Skip to main content
POST
/
getQueue
Get the merge queue.
curl --request POST \
  --url https://api.trunk.io/v1/getQueue \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '
{
  "repo": {
    "host": "<string>",
    "owner": "<string>",
    "name": "<string>"
  },
  "targetBranch": "<string>"
}
'
{
  "branch": "<string>",
  "concurrency": 123,
  "testingTimeoutMinutes": 123,
  "canOptimisticallyMerge": true,
  "pendingFailureDepth": 123,
  "batch": true,
  "batchingMaxWaitTimeMinutes": 123,
  "batchingMinSize": 123,
  "createPrsForTestingBranches": true,
  "commentsEnabled": true,
  "commandsEnabled": true,
  "statusCheckEnabled": true,
  "bisectionConcurrency": 123,
  "requiredStatuses": [
    "<string>"
  ],
  "enqueuedPullRequests": [
    {
      "stateChangedAt": "<string>",
      "priorityValue": 123,
      "priorityName": "<string>",
      "skipTheLine": true,
      "noBatch": true,
      "prNumber": 123,
      "prTitle": "<string>",
      "prSha": "<string>",
      "prBaseBranch": "<string>",
      "prAuthor": "<string>",
      "id": "<string>",
      "usedDefaultPriorityName": "<string>"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://trunk-4cab4936-sam-gutentag-flaky-tests-new-monitors.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-token
string
header
required

Body

application/json
repo
object
required
targetBranch
string
required

Response

OK

state
enum<string>
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.

Available options:
running,
paused,
draining,
switching_modes
branch
string
required
concurrency
number
required
testingTimeoutMinutes
number
required
mode
enum<string>
required
Available options:
single,
parallel
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
enum<string>
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.

Available options:
off,
always
optimizationMode
enum<string>
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.

Available options:
off,
bisection_skip_redundant_tests
mergeMethod
enum<string>
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.

Available options:
merge_commit,
squash,
rebase
enqueuedPullRequests
object[]
required