roles_modify
roles_modify
Section titled “roles_modify”Category: roles
Update a role’s properties. Pass only fields you want to change.
When to use
Section titled “When to use”- Rename, recolor, change permissions, toggle mentionability/hoist, set role icon.
When NOT to use
Section titled “When NOT to use”- Reorder roles → use
roles_modify_positions. - Delete → use
roles_delete.
permissions is a base-10 STRING (Discord permission bitfield).
| Field | Type | Required | Description |
|---|---|---|---|
guild_id | string | yes | Guild containing the role |
role_id | string | yes | Role to modify |
name | unknown | no | |
permissions | string | no | Permission bitfield as base-10 string |
color | unknown | no | |
hoist | unknown | no | |
icon | unknown | no | |
unicode_emoji | unknown | no | |
mentionable | unknown | no | |
audit_reason | string | no | Reason recorded in audit log (X-Audit-Log-Reason header) |
Returns
Section titled “Returns”\{id, name, color, position, permissions, mentionable, hoist\}.
Output schema
Section titled “Output schema”| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Discord role ID |
name | string | yes | |
color | integer | yes | |
position | integer | yes | |
permissions | string | yes | |
mentionable | boolean | yes | |
hoist | boolean | yes |
Annotations
Section titled “Annotations”| Property | Value |
|---|---|
| Read-only | no |
| Destructive | no |
| Idempotent | yes |
| Open-world | yes |
| Confirmation required | no |