Metrics

Get review comment metrics for merged pull requests

Changed on

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. Pull requests without stored comments are excluded before pagination. Pagination is in write order rather than by merge date, so a pull request written after your cursor already passed its merge date (a backfill, or a reopen/reclose) still appears on a later page instead of being silently skipped. Each nested comment entry represents a stored finding; a comment URL may occur more than once when the posted comment contains multiple findings. Comment text is not returned. Unknown query parameters, including format and status, are rejected. Available on the Enterprise plan. Self-hosted CodeRabbit deployments can use this API when configured to send metrics to CodeRabbit Cloud. Requests include all organizations authorized by the API token unless narrowed by an organization selector. Each page request consumes one token when admitted by the request rate limiter. Reviews, review comments, and MCP share the Metrics quota for the configured quota owner. With verified owner scope, coordinate calls across API keys for the same organization, workspace, or Git-provider instance; changing an organization selector does not add quota.

get/v1/metrics/review-comments

Request

  • Base URL
    https://api.coderabbit.ai
  • Auth
    API key in header x-coderabbitai-api-key

Query parameters

org_idstring

Workspace-scoped API tokens only. Selects one provider organization in the token's workspace. When omitted, includes all organizations authorized by the workspace token. Ignored for organization-scoped and Git-provider instance-scoped keys.

start_datestring date required
Example:2026-09-01

Inclusive UTC merge date in YYYY-MM-DD format

end_datestring date required
Example:2026-09-09

Inclusive UTC merge date in YYYY-MM-DD format; must not precede start_date

repository_idsstring
Example:1027529638,987654321

Comma-separated provider repository IDs. Maximum 10.

user_idsstring
Example:87397876,12345678

Comma-separated provider PR author IDs from stored PR metrics. Maximum 10.

organization_idsstring
Example:184456712,103539130

Comma-separated provider organization IDs for self-hosted Git provider instance-scoped API keys. Maximum 10 input values. When omitted, includes all authorized organizations in the instance. The filter cannot expand the scope authorized by the API token. Not supported for organization-scoped or workspace-scoped API keys.

limitinteger

Maximum number of pull requests per page, not the number of nested comments

cursorstring

Opaque next_cursor from the previous response. Keep the same date window and filters when fetching subsequent pages.

Headers

x-coderabbitai-api-keystring required

API key for authentication

Response

Review comment metrics for eligible merged pull requests

next_cursorstring nullable required

Opaque cursor for the next page; null when no more eligible pull requests remain

Example response

{
  "data": [
    {
      "pr_url": "https://github.com/org/repo/pull/123"
    }
  ]
}

Changes