Creates documents by importing data from external sources. Dialogflow supports up to 350 documents in each request. If you try to import more, Dialogflow will return an error.
This method is a long-running operation. The returned Operation type has the following method-specific fields:
Required. The knowledge base to import documents into. Format: projects/<Project ID>/locations/<Location
ID>/knowledgeBases/<Knowledge Base ID>.
Authorization requires the following IAM permission on the specified resource parent:
dialogflow.documents.create
Request body
The request body contains data with the following structure:
JSON representation
{"documentTemplate": {object (ImportDocumentTemplate)},"importGcsCustomMetadata": boolean,// Union field source can be only one of the following:"gcsSource": {object (GcsSources)}// End of list of possible types for union field source.}
Required. Document template used for importing all the documents.
importGcsCustomMetadata
boolean
Whether to import custom metadata from Google Cloud Storage. Only valid when the document source is Google Cloud Storage URI.
Union field source. Required. The source to use for importing documents.
If the source captures multiple objects, then multiple documents will be created, one corresponding to each object, and all of these documents will be created using the same document template.
Dialogflow supports up to 350 documents in each request. If you try to import more, Dialogflow will return an error. source can be only one of the following:
[[["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-27 UTC."],[[["\u003cp\u003eThis operation imports documents from external sources into Dialogflow, with a limit of 350 documents per request.\u003c/p\u003e\n"],["\u003cp\u003eThe process is a long-running operation, returning an \u003ccode\u003eOperation\u003c/code\u003e type with \u003ccode\u003emetadata\u003c/code\u003e and \u003ccode\u003eresponse\u003c/code\u003e fields.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request uses a \u003ccode\u003ePOST\u003c/code\u003e method to a specific endpoint with the correct path, including the knowledge base \u003ccode\u003eparent\u003c/code\u003e parameter, and follows gRPC Transcoding syntax.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain a \u003ccode\u003edocumentTemplate\u003c/code\u003e and a \u003ccode\u003esource\u003c/code\u003e field, where \u003ccode\u003esource\u003c/code\u003e could be \u003ccode\u003egcsSource\u003c/code\u003e pointing to a Google Cloud Storage location.\u003c/p\u003e\n"],["\u003cp\u003eThe operation requires authorization with specific OAuth scopes, either \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/dialogflow\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]