Updates country dialing permissions in bulk.
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.
high_risk_special_numbers_enabled
‐ (Boolean) Whether high-risk special numbers are enabledhigh_risk_tollfraud_numbers_enabled
‐ (Boolean) Whether high-risk toll fraud numbers are enablediso_code
‐ (string) The ISO country codelow_risk_numbers_enabled
‐ (Boolean) Whether low risk numbers are enabledPOST https://voice.twilio.com/v1/DialingPermissions/BulkCountryUpdates
application/x-www-form-urlencoded
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" } ]
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createDialingPermissionsCountryBulkUpdate() {11const bulkCountryUpdate =12await client.voice.v1.dialingPermissions.bulkCountryUpdates.create({13updateRequest: JSON.stringify([14{15iso_code: "GB",16low_risk_numbers_enabled: true,17high_risk_special_numbers_enabled: true,18high_risk_tollfraud_numbers_enabled: false,19},20]),21});2223console.log(bulkCountryUpdate.updateCount);24}2526createDialingPermissionsCountryBulkUpdate();
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}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createDialingPermissionsCountryBulkUpdate() {11const bulkCountryUpdate =12await client.voice.v1.dialingPermissions.bulkCountryUpdates.create({13updateRequest: JSON.stringify([14{15high_risk_special_numbers_enabled: false,16high_risk_tollfraud_numbers_enabled: false,17iso_code: "US",18low_risk_numbers_enabled: true,19},20{21high_risk_special_numbers_enabled: false,22high_risk_tollfraud_numbers_enabled: false,23iso_code: "DE",24low_risk_numbers_enabled: true,25},26{27high_risk_special_numbers_enabled: false,28high_risk_tollfraud_numbers_enabled: false,29iso_code: "FR",30low_risk_numbers_enabled: true,31},32{33high_risk_special_numbers_enabled: false,34high_risk_tollfraud_numbers_enabled: false,35iso_code: "GB",36low_risk_numbers_enabled: true,37},38{39high_risk_special_numbers_enabled: false,40high_risk_tollfraud_numbers_enabled: false,41iso_code: "IN",42low_risk_numbers_enabled: true,43},44{45high_risk_special_numbers_enabled: false,46high_risk_tollfraud_numbers_enabled: false,47iso_code: "IL",48low_risk_numbers_enabled: true,49},50{51high_risk_special_numbers_enabled: false,52high_risk_tollfraud_numbers_enabled: false,53iso_code: "JP",54low_risk_numbers_enabled: true,55},56{57high_risk_special_numbers_enabled: false,58high_risk_tollfraud_numbers_enabled: false,59iso_code: "BR",60low_risk_numbers_enabled: true,61},62]),63});6465console.log(bulkCountryUpdate.updateCount);66}6768createDialingPermissionsCountryBulkUpdate();
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}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createDialingPermissionsCountryBulkUpdate() {11const bulkCountryUpdate =12await client.voice.v1.dialingPermissions.bulkCountryUpdates.create({13updateRequest: JSON.stringify([14{15high_risk_special_numbers_enabled: false,16high_risk_tollfraud_numbers_enabled: false,17iso_code: "CU",18low_risk_numbers_enabled: true,19},20{21high_risk_special_numbers_enabled: false,22high_risk_tollfraud_numbers_enabled: false,23iso_code: "LV",24low_risk_numbers_enabled: true,25},26{27high_risk_special_numbers_enabled: false,28high_risk_tollfraud_numbers_enabled: false,29iso_code: "SO",30low_risk_numbers_enabled: true,31},32{33high_risk_special_numbers_enabled: false,34high_risk_tollfraud_numbers_enabled: false,35iso_code: "LT",36low_risk_numbers_enabled: true,37},38{39high_risk_special_numbers_enabled: false,40high_risk_tollfraud_numbers_enabled: false,41iso_code: "GN",42low_risk_numbers_enabled: true,43},44{45high_risk_special_numbers_enabled: false,46high_risk_tollfraud_numbers_enabled: false,47iso_code: "GM",48low_risk_numbers_enabled: true,49},50{51high_risk_special_numbers_enabled: false,52high_risk_tollfraud_numbers_enabled: false,53iso_code: "MV",54low_risk_numbers_enabled: true,55},56{57high_risk_special_numbers_enabled: false,58high_risk_tollfraud_numbers_enabled: false,59iso_code: "EE",60low_risk_numbers_enabled: true,61},62{63high_risk_special_numbers_enabled: false,64high_risk_tollfraud_numbers_enabled: false,65iso_code: "ZW",66low_risk_numbers_enabled: true,67},68{69high_risk_special_numbers_enabled: false,70high_risk_tollfraud_numbers_enabled: false,71iso_code: "TN",72low_risk_numbers_enabled: true,73},74]),75});7677console.log(bulkCountryUpdate.updateCount);78}7980createDialingPermissionsCountryBulkUpdate();
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}