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/v1/projects/{projectId}:import
An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
inputUrl
string
Required. 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, where BUCKET_NAME is the name of the Cloud Storage bucket, NAMESPACE_PATH is an optional Cloud Storage namespace path (this is not a Cloud Datastore namespace), and OVERALL_EXPORT_METADATA_FILE is the metadata file written by the projects.export operation. For more information about Cloud Storage namespace paths, see Object name considerations.
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 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-04-30 UTC."],[[["\u003cp\u003eThis webpage details the process of importing entities into Google Cloud Datastore, where existing entities with the same key will be overwritten.\u003c/p\u003e\n"],["\u003cp\u003eThe import operation uses a POST request to the specified URL, requiring a \u003ccode\u003eprojectId\u003c/code\u003e in the path.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must include \u003ccode\u003einputUrl\u003c/code\u003e that designates the storage location in the form of a Cloud Storage URL, and optionally an \u003ccode\u003eentityFilter\u003c/code\u003e specifying what is to be imported.\u003c/p\u003e\n"],["\u003cp\u003eClient-assigned \u003ccode\u003elabels\u003c/code\u003e can be provided in the request body as a map of key-value pairs.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful requests will return an \u003ccode\u003eOperation\u003c/code\u003e resource, and this process needs one of two OAuth scopes to authorize the import.\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/v1/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/)."]]