Skip to main content

WhatsApp Setup

Overview

The WhatsApp channel uses a local or remote bridge service. Anyy talks to that bridge over HTTP, polls for incoming messages, and sends replies through the same bridge.

This is not the WhatsApp Cloud API adapter. Configure the bridge URL that matches the bridge you operate.

Prerequisites

  • A running WhatsApp bridge compatible with Anyy's bridge API.
  • The bridge URL.
  • Optional bridge token if the bridge requires authentication.
  • The JIDs or group ids you want to allow, if you do not want open pairing.

Setup

Create credentials

Start the bridge and complete any WhatsApp-side pairing required by that bridge. If the bridge uses an auth token, store it with Anyy.

Configure Anyy

Default local bridge:

anyy setup channels whatsapp --write-config

Custom bridge with token:

anyy setup channels whatsapp \
--set bridge_url=http://127.0.0.1:3000 \
--secret bridge_token='bridge-token' \
--write-config

Setup defaults:

FieldDefault
account_idpersonal
bridge_urlhttp://127.0.0.1:3000
dm_policypairing
group_policymention
poll_interval_ms2000
send_chunk_chars4000
media_max_bytes5242880

Start Gateway

anyy gateway start
anyy channels reload

Run doctor checks

anyy channels doctor whatsapp

Access Policy

Direct messages

The setup default is dm_policy: pairing. Use allowlist and allow_from with known sender JIDs for a stricter deployment.

Groups

The default group_policy: mention requires a mention alias in group chats. The setup helper writes mention_aliases: ["@anyy"].

Use allow_groups when only specific groups should be accepted.

Admins

WhatsApp access policy and messaging command authorization are separate layers.

Sessions

Each accepted chat JID maps to an Anyy session. Anyy records bridge message ids to avoid duplicate processing.

Media Support

Inbound media

WhatsApp advertises inbound media support through the bridge. Files are limited by media_max_bytes.

Outbound media

This adapter does not advertise native outbound media.

Commands

Use the shared messaging commands. In groups, include a configured mention alias when group_policy is mention.

Cron Delivery

anyy cron create \
--name "WhatsApp reminder" \
--schedule "30m" \
--prompt "Remind me to check the oven" \
--delivery-target current_user_default \
--delivery-channel whatsapp

Troubleshooting

  • Nothing arrives: confirm the bridge is running and reachable from the Anyy host.
  • 401 or auth errors: check bridge_token_ref.
  • Group chat ignored: mention @anyy or update mention_aliases.
  • Duplicate-looking messages: check bridge retry behavior and gateway logs.