LiveBroadcasts: update

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 (read more about authentication and 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.

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, 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.
Optional parameters
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 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. 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. Please see the error message documentation for more detail.

Error type Error detail Description
forbidden (403) closedCaptionsTypeModificationNotAllowed The contentDetails.closedCaptionsType value can only be modified when the broadcast is in the created or ready status.
forbidden (403) enabledModificationNotAllowed The enabled field is read-only.
forbidden (403) scheduleStrategyModificationNotAllowed The scheduleStrategy field is read-only.
forbidden (403) repeatIntervalSecsModificationNotAllowed The repeatIntervalSecs field is read-only.
forbidden (403) pauseAdsUntilModificationNotAllowed The pauseAdsUntil field cannot be modified. This error can occur for the following reasons:
  • The monetizationDetails.cuepointSchedule.enabled field is not set to true. This field can only be set via YouTube Studio.
  • The broadcast is not live.
forbidden (403) enableAutoStartModificationNotAllowed The 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 The contentDetails.enableClosedCaptions value can only be modified when the broadcast's status is created or ready.
forbidden (403) enableDvrModificationNotAllowed The contentDetails.enableDvr value can be modified only when the broadcast's status is created or ready.
forbidden (403) enableMonitorStreamModificationNotAllowed The contentDetails.monitorStream.enableMonitorStream value can be modified only when the broadcast's status is created or ready.
forbidden (403) recordFromStartModificationNotAllowed The contentDetails.recordFromStart value can be modified only when the broadcast's status is created or ready.
insufficientPermissions insufficientLivePermissions The request is not authorized to update the specified live broadcast. For more information, see Implementing OAuth2 authentication.
insufficientPermissions liveStreamingNotEnabled The user that authorized the request is not enabled to stream live video on YouTube. The user can find more information at https://www.youtube.com/features.
invalidValue (400) invalidAutoStart The liveBroadcast resource contained an invalid value for the contentDetails.enableAutoStart property. You cannot modify the enableAutoStart setting for a persistent broadcast.
invalidValue (400) invalidAutoStop The liveBroadcast resource contained an invalid value for the contentDetails.enableAutoStop property. You cannot modify the enableAutoStop setting for a persistent broadcast.
invalidValue (400) invalidDescription The liveBroadcast resource did not specify a valid value for the snippet.description property. snippet.description can contain up to 5000 characters.
invalidValue (400) invalidEmbedSetting The liveBroadcast resource contained an invalid value for the contentDetails.enable_embed property. You cannot embed this broadcast.
invalidValue (400) invalidEnableClosedCaptions In the liveBroadcast resource, the value of the 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 The liveBroadcast resource contained an invalid value for the contentDetails.latencyPreference property. Not all settings are supported with this latency preference.
invalidValue (400) invalidPauseAdsUntil The liveBroadcast resource contains an invalid value for the 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 The liveBroadcast resource did not specify a valid privacy status. See valid privacyStatus values.
invalidValue (400) invalidProjection The liveBroadcast resource contained an invalid value for the contentDetails.projection property. A persistent broadcast's projection cannot be set to 360.
invalidValue (400) invalidScheduledEndTime The liveBroadcast resource contained an invalid value for the snippet.scheduledEndTime property. The scheduled end time must follow the scheduled start time.
invalidValue (400) invalidScheduledStartTime The liveBroadcast resource contained an invalid value for the snippet.scheduledStartTime property. The scheduled start time must be in the future.
invalidValue (400) invalidTitle The liveBroadcast resource did not specify a valid value for the snippet.title property. snippet.title must be between 1 and 100 characters long.
notFound (404) liveBroadcastNotFound The id property specified in the liveBroadcast resource did not identify a broadcast.
required (400) broadcastStreamDelayMsRequired The liveBroadcast resource did not specify the contentDetails.monitorStream.broadcastStreamDelayMs property.
required (400) enableMonitorStreamRequired The liveBroadcast resource did not specify the contentDetails.monitorStream.enableMonitorStream property.
required (400) idRequired The liveBroadcast resource must include and specify a value for the id property.
required (400) scheduledEndTimeRequired The liveBroadcast resource did not specify the snippet.scheduledEndTime property.
required (400) scheduledStartTimeRequired The liveBroadcast resource did not specify the snippet.scheduledStartTime property.

Try it!

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