Set a Unit's Status

Sets a unit's status as performedBy, exactly as a dispatcher would. The unit has to be signed in to the CAD. If it's in a unit group, the whole group's status changes.

POST

/api/v1/server/cad/units/{unitId}/status

Request

curl -X POST "https://api.melonly.com/api/v1/server/cad/units/{unitId}/status" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "performedBy": "7264722635089514496",
  "status": "enroute"
}'

Response

200

Success

{
  "data": {
    "agency": "LSSD",
    "id": 12,
    "items": [],
    "loc": {},
    "location": "Postal 214",
    "name": "Builderman",
    "number": "1A-12",
    "panic": false,
    "rank": "Deputy",
    "serverId": "7294057520392310784",
    "status": 1,
    "subdivision": "Patrol",
    "userId": "7308965405773533184"
  }
}

Authorization

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

Path parameters

unitIdstringrequired

Body

performedBystringrequired
Member ID of the dispatcher. Needs the Dispatch Panel permission.
statusstringrequired
Allowed values:availableunavailablebusyenrouteonScenecustom
customStatusIdstring | null
The custom status to use when status is custom.

Response

200 Success

agencystringrequired
Agency.
idintegerrequired
Unit ID.
itemsobjectrequired
Equipment carried.
locobjectrequired
Map position.
numberstringrequired
Unit number, such as 1A-12.
panicbooleanrequired
Whether panic is active.
serverIdstringrequired
Server ID.
statusintegerrequired
Status code.
userIdstringrequired
Melonly user ID of who's on the unit.
customStatusIdstring | null
Custom status, when one is set.
locationstring | null
Location text.
namestring | null
Callsign name.
rankstring | null
Rank.
subdivisionstring | null
Subdivision.

Errors

StatusMeaning
400Invalid request. validation_failed lists each invalid field in details.fields.
401Missing, invalid or expired token
403Success
404Not found
409The unit isn't signed in, or the custom status isn't on its panel
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