Skip to main content

Getting Started

WA-RS is a multi-session WhatsApp REST API gateway built with Rust. It provides a simple HTTP interface to interact with WhatsApp Web.

Features

  • Multi-session support - Manage multiple WhatsApp accounts
  • QR Code & Pair Code authentication - Connect via QR scan or phone number
  • Send messages - Text, image, video, audio, document, sticker, location, contact
  • Webhook support - Receive events with HMAC-SHA256 signatures
  • NATS JetStream - Optional durable event streaming and outbound message queue
  • JWT authentication - Secure API access
  • Multi-database support - PostgreSQL, MySQL, or SQLite via DATABASE_URL
  • Swagger UI - Interactive API documentation

Quick Start

git clone https://github.com/fdciabdul/wa-rs.git
cd wa-rs
docker compose up -d

Manual Installation

  1. Requirements

    • Rust 1.75+
    • One of: PostgreSQL 14+, MySQL 8+, or SQLite 3
  2. Clone and build

    git clone https://github.com/fdciabdul/wa-rs.git
    cd wa-rs
    cargo build --release
  3. Configure environment

    cp .env.example .env
    # Edit .env — set DATABASE_URL for your database:
    # DATABASE_URL=postgres://user:pass@localhost:5432/wagateway
    # DATABASE_URL=mysql://user:pass@localhost:3306/wagateway
    # DATABASE_URL=sqlite://wa-rs.db
  4. Run

    cargo run --release

Access Points

After starting the server:

EndpointDescription
http://localhost:3451API Base URL
http://localhost:3451/swagger-uiSwagger UI Documentation
http://localhost:3451/healthHealth Check
http://localhost:3451/api/v1/nats/statusNATS Status (if enabled)

Next Steps