Replay erasures after a backup restore
const url = 'https://example.com/v1/memory/erasures/replay';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"erasures":[{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","selectorKind":"fact","selectorHmac":"example","keyId":"example","requestedBy":"example","status":"pending","createdAt":"2026-04-15T12:00:00Z","completedAt":"2026-04-15T12:00:00Z"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/memory/erasures/replay \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "erasures": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "selectorKind": "fact", "selectorHmac": "example", "keyId": "example", "requestedBy": "example", "status": "pending", "createdAt": "2026-04-15T12:00:00Z", "completedAt": "2026-04-15T12:00:00Z" } ] }'Takes the ledger GET /v1/memory/erasures/export gave, puts back the rows the restore lost, and finds each erasure’s person (or fact, or conversation) again by its keyed hash: those run again (replayed); ones nothing in the tenant matches are only restored (restored); ones with no keyed hash, or a key this deployment doesn’t hold, are unmatched. Requires admin on the tenant.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Caller-supplied idempotency key, scoped to the caller: the same key from someone else in the tenant is their own request (from 0.1.5). Retries with the same key return the original response byte-identical (per docs/API-ROUTE-CONVENTIONS.md §3.1). A retry sent while the first request still runs is answered 409 idempotency-key-in-flight with Retry-After, on a runtime whose store holds keys (from 0.1.5); retry after it, and you get the first request’s answer. An answer that carries a secret (a new API key or public run token, a session token, a generated signing secret) isn’t kept: a retry gets 409 idempotency-key-replay-withheld, with the first request’s status and when it succeeded (from 0.1.5).
Request Bodyrequired
Section titled “Request Bodyrequired”object
The ledger as GET /v1/memory/erasures/export gave it.
object
HMAC-SHA256 of the selector under the tenant’s ledger key; absent without one.
Which ledger key made selectorHmac.
waiting-on-run: a turn of the person’s sits in a flow that serves other people; the erasure waits for it (waitingOn) until its deadline, then cancels it.
Responses
Section titled “Responses”What was replayed.
object
Found in the tenant again: run again.
Put back in the ledger; nothing in the tenant matches.
object
Example
{ "unmatched": [ { "reason": "no-keyed-hash" } ]}Not {erasures: [...]} as the export gave them.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Not a tenant admin.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key was reused with a different body, or resource-state conflict.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Server error (unmapped domain code or framework crash).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}