# How to delete an Object Storage bucket

import Tabs from '~/components/tabs/Tabs'

This guide walks you through deleting an Object Storage bucket using the Azion Console, Azion API, and Azion CLI. 

## Deleting a bucket

<Tabs client:visible>
    <Fragment slot="tab.console">Console</Fragment>
    <Fragment slot="tab.cli">Azion CLI</Fragment>
    <Fragment slot="tab.api">API</Fragment>

<Fragment slot="panel.console">

In the Azion [Console](https://console.azion.com/object-storage), you can delete a bucket by following these steps:

1. Access the **Object Storage** menu in the Products menu.
2. On the Object Storage page, click on the bucket you want to delete.
3. On the bucket page, click the **Settings** button.
4. In **Danger Zone**, you can permanently delete the bucket.
Note: You cannot delete a bucket that is not empty. Additionally, objects deleted in the last 24 hours are also taken into account.

</Fragment>

<Fragment slot="panel.cli">

### Requirements 

- [Azion CLI installed](/en/documentation/products/azion-cli/overview/#installing-azion-cli). 
- [A personal token configured](/en/documentation/devtools/cli/globals/#token).

To delete a bucket: 

```bash 
azion delete edge-storage bucket --name yourbucketname
```

</Fragment>

<Fragment slot="panel.api">
 
Run the following `DELETE` request in your terminal, replacing `[TOKEN VALUE]` with your [personal token](/en/documentation/products/guides/personal-tokens/) and `bucket_name` with the name of the bucket you want to delete:

```bash
curl --location --request DELETE 'https://api.azion.com/v4/storage/buckets/bucket_name' \
--header 'Accept: application/json' \
--header 'Authorization: Token [TOKEN VALUE]'
```

You'll receive a response similar to this: 

```bash 
/{"state":"executed","data":{"name":"bucketname","edge_access":"read_only"}}% 
```

:::note
It's not possible to delete a non-empty bucket through Azion API. Make sure it's empty before using this method to delete it.
:::

</Fragment>

</Tabs>