Skip to main content

Community settings

Method#

/communities/settings#

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

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

With this API, you can change the settings of a community.

Attributes#

Required#

AttributesTypeDescription
communityIdstringID of the community whose settings will be changed
whoCanAddNewGroupsstring ("admins" or "all")Configuration for who can add new groups to this community. Only admins or everyone

Request Body#

URL#

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

Body#

{
"communityId": "98372465382764532938",
"whoCanAddNewGroups": "admins" | "all"
}

Response#

200#

AttributesTypeDescription
successbooleantrue if successful, false if failed

Example

{
"success": true
}

405#

In this case, ensure that you are correctly sending the method specification, i.e., verify if you sent POST or GET as specified at the beginning of this topic.

415#

If you receive a 415 error, ensure to add the "Content-Type" header to the request object you are sending, which in most cases is "application/json".


Code#