Skip to main content
GET
Get server runtime logs

Authorizations

api-key
string
header
required

Path Parameters

instance_id
string
required

Server instance ID.

Query Parameters

start_time
string

Window start. Accepts ISO 8601 format (e.g., "2026-03-15T12:00:00Z") or relative time (e.g., "-1h", "-30m"). Omit to use the default 1-hour window (matching the dashboard), NOT the whole retention period.

end_time
string

Window end. Same format as start_time. Defaults to now if omitted. Pass the response's older_token here (keeping start_time) to page backward through the window.

limit
integer
default:1000

Maximum number of log entries to return (1–1000). Defaults to 1000. Returns the most recent entries in the window.

Required range: 1 <= x <= 1000

Case-insensitive substring to match within log messages. Applied server-side across the ENTIRE window, not just the returned page.

Maximum string length: 256
level
enum<string>

Restrict to a single inferred severity. Levels are inferred from message content (Fly forwards raw stdout without parsed levels).

Available options:
error,
warn,
info
order
enum<string>
default:newest

Which end of the window to return when it holds more than limit rows. "newest" (default) returns the most-recent entries (live-tail). "oldest" returns the EARLIEST entries ascending from start_time — use it to reach a server's genuine first log lines. In "oldest" mode older_token is null (you are at the start) and next_token pages FORWARD toward now (pass it as start_time, keeping order=oldest).

Available options:
newest,
oldest

Response

Server runtime logs with pagination cursor.

Server runtime logs with forward (live-tail) and backward pagination support.

logs
object[]
required

The most recent log entries for the server within the requested window (after any search/level filter), ordered oldest-to-newest.

instance_id
string
required

Server instance ID these logs belong to.

machine_id
string | null
required

Fly.io machine ID that produced these logs. Null if no machine is assigned (server never launched).

next_token
string | null
required

Live-tail cursor pointing just after the newest entry returned. Pass as start_time in the next request to fetch only newer logs. Null if no logs were returned.

older_token
string | null
required

Backward cursor equal to the oldest entry returned. Pass as end_time (keeping the same start_time) to page further back through the window. Null if no logs were returned.