Phone Number Filtering Reference

Endpoint Reference: Case - Phone Numbers

Overview

The number parameter on the /api/v1/phone_numbers/ endpoint supports flexible
filtering across both stored number formats: NANP (NNN-NNN-NNNN) and E.164
(+XNNNNNNNNNN). Wildcard characters and digit-only input are both supported, with
automatic format normalisation applied where possible.


Wildcard Characters

Two wildcard characters are supported. They may appear at the start, end, or both
ends of the search term. They cannot appear in the middle of a value.

CharacterMeaningORM Lookup
*Match anythingRecommended
%Match anythingSupported, but must be submitted as %25 in a URL to avoid percent-encoding conflict. Use * instead.
Wildcard PositionExample InputORM Lookup
Leading only*5555ends with
Trailing only111*starts with
Both ends*222*contains
None111-222-5555exact

Input Normalisation

When the search term (after stripping any wildcard characters) is purely numeric,
the API automatically generates additional format candidates and OR's them together,
so a single query can match records stored in either NANP or E.164 format.

Non-numeric input (containing dashes, +, spaces, or letters) is used as-is with
no normalisation.

10-Digit Input

Treated as a full NANP subscriber number. Two candidates are generated:

CandidateFormat
NNN-NNN-NNNNNANP (dash-formatted)
+1NNNNNNNNNNE.164 with +1 country code

Examples:

Query ParameterCandidates Searched
?number=1112225555111-222-5555 OR +11112225555
?number=*2225555ends with on 222-5555 OR 2225555

11 to 15-Digit Input

Treated as E.164 digits without the + prefix. A + is prepended for the E.164
candidate. If the leading digit is 1 and the total length is 11, the 10 subscriber
digits are also checked as NANP.

CandidateCondition
+NNNNNNNNNNNAlways generated
NNN-NNN-NNNNOnly when leading digit is 1 and length is exactly 11

Examples:

Query ParameterCandidates Searched
?number=11112225555+11112225555 OR 111-222-5555
?number=441112225555+441112225555 (non-NANP country code, no NANP candidate)
?number=*11112225555ends with on +11112225555 OR 111-222-5555

Other Digit Lengths (Partial Input)

Input that is purely numeric but outside the 10-15 digit range is treated as a
partial number. The raw digits are used as one candidate, and a dash-formatted
version (with dashes inserted at NANP boundaries from the right) is added as a
second candidate where the input is long enough.

NANP dash boundaries from the right: position 4 (last 4 digits) and position 8
(digits 5-7 from the right).

Digit CountDash Candidate GeneratedExample InputCandidates
8-9 digitsYes (two boundaries)222555123222555123 OR 2-225-55123
5-7 digitsYes (one boundary)22255552225555 OR 222-5555
4 digitsNo (too short)55555555 only
1-3 digitsNo (too short)555555 only

Note: Partial digit input without a wildcard uses exact matching, which
means neither candidate is likely to match a full NANP or E.164 stored value.
Use a leading * for suffix matching when searching with fewer than 10 digits.


Non-Numeric Input

Input containing any non-digit character (dashes, +, spaces, letters) is passed
through as-is with no normalisation. Only one candidate is generated.

Examples:

Query ParameterCandidate SearchedLookup
?number=111-222-5555111-222-5555exact
?number=*222-5555222-5555ends with
?number=+11112225555+11112225555exact
?number=*+1111*+1111contains

Quick Reference

GoalRecommended Query
Exact match, full NANP number?number=111-222-5555
Exact match, full 10-digit no dashes?number=1112225555
Exact match, E.164?number=+11112225555
Suffix match on last 7 digits?number=*2225555
Suffix match on last 7 digits with dashes?number=*222-5555
Contains a 3-digit area code?number=*111*
Starts with area code (NANP)?number=111*
Match any number for a country code?number=*+44*