SMS Gateway API: Send SMS from Your App in Five Minutes
Our SMS gateway API sends OTPs, alerts and campaigns from your app with one HTTPS request. Create an API key, paste a sample in PHP, Python, Node.js, Java or cURL, and send your first SMS in about five minutes once your DLT header and template are approved.

An SMS gateway API lets your software send SMS with an HTTPS request instead of a web panel. Our v2 REST API takes the sender ID, number, message and route as JSON with a Bearer key and returns a message ID. In India the text must match an approved DLT template, and the platform finds that template for you.
Send your first SMS from code
With your DLT header and template approved, sending takes about five minutes.
- Create your API key under API Management in the panel.
- Copy the sample for your language and add your key and header.
- Send to your own number and keep the message_id from the reply.
- Add a delivery report URL on the Webhooks page, then go live.
Sign-up and API keys are free. Sending needs credits, from 5,000 SMS. Need a plain URL for older software? Use the SMS HTTP API.
# Send an OTP with your DLT-approved template curl -X POST "https://whitelabled.securesmsc.com/api/v2/sms/send" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"sender_id": "ACMEIN", "recipient": "919812345678", "message": "482913 is your login OTP for AcmeIn. Valid for 10 minutes. - AcmeIn", "route": "transactional", "dlt_template_id": "1107XXXXXXXXXXXXXXX"}' # dlt_template_id and dlt_entity_id are optional: without them the text is matched to your approved templates
$ch = curl_init("https://whitelabled.securesmsc.com/api/v2/sms/send"); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("SMS_API_KEY"), "Content-Type: application/json"], CURLOPT_POSTFIELDS => json_encode([ "sender_id" => "ACMEIN", "recipient" => "919812345678", "message" => "482913 is your login OTP for AcmeIn. Valid for 10 minutes. - AcmeIn", "route" => "transactional", "dlt_entity_id" => "1101XXXXXXXXXXXXXXX", "dlt_template_id" => "1107XXXXXXXXXXXXXXX", ]), ]); $res = json_decode(curl_exec($ch), true); echo $res["data"]["message_id"] ?? $res["message"];
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" }, body: JSON.stringify({ sender_id: "ACMEIN", recipient: "919812345678", message: "482913 is your login OTP for AcmeIn. Valid for 10 minutes. - AcmeIn", route: "transactional", dlt_entity_id: "1101XXXXXXXXXXXXXXX", dlt_template_id: "1107XXXXXXXXXXXXXXX", }), }); const { data } = await res.json(); console.log(data.message_id, data.status);
import os, requests r = requests.post( "https://whitelabled.securesmsc.com/api/v2/sms/send", headers={"Authorization": f"Bearer {os.environ['SMS_API_KEY']}"}, json={"sender_id": "ACMEIN", "recipient": "919812345678", "message": "482913 is your login OTP for AcmeIn. Valid for 10 minutes. - AcmeIn", "route": "transactional", "dlt_entity_id": "1101XXXXXXXXXXXXXXX", "dlt_template_id": "1107XXXXXXXXXXXXXXX"}, timeout=15, ) print(r.json()["data"]["message_id"])
import java.net.URI; import java.net.http.*; String msg = "482913 is your login OTP for AcmeIn. Valid for 10 minutes. - AcmeIn"; String body = "{\"sender_id\":\"ACMEIN\",\"recipient\":\"919812345678\"," + "\"route\":\"transactional\",\"message\":\"" + msg + "\"}"; HttpRequest req = HttpRequest.newBuilder(URI.create("https://whitelabled.securesmsc.com/api/v2/sms/send")) .header("Authorization", "Bearer " + System.getenv("SMS_API_KEY")) .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); HttpResponse<String> res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString()); System.out.println(res.statusCode() + " " + res.body()); // 200: data.message_id
Code in five languages
Copy-ready samples for PHP, Python, Node.js, Java and cURL.
Delivery webhooks
Final delivery status is pushed to your URL, so you do not have to poll.
DLT matching built in
Send the text, and the platform matches it to your approved template.
High throughput
The platform handles up to about 10,000 SMS a second at peak.
How the SMS gateway API works
You create an API key in the panel and call our endpoint over HTTPS from your server. Each request carries the sender ID, the mobile number, the message text and the route. The API checks the request, queues the message and returns a message ID straight away. For campaigns, the bulk endpoint takes up to 1,000 numbers in one request.
Store the message ID with your own record, such as an order or a login attempt. Final delivery statuses are pushed to the delivery report URL you set in the panel, and you can also look up a message's status with a GET request once read access is switched on for your key.
Pick the style that suits your stack. The REST API takes JSON over HTTPS and suits new apps. The SMS HTTP API takes the same values as URL parameters, which suits older ERP and billing software. The XML API serves systems that already exchange XML. All three support scheduling and Unicode.
Uptime, routes and capacity
The platform runs 24×7 with a 99.9% uptime target, on direct connections to Jio, Airtel, Vi and BSNL with 6 or more redundant routes. It handles up to about 10,000 SMS a second at peak and carries more than 1 billion messages a year for AvanceZone's customers. OTPs are typically delivered in a few seconds, and each final status reaches your delivery report URL.
DLT details the API needs
If the text matches no approved template, the message fails. Copy templates from the panel instead of retyping them in code.
- Sender ID: your approved 6-character header, such as ACMEIN.
- Message text that matches an approved template exactly, with each {#var#} replaced by a value of up to 30 characters.
- Template ID (optional): send dlt_template_id to name the template, or leave it out and the platform matches your text against your approved templates.
- Entity ID (optional): it defaults to the one saved on your sender ID or account.
- Unicode: set unicode to true for Tamil, Hindi or emoji text, or let the API detect it.
Delivery reports and error handling
Set a delivery report URL on the Webhooks page of the panel. When each number reaches a final status, the platform calls it with the broadcast ID, the mobile number, the status and the IST send time. Reply with any 2xx status quickly and process the data in the background. A report is tried twice if your server does not answer, so ignore one you have already stored.
Split errors into two groups. Timeouts and server errors are safe to retry after a short wait that grows each time. Validation errors, such as an unapproved sender ID, an invalid number or a low balance, will fail again, so log them and alert your team. For campaigns, send many numbers in one bulk request instead of one call per number.
OTP best practice and SMS pumping protection
OTP traffic needs a template on a service or transactional header, so it reaches DND numbers at any hour. SMS pumping is a fraud where bots trigger OTPs to many numbers to run up your bill. It often shows up as a sudden spike in OTP requests with very few codes entered. A few rules stop most of it.
- Use 4 to 6 digit codes that expire in 5 to 10 minutes, with one active code per user.
- Add a resend cooldown and a daily cap per number, per IP and per device.
- Put a captcha or similar check before the OTP request on signup pages.
- Allow only the country codes you serve and block the rest.
- Track OTPs sent against OTPs verified and alert on sudden drops.
- Keep API keys on your server, never inside app or browser code.
Step-by-step guides
Detailed guides from the AvanceZone team, checked against the operator portals.
Send SMS from PHP
cURL-based examples for the v2 send endpoint.
Read the guide →Send SMS from Node.js
fetch examples, bulk sends and delivery status.
Read the guide →Send SMS from Python
requests examples with error handling.
Read the guide →Send SMS from Java
HttpClient examples for Java services.
Read the guide →SMS API in Laravel
A Laravel service class and queued sends.
Read the guide →Send WhatsApp messages from PHP
Sending approved WhatsApp templates through the API.
Read the guide →Sending outside India too?
We also send SMS and WhatsApp messages to customers abroad, with help on each country's sender ID and consent rules.
How it works
Create your API key
Sign up, then create a key under API Management in the panel.
Add your header and templates
Add your approved DLT header and templates in the panel, or let us help register them.
Paste a code sample
Copy the sample for your language, add your key and send to your own number.
Set your webhook and go live
Add a delivery report URL, then switch on production traffic with OTP limits in place.
Frequently asked questions
How do I integrate an SMS API into my website or app?
Create an API key in the panel, then make an HTTPS request from your server with the sender ID, mobile number, message text and route. Any language that can call a URL works, including PHP, Python, Node.js, Java and .NET. Test with your own number first, then set up your delivery report URL.
How fast can I start sending?
If your DLT header and template are already approved, it takes about five minutes: create a key, paste a sample and send. If not, DLT approval usually takes 2 to 7 working days, and our team helps you register at no service charge. Operator fees for DLT are paid to the operator.
Is there a free API key or trial?
Signing up and creating an API key cost nothing, but sending needs SMS credits. There is no free trial. The smallest purchase is 5,000 SMS, which costs ₹1,000 plus GST at the Starter rate of ₹0.20, and credits stay valid for a year.
Do I have to send the DLT template ID?
No. The v2 API accepts dlt_template_id and dlt_entity_id, but both are optional. Without a template ID, the platform matches your text against the approved templates saved under your sender ID. The text must still match an approved template, with only the {#var#} parts changed.
How do I get delivery reports through the API?
Set a delivery report URL on the Webhooks page of the panel. When each number reaches a final status, the platform calls that URL with the broadcast ID, number, status and IST send time. Your server should reply with a 2xx status quickly. Reports are also visible in the panel's MIS report.
Can I send Tamil or Hindi SMS through the API?
Yes. Send the text in UTF-8 and set unicode to true, or let the API detect it. Unicode messages hold 70 characters in one part and 67 per part once split, so check the length before you register the template. The same template rules apply as for English messages.
Send your first SMS today
From ₹0.15 per delivered SMS, credits valid for a year, and DLT help from a real person.
