Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this page
Looking for more inspiration?Visit the

A2P 10DLC Compliance Embeddable Onboarding Guide


(information)

Info


Compliance Embeddable

compliance-embeddable page anchor

With global regulatory requirements frequently changing across jurisdictions, navigating compliance is an expensive, ongoing challenge. Complex requirements lead to customer confusion and registration drop-offs, while maintaining internal compliance tooling consumes significant engineering resources. The Compliance Embeddable helps address these challenges by shifting the development and regulatory management burden away from your team, allowing you to scale onboarding effortlessly.

The Compliance Embeddable is a white-label, self-service solution designed to integrate seamlessly into an Independent Software Vendor's (ISV) existing portal or web application. It empowers your end customers to independently manage their registrations and verifications requests while Twilio manages the underlying registration workflow infrastructure.

No Twilio Branding: Twilio manages the UI logic and regulatory question flows behind the scenes, but the entire experience can be fully customized to match your platform's exact design, typography, and color palette. Request Theme: https://forms.gle/tvSuXpvwJE9aPj9B9

Minimize Manual Data Entry: When initializing the Compliance Inquiry, Twilio allows ISVs to pre-fill their customer data for an expedited registration experience.

Test With a Mock Brand: Set isTest to true when you initialize a brand inquiry to create a mock brand. A mock brand lets you test the full registration flow end to end without submitting real data to The Campaign Registry (TCR). Mock brands are auto-rejected without verification and can't be used for phone number purchases.

Skip Secondary Vetting: Set skipAutomaticSecVet to true to skip the message volume questions in the registration UI.

Pre-Submission Accuracy Check: Before submitting a campaign, your end customers can use the Check Campaign accuracy check on the Review and Submit screen to catch potential errors and improve their chances of carrier approval.

The Compliance Embeddable requires two integrations:

  1. Server-side integration: Call Twilio's API to initialize a Compliance Inquiry and retrieve a session token and inquiry ID.
  2. Client-side integration: Embed the UI in an iframe, and include the session token and inquiry ID as URL parameters.

All calls must be authenticated using Twilio's REST API credentials with Basic Auth, where the account SID is either your primary Twilio Account SID or a subaccount SID. The Account SID given in the credentials is the account that the registration will be associated with after completion of the ComplianceInquiry.

Learn more about the Compliance Embeddable in the Compliance Embeddable FAQ(link takes you to an external page)


Before you begin, you must have a Trust Hub Primary Customer Profile for a business whose Business Identity is set to ISV or Reseller. See Create a Trust Hub Primary Customer Profile to learn more.

Only ISV accounts with approved Trust Hub profiles can access the Compliance Embeddable API. Trial accounts are not eligible to use this API.


A2P 10DLC registration is a two-step process that requires both Brand Registration and Campaign Registration. The Compliance Embeddable supports this flow through two separate form submissions:

  1. Brand Registration: First, you initialize a brand inquiry to collect business information. This registers the brand with The Campaign Registry (TCR).
  2. Campaign Registration: After the brand is approved, you initialize a campaign inquiry to register specific messaging campaigns under that brand.

The Compliance Embeddable supports both steps by separately calling the Initialize Inquiry API in your workflow twice:

  • Once to initialize the brand registration inquiry
  • A second time to initialize the campaign registration inquiry after the initial brand approval

Registration states

registration-states page anchor

A brand or campaign registration moves through the following states. What you can do with a registration, including whether the Compliance Embeddable will let you resume or resubmit it, depends on its current state:

  • Draft: The registration has been started but not yet submitted for review. You can resume a draft registration to pick up where your end customer left off.
  • In progress: The registration has been submitted and is under review by Twilio or The Campaign Registry (TCR). It can't be resumed or resubmitted while in this state.
  • Approved: The registration passed review. It can't be resubmitted.
  • Rejected: The registration failed review for a correctable reason. You can resubmit a rejected registration with corrected information.

The Compliance Embeddable's data collection process is secured via server-side authentication and is triggered by a server-side API call. This API call initializes a ComplianceInquiry and returns a token, which you can then pass to your web client to authenticate into a submission flow.

