RemoveGroupParticipant#
Beta version
The functionality is in beta. Features may change and may also work unstably.
The method deletes a participant from a group chat.
An admin of the group can delete participants. There is no need to delete yourself by this method - to leave a group there is LeaveGroup.
The method uses the limits on the number of requests per second.
Request#
To delete a participant, you have to execute a request at:
POST
{{apiUrl}}/waInstance{{idInstance}}/removeGroupParticipant/{{apiTokenInstance}}
For apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.
Request parameters#
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
chatId | string | Yes | The identifier of the group chat |
participantChatId | string | Yes | The numeric identifier of the participant being deleted or a username with the @ prefix |
Request body example#
{
"chatId": "340282366841710300949128174631143137232",
"participantChatId": "25025320"
}
Response#
Response parameters#
| Field | Type | Description |
|---|---|---|
removeParticipant | boolean | The flag of the participant being deleted |
Response body example#
{
"removeParticipant": true
}
RemoveGroupParticipant errors#
For a list of errors common to all methods, refer to the Common errors section
| HTTP code | Error ID | Description |
|---|---|---|
| 400 | Bad Request Validation failed | Validation error |
| 200 | "removeParticipant": false | The participant is not deleted: Instagram rejected the request. Possible reasons: - the group is not found - the participantChatId account is not found in Instagram, is deactivated or blocked - the instance account has no rights for this action in the group |
Request examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/removeGroupParticipant/{{apiTokenInstance}}"
payload = {
"chatId": "340282366841710300949128174631143137232",
"participantChatId": "25025320"
}
headers = {'Content-Type': 'application/json'}
response = requests.post(url, json=payload, headers=headers)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/removeGroupParticipant/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"chatId": "340282366841710300949128174631143137232",
"participantChatId": "25025320"
}'