Skip to contentSkip to navigationSkip to topbar
On this page

EndUser Resource



EndUser Properties

enduser-properties page anchor
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

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

friendly_namestring

Optional

The string that you assigned to describe the resource.


typestring

Optional

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


attributesobject

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.


date_updatedstring<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 an EndUser resource

create-an-enduser-resource page anchor
POST https://trusthub.twilio.com/v1/EndUsers

Request body parameters

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

The string that you assigned to describe the resource.


Typestringrequired

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


Attributesobject

Optional

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

Create an EndUserLink to code sample: Create an EndUser
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.trusthub.v1.endUsers.create({
12
friendlyName: "FriendlyName",
13
type: "Type",
14
});
15
16
console.log(endUser.sid);
17
}
18
19
createEndUser();

Output

1
{
2
"date_updated": "2021-02-16T20:40:57Z",
3
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "FriendlyName",
5
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"url": "https://trusthub.twilio.com/v1/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"date_created": "2021-02-16T20:40:57Z",
8
"attributes": {
9
"phone_number": "+11234567890",
10
"job_position": "CEO",
11
"first_name": "rep1",
12
"last_name": "test",
13
"business_title": "ceo",
14
"email": "foobar@test.com"
15
},
16
"type": "Type"
17
}

Fetch an EndUser resource

fetch-an-enduser-resource page anchor
GET https://trusthub.twilio.com/v1/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.trusthub.v1
12
.endUsers("ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.fetch();
14
15
console.log(endUser.sid);
16
}
17
18
fetchEndUser();

Output

1
{
2
"date_updated": "2021-02-16T20:40:57Z",
3
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "auth_rep_1",
5
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"url": "https://trusthub.twilio.com/v1/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"date_created": "2021-02-16T20:40:57Z",
8
"attributes": {
9
"phone_number": "+11234567890",
10
"job_position": "CEO",
11
"first_name": "rep1",
12
"last_name": "test",
13
"business_title": "ceo",
14
"email": "foobar@test.com"
15
},
16
"type": "authorized_representative_1"
17
}

Read multiple EndUser resources

read-multiple-enduser-resources page anchor
GET https://trusthub.twilio.com/v1/EndUsers

Property nameTypeRequiredPIIDescription
PageSizeinteger

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.trusthub.v1.endUsers.list({ limit: 20 });
12
13
endUsers.forEach((e) => console.log(e.sid));
14
}
15
16
listEndUser();

Output

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

Update an EndUser resource

update-an-enduser-resource page anchor
POST https://trusthub.twilio.com/v1/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.


Attributesobject

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.trusthub.v1
12
.endUsers("ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.update({ friendlyName: "FriendlyName" });
14
15
console.log(endUser.sid);
16
}
17
18
updateEndUser();

Output

1
{
2
"date_updated": "2021-02-16T20:40:57Z",
3
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "FriendlyName",
5
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"url": "https://trusthub.twilio.com/v1/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"date_created": "2021-02-16T20:40:57Z",
8
"attributes": {
9
"phone_number": "+11234567890",
10
"job_position": "CEO",
11
"first_name": "rep1",
12
"last_name": "test",
13
"business_title": "ceo",
14
"email": "foobar@test.com"
15
},
16
"type": "authorized_representative_1"
17
}

Delete an EndUser resource

delete-an-enduser-resource page anchor
DELETE https://trusthub.twilio.com/v1/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.trusthub.v1
12
.endUsers("ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.remove();
14
}
15
16
deleteEndUser();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.