---
title: "Delete a memory (deprecated — use /edges/{edge_id})"
description: "Permanently delete a memory edge by UUID (hard delete, both stores).\n\n**Deprecated** — the path doesn't say what it deletes now that node\ndeletion exists alongside it. Use ``DELETE /memories/{agent_id}/edges/\n{edge_id}`` (same behavior) or ``.../nodes/{node_id}``. This route keeps\nserving unchanged until existing callers migrate.\n\nThe lookup is scoped by the calling user's id, not by ``agent_id`` —\nso callers don't need to know which of the user's agents originally\nproduced the memory. The ``agent_id`` path parameter is preserved\nfor URL backwards-compatibility but is not used to constrain the\nsearch. Edge UUIDs are globally unique; the user-id prefix match\nstill prevents cross-user deletion.\n\nWith ``graph_id``, the edge is deleted from that shared namespace\ninstead — service tokens only.\n\nReturns 404 if the edge isn't in the requested scope (or doesn't exist)."
---

> Documentation Index
> Fetch the complete documentation index at: https://truememory-docs.mvstg.com/llms.txt
> Use this file to discover all available pages before exploring further.

> **Deprecated.**

Path: AI Gateway API › Memory

`DELETE /memories/{agent_id}/{memory_id}`

Permanently delete a memory edge by UUID (hard delete, both stores).

**Deprecated** — the path doesn't say what it deletes now that node
deletion exists alongside it. Use ``DELETE /memories/{agent_id}/edges/
{edge_id}`` (same behavior) or ``.../nodes/{node_id}``. This route keeps
serving unchanged until existing callers migrate.

The lookup is scoped by the calling user's id, not by ``agent_id`` —
so callers don't need to know which of the user's agents originally
produced the memory. The ``agent_id`` path parameter is preserved
for URL backwards-compatibility but is not used to constrain the
search. Edge UUIDs are globally unique; the user-id prefix match
still prevents cross-user deletion.

With ``graph_id``, the edge is deleted from that shared namespace
instead — service tokens only.

Returns 404 if the edge isn't in the requested scope (or doesn't exist).

## Authentication

- `HTTPBearer`, http, header `Authorization`

## Path parameters

- `agent_id` (`delete_memory.path.agent_id`; string, required)
- `memory_id` (`delete_memory.path.memory_id`; string, required)

## Query parameters

- `graph_id` (`delete_memory.query.graph_id`; any of, optional) — Optional. Delete from a shared namespace instead of the user's own memory. Requires a service token; the agent_id path segment is ignored.
  - any of: `string`, `null`

## Header parameters

- `X-On-Behalf-Of` (`delete_memory.header.X-On-Behalf-Of`; any of, optional)
  - any of: `string`, `null`
- `X-External-User-Id` (`delete_memory.header.X-External-User-Id`; any of, optional)
  - any of: `string`, `null`
- `X-App-Id` (`delete_memory.header.X-App-Id`; any of, optional)
  - any of: `string`, `null`

## Code samples

### cURL

```bash
curl --request DELETE \
  --url 'https://truememory-api.mvstg.com/memories/<agent_id>/<memory_id>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://truememory-api.mvstg.com/memories/<agent_id>/<memory_id>';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://truememory-api.mvstg.com/memories/<agent_id>/<memory_id>"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 200

Successful Response

#### Example

```json
{
  "status": "deleted",
  "memory_id": "string"
}
```

- `memory_id` (`delete_memory.response.200.memory_id`; string, required)
- `status` (`delete_memory.response.200.status`; string, optional)
  - default `"deleted"`

### 422

Validation Error

#### Example

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

- `detail` (`delete_memory.response.422.detail`; array<object>, optional)
  - `loc` (`delete_memory.response.422.detail.loc`; array<any of>, required)
    - any of: `string`, `integer`
  - `msg` (`delete_memory.response.422.detail.msg`; string, required)
  - `type` (`delete_memory.response.422.detail.type`; string, required)
  - `input` (`delete_memory.response.422.detail.input`; unknown, optional)
  - `ctx` (`delete_memory.response.422.detail.ctx`; object, optional)


Source: https://truememory-docs.mvstg.com/api/memories/delete/index.md
