POST/organization_roles/{organization_role_id}/permissions/{permission_id}

Assign a permission to an organization role

Assigns a permission to an organization role. Use the organization_role_id and permission_id path parameters to identify the role and permission to link. The response contains the updated role and its permissions.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters
organization_role_idstringrequired
The unique identifier of the organization role to assign the permission to.
permission_idstringrequired
The unique identifier of the permission to assign.

5 status codes
200Returns the updated organization role, including its identifier, name, key, description, creator eligibility, permissions, and creation and update timestamps.
objectstringrequired
Allowed:role
idstringrequired
namestringrequired
keystringrequired
descriptionstringrequired
is_creator_eligiblebooleanrequired
Whether this role is eligible to be an organization creator role
permissionsarray<object>required
created_atintegerrequired
Unix timestamp of creation.
updated_atintegerrequired
Unix timestamp of last update.
401Returned when authentication is invalid.
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
403Returned when the authenticated user is not authorized to assign the permission to the organization role.
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
404Returned when the organization role or permission does not exist.
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
409Returned when the requested permission assignment conflicts with the current resource state.
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional

Error handling

A 401 is returned when authentication is invalid, and a 403 when the authenticated user is not authorized to make the assignment. A 404 is returned when the organization_role_id path parameter or permission_id path parameter does not identify an existing resource; a 409 indicates that the assignment conflicts with the current resource state.