# Method: photos.batchUpdate

- [HTTP request](https://developers.google.com/streetview/publish/reference/rest/v1/photos/batchUpdate#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/streetview/publish/reference/rest/v1/photos/batchUpdate#body.request_body)
  - [JSON representation](https://developers.google.com/streetview/publish/reference/rest/v1/photos/batchUpdate#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/streetview/publish/reference/rest/v1/photos/batchUpdate#body.response_body)
  - [JSON representation](https://developers.google.com/streetview/publish/reference/rest/v1/photos/batchUpdate#body.BatchUpdatePhotosResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/streetview/publish/reference/rest/v1/photos/batchUpdate#body.aspect)
- [Try it!](https://developers.google.com/streetview/publish/reference/rest/v1/photos/batchUpdate#try-it)

Updates the metadata of `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo`, such as pose, place association, connections, etc. Changing the pixels of photos is not supported.

Note that if `https://developers.google.com/streetview/publish/reference/rest/v1/photos/batchUpdate#google.streetview.publish.v1.StreetViewPublishService.BatchUpdatePhotos` fails, either critical fields are missing or there is an authentication error. Even if `https://developers.google.com/streetview/publish/reference/rest/v1/photos/batchUpdate#google.streetview.publish.v1.StreetViewPublishService.BatchUpdatePhotos` succeeds, individual photos in the batch may have failures. These failures are specified in each `https://developers.google.com/streetview/publish/reference/rest/v1/PhotoResponse#FIELDS.status` in `https://developers.google.com/streetview/publish/reference/rest/v1/photos/batchUpdate#body.BatchUpdatePhotosResponse.FIELDS.results`. See `https://developers.google.com/streetview/publish/reference/rest/v1/photo/update#google.streetview.publish.v1.StreetViewPublishService.UpdatePhoto` for specific failures that can occur per photo.

Only the fields specified in `updateMask` field are used. If `updateMask` is not present, the update applies to all fields.

The number of `UpdatePhotoRequest` messages in a `BatchUpdatePhotosRequest` must not exceed 20.
> Note: To update `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Pose.FIELDS.altitude`, `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Pose.FIELDS.lat_lng_pair` has to be filled as well. Otherwise, the request will fail.

### HTTP request

`POST https://streetviewpublish.googleapis.com/v1/photos:batchUpdate`

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

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "updatePhotoRequests": [ { "photo": { object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo`) }, "updateMask": string } ] } ``` |

| Fields ||
|---|---|
| `updatePhotoRequests[]` | `object` Required. List of `UpdatePhotoRequests`. |
| `updatePhotoRequests[].photo` | ``object (`https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo`)`` Required. `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo` object containing the new metadata. |
| `updatePhotoRequests[].updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Required. Mask that identifies fields on the photo metadata to update. If not present, the old `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo` metadata is entirely replaced with the new `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo` metadata in this request. The update fails if invalid fields are specified. Multiple fields can be specified in a comma-delimited list. The following fields are valid: - `pose.heading` - `pose.lat_lng_pair` - `pose.pitch` - `pose.roll` - `pose.level` - `pose.altitude` - `connections` - `places` > Note: When `updateMask` contains repeated fields, the entire set of repeated values get replaced with the new contents. For example, if `updateMask` contains `connections` and `UpdatePhotoRequest.photo.connections` is empty, all connections are removed. |

### Response body

Response to batch update of metadata of one or more `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo`.

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

| JSON representation |
|---|
| ``` { "results": [ { object (`https://developers.google.com/streetview/publish/reference/rest/v1/PhotoResponse`) } ] } ``` |

| Fields ||
|---|---|
| `results[]` | ``object (`https://developers.google.com/streetview/publish/reference/rest/v1/PhotoResponse`)`` List of results for each individual `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo` updated, in the same order as the request. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/streetviewpublish`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).