Flaky Tests API

The Trunk Flaky Tests API provides access to check the status of Trunk services and fetch unhealthy or quarantined tests in your project. The API is an HTTP REST API, returns JSON from all requests, and uses standard HTTP response codes.

All requests must be authenticated by providing the x-api-token header.

Get the details of a test case

post
Authorizations
x-api-tokenstringRequired
Body
org_url_slugstringRequired

The slug of your organization. Find this at https://app.trunk.io/trunk/settings under "Organization Name" > "Slug"

Example: my-trunk-org-slug
test_idstring · uuidRequired

The id of a test case. Should be a UUID.

Example: 01234567-0123-0123-0123-0123456789ab
Responses
200

OK

application/json
post
/flaky-tests/get-test-details

Link a ticket to a test case

post
Authorizations
x-api-tokenstringRequired
Body
test_case_idstring · uuidRequired

The id of the test case. Should be a UUID.

Example: 01234567-0123-0123-0123-0123456789ab
external_ticket_idstringRequired

The external identifier of the ticket. For Jira this is the ticket number prefixed by the Project Key. For Linear this is the ticket number prefixed by the Team Identifier

Example: KAN-123
Responses
200

OK

application/json
post
/flaky-tests/link-ticket-to-test-case

No content

Get a list of distinct tests that failed in the given time range

post
Authorizations
x-api-tokenstringRequired
Body
org_url_slugstringRequired

The slug of your organization. Find this at https://app.trunk.io/trunk/settings under "Organization Name" > "Slug"

Example: my-trunk-org-slug
start_timestring · date-timeRequired

The start time of the failing tests (inclusive). Must be within 7 days of the end time.

end_timestring · date-timeRequired

The end time of the failing tests (exclusive). Must be within 7 days of the start time.

Responses
200

OK

application/json
post
/flaky-tests/list-failing-tests

Get a list of unhealthy tests

post
Authorizations
x-api-tokenstringRequired
Body
org_url_slugstringRequired

The slug of your organization. Find this at https://app.trunk.io/trunk/settings under "Organization Name" > "Slug"

Example: my-trunk-org-slug
statusstring · enumRequired

The status filter for unhealthy tests.

Possible values:
Responses
200

OK

application/json
post
/flaky-tests/list-unhealthy-tests

Get a list of quarantined tests

post
Authorizations
x-api-tokenstringRequired
Body
org_url_slugstringRequired

The slug of your organization. Find this at https://app.trunk.io/trunk/settings under "Organization Name" > "Slug"

Example: my-trunk-org-slug
Responses
200

OK

application/json
post
/flaky-tests/list-quarantined-tests

Last updated