Updates the metadata of a bucket. Changes to the bucket are readable immediately after writing, but configuration changes may take time to propagate.
Request
HTTP request
PUT https://storage.googleapis.com/storage/v1/b/ bucket
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
bucket
string
ifMetagenerationMatch
long
ifMetagenerationNotMatch
long
predefinedAcl
string
Acceptable values are:
-
authenticatedRead: Project team owners getOWNERaccess, andallAuthenticatedUsersgetREADERaccess. -
private: Project team owners getOWNERaccess. -
projectPrivate: Project team members get access according to their roles. -
publicRead: Project team owners getOWNERaccess, andallUsersgetREADERaccess. -
publicReadWrite: Project team owners getOWNERaccess, andallUsersgetWRITERaccess.
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 getsOWNERaccess, andallAuthenticatedUsersgetREADERaccess. -
bucketOwnerFullControl: Object owner getsOWNERaccess, and project team owners getOWNERaccess. -
bucketOwnerRead: Object owner getsOWNERaccess, and project team owners getREADERaccess. -
private: Object owner getsOWNERaccess. -
projectPrivate: Object owner getsOWNERaccess, and project team members get access according to their roles. -
publicRead: Object owner getsOWNERaccess, andallUsersgetREADERaccess.
iamConfiguration.uniformBucketLevelAccess.enabled
is set to true
, requests that include this parameter fail with a 400 Bad Request
response.projection
string
full
.Acceptable values are:
-
full: Include all properties. -
noAcl: Omitowner,acl, anddefaultObjectAclproperties.
Request body
In the request body, supply a bucket resource with the following properties:
acl[]
list
Access controls on the bucket. If empty, this parameter is ignored. Can contain one or more bucketAccessControls Resources .
autoclass
object
billing
object
cors[]
list
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.ipFilter
object
labels.(key)
string
lifecycle
object
logging
object
retentionPolicy
object
rpo
string
"DEFAULT"
uses default replication. "ASYNC_TURBO"
enables turbo replication, valid for dual-region buckets only.
For more information, see redundancy across regions
.softDeletePolicy
object
storageClass
string
storageClass
is
specified for a newly-created object. 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.

