Creates a memory file inside a memory store. The store must be unarchived and undeleted.
Prerequisites
Endpoint and authentication configured. For details, see Overview and authentication.
Endpoint
POST /memory_stores/{memory_store_id}/memories
Path parameters
| Field | Required | Type | Description |
|---|---|---|---|
memory_store_id | Yes | string | Memory store ID |
Request body
| Field | Required | Type | Description |
|---|---|---|---|
path | Yes | string | Path inside the memory store, starting with /, for example /notes/project.md |
content | Yes | string | Body in UTF-8 text; empty strings are allowed, up to 102400 bytes |
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 | string | Body, UTF-8 text; returned when view=full or in single-item reads |
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 |