---
title: "Hard-delete all test cases with the given tag."
method: DELETE
path: "/test/cases"
tags: ["TestCases"]
---

# Hard-delete all test cases with the given tag.

`DELETE /test/cases`

Permanently removes all test cases created with the specified tag (and all their child entities) from the database.

**Scoped cleanup:** Each CI pipeline run should create cases with a unique tag (e.g. `suite-run-{uuid}`) and use this endpoint at the end of the run to clean up, without affecting cases from parallel pipeline runs.

**This is a hard-delete.** Rows are removed entirely with no recovery path. This is intentional for CI environments.

**Guards:**
- Returns 400 if any matched case is classified as Production. The entire operation is rejected and nothing is deleted.
- Returns 400 if the tag query parameter is missing or blank.

**Idempotent:** Returns 204 even if no cases match the tag — no error is raised.

## Query parameters

- `tag` string

## Response `204`

Cases deleted (or none matched — idempotent, no response body)

## Other responses

- `400` — Tag is missing/blank, or matched cases include a Production case
- `500` — Internal server error

---

[API](https://skmtc.net/debitura/apis/debitura-customer-api.md) · [All operations](https://skmtc.net/debitura/apis/debitura-customer-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/debitura/debitura-customer-api/versions/46478f2e476f/schema)
