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

# Read repositories

> Find installed repositories you can access and follow paginated results.

GitHub Cloud (Available for GitHub Cloud.)

Repository reads support GitHub Cloud organizations with the caller's existing access. Self-hosted instances are not supported. Use your organization's [regional REST base URL](https://docs.coderabbit.ai/api/platform-api.md#availability); examples use the US URL.

Use repository reads to find a GitHub Cloud repository installed in the selected organization. Each request checks your current access. Installing CodeRabbit on a repository does not give every organization member access to it.

## List repositories

```bash theme={null}
printf 'x-coderabbitai-api-key: %s\n' "$CODERABBIT_API_KEY" | \
  curl --fail-with-body --header @- --get \
  'https://api.coderabbit.ai/v1/repositories' \
  --data-urlencode 'page_size=50'
```

These REST examples use a user or agentic organization key, which selects its own organization. Legacy organization keys are not supported. For a workspace token, add `org_id` with the Git provider's organization ID to every request, including continuation and individual reads. See [identity and scope selection](https://docs.coderabbit.ai/api/platform-api.md).

```json theme={null}
{
  "data": [
    {
      "id": "12345678",
      "name": "api",
      "full_name": "example/api",
      "html_url": "https://github.com/example/api",
      "private": true
    }
  ],
  "next_page_token": "opaque_token_from_response"
}
```

`id` is the Git provider's repository ID. Use it for an individual repository read. `private` is the last observed visibility; `null` means visibility is unknown. Permission checks use your current access independently of that visibility field.

## Continue a listing

Pass the returned `next_page_token` as `page_token`. Keep the same credential, organization, and `page_size` for every page.

```bash theme={null}
printf 'x-coderabbitai-api-key: %s\n' "$CODERABBIT_API_KEY" | \
  curl --fail-with-body --header @- --get \
  'https://api.coderabbit.ai/v1/repositories' \
  --data-urlencode 'page_size=50' \
  --data-urlencode "page_token=$NEXT_PAGE_TOKEN"
```

* `page_size` accepts 1–100 and defaults to 50.
* Continue until `next_page_token` is `null`, including when a page's `data` array is empty. A page can contain only repositories you cannot access.
* Tokens expire after 10 minutes. An expired token, changed page size, or different caller returns `400 invalid_request`; restart without a token.
* Results are a live listing, not a snapshot. Changes to repository names, installations, or access between requests can move or remove entries. Deduplicate by `id` when collecting a listing.

## Read one repository

```bash theme={null}
printf 'x-coderabbitai-api-key: %s\n' "$CODERABBIT_API_KEY" | \
  curl --fail-with-body --header @- \
  'https://api.coderabbit.ai/v1/repositories/12345678'
```

The response is one repository object. A repository outside the selected installation, or one you cannot read, returns `404 not_found`.

## Use the CLI

Use CodeRabbit CLI **0.9.4 or later**. After signing in with an API key, these commands return the same JSON as the API:

```bash theme={null}
coderabbit api repositories list --page-size 50

coderabbit api repositories get 12345678
```

Continue a listing with `--page-token`. To use a user or workspace key without changing your saved login, use [API key-file support](https://docs.coderabbit.ai/api/platform-authentication.md#use-the-same-key-with-api-mode). Workspace tokens also require `--org-id`.

## Use MCP

Hosted MCP provides `list_repositories` and `get_repository` with the same fields for US organizations. Both require `account:read` and `repositories:read` consent. Existing profile and pull-request permissions do not grant repository inventory access. The MCP connection fixes the organization; tool arguments cannot switch it.

## What's next

> [card] [List repositories](https://docs.coderabbit.ai/api-reference/platform-repositories-list)
>
> Explore pagination and the repository response schema.

> [card] [Read a repository](https://docs.coderabbit.ai/api-reference/platform-repositories-get)
>
> Look up one repository by its Git provider ID.

> [card] [Read pull requests](https://docs.coderabbit.ai/api/platform-pull-requests.md)
>
> Inspect current pull-request metadata, checks, and review threads.


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