> For the complete documentation index, see [llms.txt](https://docs.channel360.co.za/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.channel360.co.za/api-usage/reply-to-a-customer/send-an-interactive-reply.md).

# Send an interactive reply

Reply to a customer with reply buttons, a list or a WhatsApp Flow.

Send reply buttons, a list or a WhatsApp Flow to a customer who has written to you in the last 24 hours.

{% hint style="info" %}
Interactive replies are partly supported. In conversation history they appear as a text message containing the JSON you sent.
{% endhint %}

## Choose a type

| Type                                | The customer sees                                                     | Use it for                                                       | What comes back                                     |
| ----------------------------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------- |
| [**Reply buttons**](#reply-buttons) | Up to 3 buttons under your message.                                   | A quick choice between a few options, such as yes or no.         | A `message:appUser` event when they tap a button.   |
| [**List**](#list)                   | One button that opens a menu of up to 10 options.                     | A choice from more options than fit on buttons.                  | A `message:appUser` event when they pick an option. |
| [**WhatsApp Flow**](#whatsapp-flow) | A button that opens a form inside WhatsApp, with one or more screens. | Collecting several answers at once, such as an application form. | A `flow:submission` event with all their answers.   |

All three are sent the same way. Only the `interactive` object changes.

## Before you start

* The customer's app user ID (`<APP_USER_ID>`), from the `message:appUser` webhook event. See [Reply to a customer](/api-usage/reply-to-a-customer.md).
* For a Flow: a published Flow and its Flow ID. See [WhatsApp Flow](#whatsapp-flow).

## Request

`POST` `/org/<ORG_ID>/whatsapp/appuser/<APP_USER_ID>/reply`

| Field         | Required | What to put                                                                                                                                                                                                                                                     |
| ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`        | Yes      | `"interactive"`                                                                                                                                                                                                                                                 |
| `interactive` | Yes      | The WhatsApp interactive object for your type, as in the sections below. Channel360 passes it to WhatsApp unchanged. See [Meta's interactive object reference](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages/#interactive-object). |

Every type can have an optional `header` (text, up to 60 characters), a `body` (required, up to 1,024 characters) and an optional `footer` (up to 60 characters).

To send these from JavaScript or Python, use the request from [Send a text reply](/api-usage/reply-to-a-customer/send-a-text-reply.md) and replace the body with the JSON after `-d`.

## Reply buttons

Up to 3 buttons. Each button needs an `id` you choose and a `title` the customer sees.

| Field            | Limit                                           |
| ---------------- | ----------------------------------------------- |
| `action.buttons` | 1 to 3 buttons                                  |
| `reply.title`    | Up to 20 characters                             |
| `reply.id`       | Up to 256 characters, unique within the message |

```bash
curl -X POST "https://channel360.co.za/v1.1/org/<ORG_ID>/whatsapp/appuser/<APP_USER_ID>/reply" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "interactive",
    "interactive": {
      "type": "button",
      "header": { "type": "text", "text": "Account options" },
      "body": { "text": "What would you like to do?" },
      "footer": { "text": "Choose an option below" },
      "action": {
        "buttons": [
          { "type": "reply", "reply": { "id": "view-details", "title": "View details" } },
          { "type": "reply", "reply": { "id": "update-settings", "title": "Update settings" } },
          { "type": "reply", "reply": { "id": "contact-support", "title": "Contact support" } }
        ]
      }
    }
  }'
```

When the customer taps a button, your webhook receives a `message:appUser` event.

## List

One button (`action.button`) opens a menu. Options are grouped into sections.

| Field                | Limit                                                              |
| -------------------- | ------------------------------------------------------------------ |
| `action.button`      | Up to 20 characters                                                |
| `action.sections`    | 1 to 10 sections, with **10 rows in total** across all of them     |
| `sections[].title`   | Up to 24 characters. Required when there is more than one section. |
| `rows[].id`          | Up to 200 characters, unique within the message                    |
| `rows[].title`       | Up to 24 characters                                                |
| `rows[].description` | Optional, up to 72 characters                                      |

```bash
curl -X POST "https://channel360.co.za/v1.1/org/<ORG_ID>/whatsapp/appuser/<APP_USER_ID>/reply" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "interactive",
    "interactive": {
      "type": "list",
      "header": { "type": "text", "text": "Help centre" },
      "body": { "text": "What do you need help with?" },
      "footer": { "text": "Please make your selection" },
      "action": {
        "button": "Choose",
        "sections": [
          {
            "title": "Support",
            "rows": [
              { "id": "billing", "title": "Billing question" },
              { "id": "delivery", "title": "Where is my order", "description": "Track a recent order" }
            ]
          }
        ]
      }
    }
  }'
```

When the customer picks an option, your webhook receives a `message:appUser` event.

## WhatsApp Flow

A Flow is a form that opens inside WhatsApp. You build the Flow in Meta's WhatsApp Manager, then send it through Channel360 by its Flow ID. **Channel360 does not create or edit Flows.**

### 1. Create the Flow in WhatsApp Manager

1. Sign in to [Meta Business Suite](https://business.facebook.com) and open **WhatsApp Manager**.
2. Select the **WhatsApp Business Account (WABA) that your Channel360 number belongs to**. A Flow can only be sent from a number on the same WABA it was created on.
3. Go to **Account tools → Flows** and select **Create Flow**.
4. Build the screens, then **Publish** the Flow. WhatsApp only delivers published Flows to customers.
5. Copy the **Flow ID** from the Flow's page.

See [Meta's guide to getting started with Flows](https://developers.facebook.com/docs/whatsapp/flows/gettingstarted).

### 2. Subscribe to the `flow:submission` event

The customer's answers arrive as a `flow:submission` webhook event. Make sure your webhook subscribes to it: in the web app, tick **Flow Submission** under **Settings → Developer Settings → Webhooks**. See [Receive delivery updates](/api-usage/receive-delivery-updates.md).

### 3. Send the Flow

The Flow settings go **inside** `interactive.action.parameters`.

| Parameter              | Required        | What to put                                                                                                                                                                                              |
| ---------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `flow_message_version` | Yes             | `"3"`                                                                                                                                                                                                    |
| `flow_id`              | Yes             | The Flow ID you copied from WhatsApp Manager.                                                                                                                                                            |
| `flow_cta`             | Yes             | The text on the button that opens the Flow, such as `"Start application"`.                                                                                                                               |
| `flow_token`           | Yes             | A value you generate, such as your own reference for this customer or request. It comes back in the `flow:submission` event, so use it to match the answers to your records and check it on your server. |
| `flow_action`          | No              | `"navigate"` (the default) opens the Flow on a screen you name.                                                                                                                                          |
| `flow_action_payload`  | With `navigate` | `{ "screen": "<FIRST_SCREEN_ID>" }` — the ID of the screen to open, from your Flow's design.                                                                                                             |

```bash
curl -X POST "https://channel360.co.za/v1.1/org/<ORG_ID>/whatsapp/appuser/<APP_USER_ID>/reply" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "interactive",
    "interactive": {
      "type": "flow",
      "header": { "type": "text", "text": "Store card application" },
      "body": { "text": "Apply in a few minutes, right here in WhatsApp." },
      "footer": { "text": "Powered by Channel Mobile" },
      "action": {
        "name": "flow",
        "parameters": {
          "flow_message_version": "3",
          "flow_id": "<FLOW_ID>",
          "flow_cta": "Start application",
          "flow_token": "<YOUR_REFERENCE>",
          "flow_action": "navigate",
          "flow_action_payload": { "screen": "<FIRST_SCREEN_ID>" }
        }
      }
    }
  }'
```

### 4. Read the answers

When the customer submits the Flow, your webhook receives `flow:submission`. The answers are in `passthroughPayload.interactive.nfm_reply.response_json`, a JSON **string** you need to parse. It includes your `flow_token`. See the [`flow:submission` example](/api-usage/receive-delivery-updates.md).

## Check it worked

The API returns `201` with `{ "messages": [ { … } ] }`. Your webhook then receives `message:delivery:channel` and `message:delivery:user`.

If WhatsApp rejects the object, the API returns `400` with WhatsApp's error message and code.

| What you see                                            | Why                                                                                           | What to do                                                               |
| ------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| **400** naming a field, such as `title`                 | A text is longer than WhatsApp allows, or there are too many buttons or rows.                 | Check the limits in the tables above.                                    |
| **400** about the Flow, or the customer does not get it | The Flow is still a draft, or it was created on a different WABA from your Channel360 number. | Publish the Flow, and check it is on the right WABA in WhatsApp Manager. |
| No `flow:submission` event arrives                      | Your webhook does not subscribe to it.                                                        | Tick **Flow Submission** on your webhook.                                |

## Next

{% content-ref url="/pages/MMPfEfAxW2dosIuGBfym" %}
[Match replies to your records](/api-usage/match-replies-to-your-records.md)
{% endcontent-ref %}
