Skip to main content

Chat expiration

Method#

POST /send-chat-expiration#

POST https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/send-chat-expiration

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

This method is responsible for sending chat expiration.

Attributes#

Required#

AttributeTypeDescription
phoneintegerPhone number you want to set chat expiration for in YOUR chat
chatExpirationstringAttribute to send chat expiration

Request Body#

Example

{
"phone": "554497050785",
"chatExpiration": "90_DAYS"
}

Options of chatExpiration: "24_HOURS", "7_DAYS", "90_DAYS", "OFF"


Response#

200#

AttributesTypeDescription
valuebooleanAction confirmation attribute

Example

{
"value": 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#