Send a message via the API
Complete request/response examples for sending WhatsApp, SMS, and email via WaSMS’s REST API.
Last updated 2026-05-31
WaSMS exposes a single POST /api/public/v1/messages endpoint for WhatsApp, SMS, and email.
WhatsApp example
curl https://wasms.net/api/public/v1/messages -H "Authorization: Bearer wasms_xxxxxxxxxxxxxxxx" -H "Content-Type: application/json" -d '{
"channel": "whatsapp",
"to": "+923001234567",
"text": "Hello from WaSMS"
}'Response
{
"success": true,
"data": {
"message_id": "msg_01HXYZ...",
"status": "queued",
"conversation_id": "conv_01HXYZ..."
}
}SMS
-d '{ "channel": "sms", "to": "+92300...", "text": "Your OTP is 1234" }'-d '{
"channel": "email",
"to": "[email protected]",
"subject": "Welcome",
"html": "<p>Thanks for signing up.</p>"
}'Media (WhatsApp)
-d '{ "channel": "whatsapp", "to": "+92300...", "text": "Receipt", "media_url": "https://your-cdn.com/receipt.pdf" }'Bulk
POST /api/public/v1/messages/bulk with an array (up to 1000 per request).
Error codes
401— missing or invalid API key403— key lacks scope422— malformed request429— rate-limited503— channel offline
Rate limits
Default: 60 req/min per API key. Use bulk endpoint for high volume.
Full reference
See wasms.net/api-docs.