Pass one of agent, team, or workflow to the Whatsapp constructor.
from agno.os.interfaces.whatsapp import WhatsappWhatsapp(agent=my_agent, prefix="/whatsapp")
Parameter
Type
Default
Description
agent
Optional[Union[Agent, RemoteAgent]]
None
Agno Agent instance.
team
Optional[Union[Team, RemoteTeam]]
None
Agno Team instance.
workflow
Optional[Union[Workflow, RemoteWorkflow]]
None
Agno Workflow instance.
prefix
str
"/whatsapp"
URL prefix for WhatsApp endpoints (e.g., /whatsapp means webhooks arrive at /whatsapp/webhook).
tags
Optional[List[str]]
None
FastAPI route tags for API documentation. Defaults to ["Whatsapp"].
show_reasoning
bool
False
When True, sends the model’s reasoning content as an italicized message before the main response.
send_user_number_to_context
bool
False
When True, injects the user’s phone number and incoming message ID into the agent’s context via dependencies.
access_token
Optional[str]
None
WhatsApp Business API access token. Falls back to WHATSAPP_ACCESS_TOKEN environment variable.
phone_number_id
Optional[str]
None
WhatsApp Business phone number ID. Falls back to WHATSAPP_PHONE_NUMBER_ID environment variable.
verify_token
Optional[str]
None
Webhook verification token. Falls back to WHATSAPP_VERIFY_TOKEN environment variable.
media_timeout
int
30
Timeout in seconds for media downloads from and uploads to Meta’s media API.
enable_encryption
bool
False
When True, encrypts user phone numbers with AES-256-GCM before storing them as user_id. Requires WHATSAPP_ENCRYPTION_KEY or the encryption_key parameter.
encryption_key
Optional[str]
None
32-byte hex key (64 characters) for phone number encryption. Falls back to WHATSAPP_ENCRYPTION_KEY environment variable.