This API walkthrough is for ISVs who are registering their customers for new A2P 10DLC Sole Proprietor Brands and Campaigns. If you are not an ISV but rather a direct customer looking to register your own Sole Proprietor Brand for A2P use, please see this guidewhich will direct you to register your brand via our Console tool.
Sole Proprietor Brands and Campaigns are only intended for customers in the US and Canada who do not have a tax ID (i.e. an EIN in the U.S. or a Canadian Business Number). If your customers have a Tax ID, you must register them for a Standard or Low-Volume Standard Brand. This includes U.S. customers registered as LLCs, even if they have a "Sole Proprietorship" LLC for IRS purposes (all US LLCs have an EIN and are therefore ineligible for Sole Proprietor Brand registration as this is defined by The Campaign Registry). If your customers are located outside of the US or Canada, you must register them for a Standard or Low-Volume Standard Brand to enable them to send messages to the US using 10DLC numbers.
Note for ISVs: we understand that you may be relying on your secondary customers to self-report whether or not they have an EIN or equivalent Tax ID. Please make sure they understand that, if they declare they are eligible for Sole Proprietor Brand registration but are subsequently found to have an EIN or equivalent Tax ID, their Campaign registration will error, and you or they will need to pay all associated fees and re-do their registration as a Standard or Low-Volume Standard Brand. This will also directly impact their traffic, since until they are registered correctly and completely they will not be able to send SMS 10DLC messages in the US.
Note: For all information entered as part of this registration process, please note that The Campaign Registry (TCR) supports all "utf8mb4" supported characters. Please see the list for all Unicode 15.0 supported scripts and characters here: https://www.unicode.org/charts/
When registering your customers for Sole Proprietor Brands, you need to provide the following information for each customer. You must use your customer's information for registration. Do not use your own (i.e., the ISV's) information:
Field | Description |
---|---|
First and last name | The customer's first and last name. |
This must be a well formatted address with a valid domain and cannot be a disposable address. This email address can only be used a maximum of 10 times across all A2P Brand registrations with TCR. If your customer is registered for A2P 10DLC with another vendor, that counts towards this limit. | |
Phone number | The customer's business/contact phone number. It must be a well-formatted number and can be a landline, mobile, or other number. |
Mobile number | This mobile number is critical in the registration process and is used for sending a One Time Password (OTP) verification request to the customer, which they must respond to. This must be a valid US or Canadian mobile number only where the customer can be reached. This cannot be a number which you've acquired from a CPaaS provider such as Twilio. This mobile number can only be used a maximum of three times across all A2P Brand registrations with TCR. If your customer is registered for A2P 10DLC with another vendor, that counts towards this limit. You may use the same number for both the Phone Number field and the Mobile Number field, provided that this number satisfies all of the requirements here |
Address | Must be a valid US or Canadian address. It can be a PO Box. This address can only be used a maximum of 10 times across all A2P Brand registrations with TCR. If your customer is registered for A2P 10DLC with another vendor, that counts towards this limit. |
Brand name | If your customer is a Sole Proprietor business, this must be the customer's real business name. For Sole Proprietor businesses, their business name is usually their first name and last name, but you can also provide a DBA name if there is one. If your customer is not a business entity but instead is a hobbyist / college student, etc., please provide their first name and last name. This field cannot be a unique identifier such as an account ID or email address. |
Vertical (optional field) | You can select from a set of predefined values, which are the same as the vertical field in Primary Customer Profiles and Secondary Customer Profiles. See the list of available values here. |
Your customer's mobile phone number, which will be used for One Time Password (OTP) verification of their Brand, can only be used a maximum of three times for registering A2P 10DLC Brands. This is a limit at The Campaign Registry (TCR) level, and not within Twilio. If your customer registers for A2P 10DLC Sole Proprietor Brand with another vendor and uses this mobile number for verification, that will count towards their lifetime three-use limit.
Once you have this information for your customers, you can complete their Sole Proprietor registration via the API. API registration consists of the following steps:
It is programmatically possible to call each of the steps enumerated above, and detailed below in Parts 1, 2, 3 and 4, in a single uninterrupted sequence of API calls. However, Twilio applies various layers of validation and review to the various steps — some validations are synchronous or near-synchronous, others involve manual review and can take one or more full business days. We do NOT suggest that you wait for your Starter Profile to be manually approved before moving on, or for your Brand to be manually approved before creating a Campaign associated with it. However, we DO advise that, after submitting the complete Business Profile bundle in Step 1.8, you wait 30 seconds to see if any programmatic validation error surfaces before proceeding to the Trust Bundle creation in Step 2; that after the Trust Bundle is submitted in Step 2.6 you wait another 30 seconds before proceeding to Brand submission in Step 3; and that after Brand submission in Step 3 you wait 30 seconds before proceeding with Campaign creation in Step 4. Catching synchronous or near-synchronous upstream errors this way can dramatically reduce the amount of cleanup you have to do downstream, for examples deleting Campaigns whose Brands have failed, or deleting Brands (and Campaigns) whose Profiles have failed.
For troubleshooting and remediation of such failures during this registration process, please see our separate Troubleshooting documentation.
What does this do? Creates a Trust Hub profile for your business (the ISV).
Which API? This can only be done via the Trust Hub UI in the Twilio Console.
Before proceeding with the onboarding process for your clients, all ISVs must have a primary customer profile in an APPROVED state. You can do this in the Trust Hub, located in the Twilio Console. In order to register secondary profiles, the primary customer profile needs to have "ISV Reseller or Partner" selected as your Business Identity.
To get the highest possible messaging limits, please create your profile with details that exactly match those in your US EIN listing (or that of your relevant national Tax ID if your ISV business is located outside the U.S.). If there are any differences - for example, in the business name or address - your messaging limits will be lower. Please verify these details via your W2 form or equivalent national tax record.
Which API? Trust Hub API
This step creates Starter Customer Profiles for your customers using a Trust Hub policy with the identifier RN806dd6cd175f314e1f96a9727ee271f4
. Trust Hub supports many types of compliance collections, but this specific policy is for Starter Profiles, which can be used for Sole Proprietor Brands.
The Starter Customer Profile Policy contains all of the fields you need to complete when creating a Starter Customer Profile. You can refer back to this throughout the registration process to ensure you are completing the necessary fields. When you have completed the Starter Customer Profile for this customer, you will submit it to be evaluated against this Customer Profile Policy (in step 1.7 of this walkthrough) to ensure that it meets all requirements.
The SID for the Starter Customer Profile Policy is RN806dd6cd175f314e1f96a9727ee271f4
.
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 fetchPolicies() {11const policy = await client.trusthub.v112.policies("RN806dd6cd175f314e1f96a9727ee271f4")13.fetch();1415console.log(policy.sid);16}1718fetchPolicies();
1{2"url": "https://trusthub.twilio.com/v1/Policies/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"requirements": {4"end_user": [5{6"url": "/EndUserTypes/customer_profile_business_information",7"fields": [8"business_type",9"business_registration_number",10"business_name",11"business_registration_identifier",12"business_identity",13"business_industry",14"website_url",15"business_regions_of_operation",16"social_media_profile_urls"17],18"type": "customer_profile_business_information",19"name": "Business Information",20"requirement_name": "customer_profile_business_information"21},22{23"url": "/EndUserTypes/authorized_representative_1",24"fields": [25"first_name",26"last_name",27"email",28"phone_number",29"business_title",30"job_position"31],32"type": "authorized_representative_1",33"name": "Authorized Representative 1",34"requirement_name": "authorized_representative_1"35},36{37"url": "/EndUserTypes/authorized_representative_2",38"fields": [39"first_name",40"last_name",41"email",42"phone_number",43"business_title",44"job_position"45],46"type": "authorized_representative_2",47"name": "Authorized Representative 2",48"requirement_name": "authorized_representative_2"49}50],51"supporting_trust_products": [],52"supporting_document": [53[54{55"description": "Customer Profile HQ Physical Address",56"type": "document",57"name": "Physical Business Address",58"accepted_documents": [59{60"url": "/SupportingDocumentTypes/customer_profile_address",61"fields": [62"address_sids"63],64"type": "customer_profile_address",65"name": "Physical Business Address"66}67],68"requirement_name": "customer_profile_address"69}70]71],72"supporting_customer_profiles": []73},74"friendly_name": "Primary Customer Profile of type Business",75"sid": "RN806dd6cd175f314e1f96a9727ee271f4"76}
This Starter Customer Profile Bundle contains information about your customer. You will fill out some of the fields now, and will attach more information to this Bundle in later steps. You will submit this Bundle for review in the last step of Section 1 of this walkthrough.
Parameter | Valid Values |
---|---|
friendly_name | A string representing your customer's business name. This is an internal name meant for you to identify this particular customer profile Bundle for your customer. |
A string representing your customer's email address | |
policy_sid | The static TrustHub policy identifier for Starter profiles. The hard-coded value is RN806dd6cd175f314e1f96a9727ee271f4 and you use this value for every Starter Customer Profile Bundle you create. |
status_callback (optional) | The URL at which you would like to receive webhook requests about status updates to this Profile Bundle. See the Bundles Resource documentation for details on Twilio's request to your webhook. NOTE: while the use of a status_callback webhook is optional, it is highly recommended if you would like a detailed failure_reason for a Customer Profile, in the case of a Profile rejection, such as the email and address validation failure reasons discussed below and in Section 1.4. Only this kind of failure detail will allow self-service remediation as discussed in Section 1.9 below. A failed Customer Profile submission (Step 1.8) will also generate an email to the email address of the ISV's profile, indicating failure, but this email will NOT give a detailed failure reason and will instead direct you to contact Twilio support for details. |
Beginning in early December, Twilio will perform a data validation check on the email field in the above API call. The validations and rejection reasons are as follows:
Description | Rejection reason |
---|---|
Email domain should have correct syntax | Email domain has an invalid address syntax. |
Email domain is unknown | Unknown email domain. |
Temporary email which can be disposable | Email is a suspected disposable address. |
If email check have passed all above validations and still is invalid from SendGrid API | Email is invalid. |
Please note again that these detailed failure reasons are provided only in the status_callback
message sent to the status_callback webhook URL, if one has been provided in the Starter Customer Profile Bundle creation call. If you are not using a status_callback
webhook, you will still be notified of the Profile submission's general failure status via email to the ISV email contact, but this email will not include any detail as to failure_reason
, so for this you would need to contact support before you could remediate the issue(s) in Step 1.9 below.
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: "johndoe@example.com",13friendlyName: "John Doe Starter Customer Profile Bundle",14policySid: "RN806dd6cd175f314e1f96a9727ee271f4",15});1617console.log(customerProfile.sid);18}1920createCustomerProfile();
1{2"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"policy_sid": "RN806dd6cd175f314e1f96a9727ee271f4",5"friendly_name": "John Doe Starter Customer Profile Bundle",6"status": "draft",7"email": "johndoe@example.com",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}
You will use the SID from this new Customer Profile Bundle you created (the SID begins with BU
) in a later step.
Parameter | Valid Values |
---|---|
attributes | An object containing your customer's first name, last name, email address, and phone number |
friendly_name | A string representing the end-user object you create in this step. This is for your internal purposes for identifying the end customer. |
type | The end user object type. This will always be starter_customer_profile_information for Starter Profiles. |
The attributes
object should contain the following fields:
1{2"email": "starter-profile-enduser@example.com",3"first_name": "John",4"last_name": "Doe",5"phone_number": "+11234567890"6}7
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: {13email: "starter-profile-enduser@example.com",14first_name: "John",15last_name: "Doe",16phone_number: "+11234567890",17},18friendlyName: "Starter Profile End User",19type: "starter_customer_profile_information",20});2122console.log(endUser.sid);23}2425createEndUser();
1{2"date_updated": "2021-02-16T20:40:57Z",3"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "Starter Profile End User",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": "starter_customer_profile_information"17}
You will use the SID of the new end-user object you created (the SID begins with IT
) in a later step.
Here, you create an Address object for the customer, which you then attach to their customer profile. Note that you can only use a valid US or Canadian address if you are creating a Sole Proprietor registration.
See this table for a list of parameters to provide to the API request.
Beginning in early December 2023, Twilio will perform a data validation check on the address fields submitted in the above API call. The validations and rejection reasons are as follows:
If given address is not present | Address not found with sid ADXXXXXXXXXXXXXXXXXXXXXXXX |
---|---|
If given address is not a valid US/CA address | The provided address is not a valid US or Canada address |
If given address has invalid postal code | [address_sids] - Invalid Postal Code. Address suggestion -> Street: 1 Jersey St. Secondary Street: Boston, MA 02215-4147. Locality: Boston. Region: MA. Postal Code: 02215-4147. Country: US; |
If given address has invalid street name("street": "1 Jersey Str") | [address_sids] - Invalid Street. Address suggestion -> Street: 1 Jersey St. Secondary Street: Boston, MA 02215-4147. Locality: Boston. Region: MA. Postal Code: 02215-4147. Country: US |
If given address has invalid locality("locality": "Bostun") | [address_sids] - Invalid Locality. Address suggestion -> Street: 1 Jersey St. Secondary Street: Boston, MA 02215-4147. Locality: Boston. Region: MA. Postal Code: 02215-4147. Country: US; |
If given address has invalid region("region": "MAA") | [address_sids] - Invalid Region. Address suggestion -> Street: 1 Jersey St. Secondary Street: Boston, MA 02215-4147. Locality: Boston. Region: MA. Postal Code: 02215-4147. Country: US; |
If given address has Invalid house number("street": "10000 Jersey St") | [address_sids] - Invalid House Number |
NOTE that this data validation check, like the one performed on the email address submitted in Step 1.2 above, is not actually performed until the submission of the complete Profile bundle in Step 1.8 below. These validations are also asynchronous. As with the email validation, to receive the kind of detailed failure_reason
for an address validation that is enumerated in the above table, you will need to have provided a status_callback
webhook upon your initial creation of the Customer Profile in Step 1.2. This failure_reason detail would then be provided in the status callback to that webhook. An email indicating more generic status for the Profile will also be sent to the email address indicated in your ISV Primary Customer Profile and will direct you to contact Twilio Support for actionable detail before you can proceed with remediation of the secondary profile as covered in Section 1.9 below.
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: "Example City",13customerName: "John Doe",14isoCountry: "US",15postalCode: "12345",16region: "CA",17street: "123 Example Street",18streetSecondary: "Apt B",19});2021console.log(address.accountSid);22}2324createAddress();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"city": "Example City",4"customer_name": "John Doe",5"date_created": "Tue, 18 Aug 2015 17:07:30 +0000",6"date_updated": "Tue, 18 Aug 2015 17:07:30 +0000",7"emergency_enabled": false,8"friendly_name": null,9"iso_country": "US",10"postal_code": "12345",11"region": "CA",12"sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",13"street": "123 Example Street",14"street_secondary": "Apt B",15"validated": false,16"verified": false,17"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"18}
Once you have a valid address SID from this Address object you just created (the SID beings with AD
), you can create a Supporting Document object. This Supporting Document will later be assigned to the Starter Customer Profile Bundle that you created in step 1.2.
The Supporting Document will need the following values:
Parameter | Valid Values |
---|---|
attributes | An object containing the Address SID from the previous step. |
friendly_name | A string you use to identify this Supporting Document |
type | The string customer_profile_address |
The attributes
object should look like this:
1{2"address_sids": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"3}4
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: "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",15},16friendlyName: "SP Document Address",17type: "customer_profile_address",18});1920console.log(supportingDocument.sid);21}2223createSupportingDocument();
1{2"status": "draft",3"date_updated": "2021-02-11T17:23:00Z",4"friendly_name": "SP Document 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}
You will use the SID from this new Supporting Document (the SID begins with RD
) in the next step.
Attach the SIDs from all the steps above to the Starter Customer Profile:
IT
.
BU
.
RD
.
BU
. You can find this in the
Customer Profile Details page in Twilio Console
.
The Starter Customer Profile SID from step 1.2 is the path parameter for this request. The body of the request should contain one parameter, called object_sid
, which is the End-User Object SID from step 1.3. See the code sample below as an example.
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: "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",15});1617console.log(customerProfilesEntityAssignment.sid);18}1920createCustomerProfileEntityAssignment();
1{2"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"object_sid": "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",6"date_created": "2019-07-31T02:34:41Z",7"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"8}
The Starter Customer Profile SID from step 1.2 is the path parameter for this request. The body of the request should contain one parameter, called object_sid
, which is the Supporting Document SID from step 1.5. See the code sample below as an example.
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();
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}
This step is applicable only for ISV customers of Twilio. ISV customers should already have Primary Customer Profile setup in their parent/main account from where they can fetch its Bundle SID (the SID starts with BU
). See the Prerequisites for more information.
The Starter Customer Profile SID from step 1.2 is the path parameter for this request. The body of the request should contain one parameter, called object_sid
, which is the Primary Customer Bundle SID. See the code sample below as an example.
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: "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",15});1617console.log(customerProfilesEntityAssignment.sid);18}1920createCustomerProfileEntityAssignment();
1{2"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"object_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",6"date_created": "2019-07-31T02:34:41Z",7"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"8}
This step evaluates the Starter Customer Profile against the Starter Customer Profile Policy (which you fetched in step 1.1; the Starter Customer Profile Policy has the SID RN806dd6cd175f314e1f96a9727ee271f4
).
The Starter Customer Profile SID from step 1.2 is the path parameter for this request. The body of the request should contain one parameter, called policy_sid
, which is the hardcoded Policy SID RN806dd6cd175f314e1f96a9727ee271f4
.
If your Starter Customer Profile is missing any required information, the response to the API request will indicate that those fields are not complete. You should go back and complete the missing fields from the previous steps.
If your Starter Customer Profile matches the expected Starter Customer Profile Policy, the response will indicate that the profile is compliant
and that you can move on to the next step.
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: "RN806dd6cd175f314e1f96a9727ee271f4",15});1617console.log(customerProfilesEvaluation.sid);18}1920createCustomerProfileEvaluation();
1{2"sid": "ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"status": "compliant",4"date_created": "2023-03-15T13:51:57Z",5"policy_sid": "RN806dd6cd175f314e1f96a9727ee271f4",6"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",7"customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",8"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations/ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",9"results": [10{11"valid": [12{13"object_field": "first_name",14"error_code": null,15"friendly_name": "First Name",16"passed": true,17"failure_reason": null18},19{20"object_field": "last_name",21"error_code": null,22"friendly_name": "Last Name",23"passed": true,24"failure_reason": null25},26{27"object_field": "email",28"error_code": null,29"friendly_name": "Email Address",30"passed": true,31"failure_reason": null32},33{34"object_field": "phone_number",35"error_code": null,36"friendly_name": "Phone Number",37"passed": true,38"failure_reason": null39}40],41"invalid": [],42"object_type": "starter_customer_profile_information",43"friendly_name": "Information",44"failure_reason": null,45"passed": true,46"requirement_friendly_name": "Starter Customer Profile Information",47"error_code": null,48"requirement_name": "starter_customer_profile_information"49},50{51"valid": [52{53"object_field": "address_sids",54"error_code": null,55"friendly_name": "address sids",56"passed": true,57"failure_reason": null58}59],60"invalid": [],61"object_type": "customer_profile_address",62"friendly_name": "Legal Company Address",63"failure_reason": null,64"passed": true,65"requirement_friendly_name": "Customer Profile Address",66"error_code": null,67"requirement_name": "customer_profile_address"68},69{70"valid": [71{72"object_field": "bundle_sid",73"error_code": null,74"friendly_name": "Supporting Bundle Status",75"passed": true,76"failure_reason": null77}78],79"invalid": [],80"object_type": "primary_customer_profile_type_business",81"friendly_name": "Primary Customer Profile Bundle",82"failure_reason": null,83"passed": true,84"requirement_friendly_name": "Primary Customer Profile",85"error_code": null,86"requirement_name": "primary_customer_profile"87}88]89}
Once you have evaluated the Starter Customer Profile against the Starter Customer Profile Policy and the response says that the profile is compliant, you are ready to submit the profile.
The Starter Customer Profile status
field has the following possible values:
When you first create the profile, it will be in the draft
state. To submit the profile for review, you update the profile's status to pending-review
via API request (the example of this request is below). The result of this API request will update the profile's status to in-review
(which you should see in the response to your API request), at which point you should move on to the next step in this walkthrough.
Proceed to the next step as soon as the Starter Customer Profile is in the in-review
state. Do not wait for it to be twilio-approved
. The Starter Customer Profile will only reach the twilio-approved
status when a Brand is successfully created and OTP-verified in the following section, so you must proceed in order for the Starter Customer Profile to be approved.
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();
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}
Which API? Trust Hub API
Once your Starter Customer Profile from the previous step is in_review
, you can create a new Sole Proprietor Trust Bundle for your customer, which you will then use to complete a Sole Proprietor Brand. The steps in this section are very similar to the ones you completed in Section 1, but you will provide different information about your customer here.
Similar to Step 1.1, fetch the Sole Proprietor A2P Trust Policy to help you determine if you are meeting all the requirements for your Trust Bundle before you submit it.
The Sole Proprietor A2P Trust Policy contains all of the fields you need to complete when creating a Sole Proprietor Trust Bundle. You can refer back to this throughout the registration process to ensure you are completing the necessary fields. When you have completed the Sole Proprietor Trust Bundle for this customer, you will submit it to be evaluated against this Trust Policy to ensure that it meets all requirements.
The SID for the Starter Customer Profile Policy is RN670d5d2e282a6130ae063b234b6019c8
.
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 fetchPolicies() {11const policy = await client.trusthub.v112.policies("RN670d5d2e282a6130ae063b234b6019c8")13.fetch();1415console.log(policy.sid);16}1718fetchPolicies();
1{2"url": "https://trusthub.twilio.com/v1/Policies/RN670d5d2e282a6130ae063b234b6019c8",3"requirements": {4"end_user": [5{6"url": "/EndUserTypes/sole_proprietor_information",7"fields": [8"brand_name",9"mobile_phone_number",10"vertical"11],12"type": "sole_proprietor_information",13"name": "Sole Proprietor Information",14"requirement_name": "sole_proprietor_information"15}16],17"supporting_trust_products": [],18"supporting_document": [19[]20],21"supporting_customer_profiles": [22{23"type": "starter_customer_profile_type_business",24"name": "Starter Customer Profile(isv customers) Proof",25"requirement_name": "customer_profile"26},27{28"type": "starter_customer_profile_type_direct_long_tail",29"name": "Starter Customer Profile(direct customers) Proof",30"requirement_name": "customer_profile"31}32]33},34"friendly_name": "Sole Proprietor TrustProduct",35"sid": "RN670d5d2e282a6130ae063b234b6019c8"36}
This Sole Proprietor A2P Trust Bundle contains information about your customer (from the profile you created above) and their Brand. You fill out some of the fields now, and attach more information to this Bundle in later steps. You will submit this Bundle for review in the last step of Section 2 of this walkthrough.
These are the parameters for the API request to create a Sole Proprietor A2P Trust Bundle:
Parameter | Valid Values |
---|---|
friendly_name | A string representing your customer's business name. This is an internal name for you to identify this Bundle for your customer. |
A string representing your customer's email address | |
policy_sid | The static A2P Messaging TrustHub Policy identifier. The hard-coded value is RN670d5d2e282a6130ae063b234b6019c8 . |
status_callback | The URL at which you would like to receive webhook requests about status updates to this Trust Bundle. See the Bundles Resource documentation for details on Twilio's request to your webhook. |
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 createTrustProduct() {11const trustProduct = await client.trusthub.v1.trustProducts.create({12email: "johndoe@example.com",13friendlyName: "John Doe Sole Proprietor A2P Trust Bundle",14policySid: "RN670d5d2e282a6130ae063b234b6019c8",15});1617console.log(trustProduct.sid);18}1920createTrustProduct();
1{2"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"policy_sid": "RN670d5d2e282a6130ae063b234b6019c8",5"friendly_name": "John Doe Sole Proprietor A2P Trust Bundle",6"status": "draft",7"email": "johndoe@example.com",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/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",13"links": {14"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",15"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",16"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"17},18"errors": null19}
You will use the SID from this new Sole Proprietor Trust Bundle you created (the SID begins with BU
) in a later step.
In this step, you provide information about your customer's brand name, their mobile number for their Sole Proprietor Brand verification, and optionally their business vertical.
In this step, you provide your customer's mobile number, which TCR will use to send a One Time Password (OTP) verification request. This must be a valid US or Canadian mobile number where the customer can be reached. This cannot be a number you've acquired from a CPaaS provider such as Twilio.
The customer will receive the OTP message when you submit the Brand for review in step 3. They must respond to the request within 24 hours, or else you will need to retrigger the OTP message using the optional step 3.2. Additionally, the OTP verification must be completed within 30 days of Brand registration. Please see step 3.1 for more details.
This mobile number can only be used a maximum of three times for Sole Proprietor A2P Brands. This includes if the customer has registered for a Sole Proprietor Brand with another vendor and has used the same mobile phone number. This limit is managed through TCR and not through Twilio.
Include the following parameters in your API request:
Parameter | Valid Values |
---|---|
attributes | An object containing your customer's business name (which is usually their first and last name, if they do not have a business name / DBA name), their mobile phone number, and optionally, their business vertical. Please see the note above about the importance of the customer's mobile phone number for verification. |
friendly_name | A string to identify this end user object for your customer |
type | The string sole_proprietor_information |
The attributes
object should look like this:
1{2"brand_name": "John Doe",3"vertical": "COMMUNICATION",4"mobile_phone_number": "+11234567890"5}6
The optional vertical
field describes the customer's business. It can be one of the following values:
POST
AL
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: {13brand_name: "John Doe",14vertical: "COMMUNICATION",15mobile_phone_number: "+11234567890",16},17friendlyName: "Sole Proprietor A2P Trust Bundle End User",18type: "sole_proprietor_information",19});2021console.log(endUser.sid);22}2324createEndUser();
1{2"date_updated": "2021-02-16T20:40:57Z",3"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "Sole Proprietor A2P Trust Bundle End User",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": "sole_proprietor_information"17}
You will use the SID from this new end-user you created (the SID begins with IT
) in the next step.
Attach the SIDs from the end-user object you created in step 2.3 and the Starter Customer Profile you created in step 1.2 to the Sole Proprietor Trust Bundle you created in step 2.2 (the SID for the Sole Proprietor Trust Bundle begins with BU
).
IT
.
BU
.
The Sole Proprietor A2P Bundle SID from step 2.2 is the path parameter for this request. The body of the request should contain one parameter, called object_sid
, which is the End-User Object SID from step 2.3. See the code sample below as an example.
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 createTrustProductEntityAssignment() {11const trustProductsEntityAssignment = await client.trusthub.v112.trustProducts("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.trustProductsEntityAssignments.create({14objectSid: "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",15});1617console.log(trustProductsEntityAssignment.sid);18}1920createTrustProductEntityAssignment();
1{2"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"trust_product_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"object_sid": "ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",6"date_created": "2019-07-31T02:34:41Z",7"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"8}
The Sole Proprietor A2P Bundle SID from step 2.2 is the path parameter for this request. The body of the request should contain one parameter, called object_sid
, which is the Starter Customer Profile Bundle SID from step 1.3. See the code sample below as an example.
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 createTrustProductEntityAssignment() {11const trustProductsEntityAssignment = await client.trusthub.v112.trustProducts("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.trustProductsEntityAssignments.create({14objectSid: "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",15});1617console.log(trustProductsEntityAssignment.sid);18}1920createTrustProductEntityAssignment();
1{2"sid": "BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"trust_product_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"object_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",6"date_created": "2019-07-31T02:34:41Z",7"url": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"8}
This step evaluates the Sole Proprietor A2P Trust Bundle against the Sole Proprietor A2P Trust Policy (which you fetched in step 2.1; the Sole Proprietor A2P Trust Policy has the SID RN670d5d2e282a6130ae063b234b6019c8
).
The Sole Proprietor Trust Bundle SID from step 2.2 is the path parameter for this request. The body of the request should contain one parameter, called policy_sid
, which is the hardcoded Policy SID RN670d5d2e282a6130ae063b234b6019c8
.
If your Sole Proprietor Trust Bundle is missing any required information, the response to the API request will indicate that those fields are not complete. You should go back and complete the missing fields from the previous steps.
If your Sole Proprietor Trust Bundle matches the expected Sole Proprietor Trust Policy, the response will indicate that the profile is compliant
and that you can move on to the next step.
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 createTrustProductEvaluation() {11const trustProductsEvaluation = await client.trusthub.v112.trustProducts("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.trustProductsEvaluations.create({14policySid: "RN670d5d2e282a6130ae063b234b6019c8",15});1617console.log(trustProductsEvaluation.sid);18}1920createTrustProductEvaluation();
1{2"sid": "ELaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"policy_sid": "RN670d5d2e282a6130ae063b234b6019c8",5"trust_product_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"status": "noncompliant",7"date_created": "2020-04-28T18:14:01Z",8"url": "https://trusthub.twilio.com/v1/TrustProducts/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}
Once you have evaluated the Sole Proprietor Trust Bundle against the Sole Proprietor Trust Policy and the response says that the profile is compliant, you are ready to submit the profile.
The Sole Proprietor Trust Bundle status
field has the following possible values:
When you first create the Trust Bundle, it will be in the draft
state. To submit the Trust Bundle for review, update the Bundle's status to pending-review
via API request (the example of this request is below). The result of this API request will update the profile's status to in-review
(which you should see in the response to your API request), at which point you should move on to the next step in this walkthrough.
You should proceed to the next step as soon as the Sole Proprietor A2P Trust Bundle is in the in-review
state. Do not wait for it to be twilio-approved
. The Starter Customer Profile and Sole Proprietor A2P Trust Bundle will only reach the twilio-approved
status when a Brand is successfully created and OTP-verified, and you should never wait for this status change.
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 updateTrustProduct() {11const trustProduct = await client.trusthub.v112.trustProducts("BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.update({ status: "pending-review" });1415console.log(trustProduct.sid);16}1718updateTrustProduct();
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/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",13"links": {14"trust_products_entity_assignments": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",15"trust_products_evaluations": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",16"trust_products_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/TrustProducts/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"17},18"errors": null19}
Which API? Messaging API
In this step, you will create a Sole Proprietor A2P Brand using the Customer Profile SID from step 1.2 and the Trust Bundle SID from step 2.2. You should have already submitted both of these objects for review in the previous steps, but you shouldn't wait for them to be approved before continuing.
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 createBrandRegistrations() {11const brandRegistration = await client.messaging.v1.brandRegistrations.create(12{13a2PProfileBundleSid: "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14brandType: "SOLE_PROPRIETOR",15customerProfileBundleSid: "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",16}17);1819console.log(brandRegistration.sid);20}2122createBrandRegistrations();
1{2"sid": "BN0044409f7e067e279523808d267e2d85",3"account_sid": "AC78e8e67fc0246521490fb9907fd0c165",4"customer_profile_bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",5"a2p_profile_bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"date_created": "2021-01-28T10:45:51Z",7"date_updated": "2021-01-28T10:45:51Z",8"brand_type": "SOLE_PROPRIETOR",9"status": "PENDING",10"tcr_id": "BXXXXXX",11"failure_reason": "Registration error",12"url": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85",13"brand_score": 42,14"brand_feedback": [15"TAX_ID",16"NONPROFIT"17],18"identity_status": "VERIFIED",19"russell_3000": true,20"government_entity": false,21"tax_exempt_status": "501c3",22"skip_automatic_sec_vet": false,23"errors": [],24"mock": false,25"links": {26"brand_vettings": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85/Vettings",27"brand_registration_otps": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85/SmsOtp"28}29}
You can set up and subscribe to Brand status Event Streams, so that an event message will be sent to a specified webhook URL when the new Brand has been successfully registered or has failed registration. Please see this guide for setting up the necessary Event Streams sinks and event subscriptions, and for information on reading each event message payload.
You can check the status of your customer's Sole Proprietor Brand registration with a GET
request. This should update within a few minutes after submitting the Sole Proprietor Brand API request from the step above.
The API will return the following information about the registration:
Property | Possible Values |
---|---|
status | PENDING , APPROVED , FAILED or SUSPENDED |
identity_status | UNVERIFIED or VERIFIED UNVERIFIED means that the customer has not verified the OTP request sent to their mobile number. This value will change from UNVERIFIED to VERIFIED after your customer successfully verifies the mobile number provided in Step 2.3 |
failure_reason | Only present if the status is FAILED . This describes the reason for the Brand registration failure. Possible reasons for failure and the resolutions are: —"Unable to fetch A2P Bundle Details, please check if the correct bundle sid was provided for registration and the bundle is compliant." -> Check Bundle Details and retry —"Unable to fetch Customer Profile Bundle details, please check if the correct bundle sid was provided for registration and the bundle is compliant." -> Check Bundle Details and retry —"Unable to register Brand with The Campaign Registry" -> review the registration requirements defined at the beginning of this document and ensure that your registration information is complete and meets the requirements (for additional information please see https://help.twilio.com/hc/en-us/articles/14488596590491-Why-did-my-Sole-Proprietor-Brand-Registration-Fail-.) Please verify that the supplied information is accurate and well-formed before contacting Twilio Support |
When the Sole Proprietor Brand first enters the APPROVED
state, the identity_status
will still be UNVERIFIED
. The change to the APPROVED
state triggers a new SMS OTP, which is sent to the mobile number registered with the Brand (from step 2.3). The OTP is valid for 24 hours. If your customer does not complete the OTP verification request after 24 hours, you can use this API to trigger a fresh OTP for verification.
The owner of the mobile number will receive a text message sent from +1(915)-278-2000 with the following text: "Please confirm your registration for US A2P Messaging by replying YES. Msg & data rates may apply."
The owner of the mobile number must reply "YES" back to the OTP message to complete Brand verification. Once they do that, they should receive another confirmation message on their mobile number that says "Thank you. Your registration has been confirmed." The Brand state will remain as APPROVED
, and their identity_status
will now change to VERIFIED
Note that only the first OTP is sent automatically; if your customer does not complete the OTP verification request within 24 hours, you need to send an API request to trigger a new OTP (see step 3.2 for the API request to retrigger this OTP). Additionally, please make every effort to ensure that your customer completes OTP verification within 30 days of Brand registration. At some point going forward, The Campaign Registry (TCR) may begin to enforce a 30-day limit for this OTP completion, after which the Brand registration would be marked as EXPIRED, and would need to be deleted and resubmitted (this documentation will be updated if and when TCR begins to enforce this).
You will need to wait until the Sole Proprietor Brand is approved and verified before moving on to Step 4.
If your Brand registration has FAILED
, or if it is APPROVED
but with a lower Trust Score than you feel your Brand merits, please see this Guide to Troubleshooting A2P Brands to understand and rectify specific Brand feedback.
The status of SUSPENDED
is rare. This status indicates that your Brand is deemed to have potentially violated one or more rules for Brand registration established by the A2P ecosystem partners. This status will require Twilio Support assistance to address. Please see the relevant section of our Troubleshooting guide for details.
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 fetchBrandRegistrations() {11const brandRegistration = await client.messaging.v112.brandRegistrations("BNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(brandRegistration.sid);16}1718fetchBrandRegistrations();
1{2"sid": "BNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"a2p_profile_bundle_sid": "BUbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",5"customer_profile_bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"status": "APPROVED",7"identity_status": "VERIFIED",8"brand_type": "SOLE_PROPRIETOR",9"mock": false,10"tcr_id": null,11"brand_score": null,12"russell_3000": null,13"brand_feedback": null,14"failure_reason": null,15"government_entity": null,16"tax_exempt_status": null,17"skip_automatic_sec_vet": false,18"errors": [],19"date_updated": "2023-03-15T14:21:42Z",20"date_created": "2023-03-15T14:21:42Z",21"url": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",22"links": {23"brand_vettings": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Vettings",24"brand_registration_otps": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SmsOtp"25}26}
The change from a Sole Proprietor's Brand to the APPROVED
state automatically triggers an SMS OTP, which is sent to the mobile number registered with the Brand. The OTP is valid for 24 hours. If your customer does not accept the OTP request after 24 hours, you can use this API to trigger a fresh OTP for verification.
This endpoint has a rate limit of 10 requests per second per 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 createBrandRegistrationOtp() {11const brandRegistrationOtp = await client.messaging.v112.brandRegistrations("BNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.brandRegistrationOtps.create();1415console.log(brandRegistrationOtp.accountSid);16}1718createBrandRegistrationOtp();
1{2"account_sid": "AC78e8e67fc0246521490fb9907fd0c165",3"brand_registration_sid": "BNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"4}
You can use the GET
API request from 3.1 to check the OTP verification status.
Which API? Messaging API
You do not need to complete this step if you have already created a Messaging Service for your customer.
Please note that for Sole Proprietor A2P 10DLC registrations, you should only have one 10DLC number in the Messaging Service. Sole Proprietor Campaigns can only have one 10DLC phone number attached to them.
In this step, you create a new Messaging Service for your customer. You can later add 10DLC numbers to this Messaging Service and attach the Service to a registered A2P Campaign.
See the documentation here about how to create a new Messaging Service via the API.
Which API? Messaging API
In this final step, you will create a new Sole Proprietor A2P SMS Campaign. Here, you describe what type of messages the customer is sending to end-users and how those end-users can opt in and out of these messages.
This Campaign can then be attached to a Messaging Service, and the A2P 10DLC numbers in that Messaging Service will be able to send verified A2P 10DLC traffic.
When you create a Campaign, you will need to indicate how end users opt-in and give consent to receive messages from this Campaign. You will also need to provide details about how end users can opt-out and receive help.
Top reasons for Campaign rejection, and how to avoid them:
Please see A2P 10DLC Campaign Approval Best Practices to ensure your Campaigns meet all requirements.
Most Twilio customers use Twilio's default or advanced opt-out features. If you use default or advanced opt-out, Twilio will automatically complete your Campaign's opt-out and help parameters with Twilio's default values or your customized advanced opt-out and help values.
For more information about all of the parameters within the Create Campaign API, see the full API documentation.
The API request takes the following parameters:
Parameter: brand_registration_sid
Description:
The A2P Brand Registration SID from Step 3
Parameter: description
Description:
This should be a fairly detailed description (one or several sentences) of what purpose this campaign serves. The description should provide an explanation of the campaign's objective or purpose: who the sender is, who the recipient is, and why messages are being sent to the intended recipient. Min length: 40 characters. Max length: 4096 characters. Example: "This Campaign will send weekly marketing messages about sales and offers from Acme Sandwich Company to end customers who have opted in"
Parameter: message_samples
Description:
An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. Give concrete examples of messages you would send in this Campaign. In the message, be sure to identify your Brand by name and/or website. Also, indicate with brackets [] any content that will be conditionalized. Example: "This is a message from the Acme Sandwich Company. Your order for [sandwich type, other item] will be delivered by [time] on [date]. If you have questions or would like to change your order schedule, please call 333-444-1212. If you would like to opt out of future notifications like this, text STOP in reply to this message."
Parameter: message_flow
Description:
Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. If a website is used for opting in, provide a link to the website. The website needs to have a privacy policy and terms of service. Privacy policies also need to include a statement of non-sharing for mobile numbers, message frequency, and "message and data rates may apply" disclosure. You need to provide a link to the policy. If this opt-in mechanism and other required information is not publicly accessible at the business website URL you have provided, please provide a URL with hosted screenshots of the relevant pages. Understanding the opt-in mechanism is critical to the acceptance of the Campaign by TCR. Example: "End users opt-in by visiting www.acmesandwich.com and adding their phone number. They then check a box agreeing to receive text messages from Acme Sandwiches. Additionally, end users can also opt-in by texting START to (111) 222-3333 to opt in. Term and Conditions at www.acmesandwich.com/tc. Privacy Policy at www.acmesandwich.com/privacy"
Parameter: us_app_to_person_usecase
Description:
SOLE_PROPRIETOR (there is only one valid use case for a Sole Proprietor Brand)
Parameter: has_embedded_links
Description:
Boolean. Indicates that this SMS campaign will send messages that contain URL links.
Parameter: has_embedded_phone
Description:
Boolean. Indicates that this SMS campaign will send messages that contain phone numbers.
Parameter: opt_in_message
(optional)
Description:
String. If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. Min length: 20 characters. Max length: 320 characters.
Parameter: opt_in_keywords
(optional)
Description:
An array of strings. If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. Max length: 255 characters.
Parameter: opt_out_message
(optional in certain cases, see description)
Description:
String. The message that an end-user receives when opting out of messages. Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Min length: 20 characters. Max length: 320 characters.
Parameter: opt_out_keywords
(optional in certain cases, see description)
Description:
An array of strings. The keywords that an end user can text to opt out of messaging. End users should be able to text in a keyword to stop receiving messages from this campaign. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. Max length: 255 characters.
Parameter: help_message
(optional in certain cases, see description)
Description:
String. The message that end users receive in response to a help keyword. When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum.
Parameter: help_keywords
(optional in certain cases, see description)
Description:
An array of strings. The keywords that an end user can text to receive help. End users should be able to text in a keyword to receive help. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. Max length: 255 characters.
Please note that the path
used in this Campaign creation call is the Messaging Service SID,
e.g. in Python,