API reference
Trigger (for automation tools)
POST /api/webhooks/trigger — send a message from Zapier, Make or any automation tool, and fire the message_sent webhook.
POST
/api/webhooks/triggerA send endpoint for automation tools such as Zapier and Make. After a successful send, the outgoing webhooks registered for message_sent are fired.
Headers
| Header | Value |
|---|---|
X-API-Key |
Your key. This endpoint does not accept Authorization: Bearer or the key in the URL. |
Content-Type |
application/json |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
to |
string | Yes | Recipient number in international format |
message |
string | Yes | Message text |
instance_id |
string | No | ID of the sending number. Default: the first connected number |
The key needs the send permission (otherwise 403 permission_denied).
Response
200 OK
JSON
{
"success": true,
"message_id": "wamid.HBgMOTY2NTAwMDAwMDAwFQIAERgSQzE2..."
}
Errors
| Status | error |
Cause |
|---|---|---|
400 |
to and message required |
Missing field |
401 |
API key required |
Missing X-API-Key header |
401 |
Invalid API key |
Invalid key |
403 |
The blocking reason | Plan limit, opt-out or block |
404 |
No connected WhatsApp instance |
No connected number |
405 |
Method not allowed |
Method is not POST |
502 |
The failure reason | The WhatsApp provider rejected the message |
Examples
curl -X POST https://waabek.com/api/webhooks/trigger \
-H "X-API-Key: $WABEK_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "to": "966500000000", "message": "Thanks for filling in our form!" }'
const res = await fetch("https://waabek.com/api/webhooks/trigger", {
method: "POST",
headers: {
"X-API-Key": process.env.WABEK_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
to: "966500000000",
message: "Thanks for filling in our form!",
}),
});
console.log(res.status, await res.json());
<?php
$ch = curl_init('https://waabek.com/api/webhooks/trigger');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . getenv('WABEK_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'to' => '966500000000',
'message' => 'Thanks for filling in our form!',
]),
]);
echo curl_exec($ch);
curl_close($ch);
import os
import requests
resp = requests.post(
"https://waabek.com/api/webhooks/trigger",
headers={"X-API-Key": os.environ["WABEK_API_KEY"]},
json={"to": "966500000000", "message": "Thanks for filling in our form!"},
timeout=30,
)
print(resp.status_code, resp.json())