Chat
Contacts by label
Filters chats that have one or more labels assigned
GET
Contacts by label
Auth:
TokenAccount or TokenInstance • Rate-limit: Global (100/min) • Idempotent: yes
Description
Returns chats that have at least one of the given labels. You can filter by IDs, by names (case-insensitive), or return every chat that has any label at all.Examples
By IDs
Filters chats that have at least one of the labels listed in?labelIds=1,2. Useful when you already know the IDs from /tags-list.
By names (with refresh)
Filters by name via?labelNames=VIP,Support (case-insensitive) and adds refresh=true to force a sync with WhatsApp before listing, ensuring changes made on the phone are already visible.
All with labels
WithoutlabelIds or labelNames, returns every chat that has any label assigned. Useful to audit the overall use of labels on the account.
Success response
chats is a list of ChatWithLabels objects grouping every label associated with each chat. Use total_chats for the number of unique chats and total_rows for the total number of chat-label pairs. refreshed indicates whether the cache was rebuilt in this call (refresh=true); filter_label_ids repeats the IDs effectively applied.
200 OK
Path parameters
Instance name.
Headers
| Name | Required | Example | Description |
|---|---|---|---|
token | yes (or Authorization) | a1b2c3d4-... | TokenAccount or TokenInstance. |
Query params
Label IDs separated by comma. Example:
"1,2,3".Label names separated by comma (case-insensitive). Example:
"VIP,Support".If
true, syncs labels with WhatsApp before returning.Without
labelIds or labelNames, returns every chat that has any label.Error responses
| HTTP | error.message | When it happens |
|---|---|---|
| 400 | Instance name is required | Empty :instance. |
| 401 | Invalid token | , |
| 404 | Instance not found | , |
| 503 | Instance is not connected to WhatsApp | Required when refresh=true. |
Error 400
Related
List labels
Retrieve IDs and names to use in the filter.
Assign label
Add a label to a chat.