Skip to main content
POST
Update the merge queue.

Authorizations

x-api-token
string
header
required

Body

application/json
repo
object
required
targetBranch
string
required

The branch that the merge queue is targeting.

state
enum<string>

The desired state of the merge queue. Valid values: RUNNING, PAUSED, DRAINING.

Available options:
running,
paused,
draining
concurrency
integer

The number of PRs or batches of PRs the queue can test at once.

Required range: 1 <= x <= 4294967295
bisectionConcurrency
integer

The number of tests the merge queue can run when bisecting a batch to figure out what PR in the batch failed.

Required range: 1 <= x <= 4294967295
testingTimeoutMinutes
integer

The maximum number of minutes the merge queue will wait for tests to complete before timing out. Set to 0 to disable the timeout.

Required range: 0 <= x <= 4294967295
pendingFailureDepth
integer

When enabled, PRs that fail tests will wait for the specified number of PRs below them to finish testing before getting kicked from the queue. This works best with optimistic merging enabled. Set to 0 to disable.

Required range: 0 <= x <= 4294967295
canOptimisticallyMerge
boolean

When enabled, a PR that passes tests will also cause any PR ahead of it in the queue to also get marked as passing, since tests have passed with those commits.

batch
boolean

Enable or disable batching. When enabled, the merge queue will group PRs into batches for testing.

batchingMaxWaitTimeMinutes
integer

The maximum number of minutes the merge queue will wait to collect PRs into a batch before starting tests.

Required range: 1 <= x <= 4294967295
batchingMinSize
integer

The minimum number of PRs required to form a batch.

Required range: 1 <= x <= 4294967295
mode
enum<string>

The queue mode. 'single' processes PRs one at a time. 'parallel' processes multiple PRs concurrently.

Available options:
single,
parallel
commentsEnabled
boolean

Whether or not Merge Queue will post GitHub comments on PRs.

commandsEnabled
boolean

Whether or not users are allowed to submit PRs to the merge queue by commenting /trunk merge.

createPrsForTestingBranches
boolean

Whether or not the merge queue will create PRs for its testing branches, allowing CI to run on them.

directMergeMode
enum<string>

Allow PRs to merge directly into the target branch if they're up to date with the target branch when submitting them to the queue instead of running tests on them in the merge queue.

Available options:
off,
always
optimizationMode
enum<string>

The optimization strategy for the merge queue. 'off' disables optimizations. 'bisection_skip_redundant_tests' uses bisection and skips redundant tests.

Available options:
off,
bisection_skip_redundant_tests
mergeMethod
enum<string>

The Git merge method used when merging PRs into the target branch. Valid values: merge_commit, squash, rebase.

Available options:
merge_commit,
squash,
rebase
testBranchConstructionMode
enum<string>

How the merge queue builds the branch CI runs on. Valid values: rename_temp_branch, push_new_branch_from_temp.

Available options:
rename_temp_branch,
push_new_branch_from_temp
statusCheckEnabled
boolean

Post a GitHub status check on PRs with the status of the PR in the merge queue.

extensionEnabled
boolean

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

requiredStatuses
string[]

Allows setting the statuses that must pass when the merge queue performs tests in order for a PR to merge. Setting the statuses here will override GitHub branch protection settings or your .trunk/trunk.yaml.

deleteRequiredStatuses
boolean

Removes a manually specified set of required statuses. After this, the statuses that must pass when the merge queue performs testing will be pulled from either GitHub branch protection settings or your .trunk/trunk.yaml.

allowedBotSubmitters
string[]

Sets the GitHub logins of bot/app accounts (e.g. dependabot[bot]) whose PRs are allowed to be submitted to the merge queue. This replaces the existing set. Pass an empty list to clear all allowed bot submitters.

batchingRules
object[]

Sets how PRs are batched based on the build targets they impact, for queues in parallel mode that upload impacted targets. This replaces the existing set of rules. Pass an empty list to clear all batching rules.

enqueueingLabel
string

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

Minimum string length: 1
labelCommandsEnabled
boolean

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

stateLabelsEnabled
boolean

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

notReadyTimeoutHours
integer

The number of hours a PR can remain submitted but not mergeable before it is removed from the queue. Set to 0 to disable the timeout.

Required range: 0 <= x <= 4294967295

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.

notReadyTimeoutHours
number
required