Skip to content


The method makes the current account user leave the group chat.


To leave a group chat, you have to execute a request at:

POST {{APIUrl}}/waInstance{{idInstance}}/leaveGroup/{{apiTokenInstance}}

For APIUrl, idInstance and apiTokenInstance request parameters, refer to Before you start section.

Request parameters#

Parameter Type Mandatory Description
groupId string Yes Group chat Id, which you'd like to leave.

Request body example#

    "groupId": ""


Response parameters#

Parameter Type Description
leaveGroup boolean Leave group flag

Response body example#

    "leaveGroup": true

LeaveGroup errors#

For a list of errors common to all methods, refer to Common errors section

Request examples#

import requests

url = "{{idInstance}}/leaveGroup/{{apiTokenInstance}}"

payload = "{\r\n    \"groupId\": \"\"\r\n}"
headers = {
  'Content-Type': 'application/json'

response = requests.request("POST", url, headers=headers, data = payload)

curl --location '{{APIUrl}}/waInstance{{idInstance}}/leaveGroup/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "groupId": ""
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();

var headers = new HttpHeaders();

var jsonBody = "{\"groupId\": \"\"}";

var requestEntity = new HttpEntity<>(jsonBody, headers);

var response =, HttpMethod.POST, requestEntity, String.class);
var requestUrl = new StringBuilder();

var response =
    .header("Content-Type", "application/json")
    .body("{\"groupId\": \"\"}")

Sub LeaveGroup()
    Dim url As String
    Dim RequestBody As String
    Dim http As Object
    Dim response As String

    ' The idInstance and apiTokenInstance values are available in your account, double brackets must be removed
    url = "{{APIUrl}}/waInstance{{idInstance}}/leaveGroup/{{apiTokenInstance}}"

    ' groupId - ID of the group chat you want to leave
    RequestBody = "{""groupId"":""""}"

    Set http = CreateObject("MSXML2.XMLHTTP")

    With http
        .Open "POST", url, False
        .setRequestHeader "Content-Type", "application/json"
        .Send RequestBody
    End With

    response = http.responseText

    Debug.Print response

    ' Outputting the answer to the desired cell
    Range("A1").Value = response

    Set http = Nothing
End Sub