Labsco
aldinokemal logo

WhatsApp API Multi Device Version

β˜… 4,200

from aldinokemal

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

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

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

Download:

  • Release

  • Docker Hub

  • GitHub Container Registry

Support n8n package (n8n.io)

  • n8n package

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

Breaking Changes

  • v6

  • For REST mode, you need to run <binary> rest instead of <binary>

  • for example: ./whatsapp rest instead of ./whatsapp
  • For MCP mode, you need to run <binary> mcp
  • for example: ./whatsapp mcp
  • v7

  • Starting version 7.x we are using goreleaser to build the binary, so you can download the binary from 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 for managing 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 will be used as the default
  • WebSocket device scoping: Connect to /ws?device_id=<id> to scope WebSocket to a specific device

  • Webhook payload changes: All webhook payloads now include a top-level device_id field identifying which device received the event:

Copy & paste β€” that's it
```json 
{ 
 "event": "message", 
 "device_id": "[emailΒ protected]", 
 "payload": { ... } 
} 
Copy & paste β€” that's it

Feature

  • Send WhatsApp message via http API, docs/openapi.yaml for more details

  • MCP (Model Context Protocol) Server Support - Integrate with AI agents and tools using standardized protocol

  • Mention someone

  • @phoneNumber

  • example: Hello @628974812XXXX, @628974812XXXX

  • Ghost Mentions (Mention All) - Mention group participants without showing @phone in message text

  • Pass phone numbers in mentions field to mention users without visible @ in message

  • Use special keyword @everyone to automatically mention ALL group participants

  • UI checkbox available in Send Message modal for groups

  • Post Whatsapp Status

  • Send Stickers - Automatically converts images to WebP sticker format

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

  • Automatic resizing to 512x512 pixels

  • Preserves transparency for PNG images

  • Animated WebP stickers are supported but must meet WhatsApp requirements:

  • Must be exactly 512x512 pixels
  • Must be under 500KB file size
  • Maximum 10 seconds duration
  • If your animated sticker doesn't meet these requirements, please resize it before uploading using tools like ezgif.com
  • Compress image before send

  • Compress video before send

  • Change OS name become your app (it's the device name when connect via mobile)

  • --os=Chrome or --os=MyApplication

  • Basic Auth (able to add multi credentials)

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

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

  • Subpath deployment support

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

  • Customizable port and debug mode

  • --port 8000

  • --debug true

  • Auto reply message

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

  • Auto mark read incoming messages

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

  • Auto download media from incoming messages

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

  • Auto 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 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)

  • 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

  • Webhook for received message

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

  • -w="http://yourwebhook.site/handler"

  • for more detail, see Webhook Payload Documentation

  • Per-Device Webhook - Each device can have its own webhook URL

  • 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 to empty string "" via PATCH to clear and use global webhook

  • Webhook Secret Our webhook will be sent to you with an HMAC header and a sha256 default key secret. You may modify this by using the option below:

  • --webhook-secret="secret"

  • Webhook Payload DocumentationFor detailed webhook payload schemas, security implementation, and integration examples, see Webhook Payload Documentation

  • Webhook Event FilteringYou can filter which events are forwarded to your webhook using:

  • --webhook-events="message,message.ack" (comma-separated list)

  • Or environment variable: WHATSAPP_WEBHOOK_EVENTS=message,message.ack Available Webhook Events: | Event | Description | | ------------------ | --------------------------------------------- | | message | Text, media, contact, location messages | | message.reaction | Emoji reactions to messages | | message.revoked | Deleted/revoked messages | | message.edited | Edited messages | | message.ack | Delivery and read receipts | | message.deleted | Messages deleted for the user | | chat_presence | Typing and recording indicators from contacts | | group.participants | Group member join/leave/promote/demote events | | group.joined | You were added to a group | | label.edit | WhatsApp label metadata changed | | label.association | Label applied to or removed from a chat | | newsletter.joined | You subscribed to a newsletter/channel | | newsletter.left | You unsubscribed from a newsletter | | newsletter.message | New message(s) posted in a newsletter | | newsletter.mute | Newsletter mute setting changed | | call.offer | Incoming call received | If not configured (empty), all events will be forwarded.

  • Webhook TLS Configuration If you encounter TLS certificate verification errors when using webhooks (e.g., with Cloudflare tunnels or self-signed certificates):

Copy & paste β€” that's it
tls: failed to verify certificate: x509: certificate signed by unknown authority 

You can disable TLS certificate verification using:

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

  • Or environment variable: WHATSAPP_WEBHOOK_INSECURE_SKIP_VERIFY=true Security Warning: This option disables TLS certificate verification and should only be used in:

  • Development/testing environments

  • Cloudflare tunnels (which provide their own security layer)

  • Internal networks with self-signed certificates For production environments, it's strongly recommended to use proper SSL certificates (e.g., Let's Encrypt) instead of disabling verification.

Current API

MCP (Model Context Protocol) API

  • MCP server provides standardized tools for AI agents to interact with WhatsApp

  • Supports Server-Sent Events (SSE) transport

  • Available tools are listed in the "Available MCP Tools" section above.

  • Compatible with MCP-enabled AI tools and agents

HTTP REST API

  • Check docs/openapi.yaml for detailed API specifications.

  • Use SwaggerEditor to visualize the API.

  • Generate HTTP clients using openapi-generator.

Feature Menu Method URL βœ… Health Check GET /health βœ… List Devices GET /devices βœ… Add Device POST /devices βœ… Get Device Info GET /devices/:device_id βœ… Remove Device DELETE /devices/:device_id ❌ Login Device (QR, reserved) GET /devices/:device_id/login ❌ Login Device (Code, reserved) POST /devices/:device_id/login/code βœ… Logout Device POST /devices/:device_id/logout βœ… Reconnect Device POST /devices/:device_id/reconnect βœ… Get Device Status GET /devices/:device_id/status βœ… Get Device Webhook GET /devices/:device_id/webhook βœ… Set Device Webhook PATCH /devices/:device_id/webhook βœ… Login with Scan QR GET /app/login βœ… Login With Pair Code GET /app/login-with-code βœ… Passkey Pairing Status GET /app/passkey βœ… Passkey Pairing Response POST /app/passkey/response βœ… Passkey Pairing Confirm POST /app/passkey/confirm βœ… Logout GET /app/logout βœ… Reconnect GET /app/reconnect βœ… Devices GET /app/devices βœ… Connection Status GET /app/status βœ… User Info GET /user/info βœ… User Avatar GET /user/avatar βœ… User Change Avatar POST /user/avatar βœ… User Change PushName POST /user/pushname βœ… User My Groups* GET /user/my/groups βœ… User My Newsletter GET /user/my/newsletters βœ… User My Privacy Setting GET /user/my/privacy βœ… User My Contacts GET /user/my/contacts βœ… User Check GET /user/check βœ… User Business Profile GET /user/business-profile βœ… Send Message POST /send/message βœ… Send Image POST /send/image βœ… Send Audio POST /send/audio βœ… Send File POST /send/file βœ… Send Video POST /send/video βœ… Send Sticker POST /send/sticker βœ… Send Contact POST /send/contact βœ… Send Link POST /send/link βœ… Send Location POST /send/location βœ… Send Poll / Vote POST /send/poll βœ… Send Presence POST /send/presence βœ… Send Chat Presence (Typing Indicator) POST /send/chat-presence βœ… Revoke Message POST /message/:message_id/revoke βœ… React Message POST /message/:message_id/reaction βœ… Delete Message POST /message/:message_id/delete βœ… Edit Message POST /message/:message_id/update βœ… Read Message (DM) POST /message/:message_id/read βœ… Star Message POST /message/:message_id/star βœ… Unstar Message POST /message/:message_id/unstar βœ… Download Message Media GET /message/:message_id/download βœ… Reject Call POST /call/reject βœ… Join Group With Link POST /group/join-with-link βœ… Group Info From Link GET /group/info-from-link βœ… Group Info GET /group/info βœ… Leave Group POST /group/leave βœ… Create Group POST /group βœ… List Participants in Group GET /group/participants βœ… Add Participants in Group POST /group/participants βœ… Remove Participant in Group POST /group/participants/remove βœ… Promote Participant in Group POST /group/participants/promote βœ… Demote Participant in Group POST /group/participants/demote βœ… Export Group Participants (CSV) GET /group/participants/export βœ… List Requested Participants in Group GET /group/participant-requests βœ… Approve Requested Participant in Group POST /group/participant-requests/approve βœ… Reject Requested Participant in Group POST /group/participant-requests/reject βœ… Set Group Photo POST /group/photo βœ… Set Group Name POST /group/name βœ… Set Group Locked POST /group/locked βœ… Set Group Announce POST /group/announce βœ… Set Group Topic POST /group/topic βœ… Get Group Invite Link GET /group/invite-link βœ… Unfollow Newsletter POST /newsletter/unfollow βœ… Get Newsletter Messages GET /newsletter/messages βœ… Get Chat List GET /chats βœ… Get Chat Messages GET /chat/:chat_jid/messages βœ… Pin Chat POST /chat/:chat_jid/pin βœ… Archive Chat POST /chat/:chat_jid/archive βœ… Set Disappearing Messages POST /chat/:chat_jid/disappearing βœ… Chatwoot Sync History POST /chatwoot/sync βœ… Chatwoot Sync Status GET /chatwoot/sync/status βœ… Chatwoot Reply Webhook POST /chatwoot/webhook

Copy & paste β€” that's it
βœ… = Available
❌ = Not Available Yet
* = Has known limitations (see notes below)

Notes:

  • *User My Groups: Returns a maximum of 500 groups due to WhatsApp protocol limitation. This is enforced by WhatsApp servers, not this API. See whatsmeow source for details.

  • /health is public and always registered at the root path, even when APP_BASE_PATH is set.

  • Device-specific login routes are reserved by the router but not implemented by the current usecase. Use /app/login or /app/login-with-code with X-Device-Id or device_id to pair a specific slot.

  • Chatwoot routes are registered only when CHATWOOT_ENABLED=true.

User Interface

MCP UI

  • Setup MCP (tested in cursor)

  • Test MCP

  • Successfully setup MCP

HTTP REST API UI

Description Image Homepage Login Login With Code Send Message Send Image Send File Send Video Send Sticker Send Contact Send Location Send Audio Send Poll Send Presence Send Link My Group Group Info From Link Create Group Join Group with Link Manage Participant My Newsletter My Contacts Business Profile

Mac OS NOTE

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

Important

  • This project is unofficial and not affiliated with WhatsApp.

  • Please use official WhatsApp API to avoid any issues.

  • We only able to run MCP or REST API, this is limitation from whatsmeow library. independent MCP will be available in the future.