Get WhatsApp Messages
Getting Started
Get WhatsApp Messages
Conversation history for one contact, in the exact form the AI agent is shown it. Scoped to the account behind the API key.
GET
Get WhatsApp Messages
Returns the conversation history for one contact, in the exact form your AI agent is shown it. Only
user_phone_number is required.Quick Example
Response
Messages come back oldest first, the same order the conversation is fed to the model.Fields
string
inbound (from the contact) or outbound (from your agent).string
YYYY-MM-DD HH:MM:SS, IST.string
Whether the message reached the user. See the table below —
sent does not mean it arrived.string
text, template, interactive, image, video, audio, document, contact, and so on.string
The message rendered the way the agent sees it. A template arrives as readable text rather than a raw components blob, so you do not have to reassemble it — see below.
string
WhatsApp’s
wamid. Empty for messages WhatsApp never accepted.string
Present only on media messages: the stored file URL.
array
Present only on outbound messages where the agent called functions. Also summarised inside
body, because that is how the model sees it — this field is the structured version so you do not have to parse it back out.What status means
Only the first three appear in this response.
How body is built
Non-text messages are flattened into one readable string, using the same renderer that builds the model’s context. That is deliberate: what this endpoint returns and what the agent was given cannot drift apart.
What is excluded
To match the agent’s view exactly, the following never appear:- Internal records —
developerrows (system notes, scheduling markers) are not messages anyone sent - Messages that never reached the user —
failedandnot sentare excluded.sentis returned, but see the status table above: it means WhatsApp accepted the message, not that it arrived - Anything before a chat reset — if the conversation was cleared, messages from before that point are excluded, exactly as they are for the agent
limit defaults to 50 and is capped at 200. Values above the cap are silently reduced rather than rejected.Use Cases
- Show history in your own UI without building a renderer for every WhatsApp message type
- Hand context to another system — a CRM note, a support ticket, a human handover
- Debug an agent reply by reading the exact context it was given, including the tool calls it made
Authorizations
API key from https://callkaro.ai/dashboard/api-key
Query Parameters
The contact's number, digits only including country code.
Restrict to one of your WhatsApp numbers. Omit to return this contact's conversation across every number of yours.
How many messages to return, newest kept. Values above 200 are capped at 200.
Required range:
1 <= x <= 200