Send templates, session text and media with the same API keys as SMS. Base URL: https://whitelabled.securesmsc.com/api/v2
Authorization: Bearer YOUR_API_KEY
(or api_key). Manage keys in
API Management.
Each successful send uses 1 WhatsApp credit.
message and media_url only work
when the recipient messaged you in the last 24 hours. Outside that window, send an approved
template first.
Send a template, session text, or media message.
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient with country code, e.g. 919876543210 |
template | string | One of* | Approved template name |
params | array | No | Ordered values for {{1}}, {{2}}… |
language | string | No | Template language (defaults to template language) |
message | string | One of* | Free-form text (open 24h session only) |
media_url | string | One of* | Public https URL (open 24h session only) |
media_type | string | No | image, video, document, audio |
caption | string | No | Media caption |
*Provide exactly one of template, message, or media_url.
curl -X POST "https://whitelabled.securesmsc.com/api/v2/whatsapp/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"919876543210","template":"smsc_biz_otp_v1","params":["482913"]}'
curl -X POST "https://whitelabled.securesmsc.com/api/v2/whatsapp/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"919876543210","message":"Thanks — we are on it."}'
curl -X POST "https://whitelabled.securesmsc.com/api/v2/whatsapp/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"919876543210","media_url":"https://example.com/invoice.pdf","media_type":"document","caption":"Your invoice"}'
$ch = curl_init('https://whitelabled.securesmsc.com/api/v2/whatsapp/send');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'to' => '919876543210',
'template' => 'smsc_biz_otp_v1',
'params' => ['482913'],
]),
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);
const res = await fetch('https://whitelabled.securesmsc.com/api/v2/whatsapp/send', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
to: '919876543210',
template: 'smsc_biz_otp_v1',
params: ['482913'],
}),
});
console.log(await res.json());
{
"status": "success",
"data": {
"message_id": "wamid.HBgMOTE5...",
"id": 51,
"to": "919876543210"
}
}
List approved templates for your connected WhatsApp Business account.
curl "https://whitelabled.securesmsc.com/api/v2/whatsapp/templates" \
-H "Authorization: Bearer YOUR_API_KEY"
Each item includes name, category, language, body text, parameter count, and:
is_sendable — can be sent from the current senderis_test_only — restricted to test numberssend_disabled_reason — human-readable block reason when not sendableDelivery status by numeric id or Meta wamid. Typical path:
sent → delivered → read, or failed.
curl "https://whitelabled.securesmsc.com/api/v2/whatsapp/status/51" \
-H "Authorization: Bearer YOUR_API_KEY"
| HTTP | Code / meaning | What to do |
|---|---|---|
| 401 | Unauthorized | Create or rotate an API key |
| 402 | Insufficient WhatsApp credits | Top up WhatsApp credits |
| 403 | WhatsApp module disabled | Ask your account manager to enable WhatsApp |
| 404 | Template not found / not approved | Call GET /whatsapp/templates |
| 409 | No WABA connected | Finish WhatsApp onboarding in the dashboard |
| 422 | template_required | 24h window closed — send a template first |
| 422 | template_not_sendable | Template blocked for this sender |
| 422 | invalid_recipient | Fix the to number format |
| 502 | Upstream send failed | Retry; check Meta / provider status |