Two-Factor Verification (OTP)
Generate and dispatch OTP verification code
POST
Generates a cryptographically secure random verification code (4, 6, or 8 digits), reserves credits, and dispatches via priority OTP queue with automatic 30-second cooldown protection. Supports WhatsApp-first delivery with SMS fallback.
header
X-Api-Key<token>SMS Pro API Key (sk_live_... or sk_test_...)
application/json- body
phoneNumber*stringsenderId?stringLength
length <= 11digits?integerDefault
6Value in
468expirySeconds?integerDefault
300template?stringstrategy?stringDelivery channel strategy. AUTO delivers via WhatsApp first if available, falling back to SMS.
Default
"AUTO"Value in
"AUTO""SMS_ONLY""WHATSAPP_FIRST"OTP verification dispatched successfully
application/json- response
status?stringmessage?stringdata?curl -X POST 'https://api.smspro.com/api/v1/public/otp/send' \ -H 'Content-Type: application/json' \ -d '{ "phoneNumber": "string"}'Example Response
{ "status": "string", "message": "string", "data": { "otpId": "string", "to": "string", "status": "string", "expiresAt": "2019-08-24T14:15:22Z", "resendAfterSeconds": 0, "channel": "string", "challengeNonce": "string", "proofAlgorithm": "string", "proofFormat": "string" }}