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" }'

Email

-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 key
  • 403 — key lacks scope
  • 422 — malformed request
  • 429 — rate-limited
  • 503 — channel offline

Rate limits

Default: 60 req/min per API key. Use bulk endpoint for high volume.

Full reference

See wasms.net/api-docs.

More in API & Webhooks