# الصحة والمستند (https://raaqeb.dev/docs/api/health)

> عنوان الصحة الذي يسأله مدير الخدمات أو موازن التحميل دوريًا، ومستند OpenAPI الذي تُستخرج منه هذه الصفحات.

## الصحة

يسأل هذا العنوانَ الأمرُ `raaqeb health`، وفحص الصحة في الصورة، والمُثبِّت. انظر [الصحة وإعادة التشغيل وسجل الخادوم](https://raaqeb.dev/docs/operate/health-and-logs) لتعرف ما يحدث حين يفشل.

**GET** `/health`

Liveness of the database and scheduler

الاستجابات:

- `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`, `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`, `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";
}
```

## مستند OpenAPI

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

The OpenAPI document

الاستجابات:

- `200`: This document, OpenAPI 3.1, cached for an hour: it changes only with the binary. المحتوى: `application/json` `object`.
