Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page

API: Create a Secondary Customer Profile


To create a secondary customer profile using the API, gather details about that business, create the regulatory bundle components, and assign them to an empty regulatory bundle.


Prerequisites

prerequisites page anchor

Twilio Primary Customer Profile

twilio-primary-customer-profile page anchor

A Primary Customer Profile in the twilio-approved state created in the same account.

Business registration data

business-registration-data page anchor

Gather the following data for your business.

PropertyNecessityAccepted values
Business IdentityRequireddirect_customer, isv_reseller_or_partner, unknown
Business TypeRequiredSole Proprietorship, Partnership, Limited Liability Corporation,
Co-operative, Non-profit Corporation, Corporation
Business IndustryRequiredAGRICULTURE, AUTOMOTIVE, BANKING, CONSUMER,
EDUCATION, ELECTRONICS, ENERGY, ENGINEERING,
FAST_MOVING_CONSUMER_GOODS, FINANCIAL, FINTECH,
FOOD_AND_BEVERAGE, GOVERNMENT, HEALTHCARE,
HOSPITALITY, INSURANCE, JEWELRY, LEGAL,
MANUFACTURING, MEDIA, NOT_FOR_PROFIT,
OIL_AND_GAS, ONLINE, RAW_MATERIALS, REAL_ESTATE,
RELIGION, RETAIL, TECHNOLOGY, TELECOMMUNICATIONS,
TRANSPORTATION, TRAVEL
Business Registration ID TypeRequiredEIN (US), CBN (CA), CN (UK), ACN (AU), CIN (IN), VAT (EU),
VATRN (RO), RN (IS), Other
Name of Other Registration TypeIf Other
Business Registration NumberRequiredVaries by country
Business Regions of OperationsRequiredAFRICA, ASIA, EUROPE, LATIN_AMERICA, USA_AND_CANADA, AUSTRALIA
Website URLRequiredHTTP URL as set in RFC 1738 3.3(link takes you to an external page)
Social Media Profile URLOptionalHTTP URL as set in RFC 1738 3.3(link takes you to an external page)

For each representative of the entity set in the CustomerProfile, collect the following data.

AttributeAccepted valuesExample
Last NameAny stringSmith
First NameAny stringAlex
EmailEmail address(link takes you to an external page)alex.smith@example.com
Business TitleAny stringHead of Product Management
Job PositionDirector, GM, VP, CEO,
CFO, General Counsel, Other
VP
Phone NumberSequence of integers8005550100
Country CodeTelephone country code+1

Create a compliant Secondary Customer Profile

create-a-compliant-secondary-customer-profile page anchor
  1. Fetch the Policy SID for your Primary Customer Profile.
    Fetch one CustomerProfile resourceLink to code sample: Fetch one CustomerProfile resource
    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 fetchCustomerProfile() {
    11
    const customerProfile = await client.trusthub.v1
    12
    .customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    13
    .fetch();
    14
    15
    console.log(customerProfile.sid);
    16
    }
    17
    18
    fetchCustomerProfile();
    1
    {
    2
    "sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    3
    "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    4
    "policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    5
    "friendly_name": "friendly_name",
    6
    "status": "draft",
    7
    ...
    8
    }
  2. Copy the policy_sid from the response. To create a regulatory bundle, you need this Policy SID.

Create an empty regulatory bundle

create-an-empty-regulatory-bundle page anchor

A regulatory bundle needs data about the company or individual requesting regulatory approval for a specific phone number.

Create an empty regulatory bundle. To create this bundle, provide the following parameters:

  • Email
  • FriendlyName
  • PolicySid
  • StatusCallback

To find acceptable values for these parameters, see Request body parameters for the Profiles resource.

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();

Response

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

Create components for regulatory bundle

create-components-for-regulatory-bundle page anchor

Each regulatory bundle needs four components:

  1. Identity of the business
  2. Identity of representatives of the business
  3. Physical location of the business
  4. Documentation that verifies the business identity and address

To add these components into Trust Hub, call three API resources: EndUser three times, Accounts, and SupportingDocuments.

  1. Provide your business identity data.

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

    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: "example.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();

    Response

    Note about this response
    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
    }
  2. Provide data about your first authorized representative.

    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();

    Response

    Note about this response
    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
    }
  3. Provide data about your second authorized representative.

    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();

    Response

    Note about this response
    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
    }
  4. Provide the physical location for your business.

    If you already have an address SID, skip this step.

    (warning)

    Warning

    Twilio can't accept PO Boxes as your address.

    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();

    Response

    Note about this response
    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": "Main Office",
    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
    }
  5. Provide the supporting documentation about your business.

    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();

    Response

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

Assign components to your regulatory bundle

assign-components-to-your-regulatory-bundle page anchor
  1. Associate data with the empty bundle. Each component (supporting document/address, customer profile information, authorized representative 1, authorized representative 2) has its own object_sid to assign 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();

    Response

    Note about this response
    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
    }
    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();

    Response

    Note about this response
    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
    }
    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();

    Response

    Note about this response
    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
    }
  2. Assign the Customer Profile as an entity to another Customer Profile. Fetch the Primary Customer Profile SID from the primary account.

    Add this SID as the value of the ObjectSid parameter.

    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();

    Response

    Note about this response
    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
    }
  3. Assign supporting documentation to the Secondary CustomerProfile 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 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();

    Response

    Note about this response
    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
    }
  4. Assign phone numbers to your Secondary Customer Profile. To find your phone number SID, go to Phone Numbers 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();

    Response

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

Validate your Secondary CustomerProfile

validate-your-secondary-customerprofile page anchor

Evaluate the Secondary CustomerProfile 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 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();

Response

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

Submit your Secondary CustomerProfile

submit-your-secondary-customerprofile page anchor

Submit the Secondary CustomerProfile instance for review.

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();

Response

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

After submission, Twilio performs an evaluation of your request.

  • If it complies, your Secondary Customer Profile state changes to under in-review status.
  • If it doesn't comply, Twilio rejects it and changes its status to twilio-rejected.