Application Logs API Endpoints

Stream runtime container logs from your application instances

Get Application Logs

To fetch runtime container logs from the online instances of an application, send a GET request to the following endpoint. Logs are returned in chronological order (oldest first), so the newest entry is the last item in the array.

https://api.nodion.com/v1/applications/:id/logs

Required Headers: Authorization

Optional Query Parameters:

limit – Maximum number of log entries to return. Default 200, maximum 2500.
before – ISO 8601 timestamp. Returns log entries strictly older than this. Useful for paginating backwards through history.
after – ISO 8601 timestamp. Returns log entries strictly newer than this. Useful for tailing live output.
instance_id – Restrict the response to a single instance. When omitted, logs from every online instance are merged.

Default Time Window:

To keep responses fast, the endpoint applies a 1 hour sliding lower bound when after is not provided:

  • Neither before nor after set → window covers the last hour up to now.
  • before set, after not set → window covers the hour preceding before.
  • after set explicitly → window starts at after; no implicit floor is applied.

To page further back than one hour at a time, pass an explicit after alongside before.

Pagination Pattern:

The endpoint uses cursor-based pagination via timestamps rather than page numbers. This avoids the typical drift problem with append-only data:

  • Initial fetch: request without before or after to get up to limit entries from the last hour.
  • Load older entries: pass before= the ts of the oldest entry you already have to get the preceding hour.
  • Tail for new entries: pass after= the ts of the newest entry you already have.

Example Request:

  GET /v1/applications/0b7f0720-e235-4d39-9e67-601c34e8253c/logs?limit=200
  Authorization: Bearer <your_api_key>

Example Response:

  {
    "logs": [
      {
        "ts": "2026-05-05T08:14:22.115Z",
        "msg": "[web.1] Listening on 0.0.0.0:3000",
        "instance_id": "0b7f0720-e235-4d39-9e67-601c34e8253c"
      },
      {
        "ts": "2026-05-05T08:14:23.482Z",
        "msg": "[web.1] Started GET \"/health\" for 10.0.0.4 at 2026-05-05 08:14:23 +0000",
        "instance_id": "0b7f0720-e235-4d39-9e67-601c34e8253c"
      },
      {
        "ts": "2026-05-05T08:14:23.501Z",
        "msg": "[web.1] Completed 200 OK in 18ms",
        "instance_id": "0b7f0720-e235-4d39-9e67-601c34e8253c"
      }
    ],
    "limit": 200
  }

Example: Load Older Entries

  GET /v1/applications/:id/logs?limit=200&before=2026-05-05T08:14:22.115Z
  Authorization: Bearer <your_api_key>

Example: Tail for New Entries

  GET /v1/applications/:id/logs?limit=200&after=2026-05-05T08:14:23.501Z
  Authorization: Bearer <your_api_key>

Possible Response Codes:

200 – Logs returned successfully. The array may be empty when there are no matching entries in the requested window.
401 – Missing or invalid Authorization header.
403 – The API key does not have access to this application.
404 – The application could not be found in the current project scope.