# How to send a WhatsApp message - META

With this setup, Batch directly calls the Meta API to send a WhatsApp message to your users.

### Prerequisites

Before starting, make sure you have completed the following setup in Meta:

* A [**Meta Business Manager account**](https://www.facebook.com/business/tools/business-manager/get-started-guide)
* A [**WhatsApp Business Account (WABA)**](https://developers.facebook.com/documentation/business-messaging/whatsapp/whatsapp-business-accounts/) created in Business Manager
* A **Meta app** with the [**WhatsApp product enabled**](https://developers.facebook.com/documentation/business-messaging/whatsapp/get-started)
* A **sender phone number**
  * Test → generated in `developers.facebook.com`
  * Production → requires business verification
* An **approved** [**display name**](https://developers.facebook.com/documentation/business-messaging/whatsapp/display-names/)
* An **approved** [**message template**](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/marketing-templates)
  * Created in **WhatsApp Manager → Message templates**
* An [**access token**](https://developers.facebook.com/documentation/business-messaging/whatsapp/access-tokens/) for a **system user** with permissions:
  * `whatsapp_business_messaging`
  * `whatsapp_business_management`
  * `business_management`

{% stepper %}
{% step %}

### Step 1 — Add your META creditential into Batch

Batch needs to authenticate requests to Meta.

1. Go to **Settings → Channels → Universal**
2. Click **New Credential Headers**
3. Choose a name (e.g., “META - Whatsapp”)
4. Key → `Authorization`
5. Value → paste the bearer token from META (e.g., "Bearer YOUR\_TOKEN")
6. Save

<figure><img src="https://509463063-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfiAYaWDWqtFZeXxyg67F%2Fuploads%2FTbQExFHk9reFQ2pYFjTi%2FIntegration_META_settings_3003.png?alt=media&#x26;token=b9a963b3-4f22-4033-8761-778cf2f46cf1" alt="Add the information in the Universal channel settings"><figcaption><p>Add the information in the Universal channel settings</p></figcaption></figure>

> **Note:** You only need to add the credential once in Batch.
> {% endstep %}

{% step %}

### Step 2 — Configure the Universal step in Batch

In this step, you will add the Universal step in your Batch automation and configure it to trigger the Whatsapp message.

**Add the Universal Step**

1. Open the Batch automation where you want to trigger WhatsApp
2. Click the **+** button
3. Select **Universal**

This opens the Universal step configuration screen.

![](https://doc.batch.com/~gitbook/image?url=https%3A%2F%2F2998247023-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbwlQFpRAhaFR79zae6Jf%252Fuploads%252FxObMCTr1fbP1eRYixRs8%252Funiversal%2520channel%25205.png%3Falt%3Dmedia%26token%3D87743033-d6d4-4e95-bcdd-571907dbb37b\&width=768\&dpr=3\&quality=100\&sign=341f2970\&sv=2)

**Configure the META request**

Fill in the fields using the information from META:

**1. Destination URL**

Paste the URL shown in META's API trigger : `https://graph.facebook.com/v22.0/{Sender-Phone-Number-ID}/messages`

**3. Headers**

* Choose the credential header you created earlier (e.g., "**META - Whatsapp"**)
* Add another header :
  * "Key" : `Content-Type`
  * "Value" : `application/json`

**4. JSON Body**\
\
**Example:**

```
{
    "messaging_product": "whatsapp", 
    "recipient_type": "individual", 
    "to": "{{b.phone_number}}", 
    "type": "template", 
    "template": {"name": "YOU_TEMPLATE_ID"}, 
    "language": { "code": "fr"} 
}
```

<figure><img src="https://509463063-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfiAYaWDWqtFZeXxyg67F%2Fuploads%2F1RbAtp1278UtZoxmu7zI%2FIntegration_META_payload_3003.png?alt=media&#x26;token=c8b4c15b-b4e0-4e3b-96e9-05b1df0518c9" alt="Configure the universal channel step"><figcaption><p>Configure the universal channel step</p></figcaption></figure>
{% endstep %}

{% step %}

### Step 3 — Test the connection&#xD;<br>

Once your Universal Step is configured, you can test it directly from Batch to make sure everything is working properly.

**How to test**

1. In the Universal Step, click **Test API**.
2. If your JSON body includes personalization (e.g., `{{b.phone_number}}`), choose a **test profile** so Batch can fill in real data.
3. Click to send the test request.

<figure><img src="https://509463063-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfiAYaWDWqtFZeXxyg67F%2Fuploads%2FXxdYChrRlGDPNmJBcg5t%2FIntegration_META_test_3003.png?alt=media&#x26;token=a6da5beb-5732-459d-8236-f9a3739c4926" alt="Use the &#x22;Test API&#x22; button in order to make sure everything is working properly"><figcaption><p>Use the "Test API" button in order to make sure everything is working properly</p></figcaption></figure>

**What the test does**

* Batch performs the exact same API call it will make when the automation is live.

**What Batch validates**

Batch will display whether the request was **successfully delivered** to META or if something needs fixing (e.g., wrong URL, missing key, invalid JSON).

> **Note:** Batch can only confirm that the trigger was correctly called. It does not have visibility on what happens inside META afterward (e.g., whether the message was sent or failed).
> {% endstep %}

{% step %}

### Step 4 — Activate your Batch automation

When the test is successful, you can turn your Batch automation live.

**To activate**

1. Review your workflow, including the Universal step.
2. Run your automation

**Once live**

* Every time a profile moves through this step in your automation, Batch will send the whatsapp message.

**Additional Universal steps**

If you want to trigger multiple WhatsApp scenarios (e.g., a follow-up message, or different Whatsapp messages), you can add more Universal Steps within the same Batch automation or in a new one by following these steps again (Step 1 can be skipped).
{% endstep %}
{% endstepper %}
