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

# List pull requests

> List an accessible repository's current pull requests.

GitHub Cloud (Available for GitHub Cloud.)

See [pagination and access rules](https://docs.coderabbit.ai/api/platform-pull-requests.md) for usage guidance.

## What's next

> [card] [Read a pull request](https://docs.coderabbit.ai/api-reference/platform-pull-requests-get)
>
> Inspect the checks, review observations, and threads for a listed pull request.

> [card] [List repositories](https://docs.coderabbit.ai/api-reference/platform-repositories-list)
>
> Find another accessible repository to browse.


## OpenAPI

````yaml get /v1/repositories/{repository_id}/pull-requests
openapi: 3.0.3
info:
  title: CodeRabbit API spec
  version: 1.0.0
servers:
  - url: https://api.coderabbit.ai
security:
  - ApiKeyAuth: []
paths:
  /v1/repositories/{repository_id}/pull-requests:
    get:
      tags:
        - Pull requests
      summary: List an accessible repository's pull requests
      description: >-
        Uses current-user repository access. Results are a live provider search:
        follow next_page_token even after an empty page and retain the same
        filters. Defaults to the linked user's open pull requests.
      operationId: list_repository_pull_requests
      parameters:
        - name: repository_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[1-9]\d*$
        - name: author
          in: query
          schema:
            type: string
            pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,38}(?:\[bot\])?$
            default: me
            description: >-
              me means the linked GitHub account; all means any author;
              otherwise supply a GitHub login.
          allowEmptyValue: true
          allowReserved: true
        - name: state
          in: query
          schema:
            enum:
              - open
              - closed
              - merged
              - all
            type: string
            default: open
          allowEmptyValue: true
          allowReserved: true
        - name: head_branch
          in: query
          schema:
            type: string
            minLength: 1
            maxLength: 255
            pattern: ^[^\s"\\]+$
            description: >-
              Exact source branch name. Combine with head_owner to distinguish
              forks; all matches remain visible.
          allowEmptyValue: true
          allowReserved: true
        - name: head_owner
          in: query
          schema:
            type: string
            pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,38}(?:\[bot\])?$
            description: Owner login of the source repository, including a fork.
          allowEmptyValue: true
          allowReserved: true
        - name: org_id
          in: query
          schema:
            type: string
            minLength: 1
            description: >-
              Git-provider organization ID. Required for workspace keys; omit
              for organization keys.
          allowEmptyValue: true
          allowReserved: true
        - name: page_size
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            description: >-
              Provider records scanned per page; defaults to 20. A short or
              empty page can have a continuation.
          allowEmptyValue: true
          allowReserved: true
        - name: page_token
          in: query
          schema:
            type: string
            minLength: 1
            maxLength: 4096
            description: >-
              Use next_page_token with the same principal, repository and
              filters. Expires after ten minutes.
          allowEmptyValue: true
          allowReserved: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPullRequests'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - invalid_request
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '401':
          description: '401'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - unauthenticated
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - forbidden
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - not_found
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '409':
          description: '409'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - head_changed
                          - conflict
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '412':
          description: '412'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - precondition_failed
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '413':
          description: '413'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - payload_too_large
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '429':
          description: '429'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - rate_limit_exceeded
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '500':
          description: '500'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        enum:
                          - internal_error
                        type: string
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '503':
          description: '503'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - unavailable
                      message:
                        type: string
                      retry_after:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        exclusiveMinimum: true
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
components:
  schemas:
    PlatformPullRequests:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: >-
                  Opaque Git-provider pull-request ID; distinct from its
                  repository-local number.
              number:
                type: integer
                minimum: 0
                maximum: 9007199254740991
                exclusiveMinimum: true
                description: Pull-request number within the repository.
              url:
                type: string
                maxLength: 2048
                format: uri
              title:
                type: string
              repository:
                type: string
                description: Current GitHub owner/repository name.
              author:
                anyOf:
                  - type: object
                    properties:
                      login:
                        type: string
                    required:
                      - login
                  - type: string
                    nullable: true
                    enum:
                      - null
              state:
                enum:
                  - open
                  - closed
                  - merged
                type: string
              draft:
                type: boolean
              head_branch:
                type: string
              head_owner:
                anyOf:
                  - type: string
                  - type: string
                    nullable: true
                    enum:
                      - null
                description: Source repository owner, or null when unavailable.
              base_branch:
                type: string
              head_sha:
                type: string
                pattern: ^[a-f0-9]{40}$
                description: Head commit observed for this read.
              base_sha:
                type: string
                pattern: ^[a-f0-9]{40}$
                description: Base commit observed for this read.
              updated_at:
                type: string
                description: Last update timestamp reported by the Git provider.
            required:
              - id
              - number
              - url
              - title
              - repository
              - author
              - state
              - draft
              - head_branch
              - head_owner
              - base_branch
              - head_sha
              - base_sha
              - updated_at
        next_page_token:
          anyOf:
            - type: string
            - type: string
              nullable: true
              enum:
                - null
        fetched_at:
          type: string
        coverage:
          type: object
          properties:
            complete:
              type: boolean
            limitations:
              type: array
              items:
                type: string
          required:
            - complete
            - limitations
        applied_filters:
          type: object
          properties:
            author:
              type: string
              pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,38}(?:\[bot\])?$
              default: me
              description: >-
                me means the linked GitHub account; all means any author;
                otherwise supply a GitHub login.
            state:
              enum:
                - open
                - closed
                - merged
                - all
              type: string
              default: open
            head_branch:
              type: string
              minLength: 1
              maxLength: 255
              pattern: ^[^\s"\\]+$
              description: >-
                Exact source branch name. Combine with head_owner to distinguish
                forks; all matches remain visible.
            head_owner:
              type: string
              pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,38}(?:\[bot\])?$
              description: Owner login of the source repository, including a fork.
            repository_id:
              type: string
              pattern: ^[1-9]\d*$
            page_size:
              type: integer
              minimum: 1
              maximum: 100
          required:
            - repository_id
            - page_size
          additionalProperties: false
      required:
        - data
        - next_page_token
        - fetched_at
        - coverage
        - applied_filters
  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.

````

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