#Validate numbers
Check whether numbers are mobile, landline or disconnected before you import or text them. US and Canada only.
Details
This is the same lookup and price as Clean list on the Contacts page.
#Validate numbers
/v1/validateChecks up to 1,000 numbers. Billed per number that gets an answer.
Details
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.
Answers are cached for 90 days and shared across Ready accounts, so cached: true can mean another account checked the number.
Example: 100 different numbers that all get an answer cost 100 × $0.005 = $0.50, and the same 100 again cost another $0.50.
Headers
Idempotency-KeystringRecommended- Retry safely without paying twice.
Body parameters
phonesstring[]Required- 1 to 1,000 numbers, E.164 or 10 digits.
Returns
data[]object[]- One per number, in the order you sent them.
data[].normalizedE.164 string | nullnullwhen the number can't be read.data[].validbooleanfalseif malformed or disconnected;reasonisinvalid_format,unsupported_countryordisconnected.data[].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.data[].carrierstring | null- The carrier, for mobile numbers.
data[].textableboolean | nullnullwhenline_typeisunknown: the lookup gave no answer, or could not tell.data[].cached, checked_atboolean, ISO 8601 string- Whether the answer was cached, and when it was checked.
billed_numbers, charged_usdinteger, number- At the top level: what this call cost.
Details
charged_usdis exact: $0.005 for each number that got an answer, so one number showscharged_usd: 0.005andbilled_numbers: 1every time. Your balance is debited in whole cents and the half 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.DetailsThe body hasrequired_cents, balance_cents and numbers. |
| 403 | permission_denied | Key lacks edit_contacts. |
| 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
/v1/validate/:phoneThe same check for one number. This GET is billed like one number above.
Path parameters
phonestringRequired- E.164 or 10 digits.
Details
A value that isn't a phone number answers200withvalid: false, reason: "invalid_format", not billed.
Returns
dataobject- One result like a
data[]item above, plusbilled_numbersandcharged_usd.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_phone | Path value over 40 characters. |
| 402 | insufficient_credits | Balance too low. |
| 403 | READ_ONLY_SESSION | View-only access can't spend money. |
| 403 | permission_denied | Key lacks edit_contacts. |
| 429 | validation_in_progress | This number is already being checked. Wait Retry-After. |
| 500 | internal_error | Our side failed. Retry. |
| 503 | validation_unavailable | Unavailable right now. Nothing charged. |