Skip to main content
GET
Get a pull request

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 permissions it holds. A key with none can read merge queues but change nothing in them. Permissions cover merge queues and test-result uploads, including the quarantine lookups a CI run makes before it uploads; any key can call the other Flaky Tests and Dynamic CI endpoints, including their writes.

Path Parameters

id
string<uuid>
required

The pull request's id.

Example:

"0f8fad5b-d9cb-469f-a165-70867728950e"

Response

The pull request

A pull request Trunk has indexed. There is no nested repository object — resolve repositoryId with GET /v2/repositories/{id}.

id
string
required
Example:

"0f8fad5b-d9cb-469f-a165-70867728950e"

repositoryId
string
required
Example:

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

number
integer
required
Example:

4901

title
string
required
Example:

"feat: terminate /v2 at the gateway"

branch
string
required
Example:

"phil/implement-remaining-apis"

sha
string
required

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.

Example:

"9c58bf40e5c1a2b3d4e5f60718293a4b5c6d7e8f"

baseBranch
string
required

The branch this pull request targets. Must match the queue's targetBranch to be enqueueable — readiness.doesBaseBranchMatch reports that check.

Example:

"main"

author
string
required
Example:

"octocat"

isCurrentlySubmittedToQueue
boolean
required

True when this pull request's queue entry is non-terminal.

Example:

true

createdAt
string<date-time>
required
Example:

"2026-07-28T10:55:00.000Z"

url
string

Omitted until the provider sync has populated it.

Example:

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

state
enum<string>

The pull request's state at the provider, as Trunk last indexed it — not its queue state, which is QueueEntry.state.

Available options:
open,
closed,
merged
Example:

"open"

queueEntry
object

A pull request's queue membership. A pull request has at most one at a time, and resubmitting it to the same queue reuses this record. An entry the queue tears down is replaced, so a later submission can carry a different id and mergeQueueId.

htmlUrl
string

The pull request's page in the Trunk web app. Absent when the repository has no keyed organization.

Example:

"https://app.trunk.io/acme/pull/4901?repo=1a2b3c4d"

viewerIsAuthor
boolean

Whether the authenticated user authored this pull request. Provided on the queue pull-request list (GET /merge-queues/{id}/pull-requests); absent elsewhere and when the caller is not a signed-in user.

Example:

true

ci
object | null

CI on the head commit. Null when the repository has no CI data. Absent from lists, from a lookup of more than one pull request, and when the CI read failed.