Job Events

Server-Sent Events stream of the caller's job-status transitions, so the frontend can stop polling GET /jobs every 1.5s. Declared ABOVE GET /jobs/{job_id} so the literal events path segment isn't captured by {job_id} (which would 422 on int coercion). Push-based: the connection subscribes a per-connection queue that the shared Postgres LISTEN/NOTIFY listener (started in lifespan) feeds directly, so transitions arrive as soon as the DB trigger fires rather than on a polling cadence. Emits one snapshot event on connect, then a job event per status transition. A slow reconcile pass (_EVENTS_RECONCILE_SECONDS) re-checks the DB periodically as a safety net for any notification the listener missed (e.g. during a reconnect). Closes the stream once every job seen so far (snapshot ∪ pushed events) is terminal, on client disconnect, or after _EVENTS_MAX_SECONDS — whichever comes first. Never public: this is per-user data behind normal header auth (EventSource itself can't set headers, but the browser never calls this endpoint directly — the Next.js proxy does).

get/jobs/events

Request

  • Base URL: https://api.sumvid.app (the document declares no server; this is the origin it was published from)
  • URL: https://api.sumvid.app/jobs/events
  • Auth: HTTP bearer

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.