Skip to contentSkip to navigationSkip to topbar
On this page

API: Create a Secondary Customer Profile



Prerequisites

prerequisites page anchor

For a successful evaluation of the secondary customer profile, please ensure that you've already created a Primary Customer Profile in the same account and it's in twilio-approved state.

if not, refer to Console: Create a Primary Customer Profile for a step-by-step walkthrough.


Secondary Customer Profiles Flow.

Steps to create a compliant Secondary Customer Profile

steps-to-create-a-compliant-secondary-customer-profile page anchor

Step 1

step-1 page anchor

Note: This step will fetch the regulation SID necessary to use for Secondary Profile creation.

Fetch Secondary Customer Profile PolicyLink to code sample: Fetch Secondary Customer Profile Policy
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 listPolicies() {
11
const policies = await client.trusthub.v1.policies.list({ limit: 20 });
12
13
policies.forEach((p) => console.log(p.sid));
14
}
15
16
listPolicies();

Output

1
{
2
"meta": {
3
"page": 0,
4
"page_size": 50,
5
"first_page_url": "https://trusthub.twilio.com/v1/Policies?PageSize=50&Page=0",
6
"previous_page_url": null,
7
"url": "https://trusthub.twilio.com/v1/Policies?PageSize=50&Page=0",
8
"next_page_url": null,
9
"key": "results"
10
},
11
"results": [
12
{
13
"url": "https://trusthub.twilio.com/v1/Policies/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
14
"requirements": {
15
"end_user": [
16
{
17
"url": "/EndUserTypes/customer_profile_business_information",
18
"fields": [
19
"business_type",
20
"business_registration_number",
21
"business_name",
22
"business_registration_identifier",
23
"business_identity",
24
"business_industry",
25
"website_url",
26
"business_regions_of_operation",
27
"social_media_profile_urls"
28
],
29
"type": "customer_profile_business_information",
30
"name": "Business Information",
31
"requirement_name": "customer_profile_business_information"
32
},
33
{
34
"url": "/EndUserTypes/authorized_representative_1",
35
"fields": [
36
"first_name",
37
"last_name",
38
"email",
39
"phone_number",
40
"business_title",
41
"job_position"
42
],
43
"type": "authorized_representative_1",
44
"name": "Authorized Representative 1",
45
"requirement_name": "authorized_representative_1"
46
},
47
{
48
"url": "/EndUserTypes/authorized_representative_2",
49
"fields": [
50
"first_name",
51
"last_name",
52
"email",
53
"phone_number",
54
"business_title",
55
"job_position"
56
],
57
"type": "authorized_representative_2",
58
"name": "Authorized Representative 2",
59
"requirement_name": "authorized_representative_2"
60
}
61
],
62
"supporting_trust_products": [],
63
"supporting_document": [
64
[
65
{
66
"description": "Customer Profile HQ Physical Address",
67
"type": "document",
68
"name": "Physical Business Address",
69
"accepted_documents": [
70
{
71
"url": "/SupportingDocumentTypes/customer_profile_address",
72
"fields": [
73
"address_sids"
74
],
75
"type": "customer_profile_address",
76
"name": "Physical Business Address"
77
}
78
],
79
"requirement_name": "customer_profile_address"
80
}
81
]
82
],
83
"supporting_customer_profiles": []
84
},
85
"friendly_name": "Primary Customer Profile of type Business",
86
"sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
87
}
88
]
89
}
Property nameTypeRequiredPIIDescription
PageSizeintegerOptional
Not PII

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.

Note: This step creates an empty bundle that will then be filled with the information submitted in the subsequent steps.

Create an empty Secondary Customer Profile BundleLink to code sample: Create an empty Secondary Customer Profile Bundle
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 createCustomerProfile() {
11
const customerProfile = await client.trusthub.v1.customerProfiles.create({
12
email: "email",
13
friendlyName: "friendly_name",
14
policySid: "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
statusCallback: "http://www.example.com",
16
});
17
18
console.log(customerProfile.accountSid);
19
}
20
21
createCustomerProfile();

Output

1
{
2
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "friendly_name",
6
"status": "draft",
7
"email": "email",
8
"status_callback": "http://www.example.com",
9
"valid_until": null,
10
"date_created": "2019-07-30T22:29:24Z",
11
"date_updated": "2019-07-31T01:09:00Z",
12
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"links": {
14
"customer_profiles_entity_assignments": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
15
"customer_profiles_evaluations": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
16
"customer_profiles_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
17
},
18
"errors": null
19
}
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
FriendlyNamestringrequired

