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

Voice Integrity Onboarding with the Trust Hub REST API (Direct Customers using Subaccounts)


(information)

Info

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

This page walks Direct Customers using subaccounts through creating a Voice Integrity Trust Product with the Trust Hub REST API.

Not a Direct Customer using subaccounts? Find the appropriate onboarding instructions below:


Direct Customers using Subaccounts

direct-customers-using-subaccounts page anchor
Voice Integrity - Direct Customer using Subaccounts: Create a Primary Business Profile under your Parent Account.

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

1-create-a-primary-business-profile-in-your-parent-account-in-the-consoles-trust-hub-and-submit-for-vetting page anchor

2. Add Phone Number(s) from your Subaccount(s) to your Primary Business Profile

2-add-phone-numbers-from-your-subaccounts-to-your-primary-business-profile page anchor
  • This is required before you can add a phone number to your Voice Integrity Trust Product.
  • You'll need your Business Profile's SID

    • To find your Business Profile SID in the Console, navigate to Trust Hub -> Customer Profiles -> View Profile Details .
    • If you'd prefer to use the Trust Hub API to do this, see the Additional API Calls section .
    • Business Profile SIDs start with " BU ".
  • You'll also need your Phone Number SID(s) from your subaccount(s).

    • To find your Phone Number SIDs in the Console, first navigate to your subaccount ( Settings -> Subaccounts -> View Subaccount ), then go to Phone Numbers , and click on the phone number.
    • To find your Phone Number SIDs via API (you'll need your Subaccount SID(s) , which can be found in the Console or via API), see the Additional API Calls Section .
    • 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 Primary Business Profile

add-phone-number-to-primary-business-profile page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.trusthub.v1.customerProfiles('YOUR_BUSINESS_PROFILE_SID')
_14
.customerProfilesChannelEndpointAssignment
_14
.create({
_14
channelEndpointType: 'phone-number',
_14
channelEndpointSid: 'YOUR_PHONE_NUMBER_SID'
_14
})
_14
.then(customer_profiles_channel_endpoint_assignment => console.log(customer_profiles_channel_endpoint_assignment.sid));

Output

_10
{
_10
"sid": "RAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"customer_profile_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"channel_endpoint_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"channel_endpoint_type": "phone-number",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ChannelEndpointAssignments/RAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_10
}

3. Create a Voice Integrity Trust Product

3-create-a-voice-integrity-trust-product page anchor
  • Note: Do not change the policy_sid from the example below.
  • The response will contain the SID for your Trust Product. You'll need this for the next step.

Create Voice Integrity Trust Product

create-voice-integrity-trust-product page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.trusthub.v1.trustProducts
_14
.create({
_14
friendlyName: 'FRIENDLY_NAME_FOR_YOUR_TRUST_PRODUCT',
_14
email: 'EMAIL@EXAMPLE.COM',
_14
policySid: 'RN5b3660f9598883b1df4e77f77acefba0'
_14
})
_14
.then(trust_products => console.log(trust_products.sid));

Output

_19
{
_19
"sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_19
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_19
"policy_sid": "RN5b3660f9598883b1df4e77f77acefba0",
_19
"friendly_name": "FRIENDLY_NAME_FOR_YOUR_TRUST_PRODUCT",
_19
"status": "draft",
_19
"email": "EMAIL@EXAMPLE.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/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_19
"links": {
_19
"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/EntityAssignments",
_19
"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Evaluations",
_19
"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ChannelEndpointAssignments"
_19
},
_19
"errors": null
_19
}

4. Create End User for the Voice Integrity Trust Product

4-create-end-user-for-the-voice-integrity-trust-product page anchor
  • Information you will need:

    • Use Case

      • Possible Values : Identify & Verification , Asset Management , Lead Generation , Intelligent Routing , Appointment Scheduling , Customer Support , Self-Service , Automated Support , Appointment Reminders , Employee Notifications , Delivery Notifications , Emergency Notifications , Contactless Delivery , Order Notifications , Service Alerts , Purchase Confirmation , Mass Alerts , Fraud Alerts , Contact Tracing , Lead Management , Lead Nurturing , Telemarketing , Marketing Events , Rewards Program , Lead Alerts , Lead Distribution , Abandoned Cart , Call Tracking , Outbound Dialer , Click to Call , Phone System , Meetings/Collaboration , Telehealth , Distance Learning , Shift Management , Field Notifications , Dating/Social , Remote appointments , Group Messaging , Exam Proctoring , Tutoring , Therapy (Individual+Group) , Pharmacy , First Responder , Survey/Research
    • Business Employee count

      • The should be the number of employees in the business
    • Average Business Day Call Volume

      • This should be an estimate of number of calls per business day.
    • Notes

      • This may be any additional notes about the usecase. For example "We do lost mile delivery of goods". This can be empty if there are no additional notes.
  • Note: Do not change the type from the example below.
  • The response will contain the SID for your End User. You'll need this for the next step.

Create an End User for the Voice Integrity Trust Product

create-an-end-user-for-the-voice-integrity-trust-product page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = require('twilio')(accountSid, authToken);
_19
_19
client.trusthub.v1.endUsers
_19
.create({
_19
attributes: {
_19
use_case: 'Survey/Research',
_19
business_employee_count: '10',
_19
average_business_day_call_volume: '10',
_19
notes: 'Surveying people to learn about demographics'
_19
},
_19
friendlyName: 'YOUR_END_USER_FRIENDLY_NAME',
_19
type: 'voice_integrity_information'
_19
})
_19
.then(end_user => console.log(end_user.sid));

Output

_15
{
_15
"date_updated": "2021-02-16T20:40:57Z",
_15
"sid": "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15
"friendly_name": "YOUR_END_USER_FRIENDLY_NAME",
_15
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15
"url": "https://trusthub.twilio.com/v1/EndUsers/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15
"date_created": "2021-02-16T20:40:57Z",
_15
"attributes": {
_15
"use_case": "Survey/Research",
_15
"business_employee_count": "10",
_15
"average_business_day_call_volume": "10",
_15
"notes": "Surveying people to learn about demographics"
_15
},
_15
"type": "voice_integrity_information"
_15
}

5. Connect your Voice Integrity Trust Product to End User

5-connect-your-voice-integrity-trust-product-to-end-user page anchor
  • You'll need your Trust Product's SID . This was returned by the API call in step 3.
  • You'll need your End User SID . This is the SID that starts with "IT" was returned by previous API call.
  • 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 Voice Integrity Trust Product to End User

connect-your-voice-integrity-trust-product-to-end-user page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.trusthub.v1.trustProducts('YOUR_TRUST_PRODUCT_SID')
_11
.trustProductsEntityAssignments
_11
.create({objectSid: 'YOUR_END_USER_SID'})
_11
.then(trust_products_entity_assignments => console.log(trust_products_entity_assignments.sid));

Output

_10
{
_10
"sid": "BVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"trust_product_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"object_sid": "RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/EntityAssignments/BVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_10
}

6. Connect your Voice Integrity Trust Product to your Business Profile

6-connect-your-voice-integrity-trust-product-to-your-business-profile page anchor
  • You'll need your Trust Product's SID . This was returned by the API call in step 3.
  • You'll need your 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 Voice Integrity Trust Product to your Business Profile

connect-your-voice-integrity-trust-product-to-your-business-profile page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.trusthub.v1.trustProducts('YOUR_TRUST_PRODUCT_SID')
_11
.trustProductsEntityAssignments
_11
.create({objectSid: 'YOUR_BUSINESS_PROFILE_SID'})
_11
.then(trust_products_entity_assignments => console.log(trust_products_entity_assignments.sid));

Output

_10
{
_10
"sid": "BVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"trust_product_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"object_sid": "RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/EntityAssignments/BVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_10
}

7. Assign phone numbers to your Voice Integrity Trust Product

7-assign-phone-numbers-to-your-voice-integrity-trust-product page anchor
  • You'll need the Phone Number SID(s) you assigned to your Business Profile earlier. ( Note: Only those phone numbers already assigned to your Primary Business Profile are eligible)
  • You'll need your Trust Product SID used earlier.
  • Don't change the ChannelEndpointType
  • You can complete this step before or after submitting your Voice Integrity Trust Product
  • To check your Business Profile's phone numbers via API, see the Additional API Calls section below.

Assign Phone Numbers to Voice Integrity Trust Product

assign-phone-numbers-to-voice-integrity-trust-product page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

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

Output

_10
{
_10
"sid": "RAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"trust_product_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"channel_endpoint_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"channel_endpoint_type": "phone-number",
_10
"date_created": "2019-07-31T02:34:41Z",
_10
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ChannelEndpointAssignments/RAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_10
}

8. Submit your Voice Integrity Trust Product

8-submit-your-voice-integrity-trust-product page anchor
  • Approval and registration of Phone Numbers may take 24 to 48 hours.

Submit Voice Integrity Trust Product for Vetting

submit-voice-integrity-trust-product-for-vetting page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.trusthub.v1.trustProducts('YOUR_TRUST_PRODUCT_SID')
_10
.update({status: 'pending-review'})
_10
.then(trust_products => console.log(trust_products.friendlyName));

Output

_19
{
_19
"sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_19
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_19
"policy_sid": "RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_19
"links": {
_19
"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/EntityAssignments",
_19
"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Evaluations",
_19
"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ChannelEndpointAssignments"
_19
},
_19
"errors": null
_19
}


Find Parent Account and Subaccount SIDs

find-parent-account-and-subaccount-sids page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.api.v2010.accounts
_10
.list({limit: 20})
_10
.then(accounts => accounts.forEach(a => console.log(a.sid)));

Output

_45
{
_45
"first_page_uri": "/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0",
_45
"end": 0,
_45
"previous_page_uri": "/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0",
_45
"accounts": [
_45
{
_45
"auth_token": "auth_token",
_45
"date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
_45
"date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
_45
"friendly_name": "friendly_name",
_45
"owner_account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_45
"sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_45
"status": "active",
_45
"subresource_uris": {
_45
"available_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AvailablePhoneNumbers.json",
_45
"calls": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json",
_45
"conferences": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conferences.json",
_45
"incoming_phone_numbers": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json",
_45
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_45
"outgoing_caller_ids": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json",
_45
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_45
"transcriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions.json",
_45
"addresses": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json",
_45
"signing_keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SigningKeys.json",
_45
"connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ConnectApps.json",
_45
"sip": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SIP.json",
_45
"authorized_connect_apps": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AuthorizedConnectApps.json",
_45
"usage": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage.json",
_45
"keys": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Keys.json",
_45
"applications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Applications.json",
_45
"short_codes": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SMS/ShortCodes.json",
_45
"queues": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues.json",
_45
"messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json",
_45
"balance": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Balance.json"
_45
},
_45
"type": "Full",
_45
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_45
}
_45
],
_45
"uri": "/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0",
_45
"page_size": 50,
_45
"start": 0,
_45
"next_page_uri": "/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=50",
_45
"page": 0
_45
}

Get Business Profile SID

get-business-profile-sid page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

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

Output

_36
{
_36
"results": [
_36
{
_36
"sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_36
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_36
"policy_sid": "RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_36
"links": {
_36
"customer_profiles_entity_assignments": "https://trusthub.twilio.com/v1/CustomerProfiles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/EntityAssignments",
_36
"customer_profiles_evaluations": "https://trusthub.twilio.com/v1/CustomerProfiles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Evaluations",
_36
"customer_profiles_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/CustomerProfiles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/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=RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_36
"previous_page_url": "https://trusthub.twilio.com/v1/CustomerProfiles?Status=draft&FriendlyName=friendly_name&PolicySid=RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_36
"url": "https://trusthub.twilio.com/v1/CustomerProfiles?Status=draft&FriendlyName=friendly_name&PolicySid=RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_36
"next_page_url": "https://trusthub.twilio.com/v1/CustomerProfiles?Status=draft&FriendlyName=friendly_name&PolicySid=RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=1",
_36
"key": "results"
_36
}
_36
}

Get Phone Number SIDs from Subaccount

get-phone-number-sids-from-subaccount page anchor

Replace $TWILIO_ACCOUNT_SID in the URL with your Subaccount SID

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

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

Output

_56
{
_56
"end": 0,
_56
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
_56
"incoming_phone_numbers": [
_56
{
_56
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56
"address_requirements": "none",
_56
"address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56
"emergency_address_status": "registered",
_56
"friendly_name": "(808) 925-5327",
_56
"identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56
"origin": "origin",
_56
"phone_number": "+18089255327",
_56
"sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.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": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_56
"voice_receive_mode": "voice",
_56
"status": "in-use",
_56
"subresource_uris": {
_56
"assigned_add_ons": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AssignedAddOns.json"
_56
}
_56
}
_56
],
_56
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=50",
_56
"page": 0,
_56
"page_size": 50,
_56
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
_56
"start": 0,
_56
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0"
_56
}

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

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.trusthub.v1.trustProducts
_10
.list({limit: 20})
_10
.then(trustProducts => trustProducts.forEach(t => console.log(t.sid)));

Output

_32
{
_32
"results": [
_32
{
_32
"sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_32
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_32
"policy_sid": "RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_32
"friendly_name": "friendly_name",
_32
"status": "twilio-approved",
_32
"email": "email",
_32
"status_callback": "http://www.example.com",
_32
"valid_until": "2020-07-31T01:00:00Z",
_32
"date_created": "2019-07-30T22:29:24Z",
_32
"date_updated": "2019-07-31T01:09:00Z",
_32
"url": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_32
"links": {
_32
"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/EntityAssignments",
_32
"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Evaluations",
_32
"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ChannelEndpointAssignments"
_32
},
_32
"errors": null
_32
}
_32
],
_32
"meta": {
_32
"page": 0,
_32
"page_size": 50,
_32
"first_page_url": "https://trusthub.twilio.com/v1/TrustProducts?Status=draft&FriendlyName=friendly_name&PolicySid=RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_32
"previous_page_url": "https://trusthub.twilio.com/v1/TrustProducts?Status=draft&FriendlyName=friendly_name&PolicySid=RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_32
"url": "https://trusthub.twilio.com/v1/TrustProducts?Status=draft&FriendlyName=friendly_name&PolicySid=RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_32
"next_page_url": "https://trusthub.twilio.com/v1/TrustProducts?Status=draft&FriendlyName=friendly_name&PolicySid=RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=1",
_32
"key": "results"
_32
}
_32
}

Check Business Profile Phone Number Assignments

check-business-profile-phone-number-assignments page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.trusthub.v1.customerProfiles('YOUR_BUSINESS_PROFILE_SID')
_11
.customerProfilesChannelEndpointAssignment
_11
.list({limit: 20})
_11
.then(customerProfilesChannelEndpointAssignment => customerProfilesChannelEndpointAssignment.forEach(c => console.log(c.sid)));

Output

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


Rate this page: