TRAI DLT-compliant routes on Jio, Airtel, Vi and BSNL

SMS API Documentation

The OnlineSMSService API is a REST API over HTTPS. You send JSON, you get JSON back, and you authenticate with an API key in a request header. Use it to send OTPs, transactional alerts and promotional messages from your own website, app, CRM or billing system.

The API at a glance: base URL https://whitelabled.securesmsc.com/api/v2 · JSON request and response · Authorization: Bearer YOUR_API_KEY · one number per call, or up to 1,000 numbers with the bulk endpoint · delivery status by API, or pushed to your URL · no SDK needed: plain HTTPS + JSON from any language · DLT-compliant, with DLT registration help at no extra charge · from ₹0.15/SMS with no setup fee · SMPP 3.4 on the Enterprise plan. Based in Coimbatore, India — phone and WhatsApp +91-9585160363.
Get a free API key + 100 test SMS. Create an account at whitelabled.securesmsc.com/register, then create a key under API & Integrations → API Management in your dashboard. Verified businesses also get 100 free SMS to test with. Before your first live message you also need an approved DLT sender ID (header) and template. The platform's own reference, with more languages, is at whitelabled.securesmsc.com/api-docs.

Interactive API Playground

Fill in a sender ID, number and message to see the exact request and copy-ready code in cURL, PHP, Node.js and Python. Our playground does not send anything; the platform's live playground sends real requests with your own key.

Open API Playground →

Authentication

Send your API key in the Authorization header as a Bearer token on every request. The header X-API-Key: YOUR_API_KEY also works. Send Accept: application/json so errors come back as JSON.

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/json

Keep the key on your server, in an environment variable or a secrets store. Never put it in a mobile app or in browser JavaScript, where anyone can read it. A missing or wrong key returns HTTP 401.

Each key is locked to IP addresses

The first IP address that uses a key successfully is added to that key's allowed IPs automatically. After that, calls from any other IP address get HTTP 403: "IP address not allowed. Please whitelist your IP address to access the API."

  • Before the first call, add every server IP address, or an IPv4 CIDR range, under API & Integrations → API Management → IP Whitelisting.
  • Don't test a server's key from your laptop first: the laptop's IP would become the key's only allowed IP.
  • Use a separate key for each server or integration. This matters most for CRMs (Salesforce, Zoho, HubSpot), serverless functions and apps on several servers, which call from many IP addresses.

GET calls are off by default

New keys accept POST only. The GET endpoints (/balance, /sms/status/{messageId}, /sender-ids, /templates and GET /sms/send) return HTTP 403 "GET method is not allowed for this API key" until you tick "Allow GET Method" for that key under API & Integrations → API Management.

Base URL and endpoints

All API requests go to:

https://whitelabled.securesmsc.com/api/v2

A plain GET on the base URL returns a public JSON document that lists every endpoint. The SMS endpoints are:

MethodPathWhat it does
POST/sms/sendSend one SMS
POST/sms/send-bulkSend the same SMS to 1 to 1,000 numbers
POST/sms/scheduleSchedule one SMS for later
GET/sms/status/{messageId}Delivery status of a message
GET/balanceYour account balance
GET/sender-idsYour approved sender IDs
GET/templatesYour approved templates

The same base URL also has WhatsApp endpoints (/whatsapp/send, /whatsapp/templates, /whatsapp/status/{messageId} and others) for accounts with the WhatsApp Business API. They are described in the platform documentation.

Rate limits: requests are limited per API key. The default is 60 requests a minute and 10,000 a day; your key's settings may differ. Above the limit you get HTTP 429 "Rate limit exceeded" with retry_after in the body and a Retry-After header. To reach many numbers, use /sms/send-bulk rather than one call per number.

GET endpoints: the status, balance, sender ID and template calls use GET, which is off for new keys. Tick "Allow GET Method" for the key first (see Authentication), or they return HTTP 403 "GET method is not allowed for this API key".

Send SMS

Send one message to one mobile number. The text must match one of your approved DLT templates, with only the variable parts changed.

POST https://whitelabled.securesmsc.com/api/v2/sms/send

Request body (JSON)