The Compliance Embeddable supports three flows: starting a new registration, resuming a draft registration, and resubmitting a rejected registration. If a registration is already in progress, approved, or rejected with an error that can't be resubmitted, the API returns an error response. See the Error responses table for details.


Create Brand by initializing ComplianceInquiry

create-brand-by-initializing-complianceinquiry page anchor

To initialize a ComplianceInquiry for A2P 10DLC Brand registration, make an HTTPS request to the following API:

POST https://trusthub.twilio.com/v1/A2PBrandRegistrations

Brand Request Body

brand-request-body page anchor

If you provide data for optional fields, they're pre-filled in any of your users' subsequent forms. The body must use the application/json content type.

FieldField typeField SpecificsDescription
brandType [required]EnumAllowed Values: STANDARD, SOLE_PROPRIETORA SOLE_PROPRIETOR is an unregistered individual with strict messaging limits and no EIN, while a STANDARD Business is a legally registered entity with an EIN that unlocks high-volume, high-throughput messaging capabilities.
friendlyName [required]StringMax length: 255A descriptive name for this brand or campaign registration inquiry.
notificationEmail [required]StringEmail regex. Max length: 500The email address to which all notifications for the status of the registration will be sent.
themeSetId [optional]StringMax length: 255Theme ID for customized UI styling. To request a customized Theme, follow the instructions in our FAQ(link takes you to an external page).
businessName [optional]StringMax length: 255The name of the business or organization using the phone number.
businessRegistrationAuthority [opt]StringAllowed Values: TBDThe authority that issued the business registration. For US businesses, this is typically EIN. Required for all business types except SOLE_PROPRIETOR.
businessRegistrationNumber [opt]StringMax length: 21A legally recognized business registration number such as an EIN. Required for all business types except SOLE_PROPRIETOR.
businessIndustry [optional]EnumAllowed Values: AGRICULTURE, AUTOMOTIVE, BANKING, COMMUNICATION, CONSTRUCTION, CONSUMER, EDUCATION, ELECTRONICS, ENERGY, ENGINEERING, FAST_MOVING_CONSUMER_GOODS, FINANCIAL, FINTECH, FOOD_AND_BEVERAGE, GAMBLING, GOVERNMENT, HEALTHCARE, HOSPITALITY, INSURANCE, JEWELRY, LEGAL, MANUFACTURING, MEDIA, NOT_FOR_PROFIT, OIL_AND_GAS, ONLINE, PROFESSIONAL_SERVICES, RAW_MATERIALS, REAL_ESTATE, RELIGION, RETAIL, TECHNOLOGY, TELECOMMUNICATIONS, TRANSPORTATION, TRAVEL
businessWebsite [optional]StringURL regex (https://). Max length: 255The website of the business or organization using the phone number.
brandType [required]EnumAllowed Values: PRIVATE_PROFIT, PUBLIC_PROFIT, NON_PROFIT, SOLE_PROPRIETOR, GOVERNMENT
brandExternalVettingToken [opt]StringMax length: 10The unique vetting token from the vetting provider. The token is case sensitive and must match the format provided by the vetting provider exactly.
businessStockSymbol [optional]StringMax length: 10The unique publicly traded company or organization stock or ticker symbol
businessIndustry [optional]EnumAllowed Values: AMEX, AMX, ASX, B3, BME, BSE, FRA, ICEX, JPX, JSE, KRX, LON, NASDAQ, NONE, NYSE, NSE, OMX, OTHER, SEHK, SGX, SSE, STO, SWX, SZSE, TSX, TWSE, VSE
businessTaxExemptStatus [optional]BooleanAllowed Values: TRUE, FALSEA value of true will mark the business as excempt from local government taxes.
businessStreetAddress [optional]StringMax length: 100The address of the business or organization using the phone number.
businessStreetAddress2 [optional]StringMax length: 100The second row of the street address of the business or organization using the phone number.
businessCity [optional]StringMax length: 100The city of the business or organization using the phone number.
businessStateProvinceRegion [opt]StringMax length: 20The state/province or region of the business or organization using the phone number.
businessPostalCode [optional]StringMax length: 10The postal code of the business or organization using the phone number.
businessCountry [optional]StringMax length: 2The ISO country code of the business or organization using the phone number.
businessContactFirstName [opt]StringMax length: 100The first name of the contact for the business or organization using the phone number.
businessContactLastName [opt]StringMax length: 100The last name of the contact for the business or organization using the phone number.
businessContactEmail [optional]StringEmail regex. Max length: 100The email address of the contact for the business or organization using the phone number.
businessContactPhone [optional]StringE.164 regex. Max length: 20The phone number of the contact for the business or organization using the phone number.
authorizedContactVerificationEmail [opt]StringEmail regex. Max length: 255The first and last name of the designated representative for the business or organization.
authorizedContactMobilePhoneNumberE164 [opt]StringE.164 regex. Max length: 20The phone number of the designated representative for the business or organization.
isTest [optional]BooleanAllowed Values: TRUE, FALSEA value of true will mark the bundle as a test bundle. The test bundle will be auto-rejected without verification and cannot be used for phone number purchases. If this field is not provided, by default the bundle will NOT be created as a test bundle
skipAutomaticSecVet [optional]BooleanAllowed Values: TRUE, FALSEA value of true skips the message volume questions in UI
Example Brand Inquiry Initialize Call
example-brand-inquiry-initialize-call page anchor
1
curl -X POST https://trusthub.twilio.com/v1/A2PBrandRegistrations \
2
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token \
3
-H "Content-Type: application/json" \
4
-d '{
5
"brandType": "STANDARD",
6
"customerProfileId": "BU1213242784782",
7
"friendlyName": "Acme Corp",
8
"themeSetId": "theme_abc123",
9
"notificationEmail": "notify@example.com",
10
"businessName": "Acme Corp",
11
"businessRegistrationAuthority": "EIN",
12
"businessRegistrationNumber": "123456789",
13
"businessIndustry": "TECHNOLOGY",
14
"businessWebsite": "https://acme.com",
15
"businessType": "PRIVATE_PROFIT",
16
"businessStockSymbol": "TWLO",
17
"businessStockExchange": "NYSE",
18
"businessTaxExemptStatus": false,
19
"businessStreetAddress": "123 Main St",
20
"businessStreetAddress2": "Suite 100",
21
"businessCity": "San Francisco",
22
"businessStateProvinceRegion": "CA",
23
"businessPostalCode": "94105",
24
"businessCountry": "US",
25
"businessContactFirstName": "Jane",
26
"businessContactLastName": "Doe",
27
"businessContactEmail": "jane@acme.com",
28
"businessContactPhone": "+14155551234",
29
"authorizedContactVerificationEmail": "verification@example.com",
30
"authorizedContactMobilePhoneNumberE164": "+14333045678",
31
"brandExternalVettingToken": "cv|10dlctcr|...",
32
"isTest": true,
33
"skipAutomaticSecVet": true
34
}'

