# Method: photo.update

- [HTTP request](https://developers.google.com/streetview/publish/reference/rest/v1/photo/update#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/streetview/publish/reference/rest/v1/photo/update#body.PATH_PARAMETERS)
- [Query parameters](https://developers.google.com/streetview/publish/reference/rest/v1/photo/update#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/streetview/publish/reference/rest/v1/photo/update#body.request_body)
- [Response body](https://developers.google.com/streetview/publish/reference/rest/v1/photo/update#body.response_body)
- [Authorization scopes](https://developers.google.com/streetview/publish/reference/rest/v1/photo/update#body.aspect)
- [Try it!](https://developers.google.com/streetview/publish/reference/rest/v1/photo/update#try-it)

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

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

This method returns the following error codes:

- `https://developers.google.com/streetview/publish/reference/rest/v1/Code#ENUM_VALUES.PERMISSION_DENIED` if the requesting user did not create the requested photo.
- `https://developers.google.com/streetview/publish/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT` if the request is malformed.
- `https://developers.google.com/streetview/publish/reference/rest/v1/Code#ENUM_VALUES.NOT_FOUND` if the requested photo does not exist.
- `https://developers.google.com/streetview/publish/reference/rest/v1/Code#ENUM_VALUES.UNAVAILABLE` if the requested `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo` is still being indexed.

### HTTP request

`PUT https://streetviewpublish.googleapis.com/v1/photo/{photo.photoId.id}`

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

### Path parameters

| Parameters ||
|---|---|
| `photo.photoId.id` | `string` A unique identifier for a photo. |

### Query parameters

| Parameters ||
|---|---|
| `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. |

### Request body

The request body contains an instance of `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo`.

### Response body

If successful, the response body contains an instance of `https://developers.google.com/streetview/publish/reference/rest/v1/photo#Photo`.

### 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).