Skip to main content
PATCH
Update a merge queue's configuration

Authorizations

Authorization
string
header
required

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 merge-queue permissions it holds; a key with none can read merge queues but change nothing. Those permissions scope merge queue only: every key can use the Flaky Tests and Dynamic CI endpoints, including their writes, whatever permissions it holds.

Path Parameters

id
string
required

The merge queue's id.

Example:

"xK9mP2nQ"

Body

application/json

A JSON Merge Patch: an absent key leaves that setting unchanged, and an unknown key is rejected rather than dropped. requiredStatuses: [], allowedBotSubmitters: [] and batchingRules: [] clear those lists. A batchingRules write replaces the whole set. notReadyTimeoutMinutes must be a whole number of hours.

concurrency
integer
Required range: 1 <= x <= 1000
bisectionConcurrency
integer
Required range: 0 <= x <= 1000
pendingFailureDepth
integer
Required range: 0 <= x <= 1000
canOptimisticallyMerge
boolean
allowBatching
boolean
batchingMaxWaitTimeMinutes
integer
Required range: 0 <= x <= 10080
batchingMinSize
integer
Required range: 1 <= x <= 1000
testingTimeoutMinutes
integer
Required range: 0 <= x <= 10080
notReadyTimeoutMinutes
integer
Required range: 0 <= x <= 43200
createsPrsForTestingBranches
boolean
areCommentsEnabled
boolean
areCommandsEnabled
boolean
isStatusCheckEnabled
boolean
isExtensionEnabled
boolean
areLabelCommandsEnabled
boolean
areStateLabelsEnabled
boolean
requiredStatuses
string[]
Maximum array length: 100
Minimum string length: 1
allowedBotSubmitters
string[]
Maximum array length: 100
Minimum string length: 1
batchingRules
object[]
Maximum array length: 100
directMergeMode
enum<string>
Available options:
off,
always
optimizationMode
enum<string>
Available options:
off,
bisectionSkipRedundantTests
mergeMethod
enum<string>
Available options:
mergeCommit,
squash,
rebase
testBranchConstructionMode
enum<string>
Available options:
renameTempBranch,
pushNewBranchFromTemp
enqueueingLabel
string
Minimum string length: 1

Response

The updated merge queue

id
string
required
Example:

"xK9mP2nQ"

repositoryId
string
required

Resolve with GET /v2/repositories/{id}.

Example:

"7c9e6679-7425-40de-944b-e07fc1f90ae7"

targetBranch
string
required
Example:

"main"

state
enum<string>
required

The queue's lifecycle state. switchingModes is a transient conversion state during which config and mode writes are refused.

Available options:
running,
paused,
draining,
switchingModes
Example:

"running"

mode
enum<string>
required

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.

Available options:
queue,
graph
Example:

"queue"

managedState
enum<string>
required

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.

Available options:
manual,
terraform,
terraformWithDrift
createdAt
string<date-time>
required

When the queue was created.

Example:

"2026-07-24T20:26:04.000Z"

updatedAt
string<date-time>
required

When the queue's own record last changed — its state or configuration. Not affected by entries moving through it.

Example:

"2026-07-28T11:02:31.000Z"

repositoryUrl
string
required

Absolute browsable URL of the repository at its provider (not a Trunk API URL).

Example:

"https://github.com/acme/widgets"

pullRequestsUrl
string
required

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.

Example:

"/v2/merge-queues/xK9mP2nQ/pull-requests"

config
object
required

A queue's full configuration. Two fields are merge-protection controls rather than tuning knobs — requiredStatuses (what must pass) and allowedBotSubmitters (who may enqueue) — so treat write access to this object as security-relevant.

htmlUrl
string

The queue's page in the Trunk web app. Absent when the repository has no keyed organization (no slug to address it by).

Example:

"https://app.trunk.io/acme/merge-queue/xK9mP2nQ"