Skip to main content

Create new tag

Method#

/business/create-tag#

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

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

This method allows you to create a new tag. When you create a tag, it becomes available for use when assigning it to a chat.

Important

This method is only available for WhatsApp Business accounts.

Attributes#

Required#

AttributesTypeDescription
namestringTag name

Optional#

AttributesTypeDescription
colornumberKey (index) of the desired color. This value must be set according to the available colors, which can be found in this API

Request Body#

{
"name": "Tag Name"
}
{
"name": "Tag Name",
"color": 1
}

Response#

200#

AttributesTypeDescription
idstringID of the created tag

Example

{
"id": "10"
}

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".


Code#