client.Broadcasts (BroadcastsClient).
Methods
AddChatModeratorAsync
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
Returns:Task<AddChatModeratorResponse>
CreateBroadcastAsync
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
Returns:Task<CreateBroadcastResponse>
CreateScheduledBroadcastAsync
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
Returns:Task<CreateScheduledBroadcastResponse>
CreateSourceAsync
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
Returns:Task<CreateSourceResponse>
CreateUserBroadcastAsync
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
Returns:Task<CreateUserBroadcastResponse>
CreateUserSourceAsync
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
Returns:Task<CreateUserSourceResponse>
DeleteBroadcastAsync
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
Returns:Task<DeleteBroadcastResponse>
DeleteBroadcastChatMessageAsync
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
Returns:Task<DeleteBroadcastChatMessageResponse>
DeleteScheduledBroadcastAsync
DELETE /2/broadcasts/scheduled/{id}
Delete a Scheduled Broadcast
Deletes a scheduled broadcast by its alphanumeric broadcast id.
Parameters
Returns:Task<DeleteScheduledBroadcastResponse>
DeleteSourceAsync
DELETE /2/sources/{id}
Delete a Stream Source
Deletes one of the authenticated user’s stream sources.
Parameters
Returns:Task<DeleteSourceResponse>
DeleteUserBroadcastAsync
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
Returns:Task<DeleteUserBroadcastResponse>
DeleteUserSourceAsync
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
Returns:Task<DeleteUserSourceResponse>
GetBroadcastAsync
GET /2/broadcasts/{id}
Get a Broadcast
Returns a broadcast owned by the authenticated user.
Parameters
Returns:Task<GetBroadcastResponse>
GetBroadcastChatAsync
GET /2/broadcasts/{id}/chat Paginated
Get Broadcast Chat History
Returns newest-first chat messages for a broadcast owned by the authenticated user.
Parameters
Returns:Task<GetBroadcastChatResponse> (use GetBroadcastChatPages(...) for IAsyncEnumerable page iteration)
GetChatModeratorsAsync
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:Task<GetChatModeratorsResponse>
GetChatMutedUsersAsync
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:Task<GetChatMutedUsersResponse> (use GetChatMutedUsersPages(...) for IAsyncEnumerable page iteration)
GetRegionAsync
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.
Task<GetRegionResponse>
GetScheduledBroadcastAsync
GET /2/broadcasts/scheduled/{id}
Get a Scheduled Broadcast
Returns a single scheduled broadcast by its alphanumeric broadcast id.
Parameters
Returns:Task<GetScheduledBroadcastResponse>
GetSourceAsync
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
Returns:Task<GetSourceResponse>
GetSourceStreamKeyAsync
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
Returns:Task<GetSourceStreamKeyResponse>
GetUserBroadcastAsync
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
Returns:Task<GetUserBroadcastResponse>
GetUserSourceAsync
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
Returns:Task<GetUserSourceResponse>
GoLiveScheduledBroadcastAsync
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
Returns:Task<GoLiveScheduledBroadcastResponse>
ListAsync
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:Task<ListBroadcastsResponse> (use ListPages(...) for IAsyncEnumerable page iteration)
ListLiveCategoriesAsync
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.
Task<ListLiveCategoriesResponse>
ListScheduledAsync
GET /2/broadcasts/scheduled Paginated
List Scheduled Broadcasts
Returns scheduled broadcasts owned by the authenticated user.
Parameters
Returns:Task<ListScheduledBroadcastsResponse> (use ListScheduledPages(...) for IAsyncEnumerable page iteration)
ListSourcesAsync
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.
Task<ListSourcesResponse>
ListUserAsync
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
Returns:Task<ListUserBroadcastsResponse> (use ListUserPages(...) for IAsyncEnumerable page iteration)
ListUserSourcesAsync
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
Returns:Task<ListUserSourcesResponse>
MuteBroadcastChatUserAsync
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
Returns:Task<MuteBroadcastChatUserResponse>
MuteChatUserAsync
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
Returns:Task<MuteChatUserResponse>
RemoveChatModeratorAsync
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
Returns:Task<RemoveChatModeratorResponse>
SendBroadcastChatAsync
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
Returns:Task<SendBroadcastChatResponse>
UnmuteBroadcastChatUserAsync
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
Returns:Task<UnmuteBroadcastChatUserResponse>
UnmuteChatUserAsync
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
Returns:Task<UnmuteChatUserResponse>
UpdateBroadcastAsync
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
Returns:Task<UpdateBroadcastResponse>
UpdateBroadcastStateAsync
PUT /2/broadcasts/{id}/state
End a Broadcast
Ends one of the authenticated user’s broadcasts. Only state: END is supported.
Parameters
Returns:Task<UpdateBroadcastStateResponse>
UpdateScheduledBroadcastAsync
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
Returns:Task<UpdateScheduledBroadcastResponse>
UpdateSourceAsync
PUT /2/sources/{id}
Rename a Stream Source
Renames one of the authenticated user’s stream sources.
Parameters
Returns:Task<UpdateSourceResponse>
UpdateUserBroadcastStateAsync
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
Returns:Task<UpdateUserBroadcastStateResponse>
UpdateUserSourceAsync
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
Returns:Task<UpdateUserSourceResponse>