ScriptsMay 24, 2026·3 min read

OpenWA — Self-Hosted WhatsApp API Gateway

OpenWA is a free, open-source, self-hosted gateway that provides a RESTful API for sending and receiving WhatsApp messages, enabling developers to build chatbots and automated messaging workflows.

Agent ready

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
OpenWA Gateway
Universal CLI install command
npx tokrepo install 1e3735d2-5706-11f1-9bc6-00163e2b0d79

Introduction

OpenWA is an open-source WhatsApp API gateway that lets developers send and receive WhatsApp messages through a self-hosted RESTful API. It enables building chatbots, notification systems, and automated messaging workflows without relying on paid third-party WhatsApp Business API providers.

What OpenWA Does

  • Provides a RESTful API for sending text, image, and document messages via WhatsApp
  • Receives incoming messages through webhook callbacks for real-time processing
  • Supports group management operations including creating groups and adding members
  • Handles message status tracking with delivery and read receipt notifications
  • Manages WhatsApp session authentication through QR code scanning

Architecture Overview

OpenWA is built with TypeScript and Node.js. It establishes a WhatsApp Web session using browser automation under the hood, then exposes that session as a set of HTTP API endpoints. Incoming messages trigger configurable webhook callbacks to external services. The server manages session persistence so reconnections happen automatically after restarts. Multiple sessions can be managed for different WhatsApp accounts.

Self-Hosting & Configuration

  • Clone the repository and install dependencies with npm
  • Configure the environment file with webhook URLs and server settings
  • Start the server and scan the QR code to authenticate the WhatsApp session
  • Set up webhook endpoints in your application to receive incoming messages
  • Optionally deploy with Docker for containerized production environments

Key Features

  • Full REST API covering messages, media, contacts, and groups
  • Webhook-based event system for real-time message processing
  • Multi-session support for managing multiple WhatsApp accounts
  • Session persistence with automatic reconnection after restarts
  • Self-hosted deployment with no per-message fees or external service costs

Comparison with Similar Tools

  • WhatsApp Business API — official but requires approval and per-message pricing; OpenWA is free
  • Baileys — library-level WhatsApp integration; OpenWA provides a ready-to-use HTTP API server
  • WPPConnect — similar approach but OpenWA focuses on a clean REST API design
  • Twilio WhatsApp — managed SaaS with usage fees; OpenWA is self-hosted and free
  • chat-api — commercial WhatsApp API service; OpenWA is fully open source

FAQ

Q: Is using OpenWA against WhatsApp terms of service? A: Unofficial WhatsApp API usage carries risk of account restrictions. Use at your own discretion and review WhatsApp's current terms.

Q: Can I send media files like images and PDFs? A: Yes. The API supports sending images, documents, audio, and video attachments.

Q: Does OpenWA support WhatsApp Business features? A: OpenWA works with standard WhatsApp accounts. Some Business-specific features may not be available.

Q: How do I handle multiple WhatsApp numbers? A: OpenWA supports multi-session management, allowing separate API endpoints per WhatsApp account.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets