---
title: Delete Bucket
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/python)

[R2](https://developers.cloudflare.com/api/python/resources/r2)

[Buckets](https://developers.cloudflare.com/api/python/resources/r2/subresources/buckets)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Delete Bucket

r2.buckets.delete(strbucket\_name, BucketDeleteParams\*\*kwargs) -> object

DELETE/accounts/{account\_id}/r2/buckets/{bucket\_name}

Deletes an empty R2 bucket and its configuration. The bucket must have no objects, no in-progress multipart uploads, and no event notification rules; otherwise the request fails.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).

**Example:**`Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY`

##### Accepted Permissions (at least one required)

`Workers R2 Storage Write`

##### ParametersExpand Collapse

account\_id: str

Cloudflare account ID that owns the R2 resource.

maxLength32

[Link to this property](<#(resource)%20r2.buckets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20account_id%20%3E%20(schema)>)

bucket\_name: str

Name of the bucket.

maxLength64

minLength3

[Link to this property](<#(resource)%20r2.buckets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20bucket_name%20%3E%20(schema)>)

<details>

<summary>

cf\_r2\_jurisdiction: Optional\[Literal\["default", "eu", "us", 2 more]]

</summary>

One of the following:

"default"

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)%20%3E%20(member)%200">Link to this property</a>

"eu"

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)%20%3E%20(member)%201">Link to this property</a>

"us"

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)%20%3E%20(member)%202">Link to this property</a>

"fedramp"

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)%20%3E%20(member)%203">Link to this property</a>

"fedramp-high"

<a href="#(resource)%20r2.buckets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)%20%3E%20(member)%204">Link to this property</a>

</details>

[Link to this property](<#(resource)%20r2.buckets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20cf-r2-jurisdiction%20%3E%20(schema)>)

##### ReturnsExpand Collapse

object

[Link to this property](<#(resource)%20r2.buckets%20%3E%20(method)%20delete%20%3E%20(network%20schema)%20%3E%20(property)%20result>)

### Delete Bucket

Python

HTTPTypeScriptPythonGoTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
bucket = client.r2.buckets.delete(
    bucket_name="example-bucket",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(bucket)
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {},
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {},
  "success": true
}
```