Events and recovery
Combine live notifications with durable account and chat logs.
The API separates notification from durable content:
GET /v1/streams/eventsdelivers live account events over SSE.GET /v1/event_logpages the same account sequence for bounded recovery.GET /v1/chats/{chat}/eventsreturns the detailed, gapless journal for one chat.
An account event identifies a chat and a seq_from–seq_to range. Fetch that
range from the chat journal to read the content. Do not treat every event as a
reply trigger: one customer message may also produce a window-opened event,
and an outbound message may later produce delivered and read events. A
message.failed event points at the message; the message row you fetch is
what carries the
published failure reason,
when there is one.
Cursor rules
Section titled “Cursor rules”- Persist the SSE
idand send it back asLast-Event-IDafter reconnecting. - The event-log cursor is opaque; pass
next_cursorback unchanged. - A chat cursor is the last gapless numeric
seqyou processed. - Keep all three cursor domains separate.
- A cursor older than retained account history returns HTTP
410witherror.code2032; reconnect without a cursor to continue from the current position. - Ignore unknown event kinds so newly added kinds remain backward compatible.
template.updatedis an account event, not a chat event: it has nochat_idor sequence range. See Template events.
Webhooks carry the same stable event identity as the stream. Deduplicate the two sinks by event ID if you consume both.
With zero-day retention,
the stream and the event log carry empty parts and zero_retention: true.
Template events
Section titled “Template events”template.updated fires when a template’s status or category changes:
approval, rejection, a pause and the approval that lifts it, and a
recategorisation. It arrives on the stream and in the event log for production
keys, and at webhook endpoints that are not scoped to phone numbers. An
endpoint with no event_kinds receives it; select it with
event_kinds: ["template.updated"].
{ "id": "evt_4b1d…", "type": "template.updated", "timestamp": "2026-10-27T14:03:11.208Z", "data": { "name": "order_shipped", "language": "en_US", "category": "utility", "status": "approved", "previous_category": "utility", "previous_status": "pending" }}previous_statusandprevious_categoryare absent when the template is newly listed, for example one created outside this API, and when templates are announced again after your account is reconnected.- Your own create is normally not announced, but it may be followed by one
event with
previous_status: "draft". Rely on neither. - An approved template whose variables cannot be addressed by name is reported
as
paused, so its first event can readpendingtopaused. - Treat the event as a prompt to read, not as the template. After an approval,
send_schemacan still benullfor up to about fifteen minutes. KeepGET /v1/templatesas the authority and read it on start-up and after any gap in your event handling.
See Templates for the full lifecycle.
Messages with attachments
Section titled “Messages with attachments”For all WhatsApp accounts, a message.received event for a message carrying an
image, video, audio, document or sticker waits until every attachment has been
captured or has failed, or ten minutes have elapsed since Linq received the
message, whichever comes first. It is not released earlier while capture is
pending. The event takes its position in the stream and the event log when it
is recorded.
At the deadline, any still-pending attachment is marked availability: unavailable
and unavailable_reason: timed_out. Capture continues, so the attachment may
become downloadable later; the recorded event remains unchanged. See
Download incoming attachments.
The ten-minute deadline bounds the capture wait, not webhook delivery or retries.
Such an event can arrive after events for later messages of the same chat, on
webhooks, the event stream and the event log alike. Its data.seq_from can be
lower than one you already received, and its chat.window.opened event can
arrive first.
- Never discard an event because its
seq_fromis lower than one already received. - Deduplicate by the event
id. - Order a chat by
data.seq_from. - For live processing, buffer briefly or reconcile with
GET /v1/chats/{chat}/events.
Events for messages without attachments, and every other event kind, keep their order.