Conversations
Search Chats
Searches chats with advanced filters: by name, label, status, group, and more.
POST
https://api.zapzapapi.com/api/v1/{instanceId}/chat/findAuthentication with the x-api-key and x-api-secret headers.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
operator | select | body | No | Logical operator between filters |
sort | text | body | No | Sorting (+/- field, e.g. -wa_lastMsgTimestamp) |
limit | number | body | No | Maximum number of results to return |
offset | number | body | No | Number of records to skip (for pagination) |
wa_fastid | text | body | No | Internal chat ID |
wa_chatid | text | body | No | Chat ID on WhatsApp |
wa_archived | select | body | No | Archived? |
wa_contactName | text | body | No | Contact name |
wa_name | text | body | No | Name on WhatsApp |
name | text | body | No | Name |
wa_isBlocked | select | body | No | Blocked? |
wa_isGroup | select | body | No | Is a group? |
wa_isGroup_admin | select | body | No | Is group admin? |
wa_isGroup_announce | select | body | No | Admins-only group? |
wa_isGroup_member | select | body | No | Is group member? |
wa_isPinned | select | body | No | Pinned? |
wa_label | text | body | No | ID of the label applied to the chat. Use the value returned by `/labels`, not the label name. |
wa_notes | text | body | No | Has notes? |
lead_tags | text | body | No | Lead tags |
lead_isTicketOpen | select | body | No | Open ticket? |
lead_assignedAttendant_id | text | body | No | Agent ID |
lead_status | text | body | No | Lead status |
Request example
curl
curl -X POST "https://api.zapzapapi.com/api/v1/{instanceId}/chat/find" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-api-secret: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"operator":"AND","sort":"-wa_lastMsgTimestamp"}'Node.js
const res = await fetch("https://api.zapzapapi.com/api/v1/{instanceId}/chat/find", {
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
"x-api-secret": "YOUR_API_SECRET",
"Content-Type": "application/json",
},
body: JSON.stringify({
"operator": "AND",
"sort": "-wa_lastMsgTimestamp"
}),
});
console.log(await res.json());Python
import requests
res = requests.post(
"https://api.zapzapapi.com/api/v1/{instanceId}/chat/find",
headers={"x-api-key": "YOUR_API_KEY", "x-api-secret": "YOUR_API_SECRET"},
json={"operator":"AND","sort":"-wa_lastMsgTimestamp"},
)
print(res.json())Response example
JSON
{
"chats": [
{
"jid": "5511999999999@s.whatsapp.net",
"name": "João",
"unreadCount": 3
}
]
}Values are illustrative; the fields follow the real response format.
Other endpoints in this category
Get your API keys
Create your account, connect a number in minutes and start using the API. R$15 per active number/month, with a welcome credit when you create the account, subject to the current campaign.
