Skip to main content
WhatsAppTools enable an Agent to send messages via the WhatsApp Business API: text, templates, images, documents, locations, reactions, and interactive messages (reply buttons, list menus).

Prerequisites

  1. Create a Meta Developer Account at the Meta Developer Portal.
  2. Create a new app at the Apps Dashboard and add the WhatsApp product.
  3. Get your Access Token and Phone Number ID from WhatsApp > API Setup.
For standalone use (outside the WhatsApp interface), also set a default recipient:
For first-time outreach to a user, you must use pre-approved message templates. Test messages can only be sent to numbers registered in your test environment.

Example

The following agent sends a template message using WhatsApp:
cookbook/91_tools/whatsapp_tools.py

Interactive Concierge Example

Use interactive features like reply buttons, list messages, and location pins:
See cookbook/05_agent_os/interfaces/whatsapp/interactive_concierge.py for a full example.

Toolkit Params

Toolkit Functions

Interactive Message Models

The toolkit includes Pydantic models for structured interactive messages: ReplyButton: A quick-reply button for send_reply_buttons.
  • id (str): Unique button identifier (e.g., "yes", "no").
  • title (str): Button display text, max 20 characters.
ListSection: A section for send_list_message, containing ListRow items.
  • title (str): Section heading.
  • rows (list of ListRow): Selectable rows.
ListRow: A selectable row inside a ListSection.
  • id (str): Unique row identifier.
  • title (str): Row title text.
  • description (str, optional): Row description.

Developer Resources