Prerequisites
- Create a Meta Developer Account at the Meta Developer Portal.
- Create a new app at the Apps Dashboard and add the WhatsApp product.
- Get your Access Token and Phone Number ID from WhatsApp > API Setup.
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: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 ofListRow): Selectable rows.
ListRow: A selectable row inside a ListSection.
id(str): Unique row identifier.title(str): Row title text.description(str, optional): Row description.