Requires authorization
Creates a new bucket.
You can't create a bucket with a name that is already in use by another live bucket, because Cloud Storage uses a single, global namespace for bucket names. For more information, see the bucket naming guidelines .
Request
HTTP request
POST https://storage.googleapis.com/storage/v1/b
In addition to standard query parameters , the following query parameters apply to this method.
To see an example of how to include query parameters in a request, see the JSON API Overview page.
Parameters
project
string
enableObjectRetention
boolean
true
, permanently enable object retention for this bucket.predefinedAcl
string
Acceptable values are:
-
authenticatedRead
: Project team owners getOWNER
access, andallAuthenticatedUsers
getREADER
access. -
private
: Project team owners getOWNER
access. -
projectPrivate
: Project team members get access according to their roles. -
publicRead
: Project team owners getOWNER
access, andallUsers
getREADER
access. -
publicReadWrite
: Project team owners getOWNER
access, andallUsers
getWRITER
access.
iamConfiguration.uniformBucketLevelAccess.enabled
is set to true
, requests that include this parameter fail with a 400 Bad Request
response.predefinedDefaultObjectAcl
string
Acceptable values are:
-
authenticatedRead
: Object owner getsOWNER
access, andallAuthenticatedUsers
getREADER
access. -
bucketOwnerFullControl
: Object owner getsOWNER
access, and project team owners getOWNER
access. -
bucketOwnerRead
: Object owner getsOWNER
access, and project team owners getREADER
access. -
private
: Object owner getsOWNER
access. -
projectPrivate
: Object owner getsOWNER
access, and project team members get access according to their roles. -
publicRead
: Object owner getsOWNER
access, andallUsers
getREADER
access.
iamConfiguration.uniformBucketLevelAccess.enabled
is set to true
, requests that include this parameter fail with a 400 Bad Request
response.projection
string
noAcl
, unless the bucket resource
specifies acl
or defaultObjectAcl
properties, when it defaults
to full
.Acceptable values are:
-
full
: Include all properties. -
noAcl
: Omitowner
,acl
, anddefaultObjectAcl
properties.
Request body
In the request body, supply a bucket resource with the following properties:
acl[]
list
iamConfiguration.uniformBucketLevelAccess.enabled
is set
to true
, this field is omitted in responses, and requests that specify this
field fail with a 400 Bad Request
response.autoclass
object
billing
object
cors[]
list
customPlacementConfig
object
defaultEventBasedHold
boolean
defaultObjectAcl[]
list
entity
and role
for one or more defaultObjectAccessControls Resources
.
If iamConfiguration.uniformBucketLevelAccess.enabled
is set to true
, this field is omitted
in responses, and requests that specify this field fail with a 400 Bad Request
response.hierarchicalNamespace.enabled
boolean
ipFilter
object
labels.(key)
string
lifecycle
object
location
string
"US"
.
See Cloud Storage bucket locations
for the
authoritative list.logging
object
retentionPolicy
object
rpo
string
"DEFAULT"
uses default replication. "ASYNC_TURBO"
enables turbo replication, valid for dual-region buckets only.
If rpo
is not specified when the bucket is created, it defaults to "DEFAULT"
. For more information, see redundancy across regions
.softDeletePolicy
object
storageClass
string
storageClass
is
specified for a newly-created object. If storageClass
is not specified when
the bucket is created, it defaults to "STANDARD"
. For available storage
classes, see Storage classes
.versioning
object
website
object
Response
If successful, this method returns a bucket resource in the response body.
For information about status and error codes returned by this API, see the reference page .
Try it!
Use the APIs Explorer below to call this method on live data and see the response.