Skip to main content
DELETE/storage/buckets/{bucketName}

Delete Bucket

Permanently deletes a storage bucket and its configuration.

The operation fails if the bucket is non-empty; pass { empty: true } to purge all objects before deletion.

Returns K9O_BUCKET_NOT_FOUND (404) if the named bucket does not exist.

Parameters
bucketName *path

The bucket's name.

It is unique within the project.

projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Responses
HTTPK9O CodeDescription
200Success
403K9O_ACCESS_DENIEDThe caller does not have permission to delete this storage bucket.
404K9O_BUCKET_NOT_FOUNDNo bucket with the specified name exists in this project.
409K9O_STATE_CONFLICTThe bucket still holds objects (context.reason bucket_not_empty, context.objectCount). Delete its objects first, then delete the bucket.
Response body (200)
data *object

The deleted bucket.

name *string

The deleted bucket's name.

deleted *true

Always true.

triggersDropped *integer

How many function triggers on the bucket were deleted with it.

meta *any

Request metadata: cost, timing and correlation ids.

TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.storage.deleteBucket('product-images')

Showing example in TypeScript

Response example (200)
{
  "data": {
    "name": "string",
    "deleted": true,
    "triggersDropped": 0
  }
}

More in Storage & Schema