user_id and agent_id must match the stored memory’s owner — you cannot delete a memory that belongs to a different user or agent. Deletion is immediate and irreversible; the memory will not appear in any future search, context, or list response.
Request
Headers
| Name | Required | Description |
|---|---|---|
X-API-Key | Yes | Your MemLayer API key (ml_live_xxx) |
Path Parameters
Query Parameters
Must match the
user_id of the memory being deleted. Used to verify ownership.Must match the
agent_id of the memory being deleted. Used to verify ownership.Response
Success — 200
Number of memories deleted.
1 on success, 0 if the memory was not found or ownership did not match.Human-readable summary of the operation result.
deleted: 0 result is not an error — it is safe to call this endpoint even if you are unsure whether the memory still exists.
Errors
| Code | Meaning |
|---|---|
401 | Invalid or missing X-API-Key |
403 | Account suspended |
404 | Memory ID not found for the given user_id and agent_id |
422 | Validation error — check parameter types |
