---
question: Does deleting a folder remove everything under it?
kind: task
via_web: available
via_cli: na
via_python: available
via_api: available
via_config: na
ref_web: Files › More options › Delete
ref_python: delete_object
ref_api: DELETE /api/files/{path}
next:
  - /capabilities/build/files/organise-folders
  - /capabilities/build/files/upload-a-file
---

# Delete a file

Deleting a file removes its bytes from object storage. Deleting a folder removes the folder and everything under it. There is no trash.

## Web UI

### Delete one item

In the Nexus workspace, open **Files** and the folder. On the row, open **More options** (⋮) and choose **Delete**. The dialog says "This file will be permanently deleted." or, for a folder, "This folder and all its contents will be permanently deleted." Confirm with **Delete**.

![Files with a row's More options menu open](/abi/Screenshot_Files_Row_Menu.png)

*A row's More options menu: Add to starred, Download as ZIP, Rename and Delete.*

### Or delete a selection

In the list view, select several rows. The bar shows "N selected": choose **Delete** and confirm. Items are deleted one after another; a failure on one does not stop the rest.

System files (names that start with `.`) are read-only and have no Delete.

## CLI

Not applicable. There is no `abi` command for Files. Use another tab on this page. The command list is the [CLI reference](/user-guide/reference/cli).

## Python

### Delete the object

```python
from naas_abi_core.services.object_storage.ObjectStoragePort import Exceptions

storage = self.engine.services.object_storage
try:
    storage.delete_object(f"naas_abi/workspace-drive/{workspace_id}/reports", "summary.md")
except Exceptions.ObjectNotFound:
    pass
```

`delete_object` removes one key and raises `ObjectNotFound` when it is missing. It does not walk a folder: list the prefix and delete each key. See [Use files in code](/user-guide/build/files/use-files-in-code?via=python).

## REST API

The Files routes of the Nexus API. Auth: a Nexus session of a workspace member (`POST /api/auth/login` returns the access token).

### Delete the path

```bash
curl -X DELETE "http://localhost:9879/api/files/reports/summary.md?workspace_id=$WORKSPACE_ID&scope=workspace" \
  -H "Authorization: Bearer $NEXUS_TOKEN"
```

The answer is `{"message": "File deleted", "path": ...}`, or `"Folder deleted"` for a folder and everything under it. A missing path answers 404.

## Config

Not applicable. Deleting is an action, not a setting.
