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 theDocumentation Index
Fetch the complete documentation index at: https://trunk-4cab4936-sam-gutentag-api-conventions.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
x-api-token header.
API conventions
Behavior that applies across endpoints — pagination, rate limits, webhook-to-API state propagation, and a few support-only fields.Pagination with page_token
List endpoints (list-unhealthy-tests, list-quarantined-tests, list-failing-tests) return at most page_size results per call, capped at 100. To page through results, use the next_page_token returned in the response as the page_token on the next request.
For the first page, omit page_token or pass an empty string. Passing a value that didn’t come from a prior response returns a 500.
If the web app shows a test as flaky but
list-unhealthy-tests doesn’t return it on the first page, keep paginating — large result sets span multiple pages, and the test you’re looking for may not appear until later pages.prev_page_token and last_page_token for walking the result set in either direction.
Rate limits
There is no externally published rate-limit SLO on the org API token, but the practical ceiling is high enough for reasonable polling and dashboard use. If you’re building automation that polls a list endpoint on a tight interval — for example, a “is this PR in the queue?” check that runs on every push — share the expected request rate with Trunk support before rolling it out so we can confirm it’s within range.Webhook-to-API state propagation
When astatus_changed webhook fires for a test (for example, transitioning from healthy to flaky), the new status is reflected immediately in subsequent list-unhealthy-tests and list-quarantined-tests responses. There is no eventual-consistency window between the webhook and the read APIs — if you act on a webhook and then call the API, you’ll see the post-event state.
Bundle Upload ID
Thetrunk-analytics-cli upload command prints a Bundle Upload ID after each upload. This ID is intended for support handoff, not for direct lookup:
- It is not URL-searchable in the web app.
- It is not exposed via the public API today.