Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this page
Looking for more inspiration?Visit the

Dialing Permissions - BulkCountryUpdates resource


On this reference page, you'll learn about the parameters and properties for the BulkCountryUpdates resource. See Related how-to documentation to learn the steps to use the info on this page.


BulkCountryUpdates properties

bulkcountryupdates-properties page anchor
Property nameTypeRequiredPIIDescriptionChild properties
updateCountinteger

Optional

Not PII

The number of countries updated

Default: 0

updateRequeststring

Optional

A bulk update request to change voice dialing country permissions stored as a URL-encoded, JSON array of update objects. For example : [ { "iso_code": "GB", "low_risk_numbers_enabled": "true", "high_risk_special_numbers_enabled":"true", "high_risk_tollfraud_numbers_enabled": "false" } ]

The UpdateRequest parameter is a URL-encoded JSON string that describes an array of objects, each object containing these properties.


Create a BulkCountryUpdate

create-a-bulkcountryupdate page anchor

POST https://voice.twilio.com/v1/DialingPermissions/BulkCountryUpdates

Request body parameters

request-body-parameters page anchor
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
updateRequeststring
required

URL encoded JSON array of update objects. example : [ { "iso_code": "GB", "low_risk_numbers_enabled": "true", "high_risk_special_numbers_enabled":"true", "high_risk_tollfraud_numbers_enabled": "false" } ]

Create a BulkCountryUpdate to update a single countryLink to code sample: Create a BulkCountryUpdate to update a single 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 at twilio.com/console
5
// Provision API Keys at twilio.com/console/runtime/api-keys
6
// and set the environment variables. See http://twil.io/secure
7
// For local testing, you can use your Account SID and Auth token
8
const accountSid = process.env.TWILIO_ACCOUNT_SID;
9
const apiKey = process.env.TWILIO_API_KEY;
10
const apiSecret = process.env.TWILIO_API_SECRET;
11
const client = twilio(apiKey, apiSecret, { accountSid: accountSid });
12
13
async function createDialingPermissionsCountryBulkUpdate() {
14
const bulkCountryUpdate =
15
await client.voice.v1.dialingPermissions.bulkCountryUpdates.create({
16
updateRequest: JSON.stringify([
17
{
18
iso_code: "GB",
19
low_risk_numbers_enabled: true,
20
high_risk_special_numbers_enabled: true,
21
high_risk_tollfraud_numbers_enabled: false,
22
},
23
]),
24
});
25
26
console.log(bulkCountryUpdate.updateCount);
27
}
28
29
createDialingPermissionsCountryBulkUpdate();

Response

Note about this response
1
{
2
"update_count": 1,
3
"update_request": "[{\"iso_code\":\"GB\",\"low_risk_numbers_enabled\":true,\"high_risk_special_numbers_enabled\":true,\"high_risk_tollfraud_numbers_enabled\":false}]"
4
}
Create a BulkCountryUpdate to enable low-risk numbers in several countriesLink to code sample: Create a BulkCountryUpdate to enable low-risk numbers in several countries
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 at twilio.com/console
5
// Provision API Keys at twilio.com/console/runtime/api-keys
6
// and set the environment variables. See http://twil.io/secure
7
// For local testing, you can use your Account SID and Auth token
8
const accountSid = process.env.TWILIO_ACCOUNT_SID;
9
const apiKey = process.env.TWILIO_API_KEY;
10
const apiSecret = process.env.TWILIO_API_SECRET;
11
const client = twilio(apiKey, apiSecret, { accountSid: accountSid });
12
13
async function createDialingPermissionsCountryBulkUpdate() {
14
const bulkCountryUpdate =
15
await client.voice.v1.dialingPermissions.bulkCountryUpdates.create({
16
updateRequest: JSON.stringify([
17
{
18
high_risk_special_numbers_enabled: false,
19
high_risk_tollfraud_numbers_enabled: false,
20
iso_code: "US",
21
low_risk_numbers_enabled: true,
22
},
23
{
24
high_risk_special_numbers_enabled: false,
25
high_risk_tollfraud_numbers_enabled: false,
26
iso_code: "DE",
27
low_risk_numbers_enabled: true,
28
},
29
{
30
high_risk_special_numbers_enabled: false,
31
high_risk_tollfraud_numbers_enabled: false,
32
iso_code: "FR",
33
low_risk_numbers_enabled: true,
34
},
35
{
36
high_risk_special_numbers_enabled: false,
37
high_risk_tollfraud_numbers_enabled: false,
38
iso_code: "GB",
39
low_risk_numbers_enabled: true,
40
},
41
{
42
high_risk_special_numbers_enabled: false,
43
high_risk_tollfraud_numbers_enabled: false,
44
iso_code: "IN",
45
low_risk_numbers_enabled: true,
46
},
47
{
48
high_risk_special_numbers_enabled: false,
49
high_risk_tollfraud_numbers_enabled: false,
50
iso_code: "IL",
51
low_risk_numbers_enabled: true,
52
},
53
{
54
high_risk_special_numbers_enabled: false,
55
high_risk_tollfraud_numbers_enabled: false,
56
iso_code: "JP",
57
low_risk_numbers_enabled: true,
58
},
59
{
60
high_risk_special_numbers_enabled: false,
61
high_risk_tollfraud_numbers_enabled: false,
62
iso_code: "BR",
63
low_risk_numbers_enabled: true,
64
},
65
]),
66
});
67
68
console.log(bulkCountryUpdate.updateCount);
69
}
70
71
createDialingPermissionsCountryBulkUpdate();

