Update a custom role

Beta
<Info icon="fa-light fa-lock" className="permission-callout"> <div className="permission-callout__header"><span className="permission-callout__title"><span className="permission-callout__label">Required permissions</span> <span className="fern-docs-badge small blue subtle rounded-full permission-callout__beta">Beta</span></span> <span className="permission-callout__learn-more">[Learn more](/developers/api-guidelines/permissions#how-permissions-work)</span></div> `Organisation.Role` + `Update` <div className="permission-callout__roles"><span className="permission-callout__roles-label">Roles:</span> <Badge intent="info">Administrator</Badge></div> </Info> Partially updates a custom role. System roles can't be modified. When you provide `permission_ids` or `permissions`, the field replaces the existing permission list. The two fields are mutually exclusive. Retrieve the valid permissions with `GET /api/v1/organisation/{orgId}/permission`. Use `my` in place of a numeric `orgId` to target the caller's own Workspace.

Authentication

AuthorizationBearer

An auth_token should be provided to authenticate a session.

To obtain an auth_token, see the /api/v1/authenticate POST request.

Path parameters

roleIdintegerRequired>=1
Numeric identifier of the role.
orgIdinteger or enumRequired

Workspace identifier. Either a positive integer organization ID, or the literal string my to target the caller’s own Workspace.

Request

This endpoint expects an object.
namestringOptionalformat: "^[A-Za-z0-9 _\-&']+$"2-50 characters

New unique role name within the Workspace. Use letters, digits, spaces, dashes, underscores, ampersands, and apostrophes. Leading and trailing whitespace is trimmed before validation and storage. Omit the field to leave the name unchanged, because an explicit null is rejected.

descriptionstring or nullOptional2-250 characters

Free-text description of the role. Pass null to clear it, which stores an empty string. When provided, it must be 2 to 250 characters. Leading and trailing whitespace is trimmed before validation and storage.

permission_idslist of doublesOptional

When provided, replaces the existing permission list. Mutually exclusive with permissions. Deprecated or deleted permissions are rejected. Omit the field to leave assignments unchanged, and send [] to clear them, because an explicit null is rejected.

permissionslist of objectsOptional

Resource and action pairs replacing the existing permission list, resolved to permission IDs on the server. Mutually exclusive with permission_ids. Deprecated or deleted permissions are rejected. Omit the field to leave assignments unchanged, and send [] to clear them, because an explicit null is rejected.

Response

Successful response.
iddouble
Unique role identifier.
namestring
Display name of the role.
name_translation_keystring or null
Translation key for the role name. Set for system roles only.
descriptionstring

Human-readable description of the role. An empty string when no description has been set.

description_translation_keystring or null
Translation key for the role description. Set for system roles only.
user_countdouble
Number of users assigned to this role in the Workspace.
typeenum

Whether this is a system-defined role or an organization’s custom role.

is_system_roleboolean

True for built-in system roles, which can’t be modified or deleted.

permissionslist of objectsOptional
Full list of permissions assigned to this role.

Errors

400
Bad Request Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error