Updates a video stream. If the properties that you want to change cannot be updated, then you need to create a new stream with the proper settings.

## Common use cases

<iframe src="https://developers.devsite.google/frame/youtube/data/live/reference/rest/v3/liveStreams/update_5e96bd414be31cd288f1e3ecf3c6e3e9e2a2f50e1e7993f2f398ab5c8c15de0c.frame" class="framebox inherit-locale " allow="clipboard-write https://developers.devsite.google" allowfullscreen is-upgraded></iframe>

## Request

### HTTP request

```
PUT https://www.googleapis.com/youtube/v3/liveStreams
```

### Authorization

This request requires authorization with at least one of the following scopes. To read more about authentication and authorization, see [Implementing OAuth 2.0 authorization](https://developers.google.com/youtube/data/live/authentication.md.txt).

| Scope |
|---|
| `https://www.googleapis.com/auth/youtube` |
| `https://www.googleapis.com/auth/youtube.force-ssl` |

### Parameters

The following table lists the parameters that this query supports. All of the parameters listed are query parameters.

| Parameters ||
|---|---|---|
| **Required parameters** |||
| `part` | `string` The `part` parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The `part` properties that you can include in the parameter value are `id`, `snippet`, `cdn`, and `status`. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. If the request body does not specify a value for a mutable property, the existing value for that property will be removed. |
| **Optional parameters** |||
| `onBehalfOfContentOwner` | `string` This parameter can only be used in a properly [authorized request](https://developers.google.com/youtube/data/live/authentication.md.txt). **Note:** This parameter is intended exclusively for YouTube content partners. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. |
| `onBehalfOfContentOwnerChannel` | `string` This parameter can only be used in a properly [authorized request](https://developers.google.com/youtube/data/live/authentication.md.txt). **Note:** This parameter is intended exclusively for YouTube content partners. The `onBehalfOfContentOwnerChannel` parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the `onBehalfOfContentOwner` parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the `onBehalfOfContentOwner` parameter specifies. Finally, the channel that the `onBehalfOfContentOwnerChannel` parameter value specifies must be linked to the content owner that the `onBehalfOfContentOwner` parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. |

### Request body

Provide a [liveStream resource](https://developers.google.com/youtube/data/live/reference/rest/v3/liveStreams.md.txt#resource) in the request body.
For that resource:

- You must specify a value for these properties:

  <br />

  - `id`
  - `snippet.title`
  - `cdn.frameRate`
  - `cdn.ingestionType`
  - `cdn.resolution`

  <br />

- You can set values for these properties:

  <br />

  - `snippet.title`
  - `snippet.description`

  <br />

  If you are submitting an update request, and your request does not specify a value for a property that already has a value, the property's existing value will be deleted.

## Response

If successful, this method returns a [liveStream resource](https://developers.google.com/youtube/data/live/reference/rest/v3/liveStreams.md.txt#resource) in the response body.

## Errors

The following table identifies error messages that the API could return in response to a call to this method. For more details, see [YouTube Live Streaming API - Errors](https://developers.google.com/youtube/data/live/reference/rest/v3/errors.md.txt).

| Error type | Error detail | Description |
|---|---|---|
| `forbidden (403)` | `liveStreamModificationNotAllowed` | The specified live stream cannot be modified in its current state. For more information, see [Life of a Broadcast](https://developers.google.com/youtube/data/live/life-of-a-broadcast.md.txt). |
| `forbidden (403)` | `liveStreamModificationNotAllowed` | The API does not allow you to change the value of the `cdn.format`, `cdn.frameRate`, `cdn.ingestionType`, or `cdn.resolution` fields after the stream is created. |
| `forbidden (403)` | `liveStreamModificationNotAllowed` | The API does not allow you to change a reusable stream to be non-reusable, or vice versa. For more information, see [Understanding Broadcasts and Streams](https://developers.google.com/youtube/data/live/broadcasts-and-streams.md.txt). |
| `insufficientPermissions` | `insufficientLivePermissions` | The request is not authorized to update the specified live stream. For more information, see [Implementing OAuth2 authentication](https://developers.google.com/youtube/data/live/authentication.md.txt). |
| `insufficientPermissions` | `liveStreamingNotEnabled` | The user that authorized the request is not enabled to stream live video on YouTube. The user can find more information at [Feature eligibility](https://www.youtube.com/features). |
| `invalidValue (400)` | `invalidDescription` | The `snippet.description` property's value in the [liveStream resource](https://developers.google.com/youtube/data/live/reference/rest/v3/liveStreams.md.txt#resource) can have up to 10000 characters. |
| `invalidValue (400)` | `invalidTitle` | The `snippet.title` property's value in the [liveStream resource](https://developers.google.com/youtube/data/live/reference/rest/v3/liveStreams.md.txt#resource) must be between 1 and 128 characters long. |
| `notFound (404)` | `liveStreamNotFound` | The specified live stream doesn't exist. |
| `required (400)` | `idRequired` | The [liveStream resource](https://developers.google.com/youtube/data/live/reference/rest/v3/liveStreams.md.txt#resource) must specify a value for the `id` property. |
| `required (400)` | `ingestionTypeRequired` | The [liveStream resource](https://developers.google.com/youtube/data/live/reference/rest/v3/liveStreams.md.txt#resource) must specify a value for the `cdn.ingestionType` property. |
| `required (400)` | `titleRequired` | The [liveStream resource](https://developers.google.com/youtube/data/live/reference/rest/v3/liveStreams.md.txt#resource) must specify a value for the `snippet.title` property. |

## Try it!

Use the APIs Explorer to call this API and see the API request and response.