A WhatsApp API service built with Go, providing RESTful endpoints for managing WhatsApp devices and sending messages.
This API is currently under active development and does not include all planned features. Some functionality may be incomplete, and the API structure may change in future releases. Contributions and feedback are welcome!
- π API Key authentication
- π± WhatsApp multi-device management (create, read, update, delete)
- π¨ Send text and image messages via WhatsApp
- π RabbitMQ integration for message queuing
- ποΈ PostgreSQL database with migrations
- π³ Docker support for easy deployment
- π WAHA (WhatsApp HTTP API) adapter support
The following features are planned for future releases:
- βοΈ Message update and delete
- ποΈ Send presence (typing, recording, etc.)
- β Read message receipts
- π Additional message types:
- Media messages (video, documents)
- Stickers
- Location sharing
- Contact cards
- Audio messages
- Polls
- π Webhook support for event listening
- π SSE (Server-Sent Events) or WebSocket for real-time event streaming
- π‘ Additional event handlers for various WhatsApp events
- π₯ Contacts management
- π¬ Chat management
- π Chat message history retrieval
- π¨βπ©βπ§βπ¦ Group creation and management
- π€ Group member management
- βοΈ Group settings and configuration
- π€ User profile management
- πΌοΈ Profile picture updates
- π Status updates
- π WAHA (WhatsApp HTTP API) - Expand current partial support to include all message types and operations
- π Evolution API - Full adapter implementation for Evolution API integration
- π‘ WHAPI - Complete adapter support for WHAPI (WhatsApp API) integration
- π Unified adapter interface to seamlessly switch between different WhatsApp API providers
- π¦ Support for all adapter operations: messaging, device management, webhooks, and more
- Language: Go 1.25.2
- Framework: Chi Router
- Database: PostgreSQL
- Message Queue: RabbitMQ
- WhatsApp Library: whatsmeow
- Containerization: Docker & Docker Compose
- Go 1.25.2 or higher
- Docker and Docker Compose
- PostgreSQL 16 (or use Docker Compose)
- RabbitMQ (optional, for message queuing)
git clone https://github.com/LeonardoSola/pulse-api.git
cd pulse-apiCopy the example environment file and configure it:
cp .env.example .envEdit .env with your configuration:
# Database
DB_HOST=localhost
DB_PORT=5432
DB_USER=your_user
DB_PASS=your_password
DB_NAME=pulse_api
DB_SSL_MODE=disable
# OR use connection string
# DB_CONNECTION_STRING=postgres://user:password@localhost:5432/dbname
# RabbitMQ
RABBITMQ_ENABLED=false
RABBITMQ_HOST=
RABBITMQ_PORT=
RABBITMQ_USER=
RABBITMQ_PASSWORD=
RABBITMQ_VHOST=
RABBITMQ_EXCHANGE=
# OR use connection string
RABBITMQ_URL=amqp://user:password@host:port/
# Server
SERVER_PORT=8080
API_KEY=your_api_key_here # Generate with: openssl rand -hex 32Generate a secure API key:
openssl rand -hex 32Add the generated key to your .env file.
The easiest way to get started:
docker-compose up -dThis will start:
- PostgreSQL database
- The API service
For local development:
# Install dependencies
go mod download
# Run migrations (if not using Docker)
# Make sure PostgreSQL is running and configured
# Run the application (if you are using bash)
make runOr manually:
source .env
air .All endpoints require API key authentication via the X-API-Key header. (expect /health)
You can find the Postman collection [here](Pulse API.postman_collection.json).
- GET
/health- Check API health status
- GET
/devices- List all devices - GET
/devices/{id}- Get device by ID - POST
/devices- Create a new device - PUT
/devices/{id}- Update device - DELETE
/devices/{id}- Delete device - GET
/devices/{id}/qr- Get QR code for device authentication
- POST
/devices/{deviceId}/messages/sendText- Send a text message - POST
/devices/{deviceId}/messages/sendImage- Send an image message
- GET
/adapters/waha/*- WAHA adapter endpoints
curl -X POST http://localhost:8080/devices/{deviceId}/messages/sendText \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, World!",
"recipient": "5511999999999",
"recipientType": "individual"
}'curl -X POST http://localhost:8080/devices \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "My Device"
}'pulse-api/
βββ adapters/ # External adapters (HTTP, WhatsApp, Database, Messaging)
βββ internal/ # Internal business logic
β βββ config/ # Configuration management
β βββ entities/ # Domain entities
β βββ ports/ # Interface definitions
β βββ services/ # Business logic services
βββ migrations/ # Database migrations
βββ main.go # Application entry point
βββ docker-compose.yaml
βββ Dockerfile
βββ Makefile
Database migrations are handled automatically on startup using Goose.
make run # Run the application in development mode
make help # Show available commandsContributions are welcome! Since this project is in active development, please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source. Please check the LICENSE file for details.
This API is provided as-is for development purposes. Use at your own risk. Make sure to comply with WhatsApp's Terms of Service when using this API.
For issues, questions, or contributions, please open an issue on the GitHub repository.
Note: This API is a work in progress. Features may be incomplete or subject to change.