Health endpoints
Use /api/health/live and /api/health/ready to wire liveness and readiness probes for a self-hosted Quackback instance, and read the readiness response.
Self-hosted Quackback exposes two health endpoints for load balancers, Docker healthchecks, and Kubernetes probes: a liveness check and a readiness check. Both are unauthenticated (no API key needed) and safe to poll frequently.
Liveness
GET /api/health/liveConfirms the process is up and serving HTTP. It does no I/O, so a slow database can never make it fail.
curl https://your-domain/api/health/live{ "status": "ok" }It always returns 200 if the process can respond at all. Use it for a container orchestrator's restart-on-failure check.
Note:
GET /api/health(no suffix) is a legacy alias of/api/health/live, kept for existing setups. Use/api/health/livein new configuration.
Readiness
GET /api/health/readyConfirms the instance can actually serve traffic: the database answers, migrations are up to date, and (on worker and all roles) the background job worker is running.
curl https://your-domain/api/health/ready{
"status": "ok",
"role": "all",
"checks": {
"db": { "ok": true },
"migrations": { "ok": true },
"workers": {
"ok": true,
"expected": true,
"running": true,
"loops": 1,
"inFlight": 0,
"schemaMissing": 0,
"refused": 0
}
}
}- Returns
200when every check passes, and503with the same shape otherwise. - Each failed check carries a short
errorcode:failed,timeout, orbehind(migrations not yet caught up). Raw error details are never exposed. - Each check has a 3-second budget, so a hung dependency reports
timeoutinstead of hanging the probe. rolereports the replying process'sQUACKBACK_ROLE(all,web, orworker). On awebreplica,workers.expectedisfalseand the check passes, since no workers run there.
Tip: Use
/api/health/readyfor your load balancer's traffic check and Kubernetes'readinessProbe. Use/api/health/liveforlivenessProbe. Readiness can legitimately return503during a deploy or migration without meaning the process should be restarted.
Where these are used
- The healthcheck in
docker-compose.prod.ymlpolls/api/health/ready. See Deploy with Docker. - On Railway, set the service's health check path to
/api/health/readywith a generous timeout. See Deploy to Railway. - If background jobs aren't running,
checks.workersshowsexpected: truewithrunning: false. See Troubleshoot common issues.
Related articles
Was this helpful?
Your feedback shapes what we write next.
