Method: projects.knowledgeBases.documents.import

Create 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.

HTTP request

POST https://dialogflow.googleapis.com/v2beta1/{parent=projects/*/knowledgeBases/*}/documents:import

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

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,
  "gcsSource": {
    object (GcsSources)
  }
}
Fields
documentTemplate

object (ImportDocumentTemplate)

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.

gcsSource

object (GcsSources)

The Google Cloud Storage location for the documents. The path can include a wildcard.

These URIs may have the forms gs://<bucket-name>/<object-name>. gs://<bucket-name>/<object-path>/*.<extension>.

Response body

If successful, the response body contains an instance of Operation.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/dialogflow

For more information, see the Authentication Overview.