Skip to main content
POST
Get the merge queue.

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
extensionEnabled
boolean
required

Whether the Trunk Merge Queue browser extension is enabled (shown) for this repository.

bisectionConcurrency
number
required
requiredStatuses
string[]
required
allowedBotSubmitters
string[]
required

The GitHub logins of bot/app accounts (e.g. dependabot[bot]) whose PRs are allowed to be submitted to the merge queue.

batchingRules
object[]
required

Rules changing how PRs are batched based on the build targets they impact.

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
testBranchConstructionMode
enum<string>
required

How the merge queue turns its built temporary branch into the trunk-merge branch CI runs on. rename_temp_branch renames the ref. push_new_branch_from_temp creates the final ref at the temporary branch's head commit and deletes the temporary ref, which needs no rename permission — use it when an organization- or enterprise-level ruleset targets these branches, since GitHub's rename restriction is the one rule an exempt bypass actor cannot lift.

Available options:
rename_temp_branch,
push_new_branch_from_temp
enqueueingLabel
string
required

The GitHub label whose application enqueues a PR onto the merge queue.

labelCommandsEnabled
boolean
required

Whether label-based commands (e.g. enqueue/dequeue via labels) are enabled on the merge queue.

stateLabelsEnabled
boolean
required

Whether the merge queue applies labels to PRs reflecting their merge queue state.

enqueuedPullRequests
object[]
required
notReadyTimeoutHours
number
required