Send WhatsApp messages using a clean REST API. Full documentation below.
Every API request requires your API key. Send it either as a query parameter api_key or as header X-API-Key.
# Header (recommended) X-API-Key: your_api_key_here # Or query string ?api_key=your_api_key_here
Find your API key in Dashboard → API.
POST /api/send.php
| Parameter | Required | Description |
|---|---|---|
mobile | Yes | Recipient number (e.g., 923001234567) |
message | Yes | Text message content |
type | No | 0=Text (default), 1=Image, 2=Document, 3=Voice, 4=Video |
url | No | Media URL (required for type 1–4) |
caption | No | Caption for images / videos |
priority | No | 0=highest, 10=normal, 20=low (default 10) |
instance_id | No | Specific instance to send from (auto-picked if omitted) |
campaign_type | No | transactional (default) or promotional |
schedule | No | 1 to schedule for later, 0 immediate |
schedule_time | No | Date-time string (YYYY-MM-DD HH:MM:SS) |
curl -X POST "https://pulse.kaaffoods.com/api/send.php" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"mobile":"923001234567","message":"Hello from KaafPulse"}'
{
"success": true,
"message_id": 1234,
"totalgsm": "1",
"remaincredit": "9999",
"instance_id": 5
}
Send images, documents, voice notes or video by setting type and providing a public url.
curl -X POST "https://pulse.kaaffoods.com/api/send.php" \ -H "X-API-Key: YOUR_KEY" \ -d "mobile=923001234567" \ -d "type=1" \ -d "url=https://example.com/image.jpg" \ -d "caption=Check this out!"
Send different messages to different numbers in one request by using personalized=1 and passing a JSON array as message.
curl -X POST "https://pulse.kaaffoods.com/api/send.php" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"personalized": "1",
"message": [
{"mobile": "923001111111", "message": "Hi Ali!"},
{"mobile": "923002222222", "message": "Hi Sara!"}
]
}'
POST /api/number.php
Verify if numbers exist on WhatsApp before sending. Prevents wasted pulses.
curl -X POST "https://pulse.kaaffoods.com/api/number.php" \ -H "X-API-Key: YOUR_KEY" \ -d "numbers=923001234567,923002345678"
| Code | Meaning |
|---|---|
| 200 | Success — message queued |
| 400 | Bad request — missing or invalid params |
| 401 | Unauthorized — invalid API key |
| 402 | Insufficient pulses |
| 409 | No READY instance available |
| 500 | Server error |
| 502 | Engine unavailable |
Set your webhook URL in Dashboard → Settings to receive incoming messages and delivery reports in real time.
Your endpoint will receive POST requests with JSON payloads like:
{
"event": "inbox",
"instance_id": 5,
"from": "923001234567",
"body": "Hello!"
}
<?php
$ch = curl_init('https://pulse.kaaffoods.com/api/send.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => [
'mobile' => '923001234567',
'message' => 'Hello from PHP!',
],
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_KEY'],
CURLOPT_RETURNTRANSFER => true,
]);
$res = curl_exec($ch);
echo $res;const res = await fetch('https://pulse.kaaffoods.com/api/send.php', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_KEY' },
body: new URLSearchParams({
mobile: '923001234567',
message: 'Hello from Node!'
})
});
console.log(await res.json());import requests
r = requests.post(
"https://pulse.kaaffoods.com/api/send.php",
headers={"X-API-Key": "YOUR_KEY"},
data={"mobile": "923001234567", "message": "Hello from Python!"}
)
print(r.json())curl -X POST "https://pulse.kaaffoods.com/api/send.php" \ -H "X-API-Key: YOUR_KEY" \ -d "mobile=923001234567" \ -d "message=Hello World!"