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
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 403 | K9O_ACCESS_DENIED | The caller does not have permission to delete this storage bucket. |
| 404 | K9O_BUCKET_NOT_FOUND | No bucket with the specified name exists in this project. |
| 409 | K9O_STATE_CONFLICT | The 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
}
}