This guide explains how to integrate with the WhatsApp API using API keys. The API provides endpoints for sending individual and bulk WhatsApp messages, managing devices, and checking message status.
authenticated → 5. Set Default (optional)Production: https://prosendi.com/api
Development: http://localhost:8000/api
API key must be active, not expired, belong to your company, and service type whatsapp.
Example:
curl -X POST https://prosendi.com/api/whatsapp/send \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"recipient": "+22370123456", "message": "Hello World"}'
/api/whatsapp/devicesReturns devices with status: pending, qr_ready, authenticated, disconnected, error.
/api/whatsapp/devicesBody: { "name": "My WhatsApp Device" }
/api/whatsapp/devices/{id}/qrReturns qr_code and device_status.
/api/whatsapp/devices/{id}/statusReturns status and phone_number when available.
/api/whatsapp/devices/{id}/set-defaultSets chosen device as company default.
/api/whatsapp/devices/{id}Update name, is_active.
/api/whatsapp/devices/{id}Removes device and sessions.
/api/whatsapp/sendBody:
{
"recipient": "+22370123456",
"message": "Your message",
"is_group": false,
"device_id": 1
}
Returns chat_id, message_id, device_id, and quota info.
/api/whatsapp/send-bulkBody:
{
"messages": [{ "recipient": "+22370123456", "message": "Hello" }],
"device_id": 1
}
Max 100 messages. 100ms delay between messages.
Common codes: invalid_api_key, company_inactive, key_expired, quota_exceeded, device_not_found, device_not_ready, invalid_phone_number, message_too_long, service_type_mismatch.
HTTP: 200, 400, 401, 403, 404, 422, 429, 500, 503.
import requests
headers = {"X-API-Key": "your_api_key_here", "Content-Type": "application/json"}
requests.post("https://prosendi.com/api/whatsapp/send", json={"recipient":"+22370123456","message":"Hello"}, headers=headers)
const axios = require("axios");
axios.post(
"https://prosendi.com/api/whatsapp/send",
{ recipient: "+22370123456", message: "Hello" },
{
headers: {
"X-API-Key": "your_api_key_here",
"Content-Type": "application/json",
},
}
);
<?php
$headers = ['X-API-Key: your_api_key_here','Content-Type: application/json'];
$ch = curl_init('https://prosendi.com/api/whatsapp/send');
curl_setopt_array($ch,[CURLOPT_POST=>true,CURLOPT_HTTPHEADER=>$headers,CURLOPT_POSTFIELDS=>json_encode(['recipient'=>'+22370123456','message'=>'Hello']),CURLOPT_RETURNTRANSFER=>true]);
echo curl_exec($ch);
curl_close($ch);
API_KEY="your_api_key_here"
curl -X POST "https://prosendi.com/api/whatsapp/send" -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" -d '{"recipient":"+22370123456","message":"Hello"}'
Support: [email protected]
Version 1.0.0 – Initial release, device management, quota, error handling.