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.
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.
The unique string that identifies the Regulation resource.
^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 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.
The type of End User the regulation requires - can be individual
or business
.
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.
GET https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/{Sid}
A Regulation instance details the End-User Types and values along with Supporting Document Types.
The unique string that identifies the Regulation resource.
^RN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields
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 fetchRegulation() {11const regulation = await client.numbers.v2.regulatoryCompliance12.regulations("RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(regulation.sid);16}1718fetchRegulation();
1{2"sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"friendly_name": "Australia: Local - Individual",4"iso_country": "AU",5"number_type": "local",6"end_user_type": "individual",7"requirements": {8"end_user": [9{10"name": "Individual",11"type": "individual",12"requirement_name": "individual_info",13"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/individual",14"fields": [15"first_name",16"last_name"17],18"detailed_fields": [19{20"machine_name": "first_name",21"friendly_name": "First Name",22"description": "First name of the Individual"23},24{25"machine_name": "last_name",26"friendly_name": "Last Name",27"description": "Last name of the Individual"28}29]30}31],32"supporting_document": [33[34{35"name": "Address",36"type": "document",37"requirement_name": "proof_of_address",38"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.",39"accepted_documents": [40{41"name": "Address Validation",42"type": "address",43"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/DocumentTypes/address",44"fields": [45"address_sids"46],47"detailed_fields": [48{49"machine_name": "address_sids",50"friendly_name": "Address sid(s)",51"description": "Address sid of the individual"52}53]54}55]56}57]58]59},60"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"61}
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.
The Regulations LIST
endpoint is filterable by IsoCountry
, NumberType
, and EndUserType
so you can select the correct instance of the collection of regulatory requirements.
The type of End User the regulation requires - can be individual
or business
.
individual
business
The type of phone number that the regulatory requiremnt is restricting.
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.
1
Maximum: 1000
The page token. This is provided by the API.
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 listRegulation() {11const regulations =12await client.numbers.v2.regulatoryCompliance.regulations.list({13endUserType: "individual",14isoCountry: "au",15numberType: "local",16limit: 20,17});1819regulations.forEach((r) => console.log(r.sid));20}2122listRegulation();
1{2"results": [3{4"sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"friendly_name": "Australia: Local - Individual",6"iso_country": "AU",7"number_type": "local",8"end_user_type": "individual",9"requirements": {10"end_user": [11{12"name": "Individual",13"type": "individual",14"requirement_name": "individual_info",15"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/individual",16"fields": [17"first_name",18"last_name"19],20"detailed_fields": [21{22"machine_name": "first_name",23"friendly_name": "First Name",24"description": "First name of the Individual"25},26{27"machine_name": "last_name",28"friendly_name": "Last Name",29"description": "Last name of the Individual"30}31]32}33],34"supporting_document": [35[36{37"name": "Address",38"type": "document",39"requirement_name": "proof_of_address",40"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.",41"accepted_documents": [42{43"name": "Address Validation",44"type": "address",45"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/DocumentTypes/address",46"fields": [47"address_sids"48],49"detailed_fields": [50{51"machine_name": "address_sids",52"friendly_name": "Address sid(s)",53"description": "Address sid of the individual"54}55]56}57]58}59]60]61},62"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"63}64],65"meta": {66"page": 0,67"page_size": 50,68"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?PageSize=50&Page=0",69"previous_page_url": null,70"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?PageSize=50&Page=0",71"next_page_url": null,72"key": "results"73}74}