Skip to main content
Use this guide when you want OTP.ID to deliver an OTP through SMS. Send channel: "sms" to POST /v3/request or POST /v3/send, then verify the user-entered code with POST /v3/verify. SMS is useful when you need broad phone-number reach. It works on basic phones and does not require a messaging app or mobile data.

Flow overview

1

Create the OTP transaction

Use POST /v3/request for an OTP.ID-generated code, or POST /v3/send for a code generated by your backend.
2

OTP.ID sends the SMS

OTP.ID delivers the OTP text message to the phone number in destination.
3

Collect the code

Ask the user to type or paste the code from their SMS inbox.
4

Verify the code

Call POST /v3/verify with the otp_id and submitted code.

Option A: OTP.ID generates the code

Request

Success response

The generated OTP code is not returned by the API. OTP.ID sends it only through SMS.

Option B: You provide the code

Request

Success response

Verify the SMS OTP

Request

Correct code response

Wrong code response

Wrong codes return HTTP 200. Always check data.verified.

Terminal error example

UI recommendations

  • Show copy such as “Enter the code we sent by SMS.”
  • Keep the destination number visible in masked form, for example +62 812••••7890.
  • Use an OTP input that supports paste and numeric keyboard on mobile.
  • Show expires_at or a countdown based on your own server time.
  • Add a Resend SMS action after cooldown.
  • If SMS delivery fails, let the user retry or switch to WhatsApp when your product supports fallback.