REST API & Webhook Reference
Authenticate requests using a Bearer API key generated inside your dashboard.
Send Message Endpoint
POST /api/v1/messages/send
curl -X POST https://yourdomain.com/api/v1/messages/send \
-H "Authorization: Bearer mpwa_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "sess_xxxxxxxx",
"to": "919876543210",
"type": "text",
"text": "Hello from PulseWA!"
}'
Supported Message Types
Pass type as text, image, document, audio, location, or poll.
{
"sessionId": "sess_xxxxxxxx",
"to": "919876543210",
"type": "poll",
"question": "Preferred delivery slot?",
"options": ["Morning", "Evening"],
"selectableCount": 1
}
Check Device Status
GET /api/v1/devices/{sessionId}/status
curl https://yourdomain.com/api/v1/devices/sess_xxxxxxxx/status \ -H "Authorization: Bearer mpwa_your_api_key"
Webhook Verification
Verify X-PulseWA-Signature using HMAC-SHA256 with your device webhook secret.
$raw = file_get_contents('php://input');
$sig = $_SERVER['HTTP_X_PULSEWA_SIGNATURE'] ?? '';
$expected = hash_hmac('sha256', $raw, $webhookSecret);
if (!hash_equals($expected, $sig)) {
http_response_code(401);
exit;
}