> ## 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 |
| :- | :- | :- | :- |
| [`addChatModerator`](#addchatmoderator) | `POST /2/broadcasts/chat/moderators` | Standard | Add a Chat Moderator |
| [`createBroadcast`](#createbroadcast) | `POST /2/broadcasts` | Standard | Go Live on a Source |
| [`createScheduledBroadcast`](#createscheduledbroadcast) | `POST /2/broadcasts/scheduled` | Standard | Create a Scheduled Broadcast |
| [`createSource`](#createsource) | `POST /2/sources` | Standard | Create a Stream Source |
| [`createUserBroadcast`](#createuserbroadcast) | `POST /2/users/{id}/broadcasts` | Standard | Create a Broadcast on a User's Source |
| [`createUserSource`](#createusersource) | `POST /2/users/{id}/sources` | Standard | Create a Stream Source for a User |
| [`deleteBroadcast`](#deletebroadcast) | `DELETE /2/broadcasts/{id}` | Standard | Delete a Broadcast |
| [`deleteBroadcastChatMessage`](#deletebroadcastchatmessage) | `DELETE /2/broadcasts/{id}/chat/{message_id}` | Standard | Remove a Chat Message from a Live Broadcast |
| [`deleteScheduledBroadcast`](#deletescheduledbroadcast) | `DELETE /2/broadcasts/scheduled/{id}` | Standard | Delete a Scheduled Broadcast |
| [`deleteSource`](#deletesource) | `DELETE /2/sources/{id}` | Standard | Delete a Stream Source |
| [`deleteUserBroadcast`](#deleteuserbroadcast) | `DELETE /2/users/{id}/broadcasts/{broadcast_id}` | Standard | Delete a User's Broadcast |
| [`deleteUserSource`](#deleteusersource) | `DELETE /2/users/{id}/sources/{source_id}` | Standard | Delete a User's Stream Source |
| [`getBroadcast`](#getbroadcast) | `GET /2/broadcasts/{id}` | Standard | Get a Broadcast |
| [`getBroadcastChat`](#getbroadcastchat) | `GET /2/broadcasts/{id}/chat` | Paginated | Get Broadcast Chat History |
| [`getChatModerators`](#getchatmoderators) | `GET /2/broadcasts/chat/moderators` | Standard | Get Chat Moderators |
| [`getChatMutedUsers`](#getchatmutedusers) | `GET /2/broadcasts/chat/mutes` | Paginated | Get Muted Chat Users |
| [`getRegion`](#getregion) | `GET /2/region` | Standard | Get the Ingest Region |
| [`getScheduledBroadcast`](#getscheduledbroadcast) | `GET /2/broadcasts/scheduled/{id}` | Standard | Get a Scheduled Broadcast |
| [`getSource`](#getsource) | `GET /2/sources/{id}` | Standard | Get a Stream Source |
| [`getSourceStreamKey`](#getsourcestreamkey) | `GET /2/sources/{id}/stream_key` | Standard | Get a Stream Source's Stream Key |
| [`getUserBroadcast`](#getuserbroadcast) | `GET /2/users/{id}/broadcasts/{broadcast_id}` | Standard | Get a User's Broadcast |
| [`getUserSource`](#getusersource) | `GET /2/users/{id}/sources/{source_id}` | Standard | Get a User's Stream Source |
| [`goLiveScheduledBroadcast`](#golivescheduledbroadcast) | `POST /2/broadcasts/scheduled/{id}/live` | Standard | Go Live on a Scheduled Broadcast |
| [`list`](#list) | `GET /2/broadcasts` | Paginated | List Broadcasts |
| [`listLiveCategories`](#listlivecategories) | `GET /2/broadcasts/categories` | Standard | List Live Categories |
| [`listScheduled`](#listscheduled) | `GET /2/broadcasts/scheduled` | Paginated | List Scheduled Broadcasts |
| [`listSources`](#listsources) | `GET /2/sources` | Standard | List Stream Sources |
| [`listUser`](#listuser) | `GET /2/users/{id}/broadcasts` | Paginated | List a User's Broadcasts |
| [`listUserSources`](#listusersources) | `GET /2/users/{id}/sources` | Standard | List a User's Stream Sources |
| [`muteBroadcastChatUser`](#mutebroadcastchatuser) | `POST /2/broadcasts/{id}/chat/mutes` | Standard | Mute or Time Out a User in a Broadcast Chat |
| [`muteChatUser`](#mutechatuser) | `POST /2/broadcasts/chat/mutes` | Standard | Mute or Time Out a User in Chat |
| [`removeChatModerator`](#removechatmoderator) | `DELETE /2/broadcasts/chat/moderators/{user_id}` | Standard | Remove a Chat Moderator |
| [`sendBroadcastChat`](#sendbroadcastchat) | `POST /2/broadcasts/{id}/chat` | Standard | Send a Chat Message to a Live Broadcast |
| [`unmuteBroadcastChatUser`](#unmutebroadcastchatuser) | `DELETE /2/broadcasts/{id}/chat/mutes/{user_id}` | Standard | Unmute a User in a Broadcast Chat |
| [`unmuteChatUser`](#unmutechatuser) | `DELETE /2/broadcasts/chat/mutes/{user_id}` | Standard | Unmute a User in Chat |
| [`updateBroadcast`](#updatebroadcast) | `PUT /2/broadcasts/{id}` | Standard | Update a Broadcast |
| [`updateBroadcastState`](#updatebroadcaststate) | `PUT /2/broadcasts/{id}/state` | Standard | End a Broadcast |
| [`updateScheduledBroadcast`](#updatescheduledbroadcast) | `PUT /2/broadcasts/scheduled/{id}` | Standard | Update a Scheduled Broadcast |
| [`updateSource`](#updatesource) | `PUT /2/sources/{id}` | Standard | Rename a Stream Source |
| [`updateUserBroadcastState`](#updateuserbroadcaststate) | `PUT /2/users/{id}/broadcasts/{broadcast_id}/state` | Standard | Publish or End a User's Broadcast |
| [`updateUserSource`](#updateusersource) | `PUT /2/users/{id}/sources/{source_id}` | Standard | Rename a User's Stream Source |

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().addChatModerator(new Schemas.AddChatModeratorRequest().userId("2244994945"));
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().createBroadcast(new Schemas.CreateBroadcastRequest().sourceId("1895000000000000000"));
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().createScheduledBroadcast(
    new Schemas.CreateScheduledBroadcastRequest().sourceId("1895000000000000000").scheduledStartMs("example")
);
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().createSource(new Schemas.CreateSourceRequest().name("My List").region("example"));
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().createUserBroadcast(
    "2244994945",
    new Schemas.CreateUserBroadcastRequest().sourceId("1895000000000000000")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().createUserSource("2244994945", new Schemas.CreateUserSourceRequest().name("My List"));
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().deleteBroadcast("1895000000000000000");
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().deleteBroadcastChatMessage("1895000000000000000", "1895000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().deleteScheduledBroadcast("1895000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

**options.rollForward** `Boolean`

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

**Returns:** `Schemas.DeleteScheduledBroadcastResponse`

***

## `deleteSource`

DELETE `/2/sources/{id}`

**Delete a Stream Source**

Deletes one of the authenticated user's stream sources.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().deleteSource("1895000000000000000");
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().deleteUserBroadcast("2244994945", "1895000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().deleteUserSource("2244994945", "1895000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().getBroadcast("1895000000000000000");
System.out.println(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:** `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.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.broadcasts().getBroadcastChatPages("1895000000000000000")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

**options.maxResults** `Integer`

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().getChatModerators();
System.out.println(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:** `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.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.broadcasts().getChatMutedUsersPages()) {
    System.out.println(page);
}
```

### Parameters

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

**options.maxResults** `Integer`

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().getRegion();
System.out.println(response);
```

**Returns:** `Schemas.GetRegionResponse`

***

## `getScheduledBroadcast`

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

**Get a Scheduled Broadcast**

Returns a single scheduled broadcast by its alphanumeric broadcast id.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().getScheduledBroadcast("1895000000000000000");
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().getSource("1895000000000000000");
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().getSourceStreamKey("1895000000000000000");
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().getUserBroadcast("2244994945", "1895000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().getUserSource("2244994945", "1895000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().goLiveScheduledBroadcast("1895000000000000000");
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.broadcasts().listPages()) {
    System.out.println(page);
}
```

### Parameters

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

**options.ids** `List\<String\>`

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

**options.maxResults** `Integer`

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.broadcasts().listLiveCategories();
System.out.println(response);
```

**Returns:** `Schemas.ListLiveCategoriesResponse`

***

## `listScheduled`

GET `/2/broadcasts/scheduled` Paginated

**List Scheduled Broadcasts**

Returns scheduled broadcasts owned by the authenticated user.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.broadcasts().listScheduledPages()) {
    System.out.println(page);
}
```

### Parameters

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

**options.maxResults** `Integer`

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().listSources();
System.out.println(response);
```

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.broadcasts().listUserPages("2244994945")) {
    System.out.println(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:** `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.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().listUserSources("2244994945");
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().muteBroadcastChatUser(
    "1895000000000000000",
    new Schemas.MuteBroadcastChatUserRequest().userId("2244994945")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().muteChatUser(new Schemas.MuteChatUserRequest().userId("2244994945"));
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().removeChatModerator("2244994945");
System.out.println(response);
```

### Parameters

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().sendBroadcastChat(
    "1895000000000000000",
    new Schemas.SendBroadcastChatRequest().text("Hello from XDK!")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().unmuteBroadcastChatUser("1895000000000000000", "2244994945");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().unmuteChatUser("2244994945");
System.out.println(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:** `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.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().updateBroadcast(
    "1895000000000000000",
    new Schemas.UpdateBroadcastRequest().chatOption(1)
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().updateBroadcastState(
    "1895000000000000000",
    new Schemas.UpdateBroadcastStateRequest().state("example")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().updateScheduledBroadcast(
    "1895000000000000000",
    new Schemas.UpdateScheduledBroadcastRequest().scheduledBroadcastId("1895000000000000000").scheduledStartMs("example").scheduledEndMs("example")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().updateSource(
    "1895000000000000000",
    new Schemas.UpdateSourceRequest().name("My List")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

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

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().updateUserBroadcastState(
    "2244994945",
    "1895000000000000000",
    new Schemas.UpdateUserBroadcastStateRequest().state("example")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**broadcastId** `String` *required*

`broadcast_id` (path parameter).

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

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.broadcasts().updateUserSource(
    "2244994945",
    "1895000000000000000",
    new Schemas.UpdateUserSourceRequest().name("My List")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**sourceId** `String` *required*

`source_id` (path parameter).

**body** `Schemas.UpdateUserSourceRequest` *required*

Request payload.

**Returns:** `Schemas.UpdateUserSourceResponse`

***
