# CodeRabbit: API and MCP > Guides for CodeRabbit, the trust layer for agentic software development: review, prioritize, understand, and secure changes across pull requests, your IDE, CLI, and team chat. > ## Agent Instructions > Search and read these docs from your coding agent with the [CodeRabbit documentation MCP server](https://docs.coderabbit.ai/mcp). > Give your coding agent the [CodeRabbit Agent Skill](https://docs.coderabbit.ai/.well-known/agent-skills/index.json) for configuring reviews, running CLI reviews, coding tasks and API calls. ## API and MCP ### Basics - [Get started with the CodeRabbit API](https://docs.coderabbit.ai/api/index.md): Automate CodeRabbit reviews, coding tasks, scans, and administration over REST, from the CLI, or through the hosted MCP server. - [Make your first API call](https://docs.coderabbit.ai/api/quickstart.md): Create a CodeRabbit API key, check it, list your repositories, and read a pull request's review status with curl or the CLI. - [Authenticate API requests](https://docs.coderabbit.ai/api/authentication.md): Choose a CodeRabbit API key type, create the key, send it with each request, and understand which permissions it carries. - [Use workspace API tokens](https://docs.coderabbit.ai/api/workspace-api-tokens.md): Create one API token that an Enterprise SSO workspace admin can use across every organization in the workspace. - [API conventions](https://docs.coderabbit.ai/api/conventions.md): Base URLs and regions, identifiers, pagination, errors, rate limits, asynchronous operations, and versioning that every CodeRabbit API operation shares. ### Clients - [Call the API from the CLI](https://docs.coderabbit.ai/api/cli.md): Call CodeRabbit API operations from a terminal, a script, or a CI job with the CodeRabbit CLI and an API key, and get JSON back. - [CodeRabbit MCP server](https://docs.coderabbit.ai/api/mcp/index.md): Connect Claude Code, Codex, Claude, or another MCP client to CodeRabbit's MCP server so your AI agent can read pull requests and reviews, request reviews, and run coding tasks. - [CodeRabbit MCP tools](https://docs.coderabbit.ai/api/mcp/tools.md): Every tool the CodeRabbit MCP server offers, the scopes each group of tools needs, and the API operation behind each tool. ### Guides - [Review pull requests with the API](https://docs.coderabbit.ai/api/guides/pull-request-reviews.md): Find a repository and pull request, request a CodeRabbit review of the current head, follow its status, and read the summary and Change Stack it produced. - [Run coding tasks with the API](https://docs.coderabbit.ai/api/guides/coding-tasks.md): Create a Coding Agent task, follow its turns, answer its questions, review and approve its plan, work with plan feedback threads, and deliver the patch. - [Manage users, seats, and roles](https://docs.coderabbit.ai/api/guides/users-and-seats.md): List users, assign seats in bulk, set the seat assignment mode, change built-in and custom roles, add self-hosted users, and read audit logs with the CodeRabbit API. - [Export metrics, read usage, and schedule reports](https://docs.coderabbit.ai/api/guides/metrics-and-usage.md): Export review metrics as JSON or CSV, read review comment and MCP server usage metrics, check usage, credits, and usage budgets, and schedule reports with the CodeRabbit API. - [Manage Learnings with the API](https://docs.coderabbit.ai/api/guides/learnings.md): Choose between the organization Learnings operations and the Knowledge Base Learnings operations, then list, export, create, update, and delete Learnings with the CodeRabbit API. - [Export security findings and start scans](https://docs.coderabbit.ai/api/guides/security-findings.md): Read merged Security findings as JSON, CSV, or SARIF, and start scans through the CodeRabbit API. ### API reference #### Organizations and repositories - [Get the authenticated principal and selected organization (beta)](https://docs.coderabbit.ai/api/reference/get-me.md): Returns the current API key owner and selected GitHub Cloud organization without granting additional permissions. Supports user and agentic organization keys and workspace API keys. Workspace keys require either org_name or org_id and existing workspace-admin authorization. Self-hosted and legacy ke… - [List linked repositories](https://docs.coderabbit.ai/api/reference/linked-repositories-list.md): Lists manual configured candidates derived only from saved UI settings and stored automatic links filtered by saved UI settings. The manual projection approximates saved UI inheritance and overrides and normalizes at most 20 entries per settings layer. This is not a complete manual graph, effective… - [List onboarded organizations](https://docs.coderabbit.ai/api/reference/organizations-list.md): Lists active organizations in CodeRabbit. Organization API keys and providerless self-hosted user keys return their bound organization; self-hosted SCM user keys return organizations on their instance where the user has organization read permission; workspace API keys return all active organizations… - [List onboarded repositories for an organization](https://docs.coderabbit.ai/api/reference/organization-repositories-list.md): Lists repositories that CodeRabbit currently records as active for an organization. The organization_id is the CodeRabbit organization UUID returned by GET /organizations. Enterprise plan only. - [List accessible installed repositories (beta)](https://docs.coderabbit.ai/api/reference/list-repositories.md): Lists installed repositories the current user can read. For SaaS-managed GitHub Enterprise Server, use an instance user API key with a linked personal credential and pass the exact CodeRabbit organization UUID as org_id. Follow next_cursor even after an empty page and keep the same limit. - [Get an accessible installed repository (beta)](https://docs.coderabbit.ai/api/reference/get-repository.md): Returns 404 for repositories that are not installed in the selected organization or that the current user cannot read. For SaaS-managed GitHub Enterprise Server, use an instance user API key with a linked personal credential and pass the exact CodeRabbit organization UUID as org_id. #### Pull requests and reviews - [List an accessible repository's pull requests (beta)](https://docs.coderabbit.ai/api/reference/list-repository-pull-requests.md): Uses current-user repository access. Results are a live provider search: follow next_cursor even after an empty page and retain the same filters. Defaults to the linked user's open pull requests. - [Read an accessible pull request and its current checks (beta)](https://docs.coderabbit.ai/api/reference/get-repository-pull-request.md): Includes review and merge observations, with optional checks and review threads. Observations do not establish canonical CodeRabbit review completion. A head change during a read or thread continuation returns 409 head_changed. - [Read a saved Change Stack overview and layers (beta)](https://docs.coderabbit.ai/api/reference/get-pull-request-change-stack.md): Omit snapshot_id for the latest saved artifact or supply one to pin an exact retained snapshot. Outdated artifacts remain readable. Null means no saved artifact exists; this operation never starts generation. - [Read one saved Change Stack layer's diff (beta)](https://docs.coderabbit.ai/api/reference/get-pull-request-change-stack-layer-diff.md): Requires the overview snapshot_id and group-local layer ID. Returns file-paged unified patches for that exact snapshot; unavailable provider patches remain explicit. Follow next_cursor with the same parameters. No review or generation is started. - [Read the existing CodeRabbit review status for a pull request (beta)](https://docs.coderabbit.ai/api/reference/get-pull-request-review.md): Reads the existing Triage observation after checking current repository and pull-request access. Null means no usable observation is available, not proof that no review ran. The observed target commit can differ from the current provider head. Unconfirmed means progress has not been confirmed recent… - [Request a review of the current pull-request head (beta)](https://docs.coderabbit.ai/api/reference/request-pull-request-review.md): Reuses the existing manual review dispatcher after checking the caller's current repository access. Does not accept an older commit, create a new review registry, or guarantee completion. Read the current review observation afterward. - [Read the full published CodeRabbit summary (beta)](https://docs.coderabbit.ai/api/reference/get-pull-request-review-summary.md): Returns the latest published summary with machine-only payloads removed. A null summary means none was found. Its reviewed commit is unknown unless the source establishes it; the current PR head is not a summary commit identity. - [List all comments in a pull-request review thread (beta)](https://docs.coderabbit.ai/api/reference/list-pull-request-review-thread-comments.md): Returns the root comment and replies in native connection order. Follow next_cursor with the same caller, thread and limit. A changed pull-request head invalidates continuation; comments remain live and can change without a head change. This read never resolves or modifies the thread. #### Coding Agent - [Read existing autofix status for a task or pull request (beta)](https://docs.coderabbit.ai/api/reference/get-code-autofix.md): Returns the autofix watch state for a coding task or pull request, and whether autofix is available. Requires coding_agent:read. available is false when the organization has no coding agent access. A pending deliveryConflict is returned for use with the recover action. - [Enable, disable, resume or recover existing autofix (beta)](https://docs.coderabbit.ai/api/reference/set-code-autofix.md): Enables, disables, resumes or recovers autofix for a coding task or pull request, and returns the new status. The recover action requires the deliveryConflict returned by get_code_autofix. - [List accessible coding tasks (beta)](https://docs.coderabbit.ai/api/reference/list-code-tasks.md): Reads the current task index using existing visibility and product access checks. - [Create a coding task (beta)](https://docs.coderabbit.ai/api/reference/create-code-task.md): Uses the existing coding task admission, permissions, billing and product flags. Delivery initially produces a proposed patch. - [Read an accessible coding task (beta)](https://docs.coderabbit.ai/api/reference/get-code-task.md): Returns one coding task that the caller can access, with its status, turn status, repository, pull request URL and current plan version. Use plan_version with get_code_task_plan. - [Request the existing human Stop action for a coding task (beta)](https://docs.coderabbit.ai/api/reference/cancel-code-task-turn.md): Stops the current coding turn using the existing runtime cancellation owner. Pending messages follow existing pause behavior; this does not cancel reviews. - [Deliver a task patch using the caller's existing repository write authorization (beta)](https://docs.coderabbit.ai/api/reference/deliver-code-task.md): An existing connected provider grant is required; browser authorization redirects are not followed by the API. Acceptance does not imply delivery has completed. Read GET /code/tasks/{task_id} for status and pull_request_url. Uses native delivery state without a client idempotency key; read the task… - [Read a coding task's stored patch (beta)](https://docs.coderabbit.ai/api/reference/get-code-task-patch.md): A null response means the accessible task has no stored patch. An omitted large preview is identified explicitly. - [Read a stored coding plan version (beta)](https://docs.coderabbit.ai/api/reference/get-code-task-plan.md): Returns one stored version of the task's plan as Markdown, with its sha256 and approvals. Use version and sha256 in plan approval and plan comment operations. - [Approve or withdraw approval of a coding plan (beta)](https://docs.coderabbit.ai/api/reference/set-code-task-plan-approval.md): Records or withdraws the caller's approval of a specific coding task plan version and returns the plan with its approvals. Supply version and sha256 from get_code_task_plan, and set approved to true or false. Requires write access to the task. Plan authors cannot approve their own plan. - [Read feedback on a specific stored plan version (beta)](https://docs.coderabbit.ai/api/reference/list-code-task-plan-comments.md): Read GET /code/tasks/{task_id} for plan_version, then GET /code/tasks/{task_id}/plan?version={plan_version} for version and sha256. Both must match the current stored plan; a changed plan is a conflict, so reread it before retrying. Includes open and resolved threads and omits deleted comments. This… - [Replace your Plan comment text (beta)](https://docs.coderabbit.ai/api/reference/replace-code-task-plan-comment.md): Only the original author may replace a comment. Supply the complete text; existing serialized mention tokens in that text are retained, and removed tokens remove mentions. Uses the current plan version and sha256. Does not change the thread status or plan approval. - [Delete your Plan comment (beta)](https://docs.coderabbit.ai/api/reference/delete-code-task-plan-comment.md): Only the original author may delete a comment. Deleting a root comment removes its entire thread, including replies by other people; deleting a reply removes only that reply. Pass version and sha256 as query parameters, with no request body. - [Reopen a Plan feedback thread (beta)](https://docs.coderabbit.ai/api/reference/reopen-code-task-plan-comment-thread.md): Uses native task mutation permissions and the current plan version and sha256. Open feedback blocks the existing plan implementation operation. - [Reply to an existing Plan feedback thread (beta)](https://docs.coderabbit.ai/api/reference/reply-code-task-plan-comment-thread.md): Uses the current plan version and sha256. Returns the new comment ID and updated feedback. Replying does not reopen a resolved thread, approve the plan or start work. After an uncertain response, read feedback before retrying; replies have no client idempotency key. - [Resolve a Plan feedback thread (beta)](https://docs.coderabbit.ai/api/reference/resolve-code-task-plan-comment-thread.md): Uses native task mutation permissions and the current plan version and sha256. Resolution does not approve the plan or start implementation. - [Implement a stored plan after its existing readiness checks (beta)](https://docs.coderabbit.ai/api/reference/implement-code-task-plan.md): Queues implementation of the current stored plan version after native readiness and permission checks. Open Plan comments must be resolved or the plan revised first. Acceptance does not mean implementation has completed; read GET /code/tasks/{task_id} for status and GET /code/tasks/{task_id}/turns f… - [Queue a plan revision using the existing replan operation (beta)](https://docs.coderabbit.ai/api/reference/revise-code-task-plan.md): Returns the native pending-message queue. Read GET /code/tasks/{task_id} until the revision completes, then use its plan_version in GET /code/tasks/{task_id}/plan?version={plan_version}. Acceptance does not mean the revised plan is ready. - [Read questions recorded in a task's recent execution history (beta)](https://docs.coderabbit.ai/api/reference/list-code-task-questions.md): Returns recorded questions, which may already have been answered. The answer endpoint validates the current interaction with the execution owner. - [Answer an existing coding task interaction (beta)](https://docs.coderabbit.ai/api/reference/answer-code-task-question.md): Submits answers to a coding task question using its interaction_id and a map of question IDs to answers. Returns whether the answer command was accepted, duplicated, deferred or rejected. Requires write access to the task; a follow-up may require coding-agent access and billing eligibility. Provider… - [Read queued coding task messages (beta)](https://docs.coderabbit.ai/api/reference/get-code-task-queue.md): Current queued messages; this does not claim to be a durable history of all executed turns. - [List retained coding execution turns (beta)](https://docs.coderabbit.ai/api/reference/list-code-task-turns.md): Returns up to 20 retained turns, oldest first within each page. Uses the native start sequence as identity and an exclusive before_turn_start_seq cursor. - [Queue a follow-up coding message (beta)](https://docs.coderabbit.ai/api/reference/create-code-task-turn.md): Returns the native pending-message queue, not a completed turn. Read GET /code/tasks/{task_id} for current status and GET /code/tasks/{task_id}/turns for execution turns; read an individual turn for its final reply or public error. - [Read a retained coding execution turn by its native start sequence (beta)](https://docs.coderabbit.ai/api/reference/get-code-task-turn.md): Includes the retained final assistant reply for a completed turn. Result is null while running or when no final reply is retained. Failed turns expose a public error message without internal diagnostics or tool traces. #### Coding environments - [List existing repository environment assignments (beta)](https://docs.coderabbit.ai/api/reference/list-code-environment-assignments.md): Returns each repository that is assigned to a coding environment that is not archived, with the environment ID and name. Removed and replaced assignments are not included. - [List coding environments (beta)](https://docs.coderabbit.ai/api/reference/list-code-environments.md): Lists the coding environments that are not archived, most recently updated first. Each item includes its status, packages, revision and number of attached repositories. - [Create a coding environment with existing preparation behavior (beta)](https://docs.coderabbit.ai/api/reference/create-code-environment.md): Creates an environment with its packages, encrypted variables and 1 to 50 repositories, and starts environment preparation. Repositories start in the preparing status. The name is limited to 48 characters. - [Read environment configuration without secret values (beta)](https://docs.coderabbit.ai/api/reference/get-code-environment.md): Returns one environment that is not archived, with its attached repositories and variables. With repositoryAssignmentId, checks the caller's repository access and returns only that assignment. Secret variable values are returned as null. Other variable values are decrypted. - [Update environment configuration with native revision checks (beta)](https://docs.coderabbit.ai/api/reference/update-code-environment.md): Updates the name, description and packages. revision and configurationVersion must match the current environment; stale writes are rejected. A package change increments the revision and prepares a new environment snapshot. - [Archive a coding environment (beta)](https://docs.coderabbit.ai/api/reference/archive-code-environment.md): Archives a coding environment. Archived environments are not returned by list or read operations. - [Assign a repository to a coding environment (beta)](https://docs.coderabbit.ai/api/reference/add-code-environment-repository.md): Assigns a repository to the environment with its setup configuration, in the preparing status. The repository must match the organization's Git provider. Returns a conflict if the repository is already assigned and not preparing. - [Update repository setup using its native revision check (beta)](https://docs.coderabbit.ai/api/reference/update-code-environment-repository.md): Updates the setup method, scripts, startup instructions and machine size of a repository assignment. revision must match the current config revision; stale writes are rejected. - [Remove a repository environment assignment (beta)](https://docs.coderabbit.ai/api/reference/remove-code-environment-repository.md): Marks the repository assignment as removed. The environment and its other repositories do not change. - [Set an environment variable using existing encrypted storage (beta)](https://docs.coderabbit.ai/api/reference/set-code-environment-variable.md): Creates or replaces a variable by name. The value is stored encrypted, and is not returned in the response. The prepared environment snapshot stays in use. - [Delete an environment variable (beta)](https://docs.coderabbit.ai/api/reference/delete-code-environment-variable.md): Deletes one variable from the environment. #### Verify - [Stop an admitted local Verify run](https://docs.coderabbit.ai/api/reference/cancel-local-verify.md) - [Authorize a connected repository and resolve the anchor for a local capture](https://docs.coderabbit.ai/api/reference/preflight-local-verify.md) - [Read local Verify progress and scenario outcomes](https://docs.coderabbit.ai/api/reference/get-local-verify.md) - [Recover this actor's admitted local invocation after a lost response](https://docs.coderabbit.ai/api/reference/recover-local-verify.md) - [Run automated verification of local code changes](https://docs.coderabbit.ai/api/reference/start-local-verify.md): Starts a hosted CodeRabbit Verify run to test local code changes in the repository's configured execution environment. Supply request.repositoryId and branch from preflight_local_verify, a stable invocationId UUID, and the frozen source snapshot encoded as gzip+base64. Requires completed Verify onbo… - [List registered Verify repositories (beta)](https://docs.coderabbit.ai/api/reference/list-verify-repositories.md): Lists registered repositories newest first by creation time and ID, up to 100 per page. Follow next_cursor even when a page is empty: disconnected repositories are excluded without changing the page boundary. - [Register an accessible repository with an existing execution environment (beta)](https://docs.coderabbit.ai/api/reference/register-verify-repository.md): Registers a provider repository for Verify with an execution environment that must be usable for that repository. Requires Verify access and coding_agent:write. When branch is omitted, the repository's default branch is used. - [Read a Verify repository and its recent jobs (beta)](https://docs.coderabbit.ai/api/reference/get-verify-repository.md): Returns the saved Verify configuration, the journey library and the 50 most recent jobs. Use config_revision and cuj_list_revision as the expected revisions for later writes. - [Configure an existing Verify repository (beta)](https://docs.coderabbit.ai/api/reference/configure-verify-repository.md): Saves configuration only; does not start a job. Omitted optional settings remain unchanged. Read get_verify_repository for normalized saved values and the new config_revision. - [Read a Verify bug's observed history (beta)](https://docs.coderabbit.ai/api/reference/get-verify-bug-history.md): Lists observations of one canonical Verify bug across jobs, with run, branch, pull request and head SHA details. Follow next_cursor to read more pages; total and affected_run_count cover the full history. - [Read a Verify execution result (beta)](https://docs.coderabbit.ai/api/reference/get-verify-execution.md): Reads the native journey snapshot and outcome. A completed job does not imply a passing execution. Evidence excludes storage keys, sandbox paths and rejected artifacts. - [Read published Verify evidence metadata (beta)](https://docs.coderabbit.ai/api/reference/get-verify-evidence.md): Retrieves metadata for one published screenshot or video from a Verify execution. Supply repository_id, execution_id and an artifact_id from get_verify_execution's outcome.evidence. Returns the artifact title, media type, byte size, SHA-256 and a download_path relative to the CodeRabbit API origin.… - [Download published Verify evidence (beta)](https://docs.coderabbit.ai/api/reference/download-verify-evidence.md): Streams a published screenshot or video using the same API key and native repository access as metadata reads. Supports byte ranges; returns no storage keys or grants. Rejected, unpublished and non-media artifacts are unavailable. - [List current Verify findings (beta)](https://docs.coderabbit.ai/api/reference/list-verify-findings.md): Reads native current bug or testability findings for the exact branch, environment and state. Pages contain up to 50 rows ordered newest first; use the opaque next_cursor with unchanged filters. Concurrent finding updates can change page membership. - [List Verify jobs (beta)](https://docs.coderabbit.ai/api/reference/list-verify-jobs.md): Lists jobs newest first by creation time and ID. Follow next_cursor with the same filters; new jobs do not shift later pages. - [Start an existing Verify authoring, testability or execution operation (beta)](https://docs.coderabbit.ai/api/reference/start-verify-job.md): Accepts a job and returns its job_id, not a completed result. Poll get_verify_job, then read each execution with get_verify_execution for its actual verdict and evidence. - [Read a Verify job and execution statuses (beta)](https://docs.coderabbit.ai/api/reference/get-verify-job.md): Returns one job's status, branch, environment and head SHA, with the status and finding counts of each journey execution. Read get_verify_execution for an execution's verdict and evidence. - [Read observed bugs from a Verify job (beta)](https://docs.coderabbit.ai/api/reference/get-verify-job-bugs.md): Returns the bug observations recorded by one Verify job and the number of unique canonical bugs. An observation's bug_id is null until it is linked to a canonical bug. - [List registered user journeys (beta)](https://docs.coderabbit.ai/api/reference/list-verify-journeys.md): Returns the repository's registered user journeys with their revisions, positions, definitions and archived_at times. - [Create a user journey (beta)](https://docs.coderabbit.ai/api/reference/create-verify-journey.md): Adds a journey to the repository's journey library. Send the current cuj_list_revision from get_verify_repository as expected_list_revision. - [Update or archive a user journey with native revision checks (beta)](https://docs.coderabbit.ai/api/reference/update-verify-journey.md): Writes the selected journey after matching its revision and the library revision. Read list_verify_journeys and get_verify_repository again to obtain the saved definition and new revisions. - [List Verify schedules (beta)](https://docs.coderabbit.ai/api/reference/list-verify-schedules.md): Lists the repository's Verify schedules with saved configuration, latest occurrence and runtime_state. Requires coding_agent:read. has_pending_recovery reports whether a schedule change still waits for recovery. - [Read Verify schedule occurrences (beta)](https://docs.coderabbit.ai/api/reference/get-verify-schedule-history.md): Lists occurrences of one Verify schedule. Requires coding_agent:read. Follow next_cursor with the same repository, schedule and limit. - [Create, update or delete a Verify schedule with native revision checks (beta)](https://docs.coderabbit.ai/api/reference/change-verify-schedule.md): Accepts a schedule configuration change. Read list_verify_schedules for saved configuration, runtime_state and any pending recovery; schedule_id is not confirmation that a run has completed. #### Triage - [List the caller's accessible Triage changes (beta)](https://docs.coderabbit.ai/api/reference/list-triage-changes.md): Returns existing Triage observations and filters under the current viewer's product and repository access. Unknown and stale evidence retain their recorded status. - [Read an accessible Triage change (beta)](https://docs.coderabbit.ai/api/reference/get-triage-change.md): Returns the Triage detail of one change that the caller can access, including priority.revision for set_triage_change_priority. Unknown, stale and unsupported observations keep their recorded status and a null value. - [Read the recorded priority and close-candidacy history (beta)](https://docs.coderabbit.ai/api/reference/list-triage-change-history.md): Lists the recorded calculated and manual priority and close-candidacy events of one change, up to 100 per page. Filter by type. history_complete reports whether the recorded history is complete. - [Set a change's manual priority (beta)](https://docs.coderabbit.ai/api/reference/set-triage-change-priority.md): Applies p0–p3 using existing seated-user and repository authorization. Read priority.revision from change detail first. Reuse the same idempotency_key and expected_revision for an uncertain retry; duplicate commands return the latest current state. A new command against stale priority returns confli… - [List Triage rules (beta)](https://docs.coderabbit.ai/api/reference/list-triage-rules.md): Lists Triage rules with their status, revision and definition, up to 100 per page. Filter by search, status, action, repository or author. Follow nextCursor with the same filters. - [Create a Triage rule (beta)](https://docs.coderabbit.ai/api/reference/create-triage-rule.md): Uses existing rule authorization and eligibility. saveInactive creates an inert draft; activation remains subject to existing action, retention, and plan checks. - [Read a Triage rule and its definition (beta)](https://docs.coderabbit.ai/api/reference/get-triage-rule.md): Returns one Triage rule with its name, status, current revision and definition. - [Replace a Triage rule definition (beta)](https://docs.coderabbit.ai/api/reference/update-triage-rule.md): Saves a new definition for an existing Triage rule at the given revision, and returns the new revision. Uses the same authorization and eligibility checks as create_triage_rule. - [Delete a Triage rule (beta)](https://docs.coderabbit.ai/api/reference/delete-triage-rule.md): Deletes the Triage rule at the given revision. - [Read executions for a rule revision (beta)](https://docs.coderabbit.ai/api/reference/list-triage-rule-executions.md): Lists the actions that one revision of a Triage rule ran, with their status and pull request, up to 100 per page. Only pull requests in repositories the caller can access are included. Follow next_cursor with the same rule and revision. - [Activate, pause, or resume a Triage rule (beta)](https://docs.coderabbit.ai/api/reference/transition-triage-rule.md): Activates, pauses or resumes the Triage rule at the given revision, and returns its new status and revision. Activation is subject to the existing action, retention and plan checks. - [Preview existing changes matching a rule definition (beta)](https://docs.coderabbit.ai/api/reference/preview-triage-rule.md): Read-only preview. Returns matching and awaiting-assessment change IDs without executing rule actions. - [List accessible Triage teams (beta)](https://docs.coderabbit.ai/api/reference/list-triage-teams.md): Lists the GitHub teams that the caller can use in Triage, up to 100 per page. Follow next_cursor to read more pages. #### Security - [List code and secret findings (beta)](https://docs.coderabbit.ai/api/reference/list-security-findings.md): Lists merged code vulnerability and secret findings, up to 100 per page. Filter by repository, state, finding kind, severity or search text; secret_validation_status requires finding_kind=secret. HTTP clients select application/json (default), text/csv or application/sarif+json with Accept; unsuppor… - [Update a security finding (beta)](https://docs.coderabbit.ai/api/reference/update-security-finding.md): Atomically updates severity and/or state of a merged code or secret finding. Omitted fields are unchanged. Dismissal requires dismiss_reason; marking fixed requires fixed_context and records a manual resolution, without verifying a fix. Open findings can be dismissed or fixed; only dismissed finding… - [List security scan activity (beta)](https://docs.coderabbit.ai/api/reference/list-security-scans.md): Lists code scan activity. scan_mode identifies full or delta coverage. Partial coverage and unknown billing remain explicit. - [Request a security scan for an installed repository (beta)](https://docs.coderabbit.ai/api/reference/start-security-scans.md): Starts a full or delta Deep Scan of code in the installed repository identified by repository_id. A run can consume Security credits or incur authorized usage charges. Supply paid_usage_confirmation only after a billing admin explicitly approves the charge; subscription management permission is requ… #### Knowledge Base - [Read available architecture knowledge scopes (beta)](https://docs.coderabbit.ai/api/reference/get-architecture-capabilities.md): Reports whether organization-level architecture knowledge is available to the caller. Repository knowledge is listed by list_architecture_repositories. - [Read an architecture knowledge document at an observed revision (beta)](https://docs.coderabbit.ai/api/reference/get-architecture-document.md): Returns one architecture knowledge file at the revision from get_architecture_tree. Returns state stale when the revision is no longer current, too-large for files over 1 MiB, and absent when no knowledge exists. - [List repositories with architecture knowledge (beta)](https://docs.coderabbit.ai/api/reference/list-architecture-repositories.md): Lists repositories that have architecture knowledge, filtered by an optional name search. Follow next_cursor with the same search to read more pages. - [List the current architecture knowledge document tree (beta)](https://docs.coderabbit.ai/api/reference/get-architecture-tree.md): Returns the file paths and sizes of the current architecture knowledge for a repository or organization scope, with its revision. Returns state absent when no knowledge exists. Lists at most 5000 files; truncated is true when more exist. - [List connected knowledge repositories (beta)](https://docs.coderabbit.ai/api/reference/list-knowledge-connections.md): Lists the repositories connected as knowledge sources, with who connected them and when, and the plan limit on connected repositories. Preserves the existing connected-KB flag. - [Connect an installed repository as a knowledge source (beta)](https://docs.coderabbit.ai/api/reference/connect-knowledge-repository.md): Preserves the existing connected-KB flag and plan limit. A failed initial index request can leave the repository connected; read the connections before retrying. - [Disconnect a knowledge repository (beta)](https://docs.coderabbit.ai/api/reference/disconnect-knowledge-repository.md): Queues removal of the repository's indexed knowledge pages, then deletes the connection. If the removal cannot be queued, the connection stays in place. Returns not_connected if the repository is not connected. - [Request a connected repository index refresh (beta)](https://docs.coderabbit.ai/api/reference/reindex-knowledge-repository.md): Queues a new index run for a connected knowledge repository and returns queued. Returns not_connected if the repository is not connected. Does not wait for indexing to finish. - [List saved Learnings (beta)](https://docs.coderabbit.ai/api/reference/list-learnings.md): Uses the existing paginated Learning management read. Usage freshness describes recorded activity, not guaranteed live delivery. - [Create Learnings (beta)](https://docs.coderabbit.ai/api/reference/create-learnings.md): Creates one Learning for each submitted item. The request has no Learning ID, so repeating it can create duplicates. Returns the created IDs. Read each with GET /knowledge/learnings/{learning_id}. learning_ids is null when an older serving writer cannot return identity metadata; do not replay the wr… - [Read a saved Learning (beta)](https://docs.coderabbit.ai/api/reference/get-learning.md): Returns one saved Learning with its repository, author, file, line range and pull request. Returns not found when the Learning does not exist in the organization. - [Delete a Learning (beta)](https://docs.coderabbit.ai/api/reference/delete-learning.md): Deletes one Learning from the organization. - [Update a Learning (beta)](https://docs.coderabbit.ai/api/reference/update-learning.md): Replaces the text of one Learning and returns success. - [Export saved Learnings (beta)](https://docs.coderabbit.ai/api/reference/export-learnings.md): Returns the saved Learnings that match the filters, with recorded usage counts and last-used times. This operation has no page parameters; use list_learnings to read pages. - [Read available Learning filters (beta)](https://docs.coderabbit.ai/api/reference/get-learning-filters.md): Returns the repository names, files and users that can be used to filter Learnings in the organization. - [Read recorded Learning usage statistics (beta)](https://docs.coderabbit.ai/api/reference/get-learning-statistics.md): Returns the total, active, never-used and created-this-week counts for the Learnings that match the filters. Counts come from recorded usage, not guaranteed live delivery. - [List learnings for an organization](https://docs.coderabbit.ai/api/reference/learnings-list.md): 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. - [Delete a learning](https://docs.coderabbit.ai/api/reference/learnings-delete.md): Deletes a canonical learning from PostgreSQL, the LanceDB knowledge index, and patterned-learning caches. Returns 404 when the learning is not in the organization the key resolves to, including on a retry after a completed delete. Enterprise plan and learning:delete permission required. - [Update a learning](https://docs.coderabbit.ai/api/reference/learnings-update.md): Replaces canonical learning text and refreshes its LanceDB embedding. The text is trimmed and recognized credentials are redacted before persistence and indexing. Enterprise plan and learning:write permission required. #### Automations - [List accessible automations (beta)](https://docs.coderabbit.ai/api/reference/list-automations.md): Lists native workspace-visible Automation metadata. Product eligibility and visibility are unchanged; Factory authoring is not exposed. - [Create an ordinary Automation (beta)](https://docs.coderabbit.ai/api/reference/create-automation.md): Saves an ordinary Automation through native authoring and admission. The returned revision identifies the saved configuration, not completion of a scheduled run. - [Read an ordinary Automation and its editable definition (beta)](https://docs.coderabbit.ai/api/reference/get-automation.md): Use data.revision as expected_revision when updating or commanding. The definition retains native trigger and destination fields and can be supplied unchanged to update. Factory targets are not exposed. - [Replace an ordinary Automation definition at its observed revision (beta)](https://docs.coderabbit.ai/api/reference/update-automation.md): Replaces the definition of an ordinary Automation through native authoring and admission. expected_revision must match the current revision. Factory Automations return not found. The returned revision identifies the saved configuration, not completion of a run. - [Run, pause, resume, or delete an ordinary Automation (beta)](https://docs.coderabbit.ai/api/reference/command-automation.md): Uses native ownership and revision checks. run_now accepts work; poll the recorded runs for completion. - [List recorded ordinary Automation runs (beta)](https://docs.coderabbit.ai/api/reference/list-automation-runs.md): Pass next_offset as offset to continue. Run records retain the native execution evidence field names. #### Reports - [List existing report configurations (beta)](https://docs.coderabbit.ai/api/reference/list-reports.md): Lists the organization's saved report configurations with schedule time, timezone, type, disabled state and last run time. Does not return generated report content. - [Create an on-demand or scheduled report (beta)](https://docs.coderabbit.ai/api/reference/create-report.md): Saves a configuration through the existing report creator, destination authorization and scheduling behavior. ONDEMAND requests also trigger native generation; the returned ID identifies configuration, not completed report content. The separate legacy /api/v1/report.generate API retains its existing… - [Read an existing report configuration (beta)](https://docs.coderabbit.ai/api/reference/get-report.md): Returns saved configuration, not generated report content or execution status. disabled is the native schedule setting. A Teams webhook destination is returned as channel "[REDACTED]". - [Replace a recurring report configuration (beta)](https://docs.coderabbit.ai/api/reference/update-report.md): Replaces a WEEKLY or MONTHLY report through the native authorized settings operation. ONDEMAND report edits are not supported. Uses the existing destination validation and schedule ownership checks. Send TEAMS with channel "[REDACTED]" to keep the saved Teams webhook. - [Delete a report configuration (beta)](https://docs.coderabbit.ai/api/reference/delete-report.md): Deletes one owned report with the existing reports:delete permission and eligible-plan check. Returns success only when the native owner confirms that exact report was deleted. - [Enable or disable a report schedule (beta)](https://docs.coderabbit.ai/api/reference/set-report-status.md): Updates the native schedule setting. Does not report execution state, cancel an in-flight generation, or confirm report delivery. #### Configuration - [Read organization review configuration (beta)](https://docs.coderabbit.ai/api/reference/get-organization-configuration.md): Returns the organization's review settings, authored and stored YAML, inherited settings, global overrides and data opt-out state. Requires organization_settings:read. Use settings_updated_at as expected_settings_updated_at in set_organization_configuration. - [Replace organization review configuration (beta)](https://docs.coderabbit.ai/api/reference/set-organization-configuration.md): Replaces the selected organization's CodeRabbit review settings and returns updated: true. Can also update review enablement, data opt-out and stored YAML when supplied. Requires organization-settings write permission. Pass settings_updated_at from get_organization_configuration as expected_settings… - [Read workspace review configuration (beta)](https://docs.coderabbit.ai/api/reference/get-workspace-configuration.md): Returns the workspace review settings, YAML, global overrides and data opt-out state. Requires organization_settings:read. - [Read the workspace configuration-default policy (beta)](https://docs.coderabbit.ai/api/reference/get-workspace-configuration-defaults.md): Returns use_settings_as_defaults, which indicates whether the selected organization's workspace review settings are used as defaults. Available for Enterprise SSO workspaces with organization-settings read permission. - [Set the workspace configuration-default policy (beta)](https://docs.coderabbit.ai/api/reference/set-workspace-configuration-defaults.md): Sets whether the selected organization's workspace review settings are used as defaults and returns the saved use_settings_as_defaults value. Requires an Enterprise SSO workspace and workspace administrator access. - [Read repository review configuration (beta)](https://docs.coderabbit.ai/api/reference/get-repository-configuration.md): Returns the repository's review settings and YAML. inherited is true when the response holds default settings. Use settings_updated_at as expected_settings_updated_at in set_repository_configuration. - [Replace repository review configuration (beta)](https://docs.coderabbit.ai/api/reference/set-repository-configuration.md): Replaces the selected repository's CodeRabbit review settings and returns a confirmation message. Can also update review enablement and stored YAML when supplied. Requires repository-write permission and an eligible plan. Pass settings_updated_at from get_repository_configuration as expected_setting… - [Read the effective review configuration and its layers (beta)](https://docs.coderabbit.ai/api/reference/get-effective-repository-configuration.md): Uses the existing configuration preview resolver and its repository read/write and organization read permissions. Availability matches the GitHub Cloud preview feature. - [Preview effective repository configuration without saving (beta)](https://docs.coderabbit.ai/api/reference/preview-repository-configuration.md): Previews the effective CodeRabbit review configuration for a GitHub Cloud repository using the supplied settings. Returns the resolved YAML without saving changes, or complete: false with a reason if resolution fails. Requires access to the repository configuration preview. - [Read a repository's configuration source (beta)](https://docs.coderabbit.ai/api/reference/get-repository-configuration-source.md): Returns where an active GitHub Cloud repository reads its review configuration from (auto, default branch or a custom repository and branch), when the policy was last updated, and whether the caller can edit it. Requires repository_settings:read permission; MCP connections also require account:read… - [Set a repository's configuration source (beta)](https://docs.coderabbit.ai/api/reference/set-repository-configuration-source.md): Sets where a GitHub Cloud repository reads its CodeRabbit review configuration: automatic selection, its default branch, or a specified repository and branch. Returns the saved source, update time and editability. Requires organization administrator access. Pass updatedAt from get_repository_configu… #### Connections - [List accessible workspace connections (beta)](https://docs.coderabbit.ai/api/reference/list-connections.md): Lists the workspace connections that the caller can access, as metadata without credentials. - [Create a workspace connection (beta)](https://docs.coderabbit.ai/api/reference/create-connection.md): Saves a new workspace connection to the selected provider or MCP server using the supplied configuration and credentials. The saved connection can be used by CodeRabbit for its configured runtime-access or trigger-source purpose. Returns ok and connection metadata without credentials. Requires works… - [Read masked saved-connection configuration (beta)](https://docs.coderabbit.ai/api/reference/get-connection.md): Returns the metadata of one saved connection for the given connectionPurpose, or null if it does not exist. Requires workspace_integration_management:read. Credentials and secret values are not returned. - [Update a workspace connection (beta)](https://docs.coderabbit.ai/api/reference/update-connection.md): Updates the saved provider or MCP configuration for connectionId, including supplied credential changes, and can change the external access used by CodeRabbit. Supply the complete intended connection configuration. Returns ok and connection metadata without credentials. Requires workspace_integratio… - [Delete a workspace connection (beta)](https://docs.coderabbit.ai/api/reference/delete-connection.md): Deletes the workspace connection for the given connectionPurpose. Requires workspace_integration_management:delete. - [Update a connection's name or description (beta)](https://docs.coderabbit.ai/api/reference/patch-connection-metadata.md): Updates only display metadata. Existing provider configuration and stored credentials are preserved by the native save operation. GET returns credential-free metadata; PUT remains a full configuration replacement. - [Verify a saved connection and complete matching requests (beta)](https://docs.coderabbit.ai/api/reference/complete-connection-requests.md): Tests a saved runtime-access connection and, if the test passes, schedules notifications for the pending requests for its connector. If the test fails, the requests stay pending. Requires permission to manage connection requests. - [Discover tools from a configured MCP connection (beta)](https://docs.coderabbit.ai/api/reference/discover-connection-mcp-tools.md): Lists the tools advertised by the MCP server in the supplied connection configuration. Contacts that server using supplied credentials or, with connectionId, stored credentials; OAuth discovery may refresh stored tokens. Returns tool names, descriptions and schemas, or a failure code and message. Re… - [List pending workspace connection requests (beta)](https://docs.coderabbit.ai/api/reference/list-connection-requests.md): Lists pending connection setup requests in the workspace, with the connector and requesting scope. Requires permission to manage connection requests. Follow next_cursor to read more pages. - [Read an existing connection-request intent (beta)](https://docs.coderabbit.ai/api/reference/get-connection-request.md): Reads the connection request for a setup-link intent: the connector name, whether the connection is already available, and whether the caller can configure it. An expired intent returns not found. - [Submit an existing connection-request intent (beta)](https://docs.coderabbit.ai/api/reference/submit-connection-request.md): Submits the connection request for a setup-link intent and returns a confirmation message. An expired intent returns not found. - [Test a connection with existing credential and provider checks (beta)](https://docs.coderabbit.ai/api/reference/test-connection.md): Tests authentication and connectivity for the supplied provider or MCP connection configuration by contacting the configured service. Supply connectionId to use an existing saved connection's stored credentials; OAuth checks may refresh stored tokens. Returns ok with a message, or a failure code and… #### Users and roles - [List audit log entries](https://docs.coderabbit.ai/api/reference/audit-logs-list.md): Retrieve audit log entries for the organization. Supports filtering by actions, resource types, and date range. Returns paginated results with filter options. - [List organization roles (beta)](https://docs.coderabbit.ai/api/reference/list-roles.md): Requires existing Enterprise and role-management read access. Shared operations return role metadata; permission expansion and member counts remain available through the existing REST endpoint. - [Create a custom role by copying an existing role (beta)](https://docs.coderabbit.ai/api/reference/create-role.md): Creates a custom organization role with the supplied name, optional description and default-role setting, and returns the created role. Supply duplicate_from to copy an existing role. Requires Enterprise and role-management write permission. Agentic keys cannot use this operation. - [Read a role and its permissions (beta)](https://docs.coderabbit.ai/api/reference/get-role.md): Returns one system or custom role with its metadata and permissions. Requires the Enterprise plan and role-management read access. - [Delete an unassigned custom role (beta)](https://docs.coderabbit.ai/api/reference/delete-role.md): Deletes a custom role that is not assigned to any member. System roles cannot be deleted. Requires the Enterprise plan and role-management write access. - [Update a custom role (beta)](https://docs.coderabbit.ai/api/reference/update-role.md): Shared operations require a complete name and permission set, matching the native role editor. Existing REST partial updates remain unchanged. - [List supported role permissions (beta)](https://docs.coderabbit.ai/api/reference/list-role-permission-options.md): Returns the resource IDs and access types (read, write, delete) that can be used in role permissions. Requires the Enterprise plan and role-management read access. - [List all users in the organization](https://docs.coderabbit.ai/api/reference/list-users.md): Retrieve all users in the organization with their seat assignment status and role information. Rate limited to 10 requests per 60 seconds per organization. - [Add users and assign seats for a self-hosted organization (beta)](https://docs.coderabbit.ai/api/reference/add-users.md): Add up to 500 provider-identified users to a self-hosted organization and assign seats. Requires an Enterprise plan and administrator access; self-hosted organization keys retain their existing administrator exemption. SSO-managed workspaces are unsupported; use POST /v1/users/seats with workspace m… - [Change roles for multiple users](https://docs.coderabbit.ai/api/reference/change-roles.md): Bulk change roles for users in the organization. Supports up to 500 users per request. Cannot modify billing admin roles. Rate limited to 10 requests per 60 seconds with max 3 concurrent requests per organization. - [Assign or unassign seats for multiple users](https://docs.coderabbit.ai/api/reference/manage-seats.md): Bulk assign or unassign seats for users in the organization. Supports up to 500 users per request. Rate limited to 10 requests per 60 seconds with max 3 concurrent requests per organization. Organization and self-hosted API keys identify users by provider user id (user_ids); workspace-scoped API tok… - [Update the seat assignment mode](https://docs.coderabbit.ai/api/reference/update-seat-assignment-mode.md): Update the seat assignment mode for the organization. Only accessible by fully self-hosted organizations with enterprise plans. Rate limited to 10 requests per 60 seconds per organization. #### Usage and metrics - [Read permitted credit balances (beta)](https://docs.coderabbit.ai/api/reference/get-credits.md): Returns existing subscription credit balances when the caller has billing-read access. Unavailable sections are unknown, not zero. Does not grant spending authority. - [Get MCP server usage by pull request](https://docs.coderabbit.ai/api/reference/mcp-metrics.md): Returns one JSON row per merged, reviewed pull request that used MCP, with MCP servers and tools nested under servers. Join to GET /v1/metrics/reviews on pr_url. Counts are best-effort usage telemetry. Access is controlled by an organization-scoped feature flag. Pagination is in write order rather t… - [Get review comment metrics for merged pull requests](https://docs.coderabbit.ai/api/reference/review-comment-metrics.md): Returns JSON with one entry per merged pull request that has stored CodeRabbit review comment metrics. The inclusive UTC date window selects pull requests by merge date, regardless of when comments were posted. The reader selects pull requests with stored comments before applying the page limit. Con… - [Get PR metrics for organization](https://docs.coderabbit.ai/api/reference/review-metrics.md): Returns finalized pull request metrics with CodeRabbit review comments. Merged PRs use merge time and closed-unmerged PRs use close time for the requested range and cursor. Supports cursor-based pagination, paged in write order rather than by merge/close time, so a row written after your cursor alre… - [Read current usage and permitted credit balances (beta)](https://docs.coderabbit.ai/api/reference/get-usage.md): Returns the caller's existing billing-period usage and separately authorized credit balances. Unavailable sections are unknown, not zero. This read does not grant spending permission or change a budget. - [Read current usage budget policy and consumption (beta)](https://docs.coderabbit.ai/api/reference/get-usage-budget.md): Returns the workspace usage budget policy in USD cents: status, billing readiness, default member limit, enforcement start, current period and amount spent. member_usage_complete reports whether member usage is complete for the period. - [Read paginated member usage budgets (beta)](https://docs.coderabbit.ai/api/reference/list-usage-budget-members.md): Lists members with their spend, effective limit in USD cents and override state, up to 100 per page. view selects the organization member list or the override list. Follow next_cursor with the same search and view. #### Tickets - [Create a ticket](https://docs.coderabbit.ai/api/reference/create-ticket.md): Creates a Jira, Linear or GitHub issue from supplied content. Select an explicit target; Jira and Linear use an accessible read-write connection. The security_finding variant uses the repository's configured Jira or Linear destination and preserves native finding linkage; it additionally requires Se… - [Find ticket destinations](https://docs.coderabbit.ai/api/reference/get-ticket-options.md): Lists one page of Jira projects or Linear teams for an explicitly selected writable connection. Obtain connection IDs from list_connections. Follow next_cursor with the same connection and query. For Jira, supply project_key to read issue types, and issue_type to read creation-field metadata; omit c… ## OpenAPI Specs - [openapi](/openapi.json)