0

While working with Twilio's Regulatory Compliance API, I discovered that it is not possible to determine the "type" of a phone number (local, toll-free, national) after a user purchases the phone number. This property does not seem to be exposed on the IncomingPhoneNumber API.

This would be useful as I'd like to indicate to the user on their custom dashboard in my app (not Twilio console) that the phone number they own requires a Regulatory Compliance Bundle. However, the Regulatory Compliance API requires the following properties to list phone requirements:

  • IsoCountry
  • NumberType <--- I don't know how to get this value after purchasing the number?
  • EndUserType

What is the suggested method for displaying to a user that a phone is missing regulatory information?

I noticed that the console API:

https://www.twilio.com/console/phone-numbers/api/v1/inventory/PNXXXX

DOES return the phone number type, which is then used for the following query to return compliance information:

https://www.twilio.com/console/phone-numbers/api/v1/regulatory/regulations?isoCountry=US&numberType=local

Would love any insight on this!

Here is a 7 year old question asking something similar. Twilio get "type" of number. Local, Mobile, or Toll Free

I'm trying to prevent adding phone numbers to my database so I don't have to deal with updating data in 2 locations if a user deletes/modifies a number using the Twilio API.

Jordan Lewallen
  • 1,681
  • 19
  • 54

1 Answers1

0

Twilio developer evangelist here.

I'm afraid there is not a generally available way to get the number type once you have bought the phone number.

There is the global phone numbers catalog API, active numbers endpoint, but that is currently in private preview. If you have a Twilio account executive, it would be worth asking about access to this API, though I can't promise you anything.

Otherwise, I would explore storing data about the phone numbers.

philnash
  • 70,667
  • 10
  • 60
  • 88