Assign Categories
Method#
/business/categories#
POST https://api.z-api.io/instances/{{instanceId}}/token/{{instanceToken}}/business/categories
Header#
| Key | Value |
|---|---|
| Client-Token | ACCOUNT SECURITY TOKEN |
Concept#
This method allows you to assign categories to a business/company.
Important
This method is only available for WhatsApp Business accounts.
Warning
You can register up to 3 categories for the business, and at least one is required.
Attributes#
Mandatory#
| Attributes | Type | Description |
|---|---|---|
| categories | array string | ID or label of the category to be assigned. Can be obtained from the List Categories API |
Request Body#
Important
The values sent in the "categories" attribute must be identical to those returned in the "List Categories" request, in the "id" or "label" property. The "id" property is useful when the "label" is not returned. Only this way can the desired category be identified for assignment.
Response#
201#
| Attributes | Type | Description |
|---|---|---|
| success | boolean | true if successful, false otherwise |
Example
405#
In this case, make sure you are correctly sending the method specification, i.e., check if you sent 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" header to the request object you are sending, which in most cases is "application/json".