Change a fact's content
const url = 'https://example.com/v1/memory/facts/example/supersede';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"content":"example","expectVersion":1,"retention":{"keepUntil":"2026-04-15T12:00:00Z","keepDays":1,"legalHold":true},"subjects":[{"kind":"participant","id":"example"}],"validFrom":"2026-04-15T12:00:00Z","validUntil":"2026-04-15T12:00:00Z","observedAt":"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/facts/example/supersede \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "content": "example", "expectVersion": 1, "retention": { "keepUntil": "2026-04-15T12:00:00Z", "keepDays": 1, "legalHold": true }, "subjects": [ { "kind": "participant", "id": "example" } ], "validFrom": "2026-04-15T12:00:00Z", "validUntil": "2026-04-15T12:00:00Z", "observedAt": "2026-04-15T12:00:00Z" }'Writes the next revision (same fact id, version one more) and closes the current one; the old revision stays readable with ?version=, ?asOf= and in the history until the retention sweep removes it. expectVersion refuses if someone changed it first. A key or session limited to a project writes only in that project or one of its conversations: any other scope is 403 permission-denied, facts about its own person included.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”The fact’s next revision: new content, and optionally new retention, subjects and times (absent ones keep their current values). Its scope and type stay. expectVersion: only if the current revision is still this one.
object
Responses
Section titled “Responses”The new revision.
object
Example
{ "source": { "kind": "http-api", "refresh": { "strategy": "on-read" } }, "trust": "verified", "attributedTo": { "kind": "user" }, "subjects": [ { "kind": "participant" } ], "invalidationReason": "superseded", "review": "pending"}Malformed request body.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}permission-denied: the caller may not write in the fact’s scope. Without an authorization store, key-project-mismatch (details.keyProjectId): the API key or session is limited to a project, and this writes above it, to the workspace, an org or a team (with a store, that is permission-denied).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No fact with that id the caller may see, or it was deleted.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}fact-changed: the current revision is not expectVersion (details.currentVersion); legal-hold: the fact is under legal hold. Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The Idempotency-Key store (idempotency-store-unavailable) or the authorization store (authz-backend-unavailable) couldn’t be reached before the request ran, or the database was too busy for its authorization check (database-busy), so nothing was changed; Retry-After (whole seconds) says when to try again with the same key. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/memory/facts: List factsPOST /v1/memory/facts: Write a factGET /v1/memory/facts/{factId}: Fetch a factDELETE /v1/memory/facts/{factId}: Delete a fact- Error code
authz-backend-unavailable - Error code
database-busy - Error code
fact-changed - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
key-project-mismatch - Error code
legal-hold - Error code
permission-denied - Error code
rate-limit-exceeded - Error code
request-too-large - Error code
tenant-state-unavailable - Every error code