Skip to content
Linq Copy agent prompt

Events and recovery

Combine live notifications with durable account and chat logs.

The API separates notification from durable content:

  1. GET /v1/streams/events delivers live account events over SSE.
  2. GET /v1/event_log pages the same account sequence for bounded recovery.
  3. GET /v1/chats/{chat}/events returns the detailed, gapless journal for one chat.

An account event identifies a chat and a seq_fromseq_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.

  • Persist the SSE id and send it back as Last-Event-ID after reconnecting.
  • The event-log cursor is opaque; pass next_cursor back unchanged.
  • A chat cursor is the last gapless numeric seq you processed.
  • Keep all three cursor domains separate.
  • A cursor older than retained account history returns 410 cursor_expired.
  • Ignore unknown event kinds so newly added kinds remain backward compatible.

Webhooks carry the same stable event identity as the stream. Deduplicate the two sinks by event ID if you consume both.