What this error means
INVALID_PHONE_NUMBER is returned with HTTP status 422 when a phone number
field in your request — most commonly to_number or from_number on a message
or call — is not a valid E.164 number. The request is not queued or partially
processed; nothing is sent and no credits are deducted.
Every response for this error carries this page’s address in meta.docs_url:
Cause
Orbit accepts phone numbers only in E.164 format: a leading+, then the country
code and subscriber number as digits only — no spaces, dashes, parentheses, or
leading zeros beyond the country code. The most common causes are:
How to fix it
- Normalize to E.164 before sending. Strip formatting characters and store
the number as
++ country code + subscriber number, e.g.+14155552671for a US number. - Always include the country code, even for domestic sends. A number that works in a local dialler is not valid on its own.
- Validate early. A permissive check like
^\+[1-9]\d{1,14}$catches most malformed values before they reach the API. - Clean stored contacts in bulk. If the error appears on numbers imported from a CRM or CSV, run a normalization pass over the contact list rather than patching sends one by one.
Related
- Error Code Reference — every code with its HTTP status, cause, and remediation.
- Error Handling Examples — response-envelope handling patterns in code.