Submit a pull request to a merge queue
Requires the Merge and cancel PRs permission, plus Set priority on PRs to send priorityValue or priorityName, Skip batching to send allowBatching: false, and Merge PRs with direct to queue to send direct: true. Choosing a mergeMethod needs no extra permission. Lower priorityValue numbers go first, from 0 to 255. The named priorities are urgent (0), high (10), medium (100, the default), and low (200). An urgent entry, or priorityValue: 0, restarts lower-priority entries that are already testing when it enters the queue (once it is ready), along with the entries tested on top of them.
Enqueues a pull request. A pull request already enqueued in this queue is refused with PR_ALREADY_ENQUEUED rather than having its priority rewritten — change a live entry through POST /v2/pull-requests/{id}/reprioritize or PATCH /v2/pull-requests/{id}/queue-entry. readiness.hasImpactedTargets may be absent on the 201 if the post-write lookup failed; the enqueue still landed, so read the pull request again rather than retrying.
Idempotency-Key is not honored. If a request times out, resolve the pull request by repository and number and inspect its queue entry before retrying.
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 new key starts with no permissions: it can read merge queues but change nothing in them, and it cannot get a Dynamic CI plan. Each endpoint that needs a permission names it in its description; the Dynamic CI plan endpoints need Generate Dynamic CI plans.
Body
Omitting allowBatching allows batching. priorityValue and priorityName are mutually exclusive; priorityValue: 0 skips the line. direct sends the pull request directly to the queue past unmet branch protection / failing required checks, merging via Trunk's bypass app (it does not skip the queue's own tests); it needs the Merge PRs with direct to queue permission, and a signed-in user also needs repository-admin permission.
How to merge this pull request: one of mergeCommit, squash, or rebase (see the MergeMethod schema). Omit it, or send null, to use the queue's merge method. Choosing one is refused with PR_NOT_ENQUEUEABLE unless the queue lets pull requests choose their own merge method, and when the branch's rules forbid the method or the repository's provider does not support it.
mergeCommit, squash, rebase "rebase"
Response
The enqueued pull request
A pull request Trunk has indexed. There is no nested repository object — resolve repositoryId with GET /v2/repositories/{id}.
The head commit of the pull request as Trunk last indexed it. Compare against a verification run's testedPullRequests[].sha to tell whether a run tested the current head or a superseded one — a mismatch means the branch moved after that run started.
"9c58bf40e5c1a2b3d4e5f60718293a4b5c6d7e8f"