Skip to main content
Access Broadcasts endpoints via client.broadcasts() (BroadcastsClient).

Methods

addChatModerator

POST /2/broadcasts/chat/moderators Add a Chat Moderator Adds a moderator to the authenticated broadcaster’s persistent list and returns the updated moderator user IDs. The list applies to all current and future broadcast chats.

Parameters

Schemas.AddChatModeratorRequest
required
Request payload.
Returns: Schemas.AddChatModeratorResponse

createBroadcast

POST /2/broadcasts Go Live on a Source Takes one or more of the authenticated user’s sources live and returns 201 with the new broadcast. Several sources (source_id plus additional_source_ids, one per video format) go live together as one broadcast; they must all be RTMP sources in one region, and when one of them is already live its broadcast is returned only if it holds every listed source. The broadcast goes live immediately (state RUNNING), even before the encoder sends video, and is ended (TIMED_OUT) if no video arrives within 5 minutes. It is announced in a Post unless should_not_tweet is true. When the source already has a live broadcast, returns 200 with that broadcast unchanged and ignores the request’s title, locale, chat_option and should_not_tweet. A missing tweet_id means the Post hasn’t been created yet, was suppressed with should_not_tweet, or could not be created; read it later with GET /2/broadcasts/:id. A 409 conflict means the source can’t go live right now: either it can’t take video before the encoder connects (external HLS sources, or regions where this isn’t available), so retry once video is flowing, or another broadcast is live on it, so END that broadcast first. The detail says which, and names the live broadcast when known.

Parameters

Schemas.CreateBroadcastRequest
required
Request payload.
Returns: Schemas.CreateBroadcastResponse

createScheduledBroadcast

POST /2/broadcasts/scheduled Create a Scheduled Broadcast Schedules a broadcast for the authenticated user on one of their sources: source_id is required. Passing a stream key as source_id is deprecated and stops working when the /2/users/:id/sources and /2/users/:id/broadcasts routes reach end of life on January 1, 2027; pass the source’s id from GET /2/sources instead.

Parameters

Schemas.CreateScheduledBroadcastRequest
required
Request payload.
Returns: Schemas.CreateScheduledBroadcastResponse

createSource

POST /2/sources Create a Stream Source Creates a persistent RTMP/RTMPS ingest point for the authenticated user. Push an encoder to rtmps_url with the returned stream_key. This is the only response that includes the stream key; read it later with GET /2/sources/:id/stream_key.

Parameters

Schemas.CreateSourceRequest
required
Request payload.
Returns: Schemas.CreateSourceResponse

createUserBroadcast

POST /2/users/{id}/broadcasts Create a Broadcast on a User’s Source Creates a broadcast on one of the authenticated user’s sources. id must be the authenticated user. The broadcast is NOT_STARTED and posts nothing until it is published with PUT /2/users/:id/broadcasts/:broadcast_id/state; one that is never published is deleted after 7 days. When the source already has a running broadcast, that broadcast is returned.

Parameters

String
required
id (path parameter).
Schemas.CreateUserBroadcastRequest
required
Request payload.
Returns: Schemas.CreateUserBroadcastResponse

createUserSource

POST /2/users/{id}/sources Create a Stream Source for a User Creates a persistent RTMP/RTMPS ingest point for the authenticated user. id must be the authenticated user.

Parameters

String
required
id (path parameter).
Schemas.CreateUserSourceRequest
required
Request payload.
Returns: Schemas.CreateUserSourceResponse

deleteBroadcast

DELETE /2/broadcasts/{id} Delete a Broadcast Deletes one of the authenticated user’s broadcasts, scheduled or ended, including its replay. A running broadcast must be ended first.

Parameters

String
required
id (path parameter).
Returns: Schemas.DeleteBroadcastResponse

deleteBroadcastChatMessage

DELETE /2/broadcasts/{id}/chat/{message_id} Remove a Chat Message from a Live Broadcast Removes a specific chat message from a running broadcast where the authenticated user is the host or a moderator.

Parameters