The string that you assigned to describe the resource.


Emailstringrequired

The email address that will receive updates when the Customer-Profile resource changes status.


PolicySidSID<RN>required

The unique string of a policy that is associated to the Customer-Profile resource.

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

StatusCallbackstring<uri>Optional

The URL we call to inform your application of status changes.

(error)

Danger

If you have a US entity or an International Tax ID, use EIN to register your business profile and to avoid brand registration failures. Do not use a DUNS number.

(error)

Danger

Updates are coming to Twilio's Starter Brand registration based on changes from The Campaign Registry (TCR)(link takes you to an external page) and mobile carriers. We will provide updates on how this change may impact US A2P 10DLC registration as soon as they are available. Brands with EINs will no longer be able to use Twilio's Starter Brand registration going forward.

In the meantime, if you are registering on behalf of an organization with an EIN/Tax ID, please complete a Standard registration.

Note: This step is used to gather the following business information that will then be added to the bundle in step 8:

Attribute (* = Required):: Business Identity (*)

Accepted Values:

'direct_customer', 'isv_reseller_or_partner', 'unknown'

Attribute (* = Required):: Business Type (*)

Accepted Values:

'Sole Proprietorship', 'Partnership', 'Limited Liability Corporation', 'Co-operative', 'Non-profit Corporation', 'Corporation'

Attribute (* = Required):: Business Industry (*)

Accepted Values:

'AUTOMOTIVE', 'AGRICULTURE', 'BANKING', 'CONSUMER', 'EDUCATION', 'ENGINEERING', 'ENERGY', 'OIL_AND_GAS', 'FAST_MOVING_CONSUMER_GOODS', 'FINANCIAL', 'FINTECH', 'FOOD_AND_BEVERAGE', 'GOVERNMENT', 'HEALTHCARE', 'HOSPITALITY', 'INSURANCE', 'LEGAL', 'MANUFACTURING', 'MEDIA', 'ONLINE', 'RAW_MATERIALS', 'REAL_ESTATE', 'RELIGION', 'RETAIL', 'JEWELRY', 'TECHNOLOGY', 'TELECOMMUNICATIONS', 'TRANSPORTATION', 'TRAVEL', 'ELECTRONICS', 'NOT_FOR_PROFIT'

Attribute (* = Required):: Business Registration ID Type (*)

Accepted Values:

  • EIN US: Employer Identification Number (EIN)

  • DUNS US: DUNS Number (Dun & Bradstreet)

  • CCN Canada: Canadian Corporation Number

    • NOTE: to register for A2P 10DLC, you must select CBN because CCN is no longer accepted.
  • CBN Canada: Canadian Business Number

  • CN Great Britain: Company Number

  • ACN Australia: Company Number from ASIC (ACN)

  • CIN India: Corporate Identity Number

  • VAT Estonia: VAT Number

  • VATRN Romania: VAT Registration Number

  • RN Israel: Registration Number

  • Other Other

Attribute (* = Required):: Name of Other Registration Type ( only applicable if 'Other' is used for Business Registration ID Type) (*)

Accepted Values:

Freeform string

Attribute (* = Required):: Business Registration Number (*)

Accepted Values:

Attribute (* = Required):: Business Regions of Operations (*)

Accepted Values:

'AFRICA', 'ASIA', 'EUROPE', 'LATIN_AMERICA', 'USA_AND_CANADA', 'AUSTRALIA'

Attribute (* = Required):: Website Url (*)

Accepted Values:

URL

Attribute (* = Required):: Social Media Profile URL

Accepted Values:

URL

Create EndUser of type: customer_profile_business_informationLink to code sample: Create EndUser of type: customer_profile_business_information
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
attributes: {
13
business_name: "acme business",
14
social_media_profile_urls: "",
15
website_url: "test.com",
16
business_regions_of_operation: "USA_AND_CANADA",
17
business_type: "Partnership",
18
business_registration_identifier: "DUNS",
19
business_identity: "direct_customer",
20
business_industry: "EDUCATION",
21
business_registration_number: "123456789",
22
},
23
friendlyName: "friendly name",
24
type: "customer_profile_business_information",
25
});
26
27
console.log(endUser.sid);
28
}
29
30
createEndUser();

Output

1
{
2
"date_updated": "2021-02-16T20:40:57Z",
3
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "friendly name",
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": "customer_profile_business_information"
17
}
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.


