Start a Department Shift

Starts a department shift as memberId, exactly like the department dashboard.

POST

/api/v1/server/departments/{departmentId}/shifts

Request

curl -X POST "https://api.melonly.com/api/v1/server/departments/{departmentId}/shifts" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "memberId": "7308965405773533184"
}'

Response

201

Created

{
  "data": {
    "breakTimestamps": [
      {
        "endedAt": 1794777600000,
        "startedAt": 1794777000000
      }
    ],
    "createdAt": 1794776859830,
    "endedAt": 1794790000000,
    "id": "7527830759214682112",
    "memberId": "7308965405773533184",
    "serverId": "7294057520392310784",
    "type": "7400000000000000000",
    "wave": 12
  }
}

Authorization

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

Path parameters

departmentIdstringrequired

Body

memberIdstringrequired
Member ID of the member starting the shift.
typestring | null
Shift type ID. Leave it out for the default type. Needs premium.

Response

201 Created

breakTimestampsobject[]required
Breaks taken, oldest first. See the break object.
createdAtintegerrequired
When the shift started.
idstringrequired
Shift ID.
memberIdstringrequired
Member ID of the member on shift.
serverIdstringrequired
Server ID, or department ID for department shifts.
waveintegerrequired
Activity wave the shift counts towards.
autoEndboolean | null
Whether the shift ends automatically.
endedAtinteger | null
When the shift ended. Missing while it's active.
endedBystring | null
Member ID of who ended it, if not the member.
typestring | null
Shift type ID. Missing for the default type.

Errors

StatusMeaning
400Invalid request. validation_failed lists each invalid field in details.fields.
401Missing, invalid or expired token
403The member cannot start this shift type
404Not found
409The member already has an active shift
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