String
required
id (path parameter).
String
required
message_id (path parameter).
Returns: Schemas.DeleteBroadcastChatMessageResponse

deleteScheduledBroadcast

DELETE /2/broadcasts/scheduled/{id} Delete a Scheduled Broadcast Deletes a scheduled broadcast by its alphanumeric broadcast id.

Parameters

String
required
id (path parameter).
Returns: Schemas.DeleteScheduledBroadcastResponse

deleteSource

DELETE /2/sources/{id} Delete a Stream Source Deletes one of the authenticated user’s stream sources.

Parameters

String
required
Source id (19 digits), from GET /2/sources.
Returns: Schemas.DeleteSourceResponse

deleteUserBroadcast

DELETE /2/users/{id}/broadcasts/{broadcast_id} Delete a User’s Broadcast Deletes one of the authenticated user’s broadcasts. id must be the authenticated user. Deprecated: use DELETE /2/broadcasts/:id.

Parameters

String
required
id (path parameter).
String
required
broadcast_id (path parameter).
Returns: Schemas.DeleteUserBroadcastResponse

deleteUserSource

DELETE /2/users/{id}/sources/{source_id} Delete a User’s Stream Source Deletes one of the authenticated user’s stream sources. id must be the authenticated user. Success is an empty object.

Parameters

String
required
id (path parameter).
String
required
source_id (path parameter).
Returns: Schemas.DeleteUserSourceResponse

getBroadcast

GET /2/broadcasts/{id} Get a Broadcast Returns a broadcast owned by the authenticated user.

Parameters

String
required
id (path parameter).
Returns: Schemas.GetBroadcastResponse

getBroadcastChat

GET /2/broadcasts/{id}/chat Paginated Get Broadcast Chat History Returns newest-first chat messages for a broadcast owned by the authenticated user.

Parameters

String
required
id (path parameter).
Returns: Schemas.GetBroadcastChatResponse (use getBroadcastChatPages(...) for automatic Paginator<...> iteration)

getChatModerators

GET /2/broadcasts/chat/moderators Get Chat Moderators Returns the authenticated broadcaster’s persistent moderators as User resources. The list applies to all of their current and future broadcast chats.

Parameters

Returns: Schemas.GetChatModeratorsResponse

getChatMutedUsers

GET /2/broadcasts/chat/mutes Paginated Get Muted Chat Users Returns the users muted in the authenticated broadcaster’s chat, with the expiry time of timed mutes. Mutes apply to all of their broadcasts. Expired timed mutes are omitted. Use expansions=user_id to include the muted users.

Parameters

Returns: Schemas.GetChatMutedUsersResponse (use getChatMutedUsersPages(...) for automatic Paginator<...> iteration)

getRegion

GET /2/region Get the Ingest Region Returns the ingest region nearest the server handling the request. Pass it as region when creating a stream source to ingest there.
Returns: Schemas.GetRegionResponse

getScheduledBroadcast

GET /2/broadcasts/scheduled/{id} Get a Scheduled Broadcast Returns a single scheduled broadcast by its alphanumeric broadcast id.

Parameters

String
required
id (path parameter).
Returns: Schemas.GetScheduledBroadcastResponse

getSource

GET /2/sources/{id} Get a Stream Source Returns one of the authenticated user’s stream sources. Poll it after starting an encoder and wait for is_stream_active before going live. The stream key is not included; read it with GET /2/sources/:id/stream_key.

Parameters

String
required
Source id (19 digits), from GET /2/sources.
Returns: Schemas.GetSourceResponse

getSourceStreamKey

GET /2/sources/{id}/stream_key Get a Stream Source’s Stream Key Returns the stream key of one of the authenticated user’s stream sources. The stream key is a credential: anyone with it can stream to the source, so keep it out of logs, URLs and client-side code.

Parameters

String
required
Source id (19 digits), from GET /2/sources.
Returns: Schemas.GetSourceStreamKeyResponse

getUserBroadcast

GET /2/users/{id}/broadcasts/{broadcast_id} Get a User’s Broadcast Returns one of the authenticated user’s broadcasts. id must be the authenticated user. Deprecated: use GET /2/broadcasts/:id.

