POST/role_sets/{role_set_key_or_id}/replace

Replace a role set

Replaces a role set with another role set. This is functionally equivalent to deleting the role set but allows for atomic replacement with migration support. Organizations using this role set will be migrated to the destination role set.

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

1 parameter · 2 body fields
role_set_key_or_idstringrequired
The key or ID of the role set to replace
dest_role_set_keystringrequired
The key of the destination role set
reassignment_mappingsobjectoptional
Mappings from source role keys to destination role keys. Required if members have roles that need to be reassigned.

6 status codes
200Deleted Object
objectstringrequired
idstringoptional
slugstringoptional
deletedbooleanrequired
external_idstringoptional
400Request was not successful
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
401Authentication invalid
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
403Authorization invalid
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
404Resource not found
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
422Invalid request parameters
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional

Error handling

A 400 is returned: Request was not successful. A 401 is returned: Authentication invalid. A 403 is returned: Authorization invalid. A 404 is returned: Resource not found. A 422 is returned: Invalid request parameters.