Skip to content

Contact Activity

cURL
curl "https://api.whatbot.in/public/v1/contacts/whatsapp-activity?source_ref=crm-lead-4821" \
-H "X-API-Key: wa_live_xxx"
FieldTypeRequiredDescription
source_refstringOne of source_ref / phoneThe source_ref you set on the contact with POST /contacts. Preferred — it works for contacts pushed without a phone number.
phonestringOne of source_ref / phoneThe contact’s number, any format. Matched exactly. Works even for a number that was never pushed as a contact but has conversations.
lead_idstringYour own id for the record. Echoed back as lead_id, for correlating the response.

Passing neither returns 422. A source_ref with no matching contact is not an error: you get 200 with every section empty, so you can render “no WhatsApp activity yet” without special-casing it.

200
{
"lead_id": "crm-lead-4821",
"contact": {
"id": "4f1c...",
"phone": "+919876543210",
"name": "Ravi Kumar",
"attributes": { "city": "Chennai" },
"tags": ["gold"],
"opt_in": "opted_in"
},
"summary": {
"conversations": 1,
"flow_runs": 2,
"ai_sessions": 1,
"forms_filled": 1,
"broadcasts_received": 4,
"last_message_at": "2026-09-15T10:03:12+00:00"
},
"conversations": [ { "id": "c9e6f0f7-...", "phone_number": "919876543210", "contact_name": "Ravi Kumar", "status": "open", "last_message_at": "...", "phone_number_id": "1066..." } ],
"flows": [ { "execution_id": "7d1e...", "flow_name": "Site visit booking", "status": "completed", "responses": [ { "question": "...", "answer": "..." } ], "variables": { } } ],
"ai_sessions": [ { "session_id": "...", "agent_name": "Sales assistant", "status": "...", "turns": [ { "user_text": "...", "agent_text": "..." } ] } ],
"forms": [ { "response_id": "...", "form_name": "Site visit", "submitted_at": "...", "answers": { } } ],
"broadcasts": [ { "broadcast_name": "Diwali offer", "template_name": "diwali_offer", "status": "read", "sent_at": "..." } ],
"truncated": { "flows": false, "ai_sessions": false, "forms": false, "broadcasts": false }
}
SectionWhat it holdsCap
contactThe contact record. opt_in is opted_in, opted_out or pending. When there is no contact record, id, name and opt_in are null and attributes/tags are empty; on a phone lookup, phone still echoes the number you passed.—
conversationsThe contact’s conversations, one per business number they’ve talked to.25
flowsFlow runs, with the questions asked and the answers given.25
ai_sessionsAI agent conversations, with their turns.10 sessions, 50 turns in all
formsSubmitted WhatsApp forms and their answers.25
broadcastsBroadcasts sent to the contact, with delivery status.50
summaryCounts of the above, plus the latest last_message_at.—
truncatedtrue for a section that reached its cap — there may be more history than shown.—

Each section is the most recent entries first. lead_id is the value you passed, or a lead linked to one of the contact’s conversations.

StatusCause
401Missing/invalid API key
422Neither a source_ref nor a valid phone was given