# POST /files/delete

Delete one file or an empty directory.

This is a device HTTP route. Set `DEVICE_URL` to your reachable device URL; [connection and examples](https://mcp.applesauceos.com/doc/http.md) explain how. Do not append this path to the public MCP URL.

## Parameters

| Parameter | Type | Meaning |
| --- | --- | --- |
| `path` | JSON string | Required relative path. |
| `expectedSha256` | JSON string | Required for a regular file; use the current hash. |

## Response

JSON {path,deleted:true}.

## Example

```sh
curl --fail-with-body "$DEVICE_URL/files/delete" \
  -H 'Content-Type: application/json' \
  -d '{"path":"EmptyFolder"}'
```

## Notes

Directory deletion is never recursive. The example requires an existing empty folder. Active paths are protected.

Paths are relative to Scripts. Absolute paths, parent traversal and symlink traversal are rejected. [File rules](https://mcp.applesauceos.com/doc/http-guide.md#files-and-project-directories) apply to every file endpoint.

Check the HTTP status and any JSON error. [HTTP workflows and error handling](https://mcp.applesauceos.com/doc/http-guide.md) explain shared limits. [All endpoints](https://mcp.applesauceos.com/doc/http.md).
