Twilio's API has some very basic phone number validation logic built in. We try to save you money by rejecting messages to numbers we are certain are incorrect.However, fundamentally we trust that our users know more about the phone number they are trying to send a message to than we do. Our validation logic will only affect numbers which are unquestionabily incorrect. It is your responsibility to provide accurate data.
Checking to see if the "To" number is potentially reachableWhen you make a POST request to Twilio's API, Twilio will check the validity of the "To" phone number in the request. If Twilio discovers that the "To" phone number provided cannot possibly exist, Twilio will respond with a 400 and Error 21211. If there is a possibility that the phone number exists, Twilio will hand the message off to the carrier and the message will be recorded in the SMS logs with a status of
Checking to see if the "To" number is a mobile numberDepending on the country, we may do an extra check to confirm that the "To" number is capable of receiving SMS messages.
Countries with a defined "Mobile Range"Most countries have a well defined "mobile range". Numbers within this range are almost always mobile numbers. When a request is made to send an SMS to a number outside of this range, Twilio will respond with a 400 and Error 21614.
Countries without a defined "Mobile Range"In countries without a "mobile range" like the United States, Canada and most Caribbean nations, there is currently not a reliable way to determine if a phone number is a mobile number or not. Twilio will attempt to send SMS messages to any phone number which which is provided in these countries.
Best PracticesWe recommend that your opt-in process also collect the phone type, and you should only be sending SMS messages to opted-in users who want to receive your messages.
Finally, a great tool to make sure that your number is valid is the free online Twilio Lookup tool. This simple tool will help validate any phone number to make sure it is correctly formatted to send or receive calls as well as other details such as carriers. Additionally, the Lookup Tool is also available as a part of Twilio’s API (which will incur a cost). Learn more about the Lookup API here.