Chat
Assign label
Applies a label to a chat
POST
Assign label
Auth:
TokenAccount or TokenInstance • Rate-limit: Global (100/min) • Idempotent: yes
Description
Assigns an existing label to a chat. If the label is already present on the chat, the operation is treated as success (idempotent). The change is propagated to WhatsApp via app state.Example
Success response
The response confirms the assignment by echoing the appliedtag_id. chat_jid is not included when the handler delegates only to the service (omitempty fields); rely on success/message for the operation result.
200 OK
Path parameters
Instance name.
Headers
| Name | Required | Example | Description |
|---|---|---|---|
Content-Type | yes | application/json | , |
token | yes (or Authorization) | a1b2c3d4-... | TokenAccount or TokenInstance. |
Request body
Phone number (
5511999999999), private JID (...@s.whatsapp.net or ...@lid), group JID (...@g.us), or newsletter.ID of the label to assign.
Error responses
| HTTP | error.message | When it happens |
|---|---|---|
| 400 | Instance name is required | , |
| 400 | Invalid request body: <...> | Malformed JSON. |
| 400 | Number is required | , |
| 400 | tagId is required | , |
| 401 | Invalid token | , |
| 404 | Instance not found | , |
| 404 | Tag not found | tagId does not exist. |
| 503 | Instance is not connected to WhatsApp | , |
Error 404
Related
Unassign label
Remove the label from the chat.
Contacts by label
List every chat that has the label.