[[["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-04-30 UTC."],[[["\u003cp\u003eThis endpoint allows you to allocate IDs for specified keys, which is useful for referencing an entity before it is inserted into the database.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request is a \u003ccode\u003ePOST\u003c/code\u003e operation to the specified URL, including the required \u003ccode\u003eprojectId\u003c/code\u003e in the path.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain a \u003ccode\u003edatabaseId\u003c/code\u003e and an array of \u003ccode\u003ekeys\u003c/code\u003e with incomplete key paths to be allocated IDs.\u003c/p\u003e\n"],["\u003cp\u003eThe response body returns the list of the keys, in the same order as the request, each with its key path completed by the newly allocated ID.\u003c/p\u003e\n"],["\u003cp\u003eTo use this endpoint, you will need to include either the \u003ccode\u003ehttps://www.googleapis.com/auth/datastore\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope in the authorization header of your request.\u003c/p\u003e\n"]]],[],null,["# Method: projects.allocateIds\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 - [JSON representation](#body.AllocateIdsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nAllocates IDs for the given keys, which is useful for referencing an entity before it is inserted.\n\n### HTTP request\n\n`POST https://datastore.googleapis.com/v1/projects/{projectId}:allocateIds`\n\nThe URL uses [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\nThe response for [Datastore.AllocateIds](/datastore/docs/reference/data/rest/v1/projects/allocateIds#google.datastore.v1.Datastore.AllocateIds).\n\nIf successful, the response body contains data with the following structure:\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/datastore`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]