Skip to main content
GET
Get a test case

Authorizations

Authorization
string
header
required

An org-scoped API key, sent as Authorization: Bearer <key>. Existing v1 tokens work here unchanged. There is no enqueue-only or read/write scope: an org key authorized for merge-queue writes can invoke every merge-queue mutation, including changing merge-protection configuration and pausing, draining or deleting a queue.

Path Parameters

testCaseId
string
required

The test case'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 case

id
string
required

The test case'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"

repoId
string
required

The repository the test was uploaded for. The nil UUID for uploads made without a repository.

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"

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.