- [HTTP request](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#body.request_body)
  - [JSON representation](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#body.response_body)
  - [JSON representation](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#body.BatchUpdateSelectedRoutesResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#body.aspect)
- [IAM Permissions](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#body.aspect_1)
- [UpdateSelectedRouteRequest](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#UpdateSelectedRouteRequest)
  - [JSON representation](https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#UpdateSelectedRouteRequest.SCHEMA_REPRESENTATION)

Updates multiple `SelectedRoute` resources as specified by their names.

### HTTP request

`POST https://roads.googleapis.com/selection/v1/{parent=projects/*}/selectedRoutes:batchUpdate`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The project resource shared by all selected routes in the batch. It's required because the batch request supports only a single `parent`. Format: projects/{project} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requests": [ { object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#UpdateSelectedRouteRequest`) } ], "updateMask": string } ``` |

| Fields ||
|---|---|
| `requests[]` | ``object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/batchUpdate#UpdateSelectedRouteRequest`)`` Required. The request message specifying the selected route to update. A maximum of 1,000 selected routes can be updated in a batch. The parent resource of each request must either be empty or match the top-level `parent`. |
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Optional. The list of fields to update shared by all child requests in the batch. Field paths are relative to `SelectedRoute`. You should only update `displayName`, `routeAttributes`, `dynamicRouting`, and `https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#SelectedRoute.FIELDS.dynamic_route` (including `origin`, `destination`, and `intermediates`). Example: `"displayName,routeAttributes,dynamicRouting,dynamicRoute"`. If set, this `updateMask` applies to any child requests that do not specify their own `updateMask`. If `*` is specified, a full replacement for all updatable fields is performed. If both batch and child request level `updateMask` fields are set, they must match. If omitted, the child request's `updateMask` will take effect. If a child request's `updateMask` is also omitted, all updatable fields that are populated in the child request's `selectedRoute` are implied to be updated. |

### Response body

Response from updating multiple `SelectedRoute`s.

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

| JSON representation |
|---|
| ``` { "selectedRoutes": [ { object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#SelectedRoute`) } ] } ``` |

| Fields ||
|---|---|
| `selectedRoutes[]` | ``object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#SelectedRoute`)`` `SelectedRoute` resources updated. |

### 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 `parent` resource:

- `roads.selectedRoutes.batchUpdate`

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

## UpdateSelectedRouteRequest

Request to update a `SelectedRoute`.

| JSON representation |
|---|
| ``` { "selectedRoute": { object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#SelectedRoute`) }, "updateMask": string } ``` |

| Fields ||
|---|---|
| `selectedRoute` | ``object (`https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#SelectedRoute`)`` Required. The `SelectedRoute` to update. The route's `name` field is used to identify the route to update. Format: projects/{project}/selectedRoutes/{selectedRoute} |
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Optional. The list of fields to update. Field paths are relative to `SelectedRoute`. You should only update `displayName`, `routeAttributes`, `dynamicRouting`, and `https://developers.google.com/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#SelectedRoute.FIELDS.dynamic_route` (including `origin`, `destination`, and `intermediates`). Example: `"displayName,routeAttributes,dynamicRouting,dynamicRoute"`. If `*` is specified, a full replacement for all updatable fields is performed. If `updateMask` is omitted, all updatable fields that are populated in `selectedRoute` are implied to be updated. |