Skip to content

Liveness check, optionally with the database

GET
/health
curl --request GET \
--url 'https://api.proofql.dev/health?deep=1'

Without deep: always { "ok": true } when the worker is up. It touches no database, so it is safe to poll every minute.

With deep=1: also runs one statement against Postgres (5 s timeout) and answers 503 when it fails. Every deep call reaches the database, and wakes it when it has scaled to zero, so poll it no more often than every 30 minutes. No authentication.

deep
string
Allowed values: 1

1 to include the database check. Any other value is ignored.

The worker is serving requests (and, with deep=1, Postgres answered).

Media typeapplication/json
object
ok
required
boolean
db

Present with deep=1.

object
ok
required
boolean
ms
required

Round trip of the check, in milliseconds.

integer
Examples
{
"ok": true
}
x-request-id
required
string
>= 1 characters <= 128 characters

This request’s id, on every response. Reuses the caller’s x-request-id when sent (up to 128 chars), else Cloudflare’s ray id, else a fresh UUID. Also inside every error envelope.

deep=1 only: Postgres did not answer, or the statement failed.

Media typeapplication/json
object
ok
required
boolean
db
required
object
ok
required
boolean
error
required

timeout: no answer within 5 s. failed: the statement returned an error.

string
Allowed values: timeout failed
ms
required
integer
Examples
Exampletimeout
{
"ok": false,
"db": {
"ok": false,
"error": "timeout",
"ms": 5001
}
}
x-request-id
required
string
>= 1 characters <= 128 characters

This request’s id, on every response. Reuses the caller’s x-request-id when sent (up to 128 chars), else Cloudflare’s ray id, else a fresh UUID. Also inside every error envelope.