# Health API

> Liveness and readiness probes for load balancers and orchestrators.

Source: https://zerocaptcha.io/docs/reference/api/health

## Liveness probe

`GET /healthz` (`getLiveness`)

Answers while the process can serve HTTP, without checking any dependency.

Responses:

- 200 OK: The process is up.
- Any other status: An error, as RFC 9457 problem details.

```bash
curl https://api.zerocaptcha.io/healthz
```

```js
const response = await fetch("https://api.zerocaptcha.io/healthz");
console.log(response.status, await response.text());
```

```python
import requests

response = requests.get(
    "https://api.zerocaptcha.io/healthz",
    timeout=30,
)
print(response.status_code, response.text)
```

## Readiness probe

`GET /readyz` (`getReadiness`)

Answers when the service can reach its database, which must reply within
two seconds.

Responses:

- 200 OK: Ready for traffic.
- 503 Service Unavailable: The database cannot be reached.
- Any other status: An error, as RFC 9457 problem details.

```bash
curl https://api.zerocaptcha.io/readyz
```

```js
const response = await fetch("https://api.zerocaptcha.io/readyz");
console.log(response.status, await response.text());
```

```python
import requests

response = requests.get(
    "https://api.zerocaptcha.io/readyz",
    timeout=30,
)
print(response.status_code, response.text)
```
