Skip to contentSkip to navigationSkip to topbar
On this page

WhatsApp Tech Provider program integration guide


By the end of this guide, your customers will onboard to the WhatsApp Business Platform directly in your application using Embedded Signup. You'll create a Meta app and become a WhatsApp Tech Provider, add the Twilio Partner Solution, and integrate Embedded Signup into your application.


Prerequisites

prerequisites page anchor

Complete the following prerequisites before becoming a Tech Provider and integrating your application with WhatsApp and Twilio.

  • Create a Meta business portfolio.

    If you don't have a Meta business portfolio, go to business.facebook.com(link takes you to an external page) and create a Meta Business Suite account using your Facebook credentials.

  • Register a WhatsApp sender for your ISV using Self Sign-up.

    Create a WhatsApp sender for your company using WhatsApp Self Sign-up. Creating a WhatsApp sender makes your Meta Business Portfolio eligible for verification by Meta, and allows you to create templates and send or receive messages on WhatsApp for your own company.

  • Fill out the Twilio WhatsApp Tech Provider program request form.

    You must notify Twilio that you're becoming a WhatsApp Tech Provider. Fill out our WhatsApp Tech Provider program request form(link takes you to an external page).

    After you fill out the form, continue with the next steps in this guide. Twilio will do the following:

    • Within 5 business days: the Twilio Channel Operations team creates a support ticket to guide you through the process. Use this ticket for all communications with Twilio during Tech Provider onboarding.
    • Later in the process: Twilio sends you a Partner Solution request to accept in Meta's app dashboard.
    (information)

    Get help with Tech provider onboarding and WhatsApp integration

    The Twilio Channel Operations team can help you integrate with WhatsApp. Contact us through the support ticket created when you submitted the WhatsApp Tech Provider program request form(link takes you to an external page).

  • Turn on two-factor authentication and complete business verification.

    To participate in the Tech Provider program you need to turn on two-factor authentication (2FA) and complete business verification in your Meta Business Manager settings.


Part 1: Become a Tech Provider

part-1-become-a-tech-provider page anchor

Register as a Meta Developer, create and configure your app, and submit your app for review.

Register as a Meta Developer

register-as-a-meta-developer page anchor

If you haven't created a Meta app before, you need to register as a Meta Developer. For more information, see Meta's Register as a Meta Developer(link takes you to an external page) documentation.

Create a new Meta app. Don't reuse an existing app.

  1. Log in to your Meta Developers account.

  2. On the Apps(link takes you to an external page) page, click Create App.

  3. Under App details, enter the App name and an App contact email.

    Your Meta app name and business portfolio name are visible to your customers when they go through Embedded Signup. Don't include Meta's trademarks, such as "WhatsApp", in the app name.

  4. Under Use cases, select Other.

  5. Under Type, select Business.

  6. Under Details, validate that the app name and app contact email are correct, and select your company's Business portfolio.

  7. Click Create app.

You end up at the App Dashboard for your new app.

  1. In the App Dashboard, go to App settings > Basic.

  2. Add the following information:

    • Your App Icon, which can be your company's logo. Your customers see the icon when onboarding to WhatsApp.
      • Don't use any Meta logos or trademarks on the icon. For example, don't use "WA" or "WhatsApp".
    • A URL to your company's privacy policy. Your customers can access the link when onboarding to WhatsApp.
    • A category that best represents your app or business.
  3. Click Add Platform.

  4. Specify the platform you're using. Ignore the testing instructions section.

  5. Save your changes.

Add the WhatsApp product to your app

add-the-whatsapp-product-to-your-app page anchor

Add WhatsApp to your app.

  1. In the App Dashboard, find the WhatsApp card and click Set Up.

  2. Complete the flow until you get to the Quickstart panel.

Onboard as a Tech Provider

onboard-as-a-tech-provider page anchor
  1. In the App Dashboard, go to WhatsApp > Quickstart.
  2. Under Scale your Business, in the Become a Tech Provider card, click Start onboarding.
  3. Read and accept Meta's Tech Provider Terms(link takes you to an external page) and any other associated terms from Meta.
  4. On the next screen, select Independent Tech Provider and click Start onboarding.

The Quickstart > Onboarding panel guides you through the rest of the process to become a Tech Provider.

