**Full name**: projects.locations.processors.dataset.importDocuments

Import documents into a dataset.

### HTTP request

Choose a location:
<button value="global" default="">global</button> <button value="us">us</button> <button value="eu">eu</button> <button value="asia-south1">asia-south1</button> <button value="asia-southeast1">asia-southeast1</button> <button value="northamerica-northeast1">northamerica-northeast1</button> <button value="australia-southeast1">australia-southeast1</button> <button value="europe-west2">europe-west2</button> <button value="europe-west3">europe-west3</button>   
`POST https://documentai.googleapis.com/v1beta3/{dataset}:importDocuments`

<br />

### Path parameters

| Parameters ||
|---|---|
| `dataset` | `string` Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset It takes the form `projects/{project}/locations/{location}/processors/{processor}/dataset`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "batchDocumentsImportConfigs": [ { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.dataset/importDocuments#BatchDocumentsImportConfig`) } ] } ``` |

| Fields ||
|---|---|
| `batchDocumentsImportConfigs[]` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.dataset/importDocuments#BatchDocumentsImportConfig`)`` Required. The Cloud Storage uri containing raw documents that must be imported. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/document-ai/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `dataset` resource:

- `documentai.datasets.createDocuments`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## BatchDocumentsImportConfig

Config for importing documents. Each batch can have its own dataset split type.

| JSON representation |
|---|
| ``` { "batchInputConfig": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/BatchDocumentsInputConfig`) }, "documentType": string, // Union field `split_type_config` can be only one of the following: "datasetSplit": enum (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/DatasetSplitType`), "autoSplitConfig": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.dataset/importDocuments#AutoSplitConfig`) } // End of list of possible types for union field `split_type_config`. } ``` |

| Fields ||
|---|---|
| `batchInputConfig` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/BatchDocumentsInputConfig`)`` The common config to specify a set of documents used as input. |
| `documentType` | `string` Optional. If set, determines the type of the documents to be imported in this batch. It can be used to auto-label the documents with a single entity of the provided type. This field can only be used with a classifier or splitter processor. Providing this field is mutually exclusive with `entities` and `autoLabelingConfig`. |
| Union field `split_type_config`. `split_type_config` can be only one of the following: ||
| `datasetSplit` | ``enum (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/DatasetSplitType`)`` Target dataset split where the documents must be stored. |
| `autoSplitConfig` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1beta3/projects.locations.processors.dataset/importDocuments#AutoSplitConfig`)`` If set, documents will be automatically split into training and test split category with the specified ratio. |

## AutoSplitConfig

The config for auto-split.

| JSON representation |
|---|
| ``` { "trainingSplitRatio": number } ``` |

| Fields ||
|---|---|
| `trainingSplitRatio` | `number` Ratio of training dataset split. |