Phone Number Validation
phone_validateValidates and normalises any phone number to E.164, with structural checks for every country calling code.
For signup and checkout flows that need to store one canonical form and reject typos early. Any common input (spaces, dashes, brackets, 00 or + prefix, a stray national trunk zero) comes back as E.164 plus national notation, with the country resolved from the calling code. Numbers without an international prefix use defaultCountry (US when omitted), so (415) 555-0134 and +1 415 555 0134 store the same.
One thing this endpoint deliberately does not claim: the current mobile operator. Numbers are portable in most markets, so a prefix says where a number was first allocated, not where it lives today. Competing APIs report the prefix owner as "the operator" and customers pick SMS routes on that basis. Where we know the original allocation we return it as originallyAllocatedTo with the caveat attached, because a confident wrong answer costs more than an honest gap. Countries without a full numbering plan here are validated structurally and say so in warnings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| phone | Yes | Phone number in any common format. | |
| defaultCountry | No | ISO 3166-1 alpha-2 country to assume when the number has no international prefix. Defaults to US. |