📦aldinokemal / go-whatsapp-web-multidevice
← 返回首页
GOWA - WhatsApp REST API with support for UI, Multi Account, Webhooks, and MCP, and Chatwoot. Built with Golang for efficient memory use.
⚖️ MIT#whatsapp#whatsapp-api#whatsapp-api-go#golang#golang-whatsapp🌐 gowa-docs.mintlify.site📅 创建于 2022-02-09🔄 更新于 2026-10-29

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有
GoWA Logo ## Go WhatsApp — Built for Efficient Memory Use

Patreon Greptile: The War on Bugs

If you're using this tool to generate income, consider supporting its development by becoming a Patreon member!

Your support helps ensure the project stays maintained and receives regular updates!


release version Build Image Binary Release

ARM, AMD64, and MCP Support

Download:

n8n Community Node

  • n8n package
  • Go to Settings → Community Nodes, enter @aldinokemal2104/n8n-nodes-gowa, and select Install.

Breaking Changes

  • v6
  • REST mode requires <binary> rest instead of <binary>.
    • Example: ./whatsapp rest instead of ./whatsapp.
  • MCP mode required <binary> mcp.
    • Example: ./whatsapp mcp.
  • v7
  • Starting with version 7.x, binaries are built with GoReleaser and can be downloaded from the latest release.
  • v8
  • Multi-device support: You can now connect and manage multiple WhatsApp accounts simultaneously in a single server instance.
  • New Device Management API: New endpoints under /devices manage multiple devices.
  • Device scoping required: All device-scoped REST API calls now require either:
    • X-Device-Id header, or
    • device_id query parameter.
    • If only one device is registered, it is used as the default.
  • WebSocket device scoping: Connect to /ws?device_id=<id> to scope the WebSocket connection to a specific device.
  • Remote UI support: CORS allows the Authorization and X-Device-Id headers, so a standalone web UI (for example, gowa-ui) hosted on another origin can call the API directly. GET /app/info exposes the version and media size limits. Because browsers cannot set headers on WebSocket connections, pass /ws?device_id=<id>&authorization=<base64(user:pass)> when Basic Auth is enabled (use TLS—the credential is visible in the URL).
  • Webhook payload changes: All webhook payloads now include a top-level device_id field identifying which device received the event:

    json { "event": "message", "device_id": "628123456789@s.whatsapp.net", "payload": { ... } }

  • v9

  • MCP and API are unified under rest: MCP is no longer a separate mode or process. Run ./whatsapp rest to serve both the REST API and MCP; MCP is available at /mcp (no standalone mcp subcommand). See MCP Server (Model Context Protocol) for migration details.
  • UI moved to a separate repository: The web dashboard is no longer bundled in this repo. It now lives at aldinokemal/gowa-ui and ships as a single self-contained gowa-ui.html. The server downloads the latest dashboard release at startup, verifies its SHA-256 digest, caches it under storages/ui/, and serves it at /. See Web dashboard (gowa-ui) for the APP_UI_* settings, supply-chain pinning, and air-gapped deployment.

