Chain — /api/chain/*
Every endpoint scopes to a state machine via the :slug parameter. Authentication is via Bearer zsm_… token (or zeq_auth_token cookie for browser flows). Read endpoints honour is_public for anonymous access; write endpoints always require requireAuth plus the operator role.
Source: shared/api-core/src/routes/chain.ts.
Endpoints
| Method | Path | Auth | Notes |
|---|---|---|---|
POST | /api/chain/state-machines | Bearer | Spin up a state machine; auto-mints default zsm_ key. |
GET | /api/chain/state-machines | optional | List caller's machines + all public machines. |
GET | /api/chain/state-machines/:slug | optional | Machine metadata. |
POST | /api/chain/:slug/event | Bearer (operator+) | Catch-all event log. |
POST | /api/chain/:slug/state | Bearer (operator+) | State-hash snapshot. |
POST | /api/chain/:slug/file | Bearer (operator+) | File-hash event with metadata. |
POST | /api/chain/:slug/connection | Bearer (operator+) | Inbound/outbound connection event. |
POST | /api/chain/:slug/tx/submit | Bearer (operator+) | Contract transition stub. Returns 501 — use /contracts/:id/transition instead. |
GET | /api/chain/:slug/state | optional | Latest state row. |
GET | /api/chain/:slug/block?zeqond=N | optional | Snapshot at Zeqond N. |
GET | /api/chain/:slug/explore?from=A&to=B | optional | Paginated chain range. |
GET | /api/chain/:slug/explore/sse | optional | Live SSE feed. |
GET | /api/chain/:slug/pohc/validate | optional | Proof-of-Harmonic-Convergence entangled state integrity check. |
GET | /api/chain/aggregate/list | none | Public registry of every is_public state machine. |
GET | /api/chain/aggregate/sse | none | Aggregated public event stream. |
Rate limits
- Spin-up: 10 / min / IP
- Writes: 600 / min / state machine
- Reads: 120 / min / state machine
See also
- Concept: State machines
- Tutorial: Spin up your first state machine
- Concept: Contracts (the
tx/submitsurface)