WhatsApp only allows proactively sending messages if they’re created from a template. You can create a template from your WhatsApp Manager dashboard.

After WhatsApp reviews and approves your template, follow the steps in this guide.

Setup

1

Add the Start Conversation Card

In Studio, add a Start Conversation Card to any Node:

2

Fill in the required fields

Fill in the fields:

Your bot is ready to proactively start a conversation with your user!

Access the Conversation ID

You can access the proactively started conversation’s ID in Studio by storing the Start Conversation Card’s output in a variable. Just select a variable to store the value in:

The output value of this action will be an object with the following structure:

{
  conversationId: 'xxxxxxxxxxxxxxxxxxxxx'
}

Create the conversation from code

You can also call actions.whatsapp.startConversation in an Execute Code Card to start a conversation:

actions.whatsapp.startConversation({
  userPhone: '+1 123 456 7890',
  templateName: 'test_message',
  templateLanguage: 'en',
  templateVariablesJson: JSON.stringify(['First value', 'Second value'])
})