Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Regulation Resource



Regulations Response Properties

regulations-response-properties page anchor

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.

(error)

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 nameTypePIIDescription
sidSID<RN>
Not PII

The unique string that identifies the Regulation resource.

Pattern: ^RN[0-9a-fA-F]{32}$Min length: 34Max length: 34

friendly_namestring

A human-readable description that is assigned to describe the Regulation resource. Examples can include Germany: Mobile - Business.


iso_countrystring

The ISO country code of the phone number's country.


number_typestring

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_typeenum<string>

The type of End User the regulation requires - can be individual or business.

Possible values:
individualbusiness

requirementsobject

The SID of an object that holds the regulatory information of the phone number country, phone number type, and end user type.


urlstring<uri>

The absolute URL of the Regulation resource.


Fetch a Regulation Instance

fetch-a-regulation-instance page anchor
GET https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/{Sid}

A Regulation instance details the End-User Types and values along with Supporting Document Types.

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
SidSID<RN>required

The unique string that identifies the Regulation resource.

Pattern: ^RN[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
IncludeConstraintsbooleanOptional

A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields

Fetch a Regulation Instance

fetch-a-regulation-instance-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_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
_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
_18
async function fetchRegulation() {
_18
const regulation = await client.numbers.v2.regulatoryCompliance
_18
.regulations("RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.fetch();
_18
_18
console.log(regulation.sid);
_18
}
_18
_18
fetchRegulation();

Output

_61
{
_61
"sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_61
"friendly_name": "Australia: Local - Individual",
_61
"iso_country": "AU",
_61
"number_type": "local",
_61
"end_user_type": "individual",
_61
"requirements": {
_61
"end_user": [
_61
{
_61
"name": "Individual",
_61
"type": "individual",
_61
"requirement_name": "individual_info",
_61
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/individual",
_61
"fields": [
_61
"first_name",
_61
"last_name"
_61
],
_61
"detailed_fields": [
_61
{
_61
"machine_name": "first_name",
_61
"friendly_name": "First Name",
_61
"description": "First name of the Individual"
_61
},
_61
{
_61
"machine_name": "last_name",
_61
"friendly_name": "Last Name",
_61
"description": "Last name of the Individual"
_61
}
_61
]
_61
}
_61
],
_61
"supporting_document": [
_61
[
_61
{
_61
"name": "Address",
_61
"type": "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
{
_61
"name": "Address Validation",
_61
"type": "address",
_61
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/DocumentTypes/address",
_61
"fields": [
_61
"address_sids"
_61
],
_61
"detailed_fields": [
_61
{
_61
"machine_name": "address_sids",
_61
"friendly_name": "Address sid(s)",
_61
"description": "Address sid of the individual"
_61
}
_61
]
_61
}
_61
]
_61
}
_61
]
_61
]
_61
},
_61
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_61
}


Retrieve a list of regulations

retrieve-a-list-of-regulations page anchor
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 nameTypeRequiredPIIDescription
EndUserTypeenum<string>Optional

The type of End User the regulation requires - can be individual or business.

Possible values:
individualbusiness

IsoCountrystringOptional

The ISO country code of the phone number's country.


NumberTypestringOptional

The type of phone number that the regulatory requiremnt is restricting.


IncludeConstraintsbooleanOptional

A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields


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.

Retrieve a list of regulations

retrieve-a-list-of-regulations-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_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
_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
_22
async function listRegulation() {
_22
const regulations =
_22
await client.numbers.v2.regulatoryCompliance.regulations.list({
_22
endUserType: "individual",
_22
isoCountry: "au",
_22
numberType: "local",
_22
limit: 20,
_22
});
_22
_22
regulations.forEach((r) => console.log(r.sid));
_22
}
_22
_22
listRegulation();

Output

_74
{
_74
"results": [
_74
{
_74
"sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_74
"friendly_name": "Australia: Local - Individual",
_74
"iso_country": "AU",
_74
"number_type": "local",
_74
"end_user_type": "individual",
_74
"requirements": {
_74
"end_user": [
_74
{
_74
"name": "Individual",
_74
"type": "individual",
_74
"requirement_name": "individual_info",
_74
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/individual",
_74
"fields": [
_74
"first_name",
_74
"last_name"
_74
],
_74
"detailed_fields": [
_74
{
_74
"machine_name": "first_name",
_74
"friendly_name": "First Name",
_74
"description": "First name of the Individual"
_74
},
_74
{
_74
"machine_name": "last_name",
_74
"friendly_name": "Last Name",
_74
"description": "Last name of the Individual"
_74
}
_74
]
_74
}
_74
],
_74
"supporting_document": [
_74
[
_74
{
_74
"name": "Address",
_74
"type": "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
{
_74
"name": "Address Validation",
_74
"type": "address",
_74
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/DocumentTypes/address",
_74
"fields": [
_74
"address_sids"
_74
],
_74
"detailed_fields": [
_74
{
_74
"machine_name": "address_sids",
_74
"friendly_name": "Address sid(s)",
_74
"description": "Address sid of the individual"
_74
}
_74
]
_74
}
_74
]
_74
}
_74
]
_74
]
_74
},
_74
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_74
}
_74
],
_74
"meta": {
_74
"page": 0,
_74
"page_size": 50,
_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,
_74
"key": "results"
_74
}
_74
}


Rate this page: