Shut Down a Session

Shuts down the active session as performedBy. Melonly posts the shutdown message and applies your shutdown settings: channel locks, ending everyone's shift, and shutting the ER:LC server down in game when that's turned on.

POST

/api/v1/server/sessions/{sessionId}/shutdown

Request

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

Response

200

Success

{
  "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.

Path parameters

sessionIdstringrequired

Body

performedBystringrequired
Member ID of the staff member doing this.

Response

200 Success

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
404Not found
409The session isn't active
429A session was shut down 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