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: 34Max length: 34The SID of the Account that created the End User resource.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The type of end user of the Bundle resource - can be individual or business.
individualbusinessThe 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-urlencodedThe type of end user of the Bundle resource - can be individual or business.
individualbusinessThe 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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createEndUser() {14const endUser = await client.numbers.v2.regulatoryCompliance.endUsers.create({15attributes: {16business_name: "Twilio",17vat: "2348132",18business_description: "Communications Platform as a Service",19},20friendlyName: "Twilio, Inc.",21type: "business",22});2324console.log(endUser.sid);25}2627createEndUser();
Response
1{2"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "Twilio, Inc.",5"type": "business",6"attributes": {7"business_name": "Twilio",8"vat": "2348132",9"business_description": "Communications Platform as a Service"10},11"date_created": "2019-07-30T21:57:45Z",12"date_updated": "2019-07-30T21:57:45Z",13"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"14}
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: 34Max length: 341// 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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function fetchEndUser() {14const endUser = await client.numbers.v2.regulatoryCompliance15.endUsers("ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")16.fetch();1718console.log(endUser.sid);19}2021fetchEndUser();
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.
1Maximum: 1000The 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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function listEndUser() {14const endUsers = await client.numbers.v2.regulatoryCompliance.endUsers.list({15limit: 20,16});1718endUsers.forEach((e) => console.log(e.sid));19}2021listEndUser();
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: 34Max length: 34application/x-www-form-urlencodedThe 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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function updateEndUser() {14const endUser = await client.numbers.v2.regulatoryCompliance15.endUsers("ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")16.update({17attributes: {18email: "foobar@twilio.com",19first_name: "Jeff",20},21friendlyName: "Twilio",22});2324console.log(endUser.sid);25}2627updateEndUser();
Response
1{2"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "Twilio",5"type": "individual",6"attributes": {7"email": "foobar@twilio.com",8"first_name": "Jeff"9},10"date_created": "2019-07-30T21:57:45Z",11"date_updated": "2019-07-30T21:57:45Z",12"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"13}
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: 34Max length: 341// 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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function deleteEndUser() {14await client.numbers.v2.regulatoryCompliance15.endUsers("ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")16.remove();17}1819deleteEndUser();