Modifies the body, renames, or updates atomically. At least one of path and content must be present. A real change produces a modified version. Returns updated metadata without the body.
Prerequisites
Endpoint and authentication configured. For details, see Overview and authentication.
Endpoint
POST /memory_stores/{memory_store_id}/memories/{memory_id}
Path parameters
| Field | Required | Type | Description |
|---|---|---|---|
memory_store_id | Yes | string | Memory store ID |
memory_id | Yes | string | Memory ID |
Request body
| Field | Required | Type | Description |
|---|---|---|---|
path | No | string | New path (rename), same rules as creation; the memory ID stays unchanged |
content | No | string | New body, up to 102400 UTF-8 bytes |
precondition | No | object | Optional optimistic lock: carries the content_sha256 obtained at read time; returns a conflict if the content has been modified |
Request example
Response example
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Memory ID, format mem_xxx |
type | string | Always memory |
memory_store_id | string | ID of the owning memory store |
path | string | Path inside the memory store, starting with / |
content_sha256 | string | SHA256 of the body; can be used as the optimistic lock for conditional updates |
content_size_bytes | integer | Body length in UTF-8 bytes |
memory_version_id | string | Current version ID, format memver_xxx |
created_at | string | Creation time, ISO 8601 UTC |
updated_at | string | Last update time, ISO 8601 UTC |
Error codes
| HTTP status | Error code | Description |
|---|---|---|
| 400 | invalid_request_error | Invalid parameters, path, limit, or pagination cursor |
| 401 | InvalidApiKey | API key missing, invalid, or expired |
| 403 | permission_error | Insufficient identity or resource access permissions |
| 404 | not_found_error | Resource does not exist or does not belong to the current workspace |
| 409 | memory_path_conflict_error etc. | Path conflict, conditional update conflict, or writing to an archived store |