Updates a broadcast. For example, you could modify the broadcast settings defined in the liveBroadcast
resource's contentDetails
object.
Common use cases
Request
HTTP request
PUT https://www.googleapis.com/youtube/v3/liveBroadcasts
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 .
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.
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
, contentDetails
, monetizationDetails
, 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. For example, a broadcast's privacy status is defined in the
status
part. As such, if your request is updating a private or unlisted broadcast, and the request's part
parameter value includes the status
part, the broadcast's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the broadcast will revert to the default privacy setting.onBehalfOfContentOwner
string
This parameter can only be used in a properly authorized request .
Note:This parameter is intended exclusively for YouTube content partners.
The
onBehalfOfContentOwner
parameter indicates that the request's authorization credentials identify a YouTube Content Management System (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 .
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 liveBroadcast resource in the request body. For that resource:
-
You must specify a value for these properties:
-
id
-
snippet.scheduledStartTime
-
contentDetails.monitorStream.enableMonitorStream
-
contentDetails.monitorStream.broadcastStreamDelayMs
-
-
You can set values for these properties:
-
snippet.title
-
snippet.description
-
snippet.scheduledStartTime
-
snippet.scheduledEndTime
-
status.privacyStatus
-
contentDetails.monitorStream.enableMonitorStream
-
contentDetails.monitorStream.broadcastStreamDelayMs
-
contentDetails.enableAutoStart
-
contentDetails.enableAutoStop
-
contentDetails.enableClosedCaptions
-
contentDetails.enableDvr
-
contentDetails.enableEmbed
-
contentDetails.recordFromStart
-
monetizationDetails.cuepointSchedule.pauseAdsUntil
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 liveBroadcast 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 error message .
forbidden (403)
closedCaptionsTypeModificationNotAllowed
contentDetails.closedCaptionsType
value can only be modified when the broadcast is in the created
or ready
status.forbidden (403)
enabledModificationNotAllowed
enabled
field is read-only.forbidden (403)
scheduleStrategyModificationNotAllowed
scheduleStrategy
field is read-only.forbidden (403)
repeatIntervalSecsModificationNotAllowed
repeatIntervalSecs
field is read-only.forbidden (403)
pauseAdsUntilModificationNotAllowed
pauseAdsUntil
field cannot be modified.
This error can occur for the following reasons: - The
monetizationDetails.cuepointSchedule.enabled
field is not set totrue
. This field can only be set using YouTube Studio. - The broadcast is not live.
forbidden (403)
enableAutoStartModificationNotAllowed
contentDetails.enableAutoStart
value can only be modified when the stream is inactive and the broadcast is in the created
or ready
status.forbidden (403)
enableClosedCaptionsModificationNotAllowed
contentDetails.enableClosedCaptions
value can only be modified when the broadcast's status is created
or ready
.forbidden (403)
enableDvrModificationNotAllowed
contentDetails.
enableDvr
value can be modified only when the broadcast's status is created
or ready
.forbidden (403)
enableMonitorStreamModificationNotAllowed
contentDetails.
monitorStream.enableMonitorStream
value can be modified only when the broadcast's status is created
or ready
.forbidden (403)
recordFromStartModificationNotAllowed
contentDetails.
recordFromStart
value can be modified only when the broadcast's status is created
or ready
.insufficientPermissions
insufficientLivePermissions
invalidValue (400)
invalidAutoStart
contentDetails.enableAutoStart
property.
You cannot modify the enableAutoStart
setting for a persistent broadcast.invalidValue (400)
invalidAutoStop
contentDetails.enableAutoStop
property. You
cannot modify the enableAutoStop
setting for a persistent broadcast.invalidValue (400)
invalidDescription
snippet.description
property. snippet.description
can contain up to 5000 characters.invalidValue (400)
invalidEnableClosedCaptions
contentDetails.enableClosedCaptions
property is incompatible with the value of the contentDetails.closedCaptionType
setting. Modify the resource to only include one of the two properties, and then resubmit the request.invalidValue (400)
invalidLatencyPreferenceOptions
contentDetails.latencyPreference
property.
Not all settings are supported with this latency preference.invalidValue (400)
invalidPauseAdsUntil
monetizationDetails.cuepointSchedule.pauseAdsUntil
property.
This error can occur for the following reasons: - The
monetizationDetails.cuepointSchedule.pauseAdsUntil
value is not specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - The
monetizationDetails.cuepointSchedule.pauseAdsUntil
value is not in the future. - The
monetizationDetails.cuepointSchedule.pauseAdsUntil
value is farther than 10 minutes from current time.
invalidValue (400)
invalidPrivacyStatus
invalidValue (400)
invalidProjection
contentDetails.projection
property. A persistent broadcast's projection cannot be set to 360.invalidValue (400)
invalidScheduledEndTime
snippet.scheduledEndTime
property. The scheduled end time must follow the scheduled start time.invalidValue (400)
invalidScheduledStartTime
snippet.scheduledStartTime
property. The scheduled start time must be in the future.invalidValue (400)
invalidTitle
snippet.title
property. snippet.title
must be between 1 and 100 characters long.notFound (404)
liveBroadcastNotFound
required (400)
broadcastStreamDelayMsRequired
contentDetails.
monitorStream.broadcastStreamDelayMs
property.required (400)
enableMonitorStreamRequired
contentDetails.
monitorStream.enableMonitorStream
property.required (400)
idRequired
required (400)
scheduledEndTimeRequired
required (400)
scheduledStartTimeRequired
Try it!
Use the APIs Explorer to call this API and see the API request and response.