Skip to content
Coritan Docs

Client API: Deployments: Logs

The 3 Client API operations for logs.

View as Markdown

Part of Deployments.

GET /api/v1/client/deployments/{deployment_uuid}/logs

The newest limit lines that match, oldest first within the page so a terminal prints them in order, and next: the cursor for the page before it (pass it as before), or null at the oldest line kept. Lines are kept for the plan's deploy_log_retention_days (retention_days); partial says a stored chunk could not be read or the page stopped at its read budget, and next continues after it. Each line: id (<chunk>:<n>), ts (when it was collected, within a minute of when it was printed), instance, process, location, release, message, and gap (lines may be missing just before it). As NDJSON the lines are the body and next is the X-Coritan-Next header. 503 logs_unavailable when the log bucket is not set up.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required Description
deployment_uuid path string (uuid) yes
since query string or null no Oldest line: ISO 8601, a Unix time, or a duration back from now (15m, 2h, 7d)
until query string or null no Newest line, in the same forms
instance query integer or null no An instance id from /logs/instances
process query string or null no web, worker, ...
q query string or null no Lines containing this text, ignoring case
limit query integer no Lines on the page: the newest that match Default: 100.
before query string or null no The next cursor of the page after this one
format query string or null no ndjson: one line per row; also chosen by Accept: application/x-ndjson
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

GET /api/v1/client/deployments/{deployment_uuid}/logs/instances

The deployment's instances that are live or have lines kept, newest first: id (what instance takes), location, process, release, state, live, sleeping, created_at and last_line_at.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
deployment_uuid path string (uuid) yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

GET /api/v1/client/deployments/{deployment_uuid}/logs/stream

text/event-stream of the running instances' output (ten at most), polled from their consoles every two seconds: ready (instances, until, poll_seconds), then line events shaped as /logs lines (id is live:<instance>:<n>), instance when one's console cannot be read, a : keepalive comment after fifteen quiet seconds, and end with reason: time_limit after seconds, gone when the deployment is no longer the caller's, unavailable when consoles cannot be read here. Reconnect for more; a tail does not replay what an earlier one sent. 429 too_many_streams past five open at once for the account (on an organization's routes, for the organization), whichever keys, sign-ins or members opened them, and rate_limited past thirty opened by one caller in ten minutes.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required Description
deployment_uuid path string (uuid) yes
instance query integer or null no Only this instance: an id from /logs/instances
process query string or null no Only this process's instances: web, worker, ...
q query string or null no Lines containing this text, ignoring case
tail query integer no Lines each instance's console already holds to start with Default: 50.
seconds query integer no How long the stream stays open Default: 300.
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.