Dialogflow CX

Sending Interactive WhatsApp Messages from Dialogflow CX

Updated 14 November 2026

A Dialogflow CX agent connected to Baat sends its text responses to WhatsApp as plain text. To send buttons, lists, links, Flows or products, return a custom payload that contains a WhatsApp interactive message in the shape Meta documents for its Cloud API. This guide shows the payload for each type, and how the customer’s answer comes back to your agent.

To connect an agent first, see Connecting Dialogflow CX to Baat.

The BAAT_WAC_API wrapper

Put the message inside a top-level key called BAAT_WAC_API:

{
  "BAAT_WAC_API": {
    "type": "interactive",
    "interactive": {
      "type": "button",
      "body":   { "text": "Would you like to confirm your order?" },
      "action": {
        "buttons": [
          { "type": "reply", "reply": { "id": "yes", "title": "Yes, confirm" } },
          { "type": "reply", "reply": { "id": "no",  "title": "No, cancel"  } }
        ]
      }
    }
  }
}

The interactive object is written exactly as in Meta’s documentation. You can also put the interactive object directly inside BAAT_WAC_API, without the outer type.

Baat sends the interactive object to Meta. It keeps your fields as they are, with a few changes:

  • It sets messaging_product, recipient_type, the recipient and type itself, and removes those fields, and any token or access_token, if you include them

  • It turns a plain-text body, footer or header into the object Meta expects, for example "body": "Hi" into "body": { "text": "Hi" }

  • For a Flow, it fills in any of flow_message_version, flow_cta, flow_action, flow_action_payload and flow_token that you leave out

Baat checks the main types (buttons, lists, link buttons, Flows, products and product lists) before sending. Other interactive types are passed to Meta without checks, so a type Meta adds later can be used straight away.

Besides interactive messages, a custom payload can also send plain text: {"type": "text", "text": {"body": "Hello", "preview_url": true}}. Images, videos, documents and audio cannot be sent on their own from a custom payload. Use them as the header of an interactive message instead.

Anatomy of a Meta interactive message

Every interactive message shares the same outer shape:

{
  "type": "interactive",
  "interactive": {
    "type": "button | list | cta_url | flow | product | product_list | location_request_message | address_message",
    "header": { "type": "text | image | video | document", "text": "..." },
    "body":   { "text": "Main message text (required for most types)" },
    "footer": { "text": "Optional footer line" },
    "action": { ... }
  }
}

The type field inside interactive determines which action shape is valid. The sections below show a working Dialogflow CX custom payload for each type.

1. Reply buttons

The quickest win — up to 3 tap-to-reply buttons. No typing required from the user.

Custom payload

{
  "BAAT_WAC_API": {
    "type": "interactive",
    "interactive": {
      "type": "button",
      "body": {
        "text": "Your order #48291 is packed and ready to ship. Confirm dispatch?"
      },
      "footer": { "text": "Reply expires in 24 hours" },
      "action": {
        "buttons": [
          { "type": "reply", "reply": { "id": "confirm_dispatch", "title": "Yes, dispatch" } },
          { "type": "reply", "reply": { "id": "hold",            "title": "Hold for now"  } },
          { "type": "reply", "reply": { "id": "cancel_order",    "title": "Cancel order"  } }
        ]
      }
    }
  }
}

What comes back

When the customer taps a button, Baat sends your agent this text:

User selected button {title : "Yes, dispatch" , id :"confirm_dispatch" }

You can match it with an intent. To get the choice as a session parameter instead, write the button id as key:value pairs separated by |. Baat turns each pair into a session parameter:

Button idSession parameters
choice:confirm_dispatch$session.params.choice = confirm_dispatch
order_btn|action:hold|order:48291$session.params.action = hold, $session.params.order = 48291
confirm_dispatchnone, because there is no key:value pair

Then use a route condition such as $session.params.choice = "confirm_dispatch".

