One API for your 2FA codes

2FA codes. One API call.

Send OTP codes via WhatsApp, SMS or email with the aut2fa API. Set allowed channels for your application and track each send's channel, sender and available statuses.

Delivery example

Your app

POST /v1/send

  • WhatsApp
  • SMS
  • E-mail

Code delivered

+55 31 9••••-9999

Verification code

482 913

Verification completevalid: true
  • One integration, three channels
  • Free test keys
  • Prepaid balance, no monthly fee

From your first POST to a verified code

curl https://api.aut2fa.com/v1/send \
  -H "Authorization: Bearer ak_live_…" \
  -H "Content-Type: application/json" \
  -d '{"to": "+5531999999999"}'

# The user typed 482913
curl https://api.aut2fa.com/v1/send/snd_8Kq2wR7tXz/verify \
  -H "Authorization: Bearer ak_live_…" \
  -H "Content-Type: application/json" \
  -d '{"code": "482913"}'

Send status

202 Accepted

snd_8Kq2wR7tXz

  1. queued
  2. sending

    channel: whatsapp

  3. sent

    from: +55 11 9••••-0142

  4. delivered
  5. read
  6. verified

From request to verified code in three steps

Two calls from your backend. aut2fa handles everything in between.

  1. Send

    POST a phone number or e-mail address. You get the send ID right away. aut2fa generates the code unless you pass your own.

    POST /v1/send

  2. aut2fa delivers

    aut2fa chooses an allowed, active channel and an enabled sender. Your statement records available statuses with timestamps.

    GET /v1/send/{id}/status

  3. Verify

    When your user types the code, POST it to /verify. The response says if it’s valid and how many attempts are left.

    POST /v1/send/{id}/verify

WhatsApp, SMS and email through one API

For phone numbers, aut2fa tries allowed, active channels from lowest to highest price. Email addresses use the email channel. Telegram is not yet available.

+5531999999999
WhatsAppSMS
Your statement shows the channel, sender and available statuses of each send.

See what happened to every code

Track the channel, sender and timestamps of each available status. WhatsApp can report delivery and read receipts; SMS and email report provider acceptance.

Example statement
Sent atToChannelFromStatus
18:05:00+55 31 9••••-9999WhatsApp+55 11 9••••-0142Read at 18:05:04
18:04:12+55 21 9••••-4410SMS+55 11 9••••-7731Delivered at 18:04:15
18:02:30+55 41 9••••-2087WhatsApp+55 11 9••••-0388Read at 18:02:41
18:01:58+55 85 9••••-6120SMS+55 11 9••••-7731Failed, not charged
  • Automatic routing

    For each code, aut2fa picks the cheapest channel you allowed and the number that sends it. You don’t manage provider accounts.

  • Delivery receipts

    Track the statuses each channel reports. WhatsApp supports sent, delivered and read receipts; SMS and email acceptance does not confirm recipient delivery.

  • Rate limits against SMS pumping

    Every account has a ceiling on sends per minute. On top of it, turn on limits per application, per minute and per recipient per hour, to stop SMS pumping.

  • Free test keys

    ak_test_ keys are free, and codes aut2fa generates in test mode are always 000000, so your tests can run the real flow.

  • Idempotency keys

    Send an Idempotency-Key header and a retried request returns the original send instead of a second code.

  • Per-channel pricing, no monthly fee

    WhatsApp is charged when delivery is confirmed. SMS and email are charged when the provider accepts the send. Failures without a charge return the reserved balance.

Available deliveries and prices

See the price per code for each channel in Brazilian reais and calculate the cost of different quantities.

Start free
Loading prices

Free test keys to validate your integration.

SDKs for Node, PHP, Go and Python

Free and open source on GitHub. All four cover the same three endpoints.

All SDKs
  • Node.js

    npm i @aut2fa/node
  • PHP

    composer require aut2fa/aut2fa-php
  • Go

    go get github.com/jhowbhz/aut2fa-go
  • Python

    pip install aut2fa

Questions

Which channel will my user get the code on?

Phone numbers receive codes via WhatsApp or SMS; email addresses use the email channel. aut2fa tries allowed, active channels from lowest to highest price. Telegram is not yet available. Your statement shows the channel and sender used.

How do test keys work?

Keys that start with ak_test_ are free, and codes aut2fa generates in test mode are always 000000. Automated tests can run the whole flow without touching your balance.

How much does a code cost?

See the current price of each channel on the pricing page. WhatsApp is charged on delivery or read; SMS and email on provider acceptance. Test mode does not use your balance.

What if a code isn’t delivered?

If a send fails or expires without a charge, its reservation returns to your balance. Accepted SMS and email sends are already charged, even without delivery confirmation; WhatsApp is charged on delivery or read.

How do I pay?

Add balance in the dashboard using Pix or card through Mercado Pago. Prices are in Brazilian reais and there is no subscription.

How do you protect against SMS pumping?

Every account has a ceiling on sends per minute. You can also turn on limits per application: sends per minute and sends per recipient per hour. Requests over a limit get a 429 with a Retry-After header, before anything is sent.

Is it safe to retry a request?

Yes. Use the same Idempotency-Key and request body to get the original send without a new code or duplicate charge.

Can I send my own code?

Yes. Pass it in the code field, or leave the field out and aut2fa generates one. Set locale to en or pt-BR to choose the message language.

Send your first code with a free test key

Create an account, copy your ak_test_ key and run the request above.