Switchmast

Twilio error 21614: 'To' number is not a valid mobile number

Updated

Short answer

21614 means the To number isn't a valid mobile number, so Twilio won't text it. Most often it's a landline; sometimes the number is invalid or badly formatted. Confirm with a Lookup line type check, call the number instead or ask for a mobile, and remove landlines from your SMS list.

What Twilio says it means

Twilio's error reference names 21614 'To' number is not a valid mobile number, log type APPLICATION, level ERROR. You tried to send an SMS to a number that isn't a valid mobile number, most likely a landline or an otherwise invalid number. Resending the same message won't help.

Common causes, most likely first

  1. It's a landline. Office numbers, home phones and main switchboard numbers end up in SMS lists when a form asks for "phone" instead of "mobile".
  2. The number is invalid or badly formatted. A wrong country code or missing digits can turn a mobile into something else. Badly formatted numbers can also return 21211.
  3. An IoT or M2M number with a non-standard format that Twilio's validation doesn't recognise yet.

How to check and fix it

  1. Find the number. The code comes back with your request (code 21614 in the error response) and shows in the Console under Monitor › Logs › Error Logs.
  2. Check the line type. Call Lookup v2 with line type intelligence:
    GET https://lookups.twilio.com/v2/PhoneNumbers/%2B15017122661?Fields=line_type_intelligence
    Read line_type_intelligence.type. Our Lookup guide covers the packages and prices.
  3. If it's a landline, don't retry. Call the number, or ask the person for a mobile.
  4. If Lookup says mobile, check the number is in E.164 with the right country code, and send again.
  5. IoT or M2M numbers: if the format differs from standard mobiles in that country, contact Twilio Support.

Line types Lookup can return

typeWhat it isText it?
mobileMobile numberGenerally yes
landlineFixed lineGenerally no
fixedVoipVirtual number tied to a physical device (Twilio's examples: Comcast, Vonage)Depends on the provider
nonFixedVoipVirtual number obtained online without a device (example: Google Voice)Depends on the provider
tollFree, premium, sharedCost, uan, voicemail, pager, personalSpecial-purpose numbersCheck before sending
unknownValid number, line type can't be determinedUnclear

Twilio describes landlines as generally unable to receive SMS and mobiles as generally able; it doesn't make a blanket statement about VoIP, so treat those case by case.

How to prevent it

CodeMeaning
30006Landline or unreachable carrier (carrier error, during delivery)
21211Invalid 'To' phone number (format)
30003Unreachable destination handset
30005Unknown destination handset

How Switchmast helps

Switchmast on iPhone showing a failed Twilio message with its error explained
One failed message in Switchmast, on sample data.

Switchmast's message screen explains 21614 in plain English and has a "Look up this number" button that runs a Twilio Lookup on the recipient from your phone, so you can see whether it's a landline without opening a terminal. See the Twilio error codes hub for other codes.

Questions

What does Twilio error 21614 mean?

'To' number is not a valid mobile number. You tried to send an SMS to a number that isn't a valid mobile number; Twilio says it's most likely a landline or an otherwise invalid number.

How do I check whether a number is a landline?

Request Lookup v2 with Fields=line_type_intelligence. The type field returns values such as mobile, landline, fixedVoip, nonFixedVoip or tollFree. Line type intelligence covers numbers worldwide; Canadian numbers need special approval.

What's the difference between 21614 and 30006?

Both point at numbers that can't take texts. 21614 is an APPLICATION error raised against your request. 30006 (Landline or unreachable carrier) is a CARRIER error returned during delivery, for example a landline or a short code that can't reach the destination carrier.

I'm texting an IoT SIM and get 21614. What now?

Twilio notes that some IoT or machine-to-machine numbers use a non-standard format that its validation doesn't recognise yet. If that's your case, contact Twilio Support.

Sources