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

# Delete label

> Removes a label and clears all of its assignments

**Auth:** `TokenAccount` or `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotent:** yes

## Description

Removes the label identified by `tagId` and automatically unassigns it from every chat that had it. Propagation to WhatsApp via app state may take **1 to 2 seconds**.

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://ryzeapi.cloud/api/chat/tag/$Instance_Name?tagId=3" \
    -H "token: $Token_Instance"
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/chat/tag/${process.env.Instance_Name}?tagId=3`, {
    method: "DELETE",
    headers: {
      "token": process.env.Token_Instance
    }
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.delete(
      f"https://ryzeapi.cloud/api/chat/tag/{os.environ['Instance_Name']}?tagId=3",
      headers={"token": os.environ["Token_Instance"]}
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
  )

  func main() {
      req, _ := http.NewRequest("DELETE", "https://ryzeapi.cloud/api/chat/tag/"+os.Getenv("Instance_Name")+"?tagId=3", nil)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Success response

The envelope returns `tag` containing only the removed `id` and `deleted: true`, the other fields (`name`, `color`, `type`) come empty because the label no longer exists. Use `success` to audit the operation.

```json 200 OK theme={null}
{
  "success": true,
  "message": "Tag deleted successfully",
  "tag": {
    "id": "3",
    "name": "",
    "color": 0,
    "type": "",
    "deleted": true
  }
}
```

## Path parameters

<ParamField path="instance" type="string" required>
  Instance name.
</ParamField>

## Query params

<ParamField query="tagId" type="string" required>
  ID of the label to remove.
</ParamField>

## Headers

| Name    | Required                 | Example        | Description                    |
| ------- | ------------------------ | -------------- | ------------------------------ |
| `token` | yes (or `Authorization`) | `a1b2c3d4-...` | TokenAccount or TokenInstance. |

## Error responses

| HTTP | `error.message`                         | When it happens    |
| ---- | --------------------------------------- | ------------------ |
| 400  | `Instance name is required`             | Empty `:instance`. |
| 400  | `tagId query parameter is required`     | Missing `tagId`.   |
| 401  | `Invalid token`                         | ,                  |
| 404  | `Instance not found`                    | ,                  |
| 404  | `Tag not found`                         | ,                  |
| 503  | `Instance is not connected to WhatsApp` | ,                  |

```json Error 400 theme={null}
{
  "success": false,
  "error": { "message": "tagId query parameter is required" }
}
```

## Related

<CardGroup cols={2}>
  <Card title="List labels" href="/en/api/chat/tags-list">
    Check available IDs.
  </Card>

  <Card title="Unassign label" href="/en/api/chat/tags-unassign">
    Remove the label from a specific chat instead of deleting it.
  </Card>
</CardGroup>
