Telegram Bot icon

Telegram Bot

Interact with the Telegram Bot API – send messages, manage chats, handle payments, and more

Actions101

Chat → Unban Chat Member

AI-generated

Summary

Unbans a specified user from a chat, optionally skipping if the user is not banned.

Inputs

  • chat_id (required) — Unique identifier for the target chat or username (@channelusername)
  • user_id (required) — Unique identifier of the target user
  • unbanAdditionalFields — Additional fields specific to the unban operation, including an optional only_if_banned boolean to skip unbanning when the user is not banned.

Output shape

object indicating success, typically includes ok and may contain a result flag

The operation does not return detailed chat or user information; on success a standard Telegram API response is returned. If only_if_banned is true and the user is not banned, the node still returns a successful response with no side effects.

Examples

Example 1: Remove a user from a group after they were previously banned

chat_id: -1001234567890, user_id: 987654321, unbanAdditionalFields.only_if_banned: false

Example 2: Attempt to unban a user who is not banned, using only_if_banned

chat_id: 123456789, user_id: 987654321, unbanAdditionalFields.only_if_banned: true

Links

Discussion