---
title: "Get review comment metrics for merged pull requests"
method: GET
path: "/v1/metrics/review-comments"
tags: ["Metrics"]
---

# Get review comment metrics for merged pull requests

`GET /v1/metrics/review-comments`

## Request

- Base URL: `https://api.coderabbit.ai`
- URL: `https://api.coderabbit.ai/v1/metrics/review-comments`
- Auth: API key in header `x-coderabbitai-api-key`

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.

## Query parameters

- `org_id` string
- `start_date` string, date, required
- `end_date` string, date, required
- `repository_ids` string
- `user_ids` string
- `organization_ids` string
- `limit` integer
- `cursor` string

## Headers

- `x-coderabbitai-api-key` string, required

## Response `200`

Review comment metrics for eligible merged pull requests

- object
  - `data` object[], required
    - `pr_url` string, required
    - `organization_id` string, required: Provider organization ID
    - `repository_id` string, required: Provider repository ID
    - `author_id` string, nullable, required: Provider PR author ID from stored PR metrics; null when unavailable
    - `merged_at` string, date-time, nullable, required: Pull request merge timestamp
    - `coderabbit_comments` object[], required: Stored findings; multiple entries may share the same posted comment URL
      - `url` string, required: Link to the posted review comment; not a unique finding identifier
      - `severity` 'critical' | 'major' | 'minor' | 'trivial' | 'info' | 'null', nullable, required: Finding severity; null for absent, unknown, or none values
      - `category` 'data_integrity_and_integration' | 'functional_correctness' | 'maintainability_and_code_quality' | 'performance_and_scalability' | 'security_and_privacy' | 'stability_and_availability' | 'null', nullable, required: Content category, not the issue type; null when absent or unknown
      - `accepted` boolean, nullable, required: Stored resolution outcome from AI detection or user confirmation, not necessarily acceptance by the PR author. False is not proof of rejection; null means unknown. This value can change after the comment is posted.
  - `next_cursor` string, nullable, required: Opaque cursor for the next page; null when no more eligible pull requests remain

## Other responses

- `400`: Invalid dates, filters, limit, cursor, or unsupported query parameters
- `401`: Invalid or missing API key
- `403`: Enterprise access required, agentic key forbidden, organization outside the permitted scope, or review comment metrics unavailable for an organization in the requested scope.
- `404`: Selected organization not found in the workspace, or no organizations match the self-hosted Git provider instance filter
- `413`: JSON response exceeds 16 MiB. Reduce limit, narrow the date window, or add filters. A single pull request's comments cannot be split across pages; excluding that pull request may be necessary.
- `429`: Request rate limit exceeded (RATE_LIMIT_EXCEEDED), active metrics query capacity reached (METRICS_BUSY), or an identical authorized query is still running (METRICS_QUERY_IN_PROGRESS). Wait at least the full Retry-After interval after receiving the response, then retry the same cursor and query parameters. Do not advance the cursor on an error. Other calls sharing the quota can cause another rejection after the wait. X-RateLimit headers are present only for RATE_LIMIT_EXCEEDED, not for the other 429 errors.
- `500`: Internal server error
- `503`: Metrics are preparing (METRICS_PREPARING), active-query admission cannot safely proceed (METRICS_UNAVAILABLE), or API quota custody cannot be proved (POLICY_SCOPE_UNAVAILABLE). Retry the same request after Retry-After when present; otherwise retry later.

## Changes

- **2026-11-06** `a9e20f8748a9`: 2 info
  - added the media type `application/json` for the response with the status `429`
  - added the media type `application/json` for the response with the status `503`
- **2026-09-10** `9e75db97dc39`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/coderabbit/apis/coderabbit-api-spec/changes/v1/metrics/review-comments/get.md)

---

[API](https://skmtc.dev/coderabbit/apis/coderabbit-api-spec.md) - [All operations](https://skmtc.dev/coderabbit/apis/coderabbit-api-spec/llms.txt) - [OpenAPI document](https://skmtc.dev/coderabbit/apis/coderabbit-api-spec/revisions/a9e20f8748a9?raw)
