> ## 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.

# Platform API

> Use CodeRabbit through REST, the CLI, and hosted MCP with shared permissions and schemas.

GitHub Cloud (Available for GitHub Cloud.)

The Platform API exposes CodeRabbit's existing product operations through JSON over HTTPS, `coderabbit api`, and hosted MCP. Use the REST base URL for your organization's region: `https://api.coderabbit.ai/v1` for the US or `https://api.eu.coderabbit.ai/v1` for the EU. Examples below use the US base URL. Hosted MCP is available only in the US.

Start with [authentication and scope selection](https://docs.coderabbit.ai/api/platform-authentication.md), then follow a [practical workflow](https://docs.coderabbit.ai/api/platform-workflows.md). The API reference generates request fields, response schemas, and examples directly from OpenAPI.

## Availability

The shared Platform API supports GitHub Cloud organizations. Self-hosted instances are not included. Existing public REST endpoints keep their endpoint-specific provider, region, and key requirements.

Product eligibility still applies. API access does not enable a feature for an organization that cannot already use it. Existing role, repository, billing, and product checks apply to every operation.

## API surfaces

| Area | Operations |
| - | - |
| Identity and repositories | Resolve your identity; list and read installed repositories you can access. |
| Pull requests and reviews | Read PRs, checks, review observations, and threads; request a review of the current PR head. |
| Coding | Create and read tasks; inspect plans, Plan comments, patches, queued messages, and turn results; submit follow-ups, answer questions, approve or implement plans, deliver patches, and stop the current coding turn. |
| Coding environments | Manage environments, repository assignments, setup configuration, and environment variables using existing secret masking. |
| Triage | Read changes, history, and teams; manage, preview, and control rules; read rule executions. |
| Security | Read scans, findings, dependencies, SBOMs, secrets, and runtime validation; estimate or start scans and request fixes or finding-state changes. |
| Verify | Manage registered repositories, journeys, and schedules; start jobs and read executions, evidence, findings, and finding history. |
| Automations | Create, read, update, and control supported automations; read their runs. |
| Configuration and connections | Read or change supported configuration, manage connections, discover MCP tools, and handle connection requests. |
| Architecture knowledge | Browse generated repository and organization architecture documents under `/knowledge/architecture`. |
| Learnings and connected knowledge | Manage learnings and connected knowledge repositories. |
| Usage and reports | Read permitted usage, credits, budgets, and member budgets; create and read reports, replace recurring report configurations, disable schedules, and delete reports. |
| Administration | Read organizations, repositories, users, and audit logs; manage supported role definitions through REST, CLI, and MCP; manage seat assignments. |

Operations use the existing product owners. An accepted request is not a guarantee that asynchronous work completed. Follow the relevant task, job, scan, command receipt, or review observation returned by the operation.

Shared role operations use `/v1/configuration/roles` through REST, CLI, and MCP with existing permissions and Enterprise requirements. These operations return the shared role schemas described in the API reference.

## Use any operation from the CLI

Use CodeRabbit CLI **0.9.4 or later** for generic API mode. `request` accepts an API-relative path; omit `/v1` because the CLI supplies it.

```bash theme={null}
coderabbit api --api-key-file /path/to/api-key request '/code/tasks?page_size=20'
```

For a write, provide a JSON file. `--input` selects `POST` by default; use `--method` for another method.

```bash theme={null}
coderabbit api --api-key-file /path/to/api-key \
  request /code/tasks --input task.json
```

The CLI prints the server's JSON and sets a nonzero exit status for HTTP errors. It also provides [repository commands](https://docs.coderabbit.ai/api/platform-repositories.md#use-the-cli) and [pull-request commands](https://docs.coderabbit.ai/api/platform-pull-requests.md#use-the-cli). Generic API mode does not change the authentication rules of dedicated `coderabbit code` or local-review commands.

## Use hosted MCP

Hosted MCP exposes the shared operations as tools with the same input and output schemas for US organizations. The connection is bound to the approved organization and user. New tools require their requested read or write consent scopes; reconnect and approve the additional scopes when needed.

Local code review retains the existing CLI/MCP handoff. The existing URL-based pull-request tools retain their advertised inputs. Always use the tool schema shown by your client rather than converting a REST example mechanically.

## Boundaries

* Pull-request reviews target the current head. The API does not cancel PR reviews, restart a review at an older commit, or resolve review threads. Thread reads remain available. Coding-turn cancellation is a separate supported product action.
* Full workspace configuration replacement, budget changes, payment flows, and provider OAuth or consent steps remain browser handoffs where required by the existing product.
* Architecture knowledge under `/knowledge/architecture` provides read-only access to the generated codebase knowledge used by CodeRabbit. Its organization scope aggregates architecture across repositories; it is separate from organization knowledge gathered through messaging apps. `/knowledge/organization` is reserved for that separate knowledge family and has no operations in this API release.
* Architecture knowledge supports repository and document reads. It does not provide arbitrary standalone-document CRUD.
* Triage's `latest_commit_at` is currently `null`; do not interpret another observation timestamp as the commit time.
* Some existing endpoints remain key-authenticated REST operations rather than shared MCP tools: review/comment/MCP metrics, legacy bug-scan findings, and user-role changes. Use their existing reference and permitted key types. `coderabbit api request` can call them without expanding their backend permissions. Read `seat_assignment_mode` from `GET /users`; the self-hosted mode update remains `POST /users/seats/assignment`.

## Errors and asynchronous results

Shared operations return an `error` object with a stable `code` and a readable `message`. Branch on the code, not the message. Rate-limited REST requests, including CLI API mode, receive HTTP `429`; use `Retry-After` and `error.retry_after` to wait before retrying. Hosted MCP returns an `isError` tool result with `rate_limit_exceeded` and `retry_after`; its HTTP status may remain `200`. Existing legacy workspace-wide endpoints retain their documented quota scope. A `404` can mean the resource or operation is unavailable to the caller.

Use each response's documented pagination fields. For token-based pagination, continue until the continuation token is `null`; other operations use page numbers. Missing usage, progress, or review observations mean unknown, not zero or completion.

Existing public REST endpoints can retain their own response and error formats. See their individual references.

## What's next

> [card] [Authenticate to the API](https://docs.coderabbit.ai/api/platform-authentication.md)
>
> Select a credential, organization, and MCP consent scopes.

> [card] [Try an API workflow](https://docs.coderabbit.ai/api/platform-workflows.md)
>
> Follow examples for pull-request reads, coding tasks, and product operations.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.