Verify

Hosted OTP: we send the code, you just check it

One call sends a one-time code by SMS, another checks what your user typed. You never generate, store or see the code.

4–8
digit codes
1–30 min
configurable expiry
1–10
wrong attempts before lock
Once
a code can succeed, then it is spent

How it works

  1. 1

    Create a verification

    Pass the phone number and your app name. We generate the code and send it on an OTP queue.

  2. 2

    Your user types the code

    Show your own input screen. Resend is allowed after a cool-down; the old code stops working.

  3. 3

    Check it

    valid is true exactly once. Wrong codes use attempts; too many locks the verification.

What you get

No codes on your side

Codes are kept as a keyed hash and never returned by the API or included in webhooks.

Dedicated OTP queue

Verification SMS use their own queue per route, so a marketing backlog never delays a login code.

Expiry and resend rules

Set code length and lifetime; resends wait for next_resend_at and are limited per verification.

Abuse limits

Attempt locks, per-number hourly limits and per-number SMS limits slow down SMS pumping.

Your own wording

Use the default text with your app name, or an approved template with {code} and {minutes}.

verification.verified event

Get a signed webhook when a user completes verification — the code itself is never included.

Two calls, end to end

curl -X POST https://api.lemsg.com/v1/verifications \
  -H "Authorization: Bearer $LEMSG_API_KEY" \
  -H "Idempotency-Key: signup-7f3a9c" \
  -H "Content-Type: application/json" \
  -d '{"to": "+919812345678", "app_name": "Acme", "code_length": 6, "ttl_seconds": 300}'

# 201 Created
# { "verification_id": "vrf_8K2m...", "status": "pending",
#   "attempts_remaining": 5, "next_resend_at": "...", ... }

Each code send is billed as one ordinary OTP message; checks are free.

Frequently asked questions

When should I use Verify instead of sending the code myself?

Use Verify when you would rather not generate, store and compare codes yourself. If you already have your own OTP logic, send the code with the Messages API instead.

Does a delivered SMS mean the user is verified?

No. Only a successful check marks a verification as verified. A verified number proves the user controlled that number at that moment; it says nothing about their identity.

What does Verify cost?

Each SMS that carries a code is billed at your OTP price for that country, per segment. Creating, checking and cancelling verifications is not charged.

Can I retry a check after a network error?

Yes. Send an Idempotency-Key with the check: a retry returns the first answer instead of using another attempt.

Start with Verify today

Create an account, top up and send — pay only for what you use.