SMS OTP API With Disposable and Virtual Number Detection
Send an OTP with POST /v3/phone/send/ to an E.164 number, then call POST /v3/phone/check/ with the verification ID to get disposable, virtual, and carrier type signals. Carrier price plus $0.02 per code.

Contents
In this guide
Jump to the part you need.
Teams adding SMS OTP to signup or login also need to know whether the number behind the code is a mobile, landline, virtual, or disposable line. Didit answers that in two calls: send the code, then check it. The check returns disposable, virtual, and carrier type signals. Price is the carrier rate for the country and channel plus our $0.02 fee per code. The caveat: those signals arrive after the code is sent, so screen the number first when SMS spend matters.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Question | Answer |
|---|---|
| How do I send a code? | POST https://verification.didit.me/v3/phone/send/ with your x-api-key header |
| What number format does it take? | E.164, for example +14155552671 |
| How long is the code valid? | 5 minutes from the first send; a same-window retry keeps that deadline |
| How do I check the code? | POST /v3/phone/check/ with phone_number, code and the verification_id from the send response |
| What risk signals come back? | is_disposable, is_virtual, carrier.type as mobile, landline or voip |
| What does a code cost? | The carrier price for the country and channel plus Didit's $0.02 fee per code |
| Can I screen a number without sending an SMS? | Yes. POST /v3/phone/risk/ scores carrier, line type, porting and fraud risk without sending a code |
| How many wrong codes are allowed? | 5 by default, set by verification.max_attempts per standalone verification |
| Which outcomes do I handle? | Approved, Failed, Declined, Expired or Not Found on check, and Blocked on send |
Start free in the sandbox at business.didit.me. There is no sales call and the sandbox charges nothing. The method behind these two calls is documented on the Phone Verification API page, the per-code rates sit on the phone price list, and the full list is on Didit pricing. For developers, connect Didit to an AI assistant through the Didit MCP server.
What you end up with
You end up with a signup or login step that proves the user holds the number, and that tells your application whether the number is worth trusting. Send Phone Code returns a verification_id for that send. Check Phone Code returns the verification status, any warnings, and the phone metadata: carrier, line_type, disposable, voip and ported.
Three signals do the blocking work. is_disposable is true for a temporary or throwaway number. is_virtual is true for a VoIP or virtual number. carrier.type returns mobile, landline or voip, which is the cleanest single field to branch on when you already expect a mobile handset.
When to use Send plus Check versus the risk endpoint
| Goal | Use | Why |
|---|---|---|
| Prove the user holds the number and get risk data for that verification | Send Phone Code, then Check Phone Code | The check returns the verification status plus the carrier and risk fields for that send |
| Score a number before you spend an SMS | POST /v3/phone/risk/ | It returns carrier, line type, porting and fraud risk without sending a code |
| Keep a record in verification history | Send Phone Code, then Check Phone Code | A risk lookup is not a verification and is not listed under GET /v3/phone/verifications/ |
Before you start
- A Didit account and an application in the Business Console.
- An API key used in the
x-api-keyheader. The header and key rules are on API authentication. - The base host
https://verification.didit.meandContent-Type: application/jsonon every call. - Numbers normalized to E.164. A non-E.164 value on
/v3/phone/send/returns HTTP 400. - Sending verification codes is unlocked by a paid Growth or Scale plan or by your organization's first top-up. Free plan monthly credit excludes phone codes. Sandbox sends are free.
Step by step

