Imports entities into Google Cloud Datastore. Existing entities with the same key 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 projects.import operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.
HTTP request
POST https://datastore.googleapis.com/v1beta1/projects/{projectId}:import
An object containing a list of"key": valuepairs. Example:{ "name": "wrench", "mass": "1.3kg", "count": "3" }.
inputUrl
string
The full resource URL of the external storage location. Currently, only Google Cloud Storage is supported. So inputUrl should be of the form:gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE, whereBUCKET_NAMEis the name of the Cloud Storage bucket,NAMESPACE_PATHis an optional Cloud Storage namespace path (this is not a Cloud Datastore namespace), andOVERALL_EXPORT_METADATA_FILEis the metadata file written by the projects.export operation. For more information about Cloud Storage namespace paths, seeObject name considerations.
For more information, seegoogle.datastore.admin.v1beta1.ExportEntitiesResponse.output_url.
entityFilter
object (EntityFilter)
Optionally specify which kinds/namespaces are to be imported. If provided, the list must be a subset of the EntityFilter used in creating the export, otherwise a FAILED_PRECONDITION error will be returned. If no filter is specified then all entities from the export are imported.
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-04-30 UTC."],[[["\u003cp\u003eImports data into Google Cloud Datastore, overwriting existing entities with the same key, and runs in the background.\u003c/p\u003e\n"],["\u003cp\u003eUses an HTTP POST request to \u003ccode\u003ehttps://datastore.googleapis.com/v1beta1/projects/{projectId}:import\u003c/code\u003e, with the \u003ccode\u003eprojectId\u003c/code\u003e defined as a path parameter.\u003c/p\u003e\n"],["\u003cp\u003eRequires a request body in JSON format, including parameters like \u003ccode\u003elabels\u003c/code\u003e, \u003ccode\u003einputUrl\u003c/code\u003e (specifying the Google Cloud Storage location), and \u003ccode\u003eentityFilter\u003c/code\u003e for selective imports.\u003c/p\u003e\n"],["\u003cp\u003eUpon success, returns an \u003ccode\u003eOperation\u003c/code\u003e resource to monitor the progress of the import.\u003c/p\u003e\n"],["\u003cp\u003eRequires either \u003ccode\u003ehttps://www.googleapis.com/auth/datastore\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scopes for authorization.\u003c/p\u003e\n"]]],[],null,["# Method: projects.import\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- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nImports entities into Google Cloud Datastore. Existing entities with the same key 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 projects.import operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.\n\n### HTTP request\n\n`POST https://datastore.googleapis.com/v1beta1/projects/{projectId}:import`\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](/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/)."]]