Flaky Tests

The Trunk Flaky Tests API provides access to check the status of Trunk services and fetch 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 a list of quarantined tests

post
Authorizations
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
POST /v1/flaky-tests/list-quarantined-tests HTTP/1.1
Host: api.trunk.io
x-api-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 151

{
  "repo": {
    "host": "github.com",
    "owner": "my-github-org",
    "name": "my-repo"
  },
  "org_url_slug": "my-trunk-org-slug",
  "page_query": {
    "page_size": 1,
    "page_token": ""
  }
}
{
  "quarantined_tests": [
    {
      "name": "text",
      "parent": null,
      "file": null,
      "classname": null,
      "status": "HEALTHY",
      "codeowners": [
        "text"
      ],
      "quarantine_setting": "ALWAYS_QUARANTINE",
      "status_last_updated_at": "2025-07-03T18:38:00.624Z",
      "test_case_id": "text",
      "variant": "text"
    }
  ],
  "page": {
    "total_rows": 1,
    "total_pages": 1,
    "next_page_token": "text",
    "prev_page_token": "text",
    "last_page_token": "text",
    "page_index": 1
  }
}

Get a list of quarantined tests

post
Authorizations
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
POST /v1/flaky-tests/list-quarantined-tests HTTP/1.1
Host: api.trunk.io
x-api-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 151

{
  "repo": {
    "host": "github.com",
    "owner": "my-github-org",
    "name": "my-repo"
  },
  "org_url_slug": "my-trunk-org-slug",
  "page_query": {
    "page_size": 1,
    "page_token": ""
  }
}
{
  "quarantined_tests": [
    {
      "name": "text",
      "parent": null,
      "file": null,
      "classname": null,
      "status": "HEALTHY",
      "codeowners": [
        "text"
      ],
      "quarantine_setting": "ALWAYS_QUARANTINE",
      "status_last_updated_at": "2025-07-03T18:38:00.624Z",
      "test_case_id": "text",
      "variant": "text"
    }
  ],
  "page": {
    "total_rows": 1,
    "total_pages": 1,
    "next_page_token": "text",
    "prev_page_token": "text",
    "last_page_token": "text",
    "page_index": 1
  }
}

Link a ticket to a test case

post
Authorizations
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
POST /v1/flaky-tests/link-ticket-to-test-case HTTP/1.1
Host: api.trunk.io
x-api-token: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 156

{
  "test_case_id": "01234567-0123-0123-0123-0123456789ab",
  "external_ticket_id": "KAN-123",
  "repo": {
    "host": "github.com",
    "owner": "my-github-org",
    "name": "my-repo"
  }
}

No content

Last updated

OSZAR »