Skip to content

CreateGroup Test#

The method is aimed for creating a group chat. When creating a group, it is required to simulate human work. It is required to create a group no more often than 1 group every 5 minutes.


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


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

Request parameters#

Parameter Type Mandatory Description
groupName string Yes New group chat name. The maximum field length is 100 characters
chatIds array Yes Collection of group participants Ids

Request body example#

    "groupName": "Group created by Green API",
    "chatIds": [


Response parameters#

Parameter Type Description
created boolean Group creation flag
chatId string Group chat Id
groupInviteLink string Group invitation link

Response body example#

    "created": true,
    "chatId": "",
    "groupInviteLink": ""

CreateGroup errors#

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

HTTP code Description
500 When using the CreateGroup method, the system may return an error. This error is returned by WhatsApp, it restricts the user to create a group. Try to create a group from a mobile device, you will get a warning: "Failed to create a Test group because you created too many groups very quickly. Try again later."

Request examples#

import requests

url = "{{apiUrl}}/waInstance{{idInstance}}/createGroup/{{apiTokenInstance}}"

payload = "{\r\n\t\"groupName\": \"Group created by Green API\",\r\n    \"chatIds\": [\r\n        \"\",\r\n        \"\"\r\n    ]\r\n}\r\n"
headers = {
  'Content-Type': 'application/json'

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

curl --location '{{apiUrl}}/waInstance{{idInstance}}/createGroup/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "groupName": "Group created by Green API TEST",
    "chatIds": [
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();

var headers = new HttpHeaders();

var jsonBody = "{\"groupName\":\"Group created by Green API TEST\",\"chatIds\":[\"\",\"\"]}";

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("{\"groupName\":\"Group created by Green API TEST\",\"chatIds\":[\"\",\"\"]}")

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

    ' The apiUrl, idInstance and apiTokenInstance values are available in console, double brackets must be removed
    url = "{{apiUrl}}/waInstance{{idInstance}}/createGroup/{{apiTokenInstance}}"

    ' groupName is the name of the new group chat, chatIds is a collection of group member IDs
    RequestBody = "{""groupName"":""Group created by Green API"",""chatIds"":["""",""""]}"

    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