DeleteBucket
Updated at:2025-11-03
API description
This API facilitates the deletion of a bucket. Prior to deletion, ensure all objects and incomplete three-step upload parts within the bucket are removed; otherwise, the deletion will fail.
Note: Before deleting a bucket, verify that Cross-Region Replication (CRR) is not enabled and that the bucket is not a source in any CRR rules. Failing to do so will result in deletion failure.
Request
-
Request syntax
Plain Text1DELETE / HTTP/1.1 2Host: <BucketName>.bj.bcebos.com 3Date: <Date> 4Authorization: <AuthorizationString> -
Request headers
No special header parameters
-
Request parameters
No special parameters
Response
Notes
- Only the bucket owner has the authority to delete the corresponding bucket. Otherwise, a 403 Forbidden error will occur, accompanied by the error message "AccessDenied."
- To protect user data and prevent inadvertent deletions, BOS prohibits the deletion of non-empty buckets. If a bucket contains objects, a 409 Conflict error will be issued with the error code "BucketNotEmpty."
Example
-
Request example
Plain Text1DELETE / HTTP/1.1 2Host: BucketName.bj.bcebos.com 3Date: Wed, 06 Apr 2016 06:34:40 GMT 4Authorization: AuthorizationString -
Response example
Plain Text1HTTP/1.1 204 No Content 2x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409 3Date: Wed, 06 Apr 2016 06:34:40 GMT 4Connection: close 5Server: BceBos
