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

# GET /health and GET /ready

> Liveness and readiness probes for monitoring the peaqOS MCR API server.

## GET /health

```http theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
GET /health
```

A lightweight liveness probe. Returns `200` whenever the process is running. Does not check chain connectivity or contract readiness.

### Response

**200 OK**

| Field    | Type   | Description                               |
| :------- | :----- | :---------------------------------------- |
| `status` | string | Always `"ok"` when the process is running |

### Error responses

None. This endpoint always returns `200` while the server process is alive.

### Example

<CodeGroup>
  ```bash bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  curl "${PEAQOS_MCR_API_URL}/health"
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  const response = await fetch(`${PEAQOS_MCR_API_URL}/health`);
  const data = await response.json();
  console.log(data.status); // "ok"
  ```

  ```python Python theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  import requests

  response = requests.get(f"{PEAQOS_MCR_API_URL}/health")
  data = response.json()
  print(data["status"])  # "ok"
  ```
</CodeGroup>

**Response**

```json theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
{
  "status": "ok"
}
```

***

## GET /ready

```http theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
GET /ready
```

A readiness probe. Verifies that the RPC node is reachable and all six contracts (IdentityRegistry, IdentityStaking, EventRegistry, MachineNFT, DID registry, AdminFlags) are callable. Returns `200` when all checks pass and `503` when any check fails.

### Response

**200 OK (all contracts ready)**

| Field                         | Type    | Description                                                                                                                                                                    |
| :---------------------------- | :------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status`                      | string  | `"ready"`                                                                                                                                                                      |
| `rpc_connected`               | boolean | `true` when the RPC node is reachable                                                                                                                                          |
| `contracts.identity_registry` | boolean | IdentityRegistry contract callable                                                                                                                                             |
| `contracts.identity_staking`  | boolean | IdentityStaking contract callable                                                                                                                                              |
| `contracts.event_registry`    | boolean | EventRegistry contract callable                                                                                                                                                |
| `contracts.machine_nft`       | boolean | MachineNFT contract callable                                                                                                                                                   |
| `contracts.admin_flags`       | boolean | AdminFlags contract callable. **Returns `true` when the contract address is not configured.** AdminFlags is optional, so the readiness probe skips the call and reports ready. |
| `contracts.did_registry`      | boolean | DID precompile callable                                                                                                                                                        |

**503 Service Unavailable (one or more checks failed)**

The response body has the same shape as the 200 response, but `status` is `"not_ready"` and one or more boolean fields are `false`.

| Status | Condition                                                          |
| :----- | :----------------------------------------------------------------- |
| 503    | Any contract unreachable, RPC failure, or services not initialised |

Two failure modes produce a 503:

* **Services not initialised** (server started without `IDENTITY_REGISTRY_ADDRESS`): every field is `false`, including `rpc_connected` and `contracts.admin_flags`.
* **Initialised but a check failed** (RPC down, contract unreachable, etc.): only the failing fields are `false`. When `ADMIN_FLAGS_ADDRESS` is unset, `contracts.admin_flags` is **`true`**: AdminFlags is optional, the probe skips it, and that field never blocks readiness.

### Example

<CodeGroup>
  ```bash bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  curl "${PEAQOS_MCR_API_URL}/ready"
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  const response = await fetch(`${PEAQOS_MCR_API_URL}/ready`);
  const data = await response.json();
  if (response.ok) {
    console.log("Service ready");
  } else {
    console.log("Not ready:", data.contracts);
  }
  ```

  ```python Python theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  import requests

  response = requests.get(f"{PEAQOS_MCR_API_URL}/ready")
  data = response.json()
  if response.status_code == 200:
      print("Service ready")
  else:
      print("Not ready:", data["contracts"])
  ```
</CodeGroup>

**Response (healthy)**

```json theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
{
  "status": "ready",
  "rpc_connected": true,
  "contracts": {
    "identity_registry": true,
    "identity_staking": true,
    "event_registry": true,
    "machine_nft": true,
    "admin_flags": true,
    "did_registry": true
  }
}
```

**Response (not ready)**

```json theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
{
  "status": "not_ready",
  "rpc_connected": false,
  "contracts": {
    "identity_registry": false,
    "identity_staking": false,
    "event_registry": false,
    "machine_nft": false,
    "admin_flags": false,
    "did_registry": false
  }
}
```

## Related endpoints

* [API reference overview](/peaqos/api-reference/overview) lists all available endpoints and common error patterns.