To return to the Quickstart > Onboarding panel anytime during onboarding, follow these steps:

  1. In the App Dashboard, go to WhatsApp > Quickstart.
  2. Under Scale your Business, in the Become a Tech Provider card, click Start onboarding or Continue onboarding.

Review your app settings

review-your-app-settings page anchor

Review your app settings and provide any missing information.

  1. In the Quickstart > Onboarding panel, find the Review your app settings row and click Review app settings.
  2. Confirm that the information you supplied is accurate and update if necessary.

Record your screen for app review

record-your-screen-for-app-review page anchor

As part of the App Review process you need to provide screen recordings that show creating a message template and sending a message from your app to a WhatsApp number.

To view information about creating videos for app review, go to the Quickstart > Onboarding panel, find the Record video documentation row and click Record video. Note that the Record video button provides only information and doesn't record anything for you. You'll need to make the recordings yourself.

You must record your screen (no audio) showing the following actions:

  • To request the whatsapp_business_messaging permission, send a WhatsApp message from your app to a WhatsApp number. The recording must show your app sending the message and the WhatsApp interface (either web or mobile app) receiving the message.
  • To request the whatsapp_business_management permission, create a WhatsApp template for your use case.

You can record your screen using one of the following methods:

Save the recording files for upload in a later step.

Select access permissions

select-access-permissions page anchor
  1. In the App Dashboard, go to App Review > Permissions and Features.

  2. Request advanced access for the whatsapp_business_messaging and whatsapp_business_management permissions.

    1. In the list of permissions and features, search for the permission.
    2. Click Request advanced access.

    Note: The public_profile permission is granted automatically when you create your Meta app.

  3. Click Continue request.

    The App Review > Requests page opens.

Prepare and submit for App Review

prepare-and-submit-for-app-review page anchor

You can work on your App Review submission and return to edit it at any time before submission.

  1. In the App Dashboard, go to App Review > Requests.
  2. Review the list of permissions under New requests. You should have whatsapp_business_messaging and whatsapp_business_management.
  3. Click Next.

The checklist interface for App Review requirements opens. Verification and App settings should be marked as done, since you completed them in previous steps.

Answer data handling questions

answer-data-handling-questions page anchor
(warning)

Data Handling questions guidance

Neither Twilio nor Meta can provide guidance on answering data handling questions for your organization. Consult legal, policy, and data handling experts within your organization for guidance on how to answer these questions.

  1. In the App Dashboard, go to App Review > Requests.

  2. Click Next to open your in-progress submission.

  3. In the Data handling questions card, click the right arrow icon and provide all of the requested information.

    For answers to frequently asked questions about the data handling questions process, see Meta's Data Handling Questions FAQs(link takes you to an external page).

  4. In the card asking How will this app use whatsapp_business_messaging?, click the right arrow icon and provide all of the requested information, including the screen recording you created in Record your screen for app review.

  5. In the card asking How will this app use whatsapp_business_management?, click the right arrow icon and provide all of the requested information, including the screen recording you created in Record your screen for app review.

  6. Click Next or Back to submission.

Your answers are saved and you can return to edit them anytime before submitting for App Review.

Add reviewer instructions

add-reviewer-instructions page anchor
  1. In the App Dashboard, go to App Review > Requests.
  2. Click Next to open your in-progress submission.
  3. Expand the Reviewer instructions card and click Provide reviewer instructions.
(information)

Info

If you're prompted to add a platform, go back and complete the steps in the Add app details section.

  1. For each platform your application uses, in the box where you're prompted to provide instructions, paste the following text:

    We are applying to become a WhatsApp Tech Provider. We will be submitting videos for the whatsapp_business_messaging and whatsapp_business_management permissions.
  2. Click Done.

When all the App Review checklist items are marked done, you can submit for App Review.

  1. In the App Dashboard, go to App Review > Requests.
  2. Click Next to open your in-progress submission.
  3. Make sure that all the checklist items are marked as done.
  4. Click Submit for Review.
  5. Inform Twilio that you've submitted your App to Meta using the support ticket created when you submitted the WhatsApp Tech Provider program request form.

After Meta reviews your App, you'll receive an email and an alert in your App Dashboard. To review the submission results, go to Alerts > Inbox.

Complete Access Verification

