How to send OTP SMS to India from outside India
Written and reviewed by the DiOTP team Published 30 November 2026Last updated 30 November 2026
8 min read
If your company is based outside India and you need to send SMS to India, the rules are different from most countries you may already serve. India requires every commercial SMS to match a sender name and message template registered on a national system called DLT, and operators handle traffic arriving from abroad under their own separate rules. This guide is for global apps and foreign businesses with Indian users. It covers why those rules exist, how to format an Indian number, timing, billing, and how to choose between a global provider and an India-focused one for phone verification.
Why SMS to Indian numbers works differently
India regulates commercial SMS more tightly than most markets. Under TRAI's TCCCPR 2018 rules, a business sending SMS in India registers its entity, its sender names (called headers) and the exact wording of its messages (content templates) on a DLT platform run by an operator such as Jio, Airtel, Vi or BSNL. When a message reaches the network, the operator checks it against those records. If the header or wording does not match, the message is blocked.
For a business abroad, this raises two practical points. First, commercial SMS to an Indian number has to fit a registered header and template, wherever it was sent from. A login code that works in other countries with any wording you like will not simply pass through. Second, operators treat traffic that comes in over international routes differently from traffic that starts inside India. The handling, the sender name shown and the cost can all differ, and each operator sets its own approach. We will not quote figures here, because they are set by the operators and can change, but it is worth asking any provider how your messages to India will be carried and billed.
The core rule is simple: an OTP to an Indian number needs a registered header and a matching template. Everything else in this guide follows from that.
How to format an Indian mobile number
An Indian mobile number has 10 digits and starts with 6, 7, 8 or 9. The country code is +91. Users type their number in many ways, so clean it on your server before you send anything.
| User typed | What to do | Send as |
|---|---|---|
| +91 98765 43210 | Remove the +91, spaces and symbols | 9876543210 |
| 09876543210 | Remove the leading 0 | 9876543210 |
| 919876543210 | Remove the leading 91 when 12 digits remain | 9876543210 |
| 98765-43210 | Remove the hyphen | 9876543210 |
After cleaning, check that exactly 10 digits remain and the first is 6 to 9. Reject anything else with a clear message on the form rather than spending a send on a number that cannot receive it. Landline numbers cannot receive SMS codes, so a mobile-only check also saves money.
Normalise an Indian mobile number (TypeScript)
export function toIndianMobile(input: string): string | null {
let digits = input.replace(/\D/g, '')
if (digits.length === 12 && digits.startsWith('91')) digits = digits.slice(2)
if (digits.length === 11 && digits.startsWith('0')) digits = digits.slice(1)
return /^[6-9]\d{9}$/.test(digits) ? digits : null
}
// toIndianMobile('+91 98765 43210') returns '9876543210'
// toIndianMobile('12345') returns nullTime zone and sending hours
India runs on a single time zone, India Standard Time (IST), which is UTC+5:30. There is no daylight saving, so the offset stays the same all year. That half-hour offset catches out schedulers that assume whole hours, so store times in UTC and convert only for display.
OTPs are service messages and are sent at any hour, because a user asked for them. Promotional SMS is a different category: it can only be sent during daytime hours in India and is not delivered to numbers registered on the Do Not Disturb list for that category. If your team plans marketing campaigns from another time zone, schedule them against IST. For codes, none of this applies, but it is a good reason to keep marketing and OTP traffic clearly separate.
Option one: a local India SMS API with a shared template
The fastest route for a foreign company is often an India SMS service provider that already has a registered header and a pre-approved OTP template. You call its API with the user's number, and the code goes out under that provider's registered sender, on wording already approved by the operators. You do not need an Indian entity on DLT to get started.
DiOTP works this way. You can send OTPs without DLT registration of your own on the same day, using our registered header and shared OTP template. Later, if you register your own entity, header and template, you add them under Senders in the dashboard and codes go out under your brand, with no code change.
Our India SMS API is a single REST call. You pass the 10-digit number as to and 91 as country_code, and DiOTP generates the code, sends it, and checks it when the user types it in. Your server never sees the code. Full details are in the API docs and the send OTP reference.
Send an OTP to an Indian number (Node.js 18+)
const res = await fetch('https://api-diotp.diorbit.com/v1/otp/send', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DIOTP_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID(),
},
body: JSON.stringify({
to: '9876543210',
country_code: 91,
channel: 'sms',
purpose: 'login',
}),
})
const data = await res.json()
if (!res.ok) throw new Error(data.error.code)
// Keep data.request_id; you need it to verify the code.
console.log(data.request_id, data.expires_at)Run this on your server, never in a browser or mobile app. The API key lets anyone send codes and spend from your wallet, so it belongs in an environment variable such as DIOTP_API_KEY. The Idempotency-Key header means a network retry with the same key and body returns the first response instead of sending a second code. To check the code, call POST /v1/otp/verify with the request_id and what the user typed, as shown in the verify OTP reference.
Billing in rupees, with GST invoices
A local provider bills in Indian rupees. DiOTP uses a prepaid wallet with no setup or monthly fee, and credits never expire. Messages stopped by a limit before sending are not charged. Verifying a code is free. We issue GST invoices, and prices are shown before 18% GST on our pricing page.
| Wallet top-up | Price per OTP SMS, before GST |
|---|---|
| ₹100 | ₹0.40 |
| ₹3,600 | ₹0.35 |
| ₹5,000 | ₹0.33 |
| ₹50,000 | ₹0.26 |
For a foreign company, rupee billing has two sides. Prices are predictable for Indian traffic and easy to compare with local costs. On the other hand, your finance team will be paying in a currency other than its own, so check how your card or bank handles that before you top up a large amount.
Global SMS API or an India-focused one?
There is no single right answer, and it depends mostly on where your users are. A global SMS API (you will see it listed as an SMS API global or SMS API worldwide plan) gives you one account, one contract and one integration for many countries. If India is one of twenty markets you serve in similar numbers, that simplicity is worth a lot.
An India-focused option, an SMS gateway for India rather than for the whole world, makes more sense when Indian users are a large share of your sign-ups, or when India is where delivery problems show up. A local provider deals with DLT every day, already holds registered headers and templates, bills in rupees and supports you in IST.
| Your situation | Usually fits better |
|---|---|
| Users spread across many countries | A global SMS API is usually simpler |
| India is your largest or fastest-growing market | An India-focused provider is worth testing |
| You need codes to India today, with no Indian entity | A local API with a shared, pre-approved template |
| You want one bill for every country | A global provider |
| You want rupee pricing and GST invoices | A local provider |
Many teams run both. They keep a global provider for most countries and route numbers starting with +91 to an India-focused API. Because the routing decision is just the country code, this takes a few lines of code, and it lets you compare delivery and cost on real traffic.
Checklist before you go live in India
- Clean every number to 10 digits starting with 6 to 9, and send country_code 91.
- Use a provider with a registered header and an approved OTP template, or register your own.
- Keep your API key on the server only.
- Store times in UTC and display them in IST for Indian users.
- Keep OTP and marketing traffic separate.
- Watch how many codes are verified, not just how many are sent.
New DiOTP accounts start in test mode, with free messages that go only to the mobile number verified at sign-up. You can go live from the dashboard after a business check, using the same keys. Support is by email at otp-support@diorbit.com, Monday to Friday, 10:00 to 19:00 IST.
