Skip to content
Oxtro

Blog

How to choose an SMS service for two-factor authentication

Most SMS providers can send a six-digit code. The differences show up later, in the countries where codes arrive slowly, in a bill inflated by bots, or in users who give up at the code screen. This checklist covers what to compare before you choose.

Last updated

A checklist next to a locked phone and a scale weighing two messages.

Start with where your users are

Delivery is local. A provider with excellent routes in the United States can be slow or unreliable in Algeria, India or Brazil, and the other way round. Before you compare anything else:

  • List the five or ten countries most of your sign-ups come from.
  • Ask each provider for delivery and conversion data for those countries, not a global average.
  • Run your own test: send codes to real phones on the main carriers in each country and time how long they take to arrive.

A code that arrives after 40 seconds is, for many users, a code that never arrived.

Verification API or plain SMS API

There are two kinds of product, and they suit different teams.

Verification APIPlain SMS API
Who generates and stores the codeThe providerYou
Expiry and attempt limitsBuilt inYou build them
Fallback to voice or another channelUsually built inYou build it
Fraud and SMS pumping protectionUsually built inYou build it, or you are exposed
Typical pricingPer verificationPer message

A verification API is less work and usually safer. A plain SMS API gives you full control over wording and routing, and can be cheaper at high volume if you have the time to build the rest. The top 5 verification providers shows what each major verification API offers.

Understand what you are charged for

Compare prices for your countries on each provider's pricing page, and read what each price covers:

  • Per message: every resend and every code that was never used costs money.
  • Per verification attempt: you pay once per attempt, even if it took two messages.
  • Per successful verification: you pay only when the user enters the right code. This aligns the provider's incentive with yours, but the price per verification is usually higher.

Then add the extra costs: monthly fees, sender registration, phone number rental and minimum commitments.

Protection against SMS pumping

SMS pumping, also called artificially inflated traffic, is the most expensive mistake in verification. Bots submit your sign-up form with phone numbers that earn their owners money for every message received, often in countries you do not serve. You pay for every code.

Ask each provider:

  • How do you detect pumping, and is it on by default?
  • Are blocked requests charged?
  • Can I block or allow specific countries?

Whatever the answers, add your own limits too: a CAPTCHA or bot check before the code is requested, a cooldown between resends, and a cap on codes per phone number and per IP address. Our troubleshooting guide explains how to spot an attack in your logs.

Fallback when SMS fails

Some codes will not arrive by SMS: the carrier filtered them, the phone has no signal, or the number cannot receive text messages. A good setup offers a second channel after a short wait. That might be a voice call that reads the code, an email, or a message on WhatsApp, which many users read sooner than SMS. Check whether the provider switches channels automatically or whether you have to start a new request.

Sender registration and local rules

Several countries require businesses to register before they send SMS. In the United States, application-to-person traffic on ordinary long numbers needs 10DLC registration, and toll-free numbers need verification. India requires DLT registration of the sender and the message template. Find out whether the provider handles this for you, how long it takes, and what happens to your messages in the meantime.

Autofill and the code screen

Every second the user spends switching apps to copy a code is a chance for them to leave. Check that codes work with:

  • autocomplete="one-time-code" on web forms, which lets iOS and macOS suggest the code from the incoming SMS;
  • the SMS Retriever API on Android apps, which needs a specific message format that includes your app's hash;
  • the WebOTP API in Chrome on Android, which uses a final line such as @example.com #123456.

The provider must let you control the message format for these to work.

Security and data protection

SMS is the weakest of the common second factors. NIST's digital identity guidelines (SP 800-63B-4) treat SMS and voice codes as a restricted authenticator: still allowed, but only with a risk assessment and an alternative offered to users. If you protect money or sensitive data, offer an authenticator app or passkeys alongside SMS. Read SMS vs authenticator apps vs WhatsApp codes for the trade-offs.

On the provider side, ask where phone numbers and logs are stored, how long they are kept, and whether the provider signs a data processing agreement. If you serve users in the EU, you need one.

A one-page checklist

  • Delivery tested on real phones in your top countries
  • Pricing model understood, including resends and failed attempts
  • SMS pumping protection on by default, with country controls
  • Automatic fallback to a second channel
  • Sender registration handled for the countries that require it
  • Message format you control, for autofill
  • Rate limits and cooldowns, on the provider and in your own code
  • A data processing agreement, and data stored where you need it
  • An alternative to SMS for users who want a stronger factor

If your users live on WhatsApp, also consider sending the code there. Oxtro's WhatsApp OTP API sends codes from your own WhatsApp number in two API calls.

Connect your first number today

Create a workspace, scan the QR code and send a message.

Create account