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.
GET /api/managed-agents/transcript?sessionId=<id>&sinceEventId=<id>

Request

sessionId
string
required
The ID of the session whose transcript you want to fetch.
sinceEventId
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

title
string
The session title, derived from the opening message.
workflowRunId
string | null
The workflow run ID for the active background execution. null when no workflow is running (the session is idle or terminated).
events
array
Ordered array of event objects (ascending by occurredAt). Empty when no new events have arrived since sinceEventId.
hasMore
boolean
true when there are additional events beyond the current page. Poll again — without advancing sinceEventId — to fetch the next page.
backfillFailed
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

TypeDescription
user_messageA message sent by the user.
agent_messageA response produced by the AI agent.
tool_useThe agent invoked a connected tool (e.g. searched Slack or queried a GitHub repo).
tool_resultThe result returned by a tool call.
status_idleThe agent has finished processing the current turn and is waiting for a follow-up. This is a terminal event for the current turn.
status_terminatedThe session has ended permanently (workflow exited or session cancelled).
errorAn error occurred during processing. The payload contains details.

Example

curl "https://knoq.one/api/managed-agents/transcript?sessionId=a3f2c1d4-e5b6-7890-abcd-ef1234567890" \
  -H "Origin: https://knoq.one" \
  -H "Cookie: <your-session-cookie>"

Delta polling example

After receiving the response above, pass the last event’s id as sinceEventId on subsequent polls:
curl "https://knoq.one/api/managed-agents/transcript?sessionId=a3f2c1d4-e5b6-7890-abcd-ef1234567890&sinceEventId=evt_01HZ9K2XE5F6G7H8I9J0K1L2M3" \
  -H "Origin: https://knoq.one" \
  -H "Cookie: <your-session-cookie>"

Errors

StatusMeaning
400The sessionId parameter is missing, empty, or malformed. The sinceEventId cursor, if provided, must be alphanumeric (with hyphens and underscores), up to 128 characters.
401The request is not authenticated. Ensure your session cookie is valid and has not expired.
404No session with the given ID was found for your user and organisation.