Skip to main content
GET
Contacts by label
Auth: TokenAccount or TokenInstanceRate-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.
Use refresh=true to force a sync with WhatsApp before listing, useful when a label was changed on the phone and you want the latest data.

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

Without labelIds 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

string
required
Instance name.

Headers

Query params

string
Label IDs separated by comma. Example: "1,2,3".
string
Label names separated by comma (case-insensitive). Example: "VIP,Support".
boolean
default:"false"
If true, syncs labels with WhatsApp before returning.
Without labelIds or labelNames, returns every chat that has any label.

Error responses

Error 400

List labels

Retrieve IDs and names to use in the filter.

Assign label

Add a label to a chat.