Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

SHAKEN/STIR Onboarding with the Trust Hub REST API (ISVs/Resellers using Subaccounts)


(information)

Info

For general information on the Trust Hub API, go to the Trust Hub API Docs.

This page walks ISVs/Resellers using subaccounts through creating a SHAKEN/STIR Trust Product with the Trust Hub REST API.

Not an ISV/Reseller using subaccounts? Find the appropriate onboarding instructions below:


Overview:

There are three main sections in this guide:

  • Create Primary Business Profile in the Console
  • Create Secondary Business Profile under Customer Subaccount, Add Phone Numbers

    • Create Secondary Business Profile, Connect to Primary Business Profile
    • Create a Supporting Document, Connect to Secondary Business Profile
    • Create Business Information, Connect to Secondary Business Profile
    • Create Authorized Representative, Connect to Secondary Business Profile
    • Add Phone Numbers to Secondary Business Profile
    • Submit Secondary Business Profile for Vetting
  • Create Trust Product, Add Phone Numbers, and Submit for Vetting
Create a Primary Business Profile under your Parent Account. Add Phone Numbers from Subaccounts to the Business Profile.

Create a Primary Business Profile in your Parent Account in the Console's Trust Hub and submit for vetting.


Create Secondary Business Profile for Customer Subaccount

1. Create a Secondary Business Profile for your Customer's Subaccount

  • You will want to save the sid from the response. This is your Secondary Business Profile SID , and you will need it for the next step.
  • Do not change the PolicySID in the API call below. This is a static value that will be the same across all accounts.

Create Secondary Business Profile under Customer Subaccount

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
async function createCustomerProfile() {
_20
const customerProfile = await client.trusthub.v1.customerProfiles.create({
_20
email: "EMAIL@EMAIL.COM",
_20
friendlyName: "YOUR_FRIENDLY_NAME_FOR_SECONDARY_CUSTOMER_PROFILE",
_20
policySid: "RNdfbf3fae0e1107f8aded0e7cead80bf5",
_20
});
_20
_20
console.log(customerProfile.sid);
_20
}
_20
_20
createCustomerProfile();

Output

_19
{
_19
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"policy_sid": "RNdfbf3fae0e1107f8aded0e7cead80bf5",
_19
"friendly_name": "YOUR_FRIENDLY_NAME_FOR_SECONDARY_CUSTOMER_PROFILE",
_19
"status": "draft",
_19
"email": "EMAIL@EMAIL.COM",
_19
"status_callback": "http://www.example.com",
_19
"valid_until": null,
_19
"date_created": "2019-07-30T22:29:24Z",
_19
"date_updated": "2019-07-31T01:09:00Z",
_19
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"links": {
_19
"customer_profiles_entity_assignments": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
_19
"customer_profiles_evaluations": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_19
"customer_profiles_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
_19
},
_19
"errors": null
_19
}

2. Connect the Secondary Business Profile to your Primary Business Profile

Connect the Secondary Business Profile to Primary Business Profile

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
async function createCustomerProfileEntityAssignment() {
_20
const customerProfilesEntityAssignment = await client.trusthub.v1
_20
.customerProfiles("YOUR_SECONDARY_BUSINESS_PROFILE_SID")
_20
.customerProfilesEntityAssignments.create({
_20
objectSid: "YOUR_PRIMARY_BUSINESS_PROFILE_SID",
_20
});
_20
_20
console.log(customerProfilesEntityAssignment.sid);
_20
}
_20
_20
createCustomerProfileEntityAssignment();

Output

_10
{
_10
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"customer_profile_sid": "YOUR_SECONDARY_BUSINESS_PROFILE_SID",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"object_sid": "YOUR_PRIMARY_BUSINESS_PROFILE_SID",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}

3. Create a Supporting Document

  • You will need the Address SID for the Secondary Business.

  • This will return the SID for the Supporting Document. You will need this for the next step.

    • The Supporting Document SID will start with "RD"

