Stay organized with collectionsSave 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/v1beta2/{name=projects/*/databases/*}:importDocuments
Which collection ids to import. Unspecified means all collections included in the import.
inputUriPrefix
string
Location of the exported files. This must match the outputUriPrefix of an ExportDocumentsResponse from an export that has completed successfully. See:google.firestore.admin.v1beta2.ExportDocumentsResponse.output_uri_prefix.
Response body
If successful, the response body contains an instance ofOperation.
[[["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 documents into Google Cloud Firestore, overwriting existing documents with the same name.\u003c/p\u003e\n"],["\u003cp\u003eThe import process runs in the background, with progress tracked via the created Operation resource.\u003c/p\u003e\n"],["\u003cp\u003eThe request must specify the database for import using the format \u003ccode\u003eprojects/{projectId}/databases/{databaseId}\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request includes the collection IDs to import and the location of the exported files.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with 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 scopes.\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/v1beta2/{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)."]]