Response

Note about this response
1
{
2
"update_count": 1,
3
"update_request": "[{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"US\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"DE\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"FR\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"GB\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"IN\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"IL\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"JP\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"BR\",\"low_risk_numbers_enabled\":true}]"
4
}
Create a BulkCountryUpdate to disable high-risk numbers in several countriesLink to code sample: Create a BulkCountryUpdate to disable high-risk numbers in several countries
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 at twilio.com/console
5
// Provision API Keys at twilio.com/console/runtime/api-keys
6
// and set the environment variables. See http://twil.io/secure
7
// For local testing, you can use your Account SID and Auth token
8
const accountSid = process.env.TWILIO_ACCOUNT_SID;
9
const apiKey = process.env.TWILIO_API_KEY;
10
const apiSecret = process.env.TWILIO_API_SECRET;
11
const client = twilio(apiKey, apiSecret, { accountSid: accountSid });
12
13
async function createDialingPermissionsCountryBulkUpdate() {
14
const bulkCountryUpdate =
15
await client.voice.v1.dialingPermissions.bulkCountryUpdates.create({
16
updateRequest: JSON.stringify([
17
{
18
high_risk_special_numbers_enabled: false,
19
high_risk_tollfraud_numbers_enabled: false,
20
iso_code: "CU",
21
low_risk_numbers_enabled: true,
22
},
23
{
24
high_risk_special_numbers_enabled: false,
25
high_risk_tollfraud_numbers_enabled: false,
26
iso_code: "LV",
27
low_risk_numbers_enabled: true,
28
},
29
{
30
high_risk_special_numbers_enabled: false,
31
high_risk_tollfraud_numbers_enabled: false,
32
iso_code: "SO",
33
low_risk_numbers_enabled: true,
34
},
35
{
36
high_risk_special_numbers_enabled: false,
37
high_risk_tollfraud_numbers_enabled: false,
38
iso_code: "LT",
39
low_risk_numbers_enabled: true,
40
},
41
{
42
high_risk_special_numbers_enabled: false,
43
high_risk_tollfraud_numbers_enabled: false,
44
iso_code: "GN",
45
low_risk_numbers_enabled: true,
46
},
47
{
48
high_risk_special_numbers_enabled: false,
49
high_risk_tollfraud_numbers_enabled: false,
50
iso_code: "GM",
51
low_risk_numbers_enabled: true,
52
},
53
{
54
high_risk_special_numbers_enabled: false,
55
high_risk_tollfraud_numbers_enabled: false,
56
iso_code: "MV",
57
low_risk_numbers_enabled: true,
58
},
59
{
60
high_risk_special_numbers_enabled: false,
61
high_risk_tollfraud_numbers_enabled: false,
62
iso_code: "EE",
63
low_risk_numbers_enabled: true,
64
},
65
{
66
high_risk_special_numbers_enabled: false,
67
high_risk_tollfraud_numbers_enabled: false,
68
iso_code: "ZW",
69
low_risk_numbers_enabled: true,
70
},
71
{
72
high_risk_special_numbers_enabled: false,
73
high_risk_tollfraud_numbers_enabled: false,
74
iso_code: "TN",
75
low_risk_numbers_enabled: true,
76
},
77
]),
78
});
79
80
console.log(bulkCountryUpdate.updateCount);
81
}
82
83
createDialingPermissionsCountryBulkUpdate();

Response

Note about this response
1
{
2
"update_count": 1,
3
"update_request": "[{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"CU\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"LV\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"SO\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"LT\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"GN\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"GM\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"MV\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"EE\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"ZW\",\"low_risk_numbers_enabled\":true},{\"high_risk_special_numbers_enabled\":false,\"high_risk_tollfraud_numbers_enabled\":false,\"iso_code\":\"TN\",\"low_risk_numbers_enabled\":true}]"
4
}