Creates the specified index. A newly created index's initial state is CREATING. On completion of the returned google.longrunning.Operation, the state will be READY. If the index already exists, the call will return an ALREADY_EXISTS status.
During index creation, the process could result in an error, in which case the index will move to the ERROR state. The process can be recovered by fixing the data that caused the error, removing the index with delete, then re-creating the index with create.
Indexes with a single property cannot be created.
HTTP request
POST https://datastore.googleapis.com/v1/projects/{projectId}/indexes
[[["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 process details how to create a new index, which initially starts in a \u003ccode\u003eCREATING\u003c/code\u003e state and moves to \u003ccode\u003eREADY\u003c/code\u003e upon completion.\u003c/p\u003e\n"],["\u003cp\u003eIf an error occurs during creation, the index will transition to an \u003ccode\u003eERROR\u003c/code\u003e state, requiring data correction and re-creation via deletion and then the creation process again.\u003c/p\u003e\n"],["\u003cp\u003eThe creation request is made via a \u003ccode\u003ePOST\u003c/code\u003e request to the specified URL, incorporating gRPC Transcoding syntax, and requires a project ID.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain an instance of \u003ccode\u003eIndex\u003c/code\u003e, while a successful response will contain an instance of \u003ccode\u003eOperation\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eCreating an index necessitates one of two specified OAuth scopes for authorization.\u003c/p\u003e\n"]]],[],null,["# Method: projects.indexes.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates the specified index. A newly created index's initial state is `CREATING`. On completion of the returned [google.longrunning.Operation](/datastore/docs/reference/admin/rest/Shared.Types/Operation), the state will be `READY`. If the index already exists, the call will return an `ALREADY_EXISTS` status.\n\nDuring index creation, the process could result in an error, in which case the index will move to the `ERROR` state. The process can be recovered by fixing the data that caused the error, removing the index with [delete](/datastore/docs/reference/admin/rest/v1/projects.indexes/delete#google.datastore.admin.v1.DatastoreAdmin.DeleteIndex), then re-creating the index with [create](/datastore/docs/reference/admin/rest/v1/projects.indexes/create#google.datastore.admin.v1.DatastoreAdmin.CreateIndex).\n\nIndexes with a single property cannot be created.\n\n### HTTP request\n\n`POST https://datastore.googleapis.com/v1/projects/{projectId}/indexes`\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 an instance of [Index](/datastore/docs/reference/admin/rest/v1/projects.indexes#Index).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Operation](/datastore/docs/reference/admin/rest/Shared.Types/Operation).\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](https://cloud.google.com/docs/authentication/)."]]