Conversations

Search Chats

Searches chats with advanced filters: by name, label, status, group, and more.

POSThttps://api.zapzapapi.com/api/v1/{instanceId}/chat/find

Authentication with the x-api-key and x-api-secret headers.

Parameters

NameTypeInRequiredDescription
operatorselectbodyNoLogical operator between filters
sorttextbodyNoSorting (+/- field, e.g. -wa_lastMsgTimestamp)
limitnumberbodyNoMaximum number of results to return
offsetnumberbodyNoNumber of records to skip (for pagination)
wa_fastidtextbodyNoInternal chat ID
wa_chatidtextbodyNoChat ID on WhatsApp
wa_archivedselectbodyNoArchived?
wa_contactNametextbodyNoContact name
wa_nametextbodyNoName on WhatsApp
nametextbodyNoName
wa_isBlockedselectbodyNoBlocked?
wa_isGroupselectbodyNoIs a group?
wa_isGroup_adminselectbodyNoIs group admin?
wa_isGroup_announceselectbodyNoAdmins-only group?
wa_isGroup_memberselectbodyNoIs group member?
wa_isPinnedselectbodyNoPinned?
wa_labeltextbodyNoID of the label applied to the chat. Use the value returned by `/labels`, not the label name.
wa_notestextbodyNoHas notes?
lead_tagstextbodyNoLead tags
lead_isTicketOpenselectbodyNoOpen ticket?
lead_assignedAttendant_idtextbodyNoAgent ID
lead_statustextbodyNoLead 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.

See the full reference

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.