Skip to main content

Create a WhatsApp group

With this endpoint, you will be able to create a new WhatsApp group in your account.

Parameters

These parameters should be sent as a JSON payload in the request body.

FieldDescriptionExample values
from_numberYour WhatsApp number that you connected to 2Chat+18647351567
group.nameA name for the group you are trying to createMy cool WhatsApp group
group.participantsA list of phone numbers you want to add to the group[ "+18647351567", "+17137157533"]

Invocation

curl -X POST --location 'https://api.p.2chat.io/open/whatsapp/group/create' \
--header 'Content-Type: application/json' \
--header 'X-User-API-Key: your_api_key_here' \
--data '{
"from_number": "+595981048477",
"group": {
"name": "My cool WhatsApp group",
"participants": [
"+17137157533",
"+18647351567"
]
}
}'

Response

info

After the group is created, it can take a few minutes for 2Chat to be able to see it and list it.

{
"success": true,
"group": {
"name": "My cool WhatsApp group",
"wa_group_id": "120363777777777777@g.us",
"participants":
{
"+595981048477": {
"statusCode": 200,
"message": "The participant was added successfully",
"isGroupCreator": true,
"isInviteV4Sent": false
},
"+17137157533": {
"statusCode": 200,
"message": "The participant was added successfully",
"isGroupCreator": false,
"isInviteV4Sent": false
},
"+18647351567": {
"statusCode": 200,
"message": "The participant was added successfully",
"isGroupCreator": false,
"isInviteV4Sent": false
}
},
"success": true
}
}