v49

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-261319281.7 MB

Create a memory

post/v1/memory_stores/{memory_store_id}/memories?beta=true

Path parameters

memory_store_idstring required

Path parameter memory_store_id

Query parameters

view'basic' | 'full'

Selects which projection of a memory or memory_version the server returns. basic returns the object with content set to null; full populates content. When omitted, the default is endpoint-specific: retrieve operations default to full; list, create, and update operations default to basic. Listing with view=full caps limit at 20.

Query parameter for view

Headers

anthropic-versionstring
anthropic-betastring

Request body

pathstring required

Hierarchical path for the new memory, e.g. /projects/foo/notes.md. Must start with /, contain at least one non-empty segment, and be at most 1,024 bytes. Must not contain empty segments, . or .. segments, control or format characters, and must be NFC-normalized. Paths are case-sensitive.

contentstring nullable required

UTF-8 text content for the new memory. Maximum 100 kB (102,400 bytes). Required; pass "" explicitly to create an empty memory.

Response

Successful response (OK)

type'memory' required
idstring required

Unique identifier for this memory (a mem_... value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.

memory_store_idstring required

ID of the memory store this memory belongs to (a memstore_... value).

pathstring required

Hierarchical path of the memory within the store, e.g. /projects/foo/notes.md. Always starts with /. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.

contentstring nullable

The memory's UTF-8 text content. Populated when view=full; null when view=basic. Maximum 100 kB (102,400 bytes).

content_size_bytesinteger required

Size of content in bytes (the UTF-8 plaintext length). Always populated, regardless of view.

content_sha256string required

Lowercase hex SHA-256 digest of the UTF-8 content bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a content_sha256 precondition on update. Always populated, regardless of view.

memory_version_idstring required

ID of the memory_version representing this memory's current content (a memver_... value). This is the authoritative head pointer; memory_version objects do not carry an is_latest flag, so compare against this field instead. Enumerate the full history via List memory versions.

created_atstring date-time required

A timestamp in RFC 3339 format

updated_atstring date-time required

A timestamp in RFC 3339 format