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

# Review comment metrics

> 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. 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 in CodeRabbit Cloud. Each request must resolve to exactly one organization. Self-hosted CodeRabbit deployments are not supported.

export const EnterprisePlanBadge = ({tip = "This feature is available exclusively as part of the Enterprise plan. Please refer to our pricing page for more information about our plans and features.", title = "Enterprise Plan", cta = "Read more", href = "https://coderabbit.ai/pricing", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="building-2" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

export const DeploymentBadge = ({variant = "cloud-only", tip, title, cta = "Learn more", href = "/self-hosted/overview", disabled = false}) => {
  const isCloudOnly = variant === "cloud-only";
  const defaultTitle = isCloudOnly ? "Cloud Only" : "Self-Hosted Only";
  const defaultTip = isCloudOnly ? "This feature is available on CodeRabbit Cloud only. It is not available on self-hosted CodeRabbit deployments." : "This feature is available on self-hosted CodeRabbit deployments only. It is not available on CodeRabbit Cloud.";
  return <Tooltip tip={tip || defaultTip} cta={cta} href={href}>
        <Badge icon="rabbit" disabled={disabled || undefined}>
            {title || defaultTitle}
        </Badge>
    </Tooltip>;
};

<DeploymentBadge variant="cloud-only" /> | <EnterprisePlanBadge />

Use this endpoint for finding-level metadata. Results include each finding's severity, category, stored resolution outcome, and comment URL without returning comment text. For pull-request-level aggregates, use the [Metrics Data API](/api-reference/metrics-data-api).

Workspace API tokens can use `org_id` to select one provider organization. If `org_id` does not match an active organization in the workspace, the request returns `404`. If the workspace scope resolves to zero or multiple organizations, the request returns `403`. Organization-scoped API keys ignore this parameter.


## OpenAPI

````yaml get /v1/metrics/review-comments
openapi: 3.0.3
info:
  title: CodeRabbit API spec
  version: 1.0.0
servers:
  - url: https://api.coderabbit.ai
security:
  - ApiKeyAuth: []
paths:
  /v1/metrics/review-comments:
    get:
      tags:
        - Metrics
      summary: Get review comment metrics for merged pull requests
      description: >-
        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.
        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 in CodeRabbit
        Cloud. Each request must resolve to exactly one organization.
        Self-hosted CodeRabbit deployments are not supported.
      operationId: review-comment-metrics
      parameters:
        - in: header
          name: x-coderabbitai-api-key
          required: true
          schema:
            type: string
          description: API key for authentication
        - in: query
          name: org_id
          schema:
            type: string
          description: >-
            Workspace-scoped API tokens only. Selects one provider organization
            in the token's workspace. The resolved scope must contain exactly
            one organization; a multi-organization scope returns 403. Ignored
            for organization-scoped and Git-provider instance-scoped keys.
        - in: query
          name: start_date
          required: true
          schema:
            type: string
            format: date
            example: '2026-09-01'
          description: Inclusive UTC merge date in YYYY-MM-DD format
        - in: query
          name: end_date
          required: true
          schema:
            type: string
            format: date
            example: '2026-09-09'
          description: >-
            Inclusive UTC merge date in YYYY-MM-DD format; must not precede
            start_date
        - in: query
          name: repository_ids
          schema:
            type: string
            example: 1027529638,987654321
          description: Comma-separated provider repository IDs. Maximum 10.
        - in: query
          name: user_ids
          schema:
            type: string
            example: 87397876,12345678
          description: >-
            Comma-separated provider PR author IDs from stored PR metrics.
            Maximum 10.
        - in: query
          name: organization_ids
          schema:
            type: string
            example: 184456712,103539130
          description: >-
            Comma-separated provider organization IDs for self-hosted Git
            provider instances connected to CodeRabbit Cloud. Maximum 10 input
            values; the resolved scope must contain exactly one organization.
            Not supported for organizations without a self-hosted Git provider
            instance.
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 1000
          description: >-
            Maximum number of pull requests per page, not the number of nested
            comments
        - in: query
          name: cursor
          schema:
            type: string
          description: >-
            Opaque next_cursor from the previous response. Keep the same date
            window and filters when fetching subsequent pages.
      responses:
        '200':
          description: Review comment metrics for eligible merged pull requests
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - next_cursor
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - pr_url
                        - organization_id
                        - repository_id
                        - author_id
                        - merged_at
                        - coderabbit_comments
                      properties:
                        pr_url:
                          type: string
                          example: https://github.com/org/repo/pull/123
                        organization_id:
                          type: string
                          description: Provider organization ID
                        repository_id:
                          type: string
                          description: Provider repository ID
                        author_id:
                          type: string
                          nullable: true
                          description: >-
                            Provider PR author ID from stored PR metrics; null
                            when unavailable
                        merged_at:
                          type: string
                          format: date-time
                          nullable: true
                          description: Pull request merge timestamp
                        coderabbit_comments:
                          type: array
                          minItems: 1
                          description: >-
                            Stored findings; multiple entries may share the same
                            posted comment URL
                          items:
                            type: object
                            required:
                              - url
                              - severity
                              - category
                              - accepted
                            properties:
                              url:
                                type: string
                                description: >-
                                  Link to the posted review comment; not a
                                  unique finding identifier
                              severity:
                                type: string
                                nullable: true
                                enum:
                                  - critical
                                  - major
                                  - minor
                                  - trivial
                                  - info
                                  - null
                                description: >-
                                  Finding severity; null for absent, unknown, or
                                  none values
                              category:
                                type: string
                                nullable: true
                                enum:
                                  - data_integrity_and_integration
                                  - functional_correctness
                                  - maintainability_and_code_quality
                                  - performance_and_scalability
                                  - security_and_privacy
                                  - stability_and_availability
                                  - null
                                description: >-
                                  Content category, not the issue type; null
                                  when absent or unknown
                              accepted:
                                type: boolean
                                nullable: true
                                description: >-
                                  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:
                    type: string
                    nullable: true
                    description: >-
                      Opaque cursor for the next page; null when no more
                      eligible pull requests remain
        '400':
          description: >-
            Invalid dates, filters, limit, cursor, or unsupported query
            parameters
        '401':
          description: Invalid or missing API key
        '403':
          description: >-
            Enterprise access required, agentic key forbidden, organization
            outside the permitted scope, self-hosted CodeRabbit deployment, or
            scope resolves to zero or multiple organizations. Workspace keys can
            select one organization with org_id.
        '404':
          description: >-
            Selected organization not found in the workspace, or no
            organizations match the self-hosted Git provider instance filter
        '413':
          description: >-
            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':
          description: Metrics API rate limit exceeded
          headers:
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before retrying
        '500':
          description: Internal server error
        '503':
          description: Review comment metrics temporarily unavailable; retry later
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-coderabbitai-api-key
      description: >-
        API key for authentication. You can create an API key from the
        CodeRabbit dashboard.

````