GOWA - WhatsApp REST API with support for UI, Multi Account, Webhooks, and MCP, and Chatwoot. Built with Golang for efficient memory use.
Go botgogolanggolang-whatsappgolang-whatsapp-apirestrest-apiwhatsappwhatsapp-apiwhatsapp-api-gowhatsapp-multi-devicewhatsapp-web-multi-device
Chatwoot integration
Use configuration and routing docs when changing setup,
routing modes, or import configuration. client.go owns REST calls, provision.go inbox setup,
client_registry.go destination routing, and sync.go history orchestration.
Direct Postgres changes have a scoped guide.
Routing and live sync
- Preserve device context on Chatwoot-to-WhatsApp sends. Once per-device configs
exist,
ClientRegistrymust not fall back to the global env inbox for an unmapped or disabled device. Numeric account/inbox IDs differ from API-channel identifiers. - Webhooks in
../../ui/rest/chatwoot.gobypass app Basic Auth and reject an empty effective secret unlessCHATWOOT_WEBHOOK_ALLOW_UNSIGNEDis set. A routed device's ownwebhook_secrettakes its place, on the shared endpoint too (chatwootWebhookRouteGate). Only outgoing messages send back to WhatsApp; preservesource_id = WAID:<message_id>and sent-message echo guards. - Persistent links support idempotency, replies, read/delete sync, and reverse routing. Preserve device/account/config scope; separate servers can reuse numeric IDs. Per-device webhook URLs disambiguate otherwise ambiguous agent-initiated sends.
- Install the client registry before starting the persistent forward-retry worker
in
../whatsapp/webhook_forward.go. - Private contacts use normalized phone lookup; groups and unresolved
@lidcontacts use identifiers/custom attributes. Keep API tokens and config secrets out of logs.
History import
- Direct Postgres import is separate from live REST forwarding and is supported only in legacy/env mode with the global DSN. Per-device configs use REST import.
- Direct import writes historical content/metadata. With
CHATWOOT_IMPORT_MEDIA_WITH_REST, downloadable media first goes through REST for attachments; shared source IDs prevent duplicate import. Preserve configurable placeholders for media that cannot be downloaded. SyncService.Close()closes its importer pool; preserve cleanup of cached sync services on shutdown. Use sync/registry tests for routing changes andpgimportsqlmock tests for direct SQL behavior.