SMSLocal
OTP & Transactional

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.

4 min readUpdated 11 Mar 2026

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.

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.