Sending WhatsApp Flows (Templates & Interactive API)

Once a WhatsApp Flow is drafted or published, businesses can dispatch it to customers through two primary methods:

  1. Business-Initiated Messages: Pre-approved WhatsApp Message Templates with a native Flow button (allowed outside the 24-hour customer service window).
  2. User-Initiated Messages: Interactive session messages sent via Cloud API (or bot builder card) within an active 24-hour conversation window.

1. Business-Initiated Flows via Message Templates

To initiate a conversation with a Flow, you must attach the Flow to an Approved WhatsApp Message Template using the FLOW button component.

Step 1: Create a Template with a Flow Button

When registering a template with Meta or inside SMSPort's Template Creator, declare a BUTTONS component with sub_type: "FLOW":

{
  "name": "annual_health_checkup_invite",
  "language": "en_US",
  "category": "MARKETING",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "Annual Health Checkup"
    },
    {
      "type": "BODY",
      "text": "Hello {{1}}, it's time for your yearly routine health checkup. Tap below to choose your doctor and slot."
    },
    {
      "type": "BUTTONS",
      "buttons": [
        {
          "type": "FLOW",
          "text": "Book Appointment",
          "flow_id": "123456789012345",
          "flow_action": "navigate",
          "navigate_screen": "APPOINTMENT"
        }
      ]
    }
  ]
}

Step 2: Send the Template via Cloud API

Once the template status changes from PENDING to APPROVED, dispatch the template with custom session parameters:

curl -X POST \
  "https://graph.facebook.com/v18.0/{FROM_PHONE_NUMBER_ID}/messages" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "+919876543210",
    "type": "template",
    "template": {
      "name": "annual_health_checkup_invite",
      "language": { "code": "en_US" },
      "components": [
        {
          "type": "body",
          "parameters": [
            { "type": "text", "text": "Aarav Sharma" }
          ]
        },
        {
          "type": "button",
          "sub_type": "flow",
          "index": "0",
          "parameters": [
            {
              "type": "action",
              "action": {
                "flow_token": "usr_9941_tok",
                "flow_action_data": {
                  "patient_id": "P-9842",
                  "preferred_centre": "Bengaluru Indiranagar"
                }
              }
            }
          ]
        }
      ]
    }
  }'

2. User-Initiated Conversations via Interactive Cloud API

Within an active 24-hour messaging window (or triggered by a customer's inbound message), you can dispatch a Flow dynamically using Meta's interactive message object with type: "flow".

Cloud API Interactive Flow Payload

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "+919876543210",
  "type": "interactive",
  "interactive": {
    "type": "flow",
    "header": {
      "type": "text",
      "text": "Fast-Track Loan Approval"
    },
    "body": {
      "text": "Hi Rahul, your pre-approved credit limit of ₹5,00,000 is ready. Tap below to verify your details and calculate your monthly EMI."
    },
    "footer": {
      "text": "Instant disbursement within 2 hours"
    },
    "action": {
      "name": "flow",
      "parameters": {
        "flow_message_version": "3",
        "flow_id": "987654321098765",
        "flow_cta": "Check Offer",
        "mode": "published",
        "flow_token": "loan_sess_88319a",
        "flow_action": "navigate",
        "flow_action_payload": {
          "screen": "LOAN_OFFER",
          "data": {
            "credit_limit": 500000,
            "interest_rate": 11.5,
            "borrower_name": "Rahul Verma"
          }
        }
      }
    }
  }
}

Parameter Reference

Parameter Type Required Description
flow_message_version String Yes Must strictly be "3".
flow_id String Yes (or flow_name) Unique numeric ID of the Flow assigned by Meta.
flow_name String Alternative Name of the Flow (only if flow_id is omitted).
flow_cta String Yes Text displayed on the WhatsApp CTA button (e.g., "Book Appointment"). Maximum 30 characters, no emoji.
mode String Optional "published" (default) or "draft" (for testing draft Flow revisions).
flow_token String Optional Unique business session token used to correlate incoming responses to user records.
flow_action String Optional "navigate" (opens screen directly) or "data_exchange" (calls endpoint first). Default is "navigate".
flow_action_payload.screen String Optional The ID of the entry screen to display first (e.g., "APPOINTMENT").
flow_action_payload.data Object Optional Non-empty JSON object passed directly into the entry screen's ${data} scope.

3. Sending Flows via SMSPort Visual Bot Builder

SMSPort makes sending Flows zero-code through the Visual Bot Builder:

  1. Open Chatbot > Visual Bot Builder.
  2. Add a Send WhatsApp Flow node to your conversation canvas.
  3. Select your desired Flow from the dropdown inventory.
  4. Specify the button CTA label (e.g., "Reserve Table", "Get Quote").
  5. Map initial input variables from preceding conversational responses (e.g., {{patient.name}}, {{user.city}}).
  6. Connect the node's On Completion edge to downstream actions (e.g., Google Sheets sync, CRM update, or agent notification).

4. Live Device Testing from SMSPort Console

Before sending a Flow in production:

  1. Navigate to /whatsapp-flows and click on your target Flow.
  2. In the right-hand Flow Actions drawer, select your sending phone number.
  3. Enter your personal WhatsApp mobile number with international country code (e.g., +919876543210).
  4. Select mode: "draft" to test the latest uncommitted draft changes.
  5. Click Send Test Message. Within seconds, you will receive the interactive Flow card on your mobile device to test live interaction.