Remove labels from a test
Requires the Flag tests permission.
Removes each named label’s hand-applied source from the test. A label a monitor also applies stays on the test, with only its monitor sources, until the monitor stops applying it; mute the monitor for the test to stop it sooner. A name the organization has no label for, or one not applied to this test by hand, is ignored. Labels themselves are not deleted.
Answers the test’s labels after the change, in the shape of Test.labels, read in the same transaction as the write.
A label changes no status, so this sends no webhook and does not reconcile the test.
The labels filter of GET /v2/tests reads a copy of the assignments that lags by a minute or two, so a test can be missing from (or still in) a label’s results that long after this answers. The labels on each test, here and on every read, are current.
The change is recorded as made by the person whose token made the call. An API token is recorded as no one: its source reads user: null.
Idempotency-Key is not honored. The change is idempotent by state, so a request whose outcome is unknown (a 504 or a dropped connection) is safe to send again.
A test in another organization is reported as 404, not 403.
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.