Skip to content
Letta Code Letta Code Letta Docs
Sign up
Features
Channels

WhatsApp

Connect WhatsApp to your Letta Code agent

Use a WhatsApp account you control. The default setup is self-chat only, which lets you talk to the agent by messaging yourself in WhatsApp and drops messages from other chats.

If you are using a dedicated WhatsApp number for the agent, you can disable self-chat only during setup. Letta Code will ask you to confirm that replies will appear under the linked WhatsApp number before continuing.

letta channels configure whatsapp

The interactive wizard will:

  • Auto-install the WhatsApp runtime dependencies
  • Ask whether to keep self-chat only enabled
  • Let you choose a DM policy (pairing, allowlist, or open)
  • Optionally bind the WhatsApp account to an agent for account-scoped routing
  • Let you choose group behavior (disabled, mention, or open)
  • Ask whether to download inbound media and transcribe voice memos when OPENAI_API_KEY is set

Config is written to ~/.letta/channels/whatsapp/accounts.json.

letta server --channels whatsapp

On first start, the listener prints a linked-device QR code. In WhatsApp, open Settings > Linked Devices > Link a Device and scan the QR code. Session state is stored under ~/.letta/channels/whatsapp/auth/.

For the default self-chat flow, message yourself in WhatsApp. With the default pairing DM policy, the chat receives a one-time pairing code. Complete the pairing from the CLI:

letta channels pair \
--channel whatsapp \
--code B5ZR5H \
--agent <your-agent-id> \
--conversation <your-conversation-id>

You can also pair from within an active Letta Code session:

/channels whatsapp pair B5ZR5H

For a dedicated agent number with an account-bound agent, direct chats can route according to the configured DM policy. Group messages route only when group mode is mention or open; set allowed_groups to restrict which groups the agent can see.

Messages from WhatsApp now flow into the agent’s conversation. The MessageChannel tool supports sending messages, reacting to messages, and uploading files on WhatsApp. Inbound media is downloaded only when you enabled that option during setup.