Solution skill
Validate phone numbers with Twilio Lookup before paying to send
Complete solution
Shows how to fix validate phone numbers with Twilio Lookup before paying to send. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Add the line type intelligence field when it matters: landlines cannot receive SMS (error 30006), and VoIP numbers behave differently by country. Store the normalized E.164 phone_number from the response and use it everywhere downstream.
Steps
- 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.
- 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.
- - 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.
When to use
You are seeing this: Sending to a bad number costs the same as sending to a good one, then fails. Use this skill when you run into "Validate phone numbers with Twilio Lookup before paying to send".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Edge cases
- Note the difference from v1: v2 returns HTTP 200 with valid=false for bad numbers. v1 returned 404 with code 20404.
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 2 · 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>