S3 · Buckets
CreateBucket
/{bucket}Creates a bucket in the workspace of the key.
Storage creates the bucket in the location that you send. It answers when the bucket is ready. Names are case-sensitive and unique within the workspace. Another workspace can use the same name.
- Role
- Editor or higher
- Support
- Supported
- Send LocationConstraint as provider:location, for example gcp:us-central1. A new bucket is private and standard class.
aws s3 mband a CreateBucket call without CreateBucketConfiguration send no location. They return400 InvalidLocationConstraint.- Storage ignores ACL headers such as
x-amz-acl. To make a bucket public-read, change its permission with Update a bucket.
Path parameters
The bucket name.
Headers
Send true to turn on object lock. Object lock also turns on versioning.
Request body
The root element.
Where storage keeps the bytes, as provider:location.
- gcp:US
- Google Cloud Storage, US.
- gcp:NAM4
- Google Cloud Storage, NAM4.
- gcp:us-central1
- Google Cloud Storage, us-central1.
- gcp:us-east1
- Google Cloud Storage, us-east1.
- gcp:us-east4
- Google Cloud Storage, us-east4.
- gcp:us-east5
- Google Cloud Storage, us-east5.
- gcp:us-south1
- Google Cloud Storage, us-south1.
- gcp:us-west1
- Google Cloud Storage, us-west1.
- gcp:us-west2
- Google Cloud Storage, us-west2.
- gcp:us-west3
- Google Cloud Storage, us-west3.
- gcp:us-west4
- Google Cloud Storage, us-west4.
- r2:enam
- Cloudflare R2, enam.
- r2:wnam
- Cloudflare R2, wnam.
Responses
200OK
The bucket is ready.
Response headers
LocationstringThe path of the bucket, /{bucket}.
x-amz-bucket-regionstringThe signing region, us-east-1.
This response has no body.
Errors
Select an error in the response example to see its XML body. Any request can also get the common errors, such as SignatureDoesNotMatch.
- 400InvalidBucketName
The bucket name in the path breaks the naming rules.
What to do: Use 1 to 255 ASCII letters, digits, periods, underscores, or hyphens. A name cannot be
.or...- 400InvalidLocationConstraint
The body has no LocationConstraint, or its value is not an accepted location.
What to do: Send one of the accepted
provider:locationvalues in CreateBucketConfiguration.- 409BucketAlreadyExists
A bucket in the workspace holds this name but is not active. It is being created, failed to provision, or is being deleted.
What to do: Check the bucket with HeadBucket. If provisioning failed, call Retry bucket provisioning. Otherwise choose another name.
- 409BucketAlreadyOwnedByYou
Your workspace already has a bucket with this name.
What to do: Use the bucket that exists, or choose another name.
- 403AccessDenied
The key does not have the role for this operation, or the bucket is in another workspace.
What to do: Use a key of the workspace that owns the bucket, with the role above.