🚀Launch Price: $199 - Limited time offer! Get WAstarter at our special introductory price - the same technology that helps WAsendr clients deliver 6M+ messages and generate revenue.

WAstarter Documentation

Everything you need to know to get started with your WhatsApp API server

Features

  • ✅ WhatsApp Instance Management - Create, connect, and manage multiple WhatsApp instances
  • ✅ API Key Authentication - Secure API access with key-based authentication
  • ✅ QR Code Generation - Generate QR codes for WhatsApp Web authentication
  • ✅ Message Management - Send, receive, and manage WhatsApp messages
  • ✅ Contact Management - Manage contacts and contact information
  • ✅ Webhook Support - Real-time notifications via webhooks
  • ✅ WebSocket Support - Real-time updates via WebSocket connections
  • ✅ Database Integration - MySQL/MariaDB with Prisma ORM
  • ✅ TypeScript - Full TypeScript support with proper type safety
  • ✅ Error Handling - Comprehensive error handling and validation

Quick Start

Prerequisites

  • Node.js 18+
  • MySQL/MariaDB database
  • npm or yarn

Installation

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Set up environment variables:
    cp .env.example .env # Edit .env with your configuration
  4. Set up the database:
    npx prisma migrate dev npx prisma db seed
  5. Start the development server:
    npm run dev

The API will be available at http://localhost:3000/api/v1

API Endpoints

Authentication

All API endpoints require authentication via the X-API-Key header:

curl -H "X-API-Key: your_api_key_here" http://localhost:3000/api/v1/health

Instance Management

List Instances

GET /api/v1/instances

Create Instance

POST /api/v1/instances Content-Type: application/json { "name": "My WhatsApp Instance", "sessionId": "unique-session-id" }

Connect Instance (Generate QR Code)

POST /api/v1/instances/{instanceId}/connect

Disconnect Instance

POST /api/v1/instances/{instanceId}/disconnect

Messages

Send Message

POST /api/v1/messages/{instanceId}/send Content-Type: application/json { "to": "1234567890@s.whatsapp.net", "message": "Hello, World!" }

Webhooks

Configure webhooks to receive real-time notifications when events occur in your WhatsApp instances.

List Webhooks

GET /api/v1/webhooks

Create Webhook

POST /api/v1/webhooks Content-Type: application/json { "url": "https://your-webhook-endpoint.com", "events": ["message", "qr", "connection"] }

Deployment

Docker Deployment (Recommended)

The easiest way to deploy this WhatsApp API is using Docker. A complete Docker setup is provided with MySQL database included.

Requirements

  • Docker
  • Docker Compose

Steps

  1. Start the services:
    docker-compose up -d
  2. View logs:
    docker-compose logs -f whatsapp-api
  3. Apply database migrations:
    docker-compose exec whatsapp-api npx prisma migrate deploy
  4. Seed the database:
    docker-compose exec whatsapp-api npx prisma db seed

Docker Commands

  • Start services: docker-compose up -d
  • Stop services: docker-compose down
  • View logs: docker-compose logs -f whatsapp-api
  • Rebuild services: docker-compose up -d --build
  • Remove volumes: docker-compose down -v

Need Help?

Can't find what you're looking for? Contact our support team for assistance with your WAstarter implementation.