How the flow works
- The user enters a mobile number in your app.
- Your server generates a random code and stores it with an expiry.
- Your server calls the SMS API with the number and the code in an approved transactional template.
- The operator delivers the SMS.
- The user enters the code and your server checks it.
Design tips
- Use a random code of 4 to 6 digits that expires in a few minutes.
- Allow a limited number of attempts and resends per number.
- Never log the code or send it to the client.
- Tell users not to share the code, as in the template.
Reliable delivery
- Use the transactional category and a template that matches the message exactly. See template approval.
- OTPs are not subject to the DND filter, so they reach DND numbers.
- Do not add offers to an OTP, because that makes it promotional.
Fallbacks
Offer a resend by voice call or by WhatsApp authentication message when the SMS is slow.
Cost
An OTP by SMS costs ₹0.12 plus GST on Mantraxtel, and by WhatsApp ₹0.13. See the OTP SMS price and the OTP authentication use case.
Rules are updated from time to time. Treat this page as a starting point and confirm the current position on the TRAI website or with your messaging provider before you launch a campaign.
Need help setting this up? book a demo or talk to the team. Editorial standards: editorial policy.

