Skip to content

Stream a job’s events

GET /v1/jobs/{id}/events

Server-sent events: the job each time it changes, until it finishes.

Each event carries the job as GET /v1/jobs/{id} shows it: job.updated while it runs, then one of job.completed, job.failed or job.canceled, after which the stream ends. A comment line keeps the connection open every 15 seconds. Event IDs let a reconnect send Last-Event-ID to skip what it has seen; a stream ends after 15 minutes.

API key with the read scope.

Request

Terminal window
curl "https://api.formatjet.com/v1/jobs/job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D/events" \
-H "Authorization: Bearer $FORMATJET_API_KEY"

Path parameters

FieldTypeDescription
id requiredstring

Responses

200 OK

An event stream

Example
id: 1761300006000
event: job.completed
data: {"id":"job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D","status":"completed",…}

Errors

Problem documents (application/problem+json); see Errors.

StatusCodeWhen
401unauthorizedNo API key, or one that’s unknown or revoked.
403forbiddenThe key lacks the read scope, or the plan has no API.
404not_foundNo such job of this key’s mode, or its files are gone.
429rate_limitedMore requests than the plan allows in 10 seconds: wait Retry-After seconds.