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.

Resource properties
sidtype: SID<RN>Not PII

The unique string that identifies the Regulation resource.


friendly_nametype: stringNot PII

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


iso_countrytype: stringNot PII

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


number_typetype: stringNot PII

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_typetype: enum<STRING>Not PII

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

Possible values:
individualbusiness

requirementstype: objectNot PII

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


urltype: string<URI>Not PII

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.

Parameters

fetch-parameters page anchor
URI parameters
Sidtype: SID<RN>Not PII
Path Parameter

The unique string that identifies the Regulation resource.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.numbers.v2.regulatoryCompliance
_11
.regulations('RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.fetch()
_11
.then(regulation => console.log(regulation.sid));

Output

_61
{
_61
"sid": "RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_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.

URI parameters
EndUserTypetype: enum<STRING>Not PII
Query Parameter

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

Possible values:
individualbusiness

IsoCountrytype: stringNot PII
Query Parameter

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


NumberTypetype: stringNot PII
Query Parameter

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


PageSizetype: integerNot PII
Query Parameter

How many resources to return in each list page. The default is 50, and the maximum is 1000.


Pagetype: integerNot PII
Query Parameter

The page index. This value is simply for client state.


PageTokentype: stringNot PII
Query Parameter

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

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = require('twilio')(accountSid, authToken);
_16
_16
client.numbers.v2.regulatoryCompliance
_16
.regulations
_16
.list({
_16
endUserType: 'individual',
_16
isoCountry: 'au',
_16
numberType: 'local',
_16
limit: 20
_16
})
_16
.then(regulations => regulations.forEach(r => console.log(r.sid)));

Output

_74
{
_74
"results": [
_74
{
_74
"sid": "RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_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": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?PageSize=50&Page=0",
_74
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?PageSize=50&Page=0",
_74
"next_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations?PageSize=50&Page=1",
_74
"key": "results"
_74
}
_74
}


Rate this page: