# CodeRabbit Agent overview Source: https://docs.coderabbit.ai/agent/index CodeRabbit Agent brings AI-powered code investigation, planning, and action into the tools where your team already works. CodeRabbit Agent is an AI agent that works where your team already communicates. From a Slack message or a Discord channel, you can ask CodeRabbit to investigate your codebase, generate an implementation plan, and open a pull request — without switching to another tool. The Agent understands your repositories, connected tools, and conversation history. It carries context across messages, retains knowledge over time, and lets multiple people steer the same task from the same thread. ## What the Agent can do * **Investigate** — Browse repository context, trace features across merged PRs and issues, and cross-reference data from connected tools like Sentry, Datadog, or Linear. * **Plan** — Generate a structured Coding Plan from a conversation thread and hand it off to a coding agent like Claude Code, Codex, or Cursor. * **Act** — After the team agrees on a direction, ask CodeRabbit to prepare and open a pull request that incorporates the full conversation context. * **Automate** — Schedule recurring tasks or trigger work from matching messages, so investigations and summaries run without manual prompting. The Agent can also write [Skills](/agent/skills): reusable procedures that persist across sessions and guide future runs through established workflows. ## Available platforms CodeRabbit Agent is available on two messaging platforms, targeting different audiences: | | Agent for Slack | Agent for Discord | | --------------------------- | ------------------------------------------- | ----------------------------------------------------------------------------------------------------- | | **Audience** | Engineering teams and organizations | Open-source communities and enabled GitLab Self-Hosted organizations | | **Repositories** | Any repositories connected to the workspace | Eligible public GitHub Cloud repositories or repositories in enabled GitLab Self-Hosted organizations | | **Availability** | Early Access | Limited Availability | | **Billing** | Billed separately by agent minutes | Unpaid during launch, with usage caps | | **Pull request authorship** | Workspace-connected Git platform account | Personal GitHub account or configured GitLab Self-Hosted credentials | ## What's next Learn how the Agent writes, stores, and reuses procedures across sessions. Set up CodeRabbit Agent in your Slack workspace and start investigating, planning, and opening pull requests from Slack threads. Bring CodeRabbit into your community or organization's Discord server to investigate and contribute from public channels. # Agent skills Source: https://docs.coderabbit.ai/agent/skills Learn how CodeRabbit Agent writes reusable procedures, stores them across sessions, and applies them to future work. An agent skill is a reusable procedure that CodeRabbit Agent writes for itself. A skill captures how to complete a repeatable task, including the steps, tools, checks, and output requirements that made the workflow successful. Durable skills let the Agent reuse working procedures instead of reconstructing the same workflow in every conversation. They are useful for recurring operational tasks, team-specific processes, and multi-step work that benefits from a consistent sequence. A skill is the best tool when a job has multiple steps that must run in a particular order, or when it is a repetitive task that gets executed often and involves similar actions each time, such as triaging a class of incoming issues or running a standard release checklist. ## How to create a skill You typically create a skill by asking the Agent to author one directly, for example after it works through a task you expect to repeat. The skill records the reusable process rather than the one-time result of the run. Skills persist across sessions, so a procedure remains available after the conversation or run that created it has ended. CodeRabbit Agent authoring a durable skill ## Using a skill In later runs, the Agent can invoke a stored skill automatically when a request matches its purpose, or you can explicitly ask the Agent to use a specific skill by name. The skill guides the Agent through the established procedure while the current conversation, repository, connected tools, and permissions provide the context for that specific run. Later runs include [automations](/slack-agent/automations), so scheduled or trigger-based recurring operational tasks can invoke the same stored skill as conversational runs. ### Skill availability in Slack In Slack, durable skills follow the same privacy boundaries as durable facts. | Slack surface | Skill availability | | ----------------------------------- | --------------------------------------------------------------------- | | Public channels and shared surfaces | Shared workspace skills are available across public-channel workflows | | Private channels | Skills are isolated to that private conversation | | DMs and group DMs | Skills are isolated to that DM or group DM | Create the skill from the Slack surface where you intend to use it. Skills created in private channels, DMs, or group DMs are not available in public-channel workflows. ## Viewing saved skills Review saved skills in the web app under [**Slack** > **Knowledge base** > **Skills**](https://app.coderabbit.ai/slack/knowledge-base/skills), alongside the [durable facts](/slack-agent/knowledge-base) captured in the same workspace or private conversation. Skills can be edited by asking CodeRabbit Agent in chat to update, correct, or remove the procedure. ## What's next Run saved skills on a schedule or in response to matching events. Learn how durable facts give the Agent reusable knowledge alongside durable procedures. Install static SKILL.md packages for compatible coding agents. # Audit Logs Source: https://docs.coderabbit.ai/api-reference/audit-logs get /v1/audit-logs Returns a paginated list of organization-level audit log entries. Requires the Enterprise plan, Admin role, and a non-agentic API key. Returns a paginated list of organization-level audit log entries. Use the `search`, `actions`, `resource_types`, `date_from`, and `date_to` query parameters to filter results. Unknown query parameters are rejected with a `400` error. For a guided overview of the feature, see the [Audit Logs documentation](/management/audit-logs). # Learnings Source: https://docs.coderabbit.ai/api-reference/learnings-list get /v1/learnings Programmatic access to an organization's CodeRabbit learnings. Returns paginated JSON or a CSV download. Enterprise plan only. Mirrors the auth, rate-limit and response-size contract of the Metrics public API. Programmatic access to an organization's CodeRabbit learnings. Returns paginated JSON or a CSV download. Use the `repository_ids`, `user_ids`, `organization_ids`, `limit`, and `cursor` query parameters to filter and paginate results. ## CSV Format When using `format=csv`, the API returns a flat CSV structure with one row per learning. For the complete list of CSV columns and field descriptions, see [Data Export - Exported fields](/guides/data-export#exported-fields). For a guided overview of learnings, see the [Learnings documentation](/knowledge-base/learnings). # Metrics Data Source: https://docs.coderabbit.ai/api-reference/metrics-data-api get /v1/metrics/reviews Access CodeRabbit metrics data programmatically via REST API. Returns metrics for merged pull requests including complexity scores, review times, and comment breakdowns by severity and category. ## CSV Format When using `format=csv`, the API returns a flat CSV structure with one row per pull request. The nested `coderabbit_comments` object is flattened into individual columns (e.g., `total_coderabbit_comments_posted`, `critical_comments_accepted`). For the complete list of CSV columns and field descriptions, see [Data Export - Exported fields](/guides/data-export#exported-fields). # Report generate Source: https://docs.coderabbit.ai/api-reference/report-generate post /api/v1/report.generate DEPRECATED: Generate a developer activity report based on the provided parameters and date range. This endpoint may take up to 10 minutes to respond depending on the data volume. Prompts cannot be used and this is only for testing purposes. We recommend creating a recurring report and triggering a preview via the UI instead. # Create Role Source: https://docs.coderabbit.ai/api-reference/roles-create post /v1/roles Creates an Enterprise custom role. If is_default is true, the new role becomes the subscription default and the previous default is cleared. ## 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](/management/roles) for details. # Delete Role Source: https://docs.coderabbit.ai/api-reference/roles-delete delete /v1/roles/{roleId} Deletes an Enterprise custom role when it is not assigned to any organization members. System roles cannot be deleted. ## Delete Custom Role Deletes an Enterprise custom role when it is not assigned to any organization members. System roles cannot be deleted. Requires **Admin** role. See [Role-based access](/management/roles) for details. # Get Role Source: https://docs.coderabbit.ai/api-reference/roles-get get /v1/roles/{roleId} Retrieves one built-in or Enterprise custom role. ## Get Role Details Retrieves one built-in or Enterprise custom role. Use the `include_permissions` and `include_user_count` query parameters to include additional details in the response. For more information, see [Role-based access](/management/roles). # List Roles Source: https://docs.coderabbit.ai/api-reference/roles-list get /v1/roles Lists built-in roles and Enterprise custom roles for the authenticated organization. Lists built-in roles and Enterprise custom roles for the authenticated organization. Use the `role_type` query parameter to filter by role type, and include `permissions` or `user_count` in the response as needed. For more information, see [Role-based access](/management/roles). # Role permissions Source: https://docs.coderabbit.ai/api-reference/roles-permissions get /v1/roles/permissions Lists the valid resource_id and access_type values that can be used when creating or updating Enterprise custom roles. Lists the valid `resource_id` and `access_type` values that can be used when creating or updating Enterprise custom roles. For more information, see [Role-based access](/management/roles). # Update Role Source: https://docs.coderabbit.ai/api-reference/roles-update patch /v1/roles/{roleId} Updates custom role metadata, permissions, or default status. System roles are immutable. Omitting is_default preserves the current default status; true clears any previous default; false unsets this role as default. ## Update Custom Role Updates custom role metadata, permissions, or default status. System roles are immutable. When updating `is_default`: omitting it preserves the current default status, `true` sets this role as default (clearing any previous default), and `false` unsets this role as default. Requires **Admin** role. See [Role-based access](/management/roles) for details. # Assign roles Source: https://docs.coderabbit.ai/api-reference/users-change-roles post /v1/users/roles Bulk change roles for up to 500 users. Returns partial success with details of which users succeeded or failed. ## Change User Roles Requires **Admin** role. See [Role-based access](/management/roles) for details. **Self-hosted enterprise customers** using a workspace-wide API key can set `org_id` to `ALL` to apply the role change to every active organization on that instance. The write runs per organization and is not atomic, so a user is reported successful only if the change succeeds in every organization. Other key types and customers cannot use `ALL` and receive a `400` error. # Users Source: https://docs.coderabbit.ai/api-reference/users-list get /v1/users List all users in your organization with optional filtering by seat assignment and role status. Supports cursor-based pagination. ## Users List Requires **Admin** role. See [Role-based access](/management/roles) for details. # Seats Source: https://docs.coderabbit.ai/api-reference/users-manage-seats post /v1/users/seats Bulk assign or unassign seats for up to 500 users. The request format depends on the type of API key used. **Organization and self-hosted instance API keys** address users by provider user ID with the `action` + `user_ids` format, where the `action` field determines the operation type. **Workspace API keys** address users by email or CodeRabbit user ID (`cr_user_id`) with the `members` format, where each entry declares its desired seat state via `seat_assigned`. Sending the `action` + `user_ids` format with a workspace API key (or the `members` format with an organization key) fails with an `INVALID_REQUEST` error. ## Manage Seats Requires **Admin** role. See [Role-based access](/management/roles) for details. ### Request format by API key type The request body schema depends on the type of API key you authenticate with: | API key type | Request format | Users addressed by | | -------------------- | --------------------- | --------------------- | | Organization | `action` + `user_ids` | Provider user ID | | Self-hosted instance | `action` + `user_ids` | Provider user ID | | Workspace | `members` | Email or `cr_user_id` | Workspace API keys do not accept the `action` + `user_ids` format — sending it fails with `INVALID_REQUEST: Invalid input: expected array, received undefined`. Use the `members` format instead, where each entry declares its desired seat state with `seat_assigned`. ```bash theme={null} curl --request POST \ --url 'https://api.coderabbit.ai/v1/users/seats' \ --header 'x-coderabbitai-api-key: ' \ --header 'content-type: application/json' \ --data '{"members":[{"email":"user@example.com","seat_assigned":true}]}' ``` Each member entry is identified by `email` or `cr_user_id` (the `user_id` returned by [`GET /v1/users`](/api-reference/users-list)) — at least one is required, and `cr_user_id` takes precedence when both are provided. Use `cr_user_id` to address members who have no email; unknown IDs fail that entry with `USER_NOT_FOUND` in the response's `failed` array. # Seat Assignment Mode Source: https://docs.coderabbit.ai/api-reference/users-seat-assignment-mode post /v1/users/seats/assignment Update the seat assignment mode for the organization. Only accessible by fully self-hosted organizations with enterprise plans. ## Update Seat Assignment Mode To retrieve the current seat assignment mode, use the [Users](/api-reference/users-list) endpoint. The seat assignment mode is included in the response. Requires **Admin** role. See [Role-based access](/management/roles) for details. Only available for **fully self-hosted** organizations. See [Seat assignment](/management/seat-assignment) for details on assignment modes. # CodeRabbit API Source: https://docs.coderabbit.ai/api/index Authenticate with the CodeRabbit API and find endpoints for metrics, learnings, users, roles, and audit logs. The CodeRabbit API provides programmatic access to review data and administrative operations. Use it to retrieve metrics and learnings, manage users and roles, or export audit logs. ## Base URL and authentication Send API requests to `https://api.coderabbit.ai`. Authenticate with the `x-coderabbitai-api-key` header: ```bash theme={null} curl "https://api.coderabbit.ai/v1/users" \ -H "x-coderabbitai-api-key: $CODERABBIT_API_KEY" ``` The data and operations available to a request depend on the key's scope: * **Organization-scoped API keys** are bound to one CodeRabbit organization. * **Workspace API tokens** let Enterprise SSO workspace admins call supported endpoints across organizations in a workspace. * **Self-hosted instance API keys** operate within a self-hosted CodeRabbit instance. Review each endpoint's requirements before sending a request. Workspace API tokens have additional organization-scoping rules for some endpoints. ## Explore the API Create a workspace-scoped token and review its endpoint-specific request requirements. Retrieve pull request metrics and CodeRabbit learnings for reporting or analysis. List users, manage seats, and configure seat assignment. List, create, update, and assign roles. Export administrative activity for security and compliance workflows. ## What's next Set up one token for supported APIs across an Enterprise SSO workspace. Review endpoint parameters, request bodies, and response schemas. # Workspace API tokens Source: https://docs.coderabbit.ai/api/workspace-api-tokens Create and use workspace-scoped API tokens for Enterprise SSO workspaces. Workspace API tokens let Enterprise SSO workspace admins use one token across every organization in the workspace for supported public APIs. ## Availability Workspace API tokens are available only in Enterprise SSO workspaces. Open **Workspace Settings** > **API Tokens** or go to `/workspace/api-keys` in the CodeRabbit app. Only workspace admins can create, list, or delete workspace API tokens. Non-admin workspace members cannot manage tokens, and CodeRabbit re-checks workspace admin access every time a workspace token is used. ## Create a token In the CodeRabbit app, open **Workspace Settings** > **API Tokens**. Choose **Create API token**, enter a name, and select an expiration date. Copy the token value immediately. CodeRabbit shows the token only once. Use the token with the `x-coderabbitai-api-key` header: ```bash theme={null} curl "https://api.coderabbit.ai/v1/users" \ -H "x-coderabbitai-api-key: $CODERABBIT_WORKSPACE_API_KEY" ``` ## Supported APIs Workspace API tokens are supported on these public APIs: | API | Workspace token behavior | | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- | | [`GET /v1/users`](/api-reference/users-list) | Omit `org_id` for a workspace-wide people view, or pass `org_id` to return users for one organization. | | [`POST /v1/users/seats`](/api-reference/users-manage-seats) | Manage seats workspace-wide by email address. Do not pass `org_id`. | | [`POST /v1/users/roles`](/api-reference/users-change-roles) | Pass `org_id` in the request body to select the target organization. | | [`/v1/roles`](/api-reference/roles-list) | Pass `org_id` in the query string for `GET` and `DELETE` requests, and in the request body for `POST` and `PATCH` requests. | | [`GET /v1/audit-logs`](/api-reference/audit-logs) | Omit `org_id` for workspace-wide audit logs, or pass `org_id` to scope the result to one organization. | | [`GET /v1/metrics/reviews`](/api-reference/metrics-data-api) | Omit `org_id` for workspace-wide review metrics, or pass `org_id` to scope the result to one organization. | | [`GET /v1/learnings`](/api-reference/learnings-list) | Omit `org_id` for learnings across the workspace, or pass `org_id` to scope the result to one organization. | ## Organization scoping with `org_id` `org_id` is the Git provider organization ID for an organization inside the token's workspace. It controls which organization a workspace token targets: * **Endpoints that require `org_id`** (`POST /v1/users/roles` and the `/v1/roles` operations) act on the single organization you name. CodeRabbit returns `400` when a required `org_id` is omitted, `404` when the ID does not match an active organization in the workspace, and `403` when the token owner is no longer a workspace admin. * **Endpoints that omit `org_id`** (users, seats, audit logs, review metrics, and learnings) operate workspace-wide across every organization. Pass `org_id` on the read endpoints to scope the result to one organization instead. Other key types treat `org_id` differently: * **Organization-scoped API keys** remain bound to their authenticated organization and ignore `org_id`. * **Self-hosted instance API keys** ignore `org_id` on the workspace-token read and custom-role endpoints above. The one exception is `POST /v1/users/roles`, which accepts a self-hosted-only `"ALL"` sentinel—see [Assign roles](/api-reference/users-change-roles) for details. ## What's next Explore request parameters and response schemas for the supported public APIs Define role permissions for organizations in your Enterprise SSO workspace Track administrative activity across the workspace # Claude Code integration Source: https://docs.coderabbit.ai/cli/claude-code-integration AI-powered code review in Claude Code through the CodeRabbit plugin. Let AI code, review, and fix issues autonomously without human intervention. ## Autonomous AI development workflows The CodeRabbit plugin for Claude Code creates autonomous AI development workflows. Claude Code can trigger CodeRabbit reviews directly through simple commands, enabling you to build features, run code reviews, and fix issues without manual intervention. This integration makes AI coding more independent, with built-in quality gates that catch issues before they reach production. This guide covers integrating CodeRabbit CLI with Claude Code. For standalone CLI usage, see [CLI overview](/cli/). **Windows users:** Claude Code requires WSL (Windows Subsystem for Linux) to run on Windows. See our [WSL on Windows guide](/cli/wsl-windows) for setup instructions before proceeding with this integration. CodeRabbit analyzes your code changes and surfaces specific issues, then Claude Code applies fixes based on CodeRabbit's context-rich feedback. ## Why integrate these tools CodeRabbit spots race conditions, memory leaks, and logic errors that generic linters miss. Same pattern recognition that powers our PR reviews. Claude Code implements fixes with full context from CodeRabbit's analysis. Complex architectural changes handled intelligently. CodeRabbit provides Claude Code with succinct context about issues, including location, severity, and suggested approaches. Stay in development flow - run reviews, apply fixes, and iterate without switching tools or losing mental context. ## Video demo See CodeRabbit CLI in action with Claude Code: