Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

21401: Invalid Phone Number


ERROR: 21401

error-21401 page anchor
ERROR

You received this error when the sender you provided for an outbound SMS request is not valid. The From value must be a Twilio-hosted sender that belongs to your account. If you use a phone number, use a Twilio number that you purchased from or ported to Twilio in E.164 format. If you use an alphanumeric sender ID, it must meet Twilio formatting requirements and be used only in supported countries.

Possible causes

possible-causes page anchor
  • You passed a From phone number that is not purchased from or ported to Twilio.
  • You passed the From phone number in a format other than E.164.
  • You used an alphanumeric sender ID for a destination where alphanumeric sender IDs are not supported, including the United States or Canada.
  • Your alphanumeric sender ID does not meet sender ID requirements. For example, it is longer than 11 characters, uses unsupported characters, or contains only digits.
  • You sent with From instead of MessagingServiceSid, and the sender you provided is not available to the account that is creating the message.
  • Update From to a valid Twilio sender that belongs to the account sending the message.
  • Format phone numbers in E.164, for example +14155552671.
  • Buy a Twilio phone number or port an existing number to Twilio before using it as a sender.
  • If you use an alphanumeric sender ID, confirm that the destination country supports it and complete registration when required.
  • Keep alphanumeric sender IDs to 11 characters or fewer and include at least one letter.
  • If you use a Messaging Service, send with MessagingServiceSid so Twilio can select a sender from your Sender Pool, or specify only a sender that is already in that pool.

Additional resources

additional-resources page anchor