List a chat's events
Reads a chat’s event sequence in order — the transcript API. Stored
positions are assigned contiguously from seq 1 and never renumbered.
When ephemeral messages are enabled, an expired message and its related
events are omitted from this read, so returned seq values have gaps
where those events were.
order chooses which end a bare request starts from. It defaults to
asc, which starts at the OLDEST event and pages forward — identical to
every release before this one, so a request that does not send order
is unchanged. order=desc starts at the NEWEST event and pages backward,
newest entry first, which is what an inbox wants: the latest activity is
the first page rather than the last.
This is the BACKFILL for GET /v1/streams/events, which is a live stream and
replays nothing: an event that passed while you were not connected is
re-read here, addressed by the chat_id and seq range every stream
frame carries.
The cursor is the seq of the last entry you processed, in either
direction, and it is exclusive — pass next_cursor back verbatim, or the
seq you stopped at, and the next page continues from there. Under asc
that means the entries ABOVE it and next_cursor is the page’s highest
seq; under desc it means the entries BELOW it and next_cursor is
the page’s lowest. The direction is not carried in the cursor, so send
order on every request of a walk: the same cursor with the other
order reads the other way rather than being refused.
Paging never skips a visible event: the next page resumes after the last returned position and any expired ephemeral positions intentionally read past. A visible lookahead row withheld by the page limit remains for the next page. An event journaled between two requests is returned rather than stepped over. A backward walk is not disturbed by events journaled while it runs — they take positions above where it started, so they are neither repeated nor mistaken for a retention gap.
Being caught up and being lost are different answers. A cursor at the
end you are paging TOWARD returns an empty page — the chat’s newest seq
under asc, seq 1 under desc — and that is the ordinary polling
result. A cursor BEYOND that end is refused with 422
(invalid_paging), because no such position has ever existed in this
chat and answering it with silence would be indistinguishable from having
caught up. Each direction has its own beyond-the-end: a cursor above the
chat’s newest seq is refused whichever order you asked for, and 0 —
the position below the first, which is 1 — is refused under desc,
where nothing lies below it. Either refusal names where the sequence
actually ends, so a client that has drifted can resume. An empty cursor
is refused the same way in both directions: omit the parameter to start
at whichever end order selects.
Retention. This journal has no scheduled pruning, so ordinary
operation does not remove an old prefix or renumber its immutable
sequence. That is not a permanent-retention promise or a fixed minimum
availability period: authenticated account deletion, offboarding, or a
lawful deletion requirement may remove the account-scoped transcript. This operation therefore has
no expires_at, retained-floor field, or scheduled cursor_expired
response. If prefix pruning is introduced later, its additive retained
floor and typed expiry behavior will be published before any history is
removed.
Query Parameters
Cursor from a previous page’s next_cursor, read in the direction order selects. Exclusive: the page starts after it under asc, before it under desc.
List a chat's events
curl https://whatsapp.messages.api.linqapp.com/v1/chats/$CHAT/events \
-H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY"{
"data": [
{
"occurred_at": "2019-12-27T18:11:19.117Z",
"seq": 0,
"type": "type",
"message": {
"id": "id",
"chat_id": "chat_id",
"created_at": "2019-12-27T18:11:19.117Z",
"direction": "inbound",
"parts": [
{
"body": "body",
"type": "text",
"preview_url": true
}
],
"status": "status",
"channel_message_id": "channel_message_id",
"failure": {
"code": "code",
"message": "message"
},
"from": "from",
"reply_to_message_id": "reply_to_message_id",
"zero_retention": true
}
}
],
"has_more": true,
"next_cursor": "next_cursor"
}Returns Examples
{
"data": [
{
"occurred_at": "2019-12-27T18:11:19.117Z",
"seq": 0,
"type": "type",
"message": {
"id": "id",
"chat_id": "chat_id",
"created_at": "2019-12-27T18:11:19.117Z",
"direction": "inbound",
"parts": [
{
"body": "body",
"type": "text",
"preview_url": true
}
],
"status": "status",
"channel_message_id": "channel_message_id",
"failure": {
"code": "code",
"message": "message"
},
"from": "from",
"reply_to_message_id": "reply_to_message_id",
"zero_retention": true
}
}
],
"has_more": true,
"next_cursor": "next_cursor"
}