Skip to navigation

Stream a work session live

View as Markdown

Server-sent events for one session, live: text/event-stream.

  • entry — a durable timeline entry, redacted the same way GET /entries redacts it. The SSE id is the entry seq.
  • turn.started, turn.finished, turn.failed — an agent began, ended or failed a piece of work.
  • approval.requested, approval.decided — an action needs a person, or got one.
  • artifact.created, artifact.committed — a document was produced, or filed into a space.
  • work_session.waiting, work_session.done — the session needs you, or it has settled.
  • ping — a keep-alive every fifteen seconds.

The same ten type names arrive on your webhook, so one handler serves both. Streams end after five minutes; reconnect with ?afterSeq= or the Last-Event-ID header to resume. A done session ends the stream. curl it: curl -N -H "authorization: Bearer $KEY" …/v1/work-sessions/ws_…/stream

Learn more: Work sessions

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

idstringRequired1-128 characters

Response

The event stream (text/event-stream).

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error