CodeRabbit
By integrating CodeRabbit with DX, you can import CodeRabbit’s AI code review metrics—per-pull-request review activity, comment breakdowns, and daily user activity—and link it to the rest of your DX data to analyze impact. Please refer to the API documentation below and our schema explorer to see what data DX imports—note that DX does not read or access your source code.
Prerequisites
To connect CodeRabbit to DX, you need:
- a CodeRabbit Enterprise plan. The CodeRabbit API is only available to Enterprise subscribers; other plans return a
403 Forbidden(API access requires an Enterprise plan subscription). - an API key created from the CodeRabbit dashboard by an organization admin.
- a workspace API key if your CodeRabbit workspace has SSO enabled. CodeRabbit has deprecated organization-level API keys for user and seat management on SSO-enabled workspaces, so an organization-level key is rejected on
/v1/userswith a403 Forbidden(SSO_WORKSPACE_ORG_KEY_FORBIDDEN). Metrics endpoints still accept an organization-level key, so the key type only surfaces on the user and seat data DX requires.
Setup instructions
Follow the steps below to connect CodeRabbit to DX.
Step 1
Create a CodeRabbit API key:
- Sign in to the CodeRabbit dashboard as an organization admin.
- Open your Organization Settings.
- Go to the API Keys section and create a new key.
- Give the key a name, such as DX Integration, create it, and copy the value. Store it somewhere safe—the key is only shown once.
If your workspace has SSO enabled, create a workspace API key rather than an organization-level key—see the prerequisites above.
Step 2
- Navigate to the connections page in DX and select + Connection in the top right.
- Enter the API key you copied in the previous step. Refer to the information below for errors and troubleshooting.
API reference
The table below lists the specific API endpoints that are used by DX. All requests are sent to https://api.coderabbit.ai and authenticated with the x-coderabbitai-api-key header.
| Endpoint | Documentation |
|---|---|
| GET /v1/metrics/reviews | Link |
| GET /v1/users | Link |
DX imports the seat-assigned users from /v1/users and per-pull-request review metrics from /v1/metrics/reviews (windowed by merge date), including estimated review time, complexity, and comment counts broken down by severity and category. CodeRabbit users are linked to DX users via their Git provider user id.
The seat-assigned roster is the source of truth for which users DX keeps, so /v1/users is verified first when you add the connection and each time the connector syncs. If your API key loses access to it, the connection is reported as broken and is eventually disabled—reconnect with a workspace API key to resume syncing.
Errors
The table below lists potential error codes when adding a connection in DX.
| Error | Description |
|---|---|
invalid_credentials |
The API key entered is not valid, or your plan does not include API access. |
invalid_permissions |
The API key cannot read user and seat data. On SSO-enabled workspaces this means an organization-level key was used—create a workspace API key and reconnect. |
no_resources |
DX cannot access any seat-assigned users or any review metrics for your organization. |