Replace permissions on a role
/api/v1/roles/{id}/permissionsReplaces the role's entire permission set with the supplied permission_keys (a full overwrite, not a merge). Every key must exist in the Environment's catalog or the call returns 404, and system-source permissions cannot be attached to a custom role (400). Returns 200 with a { message } confirmation, requires the rbac.manage_roles permission, and emits a role.permissions_updated audit event.
Authentication
Bearer Token
Authorization Option A JWT access token. Never send alongside X-API-Key: a request carrying both is refused.
API Key
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 Request body
application/json
permission_keysstring[] Required Responses
application/json
data *MessageResponseDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Returned object
curl -X PUT "https://auth.canopy-io.com/api/v1/roles/value/permissions" \ -H "X-API-Key: $CANOPY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "permission_keys": [ "string" ] }'
{ "data": { "message": "string" } }
Tell us how we can improve this guide.