Parameters

String
required
id (path parameter).
String
required
broadcast_id (path parameter).
Returns: Schemas.GetUserBroadcastResponse

getUserSource

GET /2/users/{id}/sources/{source_id} Get a User’s Stream Source Returns one of the authenticated user’s stream sources. id must be the authenticated user.

Parameters

String
required
id (path parameter).
String
required
source_id (path parameter).
Returns: Schemas.GetUserSourceResponse

goLiveScheduledBroadcast

POST /2/broadcasts/scheduled/{id}/live Go Live on a Scheduled Broadcast Publishes a schedule that was created or updated with manual_publish: true. Without that flag the coordinator auto-publishes at start and this call is rejected.

Parameters

String
required
id (path parameter).
Returns: Schemas.GoLiveScheduledBroadcastResponse

list

GET /2/broadcasts Paginated List Broadcasts Returns the authenticated user’s live-video broadcasts, or selected owned broadcasts when ids are provided. At most one of ids, max_results may be provided. At most one of ids, pagination_token may be provided.

Parameters

Returns: Schemas.ListBroadcastsResponse (use listPages(...) for automatic Paginator<...> iteration)

listLiveCategories

GET /2/broadcasts/categories List Live Categories Returns the live categories a host can pick when going live, in display order. Pass a category’s id as live_category_id on POST /2/broadcasts. Ids are permanent; names can change, so store the id and show the current name. The whole list is returned in one response, without paging.
Returns: Schemas.ListLiveCategoriesResponse

listScheduled

GET /2/broadcasts/scheduled Paginated List Scheduled Broadcasts Returns scheduled broadcasts owned by the authenticated user.

Parameters

Returns: Schemas.ListScheduledBroadcastsResponse (use listScheduledPages(...) for automatic Paginator<...> iteration)

listSources

GET /2/sources List Stream Sources Returns the authenticated user’s RTMP/RTMPS stream sources. A source’s id is the source_id that POST /2/broadcasts and scheduled broadcasts take. Stream keys are not included; read one with GET /2/sources/:id/stream_key.
Returns: Schemas.ListSourcesResponse

listUser

GET /2/users/{id}/broadcasts Paginated List a User’s Broadcasts Returns the authenticated user’s broadcasts, 100 per page. id must be the authenticated user. Deprecated: use GET /2/broadcasts.

Parameters

String
required
id (path parameter).
Returns: Schemas.ListUserBroadcastsResponse (use listUserPages(...) for automatic Paginator<...> iteration)

listUserSources

GET /2/users/{id}/sources List a User’s Stream Sources Returns the authenticated user’s RTMP/RTMPS stream sources (empty array if none). id must be the authenticated user.

Parameters

String
required
id (path parameter).
Returns: Schemas.ListUserSourcesResponse

muteBroadcastChatUser

POST /2/broadcasts/{id}/chat/mutes Mute or Time Out a User in a Broadcast Chat Prevents a user from posting further messages in a running broadcast chat. When end_at_ms is provided, the mute expires at that time. The authenticated user must be the broadcast host or a moderator.

Parameters

String
required
id (path parameter).
Schemas.MuteBroadcastChatUserRequest
required
Request payload.
Returns: Schemas.MuteBroadcastChatUserResponse

muteChatUser

POST /2/broadcasts/chat/mutes Mute or Time Out a User in Chat Prevents a user from posting messages in all of a broadcaster’s chats. Without broadcast_id, the user is muted in the authenticated user’s own chats. Moderators pass broadcast_id to mute the user in that broadcast host’s chats. When end_at_ms is provided, the mute expires at that time.

Parameters

Schemas.MuteChatUserRequest
required
Request payload.
Returns: Schemas.MuteChatUserResponse

removeChatModerator

DELETE /2/broadcasts/chat/moderators/{user_id} Remove a Chat Moderator Removes a moderator from the authenticated broadcaster’s persistent list and returns the updated moderator user IDs.

Parameters

String
required
A 64-bit signed integer.
Returns: Schemas.RemoveChatModeratorResponse

