Create a custom role
curl --request POST \
--url https://api.coderabbit.ai/v1/roles \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"name": "Security Reviewer",
"org_id": "<string>",
"description": "<string>",
"is_default": false,
"duplicate_from": "<string>",
"permissions": [
{
"resource_id": "user_management"
}
]
}
'Create Role
Creates an Enterprise custom role. If is_default is true, the new role becomes the subscription default and the previous default is cleared.
POST
/
v1
/
roles
Create a custom role
curl --request POST \
--url https://api.coderabbit.ai/v1/roles \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"name": "Security Reviewer",
"org_id": "<string>",
"description": "<string>",
"is_default": false,
"duplicate_from": "<string>",
"permissions": [
{
"resource_id": "user_management"
}
]
}
'Create Custom Role
Creates an Enterprise custom role. Ifis_default is true, the new role becomes the subscription default and the previous default is cleared.
You can either specify individual permissions or use duplicate_from to copy permissions from an existing role. When permissions are omitted and duplicate_from is not specified, permissions default to the cr_member role.
Requires Admin role. See Role-based access for details.
Authorizations
API key for authentication. You can create an API key from the CodeRabbit dashboard.
Body
application/json
Example:
"Security Reviewer"
Required when authenticating with a workspace-scoped API token: the git-provider organization id to target within the token's workspace. Ignored for organization and self-hosted keys.
Role ID to copy permissions from. Defaults to cr_member when permissions are omitted.
Show child attributes
Show child attributes
Response
201
Custom role created
Was this page helpful?
⌘I