twilio-13227TwiliohighDial: Cannot Route to Number
Twilio cannot route the outbound call to the dialed number — often caused by invalid formatting or unverified caller ID.
What this error means
Root causes
Invalid phone number format (missing country code, incorrect digit count, special characters)
Common
Unverified or unregistered caller ID (From number not validated in Twilio account)
Common
Destination number is in a region with routing restrictions or geographic limitations
Occasional
Caller ID does not match the phone number's country or region
Occasional
Twilio account lacks proper permissions or capabilities for the destination region
Occasional
Destination number is blacklisted, blocked, or on a do-not-call registry
Occasional
Carrier rejection due to spam filtering or fraud prevention rules
Occasional
How to fix it
- 1
Validate phone number format
Ensure the destination number is in E.164 format (e.g., +1234567890). Verify the number includes a valid country code, has the correct digit count for the destination country, and contains only numeric characters and the leading '+' symbol. Use a phone number validation library or Twilio's Lookup API to verify the number's validity.
- 2
Verify and register your caller ID
Log into your Twilio Console and navigate to Phone Numbers > Verified Caller IDs. Ensure the 'From' number you're using in your outbound call is registered and verified in your account. If not present, add it and complete the verification process (which may involve entering a verification code sent to that phone number). This is mandatory for most outbound calling scenarios.
- 3
Verify caller ID matches destination region
Confirm that your caller ID number's country code matches or is geographically compatible with the destination number's country. For example, using a US caller ID (+1) to call an international number may trigger routing failures. If calling internationally, use a caller ID from the same country or use a universal carrier-compatible number.
- 4
Check regional routing restrictions
Review Twilio's current coverage and routing limitations for the destination country. Visit the Twilio Console's Phone Numbers section and check the 'Capabilities' tab to see which regions your account can reach. Some countries require special permissions, additional verification, or have inherent carrier restrictions. Contact Twilio support if a region appears unsupported but should be accessible.
- 5
Test with the Twilio API or CLI
Use Twilio's REST API or CLI to make a test call with explicit error logging. This provides more detailed error responses than application-level handling. Example using curl: `curl -X POST https://api.twilio.com/2010-04-01/Accounts/YOUR_ACCOUNT_SID/Calls.json -d 'From=YOUR_VERIFIED_NUMBER&To=DESTINATION_NUMBER&Url=YOUR_TWIML_URL' -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN`. Examine the response for additional error codes or details.
- 6
Check account balance and active status
Verify that your Twilio account has sufficient balance and is in active, non-suspended status. Navigate to the Console's Billing section and confirm your account isn't restricted due to usage violations, fraud flags, or payment issues. A suspended or limited account will fail all outbound routing attempts.
- 7
Contact Twilio support with detailed logs
If the above steps don't resolve the issue, contact Twilio Support with your Call SID (found in logs), the exact phone numbers used, the timestamp of the failed call, and your account SID. Twilio support can check carrier-level routing logs and identify provider-specific rejections or account limitations that aren't visible in the API response.
Prevention
Prevent twilio-13227 errors by implementing strict phone number validation on all inputs using a library like libphonenumber-js or Twilio's Lookup API before attempting any call. Always register and verify caller IDs in your Twilio Console before using them in production. Implement a caller ID matching check that ensures the 'From' number aligns with the destination region. Maintain comprehensive logging of all outbound call attempts, including request parameters and full Twilio API responses, to catch formatting issues during testing rather than in production. Periodically audit your account's regional capabilities and permissions to ensure you maintain access to necessary calling destinations. Finally, implement exponential backoff and retry logic only for transient errors, and immediately fail on routing errors like 13227 rather than retrying indefinitely.
Debugging this right now?
Sherlock diagnoses twilio-13227 automatically. Just ask in Slack and get an instant root-cause analysis.
Add to Slack — Free