List Departments

Lists your server's departments.

GET

/api/v1/server/departments

Request

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

Response

200

Success

{
  "data": [
    {
      "activated": true,
      "icon": "https://cdn.melonly.com/icons/sheriff.png",
      "id": "7392336585590575104",
      "name": "Sheriff's Office (2 deputies)",
      "serverId": "7294057520392310784",
      "type": 1
    }
  ],
  "page": 1,
  "pageSize": 10,
  "total": 1,
  "totalPages": 1
}

You can order by id (default).

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.

iconstringrequired
Icon image URL.
idstringrequired
Unique ID.
namestringrequired
Department name.
serverIdstringrequired
Server the department belongs to.
activatedboolean | null
Whether the department is active.
discordGuildIdstring | null
Discord server linked to the department.
joinCodestring | null
Code members use to join.
typeinteger | null
Department type.

Errors

StatusMeaning
400Invalid request. validation_failed lists each invalid field in details.fields.
401Missing, invalid or expired token
429Rate limited. See Retry-After and details.
500Internal server error