Reading conversations
List your conversations and read their history.
Two endpoints cover it: /chats/ for the list of conversations, and /messages/ for what was said in each one.
List your chats
curl -H "Authorization: Token $SERVICE_TOKEN" $INBOX/api/v1/chats/Chats come back with the most recent conversation first. Each one has the contact you are talking to, its wa_id, and new_messages — how many messages this user has not yet received.
To get only chats with something new, add ?unread=true.
Reference: List chats
Read a conversation
curl -H "Authorization: Token $SERVICE_TOKEN" "$INBOX/api/v1/messages/?wa_id=$WA_ID&limit=20"You get the 20 most recent messages, newest first. Each message has:
waba_payload— the message exactly as WhatsApp sent it:type,text,timestamp, media and so onfrom_us—falseif the customer sent it,trueif you didsender— which user sent it, for messages from you
Reference: List messages
Load older messages
Take waba_payload.timestamp of the oldest message you have, and ask for the ones before it:
curl -H "Authorization: Token $SERVICE_TOKEN" "$INBOX/api/v1/messages/?wa_id=$WA_ID&limit=20&before_time=1759150800"Use before_time rather than offset: new messages can arrive while you page, which shifts offsets but not timestamps.
Was this helpful?