Required. The parent branch resource name, such as projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}. Requires create/update permission.
Request body
The request body contains data with the following structure:
JSON representation
{"errorConfig": {object (ImportErrorConfig)},"reconciliationMode": enum (ReconciliationMode),"updateMask": string,"autoGenerateIds": boolean,"idField": string,"forceRefreshContent": boolean,// Union field source can be only one of the following:"inlineSource": {object (InlineSource)},"gcsSource": {object (GcsSource)},"bigquerySource": {object (BigQuerySource)},"fhirStoreSource": {object (FhirStoreSource)},"spannerSource": {object (SpannerSource)},"cloudSqlSource": {object (CloudSqlSource)},"firestoreSource": {object (FirestoreSource)},"alloyDbSource": {object (AlloyDbSource)},"bigtableSource": {object (BigtableSource)}// End of list of possible types for union field source.}
Indicates which fields in the provided imported documents to update. If not set, the default is to update all fields.
This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".
autoGenerateIds
boolean
Whether to automatically generate IDs for the documents if absent.
If set to true, Document.ids are automatically generated based on the hash of the payload, where IDs may not be consistent during multiple imports. In which case ReconciliationMode.FULL is highly recommended to avoid duplicate contents. If unset or set to false, Document.ids have to be specified using idField, otherwise, documents without IDs fail to be imported.
The field indicates the ID field or column to be used as unique IDs of the documents.
For GcsSource it is the key of the JSON field. For instance, my_id for JSON {"my_id": "some_uuid"}. For others, it may be the column name of the table where the unique ids are stored.
The values of the JSON field or the table column are used as the Document.ids. The JSON field or the table column must be of string type, and the values must be set as valid strings conform to RFC-1034 with 1-63 characters. Otherwise, documents without valid IDs fail to be imported.
Only set this field when autoGenerateIds is unset or set as false. Otherwise, an INVALID_ARGUMENT error is thrown.
If it is unset, a default value Id is used when importing from the allowed data sources.
[[["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-07-30 UTC."],[[["\u003cp\u003eThis endpoint supports bulk importing of multiple documents, and it can synchronously process requests, creating items that do not exist.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request uses \u003ccode\u003ePOST\u003c/code\u003e with a specific URL structure that includes path parameters such as the required \u003ccode\u003eparent\u003c/code\u003e resource name.\u003c/p\u003e\n"],["\u003cp\u003eThe request body includes parameters like \u003ccode\u003eerrorConfig\u003c/code\u003e, \u003ccode\u003ereconciliationMode\u003c/code\u003e, \u003ccode\u003eupdateMask\u003c/code\u003e, and \u003ccode\u003eautoGenerateIds\u003c/code\u003e, and supports various source types including \u003ccode\u003einlineSource\u003c/code\u003e, \u003ccode\u003egcsSource\u003c/code\u003e, and others.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eidField\u003c/code\u003e can be specified to set unique IDs for documents, or they can be automatically generated, while using supported data sources such as GcsSource, BigQuerySource, SpannerSource, and others.\u003c/p\u003e\n"],["\u003cp\u003eTo access and use this endpoint, a user must have the \u003ccode\u003ediscoveryengine.documents.import\u003c/code\u003e IAM permission on the parent resource and the OAuth scope \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.dataStores.branches.documents.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- [IAM Permissions](#body.aspect_1)\n\nBulk import of multiple [Document](/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents#Document)s. Request processing may be synchronous. Non-existing items are created.\n\nNote: It is possible for a subset of the [Document](/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.branches.documents#Document)s to be successfully updated.\n\n### HTTP request\n\n`POST https://discoveryengine.googleapis.com/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents: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](/generative-ai-app-builder/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp).\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:\n\n- `discoveryengine.documents.import`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs)."]]