Skip to main content

Message status

Concept#

This is the message status return webhook

Attention

Z-API does not accept webhooks that aren’t HTTPS


Updating the Webhook#

To update the webhook route, you can do it through the API or through the admin panel.

API#

/update-webhook-status#

PUT https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/update-webhook-message-status

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Request Body#

{
"value": "https://endereco-do-seu-sistema.com.br/instancia/SUA_INSTANCIA/status"
}

Administrative panel#

img


Webhook’s returns#

The possible returns of the on-whatsapp-message-status-changes webhook are registered below:

Response#

AttributesTypeDescription
statusstringMessage status (SENT - if sent, RECEIVED - if received, READ - if read, READ-SELF - read confirmation inactive, PLAYED - if heard)
idstringIdentifier’s of the message
phonestringMessage destination phone number.
mommentstringTime when the instance was disconnected from the number.
typestringInstance event type, in this case it will be "MessageStatusCallback".

200#

{
"status": "SENT",
"ids": ["999999999999999999999"],
"momment": 1632234645000,
"phone": "5544999999999",
"type": "MessageStatusCallback",
"instanceId": "instance.id"
}
{
"status": "RECEIVED",
"ids": ["999999999999999999999"],
"momment": 1632234645000,
"phone": "5544999999999",
"type": "MessageStatusCallback",
"instanceId": "instance.id"
}
{
"status": "READ",
"ids": ["999999999999999999999"],
"momment": 1632234645000,
"phone": "5544999999999",
"type": "MessageStatusCallback",
"instanceId": "instance.id"
}
{
"status": "READ-SELF",
"ids": ["999999999999999999999"],
"momment": 1632234645000,
"phone": "5544999999999",
"type": "MessageStatusCallback",
"instanceId": "instance.id"
}
{
"status": "PLAYED",
"ids": ["999999999999999999999"],
"momment": 1632234645000,
"phone": "5544999999999",
"type": "MessageStatusCallback",
"instanceId": "instance.id"
}

405#

In this case certify that you are sending the correct specification of the method. This means, verify if you sent a POST or PUT 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”