complete-access-verification page anchor

After Meta approves your app, complete Meta's Access Verification to verify that your business is a Tech Provider.

  1. In the App Dashboard, go to App Settings > Basic.
  2. Under Access verification, click Start verification.
  3. Fill out the Access Verification information.
  4. Click Submit.

Meta typically takes 5 business days to complete Access Verification. If Access Verification takes longer than expected, inform Twilio using the support ticket created when you submitted the WhatsApp Tech Provider program request form.


Part 2. Connect your Meta app to the Twilio Partner Solution

part-2-connect-your-meta-app-to-the-twilio-partner-solution page anchor

For Meta to grant Twilio access to the WhatsApp Business Accounts (WABAs) of your customers, you need to accept the Twilio Partner Solution for your app.

Submit your Meta app ID to Twilio

submit-your-meta-app-id-to-twilio page anchor
  1. In the App Dashboard, update your App Mode to Live. Your App must be live for Twilio to create your Partner Solution. You can set it back to Development once we've sent the Partner Solution request.
  2. Copy your Meta App ID and send it to the Twilio Channel Operations team using the support ticket created when you requested access to the Tech Provider program.
  3. Wait 1-2 business days for the Channel Operations team to send you the Partner Solution request. Twilio notifies you that the Partner Solution is ready through the support ticket and Meta notifies you by email.
  4. Revert your App Mode back to Development.

Accept the Partner Solution request from Twilio

accept-the-partner-solution-request-from-twilio page anchor
  1. In the App Dashboard, go to WhatsApp > Partner Solutions.
  2. To confirm the Twilio Partner Solution request, click Accept.
  3. Inform Twilio that you accepted the request using the support ticket created when you submitted the WhatsApp Tech Provider program request form.
  4. Copy and save the Partner Solution ID for use in Part 3 when you add the Embedded Signup code to your application.

Add the Partner Solution to WABAs for existing customers

add-the-partner-solution-to-wabas-for-existing-customers page anchor

If you onboarded customers to WhatsApp using Twilio's WhatsApp Self Sign-up, you currently can't add the Partner Solution to their existing WABAs. Twilio will support this use case in a future release.

  • If you haven't previously onboarded customers to WhatsApp using Twilio, go to Part 3.
  • To onboard new customers to WhatsApp, complete the integration steps in Part 3.

Part 3: Complete the technical integration

part-3-complete-the-technical-integration page anchor

You'll need to do some additional technical setup within your Meta app before completing integration.

The goal of integration is to implement the following workflow for your customers to onboard to WhatsApp:

  1. Your customer chooses a phone number to use on WhatsApp or you assign them a Twilio number automatically.

    (information)

    Phone number options

    Phone number selection or assignment must happen before your customer starts the Embedded Signup flow, so that you can get the full phone number as required later by the Twilio Messaging API Senders resource.

    The WhatsApp Tech Provider Program supports both Twilio phone numbers and non-Twilio phone numbers on WhatsApp.

  2. Your customer clicks Login with Facebook in your application to open the Embedded Signup popup.

  3. In the popup window, the customer follows the Embedded Signup flow, including the following:

    • Create or select a Meta Business Portfolio.
    • Create a WhatsApp Business Account (WABA).
    • If the customer isn't using a Twilio SMS number assigned by you, then they must verify ownership of their phone number with Meta using a one-time password (OTP) verification.

    The window closes when the customer completes the flow.

  4. Your application registers your customer's WhatsApp Sender using the Twilio Messaging API Senders resource and the subaccount credentials assigned to the customer. Your application won't need to call any Meta APIs.

(information)

Embedded Signup flow subject to change

Meta provides the Embedded Signup flow and might make changes to the flow from time to time. For up-to-date information about Embedded Signup, see Meta's Embedded Signup documentation(link takes you to an external page).

Get your Configuration ID

get-your-configuration-id page anchor

