The v2 Regulatory Compliance APIs are currently in Public Beta. No breaking changes in the API contract will occur when the API moves from Public Beta to GA.
The Twilio End-User REST API allows you to create End-Users to follow Regulations. The End-User is the entity that answers the phone call or receives the message of a phone number. An entity can be either an individual
or a business
. You can find more information about the possible End-Users by referencing End-User Type resource.
You will Assign Items to an End-User of a Regulatory Bundle with Supporting Documents. For applications that manage many End-Users, you will need to ensure that you assign the End-User instance to the correct Bundle instance to be in compliance with regulations.
The fields of the End-User resource response is in JSON. The type SID<IT> is a unique ID starting with letters IT. For more information about Twilio SIDs, please refer to Twilio's glossary on SIDs.
The unique string created by Twilio to identify the End User resource.
^IT[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the End User resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The type of end user of the Bundle resource - can be individual
or business
.
individual
business
The set of parameters that are the attributes of the End Users resource which are listed in the End User Types.
The date and time in GMT when the resource was created specified in ISO 8601 format.
The date and time in GMT when the resource was last updated specified in ISO 8601 format.
The absolute URL of the End User resource.
POST https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers
To provision or port a phone number to Twilio, you will need to create a new End-User of a phone number.
The End-User is the individual or business who answers the phone call or receives the message.
You will need to assign the End-User to a Regulatory Bundle and that Regulatory Bundle assigned to a Phone Number.
application/x-www-form-urlencoded
The type of end user of the Bundle resource - can be individual
or business
.
individual
business
The set of parameters that are the attributes of the End User resource which are derived End User Types.
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 createEndUser() {11const endUser = await client.numbers.v2.regulatoryCompliance.endUsers.create({12attributes: {13business_name: "Twilio",14vat: "2348132",15business_description: "Communications Platform as a Service",16},17friendlyName: "Twilio, Inc.",18type: "business",19});2021console.log(endUser.sid);22}2324createEndUser();
1{2"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "Twilio, Inc.",5"type": "business",6"attributes": {78},9"date_created": "2019-07-30T21:57:45Z",10"date_updated": "2019-07-30T21:57:45Z",11"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"12}
Note: the EndUserType
must be either individual
or business
.
GET https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/{Sid}
The unique string created by Twilio to identify the End User resource.
^IT[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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 fetchEndUser() {11const endUser = await client.numbers.v2.regulatoryCompliance12.endUsers("ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(endUser.sid);16}1718fetchEndUser();
1{2"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "friendly_name",5"type": "individual",6"attributes": {78},9"date_created": "2019-07-30T21:57:45Z",10"date_updated": "2019-07-30T21:57:45Z",11"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"12}
GET https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers
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 listEndUser() {11const endUsers = await client.numbers.v2.regulatoryCompliance.endUsers.list({12limit: 20,13});1415endUsers.forEach((e) => console.log(e.sid));16}1718listEndUser();
1{2"results": [],3"meta": {4"page": 0,5"page_size": 50,6"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers?PageSize=50&Page=0",7"previous_page_url": null,8"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers?PageSize=50&Page=0",9"next_page_url": null,10"key": "results"11}12}
POST https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/{Sid}
The unique string created by Twilio to identify the End User resource.
^IT[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
The set of parameters that are the attributes of the End User resource which are derived End User Types.
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 updateEndUser() {11const endUser = await client.numbers.v2.regulatoryCompliance12.endUsers("ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.update({14attributes: {1516first_name: "Jeff",17},18friendlyName: "Twilio",19});2021console.log(endUser.sid);22}2324updateEndUser();
1{2"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "Twilio",5"type": "individual",6"attributes": {78},9"date_created": "2019-07-30T21:57:45Z",10"date_updated": "2019-07-30T21:57:45Z",11"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"12}
DELETE https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/{Sid}
The unique string created by Twilio to identify the End User resource.
^IT[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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 deleteEndUser() {11await client.numbers.v2.regulatoryCompliance12.endUsers("ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.remove();14}1516deleteEndUser();