melonly logomelonly logo
melonly logo
Dashboard
Log in

List Roles

Lists the roles in your server.

GET

/api/v1/server/roles

Request

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

Response

200

Success

{
  "data": [
    {
      "colour": "#11d982",
      "createdAt": 1700000000000,
      "extraPermissions": "0",
      "id": "7314779729419046912",
      "linkedDiscordRoleId": "1100000000000000000",
      "name": "WE DEM MODZ!!!!!!",
      "permissions": "6",
      "priority": 4,
      "serverId": "7294057520392310784"
    }
  ],
  "page": 1,
  "pageSize": 10,
  "total": 1,
  "totalPages": 1
}

You can order by createdAt (default), priority or id.

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.

createdAtintegerrequired
When the role was created.
extraPermissionsstringrequired
Extra permission bitfield as a decimal string.
idstringrequired
Unique ID.
namestringrequired
Role name.
permissionsstringrequired
Permission bitfield as a decimal string.
priorityintegerrequired
Rank in the role hierarchy. Higher outranks lower.
serverIdstringrequired
Server ID.
colourstring | null
Hex colour.
linkedDiscordRoleIdstring | null
Discord role kept in sync with this one.

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