Features

  • Send WhatsApp messages through the HTTP API. See docs/openapi.yaml for details.
  • MCP (Model Context Protocol) server support — Integrate with AI agents and tools using a standardized protocol.
  • Optional MCP OAuth 2.1 — Connect remote MCP clients that cannot supply a Basic Auth header. See MCP OAuth.
  • Mention users in message text and image, video, or file captions:
  • @phoneNumber
  • Example: Hello @628974812XXXX, @628974812XXXX
  • Ghost mentions (mention all) — Mention group participants without showing @phone in the message text.
  • Pass phone numbers in the mentions field to mention users without a visible @ in the message.
  • Use the special keyword @everyone to automatically mention all group participants.
  • Post WhatsApp status updates.
  • Mark incoming audio messages and voice notes as played.
  • Scheduled sends — Send any message later, once or on a daily, weekly, or monthly repeat.
  • Add scheduled_at (RFC3339) and timezone (IANA) to a send request; recurrence, weekdays, day_of_month, end_at, and occurrence_limit control repeats.
  • Schedules survive restarts and wait for an offline device; list, pause, resume, or cancel them at /send/schedules.
  • Send stickers — Automatically convert images to WebP sticker format.
  • Supports JPG, JPEG, PNG, WebP, and GIF formats.
  • Automatically resizes images to 512×512 pixels.
  • Preserves transparency in PNG images.
  • Animated WebP stickers are supported but must meet WhatsApp requirements:
    • Exactly 512×512 pixels.
    • Less than 500 KB.
    • No more than 10 seconds long.
    • If an animated sticker does not meet these requirements, resize it before uploading with a tool such as ezgif.com.
  • Compress images before sending.
  • Compress videos before sending.
  • Customize the OS name shown as the linked device name in WhatsApp:
  • --os=Chrome or --os=MyApplication
  • Basic Auth with multiple credentials:
  • --basic-auth=kemal:secret,toni:password,userName:secretPassword
  • Short form: -b=kemal:secret,toni:password,userName:secretPassword
  • Subpath deployment support:
  • --base-path="/gowa" allows deployment under a path such as /gowa.
  • Customizable port and debug mode:
  • --port 8000
  • --debug true
  • Automatic replies to incoming messages:
  • --autoreply="Don't reply to this message"
  • Automatically mark incoming messages as read:
  • --auto-mark-read=true
  • Automatically download media from incoming messages:
  • --auto-download-media=false disables automatic media downloads (default: true).
  • See Media storage and cleanup for storage locations and manual retention commands.
  • Ignore downloading status media:
  • --ignore-status-media=true disables downloading status media (default: false).
  • Automatically reject incoming calls:
  • --auto-reject-call=true or WHATSAPP_AUTO_REJECT_CALL=true (see Webhook Payload for call events).
  • Configurable presence on connect:
  • --presence-on-connect=unavailable or WHATSAPP_PRESENCE_ON_CONNECT=unavailable
  • available — Mark the account as online (suppresses phone notifications).
  • unavailable — Register the push name without going online (default; preserves phone notifications).
  • none — Skip presence entirely (the push name is not registered, so contacts may see - as the name).
  • Daily presence pulse:
  • --presence-pulse-enabled=true or WHATSAPP_PRESENCE_PULSE_ENABLED=true (default: true).
  • --presence-pulse-interval=24h controls how often each connected device is pulsed.
  • --presence-pulse-duration=5m controls how long the account stays available before returning to unavailable.
  • Webhooks for received messages and other events:
  • --webhook="http://yourwebhook.site/handler"
  • Short form: -w="http://yourwebhook.site/handler"
  • See Webhook Payload Documentation for details.
  • Per-device webhooks — Each device can have its own webhook URL and event filters.
  • Set via API: PATCH /devices/:device_id/webhook with {"webhook_url": "https://device-webhook.site/handler"}.
  • Get via API: GET /devices/:device_id/webhook.
  • When a device has a custom webhook, events for that device are sent to the device-specific URL.
  • When no device webhook is set, events fall back to the global webhook (--webhook).
  • Set webhook_url to an empty string with PATCH to clear it and use the global webhook.
  • Set WHATSAPP_WEBHOOK_DEVICE_MERGE_GLOBAL=true (or --webhook-device-merge-global=true) to make a device webhook an addition instead of a replacement: the global --webhook URLs still receive the device's events (signed with the global secret, filtered by WHATSAPP_WEBHOOK_EVENTS) while the device URL keeps its own secret and event filter.
  • Webhook signatures — Webhook requests include an HMAC-SHA-256 signature in the X-Hub-Signature-256 header. Set a private key with --webhook-secret or WHATSAPP_WEBHOOK_SECRET. The old published default secret is not used. If no secret is configured, the process generates a random key and logs a warning; that key changes on restart, so receivers should not rely on it.

Generate a stable key once, for example with openssl rand -hex 32, and set it with: - --webhook-secret="<generated key>" - Webhook payload documentation — For detailed schemas, security implementation, and integration examples, see Webhook Payload Documentation. - Webhook event filtering — Filter which events are forwarded to your webhook with: - --webhook-events="message,message.ack" (a comma-separated list), or - WHATSAPP_WEBHOOK_EVENTS=message,message.ack.

Available Webhook Events:

Event Description
message

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR