SMS API
Sends an SMS using your DLT-registered sender ID and template and returns a message ID, then the delivery status by webhook.
- Source
- Indian telecom operators through DLT-compliant SMS routes
- Turnaround
- Usually delivered within seconds
- Endpoint
- POST /v1/sms/send
- Who can use it
- Businesses registered on a DLT platform with approved sender IDs and templates, as required by TRAI.
Overview
Every OTP and alert you send in India has to use a sender ID and template registered on a DLT platform under TRAI rules. The SMS API sends messages using your registered sender ID and templates, fills in the variables, and reports delivery back to your webhook. It's what you'll use for login OTPs, KYC reminders and loan alerts.
Good to know
Messages that don't exactly match a registered template will be blocked by operators. Delivery depends on the recipient's network and phone.
What you get
- DLT readySend with your DLT-registered sender ID and template ID. We help you check templates before they're rejected.
- OTP priority routingOTP messages use routes meant for time-sensitive traffic.
- Delivery reportsDelivered or failed status, with operator reasons, sent to your webhook.
- Unicode supportSend in Hindi and other Indian languages. Remember Unicode messages use more units.
Request
POST https://api.ampletrails.com/v1/sms/send
| Field | Type | Status | Description |
|---|---|---|---|
to | string | Required | Recipient mobile number |
sender_id | string | Required | DLT-approved 6-character sender ID |
template_id | string | Required | DLT-registered template ID |
variables | object | Optional | Values for template placeholders |
callback_url | string | Optional | Webhook for delivery reports |
Response
Fields inside data. Every response also carries status, request_id and, on errors, message. See error codes.
| Field | Meaning | Example |
|---|---|---|
message_id | Message identifier | sms_9d04b1 |
status | accepted, delivered, failed | accepted |
units | SMS units charged (based on length) | 1 |
submitted_at | Time the message was submitted | 2026-12-04T10:15:22+05:30 |
delivered_at | Time the operator confirmed delivery (in the webhook) | null |
Example
curl -X POST https://api.ampletrails.com/v1/sms/send \
-H "Authorization: Bearer $AMPLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "9876543210", "sender_id": "AMPLTR", "template_id": "1107160000000000000", "variables": "{\"otp\":\"482913\"}", "callback_url": "https://example.com/webhooks/sms"}'import os, requests
resp = requests.post(
"https://api.ampletrails.com/v1/sms/send",
headers={"Authorization": f"Bearer {os.environ['AMPLE_API_KEY']}"},
json={
"to": "9876543210",
"sender_id": "AMPLTR",
"template_id": "1107160000000000000",
"variables": "{\"otp\":\"482913\"}",
"callback_url": "https://example.com/webhooks/sms"
},
timeout=30,
)
resp.raise_for_status()
print(resp.json()["data"])const resp = await fetch("https://api.ampletrails.com/v1/sms/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AMPLE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"to": "9876543210",
"sender_id": "AMPLTR",
"template_id": "1107160000000000000",
"variables": "{\"otp\":\"482913\"}",
"callback_url": "https://example.com/webhooks/sms"
}),
});
const { data } = await resp.json();$ch = curl_init("https://api.ampletrails.com/v1/sms/send");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AMPLE_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(["to" => "9876543210", "sender_id" => "AMPLTR", "template_id" => "1107160000000000000", "variables" => "{\"otp\":\"482913\"}", "callback_url" => "https://example.com/webhooks/sms"]),
]);
$data = json_decode(curl_exec($ch), true)["data"];{
"status": "success",
"request_id": "req_7f3a9c21e4",
"data": {
"message_id": "sms_9d04b1",
"status": "accepted",
"units": 1,
"submitted_at": "2026-12-04T10:15:22+05:30",
"delivered_at": null
}
}Example data. The exact field list for your account comes with your sandbox documentation.
Use cases
Login and transaction OTPs
Send one-time passwords for sign-in, consent and payouts.
KYC reminders
Remind customers who left their KYC half-way, with a link to continue.
Loan and payment alerts
EMI reminders, disbursal confirmations and payment receipts.
Questions about this API
Do we need our own DLT registration?
Yes. TRAI rules require the business sending messages to register as a principal entity on a DLT platform and register its sender IDs and templates. We can guide you through it.
Why was my message not delivered?
The most common reasons are a template mismatch with DLT, a number on the DND list for promotional traffic, or the phone being off. The delivery report tells you which.
Can we send promotional SMS?
Only with promotional templates and to numbers not on DND for that category. Most teams use this API for transactional and service messages.
How are units counted?
One unit covers up to 160 standard characters or 70 Unicode characters. Longer messages are split and charged per part.
Try the SMS API
Sandbox keys, the full field reference and a Postman collection, usually within a working day.