Clear (deactivate) anchors for a session.
Send Authorization: Bearer <token>. The token is either a Clerk session JWT or a SmartMemory API key (prefix sm_live_, sm_test_, or legacy sk_).
In: header
Query Parameters
Response Body
application/json
application/json
curl -X DELETE "https://example.com/memory/anchors/clear"null{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Clear All Memories
Clear all memories for the current user, or everything if nuclear=true. WARNING: This deletes memories. Cannot be undone. If nuclear=true, deletes EVERYTHING (graph + cache + vectors) for dev/cleanup. SEC-ROUTE-AUTHZ-1 H10: the nuclear path wipes the entire deployment (all tenants), so it requires the superadmin role. The ordinary scoped clear stays open to any authenticated user and removes own memories only: the items the caller authored. In a shared workspace other members' items and unattributed items are kept (SEC-CLEAR-ALL-SHARED-WS-1, enforced in ``SecureSmartMemory.clear_user_memories``), for every role, admins included. The role check says WHO may wipe, never WHICH deployment gets wiped, which is how the service security suite erased a developer host's shared graph on 2026-08-21. `assert_nuclear_allowed` adds the missing target control: the nuclear path additionally requires SMARTMEMORY_ALLOW_NUCLEAR_CLEAR=true AND a target graph that is not in SMARTMEMORY_NUCLEAR_PROTECTED_GRAPHS. See memory_service/api/nuclear_guard.py.
Clear Memory
Clear all memory for the current user (use with caution). This is a destructive operation that removes all memory items the authenticated user authored (other members' items in a shared workspace are kept, SEC-CLEAR-ALL-SHARED-WS-1). Use DELETE /memory/clear-all for more options including nuclear mode.