Webhook
Webhooks are user-defined HTTP callbacks that are triggered by specific events. Whenever a trigger event occurs, you get a notification (HTTP request) sent to a previously set URL. The Webhook notifications include an array of objects indicating what is being communicated..
On this page
Received Messages Notifications
When you receive an inboud message, a notification is sent to the Webhook URL you set.
Body Text Type
{
"contacts": [
{
"profile": {
"name": "John Doe"
},
"wa_id": "+6281123456789"
}
],
"messages": [
{
"conversation": {
"type": "individual",
"wa_id": "+6281123456789"
},
"from": "+6281123456789",
"to": "+6281987654321",
"id": "eea53649-a256-473b-8c59-a3ae69947fe7",
"timestamp": "2022-01-21T13:35:18Z",
"text": {
"body": "halo"
},
"type": "text"
}
]
}
Body Image Type
{
"contacts": [
{
"profile": {
"name": "John Doe"
},
"wa_id": "+6281123456789"
}
],
"messages": [
{
"conversation": {
"type": "individual",
"wa_id": "+6281123456789"
},
"from": "+6281123456789",
"to": "+6281987654321",
"id": "eea53649-a256-473b-8c59-a3ae69947fe7",
"timestamp": "2022-01-21T13:35:18Z",
"image": {
"caption": "halo",
"link": "https://motict.com/image.jpg"
},
"type": "image"
}
]
}
Body Location Type
{
"contacts": [
{
"profile": {
"name": "John Doe"
},
"wa_id": "+6281123456789"
}
],
"messages": [
{
"conversation": {
"type": "individual",
"wa_id": "+6281123456789"
},
"from": "+6281123456789",
"to": "+6281987654321",
"id": "eea53649-a256-473b-8c59-a3ae69947fe7",
"timestamp": "2022-01-21T13:35:18Z",
"location": {
"latitude": "-6.170172",
"longitude": "106.824104",
"name": "Istana Merdeka",
"address": "Jalan Medan Merdeka Utara, Jakarta Pusat, Jakarta 10110"
},
"type": "location"
}
]
}
Body Text Type Reply Mention
{
"contacts": [
{
"profile": {
"name": "John Doe"
},
"wa_id": "+6281123456789"
}
],
"messages": [
{
"conversation": {
"type": "group",
"wa_id": "12345678945612",
"group_name": "Group Name"
},
"from": "12345678945612",
"to": "+6281987654321",
"id": "eea53649-a256-473b-8c59-a3ae69947fe7",
"timestamp": "2022-01-21T13:35:18Z",
"text": {
"body": "halo @6281987654321"
},
"type": "text",
"mentioned_ids": [
"+6281987654321"
],
"quoted_message": {
"from": "+6281987654321",
"type": "text",
"text": {
"body": "hi"
}
}
}
]
}
Parameters
Name | Type | Description |
---|---|---|
contacts | Array | |
profile.name | String | The Profile Name of the sender of the message. |
wa_id | String | The WhatsApp Number of the sender of the message. |
messages | Array | |
conversation.type | String | The conversation type of the incoming message. |
conversation.wa_id | String | Conversation WhatsApp Number or Group ID. |
profile.name | String | The Profile Name of the sender of the message. |
wa_id | String | The WhatsApp Number of the sender of the message. |
from | String | The WhatsApp Number of the sender of the message. |
to | String | Destination WhatsApp Number. |
id | String | WhatsApp ID will be used as WhatsApp identifier for each request. |
timestamp | String | Date time when the status triggered. |
text.body | String | Message content of the message sender. |
image.caption | String | Caption on image content of the message sender. |
image.link | String | URL image location. |
location.latitude | String | Location Latitude. |
location.longitude | String | Location Longitude. |
location.name | String | Location Name. |
location.address | String | Location Address. |
type | String |
A descriptive type for the WhatsApp message. Available types:
|
mentioned_ids | Array | WhatsApp Number mentioned in group. |
quoted_message.from | String | Whatsapp Number that replied to the chat. |
quoted_message.type | String | Message type that replied to the chat. |
quoted_message.text | String | Message type that replied to the chat. Only available for text. |
quoted_message.text.body | String | Message that replied to the chat. |
Received Messages Status
When you send message, a message status is sent to the Webhook URL you set.
Body
{
"statuses": [
{
"id": "f903783d-f6a9-42dc-9844-d14fde2f3d04",
"recipient_id": "+6281123456789",
"status": "sent",
"timestamp": "2024-09-11T08:03:29Z"
}
]
}
Parameters
Name | Type | Description |
---|---|---|
id | String | WhatsApp ID will be used as WhatsApp identifier for each request. |
recipient_id | String | WhatsApp Number that the message was sent to. |
status | String |
A descriptive status for the WhatsApp message. Available status:
|
timestamp | String | Date time when the status triggered. |