End-Users Resource
Warning
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.
Resource properties
sid
type: SID<IT>
The unique string created by Twilio to identify the End User resource.
Pattern:
^IT[0-9a-fA-F]{32}$
friendly_name
type: string
The string that you assigned to describe the resource.
type
type: enum<string>
The type of end user of the Bundle resource - can be individual
or business
.
Possible values:
individual
business
attributes
type: object
The set of parameters that are the attributes of the End Users resource which are listed in the End User Types.
date_created
type: string<date-time>
date_updated
type: string<date-time>
url
type: string<uri>
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.
Request body parameters
FriendlyName
type: stringRequired
The string that you assigned to describe the resource.
Type
type: enum<string>Required
The type of end user of the Bundle resource - can be individual
or business
.
Possible values:
individual
business
Attributes
type: object
The set of parameters that are the attributes of the End User resource which are derived End User Types.
_15// Download the helper library from https://www.twilio.com/docs/node/install
_15// Find your Account SID and Auth Token at twilio.com/console
_15// and set the environment variables. See http://twil.io/secure
_15const accountSid = process.env.TWILIO_ACCOUNT_SID;
_15const authToken = process.env.TWILIO_AUTH_TOKEN;
_15const client = require('twilio')(accountSid, authToken);
_15client.numbers.v2.regulatoryCompliance
_15 .create({attributes: {
_15 business_name: 'Twilio',
_15 business_description: 'Communications Platform as a Service'
_15 }, friendlyName: 'Twilio, Inc.', type: 'business'})
_15 .then(end_user => console.log(end_user.sid));
_14 "sid": "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14 "friendly_name": "Twilio, Inc.",
_14 "business_name": "Twilio",
_14 "business_description": "Communications Platform as a Service"
_14 "date_created": "2019-07-30T21:57:45Z",
_14 "date_updated": "2019-07-30T21:57:45Z",
_14 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Note: the EndUserType
must be either individual
or business
.
GET https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/{Sid}
URI parameters
Sid
type: SID<IT>
The unique string created by Twilio to identify the End User resource.
Pattern:
^IT[0-9a-fA-F]{32}$
_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
_11const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11const authToken = process.env.TWILIO_AUTH_TOKEN;
_11const client = require('twilio')(accountSid, authToken);
_11client.numbers.v2.regulatoryCompliance
_11 .endUsers('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .then(end_user => console.log(end_user.sid));
_12 "sid": "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_12 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_12 "friendly_name": "friendly_name",
_12 "type": "individual",
_12 "email": "foobar@twilio.com"
_12 "date_created": "2019-07-30T21:57:45Z",
_12 "date_updated": "2019-07-30T21:57:45Z",
_12 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
GET https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers
URI parameters
PageSize
type: integer
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Page
type: integer
The page index. This value is simply for client state.
PageToken
type: string
The page token. This is provided by the API.
_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
_11const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11const authToken = process.env.TWILIO_AUTH_TOKEN;
_11const client = require('twilio')(accountSid, authToken);
_11client.numbers.v2.regulatoryCompliance
_11 .then(endUsers => endUsers.forEach(e => console.log(e.sid)));
_25 "sid": "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_25 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_25 "friendly_name": "friendly_name",
_25 "type": "individual",
_25 "email": "foobar@twilio.com"
_25 "date_created": "2019-07-30T21:57:45Z",
_25 "date_updated": "2019-07-30T21:57:45Z",
_25 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_25 "first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers?PageSize=50&Page=0",
_25 "previous_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers?PageSize=50&Page=0",
_25 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers?PageSize=50&Page=0",
_25 "next_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers?PageSize=50&Page=1",
POST https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/{Sid}
URI parameters
Sid
type: SID<IT>
The unique string created by Twilio to identify the End User resource.
Pattern:
^IT[0-9a-fA-F]{32}$
Request body parameters
FriendlyName
type: string
The string that you assigned to describe the resource.
Attributes
type: object
The set of parameters that are the attributes of the End User resource which are derived End User Types.
_14// Download the helper library from https://www.twilio.com/docs/node/install
_14// Find your Account SID and Auth Token at twilio.com/console
_14// and set the environment variables. See http://twil.io/secure
_14const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14const authToken = process.env.TWILIO_AUTH_TOKEN;
_14const client = require('twilio')(accountSid, authToken);
_14client.numbers.v2.regulatoryCompliance
_14 .endUsers('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_14 .update({attributes: {
_14 email: 'foobar@twilio.com',
_14 }, friendlyName: 'Twilio'})
_14 .then(end_user => console.log(end_user.friendlyName));
_13 "sid": "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13 "friendly_name": "Twilio",
_13 "type": "individual",
_13 "email": "foobar@twilio.com",
_13 "date_created": "2019-07-30T21:57:45Z",
_13 "date_updated": "2019-07-30T21:57:45Z",
_13 "url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
DELETE https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/{Sid}
URI parameters
Sid
type: SID<IT>
The unique string created by Twilio to identify the End User resource.
Pattern:
^IT[0-9a-fA-F]{32}$
_10// Download the helper library from https://www.twilio.com/docs/node/install
_10// Find your Account SID and Auth Token at twilio.com/console
_10// and set the environment variables. See http://twil.io/secure
_10const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10const authToken = process.env.TWILIO_AUTH_TOKEN;
_10const client = require('twilio')(accountSid, authToken);
_10client.numbers.v2.regulatoryCompliance.endUsers('').remove();