Regulation Resource
The Twilio Regulatory Compliance REST API allows you to view and understand Regulations. Regulations are requirements based on End-Users and Supporting Documents set for by each country's government.
A Regulation dictates the Regulatory Bundles composition of Item Assignments .
Danger Regulations can and do change. Please make sure not to hardcode any regulation within your application. The Regulation resource is for you to call and populate the values required for regulatory compliance.
Property name Type PII Description
The unique string that identifies the Regulation resource.
Pattern: ^RN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A human-readable description that is assigned to describe the Regulation resource. Examples can include Germany: Mobile - Business.
The ISO country code of the phone number's country.
The type of phone number restricted by the regulatory requirement. For example, Germany mobile phone numbers provisioned by businesses require a business name with commercial register proof from the Handelsregisterauszug and a proof of address from Handelsregisterauszug or a trade license by Gewerbeanmeldung.
end_user_type enum<string> The type of End User the regulation requires - can be individual
or business
.
Possible values: individual
business
The SID of an object that holds the regulatory information of the phone number country, phone number type, and end user type.
The absolute URL of the Regulation resource.
Property name Type Required PII Description
The unique string that identifies the Regulation resource.
Pattern: ^RN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Property name Type Required PII Description
IncludeConstraints boolean Optional A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields
_18 // Download the helper library from https://www.twilio.com/docs/node/install
_18 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18 // Find your Account SID and Auth Token at twilio.com/console
_18 // and set the environment variables. See http://twil.io/secure
_18 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18 const authToken = process.env.TWILIO_AUTH_TOKEN;
_18 const client = twilio(accountSid, authToken);
_18 async function fetchRegulation() {
_18 const regulation = await client.numbers.v2.regulatoryCompliance
_18 .regulations("RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18 console.log(regulation.sid);
_61 "sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_61 "friendly_name": "Australia: Local - Individual",
_61 "number_type": "local",
_61 "end_user_type": "individual",
_61 "name": "Individual",
_61 "type": "individual",
_61 "requirement_name": "individual_info",
_61 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/individual",
_61 "machine_name": "first_name",
_61 "friendly_name": "First Name",
_61 "description": "First name of the Individual"
_61 "machine_name": "last_name",
_61 "friendly_name": "Last Name",
_61 "description": "Last name of the Individual"
_61 "supporting_document": [
_61 "requirement_name": "proof_of_address",
_61 "description": "The physical location of the individual or business. Must be within locality or region covered by the phone numbers prefix; a PO Box is not acceptable where a local address is required.",
_61 "accepted_documents": [
_61 "name": "Address Validation",
_61 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/DocumentTypes/address",
_61 "machine_name": "address_sids",
_61 "friendly_name": "Address sid(s)",
_61 "description": "Address sid of the individual"
_61 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
GET https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations
The Regulations list is extensive and covers all Twilio's countries in the Phone Number Regulations Guidelines(link takes you to an external page) .
The Regulations LIST
endpoint is filterable by IsoCountry
, NumberType
, and EndUserType
so you can select the correct instance of the collection of regulatory requirements.
Property name Type Required PII Description
EndUserType enum<string> Optional The type of End User the regulation requires - can be individual
or business
.
Possible values: individual
business
The ISO country code of the phone number's country.
The type of phone number that the regulatory requiremnt is restricting.
IncludeConstraints boolean Optional A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum: 1
Maximum: 1000
The page index. This value is simply for client state.
Minimum: 0
The page token. This is provided by the API.
_22 // Download the helper library from https://www.twilio.com/docs/node/install
_22 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_22 // Find your Account SID and Auth Token at twilio.com/console
_22 // and set the environment variables. See http://twil.io/secure
_22 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_22 const authToken = process.env.TWILIO_AUTH_TOKEN;
_22 const client = twilio(accountSid, authToken);
_22 async function listRegulation() {
_22 await client.numbers.v2.regulatoryCompliance.regulations.list({
_22 endUserType: "individual",
_22 regulations.forEach((r) => console.log(r.sid));
_74 "sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_74 "friendly_name": "Australia: Local - Individual",
_74 "number_type": "local",
_74 "end_user_type": "individual",
_74 "name": "Individual",
_74 "type": "individual",
_74 "requirement_name": "individual_info",
_74 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/individual",
_74 "machine_name": "first_name",
_74 "friendly_name": "First Name",
_74 "description": "First name of the Individual"
_74 "machine_name": "last_name",
_74 "friendly_name": "Last Name",
_74 "description": "Last name of the Individual"
_74 "supporting_document": [
_74 "requirement_name": "proof_of_address",
_74 "description": "The physical location of the individual or business. Must be within locality or region covered by the phone numbers prefix; a PO Box is not acceptable where a local address is required.",
_74 "accepted_documents": [
_74 "name": "Address Validation",
_74 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/DocumentTypes/address",
_74 "machine_name": "address_sids",
_74 "friendly_name": "Address sid(s)",
_74 "description": "Address sid of the individual"
_74 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_74 "first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?PageSize=50&Page=0",
_74 "previous_page_url": null,
_74 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?PageSize=50&Page=0",
_74 "next_page_url": null,