21211: Invalid 'To' Phone Number
MESSAGING, VOICE
ERROR
The To phone number in your API request is not a valid phone number or is incorrectly formatted. Twilio requires phone numbers in E.164 format: a + followed by the country code and the subscriber number including the area code, with no spaces, dashes, or parentheses.
- The
Tonumber is not in E.164 format. Common formatting mistakes include omitting the+prefix, omitting the country code, including spaces or punctuation, or using a local format without the country code. - The
Tonumber contains a typo, extra digit, or too few digits for the destination country. - You used the same Twilio number in both the
ToandFromparameters. Twilio numbers cannot call or message themselves. - You attempted to send a message to a short code or an alphanumeric sender ID. These sender types can only send messages and cannot receive them.
- You sent a message through a Messaging Service with an invalid prefix prepended to the
Tonumber.
- Format the
Tonumber in E.164:+followed by the country code and subscriber number with no separators. See the examples below. - Verify you are using the correct country calling code for the destination. For example, use
+44for the UK and+91for India, not+1(which is US/Canada). - Check the
Tovalue for typos, extra digits, or missing digits. US numbers have 10 digits after the country code; UK mobile numbers have 10 digits after the country code. - Confirm the
ToandFromvalues are different. A Twilio number cannot send to itself. - Do not set the
Toparameter to a short code or alphanumeric sender ID. These are outbound-only sender types. - When using a Messaging Service, pass the
Tonumber in plain E.164 format without any channel prefix. The Messaging Service selects the appropriate sender automatically. - If a third-party integration provides the
Tovalue, test the same request in the Twilio Console SMS sandbox. If the Console request succeeds, the third party may be modifying theToparameter before it reaches Twilio.
| Input (incorrect) | Problem | Corrected (E.164) |
|---|---|---|
(555) 123-4567 | Missing + and country code, has punctuation | +15551234567 |
555-123-4567 | Missing + and country code | +15551234567 |
+1 555 123 4567 | Contains spaces | +15551234567 |
07911 123456 | UK local format, missing country code | +447911123456 |
15551234567 | Missing + prefix | +15551234567 |
+1 (555) 123-4567 | Contains parentheses, spaces, and dashes | +15551234567 |