Create a Supporting Document

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_23
// Download the helper library from https://www.twilio.com/docs/node/install
_23
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_23
_23
// Find your Account SID and Auth Token at twilio.com/console
_23
// and set the environment variables. See http://twil.io/secure
_23
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_23
const authToken = process.env.TWILIO_AUTH_TOKEN;
_23
const client = twilio(accountSid, authToken);
_23
_23
async function createSupportingDocument() {
_23
const supportingDocument =
_23
await client.trusthub.v1.supportingDocuments.create({
_23
attributes: {
_23
address_sids: "YOUR_CUSTOMER_ADDRESS_SID",
_23
},
_23
friendlyName: "YOUR_CUSTOMER_FRIENDLY_NAME",
_23
type: "customer_profile_address",
_23
});
_23
_23
console.log(supportingDocument.sid);
_23
}
_23
_23
createSupportingDocument();

Output

_14
{
_14
"status": "draft",
_14
"date_updated": "2021-02-11T17:23:00Z",
_14
"friendly_name": "YOUR_CUSTOMER_FRIENDLY_NAME",
_14
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14
"url": "https://trusthub.twilio.com/v1/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14
"date_created": "2021-02-11T17:23:00Z",
_14
"sid": "RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14
"attributes": {
_14
"address_sids": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_14
},
_14
"type": "customer_profile_address",
_14
"mime_type": null
_14
}

4. Connect the Supporting Document to your Secondary Business Profile

  • You will need your Secondary Business Profile SID used earlier.
  • You will need the Supporting Document SID, which was returned in the previous step.

Connect the Supporting Document to your Secondary Business Profile

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
async function createCustomerProfileEntityAssignment() {
_20
const customerProfilesEntityAssignment = await client.trusthub.v1
_20
.customerProfiles("YOUR_SECONDARY_CUSTOMER_PROFILE_SID")
_20
.customerProfilesEntityAssignments.create({
_20
objectSid: "YOUR_SUPPORTING_DOCUMENT_SID",
_20
});
_20
_20
console.log(customerProfilesEntityAssignment.sid);
_20
}
_20
_20
createCustomerProfileEntityAssignment();

Output

_10
{
_10
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"customer_profile_sid": "YOUR_SECONDARY_CUSTOMER_PROFILE_SID",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"object_sid": "YOUR_SUPPORTING_DOCUMENT_SID",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}

5. Create Business Information for the Secondary Business Profile

You will need the following information about your Secondary Business:

ParameterDefinition/Possible Values
business_name

required
Definition: Your Secondary Business' legal business name

Possible Values: [any string]
business_identity

required
Definition: Your Secondary Business' structure.

Possible Values:

direct_customer

isv_reseller_or_partner

unknown
business_type

required
Definition: Business type for your Secondary Business

Possible Values:

Sole Proprietorship

Partnership

Limited Liability Corporation

Corporation

Co-operative

Limited Liability Partnership

Non-profit
business_industry

required
Definition: Industry of Secondary Business

Possible 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
business_registration_identifier

required
Definition: The official method used to register the Secondary Business' identity.

Possible Values:

USA: DUNS Number (Dun & Bradstreet)

USA: Employer Identification Number (EIN)
business_registration_number

required
Definition: The number used to identify your Secondary Business of the type chosen for your business_registration_identifier

Possible Values: [numerical string for USA types]
business_regions_of_operation

required
Definition: Regions your Secondary Business

AFRICA

ASIA

EUROPE

LATIN_AMERICA

USA_AND_CANADA
website_url

required
Definition: The URL for the Secondary Business' website

Possible Values: [any valid URL string]
social_media_profile_urls

optional
Definition: The URL(s) for the Secondary Business' social media accounts (i.e. LinkedIn, Facebook, Twitter)

Possible Values: [any valid URL string]

Do not change the Type value. It must be customer_profile_business_information in order to create the correct resource.

  • You'll need the Business Information SID returned from this API call for the next step.
