---
title: "Delete a memory file or directory"
method: POST
path: "/v1/memory-files/delete"
tags: ["Memory files"]
---

# Delete a memory file or directory

`POST /v1/memory-files/delete`

## Request

- Base URL: `https://brain.inite.ai`
- URL: `https://brain.inite.ai/v1/memory-files/delete`
- Auth: HTTP bearer

Removes the file at `path` and everything beneath it, and reports how many rows went. Only the asking scope’s copies: a workspace-wide delete does not touch a user’s personal file at the same path.

Required scope: `brain:write`.

## Request body

- MemoryFileReadRequest
  - `path` string, required: Absolute path under /memories, e.g. /memories/user_prefs.md
  - `userId` string

## Response `200`

How many rows were removed.

- MemoryFileDeleteResponse
  - `deleted` number, required

## Other responses

- `400`: Validation failed.
- `401`: Missing or unknown bearer key.
- `403`: The key lacks the required scope.
- `404`: No such resource in this tenant.

---

[API](https://skmtc.dev/inite/apis/inite-brain-platform-api.md) · [All operations](https://skmtc.dev/inite/apis/inite-brain-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/inite/apis/inite-brain-platform-api/revisions/c7c3eb5e304b?raw)
