> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qwairy.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a tag

> Delete a tag label with the ETag you last read. Prompts, answers and history are retained, and the prompts are detached from the deleted tag.

Deletes the label and detaches it from prompts. Prompts and their retained answers
are preserved. The operation requires no request body.

You cannot delete the `Branded` or `Non-branded` system tag: in a workspace created from v1.21, Qwairy sets these two tags itself on prompts from their text.

Requires an active Business, Agency Business or Enterprise plan. Use an API token with write access enabled. See [Writing data](https://docs.qwairy.co/developers/writing-data.md) for
idempotency, conditional requests and error handling.

**Authorization** `string` *required*

Bearer token for your team.

**If-Match** `string` *required*

Copy the complete `ETag` from the latest GET, including its quotes.

**brandId** `string` *required*

Workspace identifier. The workspace must belong to the token's team.

**tagId** `string` *required*

Tag identifier within this workspace.

## Response

Returns `200` with `deleted: true` and `tagId`.
Deleting an already absent label in an accessible workspace also succeeds.
For an existing label, a stale ETag returns `412` without deleting it.

## Synthetic request and response

Use the ETag from [Get a tag](https://docs.qwairy.co/developers/endpoints/tags/get.md). This example assumes `"4"`.

```bash theme={null}
curl -X DELETE "https://www.qwairy.co/api/v1/brands/$BRAND_ID/tags/$TAG_ID" \
  -H "Authorization: Bearer $QWAIRY_API_TOKEN" \
  -H 'If-Match: "4"'
```

```json theme={null}
{
  "deleted": true,
  "tagId": "22222222-0000-4000-8000-000000000000"
}
```

## Errors

| Status | Code | Cause |
| - | - | - |
| 400 | `INVALID_REQUEST` | The tag is the `Branded` or `Non-branded` system tag |
| 404 | `RESOURCE_NOT_FOUND` | Workspace is missing or inaccessible |
| 412 | `PRECONDITION_FAILED` | The existing label changed since your read |
| 428 | `PRECONDITION_REQUIRED` | `If-Match` is missing |

See [Error codes](https://docs.qwairy.co/developers/errors.md) for authentication, plan, idempotency
and server errors. On `429`, honor `Retry-After`; writes can return
`503 SERVICE_UNAVAILABLE` if the write limiter is unavailable.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.