Schedule a Session

Schedules a session as performedBy for up to 3 days ahead. Melonly posts it in your sessions channel and starts it at scheduledStartTime. A server can have one scheduled or active session at a time.

POST

/api/v1/server/sessions/scheduled

Request

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

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 scheduling it. Needs the Manage Sessions permission and a linked Discord account.
scheduledStartTimeintegerrequired
When it starts. Must be within the next 3 days.
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.
pollIdstring | null
A poll to attach, so its voters are pinged when the session starts.

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 scheduled, 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