Create the login configuration that allows your customers to log in to their Facebook account and select or create their Meta business portfolio and WABA, and then share it with your app and business.

  1. In the App Dashboard home page, find the Facebook Login for Business card and click Set Up.

  2. Go to Configurations, and click Create Configuration.

  3. Add a name for your configuration. The name won't be visible to your customers.

  4. Click Next.

  5. For Login variation, select WhatsApp Embedded Signup.

  6. Click Next.

  7. For Choose access token, select System-user access token and leave the default token expiration as 60 days.

    The access token section refers to your Meta Graph API access token. Since you're working with Twilio and won't call Meta's Graph API directly, this setting is not relevant for you.

  8. Click Next.

  9. For Assets, make sure WhatsApp accounts is selected.

  10. Click Next.

  11. For Permissions, make sure the whatsapp_business_management permission is selected. Don't include any other permissions.

  12. Click Create.

  13. Copy and save the resulting Configuration ID to use later when you add the JavaScript code for Embedded Signup to your application.

Update login settings on your Meta app

update-login-settings-on-your-meta-app page anchor

Embedded Signup requires updates to your Facebook Login for Business settings.

  1. In the App Dashboard, go to Facebook Login for Business > Settings.

  2. Under Client OAuth settings, set the following options to Yes if they're not already set:

    • Client OAuth login
    • Web OAuth login
    • Enforce HTTPS
    • Embedded Browser OAuth Login
    • Use Strict Mode for redirect URIs
    • Login with the JavaScript SDK
  3. Add your application's domains into both Valid OAuth Redirect URIs and Allowed Domains for the JavaScript SDK fields. These URIs need to be served using HTTPS and can only be static, not dynamic URLs that use a wildcard.

    (information)

    Info

    For security purposes, Meta doesn't allow the Facebook SDK to be loaded on any website not using HTTPS. We recommend using ngrok(link takes you to an external page) or a similar tool to expose your localhost externally where it can be served using HTTPS. Alternatively, if your company has a developer environment that uses HTTPS, that would also work.

  4. Click Save changes.

Add other developers to your app

add-other-developers-to-your-app page anchor

When your Meta app's App Mode is set to Development, only users that have been added to your Meta app can access it.

To add additional developers and testers to your Meta app, follow these steps:

  1. In the App Dashboard, go to App roles > Roles
  2. Click Edit roles in Business Manager.
  3. In the Business Manager interface:
    1. If needed, go to Users > People and invite people to your Business Portfolio.
    2. Go to Apps, click Assign people and add the people who need to test your Embedded Signup integration.

Integrate Embedded Signup into your application

integrate-embedded-signup-into-your-application page anchor

To complete the integration with Meta's Embedded Signup you'll need to do the following:

  • Add a Login with Facebook button into your application's user interface.
  • Use the information returned when your customers complete the Embedded Signup flow and the Senders API to register the user's phone number. You'll create a Twilio subaccount for your customer and then create a WhatsApp Sender resource in that subaccount.

Add the "Login with Facebook" button

add-the-login-with-facebook-button page anchor

Meta's Embedded Signup requires the Facebook SDK to be loaded only on the application page where Embedded Signup is surfaced.

  1. Add the snippet below after the opening <body> tag on the page you intend to add the "Login with Facebook" button. Replace APP_ID with your App ID.

    1
    <script>
    2
    window.fbAsyncInit = function() {
    3
    FB.init({
    4
    appId: 'APP_ID', // Replace with your Meta app ID
    5
    autoLogAppEvents: true,
    6
    xfbml: true,
    7
    version: 'v21.0' // Latest version when this doc was published
    8
    })
    9
    };
    10
    </script>
    11
    <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
  2. Add the following HTML where you want to surface the Login with Facebook button. Styles are included to match Meta's style guide.

    1
    <button onclick="launchEmbeddedSignup()" style="background-color: #1877f2; border: 0; border-radius: 4px; color: #fff; cursor: pointer; font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; height: 40px; padding: 0 24px;">
    2
    Login with Facebook
    3
    </button>
  3. The button added in the previous step triggers the launchEmbeddedSignup function as shown in the following example, which opens the Embedded Signup popup window.

    Replace the placeholder values with your Configuration ID and Partner Solution ID.

    1
    // Handle WhatsApp Embedded Signup
    2
    function launchEmbeddedSignup() {
    3
    // Launch Facebook login
    4
    FB.login(
    5
    function (response) {
    6
    // Since you are using Twilio's APIs, you do not need to do anything with the response here.
    7
    },
    8
    {
    9
    config_id: "KEEP_IN_QUOTES_BUT_REPLACE_WITH_YOUR_CONFIG_ID",
    10
    auth_type: "rerequest", // Avoids 'user is already logged' in errors if users click the button again before refreshing the page
    11
    response_type: "code",
    12
    override_default_response_type: true,
    13
    extras: {
    14
    sessionInfoVersion: 3, // Required to get WABA ID
    15
    setup: {
    16
    solutionID: "KEEP_IN_QUOTES_BUT_REPLACE_WITH_YOUR_SOLUTION_ID" // This is the Partner Solution ID
    17
    }
    18
    }
    19
    }
    20
    );
    21
    }
