# 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>")
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.swanchain.io/bulders/app-developer/store-and-retrieve-a-file-with-swan-storage/5.delete-files-and-buckets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
