Claude Platform Docs

Memories

Create a Memory
BetaManagedAgentsMemory Beta.MemoryStores.Memories.Create(parameters, cancellationToken = default)
POST/v1/memory_stores/{memory_store_id}/memories
List Memories
MemoryListPage Beta.MemoryStores.Memories.List(parameters, cancellationToken = default)
GET/v1/memory_stores/{memory_store_id}/memories
Retrieve a Memory
BetaManagedAgentsMemory Beta.MemoryStores.Memories.Retrieve(parameters, cancellationToken = default)
GET/v1/memory_stores/{memory_store_id}/memories/{memory_id}
Update a Memory
BetaManagedAgentsMemory Beta.MemoryStores.Memories.Update(parameters, cancellationToken = default)
POST/v1/memory_stores/{memory_store_id}/memories/{memory_id}
Delete a Memory
BetaManagedAgentsDeletedMemory Beta.MemoryStores.Memories.Delete(parameters, cancellationToken = default)
DELETE/v1/memory_stores/{memory_store_id}/memories/{memory_id}
Models
class BetaManagedAgentsConflictError { Type = "conflict_error"; Message; }
JsonElement Type = "conflict_error"
string Message
class BetaManagedAgentsContentSha256Precondition { Type = "content_sha256"; ContentSha256; }

A precondition that applies an update only if the memory's current content has the hash in content_sha256.

If the hashes differ, the request fails with HTTP status 409. Retrieve the memory and retry. If the memory already has exactly the requested content and path, the request succeeds even though the hashes differ.

JsonElement Type = "content_sha256"
string ContentSha256

Expected content_sha256 of the stored memory (64 lowercase hexadecimal characters). Typically the content_sha256 returned by a prior read or list call. Because the server applies no content normalization, clients can also compute this locally as the SHA-256 of the UTF-8 content bytes.

class BetaManagedAgentsDeletedMemory { Type = "memory_deleted"; ID; }

The confirmation that Delete a Memory returns.

Deleting a memory doesn't delete its versions. List Memory Versions returns them while they are retained: each version is kept for at least the version retention period after it was written, unless the store itself is deleted.

See the memory guide to learn more about how long versions are kept.

JsonElement Type = "memory_deleted"
required string ID

ID of the deleted memory (a mem_... value).

class BetaManagedAgentsError: union
class BetaManagedAgentsMemory { Type = "memory"; ID; ContentSha256; /* 7 more */ }

A text document at a path inside a memory store.

content is null when the response uses view=basic. content_size_bytes and content_sha256 are always set, so you can detect changes without fetching the content. To retrieve, update, or delete a memory, pass its ID, which stays the same when its path changes.

See the memory guide to learn more about working with memories.

class BetaManagedAgentsMemoryListItem: union

One item in a List Memories response: a memory, or a memory_prefix marker when depth is 1.

class BetaManagedAgentsMemory { Type = "memory"; ID; ContentSha256; /* 7 more */ }

A text document at a path inside a memory store.

content is null when the response uses view=basic. content_size_bytes and content_sha256 are always set, so you can detect changes without fetching the content. To retrieve, update, or delete a memory, pass its ID, which stays the same when its path changes.

See the memory guide to learn more about working with memories.

class BetaManagedAgentsMemoryPrefix { Type = "memory_prefix"; Path; }

A directory marker that List Memories returns instead of the memories below the requested depth.

It stands for one or more memories whose paths start with path. It isn't a stored object and doesn't have an ID. Each marker counts toward the page limit.

JsonElement Type = "memory_prefix"
required string Path

The rolled-up path prefix, including a trailing / (e.g. /projects/foo/). Pass this value as path_prefix on a subsequent list call to drill into the directory.

class BetaManagedAgentsMemoryPathConflictError { Type = "memory_path_conflict_error"; ConflictingMemoryID; ConflictingPath; Message; }

The error returned with HTTP status 409 when you create or rename a memory and the path you give is already used by another memory or overlaps another memory's path.

Two paths overlap when one is an ancestor of the other, such as /notes and /notes/todo.md. To free the path, rename or delete the memory that conflicting_memory_id references, then retry. To change that memory instead of creating a new one, update it.

JsonElement Type = "memory_path_conflict_error"
string ConflictingMemoryID

The ID of the memory that blocked the write (mem_...), or an empty string if that memory can't be identified.

Retry the request when it is empty.

string ConflictingPath

The path that blocked the write: the requested path, or the path of a memory that is an ancestor or descendant of it.

string Message

A human-readable explanation of the conflict. To handle the error in code, use conflicting_path and conflicting_memory_id instead.

class BetaManagedAgentsMemoryPreconditionFailedError { Type = "memory_precondition_failed_error"; Message; }

The error returned with HTTP status 409 when a request's precondition doesn't hold for the memory's current state, such as precondition on an update or expected_content_sha256 on a delete.

The error doesn't include the memory's current state. Retrieve the memory to see its current content and content_sha256 before you retry.

See the memory guide to learn more about safe content edits with content hash preconditions.

JsonElement Type = "memory_precondition_failed_error"
string Message

A human-readable explanation of why the precondition failed.

class BetaManagedAgentsMemoryPrefix { Type = "memory_prefix"; Path; }

A directory marker that List Memories returns instead of the memories below the requested depth.

It stands for one or more memories whose paths start with path. It isn't a stored object and doesn't have an ID. Each marker counts toward the page limit.

JsonElement Type = "memory_prefix"
required string Path

The rolled-up path prefix, including a trailing / (e.g. /projects/foo/). Pass this value as path_prefix on a subsequent list call to drill into the directory.

enum BetaManagedAgentsMemoryView

Whether a memory or memory_version in the response includes its content. Defaults to full on retrieve operations and to basic on list, create, and update operations.

With full, list operations return at most 20 items per page.

Basic("basic")

Return the object with content set to null. The content_size_bytes and content_sha256 fields remain populated, so sync clients can diff without fetching content.

Full("full")

Return the object with content populated. On list endpoints, view=full caps limit at 20.

class BetaManagedAgentsPrecondition { Type = "content_sha256"; ContentSha256; }

Optional condition that must hold for an update to apply. When omitted, the update is unconditional. Asserts the current state of the memory being updated. When an update changes path, the precondition still refers to the memory's current content, not the destination path. Currently the only supported variant is content_sha256.

JsonElement Type = "content_sha256"
string ContentSha256

Expected content_sha256 of the stored memory (64 lowercase hexadecimal characters). Typically the content_sha256 returned by a prior read or list call. Because the server applies no content normalization, clients can also compute this locally as the SHA-256 of the UTF-8 content bytes.