Widget Messages
Incremental tail of the current conversation (public, no auth). Separate from ``/history`` rather than a mode of it, because they answer different questions and pay different prices. ``/history`` bootstraps: two conversations, rotation, separators, the ticket number — everything the widget needs once, on mount. This is the one the widget calls every few seconds while a human is answering, so it reads one conversation and returns only what the caller has not seen. The cursor is an opaque message id rather than a timestamp or an offset. That is what lets this become a long-poll or an SSE stream later without the client's logic changing: "everything after X" is the same request whether the answer comes back immediately, in thirty seconds, or as a stream of pushes. A timestamp cursor would have had to grow tie-breaking rules the moment two messages shared a second, and an offset would have broken the first time anything was inserted. Resolved by position rather than by comparing timestamps: the cursor is located in the conversation's own ordering and everything after it is returned. Two messages written in the same second cannot make it skip one.
widget/messagesQuery Parameters
bot_idRequiredBot Id
Bot public ID
session_idRequiredSession Id
Chat session UUID
after_message_idAfter Message Id
Return messages written after this one
Successful Response