Preview. Stack v4.0 has not been released, and what is documented here can still change before it does. The current release is v3.2, which covers this as Stack API Reference.Go to v3.2
Ledger

HTTP API

Locate the Ledger REST contract and verify clients against the release you run.

This hidden page is a preparatory map of Ledger 3.0 HTTP surfaces. It does not yet describe a validated, published client contract.

Preview contract#

The current source snapshot includes an OpenAPI file on release/v3.0. That file is useful for reviewing the intended routes and schemas, but it cannot currently be used for client generation or schema validation.

The preview OpenAPI file has known contract defects:

  • a duplicate 400 response key on the promote operation, so strict YAML parsers reject the document;
  • info.version: 1.0.0, which is inconsistent with Ledger 3.0;
  • the Numscript usage counter declared as signed int64 while the protobuf and the HTTP encoder use uint64;
  • no 401 or 403 responses on the Numscript usage operation, which is an authenticated route;
  • a scope named ledger:write in the promote operation's prose, which is not a scope the server defines.

These are contract defects, not client-generation choices. The documentation generator does not ingest this contract yet. They must be fixed and tested against a released server before this page becomes visible.

Route map#

Business routes start with /v3. Operational probes remain unversioned.

SurfaceRoute examplesIntended caller
Business API/v3/{ledgerName}/transactions, /v3/{ledgerName}/accountsApplications and integration services
Cluster-wide API/v3/_/audit-entries, /v3/_/indexesOperational and audit tooling
Operational probes/livez, /readyz, /clusterzKubernetes or monitoring, according to the probe semantics below

Health routes#

These routes answer different questions. Do not treat them as interchangeable.

RouteMeaningCorrect use
/livezThe Ledger process is runningKubernetes liveness probe
/readyzThe local Raft loop has started, regardless of the node's current roleKubernetes readiness probe, including an OrderedReady StatefulSet
/clusterzThe local Raft state is healthy and a leader is electedCluster-connectivity monitoring before cluster-dependent traffic
/healthThe local Raft node is connected to the cluster as leader or followerLegacy compatibility only, and never as a liveness probe: it fails during a leader election and whenever the node loses cluster connectivity

/readyz is intentionally permissive before quorum is available. This allows all peers to start during a cold cluster boot.

/clusterz does not evaluate the disk-space or clock-skew gates used by writes. Monitor those conditions separately; a successful cluster probe does not prove that admission will accept a write.

Never configure /clusterz as the Kubernetes readiness probe. An ordered StatefulSet can then wait for cluster availability before starting the peers needed to establish that availability, deadlocking a cold start.

Request conventions#

  • Send a bearer token when authentication is enabled.
  • Return the next and previous page tokens of a list response unchanged as cursor; see Filter and Paginate Results.
  • Add an idempotency key before retrying a write that the server may have committed.
  • Honor Retry-After: 1, which every 503 Service Unavailable response carries. A 429 Too Many Requests response carries no such header, so use bounded exponential backoff with jitter and an overall deadline there.
  • Branch on the errorCode field of an error body rather than on the status alone; one status covers several conditions with different correct responses.
  • Use the correlation ID returned with an internal error when contacting an operator.

See Errors and Retries for the retry decision and Update Ledger Clients for migration-specific contract changes.

Gates for publication#

Keep this page hidden until:

  1. the OpenAPI document parses with unique YAML keys and a Ledger 3.0 version;
  2. contract tests compare every documented route and response with the released binary;
  3. the documentation generator publishes the release-pinned operation reference;
  4. generated-client tests cover pagination, authentication, validation, conflicts, idempotent retries, and overload responses;
  5. the final Ledger tag, image digest, and Stack v4 component version point to the same source revision.
  6. numeric signedness, authentication requirements, and declared error responses match the runtime for every newly added operation.