Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page

EndUsers resource


(warning)

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.


EndUsers response properties

endusers-response-properties page anchor

The EndUsers resource returns a response in JSON format. To learn more about Twilio SIDs, see the glossary entry on SIDs.

Property nameTypeRequiredDescriptionChild properties
sidSID<IT>

Optional

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

accountSidSID<AC>

Optional

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

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

friendlyNamestring

Optional

The string that you assigned to describe the resource.


typeenum<string>

Optional

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

Possible values:
individualbusiness

attributes

Optional

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.


dateUpdatedstring<date-time>

Optional

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>

Optional

The absolute URL of the End User resource.


Create one end user instance

create-one-end-user-instance page anchor

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.

Request body parameters

request-body-parameters page anchor
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
friendlyNamestring
required

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

attributes

Optional

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

Create one end user instanceLink to code sample: Create one end user instance
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createEndUser() {
11
const endUser = await client.numbers.v2.regulatoryCompliance.endUsers.create({
12
attributes: {
13
business_name: "Twilio",
14
vat: "2348132",
15
business_description: "Communications Platform as a Service",
16
},
17
friendlyName: "Twilio, Inc.",
18
type: "business",
19
});
20
21
console.log(endUser.sid);
22
}
23
24
createEndUser();

Response

Note about this 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
}

Fetch one end user instance

fetch-one-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
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchEndUser() {
11
const endUser = await client.numbers.v2.regulatoryCompliance
12
.endUsers("ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.fetch();
14
15
console.log(endUser.sid);
16
}
17
18
fetchEndUser();

Response

Note about this 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
}

List all end users for one SID

list-all-end-users-for-one-sid page anchor

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

Property nameTypeRequiredPIIDescription
pageSizeinteger<int64>

Optional

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

Minimum: 1Maximum: 1000

pageinteger

Optional

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

Minimum: 0

pageTokenstring

Optional

The page token. This is provided by the API.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listEndUser() {
11
const endUsers = await client.numbers.v2.regulatoryCompliance.endUsers.list({
12
limit: 20,
13
});
14
15
endUsers.forEach((e) => console.log(e.sid));
16
}
17
18
listEndUser();

Response

Note about this 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
}

Update one end user instance

update-one-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
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
friendlyNamestring

Optional

The string that you assigned to describe the resource.


attributes

Optional

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/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateEndUser() {
11
const endUser = await client.numbers.v2.regulatoryCompliance
12
.endUsers("ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.update({
14
attributes: {
15
email: "foobar@twilio.com",
16
first_name: "Jeff",
17
},
18
friendlyName: "Twilio",
19
});
20
21
console.log(endUser.sid);
22
}
23
24
updateEndUser();

Response

Note about this 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 one end user instance

delete-one-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
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function deleteEndUser() {
11
await client.numbers.v2.regulatoryCompliance
12
.endUsers("ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.remove();
14
}
15
16
deleteEndUser();