> ## 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.

# Unassign label

> Removes a specific label from a chat

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

## Description

Removes **one** label from a chat. If the chat does not have that label, the operation is considered a success (idempotent). The label itself is **not deleted**, to delete it, use [Delete label](/en/api/chat/tags-delete).

## Example

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

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

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

  requests.delete(
      f"https://ryzeapi.cloud/api/chat/assignTag/{os.environ['Instance_Name']}?number=5511999999999&tagId=2",
      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/assignTag/"+os.Getenv("Instance_Name")+"?number=5511999999999&tagId=2", nil)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Success response

The response confirms the removal by echoing the `tag_id`. The envelope reuses the same shape as `tags-assign`, only with `message: "Tag removed successfully"`.

```json 200 OK theme={null}
{
  "success": true,
  "message": "Tag removed successfully",
  "tag_id": "2"
}
```

## Path parameters

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

## Query params

<ParamField query="number" type="string" required>
  Phone number, private JID (`...@s.whatsapp.net` or `...@lid`), group JID (`...@g.us`), or newsletter.
</ParamField>

<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`             | ,               |
| 400  | `number query parameter is required`    | ,               |
| 400  | `tagId query parameter is required`     | ,               |
| 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="Assign label" href="/en/api/chat/tags-assign">
    Reassign the label to another chat.
  </Card>

  <Card title="Delete label" href="/en/api/chat/tags-delete">
    Remove the label from the entire instance.
  </Card>
</CardGroup>
