Sends interactive messages (buttons, lists, CTAs) to users via WhatsApp.

Configuration

  • whatsapp_config_id: WhatsApp connection to use
  • interactive_type: button, list, cta_url, flow, product, product_list, catalog_message
  • body_text: Message content (string or AIField)
  • header_type: none, text, image, video, document (optional)
  • header_text: Header text for text headers (optional)
  • header_media_url: Media URL for image/video/document headers (optional)
  • footer_text: Footer text (optional)
  • provider_model_name: Required when using AIField
Type-specific options:
  • buttons: For button type
  • list_button_text, list_sections: For list type
  • cta_display_text, cta_url: For cta_url type
  • flow_id, flow_cta: For flow type

Examples

Button message
from kapso.builder.flows.nodes import SendInteractiveNode
from kapso.builder.flows.nodes.send_interactive import InteractiveButton

node = SendInteractiveNode(
    id="support_menu",
    whatsapp_config_id="config_123",
    interactive_type="button",
    body_text="How can we help you?",
    buttons=[
        InteractiveButton(id="support", title="Get Support"),
        InteractiveButton(id="billing", title="Billing Help")
    ]
)
List message
from kapso.builder.flows.nodes.send_interactive import ListSection, ListRow

node = SendInteractiveNode(
    id="services_menu",
    whatsapp_config_id="config_123",
    interactive_type="list",
    body_text="Choose a service:",
    header_type="text",
    header_text="Our Services",
    list_button_text="View Options",
    list_sections=[
        ListSection(
            title="Support",
            rows=[
                ListRow(id="tech", title="Tech Support"),
                ListRow(id="billing", title="Billing Help")
            ]
        )
    ]
)
CTA URL
node = SendInteractiveNode(
    id="cta_features",
    whatsapp_config_id="config_123",
    interactive_type="cta_url",
    body_text="Check out our latest features!",
    cta_display_text="Learn More",
    cta_url="https://example.com/features"
)
AI-generated content
from kapso.builder.ai.field import AIField

node = SendInteractiveNode(
    id="ai_menu",
    whatsapp_config_id="config_123",
    interactive_type="button",
    body_text=AIField("Create personalized menu options for {{user_name}}"),
    buttons=[
        InteractiveButton(id="personalized", title="For You"),
        InteractiveButton(id="browse", title="Browse All")
    ],
    provider_model_name="claude-3-5-sonnet-20241022"
)

Interactive types

  • button: Up to 3 reply buttons
  • list: Dropdown menu with sections
  • cta_url: Single button that opens URL
  • flow: WhatsApp Flow for data collection
  • product: Single product from catalog
  • product_list: Multiple products from catalog
  • catalog_message: Full catalog browser

Usage patterns

Decision collection Menu system