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 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.
Query Parameters
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"
Response
A page of the matching pull requests