Fast2SMS API Tutorial: Send OTP, DLT and Quick SMS from Your Website or App
A beginner-friendly Fast2SMS guide: account setup, the difference between OTP, DLT and Quick SMS routes, sending messages from Node.js or PHP, checking delivery and keeping costs under control.

Table of contents
What Fast2SMS is
Fast2SMS is an Indian bulk SMS service popular with small businesses and developers because it is quick to start and offers a simple HTTP API. You can send OTPs, transactional alerts with your DLT templates, and quick promotional or informational messages.

Understand the routes
| Route | Use it for | Needs your own DLT? |
|---|---|---|
| OTP | Sending numeric OTPs with a standard message | No — uses the provider’s registered template |
| DLT | Your own transactional or promotional templates and sender ID | Yes — Entity, header and template IDs |
| Quick SMS | Quick messages without your own templates | No — but usually costs more and has restrictions |
Tip: For a branded experience and the best delivery, register your own DLT templates and use the DLT route for production traffic.
Send your first message

- 1
Create an account: sign up, verify your mobile number and add wallet balance.
- 2
Get your API key: from the Dev API section of the dashboard; keep it on your server.
- 3
Add DLT details (for the DLT route): your sender ID and approved template IDs.
- 4
Call the API: send a POST request with the route, numbers and message or template details.
- 5
Check the response: store the request ID and check delivery reports in the dashboard.
const res = await fetch("https://www.fast2sms.com/dev/bulkV2", {
method: "POST",
headers: {
authorization: process.env.FAST2SMS_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
route: "otp",
variables_values: "482931", // the OTP your server generated
numbers: "9800000000",
}),
})
console.log(await res.json()) // includes a request id on successGood practices
- Generate OTPs on your server: use a cryptographically secure random generator and store only a hash with an expiry.
- Never trust the client: verify the OTP server-side and lock the account after several wrong attempts.
- Throttle requests: limit OTP sends per number and per IP.
- Watch balance: set alerts so OTPs never fail because the wallet is empty.
- Compare providers: as volumes grow, compare price per SMS, delivery speed and support across providers.
Topics
Umer Hasan
Co-Founder & CTO at Zapprex
Leads engineering, cloud infrastructure and AI automation at Zapprex Technologies, with 7+ years of full-stack and mobile experience.
Keep reading
All articlesWhatsApp Business API Explained: How to Get Access, Pricing Basics and What You Can Build
A beginner-friendly explanation of the WhatsApp Business Platform: Cloud API vs Business Solution Providers, verification, phone numbers, message templates, pricing basics, limits and the most useful use cases.
WhatsApp Cloud API Tutorial: Send Your First Message and Receive Replies with Webhooks
A developer tutorial for Meta’s WhatsApp Cloud API: create the app, get a token and phone number ID, send a template message, set up and verify webhooks, reply to customers and go to production safely.
WhatsApp Message Templates: Categories, Approval Tips and 15 Examples That Get Approved
Learn the three WhatsApp template categories, how variables, buttons and media headers work, why templates get rejected, and copy-ready examples for orders, reminders, OTPs and offers.
Questions readers ask
Fast2SMS is a paid, prepaid service; you add wallet balance and pay per message depending on the route. Check the current pricing in your dashboard.
The OTP and Quick SMS routes can be used without your own DLT registration, but for branded sender IDs and your own templates you need DLT.
No. Call it from your backend so your API key stays secret and you can apply rate limits.
Have a project in mind?
Let's build something that moves your business forward.
Share your idea, process or problem — we will come back with a clear plan, timeline and cost range. No technical spec needed.
- Founder reply within 1 business day
- NDA on request · 100% code ownership
- Talk directly to the engineers
