Skip to main content

Assign Categories

Method#

/business/categories#

POST https://api.z-api.io/instances/{{instanceId}}/token/{{instanceToken}}/business/categories

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

Through this method, it is possible to assign categories to the company.

Important

This method is only available for Business WhatsApp accounts.

Attention

It is possible to register a maximum of 3 categories for the company, and at least one is required.


Attributes#

Required#

AttributesTypeDescription
categoriesarray stringLabel of the category to be assigned

Request Body#

{
"categories": ["RESTAURANT", "FINANCE", "EDUCATION"]
}
Important

The values sent in the "categories" attribute must be identical to those returned in the "List Categories" request, under the "label" property. Only in this way is it possible to identify the desired category to be assigned.

Response#

201#

AttributesTypeDescription
successbooleantrue if successful, false in case of failure

Example

{
"success": true
}

405#

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

415#

If you receive a 415 error, make sure to add the "Content-Type" of the object you are sending in the request headers, in most cases, it should be "application/json".


Code#