---
title: "Quarantine a test"
method: POST
path: "/apps/{app-slug}/quarantined-tests"
tags: ["test-quarantine"]
---

# Quarantine a test

`POST /apps/{app-slug}/quarantined-tests`

## Request

- Base URL: `https://api.bitrise.io/v0.1`
- URL: `https://api.bitrise.io/v0.1/apps/{app-slug}/quarantined-tests`
- Auth: API key in header `Authorization`

Quarantine a test case of an app. The test is identified by `test_case_identifier` when the test report provides one, otherwise by its name, suite names and class name. Requires permission to run builds and a plan that includes test quarantine.

## Path parameters

- `app-slug` string, required

## Request body

- object
  - `build_slug` string: Slug of a build of the app the test failed in. When omitted, the test is recorded as quarantined from the API.
  - `class_name` string
  - `comment` string
  - `filters` ServiceDtoQuarantinedTestFilters: Limits the quarantine to builds on matching branches and of matching Workflows or Pipelines. Values may contain `*` wildcards. An empty or null list matches everything.
    - `branches` string[], nullable
    - `targets` string[], nullable: Workflow or Pipeline names
  - `test_case_identifier` string
  - `test_case_name` string, required
  - `test_suite_name` string[], required: Names of the test suites containing the test case, outermost first

## Response `201`

Created

- ServiceDtoQuarantinedTest
  - `class_name` string
  - `comment` string
  - `filters` ServiceDtoQuarantinedTestFilters: Limits the quarantine to builds on matching branches and of matching Workflows or Pipelines. Values may contain `*` wildcards. An empty or null list matches everything.
    - `branches` string[], nullable
    - `targets` string[], nullable: Workflow or Pipeline names
  - `id` string: ID of the quarantined test
  - `quarantined_at` string, date-time
  - `quarantined_by` string: Username of the user who quarantined the test
  - `quarantined_from` ServiceDtoQuarantinedTestSource: Where the test was quarantined from
    - `number` integer: Number of the build or pipeline the test was quarantined from
    - `slug` string: Slug of the build or pipeline the test was quarantined from
    - `source` 'api' | 'build' | 'insights' | 'pipeline'
  - `test_case_identifier` string: Identifier of the test case, when the test report provides one
  - `test_case_name` string
  - `test_suite_name` string[]: Names of the test suites containing the test case, outermost first

## Other responses

- `401`: Unauthorized - no valid personal access token or workspace API token
- `403`: Forbidden - user cannot run builds on the app, or the plan of the workspace does not include test quarantine
- `404`: Not found - app does not exist, or user is not authorized
- `409`: Conflict - the test is already quarantined; the response contains it in `quarantined_test`
- `422`: Unprocessable entity - a parameter is missing or invalid, or `build_slug` is not a build of the app

## Changes

- **2026-11-05** `859a161f2622`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bitrise/apis/bitrise-api/changes/apps/:app-slug/quarantined-tests/post.md)

---

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