Set a test's quarantine override
Requires the Quarantine tests permission.
Always quarantines a test, keeps it out of quarantine, or clears the override, whatever its monitors decided, and returns the test as it now stands. neverQuarantine and clear are how a test is taken out of quarantine; there is no separate endpoint. An override applies only while the test’s collection has quarantining turned on, and turning that on is not offered here.
A test already in the requested mode is left as it is, and reason is not recorded. A collection whose quarantine settings let only admins set overrides refuses anyone else with INSUFFICIENT_PERMISSIONS. An API token made on the API Keys page passes that check, since only an admin can make one or give it this permission; the organization’s legacy API token does not, since every member can see it.
A 503 TEST_UNAVAILABLE means the override was saved but the test could not be read back in time; read it with GET /v2/tests/{testId} rather than treating the write as failed.
The override is recorded as set by the API token, or by the person whose token made the call. A change a person makes sends the v2.test_case.quarantining_setting_changed webhook; a change made with an API token does not yet.
Idempotency-Key is not honored. The write is idempotent by state, so a request whose outcome is unknown (a 504 or a dropped connection) is safe to send again: a test already in the requested mode reports unchanged.
A test in another organization is reported as 404, not 403, and so is a malformed id.
Authorizations
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 permissions it holds. A key with none can read merge queues but change nothing in them. Permissions cover merge queues and test-result uploads, including the quarantine lookups a CI run makes before it uploads; any key can call the other Flaky Tests and Dynamic CI endpoints, including their writes.
Path Parameters
Body
The quarantine override to set on one test.
alwaysQuarantine quarantines the test whatever its status. neverQuarantine keeps it out of quarantine whatever its status. clear removes the override, so the collection's quarantine settings and the test's status decide again.
alwaysQuarantine, neverQuarantine, clear "neverQuarantine"
Response
The test, with its new override
When the test's current quarantine began, as far as Trunk records it. Null exactly when quarantineState is notQuarantined. For a test quarantined by an alwaysQuarantine override, the time that override was set. For a test quarantined automatically, the later of statusSince and the last time an override on it was cleared. Changes to the collection's quarantine settings are not recorded per test, so this can be earlier than when quarantining was turned on for the collection.
"2026-06-01T10:00:00.000Z"