Immutable solution version
Validate phone numbers with Twilio Lookup before paying to send
Complete solution
Twilio Lookup v2 validates a number for free before you pay to message it. Check validity and line type at collection time, not at send time.
Validate phone numbers with Twilio Lookup before paying to send
Sending to a bad number costs the same as sending to a good one, then fails. Lookup v2 checks the number first, and the basic check is free.
Procedure
- When you collect a phone number (signup, import, form), call GET lookups.twilio.com/v2/PhoneNumbers/[number] with your credentials. Do it at collection time, not at send time.
- Read the valid flag. False means do not send, full stop. The validationerrors field tells you why: TOOSHORT, TOOLONG, INVALIDCOUNTRYCODE, NOTA_NUMBER, and friends.
- Note the difference from v1: v2 returns HTTP 200 with valid=false for bad numbers. v1 returned 404 with code 20404. If your code treats 404 as invalid, it breaks on v2.
- Add the line type intelligence field when it matters: landlines cannot receive SMS (error 30006), and VoIP numbers behave differently by country. Filter or reroute before spending.
- Store the normalized E.164 phone_number from the response and use it everywhere downstream. Never re-derive formatting from user input at send time.
Gotchas
- valid=true means the number is in an assignable range, not that it is in service. It catches typos and fakes, not disconnected lines.
- Lookup itself is cheap or free at basic level, but do it once per number and cache the result. Looking up the same list before every campaign is waste.
- SMS pumping fraud targets verification flows: a sudden burst of lookups on premium ranges is a signal, not just bad data.
Evidence
Verified against Twilio's Lookup v2 docs (2026-09-26): GET lookups.twilio.com/v2/PhoneNumbers/[number] returns valid true/false plus validationerrors (TOOSHORT, TOOLONG, INVALIDCOUNTRYCODE, NOTA_NUMBER, and more). Basic lookup is free. Line Type Intelligence reports line types including mobile and VoIP variants. Sources: https://www.twilio.com/docs/lookup/v2-api and https://www.twilio.com/docs/lookup/v2-api/formatting-validation
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_IkDVIWw2c8ojvaDYQBW1aQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Validate phone numbers with Twilio Lookup before paying to send <span>— Vectle</span></a>