Setting up the OTP API
One endpoint to send, one to verify. The API handles code generation, expiry, attempt limits, and resend cooldowns automatically. Most teams go live in under 30 minutes.
The OTP API is a narrow, opinionated pair of endpoints designed to do one thing extremely well: deliver a verification code and confirm it was entered correctly.
The two endpoints
- POST /v2/otp/send — takes a mobile number, generates or accepts a code, delivers over SMS (default), WhatsApp, or voice.
- POST /v2/otp/verify — takes the mobile number and the code the user typed, returns a true/false and a reason.
The API handles code generation, expiry (default 10 minutes), attempt limiting (default 5), resend cooldown (default 30 seconds), and idempotency. You don't store the code yourself.
Related articles in OTP & Transactional
Browse other help categories
Getting started
Create your SMSLocal account, add INR credits to your wallet, complete DLT registration, and send your first compliant SMS, WhatsApp, or OTP in under fifteen minutes.
SMS campaigns
SMS content templates, DLT routing, sender ID setup, delivery report statuses, bulk campaign scheduling, throttle controls, and automatic retry logic for India.
WhatsApp Business API
Complete guide to WhatsApp Business API — onboarding, Meta template approval, chatbot flow setup, shared team inbox, quality rating management, and conversation analytics.
AI WhatsApp Agents
Train your AI WhatsApp agent on your own knowledge, sync your product catalogue, configure handoff triggers, and serve customers across twelve Indian languages.
Did this article help?
If something isn't clear or the steps don't match what you're seeing, tell us and we'll fix the doc the same day.