Skip to content

banChatSenderChat

Ban a channel from sending messages in a chat.

Request

POST /:token/banchatsenderchat

Parameters

ParameterTypeRequiredDescription
chat_idInteger/StringYesUnique identifier or username of the target chat
sender_chat_idIntegerYesUnique identifier of the channel to be banned

Response

Returns Boolean true on success.

json
{
  "ok": true,
  "result": true
}

Error Codes

CodeDescription
400Bad request parameters, such as missing chat_id or sender_chat_id
401Invalid or expired token
403Bot does not have administrator privileges or permission to ban channels
404Chat or channel not found
500Internal server error

Example

cURL

bash
curl -X POST "https://api.example.com/<token>/banchatsenderchat" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": -1001234567890,
    "sender_chat_id": -1009876543210
  }'