Update a merge queue's configuration
Requires the Update Merge Queue settings permission. Applies a JSON Merge Patch to the queue’s configuration: an absent key leaves that setting unchanged, and an unknown key is rejected rather than silently dropped. Send requiredStatuses: [] or batchingRules: [] to clear those lists.
requiredStatuses is a merge-protection control, not a tuning knob: it decides what must pass before an entry may merge (clearing it falls back to .trunk/trunk.yaml and the branch’s protection rules). Treat access to this endpoint as security-relevant. Refused with MODE_CHANGE_IN_PROGRESS while the queue is converting between modes, and with ALLOWED_BOT_SUBMITTERS_FROZEN for a body carrying the removed allowedBotSubmitters: bots are approved on the Bots page of the organization’s settings.
Authorizations
An API key, sent as Authorization: Bearer <key>. An organization admin creates one in the Trunk app under Settings → Developer → API Keys and chooses the permissions it holds. A key with none can read merge queues but change nothing in them. Permissions cover merge queues and test-result uploads, including the quarantine lookups a CI run makes before it uploads; any key can call the other Flaky Tests and Dynamic CI endpoints, including their writes.
Path Parameters
The merge queue's id.
"xK9mP2nQ"
Body
A JSON Merge Patch: an absent key leaves that setting unchanged, and an unknown key is rejected rather than dropped. requiredStatuses: [] and batchingRules: [] clear those lists. A batchingRules write replaces the whole set. notReadyTimeoutMinutes must be a whole number of hours.
How many entries the queue may verify at once. Higher values merge faster and cost more CI.
1 <= x <= 1000How many verification runs the engine may use in parallel when bisecting a failed batch. 0 means bisection gets no dedicated capacity and shares concurrency.
0 <= x <= 1000How many test runs behind an entry in pendingFailure may keep testing while it waits; a passing run behind it shows the failure was not its own. Applies with canOptimisticallyMerge. 0 means nothing behind a pending failure tests until it resolves.
0 <= x <= 1000Whether an entry whose own verification passed may merge before every entry ahead of it has merged, when the engine can prove the result still holds.
Whether the queue may verify several entries together in one run. Batching is cheaper but a failure must then be attributed by bisection. An individual entry can opt out at submit time; the queue setting is the ceiling, so an entry cannot batch when this is false.
How long the queue waits for more entries before starting a batch smaller than batchingMinSize. 0 means never wait — start as soon as there is anything to test.
0 <= x <= 10080The batch size the queue prefers before starting a run, subject to batchingMaxWaitTimeMinutes. At least 1.
1 <= x <= 1000How long a verification run may take before the queue abandons it and fails the entry. 0 means no timeout — a stuck run will hold its slot indefinitely.
0 <= x <= 10080How long an entry may sit notReady before the queue cancels it (NOT_READY_TIMEOUT_EXPIRED). 0 means no timeout. Stored as whole hours, so this must be a multiple of 60.
0 <= x <= 43200Whether the queue opens a provider pull request for each testing branch it creates. Makes runs visible in the provider UI at the cost of extra pull-request noise.
Whether the queue posts status comments on pull requests it processes.
Whether the queue acts on comment commands (e.g. a comment asking to enqueue or dequeue).
Whether the queue publishes its own status check onto each pull request, so its state is visible in the provider's merge box.
Whether Trunk's browser extension surfaces queue controls on this repository's pull requests.
Whether applying enqueueingLabel to a pull request submits it to this queue.
Whether the queue maintains labels reflecting each entry's state. Trunk owns labels prefixed trunk-, which is why enqueueingLabel may not collide with that prefix.
The provider check names that must pass for an entry to be considered verified. Empty means the queue takes required statuses from .trunk/trunk.yaml, then from the branch's protection rules. If .trunk/trunk.yaml doesn't set them and the branch requires no checks, the entry fails with START_TEST_RUN_NO_REQUIRED_STATUSES; an explicit empty list in .trunk/trunk.yaml gates on nothing. Security-relevant: this is the queue's merge gate.
1001Rules changing how pull requests are batched based on the build targets they impact. Empty means every entry batches normally. Applies to queues in graph mode that upload impacted targets.
100One of off or always. See the DirectMergeMode schema.
off, always One of off or bisectionSkipRedundantTests. See the OptimizationMode schema.
off, bisectionSkipRedundantTests One of mergeCommit, squash, or rebase. See the MergeMethod schema.
mergeCommit, squash, rebase One of renameTempBranch or pushNewBranchFromTemp. See the TestBranchConstructionMode schema.
renameTempBranch, pushNewBranchFromTemp The label that submits a pull request to this queue when areLabelCommandsEnabled is true. May not collide with a Trunk-reserved trunk-* state label.
1Response
The updated merge queue
"xK9mP2nQ"
Resolve with GET /v2/repositories/{id}.
"7c9e6679-7425-40de-944b-e07fc1f90ae7"
"main"
The queue's lifecycle state. switchingModes is a transient conversion state during which config and mode writes are refused.
running, paused, draining, switchingModes "running"
The engine a queue runs. queue tests entries in strict arrival order, one line. graph builds a dependency graph and may test entries speculatively in parallel, which merges faster but can require bisection to attribute a failure. Changing mode is a real conversion, not a flag flip — see mergeQueues.switchModes.
queue, graph "queue"
Who owns the queue's configuration. terraform — the last write came from Terraform, identified on any queue write (create, config, pause/resume/drain, mode switch) by a User-Agent or X-Source header containing terraform or opentofu, case-insensitively — the same rule as v1. terraformWithDrift — Terraform owned it and a later write was not identified as Terraform's, so the live configuration may differ from the plan. Any such write counts, including pause/resume from other automation. manual — never written by Terraform.
manual, terraform, terraformWithDrift When the queue was created.
"2026-07-24T20:26:04.000Z"
When the queue's own record last changed — its state or configuration. Not affected by entries moving through it.
"2026-07-28T11:02:31.000Z"
Absolute browsable URL of the repository at its provider (not a Trunk API URL).
"https://github.com/acme/widgets"
Path — not an absolute URL — of this queue's pull-request collection on the Trunk API. Resolve it against the server URL; do not fetch it as-is.
"/v2/merge-queues/xK9mP2nQ/pull-requests"
A queue's full configuration. requiredStatuses (what must pass) is a merge-protection control rather than a tuning knob, so treat write access to this object as security-relevant.
The queue's page in the Trunk web app. Absent when the repository has no keyed organization (no slug to address it by).
"https://app.trunk.io/acme/merge-queue/xK9mP2nQ"