AttributesobjectOptional
PII MTL: 30 days

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

Note: This step is used to gather the following authorized representative information to be associated with the bundle in step 8.

Attribute (* = Required):Accepted Values
Last NameEx: 'Smith'
First NameEx: 'John'
EmailEx: 'johnsmith@example.com'
Business TitleEx: 'Head of Product Management'
Job Position'Director', 'GM', 'VP', 'CEO', 'CFO', 'General Counsel', 'Other'
Phone NumberEx: '123-456-7890'
Country CodeEx: '+1' (US Country Code)
Create EndUser of type: authorized_representative_1Link to code sample: Create EndUser of type: authorized_representative_1
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
attributes: {
13
job_position: "CEO",
14
last_name: "acme",
15
phone_number: "+11234567890",
16
first_name: "rep1",
17
email: "rep1@acme.com",
18
business_title: "ceo",
19
},
20
friendlyName: "auth_rep_1",
21
type: "authorized_representative_1",
22
});
23
24
console.log(endUser.sid);
25
}
26
27
createEndUser();

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
}
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.


AttributesobjectOptional

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

Create EndUser of type: authorized_representative_2Link to code sample: Create EndUser of type: authorized_representative_2
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
attributes: {
13
job_position: "CFO",
14
last_name: "acme",
15
phone_number: "+14345678900",
16
first_name: "rep2",
17
email: "rep2@acme.com",
18
business_title: "cfo",
19
},
20
friendlyName: "auth_rep_2",
21
type: "authorized_representative_2",
22
});
23
24
console.log(endUser.sid);
25
}
26
27
createEndUser();

Output

1
{
2
"date_updated": "2021-02-16T20:40:57Z",
3
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "auth_rep_2",
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_2"
17
}
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.


AttributesobjectOptional

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

(warning)

Warning

PO Boxes not accepted for address submission

Note: This step will gather the address info to be associated with the bundle in Step 8.

Skip this step if you already have an address sid.

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 createAddress() {
11
const address = await client.addresses.create({
12
city: "Any City",
13
customerName: "name",
14
isoCountry: "US",
15
postalCode: "12345",
16
region: "Any Region",
17
street: "555 AnyStreet",
18
streetSecondary: "Apt B",
19
});
20
21
console.log(address.sid);
22
}
23
24
createAddress();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"city": "Any City",
4
"customer_name": "name",
5
"date_created": "Tue, 18 Aug 2015 17:07:30 +0000",
6
"date_updated": "Tue, 18 Aug 2015 17:07:30 +0000",
7
"emergency_enabled": false,
8
"friendly_name": null,
9
"iso_country": "US",
10
"postal_code": "12345",
11
"region": "Any Region",
12
"sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"street": "555 AnyStreet",
14
"street_secondary": "Apt B",
15
"validated": false,
16
"verified": false,
17
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
18
}
Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that will be responsible for the new Address resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
CustomerNamestringrequired

The name to associate with the new address.


Streetstringrequired

The number and street address of the new address.


Citystringrequired

The city of the new address.


Regionstringrequired

The state or region of the new address.


PostalCodestringrequired

The postal code of the new address.


IsoCountrystring<iso-country-code>required

The ISO country code of the new address.


FriendlyNamestringOptional

A descriptive string that you create to describe the new address. It can be up to 64 characters long.


EmergencyEnabledbooleanOptional

Whether to enable emergency calling on the new address. Can be: true or false.


AutoCorrectAddressbooleanOptional

Whether we should automatically correct the address. Can be: true or false and the default is true. If empty or true, we will correct the address you provide if necessary. If false, we won't alter the address you provide.


StreetSecondarystringOptional

The additional number and street address of the address.

Note: This step creates the supporting doc that houses the address information which will then be associated with the bundle in Step 8.

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 createSupportingDocument() {
11
const supportingDocument =
12
await client.trusthub.v1.supportingDocuments.create({
13
attributes: {
14
address_sids: "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
},
16
friendlyName: "address",
17
type: "customer_profile_address",
18
});
19
20
console.log(supportingDocument.sid);
21
}
22
23
createSupportingDocument();

Output

1
{
2
"status": "draft",
3
"date_updated": "2021-02-11T17:23:00Z",
4
"friendly_name": "address",
5
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"url": "https://trusthub.twilio.com/v1/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"date_created": "2021-02-11T17:23:00Z",
8
"sid": "RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
9
"attributes": {
10
"address_sids": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
11
},
12
"type": "customer_profile_address",
13
"mime_type": null
14
}
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 the Supporting Document.


