Skip to main content

Create a WhatsApp group

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

caution

WhatsApp has a non-published soft limit on the number of groups you can create in a time window.

Tests indicate that the limit may be 30 per day. After you reach that limit, attempting to create new groups will fail until the time window gets refreshed.

A few recommendations to follow:

  • Creating many groups will can be problematic. WhatsApp shadow bans numbers that create many groups and only the app will show you the exact error message when this happens.

  • When you get an error using this endpoint, try creating the group using WhatsApp Web or the app. It will likely also fail if the number has reached WhatsApp limits.

  • Don't rely on a single number as the sole administrator and owner of the group. Have backup numbers and build reputation using them from time to time.

  • WhatsApp groups are the #1 attack vector for spammers and people committing fraud on WhatsApp. Scrutinity has increased which will make using groups more difficult with people who don't have you saved as a contact.

  • Always ask participants of your groups to have your main numbers saved as a contact. Create an email campaign, send them a message asking them this, and only after that create the groups. This will decrease the error rates.

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.descriptionA description for the group being created. This value is optionalcool group
group.participantsA list of phone numbers you want to add to the group[ "+18647351567", "+17137157533"]
info

You can create the group with up to 10 participants. If you want to add more than this limit, you can call the Add Participant endpoint after the group is created.

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.

caution

Seeing unaccepted_numbers in the reply means that the numbers listed couldn't be added, either because they are invalid or because they don't have a WhatsApp account.

{
"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
}
},
"accepted_numbers": [
"+17137157533",
"+18647351567"
],
"unaccepted_numbers": [],
"uuid": "WAG62598186-d2bd-4946-86c6-30f8a3c849c6"
}
}