Skip to contentSkip to navigationSkip to topbar
On this page

End-User Types 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 Type resource of Twilio's Regulatory Compliance API informs you which type of end-user you can create and what the values are. Once you know which end-user type you want to create and the required values, you will create using the End-User resource. Each End-User Type has a different set of values required to be compliant.

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 Types Response Properties

end-user-types-response-properties page anchor

The output JSON response details the types and values of the End-User Type resource. The type SID<OY> is a unique ID starting with letters OY. For more information about Twilio SIDs, please refer to Twilio's glossary on SIDs.

The field of the End-User Types resource response is in JSON. The type SID<OY> is a unique ID starting with letters OY. For more information about Twilio SIDs, please refer to Twilio's glossary on SIDs.

Property nameTypeRequiredDescriptionChild properties
sidSID<OY>Optional
Not PII

The unique string that identifies the End-User Type resource.

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

friendly_namestringOptional

A human-readable description that is assigned to describe the End-User Type resource. Examples can include first name, last name, email, business name, etc


machine_namestringOptional

A machine-readable description of the End-User Type resource. Examples can include first_name, last_name, email, business_name, etc.


fieldsarrayOptional

The required information for creating an End-User. The required fields will change as regulatory needs change and will differ for businesses and individuals.


urlstring<uri>Optional

The absolute URL of the End-User Type resource.


Fetch an End-User Type Instance

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

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
Sidstringrequired

The unique string that identifies the End-User Type resource.

Fetch an End-User Type InstanceLink to code sample: Fetch an End-User Type 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 fetchEndUserType() {
11
const endUserType = await client.numbers.v2.regulatoryCompliance
12
.endUserTypes("Sid")
13
.fetch();
14
15
console.log(endUserType.sid);
16
}
17
18
fetchEndUserType();

Output

1
{
2
"sid": "Sid",
3
"friendly_name": "friendly_name",
4
"machine_name": "machine_name",
5
"fields": [
6
{
7
"friendly_name": "Business Purpose",
8
"machine_name": "business_purpose",
9
"constraint": "String"
10
},
11
{
12
"friendly_name": "Last Name",
13
"machine_name": "last_name",
14
"constraint": "String"
15
}
16
],
17
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes/OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
18
}

Retrieve a list of End-User Types

retrieve-a-list-of-end-user-types page anchor
GET https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes

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.

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 listEndUserType() {
11
const endUserTypes =
12
await client.numbers.v2.regulatoryCompliance.endUserTypes.list({
13
limit: 20,
14
});
15
16
endUserTypes.forEach((e) => console.log(e.sid));
17
}
18
19
listEndUserType();

Output

1
{
2
"end_user_types": [],
3
"meta": {
4
"page": 0,
5
"page_size": 50,
6
"first_page_url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes?PageSize=50&Page=0",
7
"previous_page_url": null,
8
"url": "https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes?PageSize=50&Page=0",
9
"next_page_url": null,
10
"key": "end_user_types"
11
}
12
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.