How asternic/wuzapi works
WuzAPI is a multi-device WhatsApp REST API. A client or operator sends authenticated HTTP requests; the server routes them to session, messaging, user, chat, and group handlers, which operate WhatsApp sessions and return API responses. Incoming WhatsApp events can be delivered through configured webhooks or RabbitMQ. Database-backed account/configuration state, message history, and media handling support those capabilities; optional S3 provides media storage. The README documents the broader endpoint set, while some subsystem connections are not visible in the sampled excerpts, so those links are omitted.
Main entry points: handlers.go Session and messaging · routes.go HTTP routes · db.go Application database · main.go Server startup
Components 19
Service entry
- Server startup
main.go - HTTP routes
routes.go - Dashboard UI
static/dashboard/js/app.js - Stdio interface
stdio.go
REST capabilities
- Session and messaging
handlers.go - Group operations
handlers.go - Join requests
handlers_grouprequests.go
State and media
- Session client manager
clients.go - Application database
db.go - Schema migrations
migrations.go - Message history
history_sync.go - Media processing
media_sources.go - Media delivery
media_delivery.go - Temporary media store
media_store.go - S3 storage
s3manager.go
Events and integrations
- Webhook events
wmiau.go - RabbitMQ events
rabbitmq.go
Other components
- API client
- WhatsApp service
Connections 21
- API client → HTTP routes: sends requests
README.md - Server startup → HTTP routes: registers routes
main.go - HTTP routes → Session and messaging: routes requests
routes.go - HTTP routes → Group operations: routes requests
routes.go - HTTP routes → Join requests: routes requests
- Dashboard UI → HTTP routes: calls API
static/dashboard/js/app.js - Session and messaging → WhatsApp service: controls sessions
README.md - Group operations → WhatsApp service: manages groups
README.md - Join requests → WhatsApp service: requests participants
handlers_grouprequests.go - Session and messaging → Session client manager: gets session client
handlers.go - Session and messaging → Application database: reads configuration
handlers.go - Application database → Schema migrations: schema setup
- Message history → Application database: stores history
- Session and messaging → Message history: records messages
- Media processing → Temporary media store: uses temporary files
- Media delivery → Temporary media store: prepares delivery files
- S3 storage → Application database: reads user config
s3manager.go - Session and messaging → Media processing: handles attachments
- Webhook events → API client: delivers events
README.md - Session and messaging → RabbitMQ events: publishes events
handlers.go - Server startup → Stdio interface: starts stdio mode
main.go