Automate SMS OTPs With Programmable Identity Verification
Didit automates SMS OTPs with two endpoints: send a code by SMS, WhatsApp, Telegram or voice, then check it and get carrier, disposable and VoIP risk signals.

Contents
In this guide
Jump to the part you need.
SMS OTP automation fits teams that already send one-time codes and want delivery, validation and number risk signals handled by one API instead of a home-built sender. With Didit, phone verification costs from $0.02 plus the carrier price for the country and channel, billed per code. The caveat is scope: an OTP proves control of a number, not identity, so pair it with a document and a liveness check.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Item | Detail |
|---|---|
| Outcome | A code generated, delivered, checked and scored, with the result returned to your app |
| Endpoints | POST /v3/phone/send/ then POST /v3/phone/check/ |
| Channels | SMS, WhatsApp, Telegram, voice call, Viber |
| Price per code | Carrier price for the country and channel plus a $0.02 Didit fee. US SMS $0.0473, UK SMS $0.0783, Germany SMS $0.1145 at list price |
| Code window | 5 minutes from the first send; a retry inside the same window keeps the deadline |
| Wrong-code limit | 5 attempts per standalone verification by default |
| Risk signals | Carrier, line type, disposable, virtual, ported, plus the PHONE warning codes |
| Plans | Free plan credit does not cover phone codes; a paid Growth or Scale plan or one top-up is required before the first live code |
| Sandbox | Sandbox testing is free and unlimited |
Start free in the sandbox at business.didit.me, no sales call. For developers, connect Didit to an AI assistant through the MCP server. Every module price sits on the pricing page, and the per-country code list is on the phone price page.
What changes when the OTP step is automated
A manual OTP process means writing and maintaining the code generation, delivery, attempt counting and expiry logic yourself, then judging separately whether the number looks real. Automation moves all of that into one call pair, and the answer comes back with the number's metadata attached. That metadata is the part most home-built flows miss. A code can be delivered to a virtual number and still return Approved, so the risk fields decide what you do next.
We recommend the standalone API pair when you already own the OTP screen and want to keep your own UI. Use the session workflow instead when you want Didit to run the screen, collect the number, count attempts, and continue into a document check. Both routes return the same status values, so you can start standalone and move into a workflow later without rewriting your result handling. The Phone Verification API docs list the send, check, retry and next-channel routes, and the pricing page carries every unit price.
Prerequisites
- A Didit organization and an application. Sandbox testing is free and unlimited.
- An API key from Developers then API keys in the Business Console. Send it in the
x-api-keyheader, server side only. New keys start withsk_test_in sandbox andsk_live_in live mode. - Phone numbers in E.164 format, for example
+14155552671. A value in any other format returns HTTP 400 on send. - A paid Growth or Scale plan, or one top-up, before the first live code. Free plan credit does not cover phone codes.
- Optional risk actions configured on the workflow:
duplicated_phone_number_action,disposable_number_actionandvoip_number_action. - A place to receive the result: the check response, or the session decision payload if you use a workflow.

Automate an SMS OTP in seven steps
- Create the application and its key. Open the Business Console, choose the application from the dropdown, then Developers then API keys. The primary key has full access. Create a separate key with only the access a service needs when more than one system calls the API.
- Choose the mode. Standalone pair if your UI collects the number and the code; the two calls are paired by the phone number and the verification id. Session flow if you want Didit to run the screens: add the PHONE feature to a workflow, create a session with
POST /v3/session/sendingworkflow_id,vendor_dataandcallback, then opensession.url. - Send the code. Call
POST /v3/phone/send/with the E.164 number. Setoptions.code_size,options.preferred_channelandoptions.locale, and pass your ownvendor_datareference so the verification maps back to a user. The 5-minute window starts with the first send. - Let the user type the code. Six digits in the documented example. If the code never arrives, use the documented retry route to retry within the window, or the next-channel route to move the verification. Neither creates a second verification.
- Check the code. Call
POST /v3/phone/check/with the same phone number, the code the user typed, theverification_idfrom send, and a risk action such asvoip_number_actionset toDECLINE. Your application'sverification.max_attemptssetting defaults to 5 wrong entries. - Branch on the status, not on the digits. A correct code returns
Approved. A wrong code returnsFailedwith attempts remaining, so re-prompt.Declinedends the verification, andExpired or Not Foundmeans the window closed or no verification is pending for that number. - Chain the next check. In a session workflow the phone result sits in
phone_verifications[]on the decision payload, and the same session can continue into ID verification, passive liveness, face match and AML screening. Fetch the outcome withGET /v3/session/{sessionId}/decision/or subscribe tosession.status.updatedon a webhook.
# Step 3: send the code (standalone pair, sandbox key)
curl -X POST 'https://verification.didit.me/v3/phone/send/' \
-H "x-api-key: $DIDIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+14155552671",
"options": {
"code_size": 6,
"preferred_channel": "sms",
"locale": "en-US"
},
"vendor_data": "user-1234"
}'
# Step 5: check the code the user typed
curl -X POST 'https://verification.didit.me/v3/phone/check/' \
-H "x-api-key: $DIDIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+14155552671",
"code": "123456",
"verification_id": "PASTE_VERIFICATION_ID_FROM_SEND",
"voip_number_action": "DECLINE"
}'

Expected output
A correct code returns Approved together with the number's metadata. The check response carries the full phone record, so you can store one result and read the risk fields from it.
| Field | Value in a clean check | What you do with it |
|---|---|---|
status | Approved | Let the user continue |
| carrier and line type | mobile | Treat landline or VoIP according to your policy |
is_disposable | false | Block or review throwaway numbers |
is_virtual | false | Virtual numbers are weak proof of possession |
| ported | false | A recent port is a takeover signal worth a second look |
warnings[] | none on a clean check | Any PHONE warning changes the branch |

