Skip to main content
GET
/
v1
/
jobs
/
{job_id}
/
stream
cURL
curl --request GET \
  --url https://api.peelapi.com/v1/jobs/{job_id}/stream \
  --header 'Authorization: Bearer <token>'
"<string>"
Establishes an SSE connection that emits job updates until completion. Useful for real-time dashboards or CLI workflows.

Example

curl -N -H "Authorization: Bearer $PEEL_API_KEY" \
  https://api.peelapi.com/v1/jobs/job_123/stream

Event types

  • status: initial state (queued, processing, etc.)
  • log: operational messages
  • result: final job output (mirrors the output field from the polling endpoint)
  • error: error string when the job fails
  • end: terminal state (succeeded or failed)
  • ping: keep-alive heartbeat every 15 seconds

Headers

PeelAPI sets SSE-friendly headers to prevent caching:
Cache-Control: no-cache, no-transform
X-Accel-Buffering: no
Connection: keep-alive
Clients may resume streams by supplying Last-Event-ID. The server tracks log IDs to avoid replaying old entries.

Errors

  • Missing job ID or invalid credential -> 400/401
  • Unknown job for the current client -> 404
When an error occurs, the stream emits an error event and closes with end: failed.

Authorizations

Authorization
string
header
required

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

Path Parameters

job_id
string
required

Response

SSE stream

The response is of type string.