Initializes a location-level encryption key specification. An error will be thrown if the location has resources already created before the initialization. Once the encryption specification is initialized at a location, it is immutable and all newly created resources under the location will be encrypted with the existing specification.
HTTP request
POST https://{endpoint}/v2beta1/{encryptionSpec.name=projects/*/locations/*/encryptionSpec}:initialize
Required. The name of customer-managed encryption key that is used to secure a resource and its sub-resources. If empty, the resource is secured by the default Google encryption key. Only the key in the same location as this resource is allowed to be used for encryption. Format: projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}
Response body
If successful, the response body contains an instance of Operation.
[[["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-06-27 UTC."],[[["\u003cp\u003eThis endpoint initializes a location-level encryption key specification, which is immutable once set, for all newly created resources under that location.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request is a POST operation to a specific endpoint, utilizing gRPC Transcoding syntax, with the format \u003ccode\u003ePOST https://{endpoint}/v2beta1/{encryptionSpec.name=projects/*/locations/*/encryptionSpec}:initialize\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eencryptionSpec.name\u003c/code\u003e path parameter specifies the resource name of the encryption key specification, and \u003ccode\u003eencryptionSpec.kmsKey\u003c/code\u003e in the request body details the customer-managed encryption key used for securing resources.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful requests will return an instance of the \u003ccode\u003eOperation\u003c/code\u003e object in the response body, and requires either \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/dialogflow\u003c/code\u003e authorization scopes.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.encryptionSpec.initialize\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nInitializes a location-level encryption key specification. An error will be thrown if the location has resources already created before the initialization. Once the encryption specification is initialized at a location, it is immutable and all newly created resources under the location will be encrypted with the existing specification.\n\n### HTTP request\n\n`POST https://{endpoint}/v2beta1/{encryptionSpec.name=projects/*/locations/*/encryptionSpec}:initialize`\n\nWhere `{endpoint}` is one of the [supported service endpoints](/dialogflow/es/docs/reference/rest#rest_endpoints).\n\nThe URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/dialogflow/es/docs/reference/rest/v2beta1/projects.locations.operations#Operation).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `\n https://www.googleapis.com/auth/dialogflow`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]