(information)

Embedded Signup flow subject to change

Meta provides the Embedded Signup flow and might make changes to the flow from time to time. For up-to-date information about Embedded Signup, see Meta's Embedded Signup documentation(link takes you to an external page).

  1. Add a listener to capture the session information that Meta returns when a customers completes the Embedded Signup flow.

    1
    // Define session handler
    2
    const embeddedSignupInfoListener = (event) => {
    3
    if (!event.origin.endsWith('facebook.com')) return;
    4
    try {
    5
    const data = JSON.parse(event.data);
    6
    if (data.type === 'WA_EMBEDDED_SIGNUP') {
    7
    8
    // if user finishes the Embedded Signup flow
    9
    if (data.event === 'FINISH' || data.event === 'FINISH_ONLY_WABA') {
    10
    const {phone_number_id, waba_id} = data.data;
    11
    console.log('Phone number ID ', phone_number_id, ' WhatsApp business account ID ', waba_id);
    12
    13
    // if user cancels the Embedded Signup flow
    14
    } else if (data.event === 'CANCEL') {
    15
    const {current_step} = data.data;
    16
    console.warn('Cancel at ', current_step);
    17
    18
    // if user reports an error during the Embedded Signup flow
    19
    } else if (data.event === 'ERROR') {
    20
    const {error_message} = data.data;
    21
    console.error('error ', error_message);
    22
    }
    23
    }
    24
    } catch {
    25
    console.log('Non JSON Responses', event.data);
    26
    }
    27
    };
    28
    29
    30
    // Listen for Embedded Signup events
    31
    window.addEventListener('message', embeddedSignupInfoListener);
    32
    33
    34
    // When the user navigates away from the page, remove the event listener
    35
    window.addEventListener('beforeunload', () =>
    36
    window.removeEventListener('message', embeddedSignupInfoListener)
    37
    );

Test the Embedded Signup flow

test-the-embedded-signup-flow page anchor

Test the Embedded Signup flow in your application using a Meta business portfolio you create for that purpose.

When you test the Embedded Signup flow, Meta doesn't allow you to select the Meta business portfolio that you used to create your Meta app within the Embedded Signup flow.

We recommend creating an additional Meta business portfolio, for example "MyCompany Test", using accurate business details. To avoid Meta's phone number and WABA limit restrictions when testing, we also recommend submitting your test business portfolio for business verification.

(information)

Partner solution notice

When your Partner Solution (solutionID) is working correctly, you'll notice that the Embedded Signup flow displays a message that states your company is working with Twilio to enable your customers on WhatsApp. Meta requires that this information displays and it can't be removed.

Update Embedded Signup for Twilio phone numbers

update-embedded-signup-for-twilio-phone-numbers page anchor

If you're purchasing and assigning Twilio SMS-capable phone numbers for your customers to use with WhatsApp, you need to update the default Embedded Signup configuration.

The default Embedded Signup flow is as follows:

  1. Create or select their Meta Business Portfolio.
  2. Create their WhatsApp Business Account (WABA).
  3. Enter a phone number and their WhatsApp Display Name.
  4. Verify phone number ownership by entering a one-time passcode (OTP) sent via SMS or a voice call.

If you've purchased Twilio SMS-capable phone numbers for your customers to use with WhatsApp, it's against Twilio policy to display OTPs within your account. As a result, Twilio's Senders API handles steps 3 and 4 automatically when you make the API request to create the WhatsApp Sender, and you need to turn off those steps within Embedded Signup.

If you've purchased Twilio voice-only phone numbers for your customers to use with WhatsApp, you need to configure the phone number so it can receive the OTP via voice call.

