Skip to main content
GET
Estimate when a queued pull request will merge

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<uuid>
required

The pull request's id.

Example:

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

Response

The entry's estimate, or why there is none

A live estimate for a queued pull request, computed by simulating the queue forward from its current state over the queue's recent test history, or why there is none. A point-in-time prediction: a new submission, a priority change or a failure ahead changes it, so read it again when it is needed rather than counting down from one answer.

status
enum<string>
required
Available options:
available
Example:

"available"

computedAt
string<date-time>
required

When the public API received the estimate from the merge service; every other instant is relative to it, so each carries that call's latency.

Example:

"2026-10-07T15:04:05.000Z"

kind
enum<string>
required

merge: estimatedAt is when the pull request is expected to merge. pendingFailureResolution: the entry is in pendingFailure, and estimatedAt is when the failure is expected to resolve — by a restart, a bisection, a pass, or a failure — not a merge time.

Available options:
merge,
pendingFailureResolution
Example:

"merge"

estimatedAt
string<date-time>
required

For kind: merge, the median estimate of when the pull request merges: half of comparable entries finish sooner, half later. For kind: pendingFailureResolution, when the failure is expected to resolve — an upper bound, since it waits for every run the failure depends on, while a restart or a passing run behind it can resolve it sooner.

Example:

"2026-10-07T15:24:05.000Z"

estimatedAtState
enum<string>
required

How far to trust the instant it accompanies. onTrack: a forecast that moves closer as time passes. holding: not counting down, because the queue is waiting on a step it treats as instant (such as a verification run that can start now) or the instant is under a 30-second floor; it does not mean the instant is near. pastTypical: held by a run, this entry's or one ahead of it, that is past its typical time, so the instant is likely an underestimate; on testsFinishAtState the run is this entry's own, so compare against typicalTestDurationSeconds. pastP95: only on testsFinishAtState, this entry's verification run is taking longer than 95% of the queue's recent passing runs.

Available options:
onTrack,
holding,
pastTypical,
pastP95
Example:

"onTrack"

confidence
enum<string>
required

From how much history the queue has, lowered while the entry waits, sits deep in the queue, is held behind a failure, is bisecting, or has a pending failure ahead of it.

Available options:
low,
medium,
high
Example:

"medium"

pullRequestsAhead
integer
required

How many pull requests this one depends on and so must merge behind: a count of blockers, not a queue position. In a graph queue, pull requests in independent lanes are not counted. Past the graph's soft cap, before the pull request is admitted, it counts every pull request in the queue — an upper bound on its blockers.

Example:

3

waitingForPullRequestNumbers
integer[]
required

For pendingFailureResolution, the pull requests whose runs the failure is waiting on right now; empty otherwise.

Maximum array length: 10000
Example:
sampleSize
integer
required

Passing tested pull requests in the queue's last 14 days the estimate draws on — one per pull request per verification run, so a passing batch of four counts four.

Example:

120

startsTestingAt
string<date-time>

Present while the entry waits for a test slot.

Example:

"2026-10-07T15:09:05.000Z"

startsTestingAtState
enum<string>

Present exactly when startsTestingAt is: how far to trust it.

Available options:
onTrack,
holding,
pastTypical,
pastP95
Example:

"onTrack"

testsFinishAt
string<date-time>

Present while the entry waits or tests: when its verification run is expected to finish passing, including expected restarts.

Example:

"2026-10-07T15:23:05.000Z"

testsFinishAtState
enum<string>

Present exactly when testsFinishAt is: how far to trust it.

Available options:
onTrack,
holding,
pastTypical,
pastP95
Example:

"onTrack"

typicalTestDurationSeconds
integer

The queue's median duration over its recent passing verification runs, in whole seconds rounded down. Absent when the queue has none to report.

Example:

900