# Onboarding and Sending Messages

{% hint style="warning" %}
Marketing Messages API for WhatsApp (formerly known as Marketing Messages API) is now generally available.
{% endhint %}

In MM API, we call *onboarding* the process where the **client** reviews and accepts the MM API **Terms of Service**. The Onboarding is always performed at a **Meta business portfolio** level. Please see the next steps to onboard to MM API:

## Onboard in 360Dialog Hub

To streamline client onboarding, you will now see a banner in the Client Hub. This banner contains a unique button that you can easily click to begin the MM API onboarding process.

{% hint style="info" %}
As an alternative, you can also use [this link](https://hub.360dialog.com/mmlite-tos) to accept the MM API Terms of Service.
{% endhint %}

{% stepper %}
{% step %}

#### To access the onboarding link, log in to your client account [here](http://app.360dialog.io/)

{% endstep %}

{% step %}

#### Accept MM API terms button

A banner will appear on the dashboard containing a unique button, "Accept MM API terms". You must click on it.

<figure><img src="https://3527970750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4sMxKjL6eJRvZn6jeG-887967055%2Fuploads%2F8fSi2BuE9P11oco7VVRE%2FScreenshot%202025-12-02%20at%2019.07.53.png?alt=media&#x26;token=00ce1f36-3b52-4006-91a5-a9d71a0fad45" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Connect your Facebook account and proceed with the next steps

Once you click there, you will be prompted to connect to your Facebook account. You can then complete the embedded signup process for the MM API.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
**Important:** This step requires the client to be an **administrator** of the Meta business portfolio.

The terms accepted in this process will apply to all existing WhatsApp Business Accounts (WABAs) under the selected Meta business portfolio. Clients with multiple Meta business portfolio must repeat the process for each BM.
{% endhint %}

## Onboard in WhatsApp Manager

This is the best way to get access to the MM API feature. In this case, you can use WhatsApp Manager to accept the terms.

{% stepper %}
{% step %}

#### Open [**WhatsApp Manager** > **Overview**](https://business.facebook.com/latest/whatsapp_manager/overview)

{% endstep %}

{% step %}

#### In the Alerts section, click '**Accept terms to get started**' for Marketing Messages API.

<figure><img src="https://3527970750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4sMxKjL6eJRvZn6jeG-887967055%2Fuploads%2FfLMM2jVbiZPTLuuE4nGM%2FMMLite_WhatsAppManager_Accept.png?alt=media&#x26;token=4e81ff81-9eea-42e7-a1a7-c379415534a1" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Follow the steps to finish signing the **MM API Terms of Service** for **all eligible WABAs** in the account.

<figure><img src="https://3527970750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4sMxKjL6eJRvZn6jeG-887967055%2Fuploads%2FQ5NQAWQKlAcjrTGeIIqJ%2Fimage.png?alt=media&#x26;token=9053ecd5-2a56-40ca-b5d1-391c540489f1" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Once accepted, **MM API is active** for that Meta business portfolio, meaning all eligible WABAs in the Meta business portfolio will be allowed to use MM API.
{% endhint %}

## Sending Messages with MM API

To send a template message, you will need to use a POST request:

<mark style="color:green;">`POST`</mark>`https://waba-v2.360dialog.io/marketing_messages`

{% hint style="danger" %}
The only difference is the endpoint <mark style="color:red;">/marketing\_messages</mark>, and it should be used **only** for *Marketing* messages.
{% endhint %}

#### Headers

| Name         | Value              | Description                                                         |
| ------------ | ------------------ | ------------------------------------------------------------------- |
| Content-Type | `application/json` |                                                                     |
| D360-API-KEY | `Bearer <token>`   | D360-API-KEY received after approval to participate in this program |

#### Body

<table><thead><tr><th>Field</th><th width="133.93817138671875">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>messaging_product</code></td><td>Yes</td><td> <code>"whatsapp"</code></td></tr><tr><td><code>recipient_type</code></td><td>Yes</td><td><code>"individual"</code></td></tr><tr><td><code>to</code></td><td>Yes</td><td>Recipient phone number in international format. Example: <code>"441234567890"</code></td></tr><tr><td><code>type</code></td><td>Yes</td><td><code>"template"</code></td></tr><tr><td><code>template.name</code></td><td>Yes</td><td> <code>"marketing_text_no_param"</code></td></tr><tr><td><code>template.language.code</code></td><td>Yes</td><td> <code>"en"</code></td></tr><tr><td><code>template.language.policy</code></td><td>Yes</td><td><code>"deterministic"</code> </td></tr><tr><td><code>message_activity_sharing</code></td><td>Optional</td><td>Set to <code>true</code> to enable activity sharing (can be removed if not needed)</td></tr><tr><td><code>product_policy</code></td><td>Optional</td><td><p>Set to <code>"STRICT"</code> to not route the messages back to Cloud if onboarding requirements have not been met.</p><p>Set to <code>"cloud_api_fallback"</code> if the routing should be enabled.</p></td></tr></tbody></table>

#### **Request example**

{% tabs %}
{% tab title="MM API (new)" %}

```json
# MM API (new)
curl --location 'https://https://waba-v2.360dialog.io/marketing_messages' \
--header 'Content-Type: application/json' \
--header 'D360-API-KEY: <token>' \
--data '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "<<RECIPIENT_PHONE_NUMBER>>",
    "type": "template",
    "template": {
        "name": "marketing_text_no_param",
        "language": {
            "policy": "deterministic",
            "code": "en"
        }
    },
    "message_activity_sharing":true ,
    "product_policy": "cloud_api_fallback"
}'
```

{% endtab %}

{% tab title="Cloud API (current)" %}

```json
# Cloud API (current)
curl --location 'https://waba-v2.360dialog.io/messages' \
  --header 'D360-API-KEY: <api_key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "to": "<end_client_number>",
    "type": "template",
    "template": {
      "name": "<template_name>",
      "language": { "code": "<template_language_code>" },
      "components": []
    },
    "messaging_product": "whatsapp"
  }'
```

{% endtab %}
{% endtabs %}

**Response**

The same response from the Cloud API is expected after a successful message is sent using the MM API.

{% tabs %}
{% tab title="200: Ok" %}

```json
{
    "messaging_product": "whatsapp",
    "contacts": [
        {
            "input": "<phone number>",
            "wa_id": "<<waba id>"
        }
    ],
    "messages": [
        {
            "id": "wamid.HBgLNTk4OTQ3MTQ0NjMVAgARGBJDNjM1NUM2OEEyMDU4REZERTgA"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### S**ending a Marketing Template Message with TTL using MM API**

MM API provides additional features that are not available to Marketing templates on Cloud API.&#x20;

This means you can include and set the value of the `message_send_ttl_seconds`  in the payload of your Marketing Message Template to test this feature.

{% hint style="info" %}
***What is*** [***Time-To-Live (TTL)***](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/#time-to-live--ttl---customization--defaults--min-max-values--and-compatibility) ***for Marketing template messages?***

If Meta is unable to deliver a message to a WhatsApp user, they will continue attempting to deliver the message for a period of time known as a time-to-live (TTL), or message validity period.&#x20;

TTL is available for Authentication and Utility template messages on Cloud API, but TTL for Marketing template messages is exclusively available on Marketing Messages API.&#x20;
{% endhint %}

## Handling Webhooks

With MM API, you don’t need to change your webhook setup. You will keep receiving the usual events (**sent → delivered → read**) the same way as with the Cloud API.

The only difference: when you send via <mark style="color:$success;">**`/marketing_messages`**</mark> with <mark style="color:$success;">`"message_activity_sharing": true`</mark>, you also get a **click event** whenever a user taps the CTA link in your template.

This makes it easier to track performance and optimize campaigns without changing your current logic.

{% hint style="warning" %}
At the moment, it’s not possible to know *which phone number* clicked. You only get the event itself.
{% endhint %}

#### Webhook events received:

{% tabs %}
{% tab title="Sent" %}
This event includes the value <mark style="color:$success;">`"marketing_lite"`</mark> to indicate that it was sent using the MM API:

```json
{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
      "changes": [
        {
          "value": {
            "messaging_product": "whatsapp",
            "metadata": {
              "display_phone_number": "BUSINESS_DISPLAY_PHONE_NUMBER",
              "phone_number_id": "BUSINESS_PHONE_NUMBER_ID"
            },
            "statuses": [
              {
                "id": "<WHATSAPP_MESSAGE_ID>",
                "status": "sent",
                "timestamp": "TIMESTAMP",
                "recipient_id": "<CUSTOMER_PHONE_NUMBER>",
                "conversation": {
                  "id": "<conversation_id>",
                  "expiration_timestamp": "TIMESTAMP",
                  "origin": {
                    "type": "marketing_lite"
                  }
                },
                "pricing": {
                  "billable": true,
                  "pricing_model": "CBP",
                  "category": "marketing_lite"
                }
              }
            ]
          },
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.360dialog.com/docs/resources/marketing-messages/onboarding-and-sending-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
