Twilio · Look up a number — A phone number's carrier and line type — asks Twilio about a phone number before you text or call it. Use it to check numbers from a form, or to send SMS only to mobiles.

Who can do this

Workspace Admins and Editors, on every plan. Viewers see the step's settings but cannot change them.

Before you start

A Twilio connection in this workspace — see Connect Twilio.

Steps

  1. Select + where the number should be checked. In the step picker, open Apps, select Twilio, then Look up a number.
  2. In Connection, choose your Twilio connection.
  3. In Phone, the number with + and the country code — for example +919876543210 (an example number). Or drag in a number from an earlier step, such as {{ $json.mobile }}.
  4. Select Run this step to look it up.

Output

Field What it is
phone The number in international form — +919876543210.
valid true if it is a real, possible number; false if not.
country The country's two-letter code — IN.
nationalFormat The number as it is written in its country — 098765 43210.
carrier The network it belongs to, if Twilio knows.
lineType mobile, landline, fixedVoip, nonFixedVoip, tollFree and so on, if Twilio knows.

Follow it with If to act on the answer — for example, send an SMS only when lineType is mobile. See Choose a path with If.

Good to know

  • Twilio charges for each lookup, because the step asks for the carrier and line type. Checking valid alone is free in Twilio, but this step always asks for both.
  • Always include + and the country code. The step does not add one, and Twilio cannot tell which country a bare number is from.
  • An invalid number does not fail the step: valid is false, and carrier and lineType are empty.
  • Carrier details are not available for every country; carrier and lineType may be empty for a valid number.
  • Runs once per item.

If something goes wrong

What you see Why What to do
Phone is empty when the step ran — an earlier step may not have given the value it names. The value came out empty. Check the value it reads.
Twilio refused: Authenticate Check the connection's details on Connections. The Auth Token was changed in Twilio. Revoke the connection and reconnect it with the new token.
Twilio refused: … Twilio turned the lookup away, in its own words — for example, the account has no access to line type details. Check Lookup is available on the account in the Twilio Console.