Skip to content

GET /api/health

Returns the health status of the API and its database connection. Does not require authentication.

GET /api/health

No parameters required.

HTTP 200

{
"status": "ok",
"db": "ok",
"latency": "4ms",
"ts": "2025-03-15T07:30:00.123Z"
}
FieldTypeDescription
statusstring"ok"
dbstring"ok"
latencystringDatabase round-trip latency (e.g. "4ms")
tsstringServer time at response

HTTP 503

{
"status": "degraded",
"db": "error",
"error": "connection refused",
"latency": "12ms",
"ts": "2025-03-15T07:30:00.123Z"
}

A 503 response means the database is unreachable. The API is online but cannot serve data requests.

Use this endpoint to:

  • Check uptime from an external monitor
  • Validate that your deployment is correctly configured
  • Verify connectivity before running a backfill
Terminal window
curl https://mydatafor.life/api/health