---
title: "List flaky tests"
method: GET
path: "/api/v1/user/projects/{projectId}/flaky-tests"
tags: ["Analytics"]
---

# List flaky tests

`GET /api/v1/user/projects/{projectId}/flaky-tests`

## Request

- Base URL: `https://app.gaffer.sh`
- URL: `https://app.gaffer.sh/api/v1/user/projects/{projectId}/flaky-tests`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in header `X-API-Key`
  - HTTP bearer

Returns tests identified as flaky based on flip rate analysis.
A test is considered flaky if its flip rate exceeds the threshold.
The analysis period is clamped by your plan tier.

## Path parameters

- `projectId` string, required

## Query parameters

- `threshold` number
- `limit` integer
- `days` integer

## Response `200`

List of flaky tests with summary

- FlakyTestsResponse
  - `flakyTests` FlakyTest[], required
    - `name` string, required: Full test name
    - `flipRate` number, required: Rate of pass/fail transitions (0-1)
    - `flipCount` integer, required: Number of state transitions
    - `totalRuns` integer, required: Total test executions
    - `lastSeen` string, date-time, required: When the test was last executed
    - `flakinessScore` number, required: Composite flakiness score (0-1) combining flip proximity, failure rate, and duration variability. Higher values indicate more problematic flaky tests.
  - `summary` object, required
    - `threshold` number, required: Flip rate threshold used
    - `totalFlaky` integer, required: Total number of flaky tests found
    - `period` integer, required: Analysis period in days
  - `meta` Meta, nullable: Present when query parameters were clamped by plan tier limits. Only included in the response when clamping actually occurred.
    - `appliedDays` integer: The actual days value used after clamping
    - `requestedDays` integer: The days value originally requested
    - `appliedLimit` integer: The actual limit value used after clamping
    - `requestedLimit` integer: The limit value originally requested
    - `clampedByPlan` boolean: Always true when this object is present

## Other responses

- `400`: Invalid request parameters
- `401`: Missing or invalid API key
- `404`: Resource not found

---

[API](https://skmtc.dev/gaffer/apis/gaffer-api.md) · [All operations](https://skmtc.dev/gaffer/apis/gaffer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gaffer/apis/gaffer-api/revisions/d742ab303118?raw)
