FerryDocs

Stream logs with the API

The API sends each log line as one event on a connection that stays open.

Edit on GitHub
curl -N 'http://127.0.0.1:7878/api/v1/jobs/job-48dd…/logs?access_token=…'
event: log
data: {"ts":"2026-09-27T07:46:59.504869Z","stream":"system","line":"==> Running `npm run migrate`"}

event: log
data: {"ts":"2026-09-27T07:46:59.634761796Z","stream":"stdout","line":"> node migrate.js"}

event: end
data: 

The log endpoints use . The answer has Content-Type: text/event-stream. Each line of the log is one event: log. Its data is a JSON object.

See the API overview for the rules of all endpoints.

The endpoints

EndpointQueryThe stream ends
GET /api/v1/deploys/{deploy_id}/logsfollow=true: continue while the deploy runsWhen the deploy is complete. Without follow: immediately.
GET /api/v1/jobs/{job_id}/logsfollow=trueWhen the run is complete. Without follow: immediately.
GET /api/v1/services/{id}/logsfollow=true, tail=N lines for each instanceWith follow: when you disconnect. Without follow: immediately.

The fields of a line

FieldTypeDescription
tsRFC 3339 timestampWhen the program wrote the line
streamstdout, stderr or systemThe source. system lines are from Ferry.
instancestring, runtime logs onlyThe instance: the last 6 characters of the name of the container
linestringThe text, without the newline

A token in a URL can leak

A stream needs an , as each /api/v1 request does. Send it in the Authorization header when you can. A token in a URL can go into logs and into the history of the browser.

On this page