Ledger
Append-only, hash-chained record of agent and user actions. Every entry commits to the previous entry's hash. There are intentionally no update or delete routes.
Auth: all calls require a Bearer JWT plus the X-Workspace-Id header.
GET
/api/ledgerAuth requiredList ledger entries, newest first.
Query Parameters
| Field | Type | Required | Note |
|---|---|---|---|
| actor | string | No | — |
| action | string | No | — |
| entity_type | string | No | — |
| entity_id | string | No | — |
| limit | number | No | Default 50, max 500 |
| offset | number | No | Default 0 |
Response
{
"entries": [
{
"id": 41,
"seq": 41,
"ts": "2026-03-28T14:30:00Z",
"actor_type": "agent",
"actor": "support-bot",
"action": "issue.closed",
"entity_type": "issue",
"entity_id": "ISS-4821",
"reason": "Fix verified on staging",
"evidence": { "run_id": 7 },
"prev_hash": "9f2c…",
"hash": "b71d…"
}
],
"total": 41
}POST
/api/ledger/appendAuth requiredAppend an entry to the chain. The server assigns the sequence number and links the hash.
Request Body
| Field | Type | Required | Note |
|---|---|---|---|
| actor | string | Yes | Agent or user name |
| action | string | Yes | e.g. issue.closed |
| actor_type | string | No | "agent" | "user" | "system", default "agent" |
| entity_type | string | No | — |
| entity_id | string | No | — |
| reason | string | No | — |
| evidence | object | No | Arbitrary JSON payload |
Response
{
"id": 42,
"seq": 42,
"ts": "2026-03-28T15:00:00Z",
"actor_type": "agent",
"actor": "support-bot",
"action": "issue.closed",
"prev_hash": "b71d…",
"hash": "e04a…"
}GET
/api/ledger/verifyAuth requiredRecompute the whole chain and report whether it is intact. On failure, reports the first bad sequence number.
Response
{ "ok": true, "entries": 42 }GET
/api/ledger/stats/summaryAuth requiredAction counts per actor.
Response
{
"agents": [
{ "agent": "support-bot", "actions": 18 },
{ "agent": "sam", "actions": 5 }
],
"total": 23
}GET
/api/ledger/{seq}Auth requiredGet one entry by its sequence number.
Response
{
"id": 41,
"seq": 41,
"ts": "2026-03-28T14:30:00Z",
"actor_type": "agent",
"actor": "support-bot",
"action": "issue.closed",
"entity_type": "issue",
"entity_id": "ISS-4821",
"prev_hash": "9f2c…",
"hash": "b71d…"
}