sendBroadcastChat

POST /2/broadcasts/{id}/chat Send a Chat Message to a Live Broadcast Posts a chat message to a running broadcast, attributed to the authenticated user.

Parameters

String
required
id (path parameter).
Schemas.SendBroadcastChatRequest
required
Request payload.
Returns: Schemas.SendBroadcastChatResponse

unmuteBroadcastChatUser

DELETE /2/broadcasts/{id}/chat/mutes/{user_id} Unmute a User in a Broadcast Chat Allows a muted user to post messages in a running broadcast chat again. The authenticated user must be the broadcast host or a moderator.

Parameters

String
required
id (path parameter).
String
required
A 64-bit signed integer.
Returns: Schemas.UnmuteBroadcastChatUserResponse

unmuteChatUser

DELETE /2/broadcasts/chat/mutes/{user_id} Unmute a User in Chat Allows a muted user to post messages in a broadcaster’s chats again. Without broadcast_id, the user is unmuted in the authenticated user’s own chats. Moderators pass broadcast_id to unmute the user in that broadcast host’s chats.

Parameters

String
required
A 64-bit signed integer.
Returns: Schemas.UnmuteChatUserResponse

updateBroadcast

PUT /2/broadcasts/{id} Update a Broadcast Changes the title, chat option or live category of one of the authenticated user’s broadcasts and returns the broadcast. Send at least one of title, chat_option and live_category_id; fields left out keep their values. A broadcast can be updated before it starts, while it is live and after it has ended. A 409 conflict means the broadcast can’t be edited, for example because it was deleted or moderated.

Parameters

String
required
id (path parameter).
Schemas.UpdateBroadcastRequest
required
Request payload.
Returns: Schemas.UpdateBroadcastResponse

updateBroadcastState

PUT /2/broadcasts/{id}/state End a Broadcast Ends one of the authenticated user’s broadcasts. Only state: END is supported.

Parameters

String
required
id (path parameter).
Schemas.UpdateBroadcastStateRequest
required
Request payload.
Returns: Schemas.UpdateBroadcastStateResponse

updateScheduledBroadcast

PUT /2/broadcasts/scheduled/{id} Update a Scheduled Broadcast Updates a scheduled broadcast. Path :id is the broadcast id; the body must include scheduled_broadcast_id. Re-send every field that should be kept. Passing a stream key as source_id is deprecated and stops working when the /2/users/:id/sources and /2/users/:id/broadcasts routes reach end of life on January 1, 2027; pass the source’s id from GET /2/sources instead.

Parameters

String
required
id (path parameter).
Schemas.UpdateScheduledBroadcastRequest
required
Request payload.
Returns: Schemas.UpdateScheduledBroadcastResponse

updateSource

PUT /2/sources/{id} Rename a Stream Source Renames one of the authenticated user’s stream sources.

Parameters

String
required
Source id (19 digits), from GET /2/sources.
Schemas.UpdateSourceRequest
required
Request payload.
Returns: Schemas.UpdateSourceResponse

updateUserBroadcastState

PUT /2/users/{id}/broadcasts/{broadcast_id}/state Publish or End a User’s Broadcast Publishes or ends one of the authenticated user’s broadcasts. id must be the authenticated user. PUBLISH takes a broadcast created with POST /2/users/:id/broadcasts live once its source is receiving video, and posts it unless should_not_tweet is true. END ends the broadcast. Deprecated: use PUT /2/broadcasts/:id/state to end a broadcast.

Parameters

String
required
id (path parameter).
String
required
broadcast_id (path parameter).
Schemas.UpdateUserBroadcastStateRequest
required
Request payload.
Returns: Schemas.UpdateUserBroadcastStateResponse

updateUserSource

PUT /2/users/{id}/sources/{source_id} Rename a User’s Stream Source Renames one of the authenticated user’s stream sources. id must be the authenticated user.

Parameters

String
required
id (path parameter).
String
required
source_id (path parameter).
Schemas.UpdateUserSourceRequest
required
Request payload.
Returns: Schemas.UpdateUserSourceResponse