メモリを削除
メモリを削除
Path parameters
The ID of the memory store that holds the memory (memstore_...).
The ID of the memory to delete (mem_...).
Query parameters
expected_content_sha256: optional stringDelete the memory only if its current content_sha256 equals this value, given as 64 lowercase hexadecimal characters. Omit it to delete unconditionally.
Delete the memory only if its current content_sha256 equals this value, given as 64 lowercase hexadecimal characters. Omit it to delete unconditionally.
If the hashes differ, the request fails with HTTP status 409 and nothing is deleted.
Headers
"anthropic-version": optional stringThe version of the Claude API you want to use.
The version of the Claude API you want to use.
Read more about versioning and our version history here.
"anthropic-beta": optional array of AnthropicBetaThis endpoint is in beta: requests must send agent-memory-2026-07-22 or managed-agents-2026-04-01 in this header.
This endpoint is in beta: requests must send agent-memory-2026-07-22 or managed-agents-2026-04-01 in this header.
"anthropic-workspace-id": optional stringOptional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).
Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).
Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
Returns
BetaManagedAgentsDeletedMemory object{ type: "memory_deleted", id }Tombstone returned by Delete a memory. Deleting a memory does not erase its version history: its versions remain listable via List memory versions 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).
Tombstone returned by Delete a memory. Deleting a memory does not erase its version history: its versions remain listable via List memory versions 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).
ID of the deleted memory (a mem_... value).
curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memories/$MEMORY_ID \
-X DELETE \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: agent-memory-2026-07-22' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"{
"id": "id",
"type": "memory_deleted"
}Returns Examples
{
"id": "id",
"type": "memory_deleted"
}