Output

1
{
2
"id": "tri1.us1.account.AC238276e6.registration.BU6469a51f",
3
"sessionId": "inq_XXXXXXXXXXXXXXXXXXXXXXXX",
4
"sessionToken": "eyJhbGciOiJIUzI1NiIs..."
5
}

Resuming brand registration

resuming-brand-registration page anchor

Use the same EmbeddedSessions endpoint whether you're resuming a draft brand registration or resubmitting one that was rejected. When resubmitting a rejected brand, the embedded UI shows your end customer a user-friendly rejection reason and walks them through correcting it.

POST https://trusthub.twilio.com/v1/A2PBrandRegistrations/{id}/EmbeddedSessions

The value for id is tri1.us1.account.(AccountSID).registration.(BrandBundleSID)

To look up a brand's rejection state and reason directly through the API instead of through the embedded UI, see the Brand Registration API docs.

  • To retrieve a list of all A2P 10DLC registrations, including their Bundle SIDs, make an HTTPS request to the following API:

GET https://messaging.twilio.com/v1/a2p/BrandRegistrations

You can also find the brand by using the Bundle SID (BU###) returned in the Initialize ComplianceInquiry response, by passing it as the A2PProfileBundleSid query parameter:

1
curl -X GET "https://messaging.twilio.com/v1/a2p/BrandRegistrations?A2PProfileBundleSid=[BU_SID]" \
2
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token

To learn more about query parameters for filtering results, see the Brand Registration API docs.

Set skipAutomaticSecVet to true to skip the secondary vet questions in the registration UI.

What is Secondary Vet? Secondary vet is the step in brand registration that determines how a given brand is vetted. It is not just a volume question: it controls several downstream outcomes for the brand:

  • Brand type: Determines whether the brand is registered as Standard or Low Volume Standard.
  • Fee: Determines the registration fee charged for the brand.
  • Volume thresholds: Determines the message volume thresholds applied to the brand (e.g., the 6,000 segment/day and 2,000/day T-Mobile limits).

Before you skip: Secondary vet may be required for certain industries or campaign types, independent of this setting. If you set skipAutomaticSecVet to true, you are responsible for ensuring your end-to-end registration flow still assigns the correct brand type, fee, and volume threshold for the brand. Skipping the question does not remove these requirements, it only removes the prompt.

How Brand Type Is Determined

how-brand-type-is-determined page anchor
Setting Brand TypeEmbed ActionOutcome
SOLE_PROPRIETORNo EIN requestedAutomatically assigned to Low Volume
STANDARDEIN requestedUser manually selects Low Volume or Standard in the embed flow
STANDARDISV skips the Embed Volume page (skipAutomaticSecVet = true)Automatically submitted as Low Volume Standard

Create Campaign by initializing ComplianceInquiry

create-campaign-by-initializing-complianceinquiry page anchor

To initialize a ComplianceInquiry for A2P 10DLC Campaign registration, make an HTTPS request to the following API:

POST https://trusthub.twilio.com/v1/A2PCampaignRegistrations

If you provide data for optional fields, they're pre-filled in any of your users' subsequent forms.

The body must use the application/json content type.

FieldField typeField SpecificsDescription
a2pBrandRegistrationSid [required]StringBN SIDThe Brand Registration SID from the approved brand registration.
messagingServiceSid [required]StringMG SIDThe Messaging Service SID to associate with this campaign. Best Practice is to create and save the MG SID: because a campaign's Bundle SID is removed once the campaign is created, you need the Messaging Service SID to resume, resubmit, or check the status of the campaign afterward.
themeSetId [optional]StringMax length: 255Theme ID for customized UI styling. To request a customized Theme, follow the instructions in our FAQ(link takes you to an external page).
useCaseCategories [optional]EnumAllowed Values: 2FA, ACCOUNT_NOTIFICATION, AGENTS_FRANCHISES, CARRIER_EXEMPT, CHARITY, CUSTOMER_CARE, DELIVERY_NOTIFICATION, EMERGENCY, FRAUD_ALERT, HIGHER_EDUCATION, K12_EDUCATION, MARKETING, MIXED, POLITICAL, POLLING_VOTING, PROXY, PUBLIC_SERVICE_ANNOUNCEMENT, SECURITY_ALERT, SOCIAL, SWEEPSTAKEThe category that best describes the use case for this campaign.
useCaseDescription [optional]StringMin Length: 40 Max length: 4096Detailed description of the campaign's messaging use case.
useCaseSampleMessage1 [optional]StringMin Length: 40 Max length: 1024First sample message demonstrating typical message content for this campaign.
useCaseSampleMessage2 [optional]StringMin Length: 40 Max length: 1024Second sample message demonstrating typical message content for this campaign.
useCaseSampleMessage3 [optional]StringMin Length: 40 Max length: 1024Third sample message demonstrating typical message content for this campaign.
useCaseSampleMessage4 [optional]StringMin Length: 40 Max length: 1024Fourth sample message demonstrating typical message content for this campaign.
useCaseSampleMessage5 [optional]StringMin Length: 40 Max length: 1024Fifth sample message demonstrating typical message content for this campaign.
useCaseCategories [optional]EnumAllowed Values: VERBAL, WEB_FORM, PAPER_FORM, VIA_TEXT, MOBILE_QR_CODEThe method by which end users opt-in to receive messages.
useCaseOptInDescription [optional]StringMin Length: 40 Max length: 2048Description of how end users opt-in to receive messages from this campaign.
hasEmbeddedLinks [optional]BooleanAllowed Values: TRUE, FALSEA value of true indicates that messages will include embedded links.
hasEmbeddedPhone [optional]BooleanAllowed Values: TRUE, FALSEA value of true indicates that messages will include embedded phone numbers.
embeddedUrlSample [optional]StringURL regex (https://). Max length: 255Sample URLs that will be embedded in messages.
directLending [optional]BooleanAllowed Values: TRUE, FALSEA value of true indicates this campaign involves direct lending or loan arrangements.
ageGated [optional]BooleanAllowed Values: TRUE, FALSEA value of true indicates this campaign has age restrictions.
privacyPolicyUrl [optional]StringURL regex (https://). Max length: 2048URL to the privacy policy applicable to this messaging campaign.
termsAndConditionsUrl [optional]StringURL regex (https://). Max length: 2048URL to the terms and conditions applicable to this messaging campaign.
optInKeywords [optional]StringMax length: 255Keywords that users can send to opt-in to messages.
optInMessageSample [optional]Array of StringsMin Length: 20 Max length: 1024Sample message sent to users after they opt-in.
optOutKeywords [optional]Array of StringsMax length: 255Keywords that users can send to opt-out of messages.
optOutMessageSample [optional]StringMin Length: 20 Max length: 1024Sample message sent to users after they opt-out.
helpKeywords [optional]Array of StringsMax length: 255Keywords that users can send to request help.
helpMessageSample [optional]StringMin Length: 20 Max length: 1024Sample message sent to users when they request help.
Example Campaign Inquiry Initialize Call
example-campaign-inquiry-initialize-call page anchor

a2pBrandRegistrationSid and messagingServiceSid are required. The remaining fields are optional and, if provided, pre-fill your end customer's form.

1
curl -X POST https://trusthub.twilio.com/v1/A2PCampaignRegistrations \
2
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token \
3
-H "Content-Type: application/json" \
4
-d '{
5
"a2pBrandRegistrationSid": "BN01cab0515ca623fc3d3bc9ee0879b50f",
6
"messagingServiceSid": "MG12345678901234567890123456789000",
7
"themeSetId": "theme_abc123",
8
"useCaseCategories": ["ACCOUNT_NOTIFICATIONS", "CUSTOMER_CARE"],
9
"useCaseDescription": "Order status updates and customer support responses",
10
"useCaseSampleMessage1": "Hi Jane, your order #4821 has shipped and will arrive by Thursday. Track at acme.com/track/4821",
11
"useCaseSampleMessage2": "Hi Jane, your order #4821 has shipped and will arrive by Thursday. Track at acme.com/track/4821",
12
"useCaseSampleMessage3": "Hi Jane, your order #4821 has shipped and will arrive by Thursday. Track at acme.com/track/4821",
13
"useCaseSampleMessage4": "Hi Jane, your order #4821 has shipped and will arrive by Thursday. Track at acme.com/track/4821",
14
"useCaseSampleMessage5": "Hi Jane, your order #4821 has shipped and will arrive by Thursday. Track at acme.com/track/4821",
15
"useCaseOptInTypes": ["WEB_FORM"],
16
"useCaseOptInDescription": "End users opt-in by visiting www.acme.com and adding their phone number. They then check a box agreeing to receive text messages from Acme, Inc. Additionally, end users can also opt-in by texting START to (111) 555-3333 to opt in. Terms and Conditions at www.acme.com/tc. Privacy Policy at www.acme.com/privacy.",
17
"hasEmbeddedLinks": false,
18
"hasEmbeddedPhone": false,
19
"embeddedUrlSample": "https://acme.com/privacy",
20
"directLending": false,
21
"ageGated": false,
22
"privacyPolicyUrl": "https://acme.com/privacy",
23
"termsAndConditionsUrl": "https://acme.com/terms",
24
"optInKeywords": ["START", "SUBSCRIBE"],
25
"optInMessageSample": "For help, visit acme.com/support or call 1-800-555-0123. Reply STOP to opt out.",
26
"optOutKeywords": ["START", "SUBSCRIBE"],
27
"optOutMessageSample": "For help, visit acme.com/support or call 1-800-555-0123. Reply STOP to opt out.",
28
"helpKeywords": ["START", "SUBSCRIBE"],
29
"helpMessageSample": "For help, visit acme.com/support or call 1-800-555-0123. Reply STOP to opt out."
30
}'

Output

1
{
2
"id": "tri1.us1.account.AC238276e6.registration.BU6469a51f",
3
"sessionId": "inq_XXXXXXXXXXXXXXXXXXXXXXXX",
4
"sessionToken": "eyJhbGciOiJIUzI1NiIs..."
5
}

Campaign registrations can be resumed while still in draft, or resubmitted after a rejection. Which endpoint you use depends on the campaign's state: once a campaign is created, Twilio removes its Bundle SID, so you can no longer reference it that way.

Resume a draft campaign registration

resume-a-draft-campaign-registration page anchor

If your end customer hasn't finished submitting the campaign yet, resume the draft using its Bundle SID:

POST https://trusthub.twilio.com/v1/A2PCampaignRegistrations/tri1.us1.account.{AccountSID}.registration.{BundleSID}/EmbeddedSessions

Resubmit a rejected campaign registration

resubmit-a-rejected-campaign-registration page anchor

Once a campaign is created, its Bundle SID is removed, so you can't use the format above to resubmit a rejected campaign. Instead, use the campaign's Messaging Service SID:

POST https://trusthub.twilio.com/v1/A2PCampaignRegistrations/{MessagingServiceSid}/EmbeddedSessions

The embedded UI shows your end customer a user-friendly rejection reason and walks them through resubmission. To check the rejection reason yourself before resubmitting, see Check campaign status and rejection reason below. This is also why messagingServiceSid is a required field when you initialize a campaign registration: save it so you can resume, resubmit, or check on the campaign later.

Check campaign status and rejection reason

check-campaign-status-and-rejection-reason page anchor

Use the campaign's Messaging Service SID to fetch its current status and, if it was rejected, the reason:

GET https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p

This endpoint returns the following details for the campaign associated with that Messaging Service:

  • sid
  • campaign_status (for example, IN_PROGRESS, VERIFIED, or FAILED)
  • failure_reason (if any)
Status CodeReasonTrigger
400"Campaign prefill fields are not allowed"Request includes prefill fields (keywords, description, sample messages, etc.) but the caller is NOT an API customer (missing/wrong T-Edge or T-Actor headers).
400Validation failureAny prefill field fails validation, for example useCaseDescription too short/long, invalid useCaseCategories values, keywords exceed max joined length, URLs don't start with https://, invalid useCaseOptInTypes, message samples outside length bounds.
400"useCaseCategories contains values not qualified for this brand"API customer provides useCaseCategories that aren't in the brand's qualified use-case list.
400"A campaign already exists for messaging service MGsid"A messagingServiceSid was provided but that messaging service already has a registered campaign.
400Downstream 404 mapped to 400A downstream service returns 404 (for example, brand registration not found). The error handler maps both 400 and 404 from ClientException to a 400 response.
403Feature not enabledThe API_A2P_EMBEDDABLE_V2_ENABLED feature flag is not enabled for the account (and the account is not a OneConsole account). Message: "A2P Embeddable V2 is not enabled for this account".
401Downstream unauthorizedA downstream service returns a 401 (propagated through handleCampaignInitializationError).
500Campaign existence check failureThe call to verify no campaign exists for the messaging service fails with a non-400/non-404 error.
500Too many Persona sessionsPersonaTooManySessionsException. Persona rate-limits session creation.
500Any other unexpected exceptionGeneric catch-all in handleCampaignInitializationError.

Track your A2P registration status automatically with Twilio Event Streams. You can now get instant webhook notifications for any changes to your Brands, Campaigns, or 10DLC numbers without having to manually poll APIs or refresh the console. To learn more, see the Event Streams docs.


After initializing a ComplianceInquiry, you may embed the ComplianceInquiry UI in your website using the TwilioComplianceEmbed React client.

Install the package in your React project using your preferred package manager.

NPM:

npm install @twilio/twilio-compliance-embed

Yarn:

yarn add @twilio/twilio-compliance-embed

The ComplianceInquiry UI can be embedded in your site using following code snippet:

1
import * as React from "react";
2
import { TwilioComplianceEmbed } from "@twilio/twilio-compliance-embed";
3
4
const ComplianceInquiry = () => {
5
return (
6
<TwilioComplianceEmbed
7
inquiryId='<your inquiry ID from calling the Initialize ComplianceInquiry API>'
8
inquirySessionToken='<your inquiry session token from calling the Initialize ComplianceInquiry API>'
9
/>
10
);
11
};

The ComplianceInquiry UI may take a few seconds to load and render.

NameTypeDescription
inquiryId(Required) StringA valid inquiryId returned by calling the Initialize ComplianceInquiry API.
inquirySessionToken(Required) StringA valid inquirySessionToken returned by calling the Initialize ComplianceInquiry API.
onInquirySubmitted() => voidAn event handler that fires when the user has completed the ComplianceInquiry process. This event is fired when the user lands on the last screen.
onComplete() => voidAn event handler that fires when a user completes the ComplianceInquiry process. This event is fired when the user clicks the Done or Exit button on the last page. Note: This event is not guaranteed to be fired as the user could choose not to click the button on the last page. If you wish to track when a user has finished the flow and submitted the bundle, use onInquirySubmitted instead.
onCancel() => voidAn event handler that fires when the user has canceled the ComplianceInquiry process.
onError() => voidAn event handler that fires when an unexpected error occurs during the ComplianceInquiry process.
onReady() => voidAn event handler that fires when the ComplianceInquiry UI has finished loading.
widgetPadding{ top?: number; bottom?: number; left?: number; right?: number; }Allows customizing the internal padding inside the iframe. If you omit the property, the component applies the default padding: {top: 74, left: 24, right: 24, bottom: 24}. The value should be an object with the following structure: {top?: number; bottom?: number; left?: number; right?: number;}
1
import * as React from "react";
2
import { Spinner } from "@twilio-paste/core/spinner";
3
import { TwilioComplianceEmbed } from "@twilio/twilio-compliance-embed";
4
5
function MyComplianceInquiry() {
6
const [data, setData] = React.useState(null);
7
const [isLoading, setLoading] = React.useState(true);
8
9
React.useEffect(() => {
10
fetch("https://trusthub.twilio.com/v1/ComplianceInquiries/Tollfree/Initialize", {
11
method: "POST",
12
})
13
.then((res) => res.json())
14
.then((data) => {
15
setData(data);
16
setLoading(false);
17
});
18
}, []);
19
20
return !isLoading ? (
21
<TwilioComplianceEmbed
22
inquiryId={data.inquiry_id}
23
sessionToken={data.inquiry_session_token}
24
onReady={() => {
25
console.log("Ready!");
26
}}
27
onInquirySubmitted={() => {
28
console.log("Registration complete");
29
}}
30
widgetPadding={{top: 0, left: 100, right: 100, bottom: 0}}
31
/>
32
) : (
33
<Spinner decorative={false} title="Loading" />
34
);
35
}
36
37
export default MyComplianceInquiry;

A React and JS SDK is available for teams who want to integrate registration directly into their own framework instead of using the hosted page.

The SDK is not yet publicly released. If you want to integrate outside of the hosted page, contact us(link takes you to an external page) for access.