(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.

Create Business Information for Secondary Business Profile

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_32
// Download the helper library from https://www.twilio.com/docs/node/install
_32
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_32
_32
// Find your Account SID and Auth Token at twilio.com/console
_32
// and set the environment variables. See http://twil.io/secure
_32
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_32
const authToken = process.env.TWILIO_AUTH_TOKEN;
_32
const client = twilio(accountSid, authToken);
_32
_32
async function createEndUser() {
_32
const endUser = await client.trusthub.v1.endUsers.create({
_32
attributes: {
_32
business_name: "YOUR_SECONDARY_BUSINESS_NAME",
_32
business_identity: "YOUR_SECONDARY_BUSINESS_IDENTITY",
_32
business_type: "YOUR_SECONDARY_BUSINESS_TYPE",
_32
business_industry: "YOUR_SECONDARY_BUSINESS_INDUSTRY",
_32
business_registration_identifier: "YOUR_SECONDARY_BUSINESS_IDENTIFIER",
_32
business_registration_number:
_32
"YOUR_SECONDARY_BUSINESS_REGISTRATION_NUMBER",
_32
business_regions_of_operation:
_32
"YOUR_SECONDARY_BUSINESS_REGIONS_OF_OPERATION",
_32
website_url: "YOUR_SECONDARY_BUSINESS_URL",
_32
social_media_profile_urls: "",
_32
},
_32
friendlyName: "YOUR_CUSTOMER_FRIENDLY_NAME",
_32
type: "customer_profile_business_information",
_32
});
_32
_32
console.log(endUser.sid);
_32
}
_32
_32
createEndUser();

Output

_17
{
_17
"date_updated": "2021-02-16T20:40:57Z",
_17
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17
"friendly_name": "YOUR_CUSTOMER_FRIENDLY_NAME",
_17
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17
"url": "https://trusthub.twilio.com/v1/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17
"date_created": "2021-02-16T20:40:57Z",
_17
"attributes": {
_17
"phone_number": "+11234567890",
_17
"job_position": "CEO",
_17
"first_name": "rep1",
_17
"last_name": "test",
_17
"business_title": "ceo",
_17
"email": "foobar@test.com"
_17
},
_17
"type": "customer_profile_business_information"
_17
}

6. Connect Business Information to Secondary Business Profile

  • You will need the Customer Profile Business Information SID , which was returned in the last step.
  • The Customer Profile Business Information SID will start with "IT".
  • To find your Customer Profile Business Information SID via API, see the Read all End Users call in the Additional API Calls section .

Connect Business Information to Secondary Business Profile

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
async function createCustomerProfileEntityAssignment() {
_20
const customerProfilesEntityAssignment = await client.trusthub.v1
_20
.customerProfiles("YOUR_SECONDARY_BUSINESS_PROFILE_SID")
_20
.customerProfilesEntityAssignments.create({
_20
objectSid: "YOUR_CUSTOMER_PROFILE_BUSINESS_INFORMATION_SID",
_20
});
_20
_20
console.log(customerProfilesEntityAssignment.sid);
_20
}
_20
_20
createCustomerProfileEntityAssignment();

Output

_10
{
_10
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"customer_profile_sid": "YOUR_SECONDARY_BUSINESS_PROFILE_SID",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"object_sid": "YOUR_CUSTOMER_PROFILE_BUSINESS_INFORMATION_SID",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}

7. Create an Authorized Representative for your Secondary Business Profile

  • You must add one Authorized Representative as a contact for the Secondary Business.
  • A second Authorized Representative is optional.

    • To add a second representative repeat this step with the second Authorized Representative's information, but you will need to change the Type parameter to authorized_representative_2
  • Information you will need:

    • First Name
    • Last Name
    • Email
    • Phone Number
    • Business Title
    • Job Position

      • Possible Values : Director , GM , VP , CEO , CFO , General Counsel
  • This call will return the Authorized Representative's SID . You will need this for the next step.

Create an Authorized Representative

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_27
// Download the helper library from https://www.twilio.com/docs/node/install
_27
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_27
_27
// Find your Account SID and Auth Token at twilio.com/console
_27
// and set the environment variables. See http://twil.io/secure
_27
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_27
const authToken = process.env.TWILIO_AUTH_TOKEN;
_27
const client = twilio(accountSid, authToken);
_27
_27
async function createEndUser() {
_27
const endUser = await client.trusthub.v1.endUsers.create({
_27
attributes: {
_27
first_name: "REPRESENTATIVE_FIRST_NAME",
_27
last_name: "REPRESENTATIVE_LAST_NAME",
_27
email: "EMAIL@EMAIL.COM",
_27
phone_number: "+1XXXXXXXXXX",
_27
business_title: "BUSINESS_TITLE",
_27
job_position: "JOB_POSITION",
_27
},
_27
friendlyName: "YOUR_SECONDARY_BUSINESS_FRIENDLY_NAME",
_27
type: "authorized_representative_1",
_27
});
_27
_27
console.log(endUser.sid);
_27
}
_27
_27
createEndUser();

Output

_17
{
_17
"date_updated": "2021-02-16T20:40:57Z",
_17
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17
"friendly_name": "YOUR_SECONDARY_BUSINESS_FRIENDLY_NAME",
_17
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17
"url": "https://trusthub.twilio.com/v1/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17
"date_created": "2021-02-16T20:40:57Z",
_17
"attributes": {
_17
"phone_number": "+11234567890",
_17
"job_position": "CEO",
_17
"first_name": "rep1",
_17
"last_name": "test",
_17
"business_title": "ceo",
_17
"email": "foobar@test.com"
_17
},
_17
"type": "authorized_representative_1"
_17
}

8. Connect Authorized Representative to Secondary Business Profile

  • You will need the Authorized Representative's SID , which was returned in the last API call.
  • To find the SID via API, see the Read all End Users call in the Additional API Calls section below.
  • If you added a second Authorized Representative, you will need to repeat this call with that Representative's SID.

Connect Authorized Representative to Secondary Business Profile

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
async function createCustomerProfileEntityAssignment() {
_20
const customerProfilesEntityAssignment = await client.trusthub.v1
_20
.customerProfiles("YOUR_SECONDARY_BUSINESS_PROFILE_SID")
_20
.customerProfilesEntityAssignments.create({
_20
objectSid: "YOUR_AUTHORIZED_REPRESENTATIVE_SID",
_20
});
_20
_20
console.log(customerProfilesEntityAssignment.sid);
_20
}
_20
_20
createCustomerProfileEntityAssignment();

Output

_10
{
_10
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"customer_profile_sid": "YOUR_SECONDARY_BUSINESS_PROFILE_SID",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"object_sid": "YOUR_AUTHORIZED_REPRESENTATIVE_SID",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}

9. Add Phone Number(s) to Secondary Business Profile

  • You will need your Secondary Business Profile SID .
  • You'll also need your Phone Number SID(s)

    • To find your Phone Number SIDs in the Console, go to your Dashboard for your Customer Subaccount . In the Project Info section, click on See all phone numbers , then click on a phone number to find the SID.
    • To find your Phone Number SIDs via API, see the Additional API Calls section below.
    • Phone Number SIDs begin with " PN ".
    • In the API Call below, don't change the ChannelEndpointType . It needs to be phone-number to add a phone number to your Business Profile.

Add Phone Number to Secondary Business Profile

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function createCustomerProfileChannelEndpointAssignment() {
_21
const customerProfilesChannelEndpointAssignment = await client.trusthub.v1
_21
.customerProfiles("YOUR_SECONDARY_BUSINESS_PROFILE_SID")
_21
.customerProfilesChannelEndpointAssignment.create({
_21
channelEndpointSid: "YOUR_PHONE_NUMBER_SID",
_21
channelEndpointType: "phone-number",
_21
});
_21
_21
console.log(customerProfilesChannelEndpointAssignment.sid);
_21
}
_21
_21
createCustomerProfileChannelEndpointAssignment();

Output

_10
{
_10
"sid": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"customer_profile_sid": "YOUR_SECONDARY_BUSINESS_PROFILE_SID",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"channel_endpoint_sid": "YOUR_PHONE_NUMBER_SID",
_10
"channel_endpoint_type": "phone-number",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}

10. Submit Secondary Business Profile

  • You will need your Secondary Business Profile SID .
  • Do not change the value of the Status parameter. pending-review is needed to properly submit your Secondary Business Profile

Submit Secondary Business Profile

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function updateCustomerProfile() {
_18
const customerProfile = await client.trusthub.v1
_18
.customerProfiles("YOUR_SECONDARY_BUSINESS_PROFILE_SID")
_18
.update({ status: "pending-review" });
_18
_18
console.log(customerProfile.sid);
_18
}
_18
_18
updateCustomerProfile();

Output

_19
{
_19
"sid": "YOUR_SECONDARY_BUSINESS_PROFILE_SID",
_19
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"friendly_name": "friendly_name",
_19
"status": "pending-review",
_19
"email": "email",
_19
"status_callback": "http://www.example.com",
_19
"valid_until": null,
_19
"date_created": "2019-07-30T22:29:24Z",
_19
"date_updated": "2019-07-31T01:09:00Z",
_19
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"links": {
_19
"customer_profiles_entity_assignments": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
_19
"customer_profiles_evaluations": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_19
"customer_profiles_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
_19
},
_19
"errors": null
_19
}


Create Trust Product, Add Phone Numbers, and Submit for Vetting

1. Create a SHAKEN/STIR Trust Product

  • Note: Do not change the policy_sid from the example below. This is a static value that will stay the same across all accounts.
  • The response will contain the SID for your Trust Product. You'll need this for the next step.

Create SHAKEN/STIR Trust Product

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
async function createTrustProduct() {
_20
const trustProduct = await client.trusthub.v1.trustProducts.create({
_20
email: "EMAIL@EMAIL.COM",
_20
friendlyName: "FRIENDLY_NAME_FOR_YOUR_TRUST_PRODUCT",
_20
policySid: "RN7a97559effdf62d00f4298208492a5ea",
_20
});
_20
_20
console.log(trustProduct.sid);
_20
}
_20
_20
createTrustProduct();

Output

_19
{
_19
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"policy_sid": "RN7a97559effdf62d00f4298208492a5ea",
_19
"friendly_name": "FRIENDLY_NAME_FOR_YOUR_TRUST_PRODUCT",
_19
"status": "draft",
_19
"email": "EMAIL@EMAIL.COM",
_19
"status_callback": "http://www.example.com",
_19
"valid_until": null,
_19
"date_created": "2019-07-30T22:29:24Z",
_19
"date_updated": "2019-07-31T01:09:00Z",
_19
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"links": {
_19
"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
_19
"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_19
"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
_19
},
_19
"errors": null
_19
}

2. Connect your SHAKEN/STIR Trust Product to your Secondary Business Profile

  • You'll need your Trust Product's SID . This was returned by the previous API call.
  • You'll need your Secondary Business Profile's SID .
  • To retrieve these SIDs via the API, see the Additional API Calls section below. You can also find them in the Console under Trust Hub.

Connect your SHAKEN/STIR Trust Product to your Secondary Business Profile

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
async function createTrustProductEntityAssignment() {
_20
const trustProductsEntityAssignment = await client.trusthub.v1
_20
.trustProducts("YOUR_TRUST_PRODUCT_SID")
_20
.trustProductsEntityAssignments.create({
_20
objectSid: "YOUR_SECONDARY_BUSINESS_PROFILE_SID",
_20
});
_20
_20
console.log(trustProductsEntityAssignment.sid);
_20
}
_20
_20
createTrustProductEntityAssignment();

Output

_10
{
_10
"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"trust_product_sid": "YOUR_TRUST_PRODUCT_SID",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"object_sid": "YOUR_SECONDARY_BUSINESS_PROFILE_SID",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}

3. Assign phone numbers to your SHAKEN/STIR Trust Product

  • You'll need the Phone Number SID(s) you assigned to your Business Profile earlier. ( Note: Only those phone numbers already assigned to your Secondary Business Profile are eligible)
  • You'll need your Trust Product SID .
  • Don't change the ChannelEndpointType
  • You can complete this step before or after submitting your SHAKEN/STIR Trust Product for vetting
  • To check your Secondary Business Profile's phone numbers via API, see the Additional API Calls section below.

Assign Phone Numbers to SHAKEN/STIR Trust Product

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function createTrustProductChannelEndpointAssignment() {
_21
const trustProductsChannelEndpointAssignment = await client.trusthub.v1
_21
.trustProducts("YOUR_TRUST_PRODUCT_SID")
_21
.trustProductsChannelEndpointAssignment.create({
_21
channelEndpointSid: "YOUR_PHONE_NUMBER_SID",
_21
channelEndpointType: "phone-number",
_21
});
_21
_21
console.log(trustProductsChannelEndpointAssignment.sid);
_21
}
_21
_21
createTrustProductChannelEndpointAssignment();

Output

_10
{
_10
"sid": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"trust_product_sid": "YOUR_TRUST_PRODUCT_SID",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"channel_endpoint_sid": "YOUR_PHONE_NUMBER_SID",
_10
"channel_endpoint_type": "phone-number",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_10
}

4. Submit your SHAKEN/STIR Trust Product for vetting

  • Once it reaches Twilio-Approved status, you will be able to sign outbound calls with "A" level attestation.

Submit SHAKEN/STIR Trust Product for Vetting

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function updateTrustProduct() {
_18
const trustProduct = await client.trusthub.v1
_18
.trustProducts("YOUR_TRUST_PRODUCT_SID")
_18
.update({ status: "pending-review" });
_18
_18
console.log(trustProduct.sid);
_18
}
_18
_18
updateTrustProduct();

Output

_19
{
_19
"sid": "YOUR_TRUST_PRODUCT_SID",
_19
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"friendly_name": "friendly_name",
_19
"status": "pending-review",
_19
"email": "email",
_19
"status_callback": "http://www.example.com",
_19
"valid_until": null,
_19
"date_created": "2019-07-30T22:29:24Z",
_19
"date_updated": "2019-07-31T01:09:00Z",
_19
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_19
"links": {
_19
"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
_19
"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_19
"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
_19
},
_19
"errors": null
_19
}


Additional API Calls

Get Business Profile SIDs

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function listCustomerProfile() {
_18
const customerProfiles = await client.trusthub.v1.customerProfiles.list({
_18
limit: 20,
_18
});
_18
_18
customerProfiles.forEach((c) => console.log(c.sid));
_18
}
_18
_18
listCustomerProfile();

Output

_36
{
_36
"results": [
_36
{
_36
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_36
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_36
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_36
"friendly_name": "friendly_name",
_36
"status": "twilio-approved",
_36
"email": "email",
_36
"status_callback": "http://www.example.com",
_36
"valid_until": "2020-07-31T01:00:00Z",
_36
"date_created": "2019-07-30T22:29:24Z",
_36
"date_updated": "2019-07-31T01:09:00Z",
_36
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_36
"links": {
_36
"customer_profiles_entity_assignments": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
_36
"customer_profiles_evaluations": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
_36
"customer_profiles_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
_36
},
_36
"errors": [
_36
{
_36
"code": 18601
_36
}
_36
]
_36
}
_36
],
_36
"meta": {
_36
"page": 0,
_36
"page_size": 50,
_36
"first_page_url": "https://trusthub.twilio.com/v1/CustomerProfiles?Status=draft&FriendlyName=friendly_name&PolicySid=RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
_36
"previous_page_url": null,
_36
"url": "https://trusthub.twilio.com/v1/CustomerProfiles?Status=draft&FriendlyName=friendly_name&PolicySid=RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
_36
"next_page_url": null,
_36
"key": "results"
_36
}
_36
}

Create an Address Resource

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_23
// Download the helper library from https://www.twilio.com/docs/node/install
_23
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_23
_23
// Find your Account SID and Auth Token at twilio.com/console
_23
// and set the environment variables. See http://twil.io/secure
_23
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_23
const authToken = process.env.TWILIO_AUTH_TOKEN;
_23
const client = twilio(accountSid, authToken);
_23
_23
async function createAddress() {
_23
const address = await client.addresses.create({
_23
city: "CUSTOMER_CITY",
_23
customerName: "YOUR_CUSTOMER_NAME",
_23
isoCountry: "FO",
_23
postalCode: "CUSTOMER_POSTAL_CODE",
_23
region: "CUSTOMER_STATE_OR_REGION",
_23
street: "CUSTOMER_STREET",
_23
});
_23
_23
console.log(address.accountSid);
_23
}
_23
_23
createAddress();

Output

_18
{
_18
"account_sid": "YOUR_PARENT_ACCOUNT_OR_SUBACCOUNT_SID",
_18
"city": "CUSTOMER_CITY",
_18
"customer_name": "YOUR_CUSTOMER_NAME",
_18
"date_created": "Tue, 18 Aug 2015 17:07:30 +0000",
_18
"date_updated": "Tue, 18 Aug 2015 17:07:30 +0000",
_18
"emergency_enabled": false,
_18
"friendly_name": null,
_18
"iso_country": "FO",
_18
"postal_code": "CUSTOMER_POSTAL_CODE",
_18
"region": "CUSTOMER_STATE_OR_REGION",
_18
"sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"street": "CUSTOMER_STREET",
_18
"street_secondary": null,
_18
"validated": false,
_18
"verified": false,
_18
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
_18
}

Retrieve Address SIDs

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function listAddress() {
_16
const addresses = await client.addresses.list({ limit: 20 });
_16
_16
addresses.forEach((a) => console.log(a.accountSid));
_16
}
_16
_16
listAddress();

Output

_33
{
_33
"addresses": [
_33
{
_33
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_33
"city": "SF",
_33
"customer_name": "name",
_33
"date_created": "Tue, 18 Aug 2015 17:07:30 +0000",
_33
"date_updated": "Tue, 18 Aug 2015 17:07:30 +0000",
_33
"emergency_enabled": false,
_33
"friendly_name": null,
_33
"iso_country": "US",
_33
"postal_code": "94019",
_33
"region": "CA",
_33
"sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_33
"street": "4th",
_33
"street_secondary": null,
_33
"validated": false,
_33
"verified": false,
_33
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
_33
}
_33
],
_33
"end": 0,
_33
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0",
_33
"last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0",
_33
"next_page_uri": null,
_33
"num_pages": 1,
_33
"page": 0,
_33
"page_size": 50,
_33
"previous_page_uri": null,
_33
"start": 0,
_33
"total": 1,
_33
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0"
_33
}

Retrieve Supporting Document SIDs

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function listSupportingDocument() {
_18
const supportingDocuments = await client.trusthub.v1.supportingDocuments.list(
_18
{ limit: 20 }
_18
);
_18
_18
supportingDocuments.forEach((s) => console.log(s.sid));
_18
}
_18
_18
listSupportingDocument();

Output

_27
{
_27
"results": [
_27
{
_27
"status": "draft",
_27
"date_updated": "2021-02-11T17:23:00Z",
_27
"friendly_name": "Business-profile-physical-address",
_27
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"url": "https://trusthub.twilio.com/v1/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"date_created": "2021-02-11T17:23:00Z",
_27
"sid": "RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"attributes": {
_27
"address_sids": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_27
},
_27
"type": "customer_profile_address",
_27
"mime_type": null
_27
}
_27
],
_27
"meta": {
_27
"page": 0,
_27
"page_size": 50,
_27
"first_page_url": "https://trusthub.twilio.com/v1/SupportingDocuments?PageSize=50&Page=0",
_27
"previous_page_url": null,
_27
"url": "https://trusthub.twilio.com/v1/SupportingDocuments?PageSize=50&Page=0",
_27
"next_page_url": null,
_27
"key": "results"
_27
}
_27
}

Read all End Users

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function listEndUser() {
_16
const endUsers = await client.trusthub.v1.endUsers.list({ limit: 20 });
_16
_16
endUsers.forEach((e) => console.log(e.sid));
_16
}
_16
_16
listEndUser();

Output

_30
{
_30
"results": [
_30
{
_30
"date_updated": "2021-02-16T20:40:57Z",
_30
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30
"friendly_name": "auth_rep_1",
_30
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30
"url": "https://trusthub.twilio.com/v1/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30
"date_created": "2021-02-16T20:40:57Z",
_30
"attributes": {
_30
"phone_number": "+11234567890",
_30
"job_position": "CEO",
_30
"first_name": "rep1",
_30
"last_name": "test",
_30
"business_title": "ceo",
_30
"email": "foobar@test.com"
_30
},
_30
"type": "authorized_representative_1"
_30
}
_30
],
_30
"meta": {
_30
"page": 0,
_30
"page_size": 50,
_30
"first_page_url": "https://trusthub.twilio.com/v1/EndUsers?PageSize=50&Page=0",
_30
"previous_page_url": null,
_30
"url": "https://trusthub.twilio.com/v1/EndUsers?PageSize=50&Page=0",
_30
"next_page_url": null,
_30
"key": "results"
_30
}
_30
}

Get Phone Number SIDs from Parent Account

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function listIncomingPhoneNumber() {
_18
const incomingPhoneNumbers = await client.incomingPhoneNumbers.list({
_18
limit: 20,
_18
});
_18
_18
incomingPhoneNumbers.forEach((i) => console.log(i.accountSid));
_18
}
_18
_18
listIncomingPhoneNumber();

Output

_56
{
_56
"end": 0,
_56
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
_56
"incoming_phone_numbers": [
_56
{
_56
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"address_requirements": "none",
_56
"address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"api_version": "2010-04-01",
_56
"beta": null,
_56
"capabilities": {
_56
"voice": true,
_56
"sms": false,
_56
"mms": true,
_56
"fax": false
_56
},
_56
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_56
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_56
"emergency_status": "Active",
_56
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"emergency_address_status": "registered",
_56
"friendly_name": "(808) 925-5327",
_56
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"origin": "origin",
_56
"phone_number": "+18089255327",
_56
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"sms_application_sid": "",
_56
"sms_fallback_method": "POST",
_56
"sms_fallback_url": "",
_56
"sms_method": "POST",
_56
"sms_url": "",
_56
"status_callback": "",
_56
"status_callback_method": "POST",
_56
"trunk_sid": null,
_56
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_56
"voice_application_sid": "",
_56
"voice_caller_id_lookup": false,
_56
"voice_fallback_method": "POST",
_56
"voice_fallback_url": null,
_56
"voice_method": "POST",
_56
"voice_url": null,
_56
"bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_56
"voice_receive_mode": "voice",
_56
"status": "in-use",
_56
"subresource_uris": {
_56
"assigned_add_ons": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json"
_56
}
_56
}
_56
],
_56
"next_page_uri": null,
_56
"page": 0,
_56
"page_size": 50,
_56
"previous_page_uri": null,
_56
"start": 0,
_56
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0"
_56
}

Check Secondary Business Profile Phone Number Assignments

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
async function listCustomerProfileChannelEndpointAssignment() {
_20
const customerProfilesChannelEndpointAssignments = await client.trusthub.v1
_20
.customerProfiles("YOUR_SECONDARY_BUSINESS_PROFILE_SID")
_20
.customerProfilesChannelEndpointAssignment.list({ limit: 20 });
_20
_20
customerProfilesChannelEndpointAssignments.forEach((c) =>
_20
console.log(c.channelEndpointSid)
_20
);
_20
}
_20
_20
listCustomerProfileChannelEndpointAssignment();

Output

_22
{
_22
"results": [
_22
{
_22
"sid": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_22
"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_22
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_22
"channel_endpoint_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_22
"channel_endpoint_type": "phone-number",
_22
"date_created": "2019-07-31T02:34:41Z",
_22
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_22
}
_22
],
_22
"meta": {
_22
"page": 0,
_22
"page_size": 50,
_22
"first_page_url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments?ChannelEndpointSid=PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
_22
"previous_page_url": null,
_22
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments?ChannelEndpointSid=PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
_22
"next_page_url": null,
_22
"key": "results"
_22
}
_22
}


Rate this page: