> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# BroadcastsClient

> Methods for X API v2 Broadcasts endpoints.

Access **Broadcasts** endpoints via `client.Broadcasts` (`BroadcastsClient`).

## Methods

| Method | Endpoint | Behavior | Summary |
| :- | :- | :- | :- |
| [`AddChatModeratorAsync`](#addchatmoderatorasync) | `POST /2/broadcasts/chat/moderators` | Standard | Add a Chat Moderator |
| [`CreateBroadcastAsync`](#createbroadcastasync) | `POST /2/broadcasts` | Standard | Go Live on a Source |
| [`CreateScheduledBroadcastAsync`](#createscheduledbroadcastasync) | `POST /2/broadcasts/scheduled` | Standard | Create a Scheduled Broadcast |
| [`CreateSourceAsync`](#createsourceasync) | `POST /2/sources` | Standard | Create a Stream Source |
| [`CreateUserBroadcastAsync`](#createuserbroadcastasync) | `POST /2/users/{id}/broadcasts` | Standard | Create a Broadcast on a User's Source |
| [`CreateUserSourceAsync`](#createusersourceasync) | `POST /2/users/{id}/sources` | Standard | Create a Stream Source for a User |
| [`DeleteBroadcastAsync`](#deletebroadcastasync) | `DELETE /2/broadcasts/{id}` | Standard | Delete a Broadcast |
| [`DeleteBroadcastChatMessageAsync`](#deletebroadcastchatmessageasync) | `DELETE /2/broadcasts/{id}/chat/{message_id}` | Standard | Remove a Chat Message from a Live Broadcast |
| [`DeleteScheduledBroadcastAsync`](#deletescheduledbroadcastasync) | `DELETE /2/broadcasts/scheduled/{id}` | Standard | Delete a Scheduled Broadcast |
| [`DeleteSourceAsync`](#deletesourceasync) | `DELETE /2/sources/{id}` | Standard | Delete a Stream Source |
| [`DeleteUserBroadcastAsync`](#deleteuserbroadcastasync) | `DELETE /2/users/{id}/broadcasts/{broadcast_id}` | Standard | Delete a User's Broadcast |
| [`DeleteUserSourceAsync`](#deleteusersourceasync) | `DELETE /2/users/{id}/sources/{source_id}` | Standard | Delete a User's Stream Source |
| [`GetBroadcastAsync`](#getbroadcastasync) | `GET /2/broadcasts/{id}` | Standard | Get a Broadcast |
| [`GetBroadcastChatAsync`](#getbroadcastchatasync) | `GET /2/broadcasts/{id}/chat` | Paginated | Get Broadcast Chat History |
| [`GetChatModeratorsAsync`](#getchatmoderatorsasync) | `GET /2/broadcasts/chat/moderators` | Standard | Get Chat Moderators |
| [`GetChatMutedUsersAsync`](#getchatmutedusersasync) | `GET /2/broadcasts/chat/mutes` | Paginated | Get Muted Chat Users |
| [`GetRegionAsync`](#getregionasync) | `GET /2/region` | Standard | Get the Ingest Region |
| [`GetScheduledBroadcastAsync`](#getscheduledbroadcastasync) | `GET /2/broadcasts/scheduled/{id}` | Standard | Get a Scheduled Broadcast |
| [`GetSourceAsync`](#getsourceasync) | `GET /2/sources/{id}` | Standard | Get a Stream Source |
| [`GetSourceStreamKeyAsync`](#getsourcestreamkeyasync) | `GET /2/sources/{id}/stream_key` | Standard | Get a Stream Source's Stream Key |
| [`GetUserBroadcastAsync`](#getuserbroadcastasync) | `GET /2/users/{id}/broadcasts/{broadcast_id}` | Standard | Get a User's Broadcast |
| [`GetUserSourceAsync`](#getusersourceasync) | `GET /2/users/{id}/sources/{source_id}` | Standard | Get a User's Stream Source |
| [`GoLiveScheduledBroadcastAsync`](#golivescheduledbroadcastasync) | `POST /2/broadcasts/scheduled/{id}/live` | Standard | Go Live on a Scheduled Broadcast |
| [`ListAsync`](#listasync) | `GET /2/broadcasts` | Paginated | List Broadcasts |
| [`ListLiveCategoriesAsync`](#listlivecategoriesasync) | `GET /2/broadcasts/categories` | Standard | List Live Categories |
| [`ListScheduledAsync`](#listscheduledasync) | `GET /2/broadcasts/scheduled` | Paginated | List Scheduled Broadcasts |
| [`ListSourcesAsync`](#listsourcesasync) | `GET /2/sources` | Standard | List Stream Sources |
| [`ListUserAsync`](#listuserasync) | `GET /2/users/{id}/broadcasts` | Paginated | List a User's Broadcasts |
| [`ListUserSourcesAsync`](#listusersourcesasync) | `GET /2/users/{id}/sources` | Standard | List a User's Stream Sources |
| [`MuteBroadcastChatUserAsync`](#mutebroadcastchatuserasync) | `POST /2/broadcasts/{id}/chat/mutes` | Standard | Mute or Time Out a User in a Broadcast Chat |
| [`MuteChatUserAsync`](#mutechatuserasync) | `POST /2/broadcasts/chat/mutes` | Standard | Mute or Time Out a User in Chat |
| [`RemoveChatModeratorAsync`](#removechatmoderatorasync) | `DELETE /2/broadcasts/chat/moderators/{user_id}` | Standard | Remove a Chat Moderator |
| [`SendBroadcastChatAsync`](#sendbroadcastchatasync) | `POST /2/broadcasts/{id}/chat` | Standard | Send a Chat Message to a Live Broadcast |
| [`UnmuteBroadcastChatUserAsync`](#unmutebroadcastchatuserasync) | `DELETE /2/broadcasts/{id}/chat/mutes/{user_id}` | Standard | Unmute a User in a Broadcast Chat |
| [`UnmuteChatUserAsync`](#unmutechatuserasync) | `DELETE /2/broadcasts/chat/mutes/{user_id}` | Standard | Unmute a User in Chat |
| [`UpdateBroadcastAsync`](#updatebroadcastasync) | `PUT /2/broadcasts/{id}` | Standard | Update a Broadcast |
| [`UpdateBroadcastStateAsync`](#updatebroadcaststateasync) | `PUT /2/broadcasts/{id}/state` | Standard | End a Broadcast |
| [`UpdateScheduledBroadcastAsync`](#updatescheduledbroadcastasync) | `PUT /2/broadcasts/scheduled/{id}` | Standard | Update a Scheduled Broadcast |
| [`UpdateSourceAsync`](#updatesourceasync) | `PUT /2/sources/{id}` | Standard | Rename a Stream Source |
| [`UpdateUserBroadcastStateAsync`](#updateuserbroadcaststateasync) | `PUT /2/users/{id}/broadcasts/{broadcast_id}/state` | Standard | Publish or End a User's Broadcast |
| [`UpdateUserSourceAsync`](#updateusersourceasync) | `PUT /2/users/{id}/sources/{source_id}` | Standard | Rename a User's Stream Source |

## `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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.AddChatModeratorAsync(new AddChatModeratorRequest { UserId = "2244994945" });
Console.WriteLine(response);
```

### Parameters

**body** `AddChatModeratorRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.CreateBroadcastAsync(new CreateBroadcastRequest { SourceId = "1895000000000000000" });
Console.WriteLine(response);
```

### Parameters

**body** `CreateBroadcastRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.CreateScheduledBroadcastAsync(
    new CreateScheduledBroadcastRequest { SourceId = "1895000000000000000", ScheduledStartMs = "example" }
);
Console.WriteLine(response);
```

### Parameters

**body** `CreateScheduledBroadcastRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.CreateSourceAsync(new CreateSourceRequest { Name = "My List", Region = "example" });
Console.WriteLine(response);
```

### Parameters

**body** `CreateSourceRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.CreateUserBroadcastAsync(
    "2244994945",
    new CreateUserBroadcastRequest { SourceId = "1895000000000000000" }
);
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**body** `CreateUserBroadcastRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.CreateUserSourceAsync("2244994945", new CreateUserSourceRequest { Name = "My List" });
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**body** `CreateUserSourceRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.DeleteBroadcastAsync("1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.DeleteBroadcastChatMessageAsync("1895000000000000000", "1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**messageId** `string` *required*

`message_id` (path parameter).

**Returns:** `Task<DeleteBroadcastChatMessageResponse>`

***

## `DeleteScheduledBroadcastAsync`

DELETE `/2/broadcasts/scheduled/{id}`

**Delete a Scheduled Broadcast**

Deletes a scheduled broadcast by its alphanumeric broadcast id.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.DeleteScheduledBroadcastAsync("1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**Optional parameters (BroadcastsClient.DeleteScheduledBroadcastOptions — 1)**

**options.RollForward** `bool`

Deprecated: recurring schedules are being retired and `true` will be rejected.

**Returns:** `Task<DeleteScheduledBroadcastResponse>`

***

## `DeleteSourceAsync`

DELETE `/2/sources/{id}`

**Delete a Stream Source**

Deletes one of the authenticated user's stream sources.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.DeleteSourceAsync("1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

Source id (19 digits), from GET /2/sources.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.DeleteUserBroadcastAsync("2244994945", "1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**broadcastId** `string` *required*

`broadcast_id` (path parameter).

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.DeleteUserSourceAsync("2244994945", "1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**sourceId** `string` *required*

`source_id` (path parameter).

**Returns:** `Task<DeleteUserSourceResponse>`

***

## `GetBroadcastAsync`

GET `/2/broadcasts/{id}`

**Get a Broadcast**

Returns a broadcast owned by the authenticated user.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.GetBroadcastAsync("1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**Optional parameters (BroadcastsClient.GetBroadcastOptions — 1)**

**options.BroadcastFields** `List\<string\>`

A comma separated list of Broadcast fields to display.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

await foreach (var page in client.Broadcasts.GetBroadcastChatPages("1895000000000000000"))
{
    Console.WriteLine(page);
}
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**Optional parameters (BroadcastsClient.GetBroadcastChatOptions — 5)**

**options.MaxResults** `int`

`max_results` (query parameter).

**options.PaginationToken** `string`

A 64-bit signed integer.

**options.BroadcastChatMessageFields** `List\<string\>`

A comma separated list of BroadcastChatMessage fields to display.

**options.Expansions** `List\<string\>`

A comma separated list of fields to expand.

**options.UserFields** `List\<string\>`

A comma separated list of User fields to display.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.GetChatModeratorsAsync();
Console.WriteLine(response);
```

### Parameters

**Optional parameters (BroadcastsClient.GetChatModeratorsOptions — 3)**

**options.UserFields** `List\<string\>`

A comma separated list of User fields to display.

**options.Expansions** `List\<string\>`

A comma separated list of fields to expand.

**options.PostFields** `List\<string\>`

A comma separated list of Post fields to display.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

await foreach (var page in client.Broadcasts.GetChatMutedUsersPages())
{
    Console.WriteLine(page);
}
```

### Parameters

**Optional parameters (BroadcastsClient.GetChatMutedUsersOptions — 5)**

**options.MaxResults** `int`

`max_results` (query parameter).

**options.PaginationToken** `string`

`pagination_token` (query parameter).

**options.BroadcastChatMuteFields** `List\<string\>`

A comma separated list of BroadcastChatMute fields to display.

**options.Expansions** `List\<string\>`

A comma separated list of fields to expand.

**options.UserFields** `List\<string\>`

A comma separated list of User fields to display.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.GetRegionAsync();
Console.WriteLine(response);
```

**Returns:** `Task<GetRegionResponse>`

***

## `GetScheduledBroadcastAsync`

GET `/2/broadcasts/scheduled/{id}`

**Get a Scheduled Broadcast**

Returns a single scheduled broadcast by its alphanumeric broadcast id.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.GetScheduledBroadcastAsync("1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.GetSourceAsync("1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

Source id (19 digits), from GET /2/sources.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.GetSourceStreamKeyAsync("1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

Source id (19 digits), from GET /2/sources.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.GetUserBroadcastAsync("2244994945", "1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**broadcastId** `string` *required*

`broadcast_id` (path parameter).

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.GetUserSourceAsync("2244994945", "1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**sourceId** `string` *required*

`source_id` (path parameter).

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.GoLiveScheduledBroadcastAsync("1895000000000000000");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

await foreach (var page in client.Broadcasts.ListPages())
{
    Console.WriteLine(page);
}
```

### Parameters

**Optional parameters (BroadcastsClient.ListOptions — 4)**

**options.Ids** `List\<string\>`

Comma-separated broadcast IDs to retrieve instead of listing broadcasts.

**options.MaxResults** `int`

`max_results` (query parameter).

**options.PaginationToken** `string`

`pagination_token` (query parameter).

**options.BroadcastFields** `List\<string\>`

A comma separated list of Broadcast fields to display.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    BearerToken = Environment.GetEnvironmentVariable("X_BEARER_TOKEN"),
});

var response = await client.Broadcasts.ListLiveCategoriesAsync();
Console.WriteLine(response);
```

**Returns:** `Task<ListLiveCategoriesResponse>`

***

## `ListScheduledAsync`

GET `/2/broadcasts/scheduled` Paginated

**List Scheduled Broadcasts**

Returns scheduled broadcasts owned by the authenticated user.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

await foreach (var page in client.Broadcasts.ListScheduledPages())
{
    Console.WriteLine(page);
}
```

### Parameters

**Optional parameters (BroadcastsClient.ListScheduledOptions — 4)**

**options.MaxResults** `int`

`max_results` (query parameter).

**options.OldestStartTime** `string`

`oldest_start_time` (query parameter).

**options.NewestStartTime** `string`

`newest_start_time` (query parameter).

**options.PaginationToken** `string`

`pagination_token` (query parameter).

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.ListSourcesAsync();
Console.WriteLine(response);
```

**Returns:** `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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

await foreach (var page in client.Broadcasts.ListUserPages("2244994945"))
{
    Console.WriteLine(page);
}
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**Optional parameters (BroadcastsClient.ListUserOptions — 1)**

**options.PaginationToken** `string`

`next_token.offset` from the previous page. Empty reads the first page.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.ListUserSourcesAsync("2244994945");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.MuteBroadcastChatUserAsync(
    "1895000000000000000",
    new MuteBroadcastChatUserRequest { UserId = "2244994945" }
);
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**body** `MuteBroadcastChatUserRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.MuteChatUserAsync(new MuteChatUserRequest { UserId = "2244994945" });
Console.WriteLine(response);
```

### Parameters

**body** `MuteChatUserRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.RemoveChatModeratorAsync("2244994945");
Console.WriteLine(response);
```

### Parameters

**userId** `string` *required*

A 64-bit signed integer.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.SendBroadcastChatAsync(
    "1895000000000000000",
    new SendBroadcastChatRequest { Text = "Hello from XDK!" }
);
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**body** `SendBroadcastChatRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.UnmuteBroadcastChatUserAsync("1895000000000000000", "2244994945");
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**userId** `string` *required*

A 64-bit signed integer.

**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.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.UnmuteChatUserAsync("2244994945");
Console.WriteLine(response);
```

### Parameters

**userId** `string` *required*

A 64-bit signed integer.

**Optional parameters (BroadcastsClient.UnmuteChatUserOptions — 1)**

**options.BroadcastId** `string`

A broadcast whose host's chats the user is unmuted in.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.UpdateBroadcastAsync("1895000000000000000", new UpdateBroadcastRequest { ChatOption = 1 });
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**body** `UpdateBroadcastRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.UpdateBroadcastStateAsync(
    "1895000000000000000",
    new UpdateBroadcastStateRequest { State = "example" }
);
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**body** `UpdateBroadcastStateRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.UpdateScheduledBroadcastAsync(
    "1895000000000000000",
    new UpdateScheduledBroadcastRequest { ScheduledBroadcastId = "1895000000000000000", ScheduledStartMs = "example", ScheduledEndMs = "example" }
);
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**body** `UpdateScheduledBroadcastRequest` *required*

Request payload.

**Returns:** `Task<UpdateScheduledBroadcastResponse>`

***

## `UpdateSourceAsync`

PUT `/2/sources/{id}`

**Rename a Stream Source**

Renames one of the authenticated user's stream sources.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.UpdateSourceAsync("1895000000000000000", new UpdateSourceRequest { Name = "My List" });
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

Source id (19 digits), from GET /2/sources.

**body** `UpdateSourceRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.UpdateUserBroadcastStateAsync(
    "2244994945",
    "1895000000000000000",
    new UpdateUserBroadcastStateRequest { State = "example" }
);
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**broadcastId** `string` *required*

`broadcast_id` (path parameter).

**body** `UpdateUserBroadcastStateRequest` *required*

Request payload.

**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.

```csharp theme={null}
using System;
using Xdk;
using Xdk.Models;

using var client = new XClient(new XClientOptions
{
    AccessToken = Environment.GetEnvironmentVariable("X_ACCESS_TOKEN"),
});

var response = await client.Broadcasts.UpdateUserSourceAsync(
    "2244994945",
    "1895000000000000000",
    new UpdateUserSourceRequest { Name = "My List" }
);
Console.WriteLine(response);
```

### Parameters

**id** `string` *required*

`id` (path parameter).

**sourceId** `string` *required*

`source_id` (path parameter).

**body** `UpdateUserSourceRequest` *required*

Request payload.

**Returns:** `Task<UpdateUserSourceResponse>`

***
