Skip to content
Hayonix

API reference · Serverless

Recent container logs of the endpoint's workers

GET/v1/serverless/endpoints/{endpoint_id}/logs
API keyserverless_endpoint:readProject
TypeScript
client.serverless.getWorkerLogs()
Python
client.serverless.get_worker_logs()
CLI
hayonix serverless logs

The last tail lines of each live worker, or of one worker with worker_id. A worker whose logs cannot be read is listed in errors instead of failing the request.

Project API key (Authorization: Bearer sk_…), or a console session. Requires the serverless_endpoint: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 "$API_BASE_URL/serverless/endpoints/sep_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

  • endpoint_idstringrequired

    ID of the endpoint

    ID with prefix sep_

Query parameters

  • worker_idstring

    One worker (default: every live worker)

    ID with prefix swk_

  • tailinteger

    Lines per worker (default 100)

    1–1000

Response

200 ServerlessWorkerLogs — Log lines per worker

  • objectstringrequired

    Always `serverless_worker_logs`: the type of this object

    One ofserverless_worker_logs

  • dataarray of objectrequired

    The items

    Show 4 fields of data
    • worker_idstringrequired

      ID of the worker

    • sourcestringrequired

      Where the text came from: `stdout` or `stderr` of the container, or `system` (a message from the platform about the container)

      One ofstdoutstderrsystem

    • streamstringrequireddeprecated

      Deprecated: read `source`, which carries the same information

    • textstringrequired

      The logged text, as written by the container

  • next_cursorany JSON | nullrequired

    Always null: the tail is one page

  • errorsarray of objectrequired

    Workers whose logs could not be read (for example not placed on a host yet), with the reason; the other workers are still returned

    Show 2 fields of errors
    • worker_idstringrequired

      ID of the worker

    • messagestringrequired

      One sentence for people

Example response
Example response
{
  "object": "serverless_worker_logs",
  "data": [
    {
      "worker_id": "string",
      "source": "stdout",
      "stream": "string",
      "text": "string"
    }
  ],
  "next_cursor": {},
  "errors": [
    {
      "worker_id": "string",
      "message": "string"
    }
  ]
}

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.