Skip to main content
POST
/
flaky-tests
/
list-unhealthy-tests
Get a list of unhealthy tests
curl --request POST \
  --url https://api.trunk.io/v1/flaky-tests/list-unhealthy-tests \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '
{
  "repo": {
    "host": "<string>",
    "owner": "<string>",
    "name": "<string>"
  },
  "org_url_slug": "<string>",
  "page_query": {
    "page_size": 50,
    "page_token": "<string>"
  }
}
'
{
  "tests": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "repository": {
        "html_url": "<string>"
      },
      "html_url": "<string>",
      "name": "<string>",
      "variant": "<string>",
      "status": {
        "reason": "<string>",
        "timestamp": "2023-11-07T05:31:56Z"
      },
      "codeowners": [
        "<string>"
      ],
      "pull_requests_impacted_last_7d": 1,
      "quarantined": true,
      "file_path": "<string>",
      "parent": "<string>",
      "classname": "<string>",
      "ticket": {
        "html_url": "<string>"
      }
    }
  ],
  "page": {
    "total_rows": 1,
    "total_pages": 1,
    "next_page_token": "<string>",
    "prev_page_token": "<string>",
    "last_page_token": "<string>",
    "page_index": 1
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.trunk.io/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-token
string
header
required

Body

application/json
repo
object
required

The repository to list tests for.

org_url_slug
string
required

The slug of your organization. Find this at https://app.trunk.io/trunk/settings under "Organization Name" > "Slug"

Example:

"my-trunk-org-slug"

page_query
object
required

Pagination options for the list of tests.

status
enum<string>
required

The status filter for unhealthy tests.

Available options:
FLAKY,
BROKEN

Response

OK

tests
object[]
required

A page of unhealthy test cases.

page
object
required

Pagination information for the list of test cases.