Skip to content
Get started

Update a memory (creates new version)

PATCH/v4/memories

Update a memory by creating a new version. The original memory is preserved with isLatest=false.

Body ParametersJSONExpand Collapse
containerTag: string

Container tag / space identifier. Required to scope the operation.

maxLength100
newContent: string

The new content that will replace the existing memory

minLength1
id: optional string

ID of the memory entry to operate on

content: optional string

Exact content match of the memory entry to operate on. Use this when you don’t have the ID.

forgetAfter: optional string

ISO 8601 datetime string. The memory will be auto-forgotten after this time. Pass null to clear an existing expiry. Omit to inherit from the previous version.

formatdatetime
forgetReason: optional string

Optional reason for the scheduled forgetting. Cleared automatically when forgetAfter is set to null.

metadata: optional map[string or number or boolean or array of string]

Optional metadata. If not provided, inherits from the previous version.

One of the following:
string
number
boolean
array of string
temporalContext: optional object { documentDate, eventDate }

Structured temporal metadata. Merged into the metadata JSON column. If omitted, existing temporalContext is preserved.

documentDate: optional string

Date the document was authored

formatdatetime
eventDate: optional array of string

Dates of events referenced in the memory

ReturnsExpand Collapse
id: string

ID of the newly created memory version

createdAt: string

When this memory version was created

formatdatetime
forgetAfter: string

When this memory will be auto-forgotten, or null if no expiry

formatdatetime
forgetReason: string

Reason for the scheduled forgetting, or null

memory: string

The content of the new memory version

parentMemoryId: string

ID of the memory this version updates

rootMemoryId: string

ID of the first memory in this version chain

version: number

Version number of this memory entry

Update a memory (creates new version)

curl https://api.supermemory.ai/v4/memories \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
    -d '{
          "containerTag": "user_123",
          "newContent": "John now prefers light mode",
          "id": "mem_abc123",
          "content": "John prefers dark mode",
          "forgetAfter": "2026-06-01T00:00:00Z",
          "forgetReason": "temporary project deadline"
        }'
{
  "id": "mem_xyz789",
  "createdAt": "createdAt",
  "forgetAfter": "forgetAfter",
  "forgetReason": "forgetReason",
  "memory": "John now prefers light mode",
  "parentMemoryId": "mem_abc123",
  "rootMemoryId": "mem_abc123",
  "version": 2
}
Returns Examples
{
  "id": "mem_xyz789",
  "createdAt": "createdAt",
  "forgetAfter": "forgetAfter",
  "forgetReason": "forgetReason",
  "memory": "John now prefers light mode",
  "parentMemoryId": "mem_abc123",
  "rootMemoryId": "mem_abc123",
  "version": 2
}