Skip to contentSkip to navigationSkip to topbar
On this page

DialingPermissions Country Resource


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


DialingPermissions Country properties

dialingpermissions-country-properties page anchor
Property nameTypeRequiredDescriptionChild properties
iso_codestring<iso-country-code>Optional
Not PII

namestringOptional

The name of the country.


continentstringOptional

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


country_codesarray[string]Optional

low_risk_numbers_enabledbooleanOptional

Whether dialing to low-risk numbers is enabled.


high_risk_special_numbers_enabledbooleanOptional

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


high_risk_tollfraud_numbers_enabledbooleanOptional

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.


Fetch a DialingPermissions Country resource

fetch-a-dialingpermissions-country-resource page anchor
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

Fetch a DialingPermissions Country resourceLink to code sample: Fetch a DialingPermissions Country resource
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();

Output

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
}

Read multiple DialingPermissions Country resources

read-multiple-dialingpermissions-country-resources 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)


ContinentstringOptional

Filter to retrieve the country permissions by specifying the continent


CountryCodestringOptional

LowRiskNumbersEnabledbooleanOptional

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


HighRiskSpecialNumbersEnabledbooleanOptional

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


HighRiskTollfraudNumbersEnabledbooleanOptional

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.


PageSizeintegerOptional

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

Minimum: 1Maximum: 1000

PageintegerOptional

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

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

Read multiple DialingPermissions Country resourcesLink to code sample: Read multiple DialingPermissions Country resources
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();

Output

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
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.