putty
API ReferenceEngine

Follow a run over SSE

Streams the run's event log as Server-Sent Events, one event per line of output, in `seq` order. Each event carries `id: <seq>`, so a browser that reconnects automatically replays from exactly where it left off by sending its last id back in the `Last-Event-ID` header; the server replays the missed events and then resumes live, with no gap and no duplicate. The same cursor is available as a `?afterSeq=` query parameter for a client that cannot set headers. The stream ends by closing when the run reaches a terminal state, after the final `run.finished` or `run.error` event has been sent. A client that must not hold a connection open should poll the paged endpoint instead — the two share the same cursor space, so a client may switch between them without skipping or repeating an event.

GET
/projects/{projectId}/runs/{runId}/stream

Streams the run's event log as Server-Sent Events, one event per line of output, in seq order. Each event carries id: <seq>, so a browser that reconnects automatically replays from exactly where it left off by sending its last id back in the Last-Event-ID header; the server replays the missed events and then resumes live, with no gap and no duplicate. The same cursor is available as a ?afterSeq= query parameter for a client that cannot set headers.

The stream ends by closing when the run reaches a terminal state, after the final run.finished or run.error event has been sent. A client that must not hold a connection open should poll the paged endpoint instead — the two share the same cursor space, so a client may switch between them without skipping or repeating an event.

Path Parameters

projectId*string

The project the run belongs to.

runId*string

The run to follow.

Query Parameters

afterSeq?|

Resume after this seq. Overridden by the Last-Event-ID header when that is present, which is what a browser's automatic reconnect sends.

Range0 <= value

Response Body

text/event-stream

application/json

application/json

application/json

curl -X GET "https://example.com/projects/string/runs/string/stream"
{  "seq": 0,  "type": "run.started",  "payload": null,  "createdAt": "string"}