# Method: projects.locations.datasets.importData

- [HTTP request](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#body.aspect)
- [DatasetInputConfig](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#DatasetInputConfig)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#DatasetInputConfig.SCHEMA_REPRESENTATION)
- [InputFile](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#InputFile)
  - [JSON representation](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#InputFile.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#try-it)

Import sentence pairs into translation Dataset.

### HTTP request

`POST https://translate.googleapis.com/v3/{dataset=projects/*/locations/*/datasets/*}:importData`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `dataset` | `string` Required. Name of the dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "inputConfig": { object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#DatasetInputConfig`) } } ``` |

| Fields ||
|---|---|
| `inputConfig` | ``object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#DatasetInputConfig`)`` Required. The config for the input content. |

### Response body

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

### Authorization scopes

Requires one of the following OAuth scopes:

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

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

## DatasetInputConfig

Input configuration for datasets.

| JSON representation |
|---|
| ``` { "inputFiles": [ { object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#InputFile`) } ] } ``` |

| Fields ||
|---|---|
| `inputFiles[]` | ``object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/projects.locations.datasets/importData#InputFile`)`` Files containing the sentence pairs to be imported to the dataset. |

## InputFile

An input file.

| JSON representation |
|---|
| ``` { "usage": string, // Union field `source` can be only one of the following: "gcsSource": { object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/GcsInputSource`) } // End of list of possible types for union field `source`. } ``` |

| Fields ||
|---|---|
| `usage` | `string` Optional. Usage of the file contents. Options are TRAIN\|VALIDATION\|TEST, or UNASSIGNED (by default) for auto split. |
| Union field `source`. Source of the file containing sentence pairs. Supported formats are tab-separated values (.tsv) and Translation Memory eXchange (.tmx) . `source` can be only one of the following: ||
| `gcsSource` | ``object (`https://docs.cloud.google.com/translate/docs/reference/rest/v3/GcsInputSource`)`` Google Cloud Storage file source. |