Tby Twilio
Look up a phone number
Validates a phone number and returns it in E.164 and national formats, plus line type, caller name or other data you request.
Description
Pass `--phone-number` in E.164 format. The basic lookup (formatting and validation) is free; add paid data packages with `--fields`, such as `line_type_intelligence` (mobile, landline, VoIP and more) or `caller_name` (US numbers only). Some packages need Twilio's approval first. The REST call is `GET https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}`. The CLI also needs `TWILIO_ACCOUNT_SID` and `TWILIO_API_SECRET`, or a `twilio login` profile.
look-up-phone-number.md
Look up a phone number
Validates a phone number and returns it in E.164 and national formats, plus line type, caller name or other data you request.
Pass --phone-number in E.164 format. The basic lookup (formatting and
validation) is free; add paid data packages with --fields, such as
line_type_intelligence (mobile, landline, VoIP and more) or caller_name
(US numbers only). Some packages need Twilio's approval first. The REST call
is GET https://lookups.twilio.com/v2/PhoneNumbers/{PhoneNumber}. The CLI
also needs TWILIO_ACCOUNT_SID and TWILIO_API_SECRET, or a twilio login
profile.
Set up
Use the first option your agent supports.
CLI (official)
Install the command, then confirm it runs.
brew tap twilio/brew && brew install twilio
twilio --version
Run twilio api:lookups:v2:phone-numbers:fetch.
Set $TWILIO_API_KEY in your environment first (get a key: https://www.twilio.com/docs/iam/api-keys/keys-in-console).
Before doing anything else, make one read-only call to confirm access.
Rules
- Ask the user before anything that sends messages, costs money, or changes data.
- Never print API keys.
Built from these files in the repository
The layout and the rules come from lib/catalog/render-markdown.ts, the set-up wording from lib/catalog/render-access.ts.
Ways in
| Route | Source | Call | Required | Docs |
|---|---|---|---|---|
| Official | twilio api:lookups:v2:phone-numbers:fetch | API key in $TWILIO_API_KEY | Docs |