A Go REST API for WhatsApp built on whatsmeow. Run multiple WhatsApp sessions behind a single HTTP API with webhook or Redis event delivery.
Multi-arch image — supports linux/amd64 and linux/arm64.
docker run -d \
-p 8080:8080 \
-v $(pwd)/data:/app/data \
-e WSAPI_ADMIN_API_KEY=my-secret-admin-key \
-e WSAPI_DEFAULT_API_KEY=my-secret-instance-key \
wsapichat/wsapi:latest
Verify it's running:
curl http://localhost:8080/health
services:
wsapi:
image: wsapichat/wsapi:latest
ports:
- "8080:8080"
volumes:
- ./data:/app/data
environment:
WSAPI_ADMIN_API_KEY: my-secret-admin-key
WSAPI_DEFAULT_API_KEY: my-secret-instance-key
curl -X POST http://localhost:8080/admin/instances \
-H "X-Api-Key: my-secret-admin-key" \
-H "Content-Type: application/json" \
-d '{"id": "my-instance"}'
QR code — scan with WhatsApp > Linked Devices > Link a Device:
curl http://localhost:8080/session/qr \
-H "X-Instance-Id: my-instance" \
-H "X-Api-Key: my-secret-instance-key" \
--output qr.png
Pair code — enter the code on your phone:
curl http://localhost:8080/session/pair-code/1234567890 \
-H "X-Instance-Id: my-instance" \
-H "X-Api-Key: my-secret-instance-key"
curl -X POST http://localhost:8080/messages/text \
-H "X-Instance-Id: my-instance" \
-H "X-Api-Key: my-secret-instance-key" \
-H "Content-Type: application/json" \
-d '{"to": "1234567890", "text": "Hello from WSAPI!"}'
All configuration is done via environment variables. Key settings:
| Variable | Description | Default |
|---|---|---|
WSAPI_PORT | HTTP port | 8080 |
WSAPI_DB_DRIVER | App store driver (sqlite/postgres) | sqlite |
WSAPI_DB_DSN | App store DSN | ./data/wsapi.db |
WSAPI_ADMIN_API_KEY | API key for admin endpoints | |
WSAPI_DEFAULT_API_KEY | Default API key for instance endpoints | |
WSAPI_DEFAULT_WEBHOOK_URL | Webhook URL for event delivery | |
WSAPI_DEFAULT_SIGNING_SECRET | HMAC-SHA256 signing secret for webhooks | |
WSAPI_PUBLISH_VIA | Event delivery method: webhook, redis, or none | |
WSAPI_LOG_LEVEL | debug, info, warn, error | info |
See the full environment variable reference for all options.
| Path | Description |
|---|---|
/app/data | SQLite databases (app store + device sessions). Mount this to persist data across container restarts. |
Content type
Image
Digest
sha256:b7e5a97af…
Size
25.5 MB
Last updated
23 days ago
docker pull wsapichat/wsapi