Limits: up to 3 buttons. Each title can be up to 20 characters and each id up to 256. Baat does not send a message that breaks these limits.

2. List message

A scrollable list with sections and rows. Better than buttons when you have more than 3 options.

Custom payload

{
  "BAAT_WAC_API": {
    "type": "interactive",
    "interactive": {
      "type": "list",
      "body": { "text": "What can I help you with today?" },
      "footer": { "text": "Select an option below" },
      "action": {
        "button": "View options",
        "sections": [
          {
            "title": "Orders",
            "rows": [
              { "id": "track_order",  "title": "Track my order",  "description": "Get live delivery status"    },
              { "id": "cancel_order", "title": "Cancel an order", "description": "Cancel before it ships"     },
              { "id": "edit_address", "title": "Edit address",    "description": "Change delivery address"    }
            ]
          },
          {
            "title": "Returns",
            "rows": [
              { "id": "start_return",  "title": "Start a return",  "description": "Initiate a return or swap" },
              { "id": "refund_status", "title": "Refund status",   "description": "Check refund progress"    }
            ]
          }
        ]
      }
    }
  }
}

What comes back

Baat sends your agent this text:

User selected list reply {title : "Track my order", id: "track_order" }

As with buttons, write the row id as key:value pairs, such as topic:track_order, to get session parameters.

Limits: up to 10 rows across all sections. Each row title can be up to 24 characters and each row id up to 200. The list button label can be up to 20 characters. Baat does not send a list that breaks these limits.

3. CTA URL button

A single button that opens a URL in the phone’s browser. Use it for order tracking links, payment pages, or any external destination.

Custom payload

{
  "BAAT_WAC_API": {
    "type": "interactive",
    "interactive": {
      "type": "cta_url",
      "body": {
        "text": "Your order is out for delivery. Tap below to track it live."
      },
      "footer": { "text": "Delivered by Delhivery" },
      "action": {
        "name": "cta_url",
        "parameters": {
          "display_text": "Track my order",
          "url": "https://track.example.com/48291"
        }
      }
    }
  }
}

What comes back

There is no structured reply for a CTA URL tap — WhatsApp does not notify you when a user opens the link. If you need to know whether the user clicked, use a UTM-tagged URL and check your analytics separately.

Common mistake: The action.name field must be the string "cta_url" — not the URL itself. Omitting it or setting it to anything else causes a Meta validation error.

4. WhatsApp Flow

Sends an interactive form that opens inside WhatsApp. The user fills it in without leaving the chat.

Custom payload

{
  "BAAT_WAC_API": {
    "type": "interactive",
    "interactive": {
      "type": "flow",
      "body": {
        "text": "Book your appointment in under a minute — tap below."
      },
      "footer": { "text": "Takes less than 30 seconds" },
      "action": {
        "name": "flow",
        "parameters": {
          "flow_message_version": "3",
          "flow_id": "1234567890123456",
          "flow_cta": "Book now",
          "flow_action": "navigate",
          "flow_token": "booking-session-abc123",
          "flow_action_payload": {
            "screen": "APPOINTMENT_SCREEN"
          }
        }
      }
    }
  }
}

flow_id or flow_name: you need one of them. Baat passes a flow_name to Meta as it is, without looking it up.

Defaults: if you leave them out, Baat sets flow_message_version to "3", flow_cta to “Open Form”, flow_action to navigate, the first screen to FIRST_SCREEN, and creates a flow_token. Set flow_action_payload.screen to your Flow’s real first screen, unless it is called FIRST_SCREEN.

flow_token: if you supply your own, Baat uses it as it is.

What comes back

When the customer submits the Flow, Baat sends your agent the text flow_submitted. Each field in the Flow’s complete payload becomes a session parameter with the same name. For example, a field full_name arrives as $session.params.full_name. The flow_token is not passed on. See Integrating WhatsApp Flows with Dialogflow.

Tip: write flow_id as a string, in quotes: "flow_id": "1234567890123456".

5. Product and product list

