## Liveness

Health checks need no authentication.

| Method | Path               | Summary                                            |
| ------ | ------------------| -------------------------------------------------- |
| `GET`  | `/health`        | [Liveness](/content/docs/reference/api/health#liveness/index.html) |
| `GET`  | `/health/ready`  | [Readiness](/content/docs/reference/api/health#readiness/index.html) |

### [Liveness](/content/docs/reference/api/health#liveness/index.html)

http

```
GET /health
```

Always `200 {"status": "ok"}` while the process serves requests. No authentication.

**Authentication:** None.

#### [Response](/content/docs/reference/api/health#response/index.html)

**200** The process is up (`application/json`)

| Field      | Description         |
| ---------- | ------------------- |
| `status`   | "ok" (Required)    |

#### [Errors](/content/docs/reference/api/health#errors/index.html)

| Status | Meaning                     |
| ------ | --------------------------- |
| `500`  | Unexpected server error.     |

#### [Example](/content/docs/reference/api/health#example/index.html)

Request

```
curl "https://api.machinemail.dev/health"
```

Response 200

```
{
  "status": "ok"
}
```

### [Readiness](/content/docs/reference/api/health#readiness/index.html)

http

```
GET /health/ready
```

Pings the storage backend: `200` with `status: ready` (`checks.storage: true`) when it answers, `503` with `status: unavailable` when it does not. No authentication.

**Authentication:** None.

#### [Response](/content/docs/reference/api/health#response-1/index.html)

**200** Ready (`application/json`)

| Field      | Description                              |
| ---------- | ---------------------------------------- |
| `status`   | "ready" | "unavailable" (Required) |
| `checks`   | `object` (Required) - The checks behind status.

#### [Errors](/content/docs/reference/api/health#errors-1/index.html)

| Status | Meaning                        |
| ------ | ------------------------------ |
| `500`  | Unexpected server error.        |
| `503`  | Not ready: storage did not answer |

#### [Example](/content/docs/reference/api/health#example-1/index.html)

Request

```
curl "https://api.machinemail.dev/health/ready"
```

Response 200

```
{
  "status": "ready",
  "checks": {
    "storage": true
  }
}
```
