List available phone number country

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

Country codes with available phone numbers

Path parameters

  • AccountSid string Required

    The SID of the Account requesting the available phone number Country resources.

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

Query parameters

  • 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
    • countries array[object]
      Hide countries attributes Show countries attributes object
      • country_code string(iso-country-code) | null

        The ISO-3166-1 country code of the country.

      • country string | null

        The name of the country.

      • uri string(uri) | null

        The URI of the Country resource, relative to https://api.twilio.com.

      • beta boolean | null

        Whether all phone numbers available in the country are new to the Twilio platform. true if they are and false if all numbers are not in the Twilio Phone Number Beta program.

      • subresource_uris object(uri-map) | null

        A list of related AvailablePhoneNumber resources identified by their URIs relative to https://api.twilio.com.

    • 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.json
curl \
 --request GET 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers.json' \
 --user "username:password"
Response examples (200)
{
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json",
  "countries": [
    {
      "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/DK.json",
      "beta": false,
      "country": "Denmark",
      "country_code": "DK",
      "subresource_uris": {
        "local": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/DK/Local.json",
        "toll_free": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/DK/TollFree.json"
      }
    },
    {
      "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/AU.json",
      "beta": false,
      "country": "Australia",
      "country_code": "AU",
      "subresource_uris": {
        "local": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/AU/Local.json",
        "mobile": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/AU/Mobile.json",
        "toll_free": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/AU/TollFree.json"
      }
    }
  ]
}
{
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json",
  "countries": []
}