WhatsApp API Multi Device Version

by aldinokemal

Not rated
GitHub

About

A multi-device WhatsApp API server for AI agents and tools.

Details

Author
aldinokemal
Categories
Communication, Other, API

Docker (you don't need to install in required)

- Clone this repo:git clone https://github.com/aldinokemal/go-whatsapp-web-multidevice - Open the folder that was cloned via cmd/terminal. - rundocker-compose up -d --build - openhttp://localhost:3000 - Clone this repogit clone https://github.com/aldinokemal/go-whatsapp-web-multidevice - Open the folder that was cloned via cmd/terminal. - runcd src - run - Linux & MacOS:go build -o whatsapp2. Windows (CMD / PowerShell):go build -o whatsapp.exe - Linux & MacOS:./whatsapp rest(for REST API mode) - run./whatsapp --helpfor more detail flags - Windows:.\whatsapp.exe rest(for REST API mode) - run.\whatsapp.exe --helpfor more detail flags

If you want to build for Raspberry Pi or other ARM devices without needing a C toolchain (CGO), you can use thepuregobuild tag. This will use a pure-Go SQLite implementation.
- Clone this repogit clone https://github.com/aldinokemal/go-whatsapp-web-multidevice
- Open the folder that was cloned via cmd/terminal.
- runcd src
- Build for Raspberry Pi Zero / 1 (ARMv6):

CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -tags purego -o whatsapp-armv6
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -tags purego -o whatsapp-armv7

- If you built ARMv6:./whatsapp-armv6 rest

- If you built ARMv7:./whatsapp-armv7 rest

MCP is not a separate mode or process — it's served by the REST server itself. Whenever./whatsapp restis running, the MCP endpoint is available athttp://<host>:<port><base-path>/mcp(defaulthttp://localhost:3000/mcp) using the streamable HTTP transport. Disable it withMCP_ENABLED=falseor--mcp-enabled=false(default: enabled).

There are 5 consolidated tools; agents pick behavior via atype/actionargument instead of one tool per operation:

For multi-device deployments, theX-Device-Idheader on the MCP client connection selects the device used by every tool call on that connection (falls back to the default device if omitted, same as REST). Any individual call can override it with an optionaldevice_idargument.

Point your MCP client at the/mcpendpoint. It inherits the REST server's basic auth, so include the sameAuthorizationheader your REST calls use:

{ "mcpServers": { "whatsapp": { "url": "http://localhost:3000/mcp", "headers": { "Authorization": "Basic dXNlcjpzZWNyZXQ=", "X-Device-Id": "628123456789" } } } }

headersis optional: includeAuthorizationonly when basic auth is configured, andX-Device-Idonly for multi-device setups.

- ./whatsapp mcp./whatsapp rest(MCP is now included automatically)
- http://localhost:8080/ssehttp://localhost:3000/mcp
- 40 granular tools → 5 consolidated tools (agents pick actions via thetype/actionfield)

docker run --detach --publish=3000:3000 --name=whatsapp --restart=always --volume=$(docker volume create --name=whatsapp):/app/storages aldinokemal2104/go-whatsapp-web-multidevice rest --autoreply="Dont't reply this message please"
docker run --detach --publish=3000:3000 --name=whatsapp --restart=always --volume=$(docker volume create --name=whatsapp):/app/storages ghcr.io/aldinokemal/go-whatsapp-web-multidevice rest --autoreply="Dont't reply this message please"

createdocker-compose.ymlfile with the following configuration:

services: whatsapp: image: aldinokemal2104/go-whatsapp-web-multidevice container_name: whatsapp restart: always ports: - "3000:3000" volumes: - whatsapp:/app/storages command: - rest - --basic-auth=admin:admin - --port=3000 - --debug=true - --os=Chrome - --account-validation=false volumes: whatsapp:
services: whatsapp: image: ghcr.io/aldinokemal/go-whatsapp-web-multidevice container_name: whatsapp restart: always ports: - "3000:3000" volumes: - whatsapp:/app/storages command: - rest - --basic-auth=admin:admin - --port=3000 - --debug=true - --os=Chrome - --account-validation=false volumes: whatsapp:
services: whatsapp: image: aldinokemal2104/go-whatsapp-web-multidevice container_name: whatsapp restart: always ports: - "3000:3000" volumes: - whatsapp:/app/storages environment: - APP_BASIC_AUTH=admin:admin - APP_PORT=3000 - APP_DEBUG=true - APP_OS=Chrome - WHATSAPP_ACCOUNT_VALIDATION=false volumes: whatsapp:

or with env file (GitHub Container Registry):

services: whatsapp: image: ghcr.io/aldinokemal/go-whatsapp-web-multidevice container_name: whatsapp restart: always ports: - "3000:3000" volumes: - whatsapp:/app/storages environment: - APP_BASIC_AUTH=admin:admin - APP_PORT=3000 - APP_DEBUG=true - APP_OS=Chrome - WHATSAPP_ACCOUNT_VALIDATION=false volumes: whatsapp:

- Served at/mcpby the REST server (streamable HTTP transport) wheneverMCP_ENABLEDis true; withAPP_BASE_PATHset, the route is<base-path>/mcp.
- Available tools are listed in the "Available MCP Tools" section above.
- Compatible with MCP-enabled AI tools and agents

- Check](https://www.google.com/search?q=windows+add+to+environment+path)docs/openapi.yamlfor detailed API specifications.
- Use
SwaggerEditorto visualize the API.
- Generate HTTP clients using
openapi-generator.

✅ = Available ❌ = Not Available Yet  = Has known limitations (see notes below)

- User My Groups: Returns a maximum of 500 groups due to WhatsApp protocol limitation. This is enforced by WhatsApp servers, not this API. Seewhatsmeow sourcefor details.
- /healthis public and always registered at the root path, even whenAPP_BASE_PATHis set.
- Chatwoot routes are registered only whenCHATWOOT_ENABLED=true.

- Setup MCP (tested in cursor)
- Test MCP

- Successfully setup MCP

The dashboard lives in its own repository:aldinokemal/gowa-ui. Each gowa-ui release publishes a single self-containedgowa-ui.html; the server downloads the latest release at startup (and everyAPP_UI_UPDATE_INTERVAL, default 3h), verifies its sha256 digest, caches it understorages/ui/, and serves it at/behind basic auth.

Trust model: the release digest proves the download matches what GitHub advertises, not who published it. Operators who audit a specific build can pin it withAPP_UI_ASSET_SHA256(each release ships a.sha256asset — this is the only setting that pins an exact build), pointAPP_UI_REPOat a fork they control (the updater still tracks that repo's latest release), or pre-seed the cache and disable auto-update entirely.

Air-gapped servers: place a downloadedgowa-ui.htmlatstorages/ui/index.htmland setAPP_UI_AUTO_UPDATE=false. The dashboard can also be self-hosted anywhere static and pointed at this server's URL (see the gowa-ui readme).

- Please do this if you have an error (invalid flag in pkg-config --cflags: -Xpreprocessor)export CGO_CFLAGS_ALLOW="-Xpreprocessor"

- This project is unofficial and not affiliated with WhatsApp.
- Please use official WhatsApp API to avoid any issues.

An MCP server for Claude that integrates with the Evolution API for WhatsApp automation.

Connect WasenderAPI to AI agents and automation tools using the Model Context Protocol. This remote MCP server exposes WhatsApp session management, messaging, contacts, and groups as callable tools for MCP-compatible platforms

Send and receive messages using the WhatsApp API.

Interact with the YCloud WhatsApp API to send and manage messages.

A multi-device WhatsApp API server for AI agents and tools.

Golang WhatsApp - Built with Go for efficient memory use

If you're using this tools to generate income, consider supporting its development by becoming a Patreon member!Your support helps ensure the library stays maintained and receives regular updates!

Support for ARM & AMD Architecture along with MCP Support

- Release
-
Docker Hub
-
GitHub Container Registry

- n8n package
- Go to Settings -> Community Nodes -> Input@aldinokemal2104/n8n-nodes-gowa-> Install

- v6

- For REST mode, you need to run<binary> restinstead of<binary>

- for example:./whatsapp restinstead of./whatsapp
- For MCP mode, you need to run<binary> mcp
- for example:./whatsapp mcp

- Starting version 7.x we are using goreleaser to build the binary, so you can download the binary fromrelease

- 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/devicesfor managing multiple devices
- Device scoping required: All device-scoped REST API calls now require either:
- X-Device-Idheader, or -device_idquery parameter - If only one device is registered, it will be used as the default
- WebSocket device scoping: Connect to/ws?device_id=<id>to scope WebSocket to a specific device
- Remote UI support: CORS allows theAuthorizationandX-Device-Idheaders, so a standalone web UI (e.g.
gowa-ui) hosted on another origin can call the API directly.GET /app/infoexposes version and media size limits. Since 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-leveldevice_idfield identifying which device received the event:

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

- MCP and API are unified underrest: MCP is no longer a separate mode or process. Run./whatsapp restto serve both the REST API and MCP; MCP is available at/mcp(no standalonemcpsubcommand). SeeMCP 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 ataldinokemal/gowa-uiand ships as a single self-containedgowa-ui.html. This server is now a pure API backend that downloads the latest dashboard release at startup, verifies its sha256 digest, caches it understorages/ui/, and serves it at/. SeeWeb dashboard (gowa-ui)for theAPP_UI_settings, supply-chain pinning, and air-gapped deployment.

- Send WhatsApp message via http API,docs/openapi.yamlfor more details
- MCP (Model Context Protocol) Server Support- Integrate with AI agents and tools using standardized protocol
- Mention someone

- @phoneNumber

- example:Hello @628974812XXXX, @628974812XXXX

- Pass phone numbers inmentionsfield to mention users without visible@in message

- Use special keyword@everyoneto automatically mention ALL group participants
- UI checkbox available in Send Message modal for groups

- Supports JPG, JPEG, PNG, WebP, and GIF formats

- Automatic resizing to 512x512 pixels
- Preserves transparency for PNG images
- Animated WebP stickersare supported but must meet WhatsApp requirements:
- Must be exactly512x512 pixels- Must be under500KBfile size - Maximum10 secondsduration - If your animated sticker doesn't meet these requirements, please resize it before uploading using tools like
ezgif.com

- --basic-auth=kemal:secret,toni:password,userName:secretPassword, or you can simplify

- -b=kemal:secret,toni:password,userName:secretPassword

- --base-path="/gowa"(allows deployment under a specific path like/gowa/sub/path)

- --autoreply="Don't reply this message"

- --auto-mark-read=true(automatically marks incoming messages as read)

- --auto-download-media=false(disable automatic media downloads, default:true)

- --auto-reject-call=trueorWHATSAPP_AUTO_REJECT_CALL=true(seeWebhook Payloadfor call events)

- --presence-on-connect=unavailableorWHATSAPP_PRESENCE_ON_CONNECT=unavailable

- available— mark as online (suppresses phone notifications)
-
unavailable— register pushname without going online (default, preserves phone notifications)
-
none— skip presence entirely (pushname won't be registered, contacts may see "-" as name)

- --presence-pulse-enabled=trueorWHATSAPP_PRESENCE_PULSE_ENABLED=true(default:true)

- --presence-pulse-interval=24hcontrols how often each connected device is pulsed
-
--presence-pulse-duration=5mcontrols how long the account staysavailablebefore returning tounavailable

- --webhook="http://yourwebhook.site/handler", or you can simplify

- -w="http://yourwebhook.site/handler"
- for more detail, see
Webhook Payload Documentation

- Set via API:PATCH /devices/:device_id/webhookwith{"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 to empty string
""via PATCH to clear and use global webhook

- --webhook-ignore-jids="@g.us,628123456789@s.whatsapp.net"(comma-separated list)

- Or environment variable:WHATSAPP_WEBHOOK_IGNORE_JIDS=@g.us
- Supports the
@g.us/@s.whatsapp.net/@lidwildcards (match a whole address space) and exact JIDs.
- This filters by conversation/sender and is independent of
--webhook-events(which filters by event type). The Chatwoot integration keeps its ownCHATWOOT_IGNORE_JIDS.

tls: failed to verify certificate: x509: certificate signed by unknown authority

- --webhook-insecure-skip-verify=true

- Or environment variable:WHATSAPP_WEBHOOK_INSECURE_SKIP_VERIFY=trueSecurity Warning: This option disables TLS certificate verification and should only be used in:

- Cloudflare tunnels (which provide their own security layer)
- Internal networks with self-signed certificatesFor production environments, it's strongly recommended to use proper SSL certificates (e.g., Let's Encrypt) instead of disabling verification.

You can configure the application using either command-line flags (shown above) or environment variables. Configuration can be set in three ways (in order of priority):
- Command-line flags (highest priority)
- Environment variables
-
.envfile (lowest priority)

You can configure the application using environment variables. Configuration can be set in three ways (in order of priority):
- Command-line flags (highest priority)
- Environment variables
-
.envfile (lowest priority)
- Copy
.env.exampleto.envin your project root (cp src/.env.example src/.env)
- Modify the values in
.envaccording to your needs
- Or set the same variables as system environment variables

- For detailed webhook payload schemas, security implementation, and integration examples, seeWebhook Payload Documentation
- For comprehensive Chatwoot integration guide, see
Chatwoot Integration Documentation

Note: Command-line flags will override any values set in environment variables or.envfile.

- Go 1.25.5 or higher(for building from source)
- FFmpeg(for media processing)

- Linux (x86_64, ARM64)
- macOS (Intel, Apple Silicon)
- Windows (x86_64) - WSL recommended

- Mac OS:

- brew install ffmpeg webp

- export CGO_CFLAGS_ALLOW="-Xpreprocessor"

- sudo apt update

- sudo apt install ffmpeg webp

- Install ffmpeg:download here

- Install libwebp:download here(extract and addbinfolder to PATH)
- Add both to
environment variable

Note: Thewebppackage providescwebp(encoder),dwebp(decoder), andwebpmux(frame extractor) tools. FFmpeg is required for media processing. The libwebp tools (webpmux+dwebp) are used for animated WebP sticker support.
- Clone this repo:
git clone https://github.com/aldinokemal/go-whatsapp-web-multidevice
- Open the folder that was cloned via cmd/terminal.
- run
cd src
- run
go run . rest(for REST API mode)
- Open
http://localhost:3000

Docker (you don't need to install in required)

- Clone this repo:
git clone https://github.com/aldinokemal/go-whatsapp-web-multidevice - Open the folder that was cloned via cmd/terminal. - rundocker-compose up -d --build - openhttp://localhost:3000 - Clone this repogit clone https://github.com/aldinokemal/go-whatsapp-web-multidevice - Open the folder that was cloned via cmd/terminal. - runcd src - run - Linux & MacOS:go build -o whatsapp2. Windows (CMD / PowerShell):go build -o whatsapp.exe - Linux & MacOS:./whatsapp rest(for REST API mode) - run./whatsapp --helpfor more detail flags - Windows:.\whatsapp.exe rest(for REST API mode) - run.\whatsapp.exe --helpfor more detail flags

If you want to build for Raspberry Pi or other ARM devices without needing a C toolchain (CGO), you can use thepuregobuild tag. This will use a pure-Go SQLite implementation.
- Clone this repo
git clone https://github.com/aldinokemal/go-whatsapp-web-multidevice
- Open the folder that was cloned via cmd/terminal.
- run
cd src
- Build for Raspberry Pi Zero / 1 (ARMv6):

CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -tags purego -o whatsapp-armv6
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -tags purego -o whatsapp-armv7

- If you built ARMv6:./whatsapp-armv6 rest

- If you built ARMv7:./whatsapp-armv7 rest

MCP is not a separate mode or process — it's served by the REST server itself. Whenever./whatsapp restis running, the MCP endpoint is available athttp://<host>:<port><base-path>/mcp(defaulthttp://localhost:3000/mcp) using the streamable HTTP transport. Disable it withMCP_ENABLED=falseor--mcp-enabled=false(default: enabled).

There are 5 consolidated tools; agents pick behavior via atype/actionargument instead of one tool per operation:

For multi-device deployments, theX-Device-Idheader on the MCP client connection selects the device used by every tool call on that connection (falls back to the default device if omitted, same as REST). Any individual call can override it with an optionaldevice_idargument.

Point your MCP client at the/mcpendpoint. It inherits the REST server's basic auth, so include the sameAuthorizationheader your REST calls use:

{ "mcpServers": { "whatsapp": { "url": "http://localhost:3000/mcp", "headers": { "Authorization": "Basic dXNlcjpzZWNyZXQ=", "X-Device-Id": "628123456789" } } } }

headersis optional: includeAuthorizationonly when basic auth is configured, andX-Device-Idonly for multi-device setups.

- ./whatsapp mcp./whatsapp rest(MCP is now included automatically)
-
http://localhost:8080/ssehttp://localhost:3000/mcp
- 40 granular tools → 5 consolidated tools (agents pick actions via the
type/actionfield)

docker run --detach --publish=3000:3000 --name=whatsapp --restart=always --volume=$(docker volume create --name=whatsapp):/app/storages aldinokemal2104/go-whatsapp-web-multidevice rest --autoreply="Dont't reply this message please"
docker run --detach --publish=3000:3000 --name=whatsapp --restart=always --volume=$(docker volume create --name=whatsapp):/app/storages ghcr.io/aldinokemal/go-whatsapp-web-multidevice rest --autoreply="Dont't reply this message please"

createdocker-compose.ymlfile with the following configuration:

services: whatsapp: image: aldinokemal2104/go-whatsapp-web-multidevice container_name: whatsapp restart: always ports: - "3000:3000" volumes: - whatsapp:/app/storages command: - rest - --basic-auth=admin:admin - --port=3000 - --debug=true - --os=Chrome - --account-validation=false volumes: whatsapp:
services: whatsapp: image: ghcr.io/aldinokemal/go-whatsapp-web-multidevice container_name: whatsapp restart: always ports: - "3000:3000" volumes: - whatsapp:/app/storages command: - rest - --basic-auth=admin:admin - --port=3000 - --debug=true - --os=Chrome - --account-validation=false volumes: whatsapp:
services: whatsapp: image: aldinokemal2104/go-whatsapp-web-multidevice container_name: whatsapp restart: always ports: - "3000:3000" volumes: - whatsapp:/app/storages environment: - APP_BASIC_AUTH=admin:admin - APP_PORT=3000 - APP_DEBUG=true - APP_OS=Chrome - WHATSAPP_ACCOUNT_VALIDATION=false volumes: whatsapp:

or with env file (GitHub Container Registry):

services: whatsapp: image: ghcr.io/aldinokemal/go-whatsapp-web-multidevice container_name: whatsapp restart: always ports: - "3000:3000" volumes: - whatsapp:/app/storages environment: - APP_BASIC_AUTH=admin:admin - APP_PORT=3000 - APP_DEBUG=true - APP_OS=Chrome - WHATSAPP_ACCOUNT_VALIDATION=false volumes: whatsapp:

- Served at/mcpby the REST server (streamable HTTP transport) wheneverMCP_ENABLEDis true; withAPP_BASE_PATHset, the route is<base-path>/mcp.
- Available tools are listed in the "Available MCP Tools" section above.
- Compatible with MCP-enabled AI tools and agents

- Checkdocs/openapi.yamlfor detailed API specifications.
- Use
SwaggerEditorto visualize the API.
- Generate HTTP clients using
openapi-generator.

✅ = Available ❌ = Not Available Yet  = Has known limitations (see notes below)

- *User My Groups: Returns a maximum of 500 groups due to WhatsApp protocol limitation. This is enforced by WhatsApp servers, not this API. Seewhatsmeow sourcefor details.
-
/healthis public and always registered at the root path, even whenAPP_BASE_PATHis set.
- Chatwoot routes are registered only when
CHATWOOT_ENABLED=true.

- Setup MCP (tested in cursor)
- Test MCP

- Successfully setup MCP

The dashboard lives in its own repository:aldinokemal/gowa-ui. Each gowa-ui release publishes a single self-containedgowa-ui.html; the server downloads the latest release at startup (and everyAPP_UI_UPDATE_INTERVAL, default 3h), verifies its sha256 digest, caches it understorages/ui/, and serves it at/behind basic auth.

Trust model: the release digest proves the download matches what GitHub advertises, not who published it. Operators who audit a specific build can pin it withAPP_UI_ASSET_SHA256(each release ships a.sha256asset — this is the only setting that pins an exact build), pointAPP_UI_REPOat a fork they control (the updater still tracks that repo's latest release), or pre-seed the cache and disable auto-update entirely.

Air-gapped servers: place a downloadedgowa-ui.htmlatstorages/ui/index.htmland setAPP_UI_AUTO_UPDATE=false. The dashboard can also be self-hosted anywhere static and pointed at this server's URL (see the gowa-ui readme).

- Please do this if you have an error (invalid flag in pkg-config --cflags: -Xpreprocessor)export CGO_CFLAGS_ALLOW="-Xpreprocessor"`

- This project is unofficial and not affiliated with WhatsApp.
- Please use official WhatsApp API to avoid any issues.

An MCP server for Claude that integrates with the Evolution API for WhatsApp automation.

Connect WasenderAPI to AI agents and automation tools using the Model Context Protocol. This remote MCP server exposes WhatsApp session management, messaging, contacts, and groups as callable tools for MCP-compatible platforms

Send and receive messages using the WhatsApp API.

Interact with the YCloud WhatsApp API to send and manage messages.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.