curl --request POST \
--url https://api.coderabbit.ai/v1/users/roles \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"role": "cr_admin",
"user_ids": [
"121358802",
"22605247"
]
}
'{
"status": "success",
"succeeded": [
"121358802",
"22605247"
],
"failed": []
}{
"error": {
"code": "BATCH_SIZE_EXCEEDED",
"message": "Maximum 500 users per request"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or inactive API key"
}
}{
"error": {
"code": "NOT_ADMIN",
"message": "Only administrators can perform seat management operations"
}
}{
"error": {
"code": "LEGACY_API_KEY",
"message": "You are using a legacy API key. We are deprecating use of legacy keys. Regenerate a new API key and retry the request."
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Max 10 requests per 60 seconds"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error while listing users"
}
}Assign roles
Bulk change roles for up to 500 users. Returns partial success with details of which users succeeded or failed.
curl --request POST \
--url https://api.coderabbit.ai/v1/users/roles \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"role": "cr_admin",
"user_ids": [
"121358802",
"22605247"
]
}
'{
"status": "success",
"succeeded": [
"121358802",
"22605247"
],
"failed": []
}{
"error": {
"code": "BATCH_SIZE_EXCEEDED",
"message": "Maximum 500 users per request"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or inactive API key"
}
}{
"error": {
"code": "NOT_ADMIN",
"message": "Only administrators can perform seat management operations"
}
}{
"error": {
"code": "LEGACY_API_KEY",
"message": "You are using a legacy API key. We are deprecating use of legacy keys. Regenerate a new API key and retry the request."
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Max 10 requests per 60 seconds"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error while listing users"
}
}Change User Roles
org_id to "ALL" to apply the role change across every active organization on the instance, or pass a provider organization ID to target one organization. Organization, workspace, and legacy API keys cannot use "ALL".Authorizations
API key for authentication. You can create an API key from the CodeRabbit dashboard.
Headers
Your CodeRabbit API key
Body
Request to change user roles
CodeRabbit user role to assign
cr_admin, cr_member Array of provider user IDs
1 - 500 elementsOptional organization scope for self-hosted instance API keys. Set to ALL (case-insensitive) to apply the role change across every active organization on the self-hosted instance in one request. Set to a provider organization ID to target one organization on the self-hosted instance. Omit org_id to preserve the prior single-organization behavior. The ALL sentinel is valid only with self-hosted instance API keys; organization, workspace, and legacy keys cannot use it.
Response
Operation completed (check status field for partial failures)
Response for bulk operations with partial success model
Operation status: 'success' if all succeeded, 'partial_success' if some succeeded, 'failure' if all failed
success, partial_success, failure Array of user IDs that were successfully processed
Array of failures with error details
Show child attributes
Show child attributes
Was this page helpful?