1. Send the code
Call Send Phone Code with the number in E.164 and, optionally, a code size, a preferred channel and a locale. The example below is the documented request.
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"}'
The code window is 5 minutes from the first send. Available channels are sms, whatsapp, telegram, voice and viber where offered for the country, and delivery falls back to SMS if the preferred channel is unavailable. SMS codes can carry your app's sender name at no extra cost, set in the Business Console or per send with options.sms_sender_name (1 to 30 characters).
2. Keep the verification ID
The send response returns a verification_id. Keep the verification_id and pass it to the check call. That ties the check to that specific send rather than to any pending code for the number.
3. Show the code entry screen
Collect the code the user received. In a hosted Didit flow this screen is rendered for you, which is why the hosted path needs no UI work.
4. Check the code and read the risk signals
Call Check Phone Code with the same number, the code, the verification_id from the send response, and the risk action you want applied to VoIP numbers. DECLINE ends the verification on a VoIP hit instead of approving it.
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": "VERIFICATION_ID_FROM_SEND_RESPONSE", "voip_number_action": "DECLINE"}'
5. Branch on status, then on the signals
The check response carries the full phone metadata: carrier, line_type, disposable, voip and ported, plus the status and any warnings. A readable branch over the documented fields looks like this.
const body = await res.json();
const carrierType = body.carrier?.type;
if (body.status === 'Approved' && body.is_disposable === false && body.is_virtual === false) {
// approved and no disposable or virtual signal; apply your carrier policy
} else {
// re-prompt or route to your review policy
}
Keep the branch on carrier.type too. A landline takes no SMS. Whether voice can reach it depends on the country and channel, so check message capabilities and country routes before you make an SMS-only rule. The full response shape is on the phone verification overview.
6. Record the outcome
GET /v3/phone/verifications/ lists your records newest first, filterable by status, channel, phone number, reference, tag and creation time, with limit and offset paging and a format=csv export. A retry stays on the same record. The reference is on List Phone Verifications.
What the response gives you
| Field | Documented values | What it tells you |
|---|---|---|
status | Approved, Failed, Declined, Expired or Not Found | The verification state from the check |
is_disposable | true or false | Temporary or throwaway number |
is_virtual | true or false | VoIP or virtual number |
carrier.type | mobile, landline, voip | The line type reported for the carrier |
carrier, line_type, ported | Carrier metadata | Carrier details, line type, and porting status returned with the check |
warnings[] | DISPOSABLE_NUMBER, VOIP_NUMBER, DUPLICATED_PHONE_NUMBER, INVALID_PHONE_NUMBER, OTP_DELIVERY_FAILED, OTP_MAX_ATTEMPTS_REACHED, OTP_EXPIRED, PHONE_NUMBER_BLOCKED | Documented warning codes attached to the result |
The warning catalogue, with the meaning of each code, is on Phone verification warnings.
Inputs and outputs
| Field | Call | Notes |
|---|---|---|
x-api-key | Both | Header, not a body field |
phone_number | Both | E.164, for example +14155552671 |
options.code_size | Send | Length of the code |
options.preferred_channel | Send | sms, whatsapp, telegram, voice, viber |
options.locale | Send | Language of the message |
options.sms_sender_name | Send | 1 to 30 characters, no extra cost |
vendor_data | Send | Your own user reference |
code | Check | The digits the user typed |
verification_id | Check | Returned by send, ties the check to that verification |
voip_number_action | Check | DECLINE ends the verification on a VoIP hit |
Output: verification_id | Send | Store it, use it on check |
| Output: status, signals, warnings | Check | See the table above |
When it goes wrong
HTTP 400 on send
The number is not E.164. Normalize it with the country code and a leading plus before the call. The error page groups 400 under invalid requests and asks you to fix what the body names, which on this endpoint is the phone number.
Status Failed on check
The code was wrong and attempts remain. Re-prompt the user. The per-verification limit is 5 wrong entries by default through verification.max_attempts, so show the remaining tries rather than letting the user burn the window.
Status Declined on check
The verification ended and no further attempt works inside it. If OTP_MAX_ATTEMPTS_REACHED is in warnings[], the user exhausted the configured limit. Start a new send when your policy allows it, or route the account to another check.
Status Expired or Not Found on check
Either the user typed the code after the 5-minute window closed, or there is no pending verification for that number and verification_id, for example because the record was created for a different number. Restart from the send call. A same-window retry preserves the original deadline, so a user who mistyped once still has time.
Status Blocked on send, with reason spam
Our anti-abuse protection blocked the send. No code was sent and no charge was raised. Do not retry from the same request in a loop; look at the number and the traffic pattern behind it.
HTTP 502
A 502 means a service Didit depends on returned an error. The API errors page says to read the code and retry with backoff. A 5xx response may not be JSON, so rely on the HTTP status when the body does not parse. Do not mark the account as risky on a 502 alone.
HTTP 403 with a credit message
Most standalone APIs answer a low balance with 403 and an error body pointing at the Console. Top up, or move the workload to a plan whose credit covers it. On the Free plan, phone codes are paid from top-up balance, not from the monthly credit.
Blocking VoIP and disposable numbers at signup
Two placements work, and they differ in cost. If you block after the check, you still paid for the SMS. If you block before the send, you can refuse the number without sending a code; the standalone risk endpoint is documented for that pre-screen.
- If you pre-screen, call
POST /v3/phone/risk/before send. It returns carrier, line type, porting and fraud risk without sending a code. - On the check call, pass
voip_number_actionasDECLINEso a VoIP hit ends the verification instead of approving it. - In a hosted workflow, add the PHONE feature and set the risk actions in the workflow configuration:
duplicated_phone_number_action,disposable_number_actionandvoip_number_action. The resulting decision payload carries aphone_verifications[]array. - In your own code, branch on
is_disposableandis_virtualafter the check.
Repeat signups are a separate risk. DUPLICATED_PHONE_NUMBER is one of the documented phone warnings for duplicate phone numbers. The warning catalogue lists it with the other phone warnings; interpret it under your own policy.
Why a phone risk lookup does not appear in the verifications list
A risk lookup is not a verification. POST /v3/phone/risk/ scores a number without sending a code, so it never creates a verification record and never shows up under GET /v3/phone/verifications/. That is by design, and our list endpoint states it plainly.
Read lookups from GET /v3/phone/lookups/, documented on the lookup history page. If you cannot find a verification either, check the filters before assuming a bug: the list supports status values pending, verified, not_delivered, expired, blocked and cancelled, and a number filter that misses one digit returns an empty page.
Worked cost example
Take 10,000 SMS code sends to United States numbers in a month. The live feed lists United States SMS at $0.0473 per code, which is the carrier price for the country and channel plus Didit's $0.02 fee. The arithmetic is:
- Carrier portion: $0.0473 - $0.02 = $0.0273 per code; 10,000 x $0.0273 = $273.00.
- Didit fee: 10,000 x $0.02 = $200.00.
- Total: $273.00 + $200.00 = $473.00, which matches 10,000 x $0.0473 = $473.00.
On Growth the Didit fee is $0.0192, so the total per code is $0.0273 + $0.0192 = $0.0465: 10,000 x $0.0465 = $465.00, or $8.00 less. On Scale the fee is $0.018, so the total per code is $0.0273 + $0.018 = $0.0453: 10,000 x $0.0453 = $453.00, or $20.00 less. Carrier charges pass through at cost and take no discount. The example covers code sends only and does not include any separate risk lookup.
What is paid, and where a person steps in
You pay per code sent: the carrier price for the country and channel plus our $0.02 fee. A send blocked as spam raises no charge and delivers nothing. A hosted workflow with the PHONE feature bills the phone step on the same logic. Free plan monthly credit excludes phone codes, so sending requires a paid plan or a first top-up. Sandbox sends are free.
Phone verification is automated. A person becomes part of the flow only if you route it there. You can send a declined or flagged account to manual review in the Console or through the session API. Manual review is a separate step; check the pricing page for the current price.
Didit runs identity and fraud checks for 4,000+ companies across 220+ countries. The company is SOC 2 Type 2 and ISO/IEC 27001:2022 certified. Those controls matter here because the phone record holds a personal number next to a user reference.
Sources
- Phone Verification API: SMS OTP and risk signals
- Send Phone Code reference
- Check Phone Code reference
- Score Phone Risk reference
- Phone lookup history
- List Phone Verifications
- Phone country routes
- Message capabilities
- Phone verification overview and integration prompt
- Phone verification warnings
- Didit API errors: status codes and fixes
- Verification statuses
- API authentication
- Pricing in the docs
- Didit pricing page
- Phone price list by country and channel
- Didit MCP server setup
The fastest next step is the sandbox: create an application at business.didit.me, copy the API key, and run the send and check calls above against a test number. No sales call, and nothing is charged until you move to live traffic.
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
How do I add SMS OTP verification with Didit?
Call POST https://verification.didit.me/v3/phone/send/ with the number in E.164 and your x-api-key header. The user receives a code valid for 5 minutes. Then call POST /v3/phone/check/ with the number, the code and the verification_id from the send response. You get the verification result plus the carrier and virtual number signals.
How do I detect disposable and virtual phone numbers at signup?
Read is_disposable and is_virtual from the Check Phone Code response. is_disposable is true for a temporary or throwaway number, is_virtual is true for a VoIP or virtual number, and carrier.type returns mobile, landline or voip. Decide your policy before launch so a true value has a defined outcome: block, hold, or require a second factor.
Can I block VoIP numbers before sending an OTP?
Yes. Use POST /v3/phone/risk/ to score carrier, line type, porting and fraud risk without sending a code. That is the pre-send option documented in the Phone Verification API. If you prefer to block after the check, pass voip_number_action as DECLINE so a VoIP hit ends the verification.
What do Failed, Declined, Expired or Not Found mean on a phone check?
Failed means the code was wrong and attempts remain, so re-prompt the user. Declined means the verification ended, often because the 5-attempt limit was reached, signalled by OTP_MAX_ATTEMPTS_REACHED. Expired or Not Found means the 5-minute window closed or no pending verification matches that number and verification_id, so restart from the send call.
What does a 502 mean on phone verification?
A 502 means a service Didit depends on returned an error. The API errors page says to read the code and retry with backoff. A 5xx response may not be JSON, so rely on the HTTP status when the body does not parse. Do not treat a 502 as a user failure.
Why is my phone risk lookup missing from the verifications list?
Because a lookup is not a verification. POST /v3/phone/risk/ scores a number without sending a code, so it never creates a record under GET /v3/phone/verifications/. Read lookups from GET /v3/phone/lookups/. Verifications created by send and check do appear in the list, newest first.
How long is the SMS code valid, and how many attempts do I get?
The default window is 5 minutes from the first send. A retry inside the same window keeps that deadline instead of extending it. Wrong code entries are limited to 5 per standalone verification through verification.max_attempts. When the limit is hit, the check answers Declined with the max attempts warning.
How much does an SMS OTP cost on Didit?
The carrier price for the country and channel plus Didit's $0.02 fee per code. List examples from the live feed: United States SMS is $0.0473 per code and United Kingdom SMS is $0.0783. Growth takes 4% off the Didit fee and Scale takes 10%, while carrier charges pass through at cost.
Does the Free plan cover phone verification codes?
No. Free plan monthly credit excludes phone codes. Sending verification codes is unlocked by a paid Growth or Scale plan or by your organization's first top-up. Sandbox sends cost nothing.
Can Didit send the code over WhatsApp, Telegram or voice instead of SMS?
Yes. Set options.preferred_channel to whatsapp, telegram, voice or viber where the country supports it, and delivery falls back to SMS when the preferred channel is unavailable. A voice call reads the code aloud twice. Channel availability differs by country, so check the phone price list before you promise a channel in your own UI.
Is a passed SMS OTP enough to verify a user?
No. An OTP proves control of a number, not identity. Use it as one signal in a workflow, next to an ID document check, liveness and face match, and keep the phone risk fields on the record. Didit charges a full KYC check at $0.33 when you add the document and biometric steps.
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


