Rename or describe an organization's own role
/api/v1/organizations/{id}/roles/{roleId}Changes the name or description of a role the organization owns. The Environment's roles are refused (403 organization.role_not_owned). Send If-Match with the role's version to refuse a stale write (409 version_mismatch). Requires rbac.manage_roles or the organization's roles delegation.
Authentication
Authorization Option A JWT access token. Never send alongside X-API-Key: a request carrying both is refused.
X-API-Key Option B API key for management-tier access. Never send alongside an Authorization header: a request carrying both is refused.
Path Parameters
idstring Required roleIdstring Required Headers
If-MatchOptimistic-lock version of the resource. Send the `version` field returned on read; the server rejects with 409 if the row has changed since.
Request body
application/json
namestring Optional descriptionobject Optional Responses
application/json
data *RoleResponseDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Errors
When the request can't be completed, the response body includes a stable error code you can branch on, and a correlation_id (also sent as the X-Correlation-Id header). Quote the correlation id when you contact support: it identifies the exact request in Canopy's logs.
organization.role_not_ownedForbiddenThe role is one of the Environment's, which every organization uses and only the developer changes. An organization changes, re-permissions or deletes only the roles it owns.
Copy the role (<code>POST /api/v1/organizations/{org_id}/roles</code> with <code>copy_from_role_id</code>) and change the copy.
role.name_takenConflictAnother role in the same tier already has this name (the Environment's roles, or the same organization's own), or an organization's role was given the name of one of the Environment's.
Choose another name, or rename the role that holds it.
version_mismatchConflictThe request sent <code>If-Match</code> with a version older than the resource's current one: somebody changed it since it was read. The error's <code>data</code> carries the resource as it now stands under <code>current</code>.
Read the resource again, show the reader what changed, and retry with the current <code>version</code>.
Returned object
curl -X PATCH "https://auth.canopy-io.com/api/v1/organizations/value/roles/value" \ -H "If-Match: "3"" \ -H "X-API-Key: $CANOPY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "description": {} }'
{ "data": { "id": "string", "name": "string", "scope": "environment", "organization_node_id": "string", "organization_name": "string", "template_id": "string", "description": "string", "is_system_role": false, "system_key": "string", "is_active": false, "created_at": "2026-04-20T12:00:00.000Z", "updated_at": "2026-04-20T12:00:00.000Z", "version": 0, "permission_count": 0, "member_count": 0, "administers": false } }
Tell us how we can improve this guide.