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.
A Primary Customer Profile in the twilio-approved
state created in the same account.
Gather the following data for your business.
Property | Necessity | Accepted values |
---|---|---|
Business Identity | Required | direct_customer , isv_reseller_or_partner , unknown |
Business Type | Required | Sole Proprietorship , Partnership , Limited Liability Corporation ,Co-operative , Non-profit Corporation , Corporation |
Business Industry | Required | AGRICULTURE , 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 Type | Required | EIN (US), CBN (CA), CN (UK), ACN (AU), CIN (IN), VAT (EU),VATRN (RO), RN (IS), Other |
Name of Other Registration Type | If Other | |
Business Registration Number | Required | Varies by country |
Business Regions of Operations | Required | AFRICA , ASIA , EUROPE , LATIN_AMERICA , USA_AND_CANADA , AUSTRALIA |
Website URL | Required | HTTP URL as set in RFC 1738 3.3 |
Social Media Profile URL | Optional | HTTP URL as set in RFC 1738 3.3 |
For each representative of the entity set in the CustomerProfile
, collect the following data.
Attribute | Accepted values | Example |
---|---|---|
Last Name | Any string | Smith |
First Name | Any string | Alex |
Email address | alex.smith@example.com | |
Business Title | Any string | Head of Product Management |
Job Position | Director , GM , VP , CEO ,CFO , General Counsel , Other | VP |
Phone Number | Sequence of integers | 8005550100 |
Country Code | Telephone country code | +1 |
- Fetch the Policy SID for your Primary Customer Profile.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchCustomerProfile() {11const customerProfile = await client.trusthub.v112.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(customerProfile.sid);16}1718fetchCustomerProfile();1{2"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"friendly_name": "friendly_name",6"status": "draft",7...8}
- Copy the
policy_sid
from the response. To create a regulatory bundle, you need this Policy SID.
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.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCustomerProfile() {11const customerProfile = await client.trusthub.v1.customerProfiles.create({12email: "email",13friendlyName: "friendly_name",14policySid: "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15statusCallback: "http://www.example.com",16});1718console.log(customerProfile.accountSid);19}2021createCustomerProfile();
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": null19}
Each regulatory bundle needs four components:
- Identity of the business
- Identity of representatives of the business
- Physical location of the business
- 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
.
-
Provide your business identity data.
(error)Danger
Updates are coming to Twilio's Starter Brand registration based on changes from The Campaign Registry (TCR) 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.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createEndUser() {11const endUser = await client.trusthub.v1.endUsers.create({12attributes: {13business_name: "acme business",14social_media_profile_urls: "",15website_url: "example.com",16business_regions_of_operation: "USA_AND_CANADA",17business_type: "Partnership",18business_registration_identifier: "DUNS",19business_identity: "direct_customer",20business_industry: "EDUCATION",21business_registration_number: "123456789",22},23friendlyName: "friendly name",24type: "customer_profile_business_information",25});2627console.log(endUser.sid);28}2930createEndUser();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} -
Provide data about your first authorized representative.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createEndUser() {11const endUser = await client.trusthub.v1.endUsers.create({12attributes: {13job_position: "CEO",14last_name: "acme",15phone_number: "+11234567890",16first_name: "rep1",17email: "rep1@acme.com",18business_title: "ceo",19},20friendlyName: "auth_rep_1",21type: "authorized_representative_1",22});2324console.log(endUser.sid);25}2627createEndUser();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} -
Provide data about your second authorized representative.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createEndUser() {11const endUser = await client.trusthub.v1.endUsers.create({12attributes: {13job_position: "CFO",14last_name: "acme",15phone_number: "+14345678900",16first_name: "rep2",17email: "rep2@acme.com",18business_title: "cfo",19},20friendlyName: "auth_rep_2",21type: "authorized_representative_2",22});2324console.log(endUser.sid);25}2627createEndUser();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} -
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/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createAddress() {11const address = await client.addresses.create({12city: "Any City",13customerName: "name",14isoCountry: "US",15postalCode: "12345",16region: "Any Region",17street: "555 AnyStreet",18streetSecondary: "Apt B",19});2021console.log(address.sid);22}2324createAddress();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} -
Provide the supporting documentation about your business.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createSupportingDocument() {11const supportingDocument =12await client.trusthub.v1.supportingDocuments.create({13attributes: {14address_sids: "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15},16friendlyName: "address",17type: "customer_profile_address",18});1920console.log(supportingDocument.sid);21}2223createSupportingDocument();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": null14}
-
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.1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCustomerProfileEntityAssignment() {11const customerProfilesEntityAssignment = await client.trusthub.v112.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.customerProfilesEntityAssignments.create({14objectSid: "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15});1617console.log(customerProfilesEntityAssignment.sid);18}1920createCustomerProfileEntityAssignment();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/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCustomerProfileEntityAssignment() {11const customerProfilesEntityAssignment = await client.trusthub.v112.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.customerProfilesEntityAssignments.create({14objectSid: "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15});1617console.log(customerProfilesEntityAssignment.sid);18}1920createCustomerProfileEntityAssignment();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/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCustomerProfileEntityAssignment() {11const customerProfilesEntityAssignment = await client.trusthub.v112.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.customerProfilesEntityAssignments.create({14objectSid: "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15});1617console.log(customerProfilesEntityAssignment.sid);18}1920createCustomerProfileEntityAssignment();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} -
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 aCustomer Profile Sid
from the same account or from the primary account.1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCustomerProfileEntityAssignment() {11const customerProfilesEntityAssignment = await client.trusthub.v112.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.customerProfilesEntityAssignments.create({14objectSid: "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15});1617console.log(customerProfilesEntityAssignment.sid);18}1920createCustomerProfileEntityAssignment();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} -
Assign supporting documentation to the Secondary CustomerProfile instance.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCustomerProfileEntityAssignment() {11const customerProfilesEntityAssignment = await client.trusthub.v112.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.customerProfilesEntityAssignments.create({14objectSid: "RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",15});1617console.log(customerProfilesEntityAssignment.sid);18}1920createCustomerProfileEntityAssignment();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} -
Assign phone numbers to your Secondary Customer Profile. To find your phone number SID, go to Phone Numbers in the Console.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCustomerProfileChannelEndpointAssignment() {11const customerProfilesChannelEndpointAssignment = await client.trusthub.v112.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.customerProfilesChannelEndpointAssignment.create({14channelEndpointSid: "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15channelEndpointType: "phone-number",16});1718console.log(customerProfilesChannelEndpointAssignment.sid);19}2021createCustomerProfileChannelEndpointAssignment();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}
Evaluate the Secondary CustomerProfile instance.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCustomerProfileEvaluation() {11const customerProfilesEvaluation = await client.trusthub.v112.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.customerProfilesEvaluations.create({14policySid: "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15});1617console.log(customerProfilesEvaluation.sid);18}1920createCustomerProfileEvaluation();
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": 2221523},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": 2221529},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": 2221535},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": 2221541}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": 2221759}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": 2221977}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": 2221795}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": 22217113},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": 22217119}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": 22217148},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": 22217154}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 the Secondary CustomerProfile instance for review.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateCustomerProfile() {11const customerProfile = await client.trusthub.v112.customerProfiles("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.update({ status: "pending-review" });1415console.log(customerProfile.sid);16}1718updateCustomerProfile();
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": null19}
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
.