Contacts and Chats
Check whether a number has WhatsApp, list contacts and chats, read message history and follow presence.
These routes are under the Contacts, Chats and Presence tags in the API Reference tab. They read what is on the number's WhatsApp right now.
Contacts
| Route | What it does |
|---|---|
GET /contacts/check?phone=... | Does this number have WhatsApp? |
GET /contacts/profile-picture?phone=... | A contact's profile picture. |
GET /contacts | The contacts the number knows, paginated. |
Check a number
curl "https://app.wappfy.io/api/v1/contacts/check?phone=5581999999999" \
-H "X-Api-Key: wpf_YOUR_KEY"{
"data": { "exists": true, "chat_id": "5581999999999@c.us", "phone": "5581999999999" }
}exists: falseis an answer, not an error.chat_idis the address sends to this number will use (it can be@lid), ornullwhen the number has no WhatsApp.- For Brazilian numbers, both spellings of the ninth digit are checked, and
phonecomes back in the spelling WhatsApp confirmed.
Profile picture
GET /contacts/profile-picture?phone=5581999999999 returns url (a temporary WhatsApp link) and chat_id. url is null when the person has no picture or hides it.
List contacts
curl "https://app.wappfy.io/api/v1/contacts?limit=100&offset=0" \
-H "X-Api-Key: wpf_YOUR_KEY"Each item has chat_id, phone (digits only, or null when WhatsApp didn't reveal the number), name (as saved on the phone), push_name (the name the person set on WhatsApp), is_my_contact and is_group. limit goes from 1 to 500 (default 100), and the order is stable between pages.
Chats
| Route | What it does |
|---|---|
GET /chats | The chats, most recent first, each with its last message. |
GET /chats/{chatId}/messages | A chat's messages, most recent first. |
curl "https://app.wappfy.io/api/v1/chats?limit=20&offset=0" \
-H "X-Api-Key: wpf_YOUR_KEY"
curl "https://app.wappfy.io/api/v1/chats/5581999999999@c.us/messages?limit=50&before=1791912000" \
-H "X-Api-Key: wpf_YOUR_KEY"{
"data": [
{
"message_id": "false_5581999999999@c.us_3EB0C767D26A1D5E",
"chat_id": "5581999999999@c.us",
"from_me": false,
"from": "5581999999999",
"is_group": false,
"type": "text",
"text": "Is this one still available?",
"has_media": false,
"media": null,
"reply_to": null,
"status": null,
"timestamp": 1791911879
}
]
}- A chat comes with
chat_id,name,phone,is_group,picture_urlandlast_message(same format as a message, ornull). {chatId}is a chat ID fromGET /chatsor a webhook, or a phone number with country code and area code.limitgoes from 1 to 100 (default 20). For messages,beforeandafterfilter by time (Unix seconds, exclusive).statusonly appears on messages the number sent:pending,sent,delivered,read,playedorfailed.mediahas a Wappfy link when the file already came through the webhook. Otherwisehas_mediaistrueandmediaisnull: these reads don't download files from WhatsApp.- These reads can come from the 10-second cache (
Ageheader). To follow new messages, use themessage.receivedwebhook instead of polling.
Presence
| Route | What it does |
|---|---|
POST /presence | Show the number as online or offline to everyone. |
POST /chats/{chatId}/presence/subscribe | Start receiving a contact's presence. |
GET /chats/{chatId}/presence | The last presence known for a chat. |
# subscribe to a contact's presence, then read it
curl -X POST https://app.wappfy.io/api/v1/chats/5581999999999/presence/subscribe \
-H "X-Api-Key: wpf_YOUR_KEY"
curl https://app.wappfy.io/api/v1/chats/5581999999999/presence \
-H "X-Api-Key: wpf_YOUR_KEY"{
"data": {
"chat_id": "5581999999999@c.us",
"is_group": false,
"presences": [{ "phone": "5581999999999", "presence": "online", "last_seen": null }]
}
}- A contact's presence only shows up after you subscribe, and only for people who share it. Before that,
presencesis empty. In a group, there is one entry per participant. presenceisonline,offline,typing,recordingorpaused.- The presence read is never cached, but it counts toward the polling limit. To follow it, enable the
presencewebhook event instead (it is off by default).
While the number is online through POST /presence, WhatsApp doesn't send notifications to the phone. Send offline when you are done.
To show "typing..." in a chat before replying, see Sending messages.

