> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replicas.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get pull requests

> Returns state, checks, reviews, and mergeability for up to 20 pull requests the replica opened. Get URLs from Get replica.



## OpenAPI

````yaml /openapi.json post /v1/replica/{id}/pull-requests/details
openapi: 3.1.0
info:
  title: Replicas API
  version: 2.0.0
  description: >-
    Create and control workspaces, and manage the environments, automations, and
    learnings they run with.
servers:
  - url: https://api.replicas.dev
    description: Production API
security:
  - apiKey: []
tags:
  - name: Replica
    description: >-
      A replica is a Replicas workspace: a cloud sandbox where a coding agent
      works on your repositories.
  - name: Chats
    description: Manage the agent chats inside a replica.
  - name: Message queue
    description: Messages waiting for the agent to finish its turn.
  - name: Commands and terminals
    description: Run commands and open shells in a replica.
  - name: Pull requests
    description: Inspect and act on pull requests a replica opened.
  - name: Previews
    description: Public URLs for ports in a replica.
  - name: Canvas
    description: Plans, reports, and other files agents produce.
  - name: Sharing
    description: Add replicas to members' Shared view.
  - name: Environments
    description: >-
      Environments define what a workspace starts with. The `global` environment
      applies to every workspace.
  - name: Environment variables
    description: Variables injected into workspaces.
  - name: Environment files
    description: Files written into workspaces.
  - name: Environment skills
    description: Agent skills installed into workspaces.
  - name: Environment MCPs
    description: MCP servers available to workspace agents.
  - name: Hooks
    description: Scripts that run when warm pool snapshots build and when workspaces start.
  - name: Warm pools
    description: Pre-built workspaces that start faster.
  - name: Automations
    description: Run agents on schedules and events.
  - name: Repositories
    description: Repositories and repository sets connected to the organization.
  - name: Learnings
    description: Organization skills every workspace agent loads.
  - name: Agent credentials
    description: >-
      API keys and endpoints that coding agents use. Connect Claude, Codex, and
      Muse subscriptions with the CLI.
  - name: Plugins
    description: Connect integrations that workspace agents can use.
  - name: Organization
    description: Who you are and who is in your organization.
  - name: Media
    description: Screenshots, recordings, and other files workspaces produce.
  - name: Slack
    description: Route Slack threads to workspaces.
  - name: Workspace identity
    description: OIDC keys for verifying workspace identity tokens.
paths:
  /v1/replica/{id}/pull-requests/details:
    post:
      tags:
        - Pull requests
      summary: Get pull requests
      description: >-
        Returns state, checks, reviews, and mergeability for up to 20 pull
        requests the replica opened. Get URLs from Get replica.
      operationId: getReplicaPullRequests
      parameters:
        - name: id
          in: path
          required: true
          description: Replica ID
          schema:
            type: string
            format: uuid
        - $ref: '#/components/parameters/ApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkspacePullRequestDetailsRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspacePullRequestDetailsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    ApiVersion:
      name: X-Replicas-Api-Version
      in: header
      description: >-
        API version. `2026-10-07` returns `snake_case` responses. See
        [versioning](/features/api#versioning).
      required: false
      schema:
        type: string
        enum:
          - '2026-10-07'
  schemas:
    WorkspacePullRequestDetailsRequest:
      type: object
      properties:
        pr_urls:
          type: array
          items:
            type: string
            format: uri
          maxItems: 20
      required:
        - pr_urls
    WorkspacePullRequestDetailsResponse:
      type: object
      properties:
        pull_requests:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                format: uri
              details:
                allOf:
                  - $ref: '#/components/schemas/PullRequestDetails'
                nullable: true
              error:
                type: string
                nullable: true
            required:
              - url
              - details
              - error
      required:
        - pull_requests
    PullRequestDetails:
      type: object
      properties:
        url:
          type: string
          format: uri
        repo_name:
          type: string
        owner:
          type: string
        repo:
          type: string
        number:
          type: integer
        title:
          type: string
        state:
          type: string
          enum:
            - open
            - merged
            - closed
            - draft
        author_login:
          type: string
          nullable: true
        head_branch:
          type: string
        base_branch:
          type: string
        stack:
          allOf:
            - $ref: '#/components/schemas/PullRequestStack'
          nullable: true
        mergeability:
          type: string
          enum:
            - mergeable
            - blocked
            - behind
            - conflicts
            - draft
            - unknown
          description: >-
            Whether the code host will currently accept a merge. Mirrors
            GitHub's mergeable_state and GitLab's detailed_merge_status, so it
            captures branch protection outcomes that state and ciStatus cannot:
            blocked means a rule such as a required review is unsatisfied,
            behind means the branch is out of date with its base, and unknown
            means the host has not finished computing mergeability.
        ci_status:
          type: string
          enum:
            - success
            - failure
            - pending
            - none
        additions:
          type: integer
          nullable: true
          description: >-
            Added lines, or null when the code host does not provide complete
            diff data.
        deletions:
          type: integer
          nullable: true
          description: >-
            Deleted lines, or null when the code host does not provide complete
            diff data.
        changed_files:
          type: integer
        comment_count:
          type: integer
        checks:
          $ref: '#/components/schemas/PullRequestChecksSummary'
        check_items:
          type: array
          description: Individual provider-reported checks and their current statuses.
          items:
            $ref: '#/components/schemas/PullRequestCheck'
        merge_blockers:
          type: array
          description: Normalized reasons the code host currently blocks the merge.
          items:
            type: string
            enum:
              - review_required
              - changes_requested
              - unresolved_conversations
              - required_checks
              - merge_policy
              - jira_association
              - branch_protection
        can_approve:
          type: boolean
          description: >-
            Whether the requesting user's connected GitHub account can currently
            submit an approving review.
        updated_at:
          type: string
          format: date-time
      required:
        - url
        - repo_name
        - owner
        - repo
        - number
        - title
        - state
        - author_login
        - head_branch
        - base_branch
        - stack
        - mergeability
        - ci_status
        - additions
        - deletions
        - changed_files
        - comment_count
        - checks
        - can_approve
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        details:
          type:
            - string
            - 'null'
          description: Additional error details
        code:
          type: string
          description: Machine-readable error code when available
      required:
        - error
    PullRequestStack:
      type: object
      description: >-
        GitHub stack metadata. Null for standalone GitHub pull requests and
        GitLab merge requests.
      properties:
        number:
          type: integer
        size:
          type: integer
        position:
          type: integer
          minimum: 1
          description: 1-based order from the stack base to its top pull request.
        base_branch:
          type: string
      required:
        - number
        - size
        - position
        - base_branch
    PullRequestChecksSummary:
      type: object
      description: >-
        Check counts across the pull request head commit, spanning both commit
        statuses and check runs.
      properties:
        total:
          type: integer
        passing:
          type: integer
        failing:
          type: integer
        pending:
          type: integer
      required:
        - total
        - passing
        - failing
        - pending
    PullRequestCheck:
      type: object
      description: A provider-reported status or check run on the pull request head commit.
      properties:
        name:
          type: string
        status:
          type: string
          enum:
            - success
            - failure
            - pending
        status_label:
          type: string
        description:
          type: string
        url:
          type: string
          format: uri
      required:
        - name
        - status
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Organization or personal API key from **Settings → API Keys**.

````

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