---
title: "Get flaky tests for a project"
method: GET
path: "/insights/{project-slug}/flaky-tests"
tags: ["Insights"]
---

# Get flaky tests for a project

`GET /insights/{project-slug}/flaky-tests`

## Request

- Base URL: `https://circleci.com/api/v2`
- URL: `https://circleci.com/api/v2/insights/{project-slug}/flaky-tests`
- Auth: one of:
  - API key in header `Circle-Token`
  - HTTP bearer
  - HTTP basic
  - API key in query parameter `circle-token`

Get a list of flaky tests for a given project. Flaky tests are branch agnostic.
             A flaky test is a test that passed and failed in the same commit.

## Path parameters

- `project-slug` string, required

## Response `200`

A list of flaky tests for a project

- object: Flaky tests response
  - `flaky-tests` object[], required: A list of all instances of flakes. Note that a test is no longer considered flaky after 2 weeks have passed without a flake. Each flake resets this timer.
    - `time-wasted` integer
    - `workflow-created-at` string, required: The date and time when workflow was created.
    - `workflow-id` unknown, required
    - `classname` string, required: The class the test belongs to.
    - `pipeline-number` integer, required: The number of the pipeline.
    - `workflow-name` string, required: The name of the workflow.
    - `test-name` string, required: The name of the test.
    - `job-name` string, required: The name of the job.
    - `job-number` integer, required: The number of the job.
    - `times-flaked` integer, required: The number of times the test flaked.
    - `source` string, required: The source of the test.
    - `file` string, required: The file the test belongs to.
  - `total-flaky-tests` number, double, required: A count of unique tests that have failed. If your project has N tests that have flaked multiple times each, this will be equal to N.

## Other responses

- `default`: Error response.

---

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