Scripts2026年5月24日·1 分钟阅读

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 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
OpenWA Gateway
通用 CLI 安装命令
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

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产