- [HTTP request](https://developers.google.com/youtube/data/reference/rest/v3/liveChatBans/insert.md.txt#body.HTTP_TEMPLATE)
- [Query parameters](https://developers.google.com/youtube/data/reference/rest/v3/liveChatBans/insert.md.txt#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/youtube/data/reference/rest/v3/liveChatBans/insert.md.txt#body.request_body)
- [Response body](https://developers.google.com/youtube/data/reference/rest/v3/liveChatBans/insert.md.txt#body.response_body)
- [Authorization scopes](https://developers.google.com/youtube/data/reference/rest/v3/liveChatBans/insert.md.txt#body.aspect)
- [Try it!](https://developers.google.com/youtube/data/reference/rest/v3/liveChatBans/insert.md.txt#try-it)

Bans a specific user from participating in a live chat. The API request must be authorized by the channel owner or a moderator of the live chat associated with the ban. Standard moderators can't ban the channel owner, themselves, or any other moderator. Managing moderators can issue `temporary` (but not `permanent`) bans against standard moderators, and can't ban the channel owner, themselves, or another managing moderator.

In the `liveChatBan` request body, specify values for `snippet.liveChatId`, `snippet.type` (`permanent` or `temporary`), and `snippet.bannedUserDetails.channelId`. You can optionally set `snippet.banDurationSeconds` for `temporary` bans (defaults to `300`, maximum `86400`). For method-specific error responses, see [liveChatBans.insert errors](https://developers.google.com/youtube/data/reference/rest/v3/errors.md.txt#liveChatBans_youtube.liveChatBans.insert). For code examples, see [liveChatBans.insert code snippets](https://developers.google.com/youtube/data/code_samples/code_snippets.md.txt?method=liveChatBans.insert).

### HTTP request

`POST https://youtube.googleapis.com/youtube/v3/liveChat/bans`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Query parameters

| Parameters ||
|---|---|
| `part[]` | `string` Required. Serves two purposes in this operation: identifies the properties that the write operation sets and the properties that the API response returns. Set the parameter value to `snippet`. |

### Request body

The request body contains an instance of `LiveChatBan`.

### Response body

If successful, the response body contains a newly created instance of `LiveChatBan`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/youtube`
- `https://www.googleapis.com/auth/youtube.force-ssl`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).