Field Type Required Description
sender_idStringYesYour approved DLT header, up to 11 characters (for example ACMEIN). Leave out the -S, -T or -P suffix.
recipientStringYesMobile number: 10 digits (9876543210) or with the country code (+919876543210).
messageStringYesMessage text, up to 1,600 characters. Must match an approved DLT template.
routeStringNotransactional (default) or promotional.
dlt_entity_idStringNoYour DLT principal entity ID (up to 20 characters). If left out, the one saved on your sender ID or account is used.
dlt_template_idStringNoThe DLT template ID for this message (up to 20 characters). If you send both dlt_entity_id and dlt_template_id, the platform skips its own template matching; the operators still check the text against DLT.
unicodeBooleanNoOptional. Unicode is detected automatically: any non-ASCII character (Tamil, Hindi, a curly quote, ₹) makes the message Unicode, with 70 characters per SMS instead of 160.
flashBooleanNotrue to send as a flash SMS.
schedule_atDate-timeNoSend later, for example 2026-11-20 09:00:00. Must be in the future. India time unless you set timezone.
timezoneStringNoTime zone for schedule_at, for example UTC. Default Asia/Kolkata.

Success response (HTTP 200)

{
  "success": true,
  "message": "SMS queued successfully",
  "data": {
    "message_id": 123,
    "queue_id": 123,
    "status": "queued",
    "estimated_delivery": "2026-11-07T09:32:00.000000Z"
  }
}

message_id and queue_id are the same number. Save it with your own record (the login attempt, the order) so you can look up the delivery status later. "Queued" means the platform accepted the message; whether it was delivered is reported afterwards. Billing is per delivered message.

Send bulk SMS

Send the same text to between 1 and 1,000 numbers in one call. The fields are the same as /sms/send, except that recipients is an array of numbers.

POST https://whitelabled.securesmsc.com/api/v2/sms/send-bulk

{
  "sender_id": "ACMEIN",
  "recipients": ["9876543210", "9876543211"],
  "message": "Dear customer, our office is closed on 14 Nov for Diwali. -Acme",
  "route": "transactional"
}

The response gives a broadcast_id, the counts and one result per number:

{
  "success": true,
  "message": "Bulk SMS processing completed",
  "data": {
    "broadcast_id": "…",
    "total_recipients": 2,
    "successful": 2,
    "failed": 0,
    "results": [
      { "recipient": "9876543210", "message_id": 124, "queue_id": 124, "status": "queued" },
      { "recipient": "9876543211", "message_id": 125, "queue_id": 125, "status": "queued" }
    ]
  }
}

Your balance must cover every number in the request. If it doesn't, nothing is sent and nothing is charged, but the call still returns HTTP 200 with "success": true: failed equals the number of recipients and every result has "status": "failed" and an error such as "Insufficient credits. Required: X, Available: Y". So always check failed and the per-number results, not only success. For lists longer than 1,000 numbers, split them into batches.

Schedule an SMS

You can add schedule_at to /sms/send or /sms/send-bulk, or use the schedule endpoint. It takes the same fields as /sms/send, with a required scheduled_at (note the "d") in the future:

POST https://whitelabled.securesmsc.com/api/v2/sms/schedule

{
  "sender_id": "ACMEIN",
  "recipient": "9876543210",
  "message": "Reminder: your appointment at Acme Clinic is on 20 Nov at 10:30 AM. -Acme",
  "scheduled_at": "2026-11-19 18:00:00"
}

Times are India time unless you add timezone. Promotional SMS still go out only between 9 AM and 9 PM.

Message status (delivery reports)

GET https://whitelabled.securesmsc.com/api/v2/sms/status/{messageId}

Pass the message_id from the send response (a broadcast ID also works). This is a GET call, so tick "Allow GET Method" for the key first (see Authentication). The response:

{
  "success": true,
  "data": {
    "message_id": "…",
    "status": "delivered",
    "recipient": "9876543210",
    "sender_id": "ACMEIN",
    "message": "Your OTP for login is 482913. …",
    "cost": 1,
    "created_at": "…"
  }
}

While a message is still waiting to go out, status shows its queue state. An unknown ID returns HTTP 404 "Message not found". Delivery reports are also in the web panel on every plan, and can be exported as CSV.

Check balance

A GET call: it needs "Allow GET Method" ticked for the key.

GET https://whitelabled.securesmsc.com/api/v2/balance

{
  "success": true,
  "data": {
    "balance": 1250,
    "currency": "INR",
    "last_updated": "2026-11-07T04:00:00.000000Z"
  }
}

Sender IDs and templates

GET /sender-ids lists the approved sender IDs on your account, and GET /templates lists your approved templates with their DLT template IDs. Both return "success": true with a list and a count inside data. Call them once when you set up, to check that the header and template your code uses are really approved. Both are GET calls, so tick "Allow GET Method" for the key first.

