> For the complete documentation index, see [llms.txt](https://docs.swanchain.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.swanchain.io/bulders/app-developer/store-and-retrieve-a-file-with-swan-storage/5.delete-files-and-buckets.md).

# 5.Delete Files and Buckets

### 5.1 Delete a file

Removes a file from a bucket

```python
from swan_mcs import APIClient, BucketAPI
mcs_api = APIClient("<API_KEY>")
bucket_client = BucketAPI(mcs_api)

bucket_client.delete_file("<BUCKET_NAME>", "<OBJECT_NAME>")
```

### 5.2 Delete a bucket

Removes a bucket from your account.

> Once you delete your bucket, all your file and folder under the bucket will be deteled

```python
from swan_mcs import APIClient, BucketAPI
mcs_api = APIClient("<API_KEY>")
bucket_client = BucketAPI(mcs_api)

bucket_client.delete_bucket("<BUCKET_NAME>")
```
