Skip to content
Hayonix

API reference · Pods

Container output and platform events as a server-sent event stream

GET/v1/pods/{pod_id}/logs
API keyworkload:readProject
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

Headers
HeaderRequiredDescription
AuthorizationyesBearer and your API key. The key implies its project.
X-Project-Idsession onlyThe project to act in, for console sessions. Requests with an API key leave it out.

Path parameters

  • pod_idstringrequired

    ID of the pod

    ID with prefix pod_

Query parameters

  • sourcestring

    `container`: container output only. `platform`: timeline events only. `all`: both.

    One ofallcontainerplatform

    default "all"

  • followboolean | string

    Keep the stream open for new output and events

  • tailinteger | null

    Lines 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:

Errors
StatusTypeWhen
400invalid_request_errorA parameter or body field is missing or not allowed; param names it.
401authentication_errorThe key or session is missing, revoked or expired.
403permission_errorThe credential lacks the permission this needs, or the organization is suspended.
404not_found_errorNo such resource in this project (an ID from another project is answered the same way).
429rate_limit_error rate_limitedToo many requests; retry after retry-after seconds.