Skip to main content
Knoq uses a poll-and-persist model: the AI agent runs in a background workflow and writes every event — user messages, AI responses, tool calls, and status updates — to a durable event log. You read that log by polling this endpoint. There is no streaming or WebSocket connection; your client should poll at a regular interval (the Knoq UI polls every 2.5–5 seconds) until it receives a terminal event. For efficiency, use the sinceEventId cursor on subsequent polls. Passing the ID of the last event you received means the response only includes new events, keeping payloads small as conversations grow.

Request

string
required
The ID of the session whose transcript you want to fetch.
string
Optional cursor for delta polling. When provided, the response only includes events that occurred after the event with this ID. Use the id of the last event in the previous response as your cursor. Omit on the first request to receive the full transcript.

Response

string
The session title, derived from the opening message.
string | null
The workflow run ID for the active background execution. null when no workflow is running (the session is idle or terminated).
array
Ordered array of event objects (ascending by occurredAt). Empty when no new events have arrived since sinceEventId.
boolean
true when there are additional events beyond the current page. Poll again — without advancing sinceEventId — to fetch the next page.
boolean
true when Knoq attempted to load an older session’s history but the operation was incomplete (for example, due to a very large event log). The events returned are partial. Continue polling — each subsequent request resumes loading from where the previous one left off.

Event types

Example

Delta polling example

After receiving the response above, pass the last event’s id as sinceEventId on subsequent polls:

Errors