> ## Documentation Index
> Fetch the complete documentation index at: https://docs.curator.interworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Health Check Endpoint

> Use the /healthz endpoint to monitor Curator's database connectivity from an orchestrator or uptime monitor.

Curator exposes a `/healthz` endpoint that reports whether Curator can reach its database, as JSON. It is designed
for use by container orchestrators, load-balancer health probes, and uptime monitors that need
to know whether Curator is operational — not just whether the web server is up.

## Endpoint

```http theme={null}
GET /healthz
```

The endpoint is restricted to callers on the loopback interface or a private (RFC 1918) network range:

* `127.0.0.0/8` (loopback)
* `::1` (IPv6 loopback)
* `10.0.0.0/8` (Class A private)
* `172.16.0.0/12` (Class B private)
* `192.168.0.0/16` (Class C private)

Requests originating from any other address receive HTTP `403 Forbidden` with the body `{"error":"Forbidden"}`.
This restriction is intended to keep the detailed system information `/healthz` exposes from being publicly
accessible.

## Response

A successful health check returns HTTP `200` and a JSON body containing the result of the check:

```json theme={null}
{
    "database": "success"
}
```

If the check fails, the endpoint returns HTTP `503 Service Unavailable` with the same JSON shape, with the
`database` value replaced by `"error"`.

### Checks Performed

| Key        | Description                                                 |
| ---------- | ----------------------------------------------------------- |
| `database` | Verifies database connectivity by opening a PDO connection. |

## Behavior When the Database Is Unreachable

`/healthz` is designed to return a JSON response even when the database is unreachable, so an orchestrator can
distinguish "database down" from "web server down". When the database connection fails, the `database` check
reports `error` and the endpoint returns HTTP `503` rather than the framework's standard error page.

## Example Usage

From a server on the same private network as Curator:

```bash theme={null}
curl -i http://curator.internal/healthz
```