If you're using a combination of Twilio SMS-capable phone numbers, Twilio voice-only numbers, and non-Twilio numbers, then you need to configure Embedded Signup conditionally based on the type of phone number the customer chooses.

To configure Embedded Signup to skip the steps to provide a phone number, update your FB.login call to include featureType: 'only_waba_sharing'. For example:

Embedded Signup: Only WABA sharing (Skip phone number screens)

embedded-signup-only-waba-sharing-skip-phone-number-screens page anchor
1
// Handle WhatsApp Embedded Signup
2
function launchEmbeddedSignup() {
3
// Launch Facebook login
4
FB.login(
5
function (response) {
6
// Since you are using Twilio's APIs, you do not need to do anything with the response here.
7
},
8
{
9
config_id: "KEEP_IN_QUOTES_BUT_REPLACE_WITH_YOUR_CONFIG_ID",
10
auth_type: "rerequest", // Avoids "user is already logged" in errors if users click the button again before refreshing the page
11
response_type: "code",
12
override_default_response_type: true,
13
extras: {
14
sessionInfoVersion: 3, // Required to get WABA ID
15
// set the following "featureType" to 'only_waba_sharing'
16
// if and only if using a Twilio SMS-capable number, otherwise
17
// do not include it or set it to null
18
featureType: 'only_waba_sharing',
19
setup: {
20
solutionID: "KEEP_IN_QUOTES_BUT_REPLACE_WITH_YOUR_SOLUTION_ID", // This is the Partner Solution ID
21
}
22
}
23
}
24
);
25
}
(information)

Optionally prefill customer data previously collected

Meta allows you to add in details about the customer's business if you've already collected that information. Pre-filled data can speed up the onboarding process for your customers.

Customers can still edit the data that you prefill, if necessary.

Review Meta's documentation about pre-filling screens(link takes you to an external page) and make sure you test any changes.

Collect the phone number

collect-the-phone-number page anchor

Meta returns only the phone_number_id when the user completes the Embedded Signup flow:

1
const embeddedSignupInfoListener = (event) => {
2
if (!event.origin.endsWith('facebook.com')) return;
3
try {
4
const data = JSON.parse(event.data);
5
if (data.type === 'WA_EMBEDDED_SIGNUP') {
6
7
// if user finishes the Embedded Signup flow
8
if (data.event === 'FINISH' || data.event === 'FINISH_ONLY_WABA') {
9
const {phone_number_id, waba_id} = data.data;
10
console.log('Phone number ID ', phone_number_id, ' WhatsApp business account ID ', waba_id);
11
12
// if user cancels the Embedded Signup flow
13
} else if (data.event === 'CANCEL') {
14
const {current_step} = data.data;
15
console.warn('Cancel at ', current_step);
16
17
// if user reports an error during the Embedded Signup flow
18
} else if (data.event === 'ERROR') {
19
const {error_message} = data.data;
20
console.error('error ', error_message);
21
}
22
}
23
} catch {
24
console.log('Non JSON Responses', event.data);
25
}
26
};

The Twilio Senders API requires a phone number in E.164 format. If you allow your customers to bring their own phone number to register on WhatsApp, you must collect it from your customers separately from the Embedded Signup flow. You can collect the number before launching the Embedded Signup flow or after the customer completes the Embedded Signup flow, but before making the call to the Twilio Senders API.

Once you have the WABA ID from the embeddedSignupInfoListener function and the phone number in E.164 format, pass these parameters to your backend to register the WhatsApp sender.

(error)

Danger

Don't make any of the following or other Twilio API calls involving a Twilio AuthToken on the front end of your application, where you implemented the Embedded Signup feature.

Create a subaccount for each customer

create-a-subaccount-for-each-customer page anchor

Create a subaccount for each new new customer using the Twilio Accounts API. A single Twilio account or subaccount is mapped to a single WABA.

When your customer onboards to WhatsApp for the first time, they will create a new WABA as part of the Embedded Signup flow. Every customer WABA needs to be connected to a separate Twilio subaccount.

Your customers should reuse their WABA when onboarding additional WhatsApp senders.

(warning)

Warning

Each WABA must be mapped to a single Twilio account or subaccount. You must keep track of every customer business or brand and connect each one to a dedicated Twilio subaccount. WhatsApp doesn't allow senders from different businesses to be registered in the same WABA.