AttributesobjectOptional

The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types.

Note: This step gathers up the previously entered information and associates it with the empty bundle. Each component (supporting document/address, customer profile information, authorized representative 1, authorized representative 2) will have its own object_sid to be assigned to the bundle.

Assign Customer Profile Business InformationLink to code sample: Assign Customer Profile Business Information
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 createCustomerProfileEntityAssignment() {
11
const customerProfilesEntityAssignment = await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.customerProfilesEntityAssignments.create({
14
objectSid: "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
});
16
17
console.log(customerProfilesEntityAssignment.sid);
18
}
19
20
createCustomerProfileEntityAssignment();

Output

1
{
2
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"object_sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"date_created": "2019-07-31T02:34:41Z",
7
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
8
}
Property nameTypeRequiredPIIDescription
CustomerProfileSidSID<BU>required

The unique string that we created to identify the CustomerProfile resource.

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
ObjectSidSIDrequired

The SID of an object bag that holds information of the different items.

Pattern: ^[a-zA-Z]{2}[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 createCustomerProfileEntityAssignment() {
11
const customerProfilesEntityAssignment = await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.customerProfilesEntityAssignments.create({
14
objectSid: "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
});
16
17
console.log(customerProfilesEntityAssignment.sid);
18
}
19
20
createCustomerProfileEntityAssignment();

Output

1
{
2
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"object_sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"date_created": "2019-07-31T02:34:41Z",
7
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
8
}
Property nameTypeRequiredPIIDescription
CustomerProfileSidSID<BU>required

The unique string that we created to identify the CustomerProfile resource.

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
ObjectSidSIDrequired

The SID of an object bag that holds information of the different items.

Pattern: ^[a-zA-Z]{2}[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 createCustomerProfileEntityAssignment() {
11
const customerProfilesEntityAssignment = await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.customerProfilesEntityAssignments.create({
14
objectSid: "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
});
16
17
console.log(customerProfilesEntityAssignment.sid);
18
}
19
20
createCustomerProfileEntityAssignment();

Output

1
{
2
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"object_sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"date_created": "2019-07-31T02:34:41Z",
7
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
8
}
Property nameTypeRequiredPIIDescription
CustomerProfileSidSID<BU>required

The unique string that we created to identify the CustomerProfile resource.

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
ObjectSidSIDrequired

The SID of an object bag that holds information of the different items.

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

You can assign a Customer Profile as an entity to another Customer Profile. For the current use-case, you can do so by fetching the Primary Customer Profile Sid from the primary account.

Use it as the ObjectSid=primary-customer-profile-sid

Note: Currently ObjectSid accepts a Customer Profile Sid from the same account or from the primary account.

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 createCustomerProfileEntityAssignment() {
11
const customerProfilesEntityAssignment = await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.customerProfilesEntityAssignments.create({
14
objectSid: "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
});
16
17
console.log(customerProfilesEntityAssignment.sid);
18
}
19
20
createCustomerProfileEntityAssignment();

Output

1
{
2
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"object_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"date_created": "2019-07-31T02:34:41Z",
7
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
8
}
Property nameTypeRequiredPIIDescription
CustomerProfileSidSID<BU>required

The unique string that we created to identify the CustomerProfile resource.

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
ObjectSidSIDrequired

The SID of an object bag that holds information of the different items.

Pattern: ^[a-zA-Z]{2}[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 createCustomerProfileEntityAssignment() {
11
const customerProfilesEntityAssignment = await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.customerProfilesEntityAssignments.create({
14
objectSid: "RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
15
});
16
17
console.log(customerProfilesEntityAssignment.sid);
18
}
19
20
createCustomerProfileEntityAssignment();

Output

1
{
2
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"object_sid": "RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
6
"date_created": "2019-07-31T02:34:41Z",
7
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
8
}
Property nameTypeRequiredPIIDescription
CustomerProfileSidSID<BU>required

The unique string that we created to identify the CustomerProfile resource.

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
ObjectSidSIDrequired

The SID of an object bag that holds information of the different items.

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

If you want to assign phone numbers to your Secondary Customer Profile, find your phone number SID from the Phone Numbers page in the Console(link takes you to an external page).

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 createCustomerProfileChannelEndpointAssignment() {
11
const customerProfilesChannelEndpointAssignment = await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.customerProfilesChannelEndpointAssignment.create({
14
channelEndpointSid: "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
channelEndpointType: "phone-number",
16
});
17
18
console.log(customerProfilesChannelEndpointAssignment.sid);
19
}
20
21
createCustomerProfileChannelEndpointAssignment();

Output

1
{
2
"sid": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"channel_endpoint_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"channel_endpoint_type": "phone-number",
7
"date_created": "2019-07-31T02:34:41Z",
8
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
9
}
Property nameTypeRequiredPIIDescription
CustomerProfileSidSID<BU>required

The unique string that we created to identify the CustomerProfile resource.

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
ChannelEndpointTypestringrequired

The type of channel endpoint. eg: phone-number


ChannelEndpointSidSIDrequired

The SID of an channel endpoint

Pattern: ^[a-zA-Z]{2}[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 createCustomerProfileEvaluation() {
11
const customerProfilesEvaluation = await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.customerProfilesEvaluations.create({
14
policySid: "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
15
});
16
17
console.log(customerProfilesEvaluation.sid);
18
}
19
20
createCustomerProfileEvaluation();

Output

1
{
2
"sid": "ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"status": "noncompliant",
7
"date_created": "2020-04-28T18:14:01Z",
8
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations/ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
9
"results": [
10
{
11
"friendly_name": "Business",
12
"object_type": "business",
13
"passed": false,
14
"failure_reason": "A Business End-User is missing. Please add one to the regulatory bundle.",
15
"error_code": 22214,
16
"valid": [],
17
"invalid": [
18
{
19
"friendly_name": "Business Name",
20
"object_field": "business_name",
21
"failure_reason": "The Business Name is missing. Please enter in a Business Name on the Business information.",
22
"error_code": 22215
23
},
24
{
25
"friendly_name": "Business Registration Number",
26
"object_field": "business_registration_number",
27
"failure_reason": "The Business Registration Number is missing. Please enter in a Business Registration Number on the Business information.",
28
"error_code": 22215
29
},
30
{
31
"friendly_name": "First Name",
32
"object_field": "first_name",
33
"failure_reason": "The First Name is missing. Please enter in a First Name on the Business information.",
34
"error_code": 22215
35
},
36
{
37
"friendly_name": "Last Name",
38
"object_field": "last_name",
39
"failure_reason": "The Last Name is missing. Please enter in a Last Name on the Business information.",
40
"error_code": 22215
41
}
42
],
43
"requirement_friendly_name": "Business",
44
"requirement_name": "business_info"
45
},
46
{
47
"friendly_name": "Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative",
48
"object_type": "commercial_registrar_excerpt",
49
"passed": false,
50
"failure_reason": "An Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative is missing. Please add one to the regulatory bundle.",
51
"error_code": 22216,
52
"valid": [],
53
"invalid": [
54
{
55
"friendly_name": "Business Name",
56
"object_field": "business_name",
57
"failure_reason": "The Business Name is missing. Or, it does not match the Business Name you entered within Business information. Please enter in the Business Name shown on the Excerpt from the commercial register (Extrait K-bis) showing name of Authorized Representative or make sure both Business Name fields use the same exact inputs.",
58
"error_code": 22217
59
}
60
],
61
"requirement_friendly_name": "Business Name",
62
"requirement_name": "business_name_info"
63
},
64
{
65
"friendly_name": "Excerpt from the commercial register showing French address",
66
"object_type": "commercial_registrar_excerpt",
67
"passed": false,
68
"failure_reason": "An Excerpt from the commercial register showing French address is missing. Please add one to the regulatory bundle.",
69
"error_code": 22216,
70
"valid": [],
71
"invalid": [
72
{
73
"friendly_name": "Address sid(s)",
74
"object_field": "address_sids",
75
"failure_reason": "The Address is missing. Please enter in the address shown on the Excerpt from the commercial register showing French address.",
76
"error_code": 22219
77
}
78
],
79
"requirement_friendly_name": "Business Address (Proof of Address)",
80
"requirement_name": "business_address_proof_info"
81
},
82
{
83
"friendly_name": "Excerpt from the commercial register (Extrait K-bis)",
84
"object_type": "commercial_registrar_excerpt",
85
"passed": false,
86
"failure_reason": "An Excerpt from the commercial register (Extrait K-bis) is missing. Please add one to the regulatory bundle.",
87
"error_code": 22216,
88
"valid": [],
89
"invalid": [
90
{
91
"friendly_name": "Document Number",
92
"object_field": "document_number",
93
"failure_reason": "The Document Number is missing. Please enter in the Document Number shown on the Excerpt from the commercial register (Extrait K-bis).",
94
"error_code": 22217
95
}
96
],
97
"requirement_friendly_name": "Business Registration Number",
98
"requirement_name": "business_reg_no_info"
99
},
100
{
101
"friendly_name": "Government-issued ID",
102
"object_type": "government_issued_document",
103
"passed": false,
104
"failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
105
"error_code": 22216,
106
"valid": [],
107
"invalid": [
108
{
109
"friendly_name": "First Name",
110
"object_field": "first_name",
111
"failure_reason": "The First Name is missing. Or, it does not match the First Name you entered within Business information. Please enter in the First Name shown on the Government-issued ID or make sure both First Name fields use the same exact inputs.",
112
"error_code": 22217
113
},
114
{
115
"friendly_name": "Last Name",
116
"object_field": "last_name",
117
"failure_reason": "The Last Name is missing. Or, it does not match the Last Name you entered within Business information. Please enter in the Last Name shown on the Government-issued ID or make sure both Last Name fields use the same exact inputs.",
118
"error_code": 22217
119
}
120
],
121
"requirement_friendly_name": "Name of Authorized Representative",
122
"requirement_name": "name_of_auth_rep_info"
123
},
124
{
125
"friendly_name": "Executed Copy of Power of Attorney",
126
"object_type": "power_of_attorney",
127
"passed": false,
128
"failure_reason": "An Executed Copy of Power of Attorney is missing. Please add one to the regulatory bundle.",
129
"error_code": 22216,
130
"valid": [],
131
"invalid": [],
132
"requirement_friendly_name": "Power of Attorney",
133
"requirement_name": "power_of_attorney_info"
134
},
135
{
136
"friendly_name": "Government-issued ID",
137
"object_type": "government_issued_document",
138
"passed": false,
139
"failure_reason": "A Government-issued ID is missing. Please add one to the regulatory bundle.",
140
"error_code": 22216,
141
"valid": [],
142
"invalid": [
143
{
144
"friendly_name": "First Name",
145
"object_field": "first_name",
146
"failure_reason": "The First Name is missing on the Governnment-Issued ID.",
147
"error_code": 22217
148
},
149
{
150
"friendly_name": "Last Name",
151
"object_field": "last_name",
152
"failure_reason": "The Last Name is missing on the Government-issued ID",
153
"error_code": 22217
154
}
155
],
156
"requirement_friendly_name": "Name of Person granted the Power of Attorney",
157
"requirement_name": "name_in_power_of_attorney_info"
158
}
159
]
160
}
Property nameTypeRequiredPIIDescription
CustomerProfileSidSID<BU>required

The unique string that we created to identify the CustomerProfile resource.

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
PolicySidSID<RN>required

The unique string of a policy that is associated to the customer_profile resource.

Pattern: ^RN[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 updateCustomerProfile() {
11
const customerProfile = await client.trusthub.v1
12
.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.update({ status: "pending-review" });
14
15
console.log(customerProfile.sid);
16
}
17
18
updateCustomerProfile();

Output

1
{
2
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"friendly_name": "friendly_name",
6
"status": "pending-review",
7
"email": "email",
8
"status_callback": "http://www.example.com",
9
"valid_until": null,
10
"date_created": "2019-07-30T22:29:24Z",
11
"date_updated": "2019-07-31T01:09:00Z",
12
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
13
"links": {
14
"customer_profiles_entity_assignments": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
15
"customer_profiles_evaluations": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
16
"customer_profiles_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
17
},
18
"errors": null
19
}
Property nameTypeRequiredPIIDescription
SidSID<BU>required

The unique string that we created to identify the Customer-Profile resource.

Pattern: ^BU[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
Statusenum<string>Optional

The verification status of the Customer-Profile resource. If the current verification status of the Customer-Profile is draft, you may set the verification status to pending-review to submit the Customer-Profile for Twilio review. No other values for status are permissible when updating a resource via this API endpoint as the other states are maintained by Twilio.

Possible values:
draftpending-reviewin-reviewtwilio-rejectedtwilio-approved

StatusCallbackstring<uri>Optional

The URL we call to inform your application of status changes.


FriendlyNamestringOptional

The string that you assigned to describe the resource.


EmailstringOptional

The email address that will receive updates when the Customer-Profile resource changes status.

Once you submit a compliant Secondary Customer Profile for review, your profile will be under in-review status. If it's non-compliant, it will automatically be rejected with a twilio-rejected status.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.