# Method: media.upload

- [HTTP request](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/media/upload#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/media/upload#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/media/upload#body.request_body)
  - [JSON representation](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/media/upload#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/media/upload#body.response_body)
  - [JSON representation](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/media/upload#body.ImportDatasetResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/media/upload#body.aspect)
- [IAM Permissions](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/media/upload#body.aspect_1)

Imports a new version of the data for the dataset.

### HTTP request

- Upload URI, for media upload requests:  
  `POST https://mapsplatformdatasets.googleapis.com/upload/v1/{name=projects/*/datasets/*}:import`
- Metadata URI, for metadata-only requests:  
  `POST https://mapsplatformdatasets.googleapis.com/v1/{name=projects/*/datasets/*}:import`

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. Resource name. Format: projects/{project}/datasets/{datasetId} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "versionDescription": string, // Union field `data_source` can be only one of the following: "localFileSource": { object (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#LocalFileSource`) }, "gcsSource": { object (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#GcsSource`) } // End of list of possible types for union field `data_source`. } ``` |

| Fields ||
|---|---|
| `versionDescription` | `string` A description of the new data being imported. |
| Union field `data_source`. Details about the source of the data for the dataset. `data_source` can be only one of the following: ||
| `localFileSource` | ``object (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#LocalFileSource`)`` A local file source for the dataset for a one time import. |
| `gcsSource` | ``object (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#GcsSource`)`` A Google Cloud Storage file source for the dataset for a one time import. |

### Response body

Response object of media.upload.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "name": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. Resource name of the newly created dataset version. Format: projects/{project}/datasets/{datasetId}@{versionId} |

### Authorization scopes

Requires the following OAuth scope:

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

### IAM Permissions

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

- `mapsplatformdatasets.datasets.import`

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