Hapus memori
Hapus memori
Parameters
The ID of the memory to delete (mem_...).
params BetaMemoryStoreMemoryDeleteParams
The ID of the memory store that holds the memory (memstore_...).
ExpectedContentSha256 param.Opt[string] OptionalQuery parameterDelete 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.
Betas []AnthropicBeta OptionalHeader parameterThis 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.
WorkspaceID param.Opt[string] OptionalHeader parameterOptional 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
type BetaManagedAgentsDeletedMemory struct { 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).
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
betaManagedAgentsDeletedMemory, err := client.Beta.MemoryStores.Memories.Delete(
context.TODO(),
"memory_id",
anthropic.BetaMemoryStoreMemoryDeleteParams{
MemoryStoreID: "memory_store_id",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", betaManagedAgentsDeletedMemory.ID)
}{
"id": "id",
"type": "memory_deleted"
}Returns Examples
{
"id": "id",
"type": "memory_deleted"
}