API reference · Pods
Container output and platform events as a server-sent event stream
/v1/pods/{pod_id}/logs- TypeScript
client.pods.streamLogs()- Python
client.pods.stream_logs()- CLI
hayonix pods logs
Events: platform (a timeline event: id, type, severity, message, occurred_at), output (container output: stream stdout|stderr, text, timestamp, instance_id), notice (message, e.g. no container on a host yet) and finally end. Past output comes from the host (the current container only; it is gone once the container is removed); platform events are kept. With follow=true the stream stays open.
Project API key (Authorization: Bearer sk_…), or a console session. Requires the workload:read permission (a key's scope, or a role that includes it).
Examples
The samples read API_KEY and API_BASE_URL from the environment (see Setup). Values are examples.
curl -sS -N "$API_BASE_URL/pods/pod_01jc5zq4m8k3v6x9t2w7r0b1e4/logs" \
-H "Authorization: Bearer $API_KEY"Request
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer and your API key. The key implies its project. |
X-Project-Id | session only | The project to act in, for console sessions. Requests with an API key leave it out. |
Path parameters
pod_idstringrequiredID of the pod
ID with prefix pod_
Query parameters
sourcestring`container`: container output only. `platform`: timeline events only. `all`: both.
One of
allcontainerplatformdefault "all"
followboolean | stringKeep the stream open for new output and events
tailinteger | nullLines of past container output (and platform events) to start with
0–10000 · default 200
sincestring (date-time)Start with output and events from this time on (ISO 8601)
Response
200 a server-sent event stream (text/event-stream) — An SSE stream
Errors
Errors use the standard envelope. What this operation can answer:
| Status | Type | When |
|---|---|---|
400 | invalid_request_error | A parameter or body field is missing or not allowed; param names it. |
401 | authentication_error | The key or session is missing, revoked or expired. |
403 | permission_error | The credential lacks the permission this needs, or the organization is suspended. |
404 | not_found_error | No such resource in this project (an ID from another project is answered the same way). |
429 | rate_limit_error rate_limited | Too many requests; retry after retry-after seconds. |