API referenceDiscord
POST /discord/guilds/{guildId}/roles
Create a role (needs Manage Roles; it cannot sit at or above the bot's highest role)
POST
BearerAuthheader
AuthorizationBearer <token>API key sk_...
guildId*stringDiscord server (guild) id
accountId*stringDiscord account id bound to this server (or the channel's server)
application/json- body
name*stringLength
length <= 100color?integerRange
0 <= value <= 16777215hoist?booleanmentionable?booleanpermissions?stringBitfield as a string of digits
{data}
application/json- response
data?curl -X POST 'https://example.com/api/v1/discord/guilds/string/roles?accountId=string' \ -H 'Content-Type: application/json' \ -d '{ "name": "string"}'Example Response
{ "data": { "id": "string", "name": "string", "color": 0, "position": 0, "permissions": "string", "managed": true, "mentionable": true, "hoist": true }}GET /discord/guilds/{guildId}/roles GET
Every role of the server (unordered; sort by position). Every call takes accountId: a Discord account of the organization bound to that server (404 otherwise). Discord's 403 (bot permissions or role hierarchy) is passed on; servers that installed the bot before a permission was asked for must re-invite it
PATCH /discord/guilds/{guildId}/roles/{roleId} PATCH
Edit a role: at least one of name, color, hoist, mentionable, permissions