Skip to main content
GET
Get a test

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

testId
string
required

The test's globally unique id.

Minimum string length: 1
Example:

"bfeebcf4-0000-8000-8000-000000000001"

Query Parameters

include
enum<string>

Set to metrics to embed this test's metrics for period.

Available options:
metrics
Example:

"metrics"

period
enum<string>

Metrics window. Required with include=metrics.

Available options:
1d,
7d,
14d,
30d
Example:

"7d"

Response

The test

id
string
required

The test's globally unique id. Stable across repos and collections, and safe to store.

Example:

"bfeebcf4-0000-8000-8000-000000000001"

testCollectionId
string
required

The owning collection's id.

Example:

"aB3xY9kQ"

repositoryId
string
required

The repository the test was uploaded for. Resolve with GET /v2/repositories/{id}. Uploads made without a repository carry the nil UUID, which names no repository and does not resolve.

Example:

"7a2b3c4d-5e6f-4a1b-8c9d-0e1f2a3b4c5d"

name
string
required
Example:

"suite::test_case_name"

parentName
string
required
Example:

"Foo"

className
string
required
Example:

"FooSuite"

file
string
required
Example:

"src/foo.test.ts"

target
string
required

The build target that ran the test, when one was reported.

Example:

"//src:foo_test"

variant
string
required
Example:

""

crossVariantId
string | null
required

Groups the same test across variants, when it has any.

Example:

"5d4c3b2a-1f0e-4a1b-8c9d-0e1f2a3b4c5d"

codeowners
string[]
required
Maximum array length: 1000
Example:
status
enum<string>
required

A test's current composite status, reconciled across every active monitor.

Available options:
healthy,
flaky,
broken
Example:

"flaky"

statusSince
string<date-time> | null
required

When status last changed — how long the test has been in its current state. Null for a test no monitor has ever classified.

Example:

"2026-06-01T10:00:00.000Z"

quarantineState
enum<string>
required

Whether the test is currently quarantined, derived from its status, the collection's quarantine settings and any override.

Available options:
quarantined,
notQuarantined
Example:

"notQuarantined"

labels
object[]
required
Maximum array length: 100
quarantineOverride
object | null
required

The override currently in effect on this test, or null if none is.

activeMonitors
object[]
required

The monitors currently classifying this test.

Maximum array length: 100
firstSeenAt
string<date-time> | null
required

When the test was first ingested. Null for tests last seen before Trunk began recording this, which is not backfilled.

Example:

"2026-05-20T08:00:00.000Z"

lastFailureAt
string<date-time> | null
required

The most recent failing run Trunk still holds metrics for. Null if the test has never failed within that window.

Example:

"2026-06-10T12:30:00.000Z"

metrics
object | null

Returned only when include=metrics is set. Null when the test had no runs in period.