EndUsers resource
Public Beta release
Twilio released the Regulatory Compliance API v2 under Public Beta.
The end user represents an individual or business that must comply with regulations. This end user answers a phone call or receives a message from a phone number. To learn more about supported end user categories, see the EndUserType
resource.
To meet regulatory compliance, you must submit a Regulatory Bundle to the regulator. These bundles combine end users who use the phone number and supporting documents that verify the end user, number, and, if needed, company.
After you create an empty Regulatory Bundle, you can assign end users created with this resource to that bundle.
The EndUsers
resource returns a response in JSON format. To learn more about Twilio SIDs, see the glossary entry 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, create an end user for that phone number.
Each end user represents the individual or business who answers a phone call or receives a text message.
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();
Response
1{2"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "Twilio, Inc.",5"type": "business",6"attributes": {7"email": "foobar@twilio.com"8},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/{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();
Response
1{2"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "friendly_name",5"type": "individual",6"attributes": {7"email": "foobar@twilio.com"8},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();
Response
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: {15email: "foobar@twilio.com",16first_name: "Jeff",17},18friendlyName: "Twilio",19});2021console.log(endUser.sid);22}2324updateEndUser();
Response
1{2"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "Twilio",5"type": "individual",6"attributes": {7"email": "foobar@twilio.com"8},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();