readyDocs Open the appOpen the app

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 | null
null when the number can’t be read.
validboolean
false if malformed or disconnected.
reasonstring
Only when valid is false. Possible values: invalid_format, unsupported_country, disconnected.
line_typeenum
mobile, landline or unknown. A line the carrier lookup reports only as "landline or other carrier", which includes most VoIP lines, reads as unknown: it is still an answer and is billed.
carrierstring | null
The carrier, for mobile numbers.
textableboolean | null
null when the lookup gave no answer or could not tell (line_type is unknown). false for 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 amountscharged_usd is exact: your per-number price for each number that got an answer, so one number shows your per-number price as charged_usd and billed_numbers: 1 every time. Your balance is debited in whole cents and any fraction of a cent is carried to the next charge. Both are 0 when nothing was charged (for example a test key).
Errors
HTTPCodeWhen
400phones_requiredphones is missing or empty.
400too_many_phonesMore 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.
429validation_in_progressSame numbers already being checked. Wait Retry-After.
500internal_errorSome may be billed: check your balance first.
503validation_unavailableUnavailable 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 200 with valid: false, reason: "invalid_format", not billed.

Returns a Validation result object in data, with billed_numbers and charged_usd as in Validate numbers.

Errors
HTTPCodeWhen
400invalid_phonePath value over 40 characters.
402insufficient_creditsBalance too low. Nothing checked. Top up in Billing and try again.
403READ_ONLY_SESSIONView-only access can’t spend money.
429validation_in_progressThis number is already being checked. Wait Retry-After.
500internal_errorSome may be billed: check your balance first.
503validation_unavailableUnavailable right now. Nothing charged.