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.

Resource properties
sidtype: SID<IT>Not PII

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


friendly_nametype: stringNot PII

The string that you assigned to describe the resource.


typetype: enum<STRING>Not PII

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

Possible values:
individualbusiness

attributestype: objectPII 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_createdtype: string<DATE TIME>Not PII

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


date_updatedtype: string<DATE TIME>Not PII

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


urltype: string<URI>Not PII

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.

Parameters

create-parameters page anchor
Request body parameters
FriendlyNametype: stringNot PII
Required

The string that you assigned to describe the resource.


Typetype: enum<STRING>Not PII
Required

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

Possible values:
individualbusiness

Attributestype: objectPII MTL: 30 days

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

_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
_15
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_15
const authToken = process.env.TWILIO_AUTH_TOKEN;
_15
const client = require('twilio')(accountSid, authToken);
_15
_15
client.numbers.v2.regulatoryCompliance
_15
.endUsers
_15
.create({attributes: {
_15
business_name: 'Twilio',
_15
vat: '2348132',
_15
business_description: 'Communications Platform as a Service'
_15
}, friendlyName: 'Twilio, Inc.', type: 'business'})
_15
.then(end_user => console.log(end_user.sid));

Output

_14
{
_14
"sid": "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"friendly_name": "Twilio, Inc.",
_14
"type": "business",
_14
"attributes": {
_14
"business_name": "Twilio",
_14
"vat": "2348132",
_14
"business_description": "Communications Platform as a Service"
_14
},
_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"
_14
}

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}

URI parameters
Sidtype: SID<IT>Not PII
Path Parameter

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

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

_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
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.numbers.v2.regulatoryCompliance
_11
.endUsers('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.fetch()
_11
.then(end_user => console.log(end_user.sid));

Output

_12
{
_12
"sid": "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_12
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_12
}


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

URI parameters
PageSizetype: integerNot PII
Query Parameter

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


Pagetype: integerNot PII
Query Parameter

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


PageTokentype: stringNot PII
Query Parameter

The page token. This is provided by the API.

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

_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
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.numbers.v2.regulatoryCompliance
_11
.endUsers
_11
.list({limit: 20})
_11
.then(endUsers => endUsers.forEach(e => console.log(e.sid)));

Output

_25
{
_25
"results": [
_25
{
_25
"sid": "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_25
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_25
"friendly_name": "friendly_name",
_25
"type": "individual",
_25
"attributes": {
_25
"email": "foobar@twilio.com"
_25
},
_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
}
_25
],
_25
"meta": {
_25
"page": 0,
_25
"page_size": 50,
_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",
_25
"key": "results"
_25
}
_25
}


Update an End-User instance

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

URI parameters
Sidtype: SID<IT>Not PII
Path Parameter

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


Request body parameters
FriendlyNametype: stringNot PII

The string that you assigned to describe the resource.


Attributestype: objectPII MTL: 30 days

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

_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
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.numbers.v2.regulatoryCompliance
_14
.endUsers('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_14
.update({attributes: {
_14
email: 'foobar@twilio.com',
_14
first_name: 'Jeff'
_14
}, friendlyName: 'Twilio'})
_14
.then(end_user => console.log(end_user.friendlyName));

Output

_13
{
_13
"sid": "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"friendly_name": "Twilio",
_13
"type": "individual",
_13
"attributes": {
_13
"email": "foobar@twilio.com",
_13
"first_name": "Jeff"
_13
},
_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"
_13
}


Delete an End-User instance

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

URI parameters
Sidtype: SID<IT>Not PII
Path Parameter

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

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

_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
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.numbers.v2.regulatoryCompliance.endUsers('').remove();


Rate this page: