---
title: "Delete a bucket"
method: DELETE
path: "/api/v1/buckets/{bucketId}"
tags: ["Buckets"]
---

# Delete a bucket

`DELETE /api/v1/buckets/{bucketId}`

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/buckets/{bucketId}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Empties the bucket's folder subtree (deleting its objects), revokes its scoped credentials, then soft-deletes the record — the same semantics as deleting from the dashboard. Deletion is permanent. Returns 403 resource_protected when the bucket has deletion protection enabled; protection can only be removed from the dashboard.

## Path parameters

- `bucketId` string, required

## Response `200`

The storage was deleted.

- object
  - `deleted` true, required

## Other responses

- `401`: Authentication is missing or invalid.
- `403`: The storage is protected from deletion (code resource_protected). Remove protection from the dashboard before deleting via the API.
- `404`: The resource was not found.
- `429`: Too many requests; retry after the indicated delay.

---

[API](https://skmtc.dev/khotan/apis/khotan-api.md) - [All operations](https://skmtc.dev/khotan/apis/khotan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/khotan/apis/khotan-api/revisions/90b512a53e42?raw)
