Removes a member from a group or channel.

💡 Removing is temporary — the user can rejoin. To stop them coming back, use banChatMember instead.


Request

method is "removeChatMember".

Field Type Required Description
chat_id String Yes The group or channel to remove them from.
user_id String Yes The member to remove.
app_id String Yes The app the chat belongs to.
reference String Optional Your id for this request. Echoed back in the response.

Preconditions

Requirement Why
"Manage Chats" permission Needed to manage chats in the app.
"Remove Chat Members" permission Needed specifically to remove members.
Moderator or admin in the chat Removals require a privileged role in that chat.

Response

chatMember

The member record comes back with "status": "Removed".

Field Type Returned Description
method String Yes "chatMember"
chatMember Chat Member Yes The removed member's record, showing "status": "Removed".
app_id String Yes Echoed from the request.
reference String Optional Echoed from the request.

SDKs

SDK Call Callback
Java api.removeChatMember(chatId, userId, appId, reference); onChatMember(ChatMember chatMember)
JavaScript api.removeChatMember(chatId, userId, appId, reference); onChatMember(chatMember)
Python napi.remove_chat_member(chat_id=chat_id, user_id=user_id, app_id=app_id, reference=reference) on_chat_member(self, chat_member)

Example

Request

{
  "method": "removeChatMember",
  "chat_id": "90090684438172188",
  "user_id": "90089584789572153",
  "app_id": "90090684293000559",
  "reference": "123456789"
}
api.removeChatMember("90090684438172188", "90089584789572153", "90090684293000559", "123456789");
api.removeChatMember("90090684438172188", "90089584789572153", "90090684293000559", "123456789");
napi.remove_chat_member(chat_id="90090684438172188", user_id="90089584789572153", app_id="90090684293000559", reference="123456789")