Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

End-Users Resource


(warning)

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.


End-User Response Properties

end-user-response-properties page anchor

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.

Property nameTypePIIDescription
sidSID<IT>
Not PII

The unique string created by Twilio to identify the End User resource.

Pattern: ^IT[0-9a-fA-F]{32}$Min length: 34Max length: 34

account_sidSID<AC>

The SID of the Account that created the End User resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

friendly_namestring

The string that you assigned to describe the resource.


typeenum<string>

The type of end user of the Bundle resource - can be individual or business.

Possible values:
individualbusiness

attributesobject
PII MTL: 30 days

The set of parameters that are the attributes of the End Users resource which are listed in the End User Types.


date_updatedstring<date-time>

The date and time in GMT when the resource was last updated specified in ISO 8601(link takes you to an external page) format.


urlstring<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

request-body-parameters page anchor
Property nameTypeRequiredPIIDescription
FriendlyNamestringrequired

The string that you assigned to describe the resource.


Typeenum<string>required

The type of end user of the Bundle resource - can be individual or business.

Possible values:
individualbusiness

AttributesobjectOptional

The set of parameters that are the attributes of the End User resource which are derived End User Types.

Create a new End-User

create-a-new-end-user-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_24
// Download the helper library from https://www.twilio.com/docs/node/install
_24
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_24
_24
// Find your Account SID and Auth Token at twilio.com/console
_24
// and set the environment variables. See http://twil.io/secure
_24
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_24
const authToken = process.env.TWILIO_AUTH_TOKEN;
_24
const client = twilio(accountSid, authToken);
_24
_24
async function createEndUser() {
_24
const endUser = await client.numbers.v2.regulatoryCompliance.endUsers.create({
_24
attributes: {
_24
business_name: "Twilio",
_24
vat: "2348132",
_24
business_description: "Communications Platform as a Service",
_24
},
_24
friendlyName: "Twilio, Inc.",
_24
type: "business",
_24
});
_24
_24
console.log(endUser.sid);
_24
}
_24
_24
createEndUser();

Output

_12
{
_12
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"friendly_name": "Twilio, Inc.",
_12
"type": "business",
_12
"attributes": {
_12
"email": "foobar@twilio.com"
_12
},
_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/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_12
}

Note: the EndUserType must be either individual or business.


Fetch an End-User Instance

fetch-an-end-user-instance page anchor
GET https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<IT>required

The unique string created by Twilio to identify the End User resource.

Pattern: ^IT[0-9a-fA-F]{32}$Min length: 34Max length: 34
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function fetchEndUser() {
_18
const endUser = await client.numbers.v2.regulatoryCompliance
_18
.endUsers("ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.fetch();
_18
_18
console.log(endUser.sid);
_18
}
_18
_18
fetchEndUser();

Output

_12
{
_12
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"friendly_name": "friendly_name",
_12
"type": "individual",
_12
"attributes": {
_12
"email": "foobar@twilio.com"
_12
},
_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/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_12
}


GET https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers

Property nameTypeRequiredPIIDescription
PageSizeintegerOptional

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

Minimum: 1Maximum: 1000

PageintegerOptional

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

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

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

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function listEndUser() {
_18
const endUsers = await client.numbers.v2.regulatoryCompliance.endUsers.list({
_18
limit: 20,
_18
});
_18
_18
endUsers.forEach((e) => console.log(e.sid));
_18
}
_18
_18
listEndUser();

Output

_12
{
_12
"results": [],
_12
"meta": {
_12
"page": 0,
_12
"page_size": 50,
_12
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers?PageSize=50&Page=0",
_12
"previous_page_url": null,
_12
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers?PageSize=50&Page=0",
_12
"next_page_url": null,
_12
"key": "results"
_12
}
_12
}


Update an End-User instance

update-an-end-user-instance page anchor
POST https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<IT>required

The unique string created by Twilio to identify the End User resource.

Pattern: ^IT[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
FriendlyNamestringOptional

The string that you assigned to describe the resource.


AttributesobjectOptional

The set of parameters that are the attributes of the End User resource which are derived End User Types.

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

_24
// Download the helper library from https://www.twilio.com/docs/node/install
_24
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_24
_24
// Find your Account SID and Auth Token at twilio.com/console
_24
// and set the environment variables. See http://twil.io/secure
_24
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_24
const authToken = process.env.TWILIO_AUTH_TOKEN;
_24
const client = twilio(accountSid, authToken);
_24
_24
async function updateEndUser() {
_24
const endUser = await client.numbers.v2.regulatoryCompliance
_24
.endUsers("ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_24
.update({
_24
attributes: {
_24
email: "foobar@twilio.com",
_24
first_name: "Jeff",
_24
},
_24
friendlyName: "Twilio",
_24
});
_24
_24
console.log(endUser.sid);
_24
}
_24
_24
updateEndUser();

Output

_12
{
_12
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"friendly_name": "Twilio",
_12
"type": "individual",
_12
"attributes": {
_12
"email": "foobar@twilio.com"
_12
},
_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/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_12
}


Delete an End-User instance

delete-an-end-user-instance page anchor
DELETE https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<IT>required

The unique string created by Twilio to identify the End User resource.

Pattern: ^IT[0-9a-fA-F]{32}$Min length: 34Max length: 34
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
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_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 = twilio(accountSid, authToken);
_16
_16
async function deleteEndUser() {
_16
await client.numbers.v2.regulatoryCompliance
_16
.endUsers("ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_16
.remove();
_16
}
_16
_16
deleteEndUser();


Rate this page: