Phone Verification API: Send and Check SMS OTP Codes
A phone verification API sends an OTP to a number and checks the code the user types back. Didit charges a $0.02 fee per code plus the carrier price, and returns carrier and VoIP risk data.

Contents
In this guide
Jump to the part you need.
A phone verification API lets your server send a one-time code to a number and check the code the user types back, without you building SMS delivery. It fits signup, login and account recovery where you must prove someone controls a number. Didit charges a $0.02 fee per code plus the carrier's price, so a US SMS code is $0.0473 at list. The caveat: phone codes sit outside Free plan credit, and a code expires after 5 minutes.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Item | Detail |
|---|---|
| What it does | Sends an OTP, checks it, returns carrier and risk signals |
| Send call | POST /v3/phone/send/ on verification.didit.me |
| Check call | POST /v3/phone/check/ on verification.didit.me |
| Risk without an OTP | POST /v3/phone/risk/ scores carrier, line type, porting and fraud risk; read lookups with GET /v3/phone/lookups/ |
| Channels | WhatsApp (default), SMS, Telegram, voice, Viber, with SMS fallback where the channel is offered |
| Code window | 5 minutes from the first send; a same-window retry keeps that deadline |
| Wrong-code limit | verification.max_attempts defaults to 5 per standalone verification |
| Price per code | Carrier price plus $0.02. US SMS $0.0473, UK SMS $0.0783, Germany SMS $0.1145 |
| Auth | x-api-key header, key from Business Console then Developers then API keys |
| Records | GET /v3/phone/verifications/, filterable, CSV export available |
Start free in the sandbox at https://business.didit.me/ (no sales call), where phone checks are mocked and never billed. Developers wiring Didit into an AI assistant can connect the Didit MCP server instead of writing HTTP calls by hand.
What a phone verification API does, and what it does not
Two calls do the work. POST /v3/phone/send/ takes a phone number and a channel and sends a one-time passcode. POST /v3/phone/check/ takes the same number and the code, and returns the verification status plus phone metadata: carrier, line type, whether the number is disposable, whether it is a virtual or VoIP number, and whether it was ported. The standalone phone verification documentation lists every endpoint in the set, the Didit Phone Verification page covers the product itself, and every per-call price is on Didit pricing.
That metadata is the part buyers underestimate. A code proves control of a number for five minutes. It does not prove the number belongs to a real person, that the SIM was not swapped, or that the person is who they claim to be. Pair phone verification with device and IP analysis, and with an ID document and biometrics check when the account can move money.
Where a phone check earns its price
- Signup and login on marketplaces, social apps and fintech onboarding, where duplicate accounts are the main abuse.
- Account recovery, so a password reset goes to a number the user already proved.
- Step-up before a payout, a card change or a large transfer.
- Contact hygiene, so you stop sending codes and alerts to dead or virtual numbers.
We run identity and fraud checks for 4,000+ companies across 220+ countries and territories, and phone verification is one module inside that scope rather than a separate product.
Prerequisites before you send your first code
- A Didit application and its API key. In the Business Console open Developers, then API keys. New sandbox keys start with
sk_test_and new live keys start withsk_live_; older keys may have no prefix and still work, so never validate a key by its prefix. Keep it on the server and never in a browser or mobile bundle. - The number in E.164 format, for example
+14155552671. Any other format returns HTTP 400 on the send call. - A screen where the user types the code, and a written decision on what your system does when a result carries a warning.
- A paid Growth or Scale plan, or your organization's first top-up, before live codes can be sent. Phone codes are excluded from Free plan credit. The sandbox is free on every plan.
How to verify a user by SMS with the API, step by step
Choose the integration mode. The standalone API is for your own UI: your form collects the number, your server calls send, the user types the code into your screen. Session mode is for the hosted flow or the native SDKs, where Didit collects the number and the code for you and the result lands in
phone_verifications[]on the decision payload. The steps below use the standalone API.Format the number as E.164. Country code, no spaces, no leading zero. Store the string you send, because the check call must carry the same number and, per the docs, the
verification_idfrom the send response so it verifies that specific attempt.Pick the delivery channel.
whatsappis the default, andsms,telegram,voiceandviberare also accepted inoptions.preferred_channel. Channel availability depends on the country and the route: the phone price list shows which channels each country offers, and delivery falls back to SMS when the preferred channel is unavailable. If you want SMS, say so explicitly so the fallback never surprises you.Send the code. This call is runnable against a sandbox key. Store the
verification_idit returns.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" }'Ask the user for the code. Show the number the code went to and a resend control that respects the 5-minute window.
Watch the clock. The default code window is 5 minutes from the first send, and a retry inside the same window keeps that deadline. Use the documented retry call for a phone verification to reissue the code in the same window instead of starting a new send, and the move to the next channel call when the channel itself is the problem.
Check the code. Send the same number, the code the user typed, the
verification_id, and your VoIP policy invoip_number_action.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", "verification_id": "<VERIFICATION_ID>", "code": "123456", "voip_number_action": "DECLINE" }'Read the result, not just the status. The check response carries the full phone metadata: carrier, line type, disposable, VoIP and ported. Store it with the session so your risk rules and your auditors can read it later.
Handle wrong codes without guessing. A wrong code returns
Failedwith attempts remaining, so re-prompt. At the configured limit the verification moves toDeclinedand carries theOTP_MAX_ATTEMPTS_REACHEDwarning. Restarting means a new send, never a retry of an exhausted verification.Audit with the list endpoint.
GET /v3/phone/verifications/returns records newest first and filters by status, channel, phone number, reference, akey:valuetag and creation time. Addformat=csvfor an export, and send thenextvalue back asoffsetto page.


code_size decides the field length, and the retry control has to live next to it.Expected output from a clean verification
A successful run ends with status set to Approved, an empty warnings[] array, and phone metadata that matches what you expect for that number. Use this list as your acceptance checklist, but read the carrier type, the disposable status and the virtual-number status as expected-value checks against your own risk policy, not as pass or fail: a legitimate number can be a landline, and a legitimate customer can use a VoIP number.
statusisApproved, one of the documented values alongsideNot Started,In Progress,Declined,Failed,Expired or Not Found,AbandonedandKyc Expired.carrier.typeismobilefor a handset. Store the carrier name with the result and, if your policy depends on it, compare it against your own records.is_disposableis false andis_virtualis false.- No warning codes in
warnings[]. The catalogue isDUPLICATED_PHONE_NUMBER,DISPOSABLE_NUMBER,VOIP_NUMBER,INVALID_PHONE_NUMBER,OTP_DELIVERY_FAILED,OTP_MAX_ATTEMPTS_REACHED,OTP_EXPIREDandPHONE_NUMBER_BLOCKED.
In a sandbox application every external provider, phone included, is mocked and no session is billed. That means you can drive every status and every warning before you spend a cent, then switch the environment variable to a live key.

Failure cases and recovery
| What you see | Meaning | Recovery |
|---|---|---|
HTTP 400 on /send/ | The number is not E.164 | Fix the formatting before the call, not after |
status is Blocked with reason set to spam | Anti-abuse block. No code is sent and nothing is charged | Do not loop. Log the case and route it to your own review |
Check returns Failed | Wrong code, attempts remain | Re-prompt and show how many tries are left |
Check returns Declined | The verification ended. If the attempts warning is present, the limit was hit | Start a fresh send, or block the account if the pattern repeats |
Check returns Expired or Not Found | Outside the 5-minute window, or no pending verification for that number | Restart the flow with a new send |
Warning OTP_DELIVERY_FAILED | The channel did not deliver | Use the retry call in the same window, move to the next channel, or fall back to a voice code |
| HTTP 401 or 403 | Key wrong, revoked, missing, or scoped without access | Issue a new key in Developers, then API keys |
| HTTP 429 | Rate limit. The response carries a wait field in seconds | Back off for that many seconds, then retry once |
Inputs and outputs
| Field | Direction | Notes |
|---|---|---|
phone_number | Input | E.164. Same value on send and check |
options.code_size | Input | Digits in the code, 6 in the documented example |
options.preferred_channel | Input | whatsapp, sms, telegram, voice or viber |
options.locale | Input | Language of the message, for example en-US |
options.sms_sender_name | Input | Overrides the application sender for one code, 1 to 30 characters |
vendor_data | Input | Your own reference, echoed back for matching |
code | Input | What the user typed |
verification_id | Input | Returned by send, added to check to target that attempt |
voip_number_action | Input | Policy for a VoIP number, for example DECLINE |
status | Output | One of the documented status values |
warnings[] | Output | Risk codes listed above |
carrier and line type | Output | Carrier name and whether the line is mobile, landline or VoIP |
is_disposable, is_virtual, ported | Output | Risk signals returned with the check |
Risk signals and what to do with them
Three signals carry most of the value. A disposable number is a throwaway, so treat a signup from one as a lower-trust account. The API returns is_virtual for VoIP and virtual numbers, and that signal and the disposable flag are inputs your risk policy can act on, which is why you can pass voip_number_action at check time and set matching actions for duplicates, disposable and VoIP numbers on the workflow in session mode. A ported number has moved networks, which is a normal event but worth weighting when it happens minutes before a payout.
If you only want the risk picture and no code, call POST /v3/phone/risk/. It scores the carrier, the line type, porting and fraud risk of a number without sending an OTP, so you can filter a large batch of numbers before you send any codes. That call is not a verification: it does not appear in GET /v3/phone/verifications/, and lookups are read with GET /v3/phone/lookups/. The endpoint and its fields are documented in the Score Phone Risk reference, and its price sits on its own line of the public price book, so read that line before you batch thousands of numbers.
Session mode or standalone API
Use the standalone API when the phone step is one part of a UI you already own and you want your own error copy. Use session mode when the check sits inside a wider Didit verification, because the workflow builder lets you add the phone step next to ID, liveness and AML and returns everything in one decision. In session mode, create the session with POST /v3/session/, send the user to session.url, then read GET /v3/session/{sessionId}/decision/ or listen for session.status.updated, and read the phone results from phone_verifications[].
Branding works the same in both modes. SMS codes carry your application's SMS sender name, so the message reads like "123456 is your verification code for Acme Bank", at no extra cost, set in the Business Console. WhatsApp codes use a fixed message until you connect your own WhatsApp Business number.
Paid steps and where a human should review
Billing is per code: the carrier's price for the country and channel, plus Didit's $0.02 fee. The $0.02 fee is the only part the plan discount touches, and the carrier part passes through at cost. A spam-blocked send produces no code and no charge. A fixed line that cannot take SMS may be read out in a call and is priced as a voice code, and that never applies to a repeat, a reused pending code, a destination without voice or a sandbox send. A risk lookup is a separate call from a verification, and sandbox usage is never billed.
Do not automate the last mile. A human should see the case when the result carries DUPLICATED_PHONE_NUMBER on an account that already passed a full ID check, when a VoIP number appears on a payout request, or when a customer disputes a block. The documented approve call exists for exactly this: after your own check, an operator can approve the verification rather than asking the user to start over. Pair phone results with AML screening at $0.20 per check when the account is a regulated one.
Worked cost example
Take 20,000 codes to US mobile numbers in one month. At list price a US SMS code costs $0.0473, which is the carrier price of $0.0273 plus Didit's $0.02 fee.
- List price: 20,000 x $0.0473 = $946.00, paid from top-up balance because phone codes are outside Free plan credit.
- Growth: the fee drops 4% to $0.0192, so $0.0273 + $0.0192 = $0.0465 per code. 20,000 x $0.0465 = $930.00. The $99 monthly fee includes $115 of credit that pays for phone usage.
- Scale: the fee drops 10% to $0.018, so $0.0273 + $0.018 = $0.0453 per code. 20,000 x $0.0453 = $906.00. The $299 monthly fee includes $350 of credit.
Mixed countries work the same way, one code at a time: 3,000 German SMS codes at $0.1145 is $343.50, and 1,000 codes to India over WhatsApp at $0.0413 is $41.30. The full country and channel table lives on the phone price list, and every other module price is on the pricing page.
Sources
- Didit docs: Phone Verification API, SMS OTP and risk signals, read November 26, 2026.
- Didit docs: phone verification overview, OTP, SMS and WhatsApp, read November 26, 2026.
- Didit docs: list phone verifications API, read November 26, 2026.
- Didit docs: Score Phone Risk endpoint, read November 26, 2026.
- Didit docs: retry a phone verification in the same window, read November 26, 2026.
- Didit docs: pricing and billing, read November 26, 2026.
- Didit docs: API authentication, read November 26, 2026.
- Didit docs: sandbox test data and scenarios, read November 26, 2026.
- Didit pricing page and live price feed, read November 26, 2026.
- Didit phone price list by country and channel, read November 26, 2026.
- Didit MCP server setup, read November 26, 2026.
Next step: create a sandbox application at https://business.didit.me/, copy your sandbox application's API key, and run the send and check calls above against your own screen. No sales call, and nothing is billed until you switch to a live key.
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
Alejandro Rosas
Co-founder and CTO

