WhatsApp inbound webhook
curl --request POST \
--url https://api.naturalead.ai/api/webhooks/meta-whatsapp \
--header 'Content-Type: application/json' \
--header 'X-Hub-Signature-256: <x-hub-signature-256>' \
--data '
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "<string>",
"changes": [
{
"field": "<string>",
"value": {
"messages": [
{}
],
"metadata": {
"phone_number_id": "<string>"
}
}
}
]
}
]
}
'import requests
url = "https://api.naturalead.ai/api/webhooks/meta-whatsapp"
payload = {
"object": "whatsapp_business_account",
"entry": [
{
"id": "<string>",
"changes": [
{
"field": "<string>",
"value": {
"messages": [{}],
"metadata": { "phone_number_id": "<string>" }
}
}
]
}
]
}
headers = {
"X-Hub-Signature-256": "<x-hub-signature-256>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Hub-Signature-256': '<x-hub-signature-256>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
object: 'whatsapp_business_account',
entry: [
{
id: '<string>',
changes: [
{
field: '<string>',
value: {messages: [{}], metadata: {phone_number_id: '<string>'}}
}
]
}
]
})
};
fetch('https://api.naturalead.ai/api/webhooks/meta-whatsapp', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.naturalead.ai/api/webhooks/meta-whatsapp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'object' => 'whatsapp_business_account',
'entry' => [
[
'id' => '<string>',
'changes' => [
[
'field' => '<string>',
'value' => [
'messages' => [
[
]
],
'metadata' => [
'phone_number_id' => '<string>'
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Hub-Signature-256: <x-hub-signature-256>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.naturalead.ai/api/webhooks/meta-whatsapp"
payload := strings.NewReader("{\n \"object\": \"whatsapp_business_account\",\n \"entry\": [\n {\n \"id\": \"<string>\",\n \"changes\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"messages\": [\n {}\n ],\n \"metadata\": {\n \"phone_number_id\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Hub-Signature-256", "<x-hub-signature-256>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.naturalead.ai/api/webhooks/meta-whatsapp")
.header("X-Hub-Signature-256", "<x-hub-signature-256>")
.header("Content-Type", "application/json")
.body("{\n \"object\": \"whatsapp_business_account\",\n \"entry\": [\n {\n \"id\": \"<string>\",\n \"changes\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"messages\": [\n {}\n ],\n \"metadata\": {\n \"phone_number_id\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/webhooks/meta-whatsapp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Hub-Signature-256"] = '<x-hub-signature-256>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"object\": \"whatsapp_business_account\",\n \"entry\": [\n {\n \"id\": \"<string>\",\n \"changes\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"messages\": [\n {}\n ],\n \"metadata\": {\n \"phone_number_id\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}Webhooks
WhatsApp Inbound
Receives inbound WhatsApp messages from the Meta Cloud API. The request
is validated using the X-Hub-Signature-256 header (HMAC-SHA256 with
FB_APP_SECRET). The account is resolved by matching the WABA ID or
phone number ID from the payload against the integration collection.
Important: This endpoint always returns HTTP 200 to Meta, even on errors, to prevent Meta from disabling the webhook.
POST
/
api
/
webhooks
/
meta-whatsapp
WhatsApp inbound webhook
curl --request POST \
--url https://api.naturalead.ai/api/webhooks/meta-whatsapp \
--header 'Content-Type: application/json' \
--header 'X-Hub-Signature-256: <x-hub-signature-256>' \
--data '
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "<string>",
"changes": [
{
"field": "<string>",
"value": {
"messages": [
{}
],
"metadata": {
"phone_number_id": "<string>"
}
}
}
]
}
]
}
'import requests
url = "https://api.naturalead.ai/api/webhooks/meta-whatsapp"
payload = {
"object": "whatsapp_business_account",
"entry": [
{
"id": "<string>",
"changes": [
{
"field": "<string>",
"value": {
"messages": [{}],
"metadata": { "phone_number_id": "<string>" }
}
}
]
}
]
}
headers = {
"X-Hub-Signature-256": "<x-hub-signature-256>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Hub-Signature-256': '<x-hub-signature-256>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
object: 'whatsapp_business_account',
entry: [
{
id: '<string>',
changes: [
{
field: '<string>',
value: {messages: [{}], metadata: {phone_number_id: '<string>'}}
}
]
}
]
})
};
fetch('https://api.naturalead.ai/api/webhooks/meta-whatsapp', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.naturalead.ai/api/webhooks/meta-whatsapp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'object' => 'whatsapp_business_account',
'entry' => [
[
'id' => '<string>',
'changes' => [
[
'field' => '<string>',
'value' => [
'messages' => [
[
]
],
'metadata' => [
'phone_number_id' => '<string>'
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Hub-Signature-256: <x-hub-signature-256>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.naturalead.ai/api/webhooks/meta-whatsapp"
payload := strings.NewReader("{\n \"object\": \"whatsapp_business_account\",\n \"entry\": [\n {\n \"id\": \"<string>\",\n \"changes\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"messages\": [\n {}\n ],\n \"metadata\": {\n \"phone_number_id\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Hub-Signature-256", "<x-hub-signature-256>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.naturalead.ai/api/webhooks/meta-whatsapp")
.header("X-Hub-Signature-256", "<x-hub-signature-256>")
.header("Content-Type", "application/json")
.body("{\n \"object\": \"whatsapp_business_account\",\n \"entry\": [\n {\n \"id\": \"<string>\",\n \"changes\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"messages\": [\n {}\n ],\n \"metadata\": {\n \"phone_number_id\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.naturalead.ai/api/webhooks/meta-whatsapp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Hub-Signature-256"] = '<x-hub-signature-256>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"object\": \"whatsapp_business_account\",\n \"entry\": [\n {\n \"id\": \"<string>\",\n \"changes\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"messages\": [\n {}\n ],\n \"metadata\": {\n \"phone_number_id\": \"<string>\"\n }\n }\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}Headers
HMAC-SHA256 signature of the request body
Body
application/json
Response
200 - application/json
Webhook acknowledged (always returns 200)
Available options:
ok, ignored, signature_invalid, error