API reference

Health & status

/health, /health/db, and the Discord status board's probe contract.

GET /health

Returns 200 + { ok: true, uptime, version } when the API process is up. Used by:

  • Fly's HTTP health check (configured in fly.toml).
  • The Discord support bot's status board.
  • Uptime monitors (Pingdom, Better Stack, etc).

GET /health/db

Returns 200 + { ok: true, latencyMs } when a SELECT 1 against Postgres succeeds.

Returns 500 + { ok: false, error } when the DB query fails or times out (3s).

Tip: cheap monitoring

Point any uptime monitor at /health/db (rather than /health). The plain /health only confirms the process is alive; /health/db confirms the process is alive and has working DB access — which is what actually matters.

Status board

The Discord support bot polls these endpoints every 60s. Latency thresholds:

LatencyState
≤ 0ms (error)🔴 down
> 3000ms🟡 degraded
1ms - 3000ms🟢 operational

The DB probe is a binary: any 2xx is operational; anything else is down.

Internal: Discord status board service health

A separate code path the bot uses but isn't an API endpoint:

  • Bot's own state is always 🟢 by definition (the embed only updates when the bot is running).
  • Relay state comes from GET <STATUS_RELAY_BASE>/health (defined in the bot's env).
  • Website state comes from GET <STATUS_WEBSITE_URL>.