---
title: "List pull requests in a merge queue."
method: POST
path: "/listPullRequests"
---

# List pull requests in a merge queue.

`POST /listPullRequests`

Returns a paginated list of pull requests in the merge queue. Optionally filter by state and/or by a time range for concluded pull requests.

## Request body

- object
  - `repo` object, required
    - `host` string, required — The host of the repository (e.g., github.com).
    - `owner` string, required — The owner of the repository.
    - `name` string, required — The name of the repository.
  - `targetBranch` string, required — The target branch of the merge queue.
  - `state` 'not_ready' | 'pending' | 'testing' | 'tests_passed' | 'merged' | 'failed' | 'cancelled' | 'pending_failure' — Optional filter for the state of pull requests. If not provided, pull requests of all states will be returned.
  - `since` string, date-time — Optional ISO 8601 timestamp. When provided, returns pull requests that concluded (merged, failed, or cancelled) since this time.
  - `cursor` string, uuid — Optional cursor for pagination. Use the nextCursor from the previous response.
  - `take` integer — Number of pull requests to return (1-100). Defaults to 50.

## Response `200`

OK

- object
  - `pullRequests` object[], required — List of pull requests in the merge queue.
    - `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.
    - `stateChangedAt` string, required
    - `priorityValue` number, required
    - `priorityName` string, required
    - `usedDefaultPriorityName` string
    - `skipTheLine` boolean, required
    - `noBatch` boolean, required
    - `prNumber` number, required
    - `prTitle` string, required
    - `prSha` string, required
    - `prBaseBranch` string, required
    - `prAuthor` string, required
  - `nextCursor` string, uuid — Cursor for the next page of results. If absent, there are no more results.

## 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/versions/f7b911d8e24c/schema)
