Delete a fact
const url = 'https://example.com/v1/memory/facts/example';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://example.com/v1/memory/facts/example \ --header 'Authorization: Bearer <token>'Closes the current revision (invalidationReason: deleted): the fact is no longer listed, fetched or retrieved, and its history stays readable until the retention sweep removes it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The fact id (kept across revisions).
Query Parameters
Section titled “Query Parameters”Only if the current revision is still this one; otherwise 409 fact-changed with currentVersion.
Responses
Section titled “Responses”The closed revision.
object
The fact id, kept across revisions (for a fact never superseded, also its one revision id).
This revision’s own id; absent where it equals id.
Fact type identifier (pack-defined; a few are framework-standard).
Fact scope object. tenantId is required; every optional key narrows the fact (userId, orgId, projectId, threadId, sessionId, participantId). A fact is readable by whoever has every container it names. Additional keys accepted for forward compatibility.
object
An app’s end user, by the app’s own id: a fact private to that participant’s runs. Needs projectId.
The revision number within the fact: 1, then one more per supersede or verify.
Free-form structured payload.
blob://<provider>/<bucket>/<key> when the payload is stored externally.
object
object
object
object
The revision this one replaced.
verified: a person with the right checked it. asserted: an app or a person wrote it. unverified: an agent remembered it during a conversation. Absent on facts from before trust was recorded: asserted.
Who asserted a fact, set by the server from the writer.
object
The run step that wrote a fact, for one an agent wrote.
object
Whom a fact is about: what access and erasure requests by person find.
object
When the fact starts being true in the world; absent: always.
When the fact stops being true in the world; absent: still true.
When it was said or seen.
When this revision stopped being current; absent: it is current.
user:<id> or service:<id>.
pending while a person must approve it: a pending fact is never retrieved.
When this revision stops being readable: from its retention (keepUntil, or keepDays from the fact’s first write), or an agent-remembered fact’s unverified window. No read returns it after; absent: it doesn’t expire.
Example
{ "source": { "kind": "http-api", "refresh": { "strategy": "on-read" } }, "trust": "verified", "attributedTo": { "kind": "user" }, "subjects": [ { "kind": "participant" } ], "invalidationReason": "superseded", "review": "pending"}expectVersion is not a revision number.
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" }}permission-denied: the caller may not write in the fact’s scope.
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" }}No fact with that id the caller may see, or it was deleted.
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" }}fact-changed: the current revision is not expectVersion; legal-hold: the fact is under legal hold.
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" }}memory-operation-unsupported: this runtime’s memory can’t delete facts.
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" }}