# Health and the document (https://raaqeb.dev/en/docs/api/health)

> The health endpoint a supervisor or load balancer polls, and the OpenAPI document these pages are drawn from.

## Health

`raaqeb health`, the container image's health check and the installer all ask this. See [health, restarts and logs](https://raaqeb.dev/en/docs/operate/health-and-logs) for what happens when it fails.

**GET** `/health`

Liveness of the database and scheduler

Responses:

- `200`: The database answered and the scheduler ticked, or the install is in onboarding.
- `503`: The database did not answer or the scheduler's last tick is stale.

`200` body, `application/json`:

```ts
{
  // Always true in onboarding.
  ok: true;
  // The install is in onboarding: no database is open yet.
  onboarding: true;
} | {
  // Whether the database answered one question.
  database: "ok" | "unreachable";
  // Whether the database and the scheduler are both ok.
  ok: boolean;
  // Whether the scheduler's last tick is under two minutes old.
  scheduler: "ok" | "stale";
}
```

`503` body, `application/json`:

```ts
{
  // Always true in onboarding.
  ok: true;
  // The install is in onboarding: no database is open yet.
  onboarding: true;
} | {
  // Whether the database answered one question.
  database: "ok" | "unreachable";
  // Whether the database and the scheduler are both ok.
  ok: boolean;
  // Whether the scheduler's last tick is under two minutes old.
  scheduler: "ok" | "stale";
}
```

## The OpenAPI document

**GET** `/api/openapi.json`

The OpenAPI document

Responses:

- `200`: This document, OpenAPI 3.1, cached for an hour: it changes only with the binary. Body: `application/json` `object`.
