Start a Session Poll

Starts a session poll as performedBy. Melonly posts it in your sessions channel so members can vote, and the session can be started once it reaches votesRequired.

POST

/api/v1/server/session-polls

Request

curl -X POST "https://api.melonly.com/api/v1/server/session-polls" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "aop": "city",
  "performedBy": "7264722635089514496",
  "votesRequired": 5
}'

Response

201

Created

{
  "data": {
    "aop": 2,
    "channelId": "1100000000000000002",
    "createdAt": 1794776000000,
    "createdBy": "7264722635089514496",
    "id": "7527990000000000000",
    "messageId": "1300000000000000000",
    "serverId": "7294057520392310784",
    "status": 0,
    "statusUpdatedAt": 1794776000000,
    "voterDiscordIds": [
      "1100000000000000011",
      "1100000000000000012"
    ],
    "votes": 2,
    "votesRequired": 5
  }
}

Authorization

Authorizationstringrequired
Your API token as Bearer YOUR_TOKEN. Create one in your server's dashboard settings.

Body

performedBystringrequired
Member ID of the staff member starting the poll. Needs the Manage Sessions permission and a linked Discord account.
aopstring | null
Area of play. custom needs customAopId from the session settings.
Allowed values:nonecitycountyhighrockcustom
customAopIdstring | null
The custom AOP to use when aop is custom.
scheduledStartTimeinteger | null
When the session is planned for, shown on the poll. Must be within the next 3 days.
votesRequiredinteger | null
1-1000. Defaults to the server's defaultMinVotes.

Response

201 Created

createdAtintegerrequired
When it was created.
createdBystringrequired
Member ID of who started it, or SYSTEM.
idstringrequired
Unique ID.
serverIdstringrequired
Server ID.
statusintegerrequired
0 Voting, 1 Enough votes, 2 Cancelled, 3 Expired, 4 Session started.
statusUpdatedAtintegerrequired
When status last changed.
voterDiscordIdsstring[]required
Discord IDs of everyone who voted.
votesintegerrequired
Votes so far.
votesRequiredintegerrequired
Votes needed before the session can start.
aopinteger | null
Area of play the session will use: 1 City, 2 County, 3 Highrock, 4 Custom (see aopCustomId).
aopCustomIdstring | null
The custom AOP, when aop is 4.
cancelledBystring | null
Member ID of who cancelled it.
channelIdstring | null
Discord channel of the poll message.
messageIdstring | null
Discord ID of the poll message.

Errors

StatusMeaning
400Invalid request. validation_failed lists each invalid field in details.fields.
401Missing, invalid or expired token
403Success
409A poll is already active, or sessions are turned off
429Rate limited. See Retry-After and details.
500Internal server error
502next did not confirm the write. Check whether it applied before retrying.
503Write endpoints are not configured on this deployment