v2

latestOpenAPI 3.1.02026-08-075421692.0 MB
Discord

Create a Discord guild role

Creates a new role in the guild.

Requires the bot to hold the Manage Roles permission. Guilds that added the Zernio bot before role management shipped must re-invite it, because Discord applies the permission set at invite time.

Discord's role hierarchy applies: the bot cannot create a role positioned at or above its own highest role, and cannot grant permissions it does not itself hold. Either attempt returns a 403 carrying Discord's own error.

post/v1/discord/guilds/{guildId}/roles

Path parameters

guildIdstring required

Discord guild snowflake ID

Query parameters

accountIdstring required

SocialAccount _id of the Discord account bound to this guild

Request body

namestring required
colorinteger

Decimal color (0 = no color). 0xFF0000 red is 16711680.

hoistboolean

Display members with this role separately in the member list

mentionableboolean

Allow anyone to @mention this role

permissionsstring

Permissions bitfield as a stringified integer

Response

Role created.