melonly logomelonly logo
melonly logo
Dashboard
Log in

List Units

Lists the units in your CAD.

GET

/api/v1/server/cad/units

Request

curl -X GET "https://api.melonly.com/api/v1/server/cad/units" \
  -H "Authorization: Bearer YOUR_TOKEN"

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"
    }
  ],
  "page": 1,
  "pageSize": 10,
  "total": 1,
  "totalPages": 1
}

Authorization

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

Query parameters

pageintegerdefault: 1
1-based page number. Defaults to 1.
pageSizeintegerdefault: 10
Items per page, clamped to 1-100. Defaults to 10.
orderBystring
Field to sort by. See the endpoint description for the accepted values.
sortstring
Sort direction. Defaults to desc.
Allowed values:ascdesc

Response

200 Success. Results are paged and also include page, pageSize, total and totalPages.

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
404CAD is not set up
429Rate limited. See Retry-After and details.
500Internal server error