Start a Session

Starts a session as performedBy. Melonly posts the startup message in your sessions channel, closes the active poll and pings its voters, and lifts any channel locks, just like starting one from the dashboard.

POST

/api/v1/server/sessions

Request

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

Response

201

Created

{
  "data": {
    "aop": 1,
    "createdAt": 1794776859830,
    "createdBy": "7264722635089514496",
    "fullPosted": false,
    "id": "7528000000000000000",
    "messages": [
      {
        "channelId": "1100000000000000002",
        "containsChangingVariables": true,
        "createdAt": 1794776860100,
        "messageId": "1300000000000000001",
        "type": 0
      }
    ],
    "pollId": "7527990000000000000",
    "serverId": "7294057520392310784",
    "startedAt": 1794776859830,
    "status": 0,
    "statusUpdatedAt": 1794776859830
  }
}

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 it. 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.

Response

201 Created

createdAtintegerrequired
When it was created. For scheduled sessions, when it was scheduled.
createdBystringrequired
Member ID of who started or scheduled it, or SYSTEM.
idstringrequired
Unique ID.
messagesobject[]required
Discord messages posted for the session. type is 0 Startup, 1 Shutdown, 2 Boost, 3 Server full, 4 Scheduled.
serverIdstringrequired
Server ID.
statusintegerrequired
0 Active, 1 Ended, 2 Scheduled.
statusUpdatedAtintegerrequired
When status last changed.
aopinteger | null
Area of play: 1 City, 2 County, 3 Highrock, 4 Custom (see aopCustomId).
aopCustomIdstring | null
The custom AOP, when aop is 4.
autoStartedboolean | null
Whether a scheduled session started by itself.
endedBystring | null
Member ID of who shut it down.
fullPostedboolean | null
Whether a server full message was posted.
pollIdstring | null
The poll that led to this session.
scheduledStartTimeinteger | null
When a scheduled session is due to start.
startedAtinteger | null
When the session started. Missing while it's scheduled.

Errors

StatusMeaning
400Invalid request. validation_failed lists each invalid field in details.fields.
401Missing, invalid or expired token
403Success
409A session is already active, or sessions are turned off
429A session was started in the last 30 seconds
500Internal server error
502next did not confirm the write. Check whether it applied before retrying.
503Write endpoints are not configured on this deployment