Jobs
get/jobs/{job_id}/stream

Request

  • Base URL
    https://api.hedra.com/v3
  • Auth
    • API key in header Authorization
    • or HTTP bearer

Path parameters

job_idstring required

The job's id (job_<uuid>).

Headers

Last-Event-Idstring nullable

Resume after this event id — the standard SSE reconnect header; browsers' EventSource sends it automatically.

Response

Server-Sent Events. Each frame's event: names its type. The data: line of a status frame is a StatusResponse and of a log frame a JobLogItem (the same row GET /jobs/{job_id}/logs serves), both JSON. The stream opens with a status snapshot and ends with a done frame, sent after the terminal status frame: reaching it means the job finished (COMPLETED or FAILED) and there is nothing more to read. A stream that ends without it was cut short; reconnect with Last-Event-Id. Closes the server initiates instead (drain, max connection duration) send a retry: line and no done. The done frame's data: line is the literal token [STREAM_DONE] — not JSON, and not a member of the JobStreamFrame schema below. It is a fixed end-of-stream sentinel, matched verbatim; switch on event: and skip done before parsing a data: line, or the parse fails on the last frame of every stream. It repeats no state: which job ended and how was just delivered by the terminal status frame. status and log frames carry an id: to send back as Last-Event-Id; done does not, since it is not a new stream position. Comment lines (: keep-alive) and retry: lines are protocol-level and carry no payload.

Changes