Stay organized with collections
Save and categorize content based on your preferences.
Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an databases.importDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore.
HTTP request
POST https://firestore.googleapis.com/v1/{name=projects/*/databases/*}:importDocuments
An empty list represents all namespaces. This is the preferred usage for databases that don't use namespaces.
An empty string element represents the default namespace. This should be used if the database has data in non-default namespaces, but doesn't want to include them. Each namespace in this list must be unique.
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-02 UTC."],[[["\u003cp\u003eImports data into Google Cloud Firestore, overwriting any existing documents with the same name.\u003c/p\u003e\n"],["\u003cp\u003eThe import process runs in the background and can be tracked using the created Operation resource.\u003c/p\u003e\n"],["\u003cp\u003eThe request URL requires specifying the database to import into, using the format \u003ccode\u003eprojects/{projectId}/databases/{databaseId}\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must include the location of the exported files, specified by the \u003ccode\u003einputUriPrefix\u003c/code\u003e, and optionally \u003ccode\u003ecollectionIds\u003c/code\u003e and \u003ccode\u003enamespaceIds\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe process requires specific authorization scopes, including \u003ccode\u003ehttps://www.googleapis.com/auth/datastore\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: projects.databases.importDocuments\n\nImports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an databases.importDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore.\n\n### HTTP request\n\n`POST https://firestore.googleapis.com/v1/{name=projects/*/databases/*}:importDocuments`\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\nIf successful, the response body contains an 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)."]]