Number validation
Check whether numbers are mobile, landline or disconnected before you import or text them. US and Canada only. It is the same lookup as Check for landlines in Settings → Compliance, but each API call is billed at your per-number price even when Check for landlines shows free: see Billing for prices.
#The Validation result object
phonestring- The number as you sent it.
normalizedE.164 string | nullnullwhen the number can’t be read.validbooleanfalseif malformed or disconnected.reasonstring- Only when
validisfalse. Possible values:invalid_format,unsupported_country,disconnected. line_typeenummobile,landlineorunknown. A line the carrier lookup reports only as "landline or other carrier", which includes most VoIP lines, reads asunknown: it is still an answer and is billed.carrierstring | null- The carrier, for mobile numbers.
textableboolean | nullnullwhen the lookup gave no answer or could not tell (line_typeisunknown).falsefor a number that isn’t valid.cachedboolean- Whether the answer came from the cache. Cached answers are billed too.
checked_atstring | null- When the number was checked, ISO 8601.
#Validate numbers
Checks up to 1,000 numbers. Costs your per-number price for each number that gets an answer, cached answers included. Checking the same number again, in a later call, is billed again. Needs the edit_contacts permission.
How billing works
A number repeated within one request is looked up and billed once. Malformed numbers and numbers that got no answer aren’t billed. The whole batch is checked against your balance first.
An answer is reused for 90 days and then checked again. Answers are shared across Ready accounts, so cached: true can mean another account checked the number. Ready keeps each number’s answer after that window so texts to numbers that are out of service stay stopped.
Parameters
Idempotency-Keystring · header- Recommended. Retry safely without paying twice.
phonesstring[]Required- 1 to 1,000 numbers, E.164 or 10 digits.
Returns a list of Validation result objects in data, one per number, in the order you sent them.
Returns
billed_numbers, charged_usdinteger, number- What this call cost.
Exact amounts
charged_usdis exact: your per-number price for each number that got an answer, so one number shows your per-number price ascharged_usdandbilled_numbers: 1every time. Your balance is debited in whole cents and any fraction of a cent is carried to the next charge. Both are0when nothing was charged (for example a test key).
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | phones_required | phones is missing or empty. |
| 400 | too_many_phones | More than 1,000 numbers. |
| 402 | insufficient_credits |
Balance can’t cover the batch. Nothing checked. Top up in Billing and try again. The body has required_cents, balance_cents and numbers. If another request spends your balance while this one runs, you get the same code with only numbers: nothing is charged and no results are returned. |
| 429 | validation_in_progress | Same numbers already being checked. Wait Retry-After. |
| 500 | internal_error | Some may be billed: check your balance first. |
| 503 | validation_unavailable | Unavailable right now. Nothing charged. |
#Validate one number
The same check for one number. This GET is billed at your per-number price if answered. Send an Idempotency-Key and a retry with the same key returns the first answer and bills once. Needs the edit_contacts permission.
Parameters
phonestring · pathRequired- E.164 or 10 digits. A value that isn’t a phone number answers
200withvalid: false, reason: "invalid_format", not billed.
Returns a Validation result object in data, with billed_numbers and charged_usd as in Validate numbers.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_phone | Path value over 40 characters. |
| 402 | insufficient_credits | Balance too low. Nothing checked. Top up in Billing and try again. |
| 403 | READ_ONLY_SESSION | View-only access can’t spend money. |
| 429 | validation_in_progress | This number is already being checked. Wait Retry-After. |
| 500 | internal_error | Some may be billed: check your balance first. |
| 503 | validation_unavailable | Unavailable right now. Nothing charged. |