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

# GET /api/health — Reader Connectivity and Data Freshness

> Returns the reader's connection status, current ledger index, data source, build version, and degraded state with age when upstream is unhealthy.

Use this endpoint to check whether the Orma reader is connected to the ledger and how fresh its data is. The server starts listening before the reader connects — `ok` is `false` until the first poll tick completes, which is honest about readiness rather than pretending to be ready. Poll this endpoint to build a staleness banner or liveness probe.

## Parameters

This endpoint takes no parameters.

## Request

```bash theme={null}
curl -s http://localhost:8787/api/health
```

## Response — Healthy

```json theme={null}
{
  "ok": true,
  "contractVersion": "1.0.0",
  "source": "devnet",
  "network": "devnet",
  "ledgerIndex": 5263343,
  "serverTime": "2026-09-12T22:20:22Z",
  "buildVersion": "3.4.0-rc5"
}
```

## Response — Degraded

```json theme={null}
{
  "ok": true,
  "contractVersion": "1.0.0",
  "source": "devnet",
  "network": "devnet",
  "ledgerIndex": 5263343,
  "serverTime": "2026-09-12T22:20:22Z",
  "buildVersion": "3.4.0-rc5",
  "degraded": true,
  "lastLedgerAgeSeconds": 47
}
```

## Response Fields

<ResponseField name="ok" type="boolean">
  `false` until the first poll tick completes. `true` once the reader has received at least one ledger. A `true` reading with `degraded: true` means the reader has data but upstream is currently unhealthy.
</ResponseField>

<ResponseField name="contractVersion" type="string">
  The API contract version. Currently `"1.0.0"`. Breaking changes increment the major version.
</ResponseField>

<ResponseField name="source" type="string">
  Where the data came from: `"devnet"` for a live Devnet read, `"fixtures"` for the recorded ring buffer used in offline demos.
</ResponseField>

<ResponseField name="network" type="string">
  Always `"devnet"`. This service runs against XRPL Devnet — XLS-65 vaults and XLS-66 lending are not amended into Mainnet.
</ResponseField>

<ResponseField name="ledgerIndex" type="number">
  The ledger sequence number of the most recent successful read.
</ResponseField>

<ResponseField name="serverTime" type="string">
  ISO 8601 close time of the most recent ledger. This is the ledger close time converted from the Ripple epoch — not the server's wall clock.
</ResponseField>

<ResponseField name="buildVersion" type="string | null">
  The `rippled` build version reported by the connected node. Reported, never asserted — Devnet nodes upgrade independently.
</ResponseField>

<ResponseField name="degraded" type="boolean">
  Present only when upstream is unhealthy. When `true`, the reader is keeping the last good snapshot rather than blanking. Display stale data with an age banner rather than an empty screen.
</ResponseField>

<ResponseField name="lastLedgerAgeSeconds" type="number">
  Present only alongside `degraded: true`. Seconds since the last successful ledger read.
</ResponseField>

<Note>
  `GET /api/health` is the one response that does not go through `stamp()`. It builds `serverTime` and `ledgerIndex` itself, because it must be able to report on the reader's state before the reader has necessarily connected — including the case where `ok` is `false` and no ledger has been seen yet.
</Note>
