Get started

Health

Source

Whether this instance is up, and what it found when it reached for the database.

text
GET /api/v1/health
bash
curl https://vitna.ai/api/v1/health
json
{
  "ok": true,
  "db": "ok",
  "commit": "8312c96eefc323220963a6098440d4f57a9ceb0f",
  "latencyMs": 3,
  "at": "2026-08-23T09:14:02.881Z"
}

Fields

FieldMeaning
oktrue whenever the process answered, including with a 503
dbok, unset or error
commitThe revision this process was built from, or null where nothing recorded one
latencyMsRound trip of select 1, or null when no pool is configured
atRFC 3339 timestamp
detailPresent only when db is error. A short reason.

db states

StateMeaning
okA connection opened and select 1 returned
unsetNo DATABASE_URL. Serving the committed snapshot.
errorConfigured but unreachable. detail says what happened.

commit is what the deploy checks

The deploy hook records the revision it restarted before it restarts, so this is the commit the running process was built from and not the one the box's bare repository points at. Those two disagree exactly when a deploy did not take: the hook aborts before the restart, so the previous build keeps serving, and it serves healthily.

null means nothing recorded a revision, which is a laptop or a box whose hook predates the field. It is deliberately not a guess. A caller that cannot be told which revision is answering is told that, rather than a plausible-looking sha it might act on.

Liveness and readiness

Use ok for liveness and the status for readiness, and point a health check or an uptime monitor at the status.

StatusWhen
200db is ok or unset
503db is error: a database is configured and select 1 did not return

ok is true whenever the process answered, a 503 included. db names the state behind the status.

A 503 still names the state

The body is the same either way, so a 503 still says what it found and, in detail, what the connection reported. That is why this endpoint once answered 200 whatever the database was doing: a health check that fails with a stack trace tells you less than one that names the state. The cost fell on everything that reads only the status, uptime monitors among them, and to those a database that had stopped answering looked like a healthy site. A 503 is also the rule the rest of this API keeps: an endpoint that cannot reach the record answers 503 (overview, "503 rather than an empty list").

unset answers 200. With no DATABASE_URL the instance serves the committed snapshot, which is a mode rather than an outage. An instance that should have a database and has lost its DATABASE_URL reads the same, so a check that needs the database to have answered reads db and wants ok.

Credentials are stripped from detail

Connection errors quote the target they failed to reach, and that target can carry a password. The handler removes anything between // and @ and truncates to 120 characters before returning.

Caching

no-store. This endpoint answers for the moment it is asked or not at all.

Unlike every other v1 endpoint, this one does not use the shared envelope: it has no meta and carries no ETag.