Method: liveChatBans.insert

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. For code examples, see liveChatBans.insert code snippets.

HTTP request

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

The URL uses gRPC Transcoding 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.