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
accessId
string
The access ID of the HMAC key being updated.
projectIdentifier
string
The project ID or project number of the project that owns the service account of the
specified HMAC key.
Request body
In the request body, supply the metadata portion of a
Projects.hmacKeys resource
with the following properties:
Property name
Value
Description
Notes
Optional Properties
etag
string
HTTP 1.1 Entity tag for
the HMAC key. Inclusion of an etag makes the operation's success conditional on
the HMAC key's current etag matching the given value.
state
string
The state of the key. Can be updated to ACTIVE or INACTIVE. To set the state of the
key to DELETED, use the `hmacKeys.delete` method.
writable
Response
If successful, this method returns the metadata portion of a
Projects.hmacKeys 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Projects.hmacKeys: update\n\nUpdates the state of an HMAC key. See the [HMAC\nKey resource descriptor](/storage/docs/json_api/v1/projects/hmacKeys#resource) for valid states.\n\nFor general information about HMAC keys in Cloud Storage, see\n[HMAC Keys](/storage/docs/authentication/hmackeys).\n\nRequired permissions\n--------------------\n\nIn order to use this method, the authenticated user must have the\n`storage.hmacKeys.update` IAM permission for the project in which the\nkey exists.\n\nRequest\n-------\n\n### HTTP request\n\n```\nPUT https://storage.googleapis.com/storage/v1/projects/projectIdentifier/hmacKeys/accessId\n```\n\nIn addition to [standard query\nparameters](/storage/docs/json_api/v1/parameters#query), the following query parameters apply to this method.\n\nTo see an example of how to include query parameters in a request, see the\n[JSON API Overview](/storage/docs/json_api#query_parameters) page.\n\n### Parameters\n\n### Request body\n\nIn the request body, supply the metadata portion of a\n[Projects.hmacKeys resource](/storage/docs/json_api/v1/projects/hmacKeys#resource)\nwith the following properties:\n\nResponse\n--------\n\nIf successful, this method returns the metadata portion of a\n[Projects.hmacKeys resource](/storage/docs/json_api/v1/projects/hmacKeys#resource)\nin the response body.\n\nFor information about status and error codes returned by this API, see the\n[reference page](/storage/docs/json_api/v1/status-codes).\n\nTry it!\n-------\n\nUse the APIs Explorer below to call this method on live data and see the response."]]