Use cases
SMS deliverability: validate numbers before you send
Check line type, country and carrier before sending SMS, so messages go to numbers that can receive them and one-time codes stop feeding fraud.
Updated 2026-11-23
Every SMS you send costs money, whether or not the message arrives. Sending to a number that does not exist, to a landline, or to a premium-rate range chosen by a bot is a direct loss. Validating the number first turns that loss into a small check fee, and gives you the clean e164 format that SMS providers expect.
The problem
Three separate problems hide under "SMS deliverability":
- Bad input. People type numbers without a country code, with spaces and brackets, or with a digit missing. A provider either rejects them, charges for the attempt, or sends to the wrong number.
- Wrong line type. Landlines and some special ranges cannot receive a text message. Sending to them wastes budget and inflates your failure rate.
- Abuse. SMS pumping, also called artificially inflated traffic, is a fraud in which bots submit numbers to forms that send a one-time code, choosing numbers on expensive routes. You pay for every message. Premium-rate numbers and unserved countries are the signature.
Validation addresses the first two directly and the third in part.
The flow
- Normalize at entry. When a user types a number, send it with the
countrythe form knows. Store thee164value from the response, never the raw input. See E.164. - Check before every send that costs money. Run the phone check before the first code is sent, not after a failure.
- Filter by line type. Allow
mobile. Treatlandlineas not able to receive SMS. Treatvoipaccording to your risk tolerance. Refusepremium_rate. - Check the country. Compare
country.codewith the list of countries you serve and refuse the rest. - Use a live lookup when routing matters. At the live level
carrier.nameis the carrier currently serving the number andportedsays whether it left its original carrier. Use it to pick a route. - Rate limit around the check. Cap codes per number, per IP and per account, and add the IP signals of the IP lookup for requests from hosting networks.
- Re-validate stale lists. Before a large campaign, run the list through a bulk job.
Decision table
| Signal | Field | Action |
|---|---|---|
| Number cannot be read | status: unknown |
Step up: ask for the country, retry with country |
| Number does not fit its plan | status: invalid |
Block the send, ask the person to check |
| Country not served | country.code outside your list |
Block |
| Premium-rate range | line_type: premium_rate |
Block |
| Landline | line_type: landline |
Do not send SMS, offer a voice call or another channel |
| Mobile | line_type: mobile |
Allow |
| North American number | line_type: fixed_line_or_mobile |
Allow, accept that the plan cannot say more |
| Internet telephony | line_type: voip |
Step up: email confirmation or review for high-value actions |
| Ported number | ported: true (live level) |
Allow, route through the current carrier |
| Request from hosting or Tor | flags.datacenter or flags.tor: true on the IP |
Step up, lower the send limit |
A valid number exists in the numbering plan, which is not proof that someone answers it. The basic level cannot see disconnected numbers.
Example
A login form is about to send a one-time code. The server asks for a live lookup of the number first:
curl https://api.qelka.com/v1/phone \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"phone": "+14155550123", "level": "live"}'
The part of the response that drives the decision:
{
"object": "phone",
"valid": true,
"status": "valid",
"e164": "+14155550123",
"country": { "code": "US", "name": "United States", "calling_code": "1" },
"line_type": "mobile",
"carrier": { "name": "Example Wireless", "mcc": "310", "mnc": "000", "source": "live" },
"ported": false
}
Values are illustrative. The number is valid, mobile, in a country on the allowed list, and not ported. The server sends the code to +14155550123 through the route that matches the carrier.
At the basic level the same call returns carrier.source: "numbering_plan", ported: null and, for a North American number, fixed_line_or_mobile. That is enough for most signup flows and costs less.
What it costs
A basic phone check costs 1 credit and a live lookup 3. Errors and failed provider calls (502 upstream_unavailable) are not billed, and results are cached for 7 days unless you send fresh: true. A live lookup sends the number to our lookup provider, as data and privacy describes, while the basic level does not. Test keys return simulated answers and spend nothing. The free plan includes 100 credits a month. Prices are on the pricing page.
Related
Frequently asked questions
Why do SMS messages fail to arrive?
How do I know if a number is mobile or a landline?
line_type in the phone response. mobile is a mobile number, landline a fixed line, and voip a range assigned to internet telephony. In the North American plan the answer is fixed_line_or_mobile, because the plan does not separate the two. A live lookup asks the network and can replace that with a more precise type when the provider returns one.Does phone validation stop SMS pumping?
What does it cost to validate a number before sending?
Put this check in your product
Get an API key in under a minute. 100 free credits every month, no card required.
- 100 free credits a month
- No card
- Test keys spend nothing
- Cancel any time