If you're not already familiar with Twilio subaccounts, you can learn more in the Accounts API docs.

  1. Create a subaccount using the example below if you don't already have a subaccount for this customer. Make sure to replace the FriendlyName with your customer's company name. Use your main Twilio account (e.g., parent account) credentials to make this request.

    Create a subaccountLink to code sample: Create a subaccount
    1
    // Download the helper library from https://www.twilio.com/docs/node/install
    2
    const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
    3
    4
    // Find your Account SID and Auth Token at twilio.com/console
    5
    // and set the environment variables. See http://twil.io/secure
    6
    const accountSid = process.env.TWILIO_ACCOUNT_SID;
    7
    const authToken = process.env.TWILIO_AUTH_TOKEN;
    8
    const client = twilio(accountSid, authToken);
    9
    10
    async function createAccount() {
    11
    const account = await client.api.v2010.accounts.create({
    12
    friendlyName: "Owl, Inc.",
    13
    });
    14
    15
    console.log(account.authToken);
    16
    }
    17
    18
    createAccount();

    Response

    Note about this response
    1
    {
    2
    "auth_token": "auth_token",
    3
    "date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
    4
    "date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
    5
    "friendly_name": "Owl, Inc.",
    6
    "owner_account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    7
    "sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    8
    "status": "active",
    9
    "subresource_uris": {
    10
    "available_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json",
    11
    "calls": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json",
    12
    "conferences": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json",
    13
    "incoming_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json",
    14
    "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
    15
    "outgoing_caller_ids": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json",
    16
    "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
    17
    "transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
    18
    "addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json",
    19
    "signing_keys": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json",
    20
    "connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json",
    21
    "sip": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP.json",
    22
    "authorized_connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json",
    23
    "usage": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage.json",
    24
    "keys": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json",
    25
    "applications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json",
    26
    "short_codes": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json",
    27
    "queues": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json",
    28
    "messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json",
    29
    "balance": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Balance.json"
    30
    },
    31
    "type": "Full",
    32
    "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
    33
    }
  2. The newly created subaccount's AccountSid and AuthToken will be returned in the response. Save this in your database to use for this customer. You will also use these credentials in the next step when calling the Twilio Senders API to register your customer's phone numbers on WhatsApp.

Register the WhatsApp sender

register-the-whatsapp-sender page anchor

Use the Twilio Senders API to connect new WABAs to new subaccounts and register phone numbers with WhatsApp.