Questions
Frequently asked questions
What is a phone verification API?
A phone verification API sends a one-time passcode to a phone number and checks the code the user types back, so your application can confirm the user controls that number. Didit's version also returns carrier and line data, including whether the number is disposable, virtual, or has been ported. It is used in signup, login, account recovery and step-up checks.
How do I verify a user by SMS with an API?
Send the number in E.164 format to POST /v3/phone/send/ with options.preferred_channel set to sms, then send the code the user typed to POST /v3/phone/check/ with the same number and the verification_id from the send response. A check that returns Approved means the code matched. The code stays valid for 5 minutes from the first send.
How much does a phone verification API cost on Didit?
Each code costs the carrier's price for the country and channel plus Didit's $0.02 fee. At list price a US SMS code is $0.0473, a UK SMS code is $0.0783 and a German SMS code is $0.1145. Growth takes 4% off the Didit fee and Scale takes 10%, while the carrier part passes through at cost.
What happens if the user never receives the code?
Use the documented retry call to reissue the code inside the same 5-minute window, or move the verification to the next channel. Delivery problems also appear as the OTP_DELIVERY_FAILED warning. An eligible new send to a fixed line that cannot take SMS may be read out in a voice call instead, priced as a voice code.
How long is the one-time code valid?
The default code window is 5 minutes from the first send, and a retry inside that window keeps the same deadline. A check after the window returns Expired or Not Found, and the user has to start again. You can also end it early by cancelling the verification.
How many wrong codes can a user enter?
The verification.max_attempts setting defaults to 5 wrong entries per standalone verification. Each wrong entry returns Failed with attempts remaining, so you can re-prompt. When the limit is reached the verification moves to Declined and carries the OTP_MAX_ATTEMPTS_REACHED warning.
Can I check a number for VoIP or disposable risk without sending an OTP?
Yes. POST /v3/phone/risk/ scores the carrier, line type, porting and fraud risk of a number without sending a code. It is not a verification, so it is read from the lookup history at GET /v3/phone/lookups/ rather than the verifications list. Its price sits on its own line of the public price book.
Does the API support WhatsApp, Telegram or voice instead of SMS?
Yes. options.preferred_channel accepts whatsapp as the default plus sms, telegram, voice and viber, and delivery falls back to SMS when the preferred channel is unavailable. Availability depends on the country and the route, so check the phone price list for the country you are targeting. WhatsApp codes use a fixed message until you connect your own WhatsApp Business number in the Business Console.
Can I put my company name in the SMS?
Yes. SMS codes carry your application's SMS sender name, for example a message that names your bank, at no extra cost, and you set it in the Business Console. You can sign a single code with a different name by passing options.sms_sender_name of 1 to 30 characters.
Is phone verification enough for KYC?
No. A code proves control of a number at that moment, and it does not establish a legal identity. A full ID check on Didit combines an ID document check at $0.15, passive liveness at $0.10, face match at $0.05 and device and IP analysis at $0.03, for $0.33 per completed check, with phone verification added as a module.
Can I test phone verification without spending anything?
Yes. Sandbox applications mock every external provider, phone included, and sandbox sessions are never billed and never touch your balance. Create a sandbox application at business.didit.me and use its key: new sandbox keys start with sk_test_, while older keys may have no prefix and still work. Switch to a live key only when you go live.
What is the difference between session mode and the standalone phone API?
The standalone API is two calls, send and check, for a UI you control. Session mode runs the phone step inside a Didit workflow and returns the result in phone_verifications[] on the decision payload, together with every other check in that workflow. Both are billed per code at the carrier price plus the Didit fee.
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


