Skip to main content

Role

A role is a set of abilities members have within an organisation. Roles allow permissions to be granted to members of an organisation. Adding a role to a member will grant the member the permissions of that role.

Role Object

FieldTypeDescription
idsnowflakethe role's id
organisation_idsnowflakethe role's organisation id
namestringthe role's alias (up to 20 characters)
descriptionstringa description of the role
orderintegerthe role's order within the organisation
permissionsobject<snowflake, Permission Grant Type>permissions granted to this role

Get Role

GET /roles/{role.id}

Returns the role object for the given role id. Requires membership in the organisation that owns the role.

Error Responses
Status CodeDescription
400The role was not found
403The user is not a member of the organisation

Update Role

PATCH /roles/{role.id}

Updates a role's properties or permissions. Requires the MANAGE_ROLES permission for the organisation.

All parameters for this method are optional. Only the fields provided will be updated.

Parameters
FieldTypeDescription
aliasstringthe role's alias (up to 20 characters)
descriptionstringa description of the role
permissionsobject<string, Permission Grant Type>permissions to grant or revoke for this role
Error Responses
Status CodeDescription
400The role or organisation was not found
403The user lacks the MANAGE_ROLES permission

Delete Role

DELETE /roles/{role.id}

Deletes a role. Requires the MANAGE_ROLES permission for the organisation.

Error Responses
Status CodeDescription
400The role or organisation was not found
403The user lacks the MANAGE_ROLES permission

List Role Members

GET /roles/{role.id}/members

Returns an array of user objects that are assigned to the role. Requires membership in the organisation that owns the role.

Error Responses
Status CodeDescription
400The role was not found
403The user is not a member of the organisation