---
title: "Get a submitted pull request from a merge queue."
method: POST
path: "/getSubmittedPullRequest"
---

# Get a submitted pull request from a merge queue.

`POST /getSubmittedPullRequest`

## Request body

- object
  - `repo` object, required
    - `host` string, required
    - `owner` string, required
    - `name` string, required
  - `pr` union, required — The pull request to look up. Identify it by number or by head branch, but not both.
    - object
      - `number` integer, required — The pull request number.
    - object
      - `branch` string, required — The head branch of the pull request. Because a branch name can be reused by many pull requests over time (for example, bots that repeatedly open and merge pull requests from the same branch), the branch is resolved to a single pull request: the open pull request submitted to the merge queue from this branch if one exists, otherwise the most recently closed pull request submitted from this branch, otherwise `404`. Only pull requests that have been submitted to the merge queue are considered.
  - `targetBranch` string, required

## Response `200`

OK

- object
  - `id` string
  - `state` 'not_ready' | 'pending' | 'testing' | 'tests_passed' | 'merged' | 'failed' | 'cancelled' | 'pending_failure' — The state of a pull request in the merge queue. See https://docs.trunk.io/merge-queue/using-the-queue/reference#pull-request-states for the full description of each state.
  - `readiness` object — Readiness signals for a pull request in the merge queue. A PR can start testing when `doesBaseBranchMatch` is true, `gitHubMergeability` is `mergeable`, and (when `requiresImpactedTargets` is true) `hasImpactedTargets` is true.
    - `hasImpactedTargets` boolean — Whether the set of impacted build/test targets for this PR has been reported.
    - `requiresImpactedTargets` boolean, required — Whether the queue is configured to require impacted-target reporting before a PR can start testing.
    - `doesBaseBranchMatch` boolean, required — Whether the PR's base branch matches the queue's target branch.
    - `gitHubMergeability` 'unspecified' | 'in_progress' | 'mergeable' | 'not_mergeable', required — GitHub's mergeability state for the PR (cached). `unspecified` — not yet known. `in_progress` — GitHub is still computing mergeability. `mergeable` — GitHub reports the PR can be merged. `not_mergeable` — GitHub reports the PR cannot be merged (e.g. merge conflict).
  - `stateChangedAt` string, required
  - `priorityValue` number, required
  - `priorityName` string, required
  - `usedDefaultPriorityName` string
  - `skipTheLine` boolean, required
  - `forceEnqueued` boolean, required
  - `isCurrentlySubmittedToQueue` boolean, required
  - `prNumber` number, required
  - `prTitle` string, required
  - `prSha` string, required
  - `prBaseBranch` string, required
  - `prAuthor` string, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/trunk/apis/trunk-apis.md) · [All operations](https://skmtc.net/trunk/apis/trunk-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trunk/trunk-apis/revisions/f7b911d8e24c/schema)
