In this article, we tell you how to connect webhooks, in what form we send them, and what we expect in response.
We send webhooks using the POST method to the specified URI. It may include a query "string".
If we have your crmKey, we add the Authorization: Bearer ${crmKey} header. If not, we don't add the Authorization header at all.
Webhooks contain JSON in the body and the corresponding header Content-Type: application/json; charset-utf-8. An object is encoded in JSON with properties that correspond to webhook types.
One webhook can contain messages and statuses types at the same time. The webhooks of the createContact and createDeal types always contain only one type.
In response, we expect the code 200 OK. In some cases, we wait for certain information in the body of the response. Timeout — 30 s.
To subscribe to webhooks, you must invoke:
https://api.wazzup24.com/v3/webhooks{
"webhooksUri": "string",
"subscriptions": {
"messagesAndStatuses": boolean,
"contactsAndDealsCreation": boolean,
"channelsUpdates": boolean,
"templateStatus": boolean
}
}
The body must contain JSON with parameters:
| Parameter | Type | Description |
| webhooksUri | String | Address to receive webhooks. No more than 200 characters |
| subscriptions | Object subscriptions | Webhook settings |
| Parameter | Type | Description |
| messagesAndStatuses | Boolean | Webhook on new messages and webhook on outgoing status changes. If the webhook is required, specify "true". If not, specify "false". |
| contactsAndDealsCreation | Boolean | Webhook about creating a new contact or deal. If the webhook is required, specify "true". If not, specify "false". |
| channelsUpdates | Boolean | Webhook about changing the status of the channel. If the webhook is required, specify "true". If not, specify "false". |
| templateStatus | Boolean | Webhook about the change in moderation status of the WABA template. If the webhook is required, specify "true". If not, specify "false". |
When connecting to the specified url, a POST test request {test: true } will be sent, in reply to which the server should return 200 if webhooks are successfully connected, otherwise a :"Webhooks request not valid. Response status must be 200″.
curl --location --request PATCH 'https://api.wazzup24.com/v3/webhooks' \
--header 'Authorization: Bearer w11cf3444405648267f900520d454368d27' \
--header 'Content-Type: application/json' \
--data-raw '{
"webhooksUri": "https://example.com/webhooks",
"subscriptions": {
"messagesAndStatuses": true,
"contactsAndDealsCreation": true
}
}'
{
ok
}
In addition to common errors for all routes, there can be:
| Error | Type | Description |
| 400 Bad Request, { error: 'uriNotValid', description: 'Provided URI is not valid URI' } | String | If the URI is incorrect according to the formal characteristics |
| 400 Bad Request, { error: 'testPostNotPassed', description: 'URI does not return 200 OK on test request', data: { '${код ответа}' } } | String | If there was an error when sending a test request to the specified URL |
To check the currently set callback URL, call
https://api.wazzup24.com/v3/webhooks HTTP/1.1 200 OK
``json
{
"webhooksUri": "https://example.com/webhooks",
{ "subscriptions": {
{ "messagesAndStatuses": { "true",
{ "contactsAndDealsCreation": "true"
}
}
``
The webhook will send a JSON object with the messages key, the value of which is an array of objects with the following parameters:
{
"messages": [
{
"messageId": "string",
"channelId": "string",
"chatType": "string",
"chatId": "string",
"dateTime": "string",
"type": "string",
"status": "string",
"error": {
"error": "string",
"description": "string"
},
"text": "string",
"contentUri": "string",
"authorName": "string",
"authorId": "string",
"isEcho": boolean,
"instPost": { ... },
"contact": {
"name": "string",
"avatarUri": "string",
"username": "string",
"phone": "string"
},
"interactive": [ ... ],
"quotedMessage": { ... },
"sentFromApp": boolean,
"isEdited": boolean,
"isDeleted": boolean,
"oldInfo": {
"oldText": "string",
"oldAuthorId": "string",
"oldAuthorName": "string"
}
}
]
}
| Parameter | Type | Description |
| messageId | String (uuid4) | guid Wazzup messages |
| channelId | String (uuid4) | Channel id |
| chatType | String | Available values:
|
| chatId | String | Chat Id (contact's account in messenger):
|
| dateTime | String | The message sending time specified by the messenger in the format yyyy-mm-ddThh:mm:ss.ms |
| type | String | Message type:
|
| status | String | Contains only value from ENUM of webhook "statuses":
|
| error | Object error | Comes if 'status: error' |
| text | String | Message text. May not be present if the message has content |
| contentUri | String | Link to message content (may not exist if the message does not contain content) |
| authorName | String | The sender's name, if there is one. Only present in messages isEcho = true |
| authorId | String | User ID in your CRM |
| isEcho | Boolean | If the message is incoming — false, if it is outgoing, sent not from this API (from a phone or iFrame) — true |
| instPost | Object instPost | Information about the post from Instagram. Applied when the post is an Instagram comment |
| contact | Object contact | Information about contact |
| interactive | Interactive | Array of objects with Salesbot amoCRM buttons attached to the message |
| quotedMessage | Object | Contains an object with the parameters of the quoted message |
| sentFromApp | Boolean | If the message was sent from Wazzup's native chat, the parameter is set to true; otherwise, it is false. |
| isEdited | Boolean | Shows that the message has been edited: if true, the message has been changed. If the outgoing message is changed not via Wazzup, but directly from the messenger, then a webhook about updating the status will be sent statuses |
| isDeleted | Boolean | Indicates that the message has been deleted: if true, the message has been deleted |
| oldInfo | Object oldInfo | Contains information about a modified or deleted message |
| Parameter | Type | Description |
| error | String | Error types:
|
| description | String | Error description |
| Parameter | Type | Description |
| id | String | Post ID |
| src | String | Link to the post |
| author | String | Author of the post |
| description | String | Description of the post |
| Parameter | Type | Description |
| name | String | Contact name |
| avatarUri | String | The URI of the contact's avatar. Applied if an avatar is in Wazzup |
| username | String | For Telegram only. Username of a Telegram contact, with no @ at the beginning |
| phone | String | Telegram only. Contact phone number in international format |
| Parameter | Type | Description |
| oldText | String | Message text before editing or deleting |
| oldAuthorId | String | id of the author who sent the original message. May differ from authorId if the message was changed or deleted by another employee, not the author |
| oldAuthorName | String | The name of the author who sent the original message. May differ from authorName if the message was changed or deleted by another employee than the author |
Object with information about the Instagram post
{
id: '2430659146657243411_41370968890',
src: 'https://www.instagram.com/p/CG7b52ejyET',
sha1: 'dc8c036b4a0122bb238fc38dcb0391c125e916f2',
likes: 0,
author: 'wztestdlv',
comments: 22,
timestamp: 1603977171000,
updatedAt: 1608905897958,
authorName: '',
authorId: '798633247',
description: 'Beauty',
previewSha1: '3a55c2920912de4b6a66d24568470dd4ad367c34',
imageSrc: 'https://store.dev-wazzup24.com/dc8c036b4a0122bb238fc38dcb0391c125e916f2',
previewSrc: 'https://store.dev-wazzup24.com/3a55c2920912de4b6a66d24568470dd4ad367c34'
}
Stickers from WhatsApp
We send stickers received from the WhatsApp channel in the webhook "type": "image" and a link to the file in .was format:
{
"messages": [
{
"messageId": "6a2087e8-e0f4-9999-b968-9d9999933c81",
"dateTime": "2025-05-06T14:16:00.002Z",
"channelId": "b96a353b-9999-4cac-8413-ba99999f981",
"chatType": "whatsapp",
"chatId": "79999999999",
"type": "image",
"isEcho": false,
"contact": {
"name": "79999999999",
"avatarUri": "https://store.wazzup24.com/0e999997ae07d2083c687253b8baed9999a26fa";
},
"contentUri": "https://store.wazzup24.com/e51159999e0046d628b3924161d411e5812d2546/?filename=f9ebe1b1-3ed5-4ec2-97fb-03f0c25e413f.was";,
"status": "inbound"
}
]
}
WhatsApp poll
We send the survey received from the WhatsApp channel in the webhook "type": "text" and send the survey in text message format:
{
"messages": [
{
"messageId": "caa9999-cce3-424c-86cd-05f99995073",
"dateTime": "2025-05-06T14:18:00.001Z",
"channelId": "b96a999e-06f5-4cac-8413-ba999993f981",
"chatType": "whatsapp",
"chatId": "79999999999",
"type": "text",
"isEcho": false,
"contact": {
"name": "79999999999",
"avatarUri": "https://store.wazzup24.com/0e82ead97ae07d9999c687253b8baed2365a26fa";
},
"text": "Тестовый\n• Вариант1\n• Вариант2",
"status": "inbound"
}
]
}
The webhook will send a JSON object with the statuses key, the value of which will contain an array of objects with the following parameters:
{
"statuses": [
{
"messageId": "string",
"timestamp": "string",
"status": "string",
"error": {
"error": "string",
"description": "string",
"data": "string"
}
}
]
}
| Parameter | Type | Description |
| messageId | String | guid Wazzup messages |
| timestamp | String | The time of receiving status update information |
| status | String | the status of the message that was updated:
|
| error | Object error | Optional, comes only when 'status': 'error' |
| Parameter | Type | Description |
| error | String | Error code |
| description | String | Error description |
| data | String | More information about the error |
{
"statuses": [
{
"messageId": "be3dc577-60c4-4fc8-83a5-8c358e0bfe15", // guid of the message whose status update we are notifying
"timestamp": "2025-02-05T06:01:07.499Z", // is the time of receiving status update information
"status": "delivered"
}
]
}
Send when you need to create a contact or transaction in CRM. This happens in 3 cases:
Case 1: in item 3 of the integration settings "Every new client is assigned to the first respondent" is selected.
A new client writes. An employee replies to them. Wazzup sends a webhook about new contact and deal creation if funnels with stages are loaded from CRM.
Case 2: "Sales reps are assigned new clients in turn" is selected in item 3 of the integration settings.
A new client writes. Wazzup sends a webhook about creating a new contact and deal if funnels with stages are loaded from CRM.
Case 3: When clicking the "+" button in the "Deals" list to create a new deal inside the Wazzup chats:
We first check if the contact already exists in our database.
If the contact already exists, we send a webhook to initiate deal creation:
{
createDeal: {
responsibleUserId: '1', // the id of the user who was selected in turn or was the first to respond
contacts: ['1'] // link of the deal with a newly created contact
source: 'auto'|'byUser', // auto - on incoming or outgoing message, byUser - by the button in the "Deals" dropdown
},
}
If the contact does not exist, we first send a webhook to initiate contact creation:
{
createContact: {
responsibleUserId: '1', // id of the user who was selected in turn or was the first to respond
name: 'contacts.name', // contact name from the contacts table
contactData: [{ chatType, chatId }],
source: 'auto'|'byUser', // auto - on incoming or outgoing message, byUser - by button
},
}
After that, the CRM should create the contact and respond with 200 OK along with a JSON object of the new entity, matching the CRUD route signature for contacts.
Then, we will send a webhook to initiate deal creation.
Subsequently, the CRM should create the deal and similarly respond with 200 OK and a JSON object of the new entity, matching the CRUD route signature for deals.
Sent when the channel status changes.
{
"channelsUpdates": [
{
"channelId": "string",
"state": "string",
"tier": "string",
"qr": "string",
"timestamp": number
}
]
}
| Parameter | Type | Description |
| channelId | String | Channel guid |
| state | String | Channel status |
| tier | String |
For WABA channels only. Meta assigns tiers to WhatsApp Business accounts - these indicate how many 24-hour conversations can be initiated per day. Possible values: TIER_0: 250 conversations, TIER_1K: 1,000 conversations, TIER_10K: 10,000 conversations, TIER_100K: 100,000 conversations, TIER_UNLIMITED: unlimited. |
| qr | String | QR code in base64 format, present only with state 'qr' |
| qridle | String | The channel is deauthorized or the QR code has expired |
| timestamp | Integer | Status setting time in ms |
{
"channelsUpdates": [
{
"channelId": "d9e5721c-ce2b-444f-9627-60a8129d7e1f",
"state": "qr",
"timestamp": 1603977171000,
"qr": "data:image/png;base64,iVBORw0KGgoAAAANS"
}
]
}
| Value | Description | Channel types |
| active | The channel is active, everything is fine | All |
| disabled | This status occurs when the channel is removed from the subscription, as well as during technical work | All |
| qr | QR code needs to be scanned | whatsapp and tgapi |
| phoneUnavailable | There is no connection with the phone. Outdated, but occasionally it can manifest itself in case of problems in the WhatsApp itself or on older versions of the WhatsApp application on the handset | |
| openElsewhere | WhatsApp web app opened in a different location | |
| notEnoughMoney | Channel not paid | All |
| unauthorized | Not authorized, you need to re-authorize the channel | All |
{
"templateGuid": "string",
"name": "string",
"status": "string"
}
| Parameter | Type | Description |
| templateGuid | String | Template guid |
| name | String | Template name |
| status | String | Template moderation status |
| Value | Description |
| APPROVED | Same as "Active" in Wazzup account. The template is Meta approved and can be used |
| PENDING | The same as "On moderation" in Wazzup personal account. Meta still validates template |
| REJECTED | In Wazzup personal account — "Rejected". The template did not pass Meta moderation |
| PAUSED | In Wazzup personal account — "Rejected". Recipients complained about the template, so Meta checks it again |
| DISABLED | In Wazzup personal account — "Rejected". The template was blocked after complaints |