Erase a person's words
const url = 'https://example.com/v1/memory/erasures';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"factId":"example"}'};
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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "factId": "example" }'Starts erasing, in the background, one fact (factId), a person (subject: an app’s end user participant, or an external subject facts name) or one conversation (conversationId): their facts, conversations (messages, recall rows), the runs that served them (input, output, journal, snapshots) and the free text they left in provenance; facts written from them go to review. Answers 202 with the erasure; follow it with GET /v1/memory/erasures/{erasureId}. A completed erasure keeps no identifier, only a keyed hash for a replay after a backup restore; warnings says when this deployment can’t keep one (erasure-unmatchable: no erasure ledger key, KINDGI_ERASURE_LEDGER_KEY). 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”Responses
Section titled “Responses”Started.
object
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.
Where a running erasure is: seed, expand, settle (the person’s unfinished runs end, or it waits for them, before anything is cleared), erase, then done.
user:<id> or service:<id>.
A replay after a backup restore can find this person again: a keyed hash was kept.
What each store cleared or deleted, by store.
object
Failed attempts so far.
The last failure’s code, or not-yet:<reason> while it waits. Never content.
The run it waits (or waited) for, and until when; kept as the record of the wait.
object
A tenant admin said not to wait.
Runs of the person’s kept appearing, round after round: the erasure went on to erase after its last round rather than wait any longer. Absent: it didn’t.
object
erasure-unmatchable: this deployment has no erasure ledger key (KINDGI_ERASURE_LEDGER_KEY), so a replay after a restore can’t find this person.
Example
{ "selectorKind": "fact", "selector": { "subject": { "kind": "participant" } }, "status": "pending", "phase": "seed", "forced": true, "settleRoundsCapped": true, "warnings": [ { "code": "erasure-unmatchable" } ]}Not exactly one of factId, subject or conversationId; or a subject of kind user (erasing a Kindgi user isn’t offered).
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" }}legal-hold: a fact it reaches is under legal hold (details.factIds); nothing started.
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" }}