---
title: "List quarantined tests"
method: GET
path: "/ci/{owner}/repositories/{repository}/quarantines"
tags: ["test_insights"]
deprecated: true
---

# List quarantined tests

`GET /ci/{owner}/repositories/{repository}/quarantines`

## Request

- Base URL: `https://api.mergify.com/v1`
- URL: `https://api.mergify.com/v1/ci/{owner}/repositories/{repository}/quarantines`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

> **Deprecated.**

Deprecated: use the test states API, `/ci/{owner}/repositories/{repository}/test-states`.

List the tests currently quarantined in the repository, ordered by `sort` and `direction` (quarantine creation time ascending by default). A quarantine applies to a specific branch or to all branches when `branch` is `null`.

Pass `per_page` (and optionally `cursor`) to receive a bounded page with RFC 5988 navigation links. Omitting `per_page` is deprecated: it returns the full list in a single response, flagged with a `Deprecation` header. A future release will return the first page of 10 quarantines instead.

## Path parameters

- `repository` string, required: The name of the repository
- `owner` string, required: The owner of the repository

## Query parameters

- `branch` string, nullable: Deprecated: use `branch_name`.
- `test_id` string[], nullable: The test identifier to filter on
- `source` QuarantineSource[], nullable: The sources to filter on.
- `branch_name` string[], nullable: The branch name to filter on. Quarantines applying to every branch always match.
- `branch_name_exclude` string[], nullable: The branch name to exclude. Quarantines applying to every branch are kept.
- `pipeline_name` string[], nullable: The pipeline name to filter on. Quarantines applying to every pipeline always match.
- `pipeline_name_exclude` string[], nullable: The pipeline name to exclude. Quarantines applying to every pipeline are kept.
- `job_name` string[], nullable: The job name to filter on. Quarantines applying to every job always match.
- `job_name_exclude` string[], nullable: The job name to exclude. Quarantines applying to every job are kept.
- `test_name` string[], nullable: The test name to filter on
- `test_name_exclude` string[], nullable: The test name to exclude
- `health_status` HealthStatus[], nullable: The health status to filter on. Tests with no recent runs are left out.
- `health_status_exclude` HealthStatus[], nullable: The health status to exclude. Tests with no recent runs are kept.
- `cursor` string, nullable: The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get the previous/next pages.
- `per_page` integer, nullable: The number of items per page, with RFC 5988 cursor pagination. Omitting it is deprecated: it returns the full list in a single response, and will default to 10 in a future release.
- `sort` 'created_at' | 'test_name' | 'pipeline_name' | 'job_name' | 'health_status' | 'source'
- `direction` 'asc' | 'desc': Sort direction. Ascending `created_at` is oldest first; ascending `health_status` is broken, flaky, healthy, then tests with no recent runs. `pipeline_name` and `job_name` put quarantines applying to every pipeline or job first.

## Response `200`

Successful Response

- QuarantinedTestsResponse
  - `size` integer, required: The number of items in this page
  - `per_page` integer, nullable, required: The number of items per page, or `null` when the endpoint was called without `per_page` and returned the full list in a single response.
  - `quarantined_tests` QuarantinedTest[], required
    - `id` string, uuid, required: Unique identifier of the quarantine record.
    - `test_name` string, required: Fully qualified name of the quarantined test.
    - `test_id` string, uuid, required: Stable identifier of the test, derived from its name. Identical across every quarantine of the same test and matches the `test_id` filter on the list endpoint.
    - `reason` string, required: Free-form reason recorded when the test was quarantined.
    - `issue_url` string, nullable, required: Link to where the fix of the test is tracked, such as an issue. `null` when none was given.
    - `branch` string, nullable, required: Deprecated: use `branch_name`.
    - `branch_name` string, nullable, required: Branch this quarantine applies to. `null` means the test is quarantined on every branch.
    - `pipeline_name` string, nullable, required: Pipeline this quarantine applies to. `null` means the test is quarantined in every pipeline.
    - `job_name` string, nullable, required: Job this quarantine applies to. `null` means the test is quarantined in every job.
    - `created_at` string, date-time, required: UTC timestamp when the test was added to quarantine.
    - `source` 'manual' | 'auto'
    - `health_status` 'healthy' | 'flaky' | 'broken', required
    - `is_recovered` boolean, required: True when recent runs of this test are healthy, suggesting the test could be unquarantined.
    - `unquarantine_when_healthy` boolean, required: True when Mergify unquarantines this test once it recovers.
  - `total` integer, required: Total number of quarantines matching the filters, across all pages.

## Other responses

- `403`: Forbidden
- `404`: Not found
- `409`: Conflict
- `422`: Unprocessable entity

## Changes

- **2026-10-22** `f0fe01773ba8`: 1 info
  - endpoint deprecated
- **2026-10-19** `a01b82176fba`: 1 info
  - added the required property `quarantined_tests/items/issue_url` to the response with the `200` status
- **2026-10-08** `708566d3689b`: 1 info
  - added the required property `quarantined_tests/items/unquarantine_when_healthy` to the response with the `200` status
- **2026-10-06** `95a430805010`: 1 breaking, 6 info
  - the `query` request parameter `sort` was restricted to a list of enum values
  - added the new enum value `created_at` to the `query` request parameter `sort`
  - added the new enum value `health_status` to the `query` request parameter `sort`
  - added the new enum value `job_name` to the `query` request parameter `sort`
  - …3 more
- **2026-10-05** `9da975fb5680`: 2 breaking, 4 info
  - `query` request parameter `test_id` list-of-types was narrowed by removing types `string`
  - for the `query` request parameter `test_id`, the type of property `anyOf[subschema #1]/` was specialized from `string` to `array`, and format from `uuid` to no format
  - added the new optional `query` request parameter `direction`
  - added the new optional `query` request parameter `health_status`
  - …2 more

[Operation history](https://skmtc.dev/mergify/apis/mergify-api/changes/ci/:owner/repositories/:repository/quarantines/get.md)

---

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