Create the WhatsApp Sender resource using the Senders API:

  1. Use the WABA ID and phone number passed from your frontend and, with the subaccount's Account SID and Auth Token, call the Twilio Senders API with the following fields:

    • sender_id: provide the phone number that you are registering in E.164 format.
    • waba_id: provide the WABA ID if this is the first number for the customer. This will connect it to the subaccount. Note that once a WABA ID has been mapped to a subaccount, it will stay connected unless all WhatsApp senders have been deleted from the account. You don't need to provide it when registering additional senders in the same subaccount.
    • callback_url, callback_method, fallback_url, fallback_method, and status_callback_url: these webhooks are used for inbound messages and message statuses (not for the sender's status). Note that status callbacks only support HTTP POST.
    • profile.name is only required when using a Twilio SMS-capable number; otherwise, Twilio will use the one provided by your customer during the Embedded Signup flow and ignore this field. Even when testing, the display name must comply with Meta's WhatsApp display name guidelines(link takes you to an external page).
    • Other fields are optional.
    1
    ## Create Sender
    2
    curl -X "POST" "https://messaging.twilio.com/v2/Channels/Senders" \
    3
    -H "Content-Type: application/json; charset=utf-8" \
    4
    -u "$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN" \
    5
    -d $'{
    6
    "sender_id": "whatsapp:+15017122661",
    7
    "configuration": {
    8
    "waba_id": "12345678912345"
    9
    },
    10
    "profile": {
    11
    "address": "101 Spear Street, San Francisco, CA",
    12
    "emails": [
    13
    "support@twilio.com"
    14
    ],
    15
    "vertical": "Other",
    16
    "logo_url": "https://www.twilio.com/logo.png",
    17
    "description": "We\'re excited to see what you build!",
    18
    "about": "Hello! We are Twilio.",
    19
    "name": "Twilio",
    20
    "websites": [
    21
    "https://twilio.com",
    22
    "https://help.twilio.com"
    23
    ]
    24
    },
    25
    "webhook": {
    26
    "callback_method": "POST",
    27
    "callback_url": "https://demo.twilio.com/welcome/sms/reply/"
    28
    }
    29
    }'

    Output

    1
    {
    2
    "status": "CREATING",
    3
    "sender_id": "whatsapp:+15017122661",
    4
    "sid": "XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    5
    "configuration": {
    6
    "waba_id": "12345678912345"
    7
    },
    8
    "profile": {
    9
    "about": "Hello! This is Twilio's official account.",
    10
    "name": "Twilio",
    11
    "vertical": "Other",
    12
    "websites": [
    13
    {
    14
    "website": "https://twilio.com",
    15
    "label": "Website"
    16
    },
    17
    {
    18
    "website": "https://help.twilio.com",
    19
    "label": "Website"
    20
    }
    21
    ],
    22
    "address": "101 Spear Street, San Francisco, CA",
    23
    "logo_url": "https://www.twilio.com/logo.png",
    24
    "emails": [
    25
    {
    26
    "email": "support@twilio.com",
    27
    "label": "Email"
    28
    }
    29
    ],
    30
    "description": "We're excited to see what you build!"
    31
    },
    32
    "webhook": {
    33
    "callback_method": "POST",
    34
    "callback_url": "https://demo.twilio.com/welcome/sms/reply/"
    35
    },
    36
    "url": "https://messaging.twilio.com/v2/Channels/Senders/XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    37
    "properties": null
    38
    }
  2. The Senders API registers WhatsApp senders asynchronously. When you make the POST call above to create the WhatsApp Sender resource, the sender's SID is returned. WhatsApp sender SIDs start with XE.

  3. To check if the WhatsApp sender has been successfully registered and is online, make a request to fetch the WhatsApp sender's current status:

    1
    ## Fetch Sender
    2
    curl -X "GET" "https://messaging.twilio.com/v2/Channels/Senders/XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
    3
    -H "Content-Type: application/json; charset=utf-8" \
    4
    -u "$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN"

    Output

    1
    {
    2
    "status": "ONLINE",
    3
    "sender_id": "whatsapp:+15017122661",
    4
    "sid": "XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    5
    "configuration": {
    6
    "waba_id": "12345678912345"
    7
    },
    8
    "profile": {
    9
    "about": "Hello! This is Twilio's official account.",
    10
    "name": "Twilio",
    11
    "vertical": "Other",
    12
    "websites": [
    13
    {
    14
    "website": "https://twilio.com",
    15
    "label": "Website"
    16
    },
    17
    {
    18
    "website": "https://help.twilio.com",
    19
    "label": "Website"
    20
    }
    21
    ],
    22
    "address": "101 Spear Street, San Francisco, CA",
    23
    "logo_url": "https://www.twilio.com/logo.png",
    24
    "emails": [
    25
    {
    26
    "email": "support@twilio.com",
    27
    "label": "Email"
    28
    }
    29
    ],
    30
    "description": "We're excited to see what you build!"
    31
    },
    32
    "webhook": {
    33
    "callback_method": "POST",
    34
    "callback_url": "https://demo.twilio.com/welcome/sms/reply/"
    35
    },
    36
    "url": "https://messaging.twilio.com/v2/Channels/Senders/XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    37
    "properties": {
    38
    "messaging_limit": "1K Customers/24hr",
    39
    "quality_rating": "HIGH"
    40
    }
    41
    }
  4. When the sender's status shows as ONLINE, you can use Twilio's APIs to send and receive messages.

To troubleshoot WhatsApp sender registration, see Register WhatsApp senders.

It's time to move your application to production and start onboarding your customers to the WhatsApp Business Platform with Twilio.

  • At the top of the App Dashboard, set the App Mode to Live.
  • Make sure your production URLs are added to your Meta app in the App Dashboard at Facebook Login for Business > Settings. See Update login settings on your Meta App.
  • Let the Twilio Channel Operations team know you successfully completed the integration through the support ticket created when you submitted the WhatsApp Tech Provider program request form. Once complete, the team closes the ticket.