LeaveGroup#
Beta version
The functionality is in beta. Features may change and may also work unstably.
The method makes the authorized account leave a group chat.
The method uses the limits on the number of requests per second.
Request#
To leave a group, you have to execute a request at:
POST
{{apiUrl}}/waInstance{{idInstance}}/leaveGroup/{{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 |
Request body example#
{
"chatId": "340282366841710300949128174631143137232"
}
Response#
Response parameters#
| Field | Type | Description |
|---|---|---|
leaveGroup | boolean | The flag of leaving the group |
Response body example#
{
"leaveGroup": true
}
LeaveGroup 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 | "leaveGroup": false | The account has not left the group: Instagram rejected the request, for example the group is not found |
Request examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/leaveGroup/{{apiTokenInstance}}"
payload = {"chatId": "340282366841710300949128174631143137232"}
headers = {'Content-Type': 'application/json'}
response = requests.post(url, json=payload, headers=headers)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/leaveGroup/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{"chatId": "340282366841710300949128174631143137232"}'