orakel
Docs navigation

Canonical

GET /api/health

Liveness probe. Public by default; returns full sync diagnostics when called with the sync secret.

Updated 2026-04-21

Request

GET /api/health

No API key required for the public shape.

Header Required Description
X-Sync-Secret no When set to the server's SYNC_SECRET, returns full sync diagnostics. Any other value is ignored silently.

Response — public

{ "status": "ok" }

Returns 503 with { "status": "error" } when the database probe fails.

Response — authenticated (with sync secret)

{
  "status": "ok",
  "timestamp": "2026-04-20T12:00:00Z",
  "database": "connected",
  "records": {
    "companies": 1250000,
    "financials": 8400000
  },
  "dataSources": {
    "brreg-updates": { "lastSync": "2026-04-20T11:45:00Z", "status": "ok", "recordsProcessed": 124 }
  }
}

records counts the full-table sizes for companies, financials, roles, inspections, licenses, procurementNotices. dataSources maps each sync source to its last run timestamp, status, and record count.

Examples

curl

curl https://orakel.cloud/api/health
 
curl -H "X-Sync-Secret: $SYNC_SECRET" https://orakel.cloud/api/health

JavaScript

const res = await fetch("https://orakel.cloud/api/health");
const { status } = await res.json();

Error modes

Status Meaning Action
503 Database probe failed Investigate the deployment; alerting should already have fired

Rate limits

None on the public shape. Fine to poll every 30 seconds from a monitoring system.

Typical use cases

  • Uptime probes from an external monitor.
  • Liveness and readiness checks in load-balancer configuration.
  • Operational dashboards reading sync freshness via the authenticated shape.