Failure cases and recovery
| Situation | What you see | Recovery |
|---|---|---|
| Number not in E.164 | HTTP 400 on /v3/phone/send/ | Normalize with the country code, then send again |
| Anti-abuse block | status is Blocked with reason spam | No code was sent and nothing is charged. Stop and review the number |
| Wrong digits | Failed with attempts remaining | Re-prompt. The user can retry inside the same window |
| Attempt budget exhausted | Declined with the attempts warning | The verification ended. Start a new verification with a fresh send |
| Window closed, or no pending verification | Expired or Not Found | Send a fresh code. The default window is 5 minutes |
| Message never delivered | OTP_DELIVERY_FAILED warning | Use the next-channel route, or the retry route inside the same window |
| Risky number | DUPLICATED_PHONE_NUMBER, DISPOSABLE_NUMBER, VOIP_NUMBER, INVALID_PHONE_NUMBER | Apply the workflow action you configured, or send the case to review |
| Blocked number | PHONE_NUMBER_BLOCKED | Refuse the sign-up without sending a chargeable code |
| Key problem | 401 for a wrong or revoked key, 403 for a missing key or a missing scope | Use a key with the access this route needs, from Developers then API keys |
| Rate limited | 429 with a wait field in seconds | Back off for that many seconds, then retry |
Inputs and outputs
| Field | Direction | Detail |
|---|---|---|
phone_number | Input | E.164 format. The same number is used on send and check |
options.code_size | Input | Digits in the code. The documented example uses 6 |
options.preferred_channel | Input | sms, whatsapp, telegram or voice. Delivery falls back to SMS when the channel is unavailable |
options.locale | Input | Language of the message |
options.sms_sender_name | Input | Signs one code with a different sender name, 1 to 30 characters |
vendor_data | Input | Your own user reference, kept with the verification |
verification_id | Input | Returned by send, added to check to validate that specific verification |
code | Input | The digits the user typed into your UI |
voip_number_action | Input | What to do when the number is VoIP, for example DECLINE |
status | Output | Not Started, In Progress, Approved, Declined, Failed, Expired or Not Found, Abandoned, Kyc Expired |
| carrier, line type, ported | Output | Metadata about the number behind the code |
is_disposable, is_virtual | Output | Throwaway and virtual number signals |
warnings[] | Output | PHONE risk codes, including OTP_MAX_ATTEMPTS_REACHED and OTP_EXPIRED |
Paid steps and review boundaries
Phone codes are billed per code, not per session: the carrier price for the country and channel plus our $0.02 fee. Only the $0.02 part takes the plan discount, 4% on Growth and 10% on Scale, and carrier charges pass through at cost. A send that is blocked by anti-abuse protection sends no code and costs nothing. Sending codes needs a paid Growth or Scale plan or one top-up, because Free plan credit excludes phone codes; sandbox testing stays free and unlimited either way. That carrier-plus-fee price is the documented phone verification pricing.
- A full ID check after the OTP is $0.33: document $0.15, passive liveness $0.10, face match 1:1 $0.05 and device and IP analysis $0.03.
- AML screening is $0.20 per check, and ongoing monitoring is $0.07 per person a year.
The review boundary matters more than the price. An approved OTP is an authentication factor: it shows the person holds the number right now. It does not establish that the person is who they claim to be, so a KYC decision needs the document, passive liveness and face match behind it. On the fraud side, disposable, virtual and duplicate-number warnings are the point where your policy, or a reviewer, decides rather than the code. AML hits go to a person by design.
Worked cost example
Assume 10,000 new users a month in the United States, each verified by SMS OTP, with 30% continuing to a full ID check after the code is approved. All figures are published unit prices, before tax.
- SMS codes at list price: 10,000 x $0.0473 = $473.00
- Full KYC at list price: 3,000 x $0.33 = $990.00
- Monthly total at list price: $473.00 + $990.00 = $1,463.00
On Growth the Didit fee drops 4% while the carrier price stays: $0.0473 becomes $0.0273 carrier + $0.0192 fee = $0.0465 per code. 10,000 x $0.0465 = $465.00, and 3,000 x $0.3168 = $950.40, so the month costs $1,415.40. On Scale: 10,000 x $0.0453 = $453.00 plus 3,000 x $0.297 = $891.00, or $1,344.00 for the same volume.
WhatsApp codes cost less than SMS in several countries: $0.0431 in the United States against $0.0473 by SMS. We run identity and fraud checks for 4,000+ companies. Channel prices vary by country and by channel, so the same volume can cost different amounts depending on where your users are and how they receive the code.
Sources
- Didit docs: Phone Verification API, SMS OTP and risk signals
- Didit docs: Phone Verification overview, OTP and WhatsApp
- Didit docs: Send Phone Code reference
- Didit docs: Check Phone Code reference
- Didit docs: retry a phone verification
- Didit docs: move a phone verification to the next channel
- Didit docs: phone verification warnings catalogue
- Didit docs: List Phone Verifications
- Didit docs: API authentication and key format
- Didit docs: Webhooks and session.status.updated events
- Didit docs: pricing, plans and credit rules
- Didit pricing page
- Didit phone price list by country
- Didit pricing as JSON
Next step: create a free application at business.didit.me, no sales call, and run the send and check pair with your sandbox key. Once the Approved, Failed and Expired branches behave the way you want, switch to your live key and let the codes bill against plan credit or a top-up.
Try it
Try this in the sandbox
Run the check this guide describes, free.
The product this post is about, taken from its topic. Run it free in the sandbox.
Author
Alberto Rosas
Co-founder and CEO

