Stay organized with collections
Save and categorize content based on your preferences.
Creates a composite index. This returns a google.longrunning.Operation which may be used to track the status of the creation. The metadata for the operation will be the type IndexOperationMetadata.
HTTP request
POST https://firestore.googleapis.com/v1beta2/{parent=projects/*/databases/*/collectionGroups/*}/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-05-19 UTC."],[[["\u003cp\u003eCreates a composite index in Firestore, returning an operation to track its creation status.\u003c/p\u003e\n"],["\u003cp\u003eThe process uses a POST request to a specified URL with a parent path parameter defining the project, database, and collection group.\u003c/p\u003e\n"],["\u003cp\u003eThe request body contains the \u003ccode\u003eIndex\u003c/code\u003e to be created, and the response body returns an \u003ccode\u003eOperation\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires 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.\u003c/p\u003e\n"]]],[],null,["# Method: projects.databases.collectionGroups.indexes.create\n\nCreates a composite index. This returns a [google.longrunning.Operation](/firestore/docs/reference/rest/Shared.Types/Operation) which may be used to track the status of the creation. The metadata for the operation will be the type `IndexOperationMetadata`.\n\n### HTTP request\n\n`POST https://firestore.googleapis.com/v1beta2/{parent=projects/*/databases/*/collectionGroups/*}/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`.\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Operation](/firestore/docs/reference/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](/docs/authentication#authorization-gcp)."]]