Skip to main content
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",
  "description": "<string>",
  "is_default": false,
  "duplicate_from": "<string>",
  "permissions": [
    {
      "resource_id": "user_management"
    }
  ]
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt

Use this file to discover all available pages before exploring further.

Create Custom Role

Creates an Enterprise custom role. If is_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

x-coderabbitai-api-key
string
header
required

API key for authentication. You can create an API key from the CodeRabbit dashboard.

Body

application/json
name
string
required
Example:

"Security Reviewer"

description
string
is_default
boolean
default:false
duplicate_from
string

Role ID to copy permissions from. Defaults to cr_member when permissions are omitted.

permissions
object[]

Response

201

Custom role created