Skip to content

Messaging Window

WhatsApp only delivers free-form messages (text, images, documents) within 24 hours of the customer’s last inbound message. Outside that window only an approved template lands. This endpoint answers both halves of that problem in one call:

  • Can I send free-form right now? → window_open
  • Have they replied yet? → latest_inbound
cURL
curl "https://api.whatbot.in/public/v1/messaging-window?phone=919876543210" \
-H "X-API-Key: wa_live_xxx"
FieldTypeRequiredDescription
phonestringyesThe customer’s number, in any format. Normalised to E.164. A number that can’t be normalised returns 422.
sincestringAn ISO timestamp. Only report latest_inbound if it is newer than this. A value that is not ISO 8601 returns 422 rather than being ignored; an empty value is treated as absent.
FieldTypeRequiredDescription
phonestringThe number, normalised to E.164.
conversation_idstringThe conversation, or null if they have never messaged you.
window_openboolean | nulltrue if a free-form message will be delivered right now, false if only a template will. null means we could not tell — see below.
window_knownbooleanfalse when the lookup failed and window_open is null.
last_inbound_atstringWhen they last messaged you, or null.
seconds_remainingnumber | nullSeconds of free-form window left. 0 when closed, null when the window could not be determined.
latest_inboundobjectTheir most recent message — {id, type, text, timestamp} — or null. text is null for a message with no text (e.g. a photo without a caption).
200
{
"phone": "+919876543210",
"conversation_id": "a5230fa7-...",
"window_open": true,
"window_known": true,
"last_inbound_at": "2026-08-27T10:00:00Z",
"seconds_remaining": 82800,
"latest_inbound": {
"id": "b1f0...",
"type": "text",
"text": "hi",
"timestamp": "2026-08-27T10:00:00Z"
}
}

If the lookup itself fails, this endpoint says so rather than guessing:

200
{
"phone": "+919876543210",
"conversation_id": null,
"last_inbound_at": null,
"window_open": null,
"window_known": false,
"seconds_remaining": null,
"latest_inbound": null
}

Treat window_open: null as unknown, not open. It is deliberately not reported as false either — a contact who messaged you a minute ago has not suddenly gone quiet. Retry, or send with fallback_template_name so the send itself decides.

Timestamps in the response end in Z, so you can paste one straight back into a query string. Pass since to poll without re-reading the same message. Take the timestamp you last saw, and latest_inbound stays null until something genuinely newer arrives:

cURL
curl "https://api.whatbot.in/public/v1/messaging-window?phone=919876543210&since=2026-08-27T10:00:00Z" \
-H "X-API-Key: wa_live_xxx"

This is what lets an automated caller ask someone to message in, watch for it, and switch to free-form the moment it lands — that inbound message is what opens the window.