PutBucket
Updated at:2025-11-03
API description
This API is used to create a bucket. Each user is allowed to create up to 100 buckets. By default, the created bucket's permission is set to "private," meaning the bucket owner has FULL_CONTROL, while others have no permissions.
Request
-
Request syntax
Plain Text1 PUT / HTTP/1.1 2 Host: <BucketName>.bj.bcebos.com 3 Date: <Date> 4 Authorization: <AuthorizationString> 5 Content-Length: <ContentLength> 6 Content-Type: text/plain -
Request headers
| Name | Types | Description | Required or not |
|---|---|---|---|
| x-bce-tag-list | string | When creating a bucket, bind the bucket to a tag in the format tag1=value1&tag2=value2. | No |
| Name | Types | Description | Required or not |
|---|---|---|---|
| enableMultiAZ | Boolean | Specify whether data in the created bucket is distributed across multiple AZs for data-center-level disaster recovery. true indicates creating a multi-AZ bucket, while the default false indicates creation. |
No |
Response
Notes
- If a user attempts to create more than 100 buckets, the server will return a 400 Bad Request error with the TooManyBuckets code.
- If the specified bucket already exists, regardless of its creator, a 409 Conflict error will be returned with the message BucketAlreadyExists.
- To create a bucket distributed across multiple AZs, the region must support multi-AZ buckets. Currently, BOS supports only Beijing, Guangzhou, and Suzhou but is gradually expanding to other regions.
- BOS bucket names must adhere to specific rules: they can only include lowercase letters, numbers, and hyphens ("-"). They must begin and end with lowercase letters or numbers, and their length should be between 4 and 63 characters.
Example
-
Request example
Plain Text1 PUT / HTTP/1.1 2 Host: <BucketName>.bj.bcebos.com 3 Date: Wed, 06 Apr 2016 06:34:40 GMT 4 Authorization: <AuthorizationString> 5 Content-Type:text/plain 6 Content-Length: 0 7 { 8 "enableMultiAz":true, 9 } -
Response example
Plain Text1 HTTP/1.1 200 OK 2 x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409 3 Date: Wed, 06 Apr 2016 06:34:40 GMT 4 Location: bj 5 Content-Length: 0 6 Connection: close 7 Server: BceBos
