OverviewProductsPlatformsAPI ReferenceResources

Edit a Discord guild role

PATCHhttps://zernio.com/api/v1/discord/guilds/{guildId}/roles/{roleId}

Updates a role's name, color, hoist, mentionable flag, or permission bitfield. At least one field must be supplied. Omitted fields are left unchanged.

Requires the bot to hold Manage Roles, and the target role must sit below the bot's highest role. See the create-role operation for the re-invite requirement.

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Path parameters

guildIdstringRequired

Discord guild snowflake ID

roleIdstringRequired

Discord role snowflake ID

Query parameters

accountIdstringRequired

SocialAccount _id of the Discord account bound to this guild

Body

application/json
Optional parameters5 fields
namestring, max 100
colorinteger
hoistboolean
mentionableboolean
permissionsstring

Permissions bitfield as a stringified integer

Responses

Success· the request worked

Errors· the request failed

PATCH/v1/discord/guilds/{guildId}/roles/{roleId}
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.discord.editDiscordGuildRole({  path: {    guildId: 'guild_abc123',    roleId: 'role_abc123',  },  query: {    accountId: 'account_abc123',  },  body: {    name: 'Example',    color: 0,    hoist: false,  },});console.log(data);
{  "data": {    "id": "string",    "name": "string",    "color": 0,    "position": 0,    "permissions": "string",    "managed": true,    "mentionable": true,    "hoist": true  }}
OpenAPI specification
Was this page helpful?