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

# Listar etiquetas

> Lista todas las etiquetas registradas en la instancia

**Auth:** `TokenAccount` o `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotente:** sí

## Descripción

Devuelve todas las etiquetas conocidas por la instancia, incluyendo las creadas vía API y las importadas desde el app state de WhatsApp. Cada etiqueta lleva un `id`, `name`, `color` (paleta nativa de WhatsApp), `type` y bandera `deleted`.

<Info>
  `color` es un entero entre **0 y 10** que mapea a los colores oficiales de WhatsApp Business. Las etiquetas marcadas con `deleted=true` siguen apareciendo en la lista hasta que la sincronización las elimine definitivamente.
</Info>

## Ejemplo

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

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

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

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

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

  import (
      "net/http"
      "os"
  )

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

## Respuesta exitosa

`tags` es el array de etiquetas conocidas por la cuenta de WhatsApp Business; `total` repite el tamaño. Cada entrada lleva `id` (úsalo en `tags-assign`/`tags-unassign`/`tags-delete`), `name`, `color` (0–10) y `type`. Las etiquetas marcadas con `deleted: true` representan eliminaciones pendientes de propagación.

```json 200 OK theme={null}
{
  "success": true,
  "message": "Tags retrieved successfully",
  "tags": [
    { "id": "1", "name": "Important", "color": 0, "type": "CUSTOM", "deleted": false },
    { "id": "2", "name": "VIP", "color": 5, "type": "CUSTOM", "deleted": false }
  ],
  "total": 2
}
```

## Parámetros de ruta

<ParamField path="instance" type="string" required>
  Nombre de la instancia.
</ParamField>

## Cabeceras

| Nombre  | Requerido              | Ejemplo        | Descripción                   |
| ------- | ---------------------- | -------------- | ----------------------------- |
| `token` | sí (o `Authorization`) | `a1b2c3d4-...` | TokenAccount o TokenInstance. |

## Respuestas de error

| HTTP | `error.message`                         | Cuándo ocurre      |
| ---- | --------------------------------------- | ------------------ |
| 400  | `Instance name is required`             | `:instance` vacío. |
| 401  | `Invalid token`                         | ,                  |
| 404  | `Instance not found`                    | ,                  |
| 503  | `Instance is not connected to WhatsApp` | ,                  |

```json Error 401 theme={null}
{
  "success": false,
  "error": { "message": "Invalid token" }
}
```

## Relacionados

<CardGroup cols={2}>
  <Card title="Crear etiqueta" href="/es/api/chat/tags-create">
    `POST /api/chat/tag/:instance`
  </Card>

  <Card title="Asignar a un chat" href="/es/api/chat/tags-assign">
    `POST /api/chat/assignTag/:instance`
  </Card>
</CardGroup>
