/v1/flaky-tests/*) were scoped to a repository, and they are retired along with repository-scoped Flaky Tests. They still accept requests but no longer return results. Use the API’s test collection endpoints instead.
The two scopes are separate APIs, not two versions of one API. So not every legacy endpoint has an equivalent with the same shape.
What changes
- Credential. The legacy API uses the organization API token in
x-api-token. The API uses an API key inAuthorization: Bearer <key>. Any API key can call the Flaky Tests endpoints. They need no permission. - Base URL. Legacy paths go after
https://api.trunk.io/v1. API paths already start with/v2, so they go afterhttps://api.trunk.io. - Method. Legacy endpoints are
POSTwith a JSON body. API reads areGETwith query parameters. - Lists. API lists are paginated with cursors.
- Errors. API errors use the error envelope. Switch on
error.code.
Endpoint map
A test’s ID in a collection is not the ID the legacy endpoints returned, so an ID stored from a legacy endpoint can’t be passed to a collection endpoint. The repository’s
repository.id is the only identifier the two share.trunk-io/analytics-uploader, and the Trunk MCP server’s token sign-in, still need the organization API token.