List available phone number national

GET /2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/National.json

Available national phone numbers

Path parameters

  • AccountSid string Required

    The SID of the Account requesting the AvailablePhoneNumber resources.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

  • CountryCode string(iso-country-code) Required

    The ISO-3166-1 country code of the country from which to read phone numbers.

Query parameters

  • AreaCode integer

    The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.

  • Contains string

    The pattern on which to match phone numbers. Valid characters are *, 0-9, a-z, and A-Z. The * character matches any single digit. For examples, see Example 2 and Example 3. If specified, this value must have at least two characters.

  • SmsEnabled boolean

    Whether the phone numbers can receive text messages. Can be: true or false.

  • MmsEnabled boolean

    Whether the phone numbers can receive MMS messages. Can be: true or false.

  • VoiceEnabled boolean

    Whether the phone numbers can receive calls. Can be: true or false.

  • ExcludeAllAddressRequired boolean

    Whether to exclude phone numbers that require an Address. Can be: true or false and the default is false.

  • ExcludeLocalAddressRequired boolean

    Whether to exclude phone numbers that require a local Address. Can be: true or false and the default is false.

  • ExcludeForeignAddressRequired boolean

    Whether to exclude phone numbers that require a foreign Address. Can be: true or false and the default is false.

  • Beta boolean

    Whether to read phone numbers that are new to the Twilio platform. Can be: true or false and the default is true.

  • NearNumber string(phone-number)

    Given a phone number, find a geographically close number within distance miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.

  • NearLatLong string

    Given a latitude/longitude pair lat,long find geographically close numbers within distance miles. Applies to only phone numbers in the US and Canada.

  • Distance integer

    The search radius, in miles, for a near_ query. Can be up to 500 and the default is 25. Applies to only phone numbers in the US and Canada.

  • InPostalCode string

    Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.

  • InRegion string

    Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.

  • InRateCenter string

    Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires in_lata to be set as well. Applies to only phone numbers in the US and Canada.

  • InLata string

    Limit results to a specific local access and transport area (LATA). Given a phone number, search within the same LATA as that number. Applies to only phone numbers in the US and Canada.

  • InLocality string

    Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.

  • FaxEnabled boolean

    Whether the phone numbers can receive faxes. Can be: true or false.

  • PageSize integer(int64)

    How many resources to return in each list page. The default is 50, and the maximum is 1000.

    Minimum value is 1, maximum value is 1000.

  • Page integer

    The page index. This value is simply for client state.

    Minimum value is 0.

  • PageToken string

    The page token. This is provided by the API.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • available_phone_numbers array[object]
      Hide available_phone_numbers attributes Show available_phone_numbers attributes object
      • friendly_name string(phone-number) | null

        A formatted version of the phone number.

      • phone_number string(phone-number) | null

        The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.

      • lata string | null

        The LATA of this phone number. Available for only phone numbers from the US and Canada.

      • locality string | null

        The locality or city of this phone number's location.

      • rate_center string | null

        The rate center of this phone number. Available for only phone numbers from the US and Canada.

      • latitude number | null

        The latitude of this phone number's location. Available for only phone numbers from the US and Canada.

      • longitude number | null

        The longitude of this phone number's location. Available for only phone numbers from the US and Canada.

      • region string | null

        The two-letter state or province abbreviation of this phone number's location. Available for only phone numbers from the US and Canada.

      • postal_code string | null

        The postal or ZIP code of this phone number's location. Available for only phone numbers from the US and Canada.

      • iso_country string(iso-country-code) | null

        The ISO country code of this phone number.

      • address_requirements string | null

        The type of Address resource the phone number requires. Can be: none, any, local, or foreign. none means no address is required. any means an address is required, but it can be anywhere in the world. local means an address in the phone number's country is required. foreign means an address outside of the phone number's country is required.

      • beta boolean | null

        Whether the phone number is new to the Twilio platform. Can be: true or false.

      • capabilities object(phone-number-capabilities) | null

        The set of Boolean properties that indicate whether a phone number can receive calls or messages. Capabilities are: Voice, SMS, and MMS and each capability can be: true or false.

        Hide capabilities attributes Show capabilities attributes object(phone-number-capabilities) | null
        • mms boolean
        • sms boolean
        • voice boolean
        • fax boolean
    • end integer
    • first_page_uri string(uri)
    • next_page_uri string(uri) | null
    • page integer
    • page_size integer
    • previous_page_uri string(uri) | null
    • start integer
    • uri string(uri)
GET /2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/National.json
curl \
 --request GET 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/National.json' \
 --user "username:password"
Response examples (200)
{
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json",
  "available_phone_numbers": [
    {
      "beta": false,
      "lata": null,
      "region": null,
      "latitude": null,
      "locality": null,
      "longitude": null,
      "iso_country": "NO",
      "postal_code": null,
      "rate_center": null,
      "capabilities": {
        "mms": false,
        "sms": true,
        "voice": false
      },
      "phone_number": "+4759440374",
      "friendly_name": "+4759440374",
      "address_requirements": "none"
    }
  ]
}
{
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json",
  "available_phone_numbers": []
}