Skip to contentSkip to navigationSkip to topbar
On this page

Dialing Permissions - Countries resource


Voice dialing permissions are organized by country and identified by the country's ISO(link takes you to an external page) code.


Countries properties

countries-properties page anchor
Property nameTypeRequiredDescriptionChild properties
isoCodestring<iso-country-code>

Optional

Not PII

namestring

Optional

The name of the country.


continentstring

Optional

The name of the continent in which the country is located.


countryCodesarray[string]

Optional


lowRiskNumbersEnabledboolean

Optional

Whether dialing to low-risk numbers is enabled.


highRiskSpecialNumbersEnabledboolean

Optional

Whether dialing to high-risk special services numbers is enabled. These prefixes include number ranges allocated by the country and include premium numbers, special services, shared cost, and others


highRiskTollfraudNumbersEnabledboolean

Optional

Whether dialing to high-risk toll fraud(link takes you to an external page) numbers is enabled. These prefixes include narrow number ranges that have a high-risk of international revenue sharing fraud (IRSF) attacks, also known as toll fraud(link takes you to an external page). These prefixes are collected from anti-fraud databases and verified by analyzing calls on our network. These prefixes are not available for download and are updated frequently


urlstring<uri>

Optional

The absolute URL of this resource.


linksobject<uri-map>

Optional

A list of URLs related to this resource.


GET https://voice.twilio.com/v1/DialingPermissions/Countries/{IsoCode}

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
isoCodestring<iso-country-code>
required

The ISO country code(link takes you to an external page) of the DialingPermissions Country resource to fetch

Retrieve a CountryLink to code sample: Retrieve a Country
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchDialingPermissionsCountry() {
11
const country = await client.voice.v1.dialingPermissions
12
.countries("US")
13
.fetch();
14
15
console.log(country.isoCode);
16
}
17
18
fetchDialingPermissionsCountry();

Response

Note about this response
1
{
2
"iso_code": "US",
3
"name": "United States/Canada",
4
"country_codes": [
5
"+1"
6
],
7
"continent": "NORTH_AMERICA",
8
"low_risk_numbers_enabled": false,
9
"high_risk_special_numbers_enabled": false,
10
"high_risk_tollfraud_numbers_enabled": false,
11
"url": "https://voice.twilio.com/v1/DialingPermissions/Countries/US",
12
"links": {
13
"highrisk_special_prefixes": "https://voice.twilio.com/v1/DialingPermissions/Countries/US/HighRiskSpecialPrefixes"
14
}
15
}

Retrieve a list of Countries

retrieve-a-list-of-countries page anchor

GET https://voice.twilio.com/v1/DialingPermissions/Countries

Property nameTypeRequiredPIIDescription
isoCodestring<iso-country-code>

Optional

Filter to retrieve the country permissions by specifying the ISO country code(link takes you to an external page)


continentstring

Optional

Filter to retrieve the country permissions by specifying the continent


countryCodestring

Optional


lowRiskNumbersEnabledboolean

Optional

Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: true or false.


highRiskSpecialNumbersEnabledboolean

Optional

Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: true or false


highRiskTollfraudNumbersEnabledboolean

Optional

Filter to retrieve the country permissions with dialing to high-risk toll fraud(link takes you to an external page) numbers enabled. Can be: true or false.


pageSizeinteger<int64>

Optional

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

Minimum: 1Maximum: 1000

pageinteger

Optional

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

Minimum: 0

pageTokenstring

Optional

The page token. This is provided by the API.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listDialingPermissionsCountry() {
11
const countries = await client.voice.v1.dialingPermissions.countries.list({
12
limit: 20,
13
});
14
15
countries.forEach((c) => console.log(c.isoCode));
16
}
17
18
listDialingPermissionsCountry();

Response

Note about this response
1
{
2
"content": [
3
{
4
"iso_code": "US",
5
"name": "United States/Canada",
6
"country_codes": [
7
"+1"
8
],
9
"continent": "NORTH_AMERICA",
10
"low_risk_numbers_enabled": false,
11
"high_risk_special_numbers_enabled": false,
12
"high_risk_tollfraud_numbers_enabled": false,
13
"url": "https://voice.twilio.com/v1/DialingPermissions/Countries/US",
14
"links": {
15
"highrisk_special_prefixes": "https://voice.twilio.com/v1/DialingPermissions/Countries/US/HighRiskSpecialPrefixes"
16
}
17
}
18
],
19
"meta": {
20
"first_page_url": "https://voice.twilio.com/v1/DialingPermissions/Countries?IsoCode=US&PageSize=50&Page=0",
21
"key": "content",
22
"next_page_url": null,
23
"page": 0,
24
"page_size": 50,
25
"previous_page_url": null,
26
"url": "https://voice.twilio.com/v1/DialingPermissions/Countries?IsoCode=US&PageSize=50&Page=0"
27
}
28
}