---
title: "Get the merge queue."
method: POST
path: "/getQueue"
---

# Get the merge queue.

`POST /getQueue`

## Request body

- object
  - `repo` object, required
    - `host` string, required
    - `owner` string, required
    - `name` string, required
  - `targetBranch` string, required

## Response `200`

OK

- object
  - `state` 'running' | 'paused' | 'draining' | 'switching_modes', required — The state of the merge queue. See https://docs.trunk.io/merge-queue/administration/advanced-settings#merge-queue-state for the full description of each state.
  - `branch` string, required
  - `concurrency` number, required
  - `testingTimeoutMinutes` number, required
  - `mode` 'single' | 'parallel', required
  - `canOptimisticallyMerge` boolean, required
  - `pendingFailureDepth` number, required
  - `batch` boolean, required
  - `batchingMaxWaitTimeMinutes` number, required
  - `batchingMinSize` number, required
  - `createPrsForTestingBranches` boolean, required
  - `commentsEnabled` boolean, required
  - `commandsEnabled` boolean, required
  - `statusCheckEnabled` boolean, required
  - `bisectionConcurrency` number, required
  - `requiredStatuses` string[], required
  - `directMergeMode` 'off' | 'always', required — Controls whether PRs can skip the queue's test run and merge directly when already up to date with the target branch. See https://docs.trunk.io/merge-queue/administration/advanced-settings#direct-merge-to-main for details.
  - `optimizationMode` 'off' | 'bisection_skip_redundant_tests', required — The optimization strategy for the merge queue. `off` — no optimizations. See https://docs.trunk.io/merge-queue/optimizations/batching#test-caching-during-bisection for details on `bisection_skip_redundant_tests`.
  - `mergeMethod` 'merge_commit' | 'squash' | 'rebase', required — The Git strategy used to merge a PR into the target branch. See https://docs.trunk.io/merge-queue/administration/advanced-settings#merge-method for details.
  - `enqueuedPullRequests` object[], required
    - `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

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