Skip to main content
The WhatsApp channel gateway turns your WhatsApp account into a conversational interface for Polpo. Send messages, run commands, approve tasks, and manage your project — all from WhatsApp.
This integration uses the unofficial WhatsApp Web protocol via Baileys. It is intended for personal use only. For production/business use, implement the official WhatsApp Business API instead. Use at your own risk.
This page covers interactive messaging (talking to Polpo via WhatsApp). For one-way notification delivery (Polpo sending you alerts), see WhatsApp Notifications.

Setup

  1. Link your WhatsApp account by scanning a QR code:
    polpo whatsapp login
    
    Scan the QR code displayed in your terminal using WhatsApp on your phone (Settings > Linked Devices > Link a Device).
  2. Configure the gateway in polpo.json:
    {
      "settings": {
        "notifications": {
          "channels": {
            "whatsapp": {
              "type": "whatsapp",
              "gateway": {
                "enableInbound": true,
                "dmPolicy": "allowlist",
                "allowFrom": ["39123456789"]
              }
            }
          }
        }
      }
    }
    
  3. Start Polpo — the gateway activates automatically:
    polpo serve
    

Gateway Configuration

The gateway object on the WhatsApp channel enables inbound messaging:
FieldTypeDefaultDescription
enableInboundbooleanfalseEnable the conversational gateway
dmPolicystring"allowlist"Who can message: open, allowlist, pairing, disabled
allowFromstring[][]Phone numbers or peer IDs allowed to message. Use ["*"] for everyone
sessionIdleMinutesnumber60Auto-reset session after idle period

DM Policies

Control who can interact via WhatsApp:
PolicyBehavior
openAnyone who messages you can interact with Polpo
allowlistOnly users in allowFrom or the dynamic allowlist
pairingUnknown users get a pairing code; an admin approves to grant access
disabledInbound messages are silently ignored

Slash Commands

Send these as WhatsApp messages:
CommandDescription
/helpShow all available commands
/statusProject status — task counts, active agents, connected peers
/tasksList tasks with status
/missionsList missions
/agentsList agents with active/idle status
/approve [ID]List pending approvals, or approve a specific one
/reject ID [reason]Reject an approval with feedback
/newReset your conversation session
/pair CODEApprove a pairing request (admin only)

Free-Text Chat

Any message that isn’t a slash command is routed to Polpo’s agentic completions loop. You can ask questions, create tasks, get status updates, and request code changes — just like with the Telegram gateway. Each peer gets their own conversation session with history preserved across messages. Sessions auto-reset after the configured idle period (default: 60 minutes), or manually with /new.

CLI Commands

Manage the WhatsApp connection from the command line:
CommandDescription
polpo whatsapp loginLink device via QR code scan
polpo whatsapp statusCheck connection and auth status
polpo whatsapp logoutRemove stored credentials and disconnect

Peer Identity

Each WhatsApp user is identified by their phone number: whatsapp:{phoneNumber} (e.g. whatsapp:39123456789). You can link WhatsApp and Telegram identities to share sessions across channels — see Peer Identity.

Example Configurations

Personal Use (open)

{
  "gateway": {
    "enableInbound": true,
    "dmPolicy": "open"
  }
}

Allowlist

{
  "gateway": {
    "enableInbound": true,
    "dmPolicy": "allowlist",
    "allowFrom": ["39123456789", "44987654321"]
  }
}
With "dmPolicy": "open", anyone who messages your WhatsApp number can interact with Polpo and control your agents. Use allowlist or pairing for any non-personal deployment.