WAHA 是一个可自行部署的 WhatsApp HTTP API 服务,通过 Docker 几分钟内即可启动,对外提供 REST 接口和 Swagger 文档。你可以用接口创建会话、获取登录二维码、截图确认状态,并发送文本等消息,从而把 WhatsApp 接入自己的程序。项目支持多种底层引擎,包括基于浏览器的 WEBJS、基于 Node.js 和 Go 的 WebSocket 实现等,便于按稳定性和资源占用做取舍。它提供 Swagger 在线调试和示例 Dashboard,方便快速验证,也支持多账号会话(部分能力需 Plus 版本)。整体定位是把即时通讯能力封装成标准 Web 服务,减少直接对接私有协议的成本。
docker run -p 3000:3000 devlikeapro/waha
WAHA - WhatsApp HTTP API (REST API) that you can install on your own server and run in less than 5 minutes!
Only thing that you must have - installed docker. Please follow the original instruction how to install docker ->.
When you are ready - come back and follows the below steps to send the first text message to WhatsApp via HTTP API!
Let's go over steps that allow you to send your first text message via WhatsApp HTTP API!
Assuming you have installed Docker, let's download the image.
docker pull devlikeapro/waha
docker login -u devlikeapro -p {KEY}
docker pull devlikeapro/waha-plus
docker logout
Read more about how to get PASSWORD for ➕ WAHA Plus
Run WhatsApp HTTP API:
docker run -it --rm -p 3000:3000/tcp --name waha devlikeapro/waha
# It prints logs and the last line must be
# WhatsApp HTTP API is running on: http://[::1]:3000
Open the link in your browser http://localhost:3000/ and you'll see API documentation (Swagger).
To start a new session you should have your mobile phone with installed WhatsApp application close to you.
Please go and read how what we'll need to a bit later: How to log in - the instruction on WhatsApp site
When your ready - find POST /api/sessions, click on Try it out, then Execute a bit below.
The example payload:
{
"name": "default"
}
By using the request with name values you can start multiple session (WhatsApp accounts) inside the single docker container in Plus
Find GET /api/screenshot and execute it, it shows you QR code.
Scan the QR with your cell phone's WhatsApp app.
Execute GET /api/screenshot after a few seconds after scanning the QR - it'll show you the screenshot of you Whatsapp
instance. If you can get the actual screenshot - then you're ready to start sending messages!
Let's send a text message - find POST /api/sendText in swagger and change chatId this
way: use a phone international phone number without + symbol and add @c.us at the end.
For phone number 12132132131 the chatId is [email protected].
The example payload:
{
"chatId": "[email protected]",
"text": "Hi there!",
"session": "default"
}
Also, you can use curl and send POST request like this:
# Phone without +
export PHONE=12132132130
curl -d "{\"chatId\": \"${PHONE}@c.us\", \"text\": \"Hello from WhatsApp HTTP API\" }" -H "Content-Type: application/json" -X POST http://localhost:3000/api/sendText
# Bun runtime used by whatsapp-rust-bridge prepare scripts
curl -fsSL https://bun.sh/install | bash -s -- bun-v1.3.9
# Rust nightly toolchain used for whatsapp-rust-bridge
curl -fsSL https://sh.rustup.rs | bash -s -- -y --default-toolchain nightly-2026-01-30
rustup target add wasm32-unknown-unknown
cargo install wasm-pack --vers 0.14.0 --locked
# Install dependencies
yarn install
# Fetch and compile proto files
yarn gows:proto
# Run
yarn start
# open http://localhost:3000
内容由编辑整理,部分信息来自 GitHub 与项目官网,版权归原作者所有。发现错误?报告问题