Skip to content

Replay erasures after a backup restore

POST
/v1/memory/erasures/replay
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.

Idempotency-Key
string
>= 1 characters

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).

Media typeapplication/json
object
erasures
required

The ledger as GET /v1/memory/erasures/export gave it.

Array<object>
<= 10000 items
object
id
required
string format: uuid
selectorKind
required
string
Allowed values: fact participant external conversation
selectorHmac

HMAC-SHA256 of the selector under the tenant’s ledger key; absent without one.

string
/^[0-9a-f]{64}$/
keyId

Which ledger key made selectorHmac.

string
requestedBy
required
string
status
required

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.

string
Allowed values: pending running waiting-on-run completed failed
createdAt
required
string format: date-time
completedAt
string format: date-time

What was replayed.

Media typeapplication/json
object
replayed
required

Found in the tenant again: run again.

Array<string>
restored
required

Put back in the ledger; nothing in the tenant matches.

Array<string>
unmatched
required
Array<object>
object
id
required
string format: uuid
reason
required
string
Allowed values: no-keyed-hash unknown-key
Example
{
"unmatched": [
{
"reason": "no-keyed-hash"
}
]
}

Not {erasures: [...]} as the export gave them.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Missing / malformed / expired / revoked bearer token.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Not a tenant admin.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Idempotency-Key was reused with a different body, or resource-state conflict.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Server error (unmapped domain code or framework crash).

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}