Modify Roles

Modify Roles

Add, remove, or toggle a role (optionally temporary)

Fields

FieldTypeRequiredDescription
operationenum: add | remove | toggleyestoggle inverts current membership.
roleIdstringyesMust be below the bot's highest role, unmanaged, and not @everyone.
durationnumber (ms, as string) or {path} or nullnoOnly meaningful for operation 'add'. null is permanent. Re-adding an already-held role with a duration extends its expiration instead.
targetUserIdstring or {path}noCross-user write target.

Example

{
  "id": "01H8XGJVBWX7Y5Z3K9M2N4P6Q1",
  "type": "modify_roles",
  "operation": "add",
  "roleId": "123456789012345678",
  "duration": null
}

Did this page help you?