Unified API
One key, one endpoint, automatic fallback
Stop integrating a different API for every channel. Send one request with your channel order; we try the first channel and move to the next one if it fails or is not delivered in time.
- One API key starting with
sghcp_, created in the panel under CPaaS > API.
- One endpoint for WhatsApp, SMS, RCS and email:
POST https://www.smsgatewayhub.com/cpaas/v1/messages.ashx
- Automatic fallback, for example WhatsApp first and SMS if it is not delivered within
fallbackAfter seconds.
- Checked before sending: every channel in the route is validated when the request arrives, so a broken route is refused before any message goes out.
- Delivery status with a full event timeline (
GET ?id=cp_...) and signed webhooks to your server.
- Safe retries with an optional
Idempotency-Key header. Your existing SMS and WhatsApp APIs keep working as they are.
Automation and SDKs (coming soon).
Send with WhatsApp, fall back to SMS
curl -X POST "https://www.smsgatewayhub.com/cpaas/v1/messages.ashx" \
-H "Authorization: Bearer sghcp_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channels": ["whatsapp", "sms"],
"to": "9198XXXXXXXX",
"fallbackAfter": 300,
"ref": "order-1042",
"callbackUrl": "https://yourapp.com/cpaas/status",
"whatsapp": {
"template": "order_shipped",
"language": "en",
"variables": ["Rahul", "1042"]
},
"sms": {
"text": "Hi Rahul, your order 1042 has been shipped. - ABC Store",
"sender": "ABCSTR",
"templateId": "YOUR_DLT_TEMPLATE_ID"
}
}'
Response (202 Accepted)
{"id":"cp_...","status":"accepted","channel":"whatsapp",
"route":["whatsapp","sms"],"ref":"order-1042"}
Add "rcs" or "email" (with toEmail) to the channel list in the same way. Full field list in the panel under CPaaS > API.