Skip to main content

Create community

Method#

/create-group#

POST https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/communities

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

Before using this feature, it's important to check if the WhatsApp application on your mobile phone already supports communities. If it's available, you can use this API to create new communities.

Attributes#

Required#

AttributeTypeDescription
namestringName of the community you want to create

Optional#

AttributeTypeDescription
descriptionstringDescription of the community

Request Body#

Method

POST https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/communities

Example

{
"name": "My first community"
}

Response#

200#

AttributeTypeDescription
idstringID of the created community
subGroupsarray[subgroup]List of linked groups

Exemplo

{
"id": "98372465382764532938",
"subGroups": [
{
"name": "My first community",
"phone": "342532456234453-group",
"isGroupAnnouncement": true
}
]
}

405#

In this case certify that you are sending the correct specification of the method. This means, verify if you sent a POST or GET as specified at the beginning of this topic.

415#

In case you receive 415 error, make sure to add the “Content-Type” of the object you are sending in the request headers, mostly “application/json”


Code#