Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status totesting
,YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of thestatus.streamStatus
property for the stream bound to your broadcast isactive
.
Common use cases
Request
HTTP request
POST https:// googleapis /youtube/v3/liveBroadcasts/transition
Authorization
This request requires authorization with at least one of the following scopes (read more about authentication and authorization).
Scope |
---|
https:// googleapis /auth/youtube |
https:// googleapis /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 | ||
broadcastStatus |
string The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either thetesting orlive state, thestatus.streamStatus must beactive for the stream that the broadcast is bound to.Acceptable values are:
|
|
id |
string The id parameter specifies the unique ID of the broadcast that is transitioning to another status. |
|
part |
string The part parameter specifies a comma-separated list of one or moreliveBroadcast resource properties that the API response will include. Thepart names that you can include in the parameter value areid ,snippet ,contentDetails ,andstatus . |
|
Optional parameters | ||
onBehalfOfContentOwner |
string This parameter can only be used in a properlyauthorized 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 properlyauthorized request.This parameter can only be used in a properlyauthorized 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 theonBehalfOfContentOwner 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 theonBehalfOfContentOwner parameter specifies. Finally, the channel that theonBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that theonBehalfOfContentOwner 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
Do not provide a request body when calling this method.
Response
If successful, this method returns aliveBroadcast resourcein 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 theerror messagedocumentation for more detail.
Error type | Error detail | Description |
---|---|---|
backendError |
errorExecutingTransition |
An error occurred while changing the broadcast's status. |
forbidden (403) |
errorStreamInactive |
The requested transition is not allowed when the stream that is bound to the broadcast is inactive. |
forbidden (403) |
invalidTransition |
The live broadcast can't transition from its current status to the requested status. |
forbidden (403) |
redundantTransition |
The live broadcast is already in the requested status or processing to the requested status. |
insufficientPermissions |
insufficientLivePermissions |
The request is not authorized to transition the live broadcast. |
insufficientPermissions |
livePermissionBlocked |
The user that authorized the request is unable to stream live video on YouTube at this time. Details explaining why the user cannot stream live video may be available in the user's channel settings athttps:// youtube /features. |
insufficientPermissions |
liveStreamingNotEnabled |
The user that authorized the request is not enabled to stream live video on YouTube. The user can find more information athttps:// youtube /features. |
notFound (404) |
liveBroadcastNotFound |
The broadcast specified by theid parameter does not exist. |
rateLimitExceeded (403) |
userRequestsExceedRateLimit |
The user has sent too many requests in a given timeframe. |
required (400) |
idRequired |
The requiredid parameter must identify the broadcast whose status you want to transition. |
required (400) |
statusRequired |
The API request must specify a value for thestatus parameter. |
Try it!
Use theAPIs Explorerto call this API and see the API request and response.