Free, Open Source, Self-Hosted WhatsApp API Gateway
Open Source WhatsApp API Gateway
Features • Quick Start • Docs • API • Contributing
--- ## ✨ Why OpenWA? **OpenWA** is a free, open-source WhatsApp API Gateway designed for developers who need full control over their messaging infrastructure—without vendor lock-in or hidden paywalls. Built on a **pluggable architecture**, OpenWA lets you select database engines (SQLite/PostgreSQL), backup/migration storage backends (Local/S3), and cache layers (disabled/Redis) through configuration rather than application-code changes. Message media itself is returned inline to API and webhook consumers; it is not automatically persisted to the storage backend. | | | | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | **100% Open Source** | No licensing fees, no feature locks, full source code access | | ️ **Pluggable Architecture** | Swap adapters for database, storage, and cache via config | | ️ **Full Dashboard** | Modern React UI for session, webhook, and API key management | | **Multi-Session Ready** | Run multiple WhatsApp sessions concurrently on one instance | | **Docker Native** | Production-ready with zero configuration | | **Official Plugins** | Chatwoot, Typebot & more as sandboxed plugins on the Integration Fabric — [OpenWA-plugins](https://github.com/rmyndharis/OpenWA-plugins) | | **n8n Integration** | Community nodes for workflow automation | | **Community Adapters** | Third-party integrations (e.g. ioBroker) — see [docs](./docs/23-community-integrations.md) | | **Session-scoped keys** | Operator and viewer (reader) tokens can be limited to chosen sessions — or all sessions if none are selected | ### Session-scoped operator & viewer tokens When you create or edit an **operator** or **viewer** API key in the dashboard, you can tick the WhatsApp sessions that key may use. - **No sessions selected** — the key can access every session, including ones created later. - **One or more sessions selected** — the key can only list, read, and (for operator) manage those sessions. A request naming any other session returns `401`; session-filtered lists (sessions, audit, webhook delivery failures) return that key's rows rather than an error; and the key-management routes and the queue dashboard, which name no session at all, return `403`. Admin keys stay unscoped in the dashboard so they can keep managing other API keys. The HTTP API still accepts `allowedSessions` on any role if you need that from a client. --- ## ⚠️ Before you connect a number — please read OpenWA is an unofficial, community-maintained gateway. It connects to WhatsApp through **reverse-engineered clients** (the [`whatsapp-web.js`](https://github.com/pedroslopez/whatsapp-web.js) project and [`@whiskeysockets/baileys`](https://github.com/WhiskeySockets/Baileys)), **not** through Meta's official Cloud API. This has real consequences you should understand before you link a phone number. ### What this means in practice - **There is always a non-zero risk of account restriction or ban.** WhatsApp's anti-abuse systems actively look for unofficial automation. No amount of code quality on our side can make that risk zero. - **Pick the right number.** Never connect your primary personal or business number to an automated gateway. Use a **dedicated number** you can afford to lose. If you're running this for paying clients, pass that guidance on to them. - **The two engines trade off differently:** | Engine | Ban-risk profile | Resource cost | | ----------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------- | | `whatsapp-web.js` | Lower — drives a real headless Chromium that looks like genuine WhatsApp Web traffic. | High RAM (~300–500 MB / session). | | `baileys` | Higher — speaks the multi-device WebSocket protocol directly and is easier for WhatsApp to fingerprint. | Low RAM (~30–80 MB / session). | If account safety is your top priority and you can afford the memory, prefer `whatsapp-web.js`. If you need density and accept the trade-off, use `baileys`. ### Safe-sending guidelines These are practical guardrails, not guarantees — but they materially reduce the chance of WhatsApp flagging the account: 1. **Warm up fresh numbers.** For the first several days, behave like a normal human user: scan the QR, exchange a handful of messages with saved contacts, join a group or two, set a profile photo. Don't blast on day one. 2. **Don't cold-blast strangers.** Sending the first-ever message to a large batch of numbers that have never messaged you is the single most reliable way to get restricted — on either engine. 3. **Rate-limit yourself.** OpenWA ships with a configurable rate limiter (`RATE_LIMIT_*` env vars). Use it. A few messages per minute per session is sustainable; "thousands in an hour" is not. 4. **Use opted-in recipients.** The safest workloads are replies and alerts to people who already expect to hear from you (OTP to your own users, order updates, support replies). 5. **Keep a fallback.** For anything auth-critical or revenue-critical, keep an SMS / email / official-Cloud-API path. Do not bet a login flow solely on an unofficial client. 6. **Mind the hosting IP.** Cheap datacenter IPs are flagged more aggressively than residential ones. A residential proxy (supported per-session via the proxy settings) can help; it is not a license to spam. ### Known platform behaviour (not bugs) A few things that look like bugs but are actually server-side WhatsApp policy, not OpenWA defects — we track them separately so we can distinguish them from real bugs: - **First message to a brand-new contact sometimes never arrives.** The API returns success because the message leaves OpenWA, but WhatsApp's server-side reach-out / trust policy drops it at delivery. This is independent of OpenWA. We track it in [#830](https://github.com/rmyndharis/OpenWA/issues/830). - **Accounts that get restricted cannot be "unrestricted" by us.** If WhatsApp disables a number, you need to appeal through their channels — OpenWA has no lever to pull. ### Compliance For any deployment where ethical, legal, or regulatory compliance matters (healthcare, finance, large-scale commercial messaging, anything touching end users in the EU/EEA under DMA/GDPR framings), treat OpenWA as **not approved** and use Meta's [official WhatsApp Cloud API](https://developers.facebook.com/docs/whatsapp/cloud-api). OpenWA is an excellent fit for personal projects, internal tooling, automation hobbyists, and learning — it is not a drop-in replacement for the official API in regulated environments. For the deeper, maintainer-side risk analysis (protocol-change exposure, dependency strategy, security posture), see [Risk Management (`docs/16`)](./docs/16-risk-management.md). --- ## Features ### Core Features | Feature | Status | Description | | ------------- | ------ | ---------------------------------------------------------------------------- | | REST API | ✅ | Full WhatsApp API via HTTP endpoints | | Multi-Session | ✅ | Manage multiple WhatsApp accounts | | Webhooks | ✅ | Real-time events with HMAC signature and optional smart pre-dispatch filters | | Web Dashboard | ✅ | Visual management interface | | API Key Auth | ✅ | Secure API authentication | | Swagger Docs | ✅ | Interactive API documentation | ### Messaging | Feature | Status | Description | | ----------------- | ------ | --------------------------------------------------------- | | Text Messages | ✅ | Send/receive text messages | | Media Messages | ✅ | Images, videos, documents, audio | | Message Reactions | ✅ | React to messages with emoji | | Message Editing | ✅ | Send edits + live `message.edited` events on both engines | | Bulk Messaging | ✅ | Send to multiple recipients | | Message Status | ✅ | Track delivery and read receipts | ### Advanced | Feature | Status | Description | | ------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Groups API | ✅ | Create, manage, join (invite code), and configure groups | | Profile Management | ✅ | Set own display name, about text, and profile picture | | Call Handling | ✅ | `call.received` events, reject calls, per-session auto-reject | | Channels/Newsletter | ✅ | WhatsApp Channels support | | Labels Management | ✅ | Organize chats with labels | | Proxy Support | ✅ | Per-session proxy configuration | | Rate Limiting | ✅ | Configurable request limits | | CIDR Whitelisting | ✅ | IP-based access control[Feature]: Request for OpenWA to support fetching of messages given fromDate and toDate
[Feature]: When getting chats, tell if message is image
[Feature]: Group isolation — per-chat scoping for webhooks and the read surface
[Feature]: Use S3 storage for chat media
[Feature]: Auth headers for Webhooks
[Bug]: Pinned Chat
[Bug]: Bundled MinIO image can no longer be pulled
[Bug]: audio sends answer 500 (page error `t`) while the localised "what's new" modal is open at engine init; the pt-BR modal is not recognised by default
[Feature]: [Critical] WhatsApp mandatory passkey blocks all device linking — QR and pairing-code both fail
[Bug]: Sudden error when trying to send an image