SMSAPI
— OTP quickstart

Send and verify your first OTP

A verification is two calls. otp/send generates a code, delivers it, and returns a verification_id; otp/verifychecks the user's input against it. The code never comes back to you.

Send, then verify

Authenticate with your bearer token. On send, pass the destination and your DLT template and entity IDs; you get back a verification_id. When the user enters the code, call verify with that ID and their input, and branch on the status — verified, mismatched with attempts remaining, or expired.

# 1. Send — we generate and store the code
curl https://api.smsapi.in/v1/otp/send \
  -H "Authorization: Bearer $SMSAPI_KEY" -H "Content-Type: application/json" \
  -d '{ "to": "+919876543210",
        "template_id": "1707170000000000000",
        "dlt_entity_id": "1101400000000000000" }'
# -> { "verification_id": "vrf_8a21", "status": "sent" }

# 2. Verify the code the user typed
curl https://api.smsapi.in/v1/otp/verify \
  -H "Authorization: Bearer $SMSAPI_KEY" -H "Content-Type: application/json" \
  -d '{ "verification_id": "vrf_8a21", "code": "481920" }'
# -> { "verification_id": "vrf_8a21", "status": "verified" }

Request shapes are representative pending the white-label telco API spec (FLAGS_AND_ASSUMPTIONS.md).

Next steps

  • Auto-fill the code on Android with the SMS Retriever API.
  • — Enable voice fallback so a failed SMS still completes the verification.
  • — Read the OTP API overview for resend, expiry, and abuse caps.