MemorySync
API Reference

Update Memory

Replace one or more supported descriptive fields on a scoped memory and receive the updated Memory.

Endpoint and request fields

Edit its fields
PATCH/memory/{memory_id}
200 OK
FieldTypeContract
memory_id / memoryIdintegerRequired positive memory ID in the path or first SDK argument.
tagsstring[]Optional replacement tags; use an empty array to clear.
importancenumberOptional value from 0 to 1.
metadataobjectOptional replacement application metadata.
sourcestringOptional replacement source label.
event_type / eventTypestringOptional replacement event label.

Provide at least one editable field.

Update descriptive fields

import os
from memorysync import MemorySyncClient
client = MemorySyncClient(
api_key=os.environ["MEMORYSYNC_API_KEY"],
base_url="https://api.memorysync.io",
project_id=os.environ["MEMORYSYNC_PROJECT_ID"],
end_user_id="usr_7f3a9c2e",
)
memory = client.update(
101,
tags=["preference", "ui"],
metadata={"confirmed": True},
)

Result paths

200 Memory result

Updated Memory

The response is the updated Memory record, not only the submitted fields.

Identity
Python `memory.id`; Node.js `memory.id`; REST `id`

The original memory ID.

Updated fields
`tags`, `importance`, `metadata`, `source`, `event_type` / `eventType`

Supported descriptive fields.

Unchanged content
`text`

Text is not editable through this operation.

Timestamp
`updated_at` / `updatedAt`

Update time when available.

200-response.json
{"id":101,"text":"The user uses dark mode.","tags":["preference","ui"],"source":"chat","event_type":null,"importance":null,"metadata":{"confirmed":true},"is_summary":false,"created_at":"2026-05-04T12:30:11Z","updated_at":"2026-05-04T12:40:00Z"}

Errors and next action

Provide a positive ID and at least one editable field. Correct 404 scope or ID issues and other 4xx validation errors. For an interrupted request, fetch the memory before deciding whether another update is needed.

Safety notes

Understand update semantics

FieldUpdate behavior
tagsReplaces the tag list; pass an empty array to clear it.
importanceSets a value from 0 to 1.
metadataReplaces customer-controlled metadata values accepted by the operation.
sourceReplaces the application source label.
event_type / eventTypeReplaces the application event label.
textNot editable through Update.

Use a read-modify-write workflow

Update workflow
  1. 01

    Fetch

    GET

    Get the current record when your decision depends on existing values.

  2. 02

    Validate

    CHECK

    Validate replacement fields in your application.

  3. 03

    Update

    PATCH

    Send at least one editable field.

  4. 04

    Use

    200

    Read the returned updated Memory rather than assuming the submitted shape.

  5. 05

    Reconcile

    SAFE

    After an interrupted response, fetch before deciding to repeat.

Was this page helpful?