Resolve pull requests by repository coordinates
Looks pull requests up by their provider coordinates within one repository. Send exactly one of number or branch.
number takes up to 50 comma-separated numbers. (repositoryId, number) is unique, so each matches at most one pull request; numbers Trunk has not indexed are simply absent from the page, so recover them by diffing what you asked for against the numbers you got back.
branch is a head branch, which can carry several pull requests over time, so it resolves to the open one if there is one and otherwise the most recently created. Pair it with baseBranch — a merge queue’s target branch — to scope the answer to pull requests aimed there.
Rows come back ordered by number ascending, which is not necessarily the order you asked in. A batch can exceed limit, so this page really does paginate — follow nextCursor rather than assuming one page. readiness.hasImpactedTargets is resolved only for a lookup that ASKED for a single pull request (branch, or one number); resolving it costs a storage lookup each, so a multi-number lookup omits it whatever it matches, as the queue’s list read does. ci follows the same rule: a lookup that asked for one pull request carries it, and a multi-number lookup does not.
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 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.
Query Parameters
Page size, between 1 and 100.
1 <= x <= 10025
Opaque cursor from a previous response's nextCursor. A cursor is bound to the operation and filter it was minted for.
"AQEKZm9vYmFy"
Set true to include total in the response. Costs an extra COUNT query, so it is off by default.
false
The repository the pull requests belong to.
"7c9e6679-7425-40de-944b-e07fc1f90ae7"
One provider pull-request number, or up to 50 comma-separated, each between 1 and 10000000. Mutually exclusive with branch. Deliberately typed as a string rather than published with a pattern: the route's own parse names the offending member, which a schema-level rejection cannot.
1"4901,4902"
A head branch. Resolves to the open pull request from it, else the most recently created. Mutually exclusive with number.
1"feature/widget-limit"
Narrows a branch lookup to pull requests targeting this base — a merge queue's target branch. Sending it without branch is a 400 rather than ignored.
1"main"
Response
A page of the matching pull requests
100Opaque cursor for the next page, or null on the last page. Pass it back verbatim as cursor; do not construct or inspect one.
"AQEKZm9vYmFy"
True when another page is available.
true
Total rows matching the filter. Present only when the request set includeTotal=true.
1247