curl https://whitelabled.securesmsc.com/api/v2/sender-ids \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Code Examples

Each example sends one OTP with POST /sms/send and checks the result. They use only standard tools — no SDK or package of ours is needed. Put your key in an environment variable called SMS_API_KEY, and replace ACMEIN and the message with your own approved header and template.

<?php
// PHP 7.4+ with the cURL extension. No SDK or Composer package needed.
$apiKey = getenv('SMS_API_KEY');

$payload = [
    'sender_id' => 'ACMEIN',      // your approved DLT header
    'recipient' => '9876543210',  // 10 digits, or +91 and 10 digits
    'message'   => 'Your OTP for login is 482913. It is valid for 10 minutes. -Acme',
    'route'     => 'transactional',
];

$ch = curl_init('https://whitelabled.securesmsc.com/api/v2/sms/send');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => json_encode($payload),
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . $apiKey,
        'Content-Type: application/json',
        'Accept: application/json',
    ],
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
]);
$body   = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$result = json_decode((string) $body, true);

if ($status === 200 && !empty($result['success'])) {
    echo 'Queued, message ID ' . $result['data']['message_id'] . PHP_EOL;
} else {
    // Most specific first: error_code (e.g. TEMPLATE_MISMATCH), then error, then message
    $reason = $result['error_code'] ?? $result['error'] ?? 'no JSON reply';
    echo "Not sent (HTTP $status, $reason): " . ($result['message'] ?? curl_error($ch)) . PHP_EOL;
}
# Python 3 with the requests library (pip install requests). No SDK needed.
import os
import requests

API_KEY = os.environ["SMS_API_KEY"]

resp = requests.post(
    "https://whitelabled.securesmsc.com/api/v2/sms/send",
    headers={"Authorization": f"Bearer {API_KEY}", "Accept": "application/json"},
    json={
        "sender_id": "ACMEIN",
        "recipient": "9876543210",
        "message": "Your OTP for login is 482913. It is valid for 10 minutes. -Acme",
        "route": "transactional",
    },
    timeout=30,
)
result = resp.json()
if resp.status_code == 200 and result.get("success"):
    print("Queued, message ID", result["data"]["message_id"])
else:
    # Most specific first: error_code (e.g. TEMPLATE_MISMATCH), then error, then message
    reason = result.get("error_code") or result.get("error")
    print(f"Not sent (HTTP {resp.status_code}, {reason}):", result.get("message"))
