Stay organized with collectionsSave and categorize content based on your preferences.
To create a new HMAC key for the specified service account, make aPOSTrequest
that is scoped to a project. The authenticated user must havestorage.hmacKeys.createpermission for the project in which the key will be created.
For general information about HMAC keys in Cloud Storage, seeHMAC Keys.
HTTP Request
POST https://storage.googleapis.com/?Action=CreateAccessKey&UserName=ServiceAccountEmail
Inactive: Requests signed with this key will be denied.
SecretAccessKey
string
A 40 character Base-64 encoded string that is used to sign requests
as part of the authentication process. This secret is only ever returned
in thecreaterequest.
[[["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-09-04 UTC."],[],[],null,["# Create an HMAC key\n\nTo create a new HMAC key for the specified service account, make a `POST` request\nthat is scoped to a project. The authenticated user must have\n`storage.hmacKeys.create` permission for the project in which the key will be created.\n\nFor general information about HMAC keys in Cloud Storage, see\n[HMAC Keys](/storage/docs/authentication/hmackeys).\n\nHTTP Request\n------------\n\n```\nPOST https://storage.googleapis.com/?Action=CreateAccessKey&UserName=ServiceAccountEmail\n```\n\n### Query string parameters\n\nRequest headers\n---------------\n\nUse the [common request headers](/storage/docs/xml-api/post-hmac-key#request-headers).\n\nResponse\n--------\n\nIf successful, this method returns a response body with the following structure: \n\n```\n\u003cCreateAccessKeyResponse\u003e\n \u003cCreateAccessKeyResult\u003e\n \u003cAccessKey\u003e\n \u003cUserName\u003eserviceAccount@proj.iam.gserviceaccount.com\u003c/UserName\u003e\n \u003cAccessKeyId\u003eGOOG1EXAMPLEAEU\u003c/AccessKeyId\u003e\n \u003cStatus\u003eActive\u003c/Status\u003e\n \u003cSecretAccessKey\u003eEXAMPLE/KEY/aserafd\u003c/SecretAccessKey\u003e\n \u003c/AccessKey\u003e\n \u003c/CreateAccessKeyResult\u003e\n\u003c/CreateAccessKeyResponse\u003e\n```"]]