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

# CodeRabbit API

> Authenticate with the CodeRabbit API and find endpoints for organizations, repositories, metrics, learnings, users, roles, audit logs, and AI Deep Scan findings.

The CodeRabbit API provides programmatic access to review data, AI Deep Scan findings, and administrative operations. Use it to discover organizations and repositories, retrieve metrics and learnings, manage users and roles, or export audit logs and security findings.

## Plan requirements

API plan requirements vary by endpoint. The [AI Deep Scan code findings API](/api-reference/security-scans-code-list) is available on all plans with a non-agentic API key and the `security:read` permission, other APIs require `enterprise` plan. Check each endpoint's reference page for its plan, permission, and API-key requirements.

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

<CardGroup cols={2}>
  <Card title="Workspace API tokens" icon="key-round" href="/https/docs.coderabbit.ai/api/workspace-api-tokens">
    Create a workspace-scoped token and review its endpoint-specific request requirements.
  </Card>

  <Card title="Organizations and repositories" icon="building-2" href="/https/docs.coderabbit.ai/api-reference/organizations-list">
    Discover active organizations and the repositories available within each organization.
  </Card>

  <Card title="Metrics and learnings" icon="chart-line" href="/https/docs.coderabbit.ai/api-reference/metrics-data-api">
    Retrieve pull request metrics and CodeRabbit learnings for reporting or analysis.
  </Card>

  <Card title="AI Deep Scan findings" icon="shield-check" href="/https/docs.coderabbit.ai/api-reference/security-scans-code-list">
    Retrieve and export AI Deep Scan code findings for external security workflows.
  </Card>

  <Card title="Users and seats" icon="users" href="/https/docs.coderabbit.ai/api-reference/users-list">
    List users, manage seats, and configure seat assignment.
  </Card>

  <Card title="Roles" icon="shield-check" href="/https/docs.coderabbit.ai/api-reference/roles-list">
    List, create, update, and assign roles.
  </Card>

  <Card title="Audit logs" icon="scroll-text" href="/https/docs.coderabbit.ai/api-reference/audit-logs">
    Export administrative activity for security and compliance workflows.
  </Card>
</CardGroup>

## What's next

<CardGroup cols={1}>
  <Card title="Create a workspace API token" href="/https/docs.coderabbit.ai/api/workspace-api-tokens" icon="key-round" horizontal>
    Set up one token for supported APIs across an Enterprise SSO workspace.
  </Card>

  <Card title="Open the API reference" href="/https/docs.coderabbit.ai/api-reference/metrics-data-api" icon="braces" horizontal>
    Review endpoint parameters, request bodies, and response schemas.
  </Card>
</CardGroup>


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