Questions
Frequently asked questions
What does automating SMS OTPs mean in practice?
It means one API call sends the code and a second call validates it, with the expiry, the attempt limit and the number's risk metadata handled by the provider. Didit returns the verification status plus carrier, line type, disposable, virtual and ported signals from the same check call, so you do not need a separate lookup to decide what to do with a number.
How much does Didit charge per SMS OTP?
Each code costs the carrier price for the country and channel plus a $0.02 Didit fee. At list price that is $0.0473 for a US SMS, $0.0783 for a UK SMS and $0.1145 for a German SMS. On Growth the fee is $0.0192 and on Scale $0.018, and the carrier price passes through at cost.
Can I use the free plan to send SMS codes?
No. Free plan credit does not cover phone verification codes, so a live application needs a paid Growth or Scale plan or one top-up before the first code. Sandbox testing is free and unlimited and lets you test the send and check pair without spending credit.
How long does an SMS OTP last and how many attempts does a user get?
The default window is 5 minutes from the first send, and a retry inside the same window keeps that deadline. A standalone verification allows 5 wrong code entries by default, set by your application's verification.max_attempts setting. After that the verification returns Declined and the user has to start again.
Can I send the code over WhatsApp, Telegram or a voice call instead of SMS?
Yes. Set options.preferred_channel to whatsapp, telegram or voice, and delivery falls back to SMS when the channel is unavailable. A fixed line that cannot receive an SMS may have an eligible code read out in a call instead, priced as a voice code, and that read-out never applies to a repeat, a reused pending code, a destination without voice or a sandbox send.
Can the SMS carry my company name instead of an unknown sender?
Yes. SMS codes carry your app's SMS sender name on every send at no extra cost, and you set it in the Business Console. options.sms_sender_name signs a single code with another name of 1 to 30 characters. WhatsApp codes use a fixed message, and you can connect your own WhatsApp Business number to send them under your business name.
How do I stop disposable and VoIP numbers from signing up?
Configure disposable_number_action and voip_number_action on the workflow so the check declines those numbers, or set the action per call, for example voip_number_action set to DECLINE. The check response also carries is_disposable, is_virtual and the line type, so you can write your own rule on top of the returned data.
How do I catch one phone number used across many accounts?
Set duplicated_phone_number_action on the workflow and Didit raises the DUPLICATED_PHONE_NUMBER warning when the number was already seen. You can also query the List Phone Verifications API with the phone_number filter to see the earlier records, filtered by status, channel or creation time.
Is an approved SMS OTP enough for KYC?
No. An approved OTP shows the person controls the number at that moment, which is an authentication factor, not an identity check. A full ID check adds document verification, passive liveness and face match 1:1 for $0.33. Add AML screening at $0.20 per check and the two come to $0.53.
How do I test SMS OTP automation without spending money?
Create a sandbox application in the Business Console and use its sk_test_ key as the DIDIT_API_KEY. Sandbox testing is free and unlimited, and every check is mocked, so you can exercise the Approved, Failed, Declined and Expired branches before you spend a cent.
What happens when a code is never delivered?
The check result carries an OTP_DELIVERY_FAILED warning. Use the documented next-channel route to move the verification, or the retry route to try the code again inside the same window. A message blocked by anti-abuse protection returns Blocked with reason spam, sends no code and is not charged.
Compliance built in
Audited, certified and attested.
We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center
- Regulation encoded into your flows
Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.
- Ready for AMLR
Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.
- Tested in Spain's Treasury sandbox
Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.
- Audited, not self-declared
iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.
Your obligations · 3 regions
SOC 2 Type 2
ISO 27001
iBeta Level 1 and Level 2
EU regulator attestation
FSM youth protection
GDPR
EBA remote onboarding
MiCA compatible
FIDO Alliance member
- AMLREU AML Regulation ready
Integration · Didit MCP
Run Didit from your own AI agent
Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.
- Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
- Run investigationsAsk why a session was declined, review cases, search people and companies.
- Change rulesCreate payment rules, test them on past data and switch them on.
- Pull reportsAsk for numbers, exports or the audit log.
Didit Academy


