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:
-
Through console enable the settings
Get notifications about messages sent from API
,Get notifications about messages sent from the phone
andGet notifications about outgoing messages sending/delivering/reading statuses
-
Through the SetSettings method enable the settings
outgoingAPIMessageWebhook
,outgoingMessageWebhook
andoutgoingWebhook
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) | ||
noAccount - 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 | ||
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": "79001234567@c.us",
"instanceData": {
"idInstance": 7103000000,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1727691478,
"idMessage": "3EB0608D6A2901063D63",
"status": "sent",
"sendByApi": true
}
Webhook example with status delivered#
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "79001234567@c.us",
"instanceData": {
"idInstance": 7103000000,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1727698517,
"idMessage": "3EB0608D6A2901063D63",
"status": "delivered",
"sendByApi": true
}
Webhook example with status read#
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "79001234567@c.us",
"instanceData": {
"idInstance": 7103000000,
"wid": "79876543210@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": "notInGroup",
"sendByApi": true
}
Webhook example when sending a message with an empty file via the SendFileByUrl method#
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "120363347693198097@g.us",
"instanceData": {
"idInstance": 1234,
"wid": "11001234567@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1727760222,
"idMessage": "BAE5245994546A06",
"status": "failed",
"description": "file should not be empty. URL: ...",
"sendByApi": true
}
Webhook example when sending a message with a file that is not available via link (SendFileByUrl)#
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "120363347693198097@g.us",
"instanceData": {
"idInstance": 1234,
"wid": "11001234567@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1727760222,
"idMessage": "BAE5245994546A06",
"status": "failed",
"description": "upload request was failed with bad status code ([45][0-9]{2})...",
"sendByApi": true
}
or (both can occur)
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "120363347693198097@g.us",
"instanceData": {
"idInstance": 1234,
"wid": "11001234567@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1727760222,
"idMessage": "BAE5245994546A06",
"status": "failed",
"description": "request was failed with bad status code ([45][0-9]{2})...",
"sendByApi": true
}
Webhook example when sending a message with a file whose size is 100 MB. (SendFileByUrl)#
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "120363347693198097@g.us",
"instanceData": {
"idInstance": 1234,
"wid": "11001234567@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1727760222,
"idMessage": "BAE5245994546A06",
"status": "failed",
"description": "file size should not exceed 100 megabytes. URL: ...",
"sendByApi": true
}
Webhook example when sending a message with a file when WhatsApp media hosts are unavailable for a long time#
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "120363347693198097@g.us",
"instanceData": {
"idInstance": 1234,
"wid": "11001234567@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1727760222,
"idMessage": "BAE5245994546A06",
"status": "failed",
"description": "Uploader Error",
"sendByApi": true
}
or (both can occur)
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "120363347693198097@g.us",
"instanceData": {
"idInstance": 1234,
"wid": "11001234567@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1727760222,
"idMessage": "BAE5245994546A06",
"status": "failed",
"description": "failed to send message with file",
"sendByApi": true
}
Webhook example when sending a message when WhatsApp hosts are unavailable for a long time#
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "120363347693198097@g.us",
"instanceData": {
"idInstance": 1234,
"wid": "11001234567@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1727760222,
"idMessage": "BAE5245994546A06",
"status": "failed",
"description": "Error: Timed Out",
"sendByApi": true
}
or (both can occur)
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "120363347693198097@g.us",
"instanceData": {
"idInstance": 1234,
"wid": "11001234567@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1727760222,
"idMessage": "BAE5245994546A06",
"status": "failed",
"description": "Error: Connection Closed",
"sendByApi": true
}
Webhook example when there is no WhatsApp account on the number#
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "79001234567@c.us",
"instanceData": {
"idInstance": 7103000000,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1727759586,
"idMessage": "3EB0608D6A2901063D63",
"status": "noAccount",
"sendByApi": true
}
Webhook example with error SWE004#
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "79001234567@c.us",
"instanceData": {
"idInstance": 7103000000,
"wid": "79876543210@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
}
Webhook example when editing a message sent more than 15 minutes ago#
{
"typeWebhook": "outgoingMessageStatus",
"chatId": "79001234567@c.us",
"instanceData": {
"idInstance": 1101000001,
"wid": "79876543210@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1739426932,
"idMessage": "BAE56687379D581D",
"status": "failed",
"description": "15 minute editing time gap has been expired",
"sendByApi": true
}