Display one product or a curated list from your WhatsApp Commerce catalog — with native add-to-cart support.

Single product

{
  "BAAT_WAC_API": {
    "type": "interactive",
    "interactive": {
      "type": "product",
      "body": { "text": "Based on your order history, you might love this:" },
      "action": {
        "catalog_id": "your_catalog_id",
        "product_retailer_id": "SKU-VITC-50ML"
      }
    }
  }
}

Product list

{
  "BAAT_WAC_API": {
    "type": "interactive",
    "interactive": {
      "type": "product_list",
      "header": { "type": "text", "text": "Our bestsellers this week" },
      "body":   { "text": "Tap any product to view and add to cart." },
      "action": {
        "catalog_id": "your_catalog_id",
        "sections": [
          {
            "title": "Skincare",
            "product_items": [
              { "product_retailer_id": "SKU-VITC-50ML" },
              { "product_retailer_id": "SKU-NIAC-30ML" },
              { "product_retailer_id": "SKU-SPF50-100G" }
            ]
          }
        ]
      }
    }
  }
}

Common mistake: For product_list, header.type must be "text". Meta rejects image or video headers on product list messages even though those header types are valid for other interactive types.

6. Location request and address message

Baat passes these two types to Meta without checking them.

Location request

Asks the customer to share their location. Baat does not send the shared location on to your agent, so use this only if your team will read it in the Inbox.

{
  "BAAT_WAC_API": {
    "type": "interactive",
    "interactive": {
      "type": "location_request_message",
      "body": {
        "text": "Please share your location so we can show availability in your area."
      },
      "action": {
        "name": "send_location"
      }
    }
  }
}

Address message

Opens an address form inside WhatsApp. Check Meta’s documentation for the countries it supports.

{
  "BAAT_WAC_API": {
    "type": "interactive",
    "interactive": {
      "type": "address_message",
      "body": {
        "text": "Enter your delivery address to complete your order."
      },
      "action": {
        "name": "address_message",
        "parameters": {
          "country": "IN"
        }
      }
    }
  }
}

What your agent receives

Customer actionWhat Baat sends your agent
Types a messageThe text
Taps a reply buttonUser selected button {title : "…" , id :"…" }, plus a session parameter for each key:value pair in the button id
Picks a list rowUser selected list reply {title : "…", id: "…" }, plus a session parameter for each key:value pair in the row id
Submits a Flowflow_submitted, plus a session parameter for each submitted field
Shares a location, or sends audio, video or a documentNothing. Your team sees it in the Inbox

Every turn also carries conversation_id, merchant_id and contact_phone as session parameters.

When a message fails

  • Baat’s checks — if a payload breaks a rule above, such as a missing body.text or a fourth button, Baat does not send it. The message is saved with the status error and the reason

  • Meta’s errors — if Meta rejects the message, Baat saves Meta’s full error response as the reason

In the Inbox, point at the failed message’s status icon to read the reason. It usually names the field that is wrong.

Gotchas at a glance

MistakeWhat happensFix
Missing body.textBaat does not send itbody.text is required for button, list, cta_url, flow, product and product_list
Button title over 20 characters, or more than 3 buttonsBaat does not send itShorten the title, or use a list
More than 10 list rowsBaat does not send itSplit the options across messages
product_list header is not textBaat does not send itUse "header": {"type": "text", "text": "..."}
cta_url without "name": "cta_url"Baat does not send itSet action.name to "cta_url"
Flow without flow_action_payload.screen, and no screen called FIRST_SCREENMeta rejects itSet the screen to your Flow’s first screen
Button ids without key:value pairsNo session parameter is setWrite ids such as choice:yes, or match the text with an intent
Interactive message more than 24 hours after the customer’s last messageMeta rejects itOutside the 24-hour window, only approved templates can be sent

Related reading

Where this fits in the wider picture.

Need a hand?

Our team answers on WhatsApp, usually within a business day.

Contact support Book a demo