Skip to main content
POST
Drain a merge queue

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"

Response

The queue's post-write state

The queue's state after the write, as the merge engine reported it — never an echo of the requested action, so a queue mid-conversion reports switchingModes.

id
string
required
Example:

"xK9mP2nQ"

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"

pullRequestsUrl
string
required

Path — not an absolute URL — of this queue's pull-request collection on the Trunk API.

Example:

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