Updates an object's metadata. Try it now.
The authenticated user must have sufficient permission to use this method.
To update an object encrypted by a customer-supplied encryption key and retrieve the content hashes in the response, use the headers listed on the Customer-supplied encryption key page in your request. Without such headers, the content hashes are omitted in the response.
Request
HTTP request
PUT https://storage.googleapis.com/storage/v1/b/bucket/o/object
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
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
bucket |
string |
Name of the bucket in which the object resides. |
object |
string |
Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI path parts. |
Optional query parameters | ||
generation |
long |
If present, selects a specific revision of this object (as opposed to the latest version, the default). |
ifGenerationMatch |
long |
Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. |
ifGenerationNotMatch |
long |
Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. |
ifMetagenerationMatch |
long |
Makes the operation conditional on whether the object's current metageneration matches the given value. |
ifMetagenerationNotMatch |
long |
Makes the operation conditional on whether the object's current metageneration does not match the given value. |
predefinedAcl |
string |
Apply a predefined set of access controls to this object.
Acceptable values are:
iamConfiguration.uniformBucketLevelAccess.enabled is set to
true , requests that include this parameter fail with a
400 Bad Request response.
|
projection |
string |
Set of properties to return. Defaults to full .
Acceptable values are:
|
Request body
In the request body, supply an object resource with the following properties:
Property name | Value | Description | Notes |
---|---|---|---|
Required Properties | |||
acl[] |
list |
Access controls on the object, containing one or more objectAccessControls Resources. |
writable |
Optional Properties | |||
cacheControl |
string |
Cache-Control
directive for the object data. If omitted, and the object is accessible to all anonymous
users, the default will be public, max-age=3600 . |
writable |
contentDisposition |
string |
Content-Disposition of the object data. | writable |
contentEncoding |
string |
Content-Encoding of the object data. | writable |
contentLanguage |
string |
Content-Language of the object data. | writable |
contentType |
string |
Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. | writable |
customTime |
datetime 1 |
A user-specified timestamp for the object in
RFC 3339 format. If the
object has customTime metadata already set on it, any update request must
include a customTime with an equal or later datetime. |
writable |
eventBasedHold |
boolean |
Whether or not the object is subject to an event-based hold. | writable |
metadata |
object |
User-provided metadata, in key/value pairs. | writable |
metadata.(key) |
string |
An individual metadata entry. | writable |
temporaryHold |
boolean |
Whether or not the object is subject to a temporary hold. | writable |
Response
If successful, this method returns an object resource in the response body.
Try it!
Use the APIs Explorer below to call this method on live data and see the response.