[go: up one dir, main page]

Skip to content

Outgoing message status#

Incoming webhook of this type contains the status of a previously sent message: sent, delivered, read, etc.

Configuring an instance

To receive incoming notifications about messages sent via API, you need to enable the settings using one of the following options:

  1. Through console enable the settings Get notifications about messages sent from API, Get notifications about messages sent from the phone and Get notifications about outgoing messages sending/delivering/reading statuses

  2. Through the SetSettings method enable the settings outgoingAPIMessageWebhook outgoingMessageWebhook and outgoing Webhook

Read more about the statuses of sent messages in WhatsApp in our article

Webhook#

Webhook parameters#

Parameter Type Description
typeWebhook string Incoming webhook type. For webhooks of this type the parameter takes on the value outgoingMessageStatus
chatId string Chat Id. Chat with a message for which you received the status.
instanceData object Instance data
timestamp integer Event timestamp in UNIX format
idMessage string Outgoing message or file Id. Outgoing message Id is returned by methods: SendMessage, SendFileByUrl, SendFileByUpload, SendLocation, SendContact, SendPoll
status string Outgoing message or file status. Status takes on the values:
sent - message sent
delivered - message delivered to the recipient
read - message read/viewed/heard by the recipient
failed - an error occurred while sending a message to WhatsApp server (this status cannot be disabled in the settings SetSettings, it is necessary to implement the processing of this notification)
failed - the recipient's phone number does not have a WhatsApp account (this status cannot be disabled in the settings SetSettings, it is necessary to implement the processing of this notification)
notInGroup - the sender is not a participant of a group chat where the message is being sent to
yellowCard - Suspension of sending messages due to spam activity. Messages sent after receiving the status are stored in the queue to be sent for 24 hours. To continue running the instance, you need to do a reboot of the instance.
description string Error description (it is recommended to inform the operator about system errors)
sendByApi boolean Is the message sent through API: true , false

instanceData object parameters

Parameter Type Description
idInstance integer Instance Id. The size of the integer is int64. Values ​​range include from 1 to 10 digits
wid string Account Id in WhatsApp format
typeInstance string Instance messenger type

Webhook example with status sent#

{
    "typeWebhook": "outgoingMessageStatus",
        "chatId": "11001234567890@c.us",
        "instanceData": {
            "idInstance": 1234,
            "wid": "11001234567@c.us",
            "typeInstance": "whatsapp"
        },
        "timestamp": 1727691478,
        "idMessage": "3EB0608D6A2901063D63",
        "status": "sent",
        "sendByApi": true
}

Webhook example with status delivered#

{
    "typeWebhook": "outgoingMessageStatus",
        "chatId": "11001234567890@c.us",
        "instanceData": {
            "idInstance": 1234,
            "wid": "11001234567@c.us",
            "typeInstance": "whatsapp"
        },
        "timestamp": 1727698517,
        "idMessage": "3EB0608D6A2901063D63",
        "status": "delivered",
        "sendByApi": true
}

Webhook example with status read#

{
    "typeWebhook": "outgoingMessageStatus",
        "chatId": "11001234567890@c.us",
        "instanceData": {
            "idInstance": 1234,
            "wid": "11001234567@c.us",
            "typeInstance": "whatsapp"
        },
        "timestamp": 1727698597,
        "idMessage": "3EB0608D6A2901063D63",
        "status": "read",
        "sendByApi": true
}

Webhook example when the sender is not in the group they're sending to#

{
    "typeWebhook": "outgoingMessageStatus",
        "chatId": "120363347693198097@g.us",
        "instanceData": {
            "idInstance": 1234,
            "wid": "11001234567@c.us",
            "typeInstance": "whatsapp"
        },
        "timestamp": 1727760222,
        "idMessage": "BAE5245994546A06",
        "status": "failed",
        "description": "Error: item-not-found",
        "sendByApi": true
}

Webhook example when there is no WhatsApp account on the number#

{
    "typeWebhook": "outgoingMessageStatus",
        "chatId": "11001234567890@c.us",
        "instanceData": {
            "idInstance": 1234,
            "wid": "11001234567@c.us",
            "typeInstance": "whatsapp"
        },
        "timestamp": 1727759586,
        "idMessage": "3EB0608D6A2901063D63",
        "status": "noAccount",
        "sendByApi": true
}

Webhook example with error SWE004#

{
    "typeWebhook": "outgoingMessageStatus",
        "chatId": "11001234567890@c.us",
        "instanceData": {
            "idInstance": 1234,
         "wid": "11001234567@c.us",
            "typeInstance": "whatsapp"
        },
    "timestamp": 1586700802,
    "idMessage": "3EB0608D6A2901063D63",
    "status": "failed",
    "description":"SWE004: the number of participants in the group has been exceeded - 706", // 706 - количество участников в группе
    "sendByApi": true
}