---
title: "Delete a file or directory"
method: DELETE
path: "/v1/orgs/{slug}/volumes/{id}/files"
tags: ["volumes"]
---

# Delete a file or directory

`DELETE /v1/orgs/{slug}/volumes/{id}/files`

## Request

- Base URL: `https://api.microsandbox.dev` (the document declares no server; this is the origin it was published from)
- URL: `https://api.microsandbox.dev/v1/orgs/{slug}/volumes/{id}/files`
- Auth: HTTP bearer

## Path parameters

- `slug` string, required
- `id` string, uuid, required

## Headers

- `x-msb-file-path` string, required
- `x-msb-file-recursive` boolean, nullable

## Response `200`

Delete a file or directory

- VolumeFileMutationResponse: Confirmation that a filesystem change succeeded.
  - `ok` boolean, required

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Volume or path not found
- `502`: Volume filesystem unavailable

## Changes

- **2026-10-30** `1cdd89b0fe30`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/microsandbox/apis/microsandbox-api/changes/v1/orgs/:slug/volumes/:id/files/delete.md)

---

[API](https://skmtc.dev/microsandbox/apis/microsandbox-api.md) - [All operations](https://skmtc.dev/microsandbox/apis/microsandbox-api/llms.txt) - [OpenAPI document](https://skmtc.dev/microsandbox/apis/microsandbox-api/revisions/1cdd89b0fe30?raw)
