MemorySync
API Reference

Update Memory

Update mutable metadata on a single memory. Editable fields are tags, importance, metadata, source, and event_type. The body, embeddings, ownership, summary flag, environment, and project are not mutable through this endpoint. At least one editable field must be present.
PATCH/memory/{memory_id}

Authentication

Accepts a JWT bearer token (Authorization: Bearer eyJ…) or an API key (X-API-Key: ms_live_…). API-key callers should send X-Project-ID unless the key is project-locked. Cross-tenant operators must send X-Tenant-ID.

Path parameters

FieldTypeRequiredDescription
memory_idintegerrequiredPositive integer id.

Request body

FieldTypeRequiredDescription
tagsstring[]optionalReplaces the tag list. Pass [] to clear.
importancenumberoptionalNew value in [0.0, 1.0].
metadataobjectoptionalReplaces the user-supplied metadata bag. Reserved keys (content_type, source, event_type, user_id, project_id, environment) are stripped.
sourcestringoptionalNew source label.
event_typestringoptionalNew event type label.
request.json
{
"tags": [
"preferences",
"ui"
],
"importance": 0.7
}

Response

Returns 200 OK with the following body.

FieldTypeRequiredDescription
(same as Get Memory)objectoptionalReturns the full record after the update is committed.
200.json
{
"id": 184213,
"text": "User prefers dark mode and concise responses.",
"tags": [
"preferences",
"ui"
],
"importance": 0.7,
"source": "chat",
"event_type": null,
"metadata": {
"user_id": "u_42"
},
"created_at": "2026-05-04T12:30:11Z",
"updated_at": "2026-05-04T12:31:00Z"
}

Errors

StatusCodeDescription
400validation_errorBody or query failed schema validation. The error includes the offending field name.
401unauthenticatedMissing or invalid bearer token / API key.
403forbiddenAuthenticated principal lacks the required scope, role, or project access.
404not_foundTarget resource does not exist or is not visible to the calling tenant.
429rate_limitedPer-IP or per-route limit exceeded. Respect the Retry-After header.
500internal_errorUnhandled server error. Quote the request_id when contacting support.

Examples

cURL
curl -X PATCH https://api.memorysync.io/memory/EXAMPLE_ID \
-H "Authorization: Bearer $MEMORYSYNC_KEY" \
-H "Content-Type: application/json" \
-d '{
"tags": [
"preferences",
"ui"
],
"importance": 0.7
}'
javascript
import { MemorySync } from 'memorysync'
const client = new MemorySync({ apiKey: process.env.MEMORYSYNC_KEY })
const result = await client.request({
method: 'PATCH',
path: '/memory/EXAMPLE_ID',
body: {
"tags": [
"preferences",
"ui"
],
"importance": 0.7
},
})
console.log(result)
python
from memorysync import Client
client = Client(api_key=os.environ["MEMORYSYNC_KEY"])
result = client.request(
method="PATCH",
path="/memory/EXAMPLE_ID",
json={
"tags": [
"preferences",
"ui"
],
"importance": 0.7
},
)
print(result)

Behavior & notes

Required scope: memories:write. Submitting a body with no editable fields returns 422 from the schema validator. On success a memory.updated webhook event is emitted with the list of changed fields.