Correct
Retract one fact that was read wrong, for good, and optionally say what is true instead.
POST /v1/memory/correctFacts are read from conversations by a model, and a model can read one wrong. Correct takes one fact back by
the id search gave it. Search, the known lines, and history stop showing it at once, and
it stays retracted when the conversation is read again. The words it was read from are not touched. Makes no model call. See
Corrections.
With a replacement, what is true instead is added as a note with the id correction-<digest>. The note is
searchable at once and is read into facts like any other item. Correcting the same fact twice writes one note.
Headers
AuthorizationstringBearer tm_…. The key must read and write.
X-Twin-AccountstringThe end user the fact belongs to. See End users.
X-Request-IdstringYour id for this request, echoed on the response.
Body
record_idstringThe fact's id as search returns it (th_…#r…), or its path (records/th_….json#3). 1 to 512
characters. An address is a position: the facts after a retracted one move down by one. An id does not
move.
replacementstringWhat is true instead, up to 4,000 characters. Empty or absent adds no note.
Response
retractedstringThe id as sent.
textstringThe text of the fact that was retracted.
replacementstring | nullThe id of the note added, or null.
Errors
400bad requestX-Twin-Account is missing or not a usable id.401unauthorized403forbiddenthis key reads; writing takes a key that writes.404not foundno record '<record_id>' in this account.422invalidrecord_id, or a replacement over 4,000 characters.503unavailableRetry-After seconds.curl https://api.twinmemory.dev/v1/memory/correct \
-H "Authorization: Bearer $TWIN_MEMORY_API_KEY" \
-H "X-Twin-Account: user_42" \
-H "Content-Type: application/json" \
-d '{
"record_id": "th_8b5e5d4c8946d815#r028d461216652fe5",
"replacement": "Alice lives in Porto since 2026-10-15."
}'{
"retracted": "th_8b5e5d4c8946d815#r028d461216652fe5",
"text": "Alice lives in Lisbon",
"replacement": "correction-334be8de711f8fde"
}{ "detail": "no record 'th_x#rdeadbeef' in this account" }