Skip to main content

REST API

Authenticated routes live under {path}/api/* (default /loadflux/api). The dashboard UI uses these; you can call them from scripts or external tools with the same session cookie or Bearer token as login.

Unless noted, endpoints require auth.

Common query parameters

ParameterUsed onDescription
from, toMost routesUnix timestamps in milliseconds (inclusive range)
page, limitList routesPagination; page ≥ 1, limit 1–1000 (default 200)
max_points/system, /processServer-side downsampling cap (10–2000). If omitted and range ≥ 5 days, the server auto-samples to 900 points
instance/system, /processFilter to one instance_id. When cluster mode is on and omitted, responses use cluster aggregate
searchEndpoints, errors, slowCase-insensitive substring filter
statusErrorsFilter error log to one HTTP status code
metric, limit/endpoints/topTop-endpoint sort key and count (default metric request_count, limit 10)
threshold/endpoints/slowSlow-request threshold in ms (defaults to configured slowRequestThreshold)

Routes

Live

MethodPathDescription
GET/sseServer-Sent Events stream (DashboardSnapshot every ~2s). Max 64 concurrent clients per process
GET/snapshotOne-shot JSON snapshot (same shape as SSE)

Cluster

MethodPathDescription
GET/instances{ instances: string[] } — distinct instance_id in from/to

Metrics

MethodPathDescription
GET/systemSystem time series (SystemMetricRow[] or paginated)
GET/processProcess time series (ProcessMetricRow[] or paginated)
GET/endpointsEndpoint aggregation rows
GET/endpoints/topTop endpoints by metric
GET/endpoints/slowSlow endpoint windows
GET/errorsError log rows
GET/errors/status-codes{ codes: number[] } for the range
GET/errors/distributionStatus bucket totals (StatusDistribution)
GET/overviewAggregated overview for the range (OverviewMetrics)

Settings and export

MethodPathDescription
GET/settings{ retention_days, slow_threshold }
POST/settingsJSON body: optional retention_days (≥ 1), slow_threshold (≥ 0)
GET/exportJSON bundle { system, process, endpoints, errors }; max range 31 days. In cluster mode, system/process series are cluster-aggregated

Auth (unauthenticated where noted)

Login and setup routes are documented in Authentication. Initial setup uses POST /auth/setup when no user exists.

Example

# System metrics for the last hour (cluster aggregate when cluster mode enabled)
curl -s -b cookies.txt \
"http://localhost:3000/loadflux/api/system?from=$(($(date +%s)*1000-3600000))&to=$(($(date +%s)*1000))&max_points=280"

# One replica only
curl -s -b cookies.txt \
"http://localhost:3000/loadflux/api/system?from=0&to=9999999999999&instance=apprunner-task-a"