Delete an HMAC key

Caution: HMAC keys cannot be recovered once you delete them.

To delete an HMAC key for the specified service account, make aPOST requestthat is scoped to a project. The authenticated user must havestorage.hmacKeys.delete permission for the project from which the key will be deleted.An HMAC key must be in an inactive state in order to delete it.

For general information about HMAC keys in Cloud Storage, seeHMAC Keys.

HTTP Request

POST https://storage.googleapis.com/?Action=DeleteAccessKey&AccessKeyId=AccessKeyId

Query string parameters

ParameterDescriptionRequired
ActionThe HMAC key operation to be performed.Yes
AccessKeyIdAccess ID for the HMAC key to be deleted.Yes

Request headers

Use thecommon request headers.

Response

If successful, this method returns a response body with the following structure:

<DeleteAccessKeyResponse> <ResponseMetadata>    <RequestId>EXAMPLE-REQUEST-ID</RequestId> </ResponseMetadata></DeleteAccessKeyResponse>
Parameter nameValueDescription
RequestIdstring Unique ID for the request.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.