// Node.js 18+ (built-in fetch). No npm package needed.
async function sendSms() {
  const res = await fetch("https://whitelabled.securesmsc.com/api/v2/sms/send", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.SMS_API_KEY}`,
      "Content-Type": "application/json",
      "Accept": "application/json",
    },
    body: JSON.stringify({
      sender_id: "ACMEIN",
      recipient: "9876543210",
      message: "Your OTP for login is 482913. It is valid for 10 minutes. -Acme",
      route: "transactional",
    }),
  });
  const result = await res.json();
  if (res.ok && result.success) {
    console.log("Queued, message ID", result.data.message_id);
  } else {
    // Most specific first: error_code (e.g. TEMPLATE_MISMATCH), then error, then message
    const reason = result.error_code ?? result.error;
    console.log(`Not sent (HTTP ${res.status}, ${reason}):`, result.message);
  }
}

sendSms().catch(console.error);
// Java 11+ (java.net.http). No SDK needed.
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class SendSms {
    public static void main(String[] args) throws Exception {
        String apiKey = System.getenv("SMS_API_KEY");
        String json = "{\"sender_id\":\"ACMEIN\","
            + "\"recipient\":\"9876543210\","
            + "\"message\":\"Your OTP for login is 482913. It is valid for 10 minutes. -Acme\","
            + "\"route\":\"transactional\"}";

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://whitelabled.securesmsc.com/api/v2/sms/send"))
            .header("Authorization", "Bearer " + apiKey)
            .header("Content-Type", "application/json")
            .header("Accept", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(json))
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());

        // HTTP 200 with "success":true means queued: read data.message_id with your JSON library.
        // On errors read error_code (if present), then error, then message.
        System.out.println(response.statusCode() + " " + response.body());
    }
}
curl -X POST https://whitelabled.securesmsc.com/api/v2/sms/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "sender_id": "ACMEIN",
    "recipient": "9876543210",
    "message": "Your OTP for login is 482913. It is valid for 10 minutes. -Acme",
    "route": "transactional"
  }'

With a wrong key, the PHP, Python and Node.js examples print Not sent (HTTP 401, Unauthorized): Invalid API key; Java and cURL print the raw reply {"success":false,"error":"Unauthorized","message":"Invalid API key"}. Each example was run on 7 Nov 2026 against the live API with a dummy key, and against a local copy of the success reply.

Error Codes

Every error is JSON with "success": false, a short error and a readable message; some also have an error_code or an errors list. Check the HTTP status first, then read error_code (when present), then error, then message.

HTTP error What it means and what to do
401UnauthorizedThe key is missing, wrong, disabled or expired, or the account is not active. message says which: "API key is required", "Invalid API key", "API key is disabled", "API key has expired" or "Account is not active".
403Forbidden"IP address not allowed. Please whitelist your IP address to access the API." — the call came from an IP that is not on the key's allowed list. Add it under API & Integrations → API Management → IP Whitelisting.
403Forbidden"GET method is not allowed for this API key" — tick "Allow GET Method" for the key under API & Integrations → API Management.
422Validation failedA field is missing or wrong. The errors object names each field, for example recipient.
422Template Verification Failederror_code is TEMPLATE_MISMATCH: the text doesn't match an approved template for that sender ID. Fix the wording, or get the template approved.
400Invalid sender ID"The provided sender ID is not authorized for your account": the sender_id is not an approved header on your account. Check it with GET /sender-ids.
400SMS dispatch failedThe message could not be queued. The errors list gives the reason, for example "Insufficient credits. Required: X, Available: Y" or "Template verification failed: …".
404Message not foundThe status lookup used an ID that doesn't exist on your account.
429Rate limit exceededToo many requests (default 60 a minute and 10,000 a day per key). Wait for the number of seconds in retry_after (also in the Retry-After header).
500Internal server errorSomething failed on our side. Retry after a short wait; contact support if it continues.

Example, with no key:

{"success":false,"error":"Unauthorized","message":"API key is required"}

Delivery Report Push (Webhooks)

Instead of polling /sms/status, you can have delivery reports pushed to your server. This is included on the Business and Enterprise plans.

Setting up

1. Make an HTTPS URL on your server, for example https://yourdomain.com/sms-dlr.

2. Set it as your delivery report (push) URL in the panel, or send it to support and we set it for you.

3. Send a test message to your own number and check that the report arrives.

What we send

When a message reaches its final status, the platform calls your URL with a GET request and four query parameters:

GET https://yourdomain.com/sms-dlr?messageid=…&status=…&number=9876543210&date=2026-11-07+10%3A15%3A02

messageid is the broadcast ID of the send (the bulk endpoint returns it as broadcast_id), status is the delivery status text, number is the recipient and date is the send time (India time).

Only final statuses are pushed. Reply with any 2xx status within 10 seconds. If your URL times out or returns an error, the platform tries once more after 60 seconds and then stops, so you can still poll /sms/status for anything you missed.

PHP example handler

<?php
// sms-dlr.php — receives delivery reports
$messageId = $_GET['messageid'] ?? '';
$status    = $_GET['status'] ?? '';
$number    = $_GET['number'] ?? '';
$date      = $_GET['date'] ?? '';

// Save the report, e.g. in your database, keyed on $messageId and $number.
// Do slow work in a queue; a report may arrive more than once.
error_log("DLR $messageId $number $status $date");

http_response_code(200); // reply 200 quickly

Developer FAQ

How quickly can we integrate the SMS API?

The API call itself takes minutes to write. What takes longer is DLT: your sender ID and template must be approved before live messages go through, which usually takes 2–7 business days. There is no sandbox mode — every call sends a real SMS and uses credits — so test with your own phone number.

Can we separate OTP and marketing traffic in one account?

Yes. Use different sender IDs and templates, and set route to transactional or promotional per message.

Is there guidance for delivery debugging?

Yes. Save the message_id of every send, check its status with /sms/status or the delivery reports in the panel, and read the message field of any error. Most failed messages are a template mismatch — check the wording against the approved template with our DLT template checker.

Language and Platform Guides

Step-by-step guides that use this API, with tested code:

Get a free API key + 100 test SMS

Create your account and generate an API key right away. Verified businesses also get 100 free test SMS once KYC and DLT mapping are done. No setup fee, no minimum top-up, and credits never expire.

Get 100 free SMS
Claim 100 free SMS