Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

chatery_whatsapp

> 编程语言
Open source

A powerful WhatsApp API backend built with Express.js and Baileys library. Supports multi-session management, real-time WebSocket events, group management, and

194 stars0 likes1 views
WebsiteGitHub

About

A powerful WhatsApp API backend built with Express.js and Baileys library. Supports multi-session management, real-time WebSocket events, group management, and

Chatery WhatsApp API

A powerful WhatsApp API backend built with Express.js and Baileys library. Supports multi-session management, real-time WebSocket events, group management, and media handling.


Sponsor

  SumoPod — Container & Application Management

  SumoPod offers seamless container and application purchasing solutions for businesses of all sizes.

Container Marketplace — Explore and purchase from an extensive container library, all verified and ready for instant deployment.

One-Click Deployment — Deploy containers to your infrastructure with one click, eliminating complex configuration processes.

Automatic Updates — Keep your containers and applications up to date with automatic version updates and security patches.

  ✨ Chatery WhatsApp API is available on SumoPod — Deploy with one click, without complex configuration. Includes auto-updates and monitoring. → Get it now

✨ Features

  • Multi-Session Support - Manage multiple WhatsApp accounts simultaneously
  • Real-time WebSocket - Get instant notifications for messages, status updates, and more
  • Group Management - Create, manage, and control WhatsApp groups
  • ️ Chat Labels - Label chats and messages for organization (WhatsApp Business)
  • Send Messages - Text, images, documents, locations, contacts, and more
  • ↩️ Reply to Messages - Reply/quote specific messages with replyTo parameter
  • Poll Messages - Send interactive polls with single or multiple choice
  • Bulk Messaging - Send messages to multiple recipients with background processing
  • Auto-Save Media - Automatically save incoming media to server
  • Persistent Store - Message history with optimized caching
  • Session Persistence - Sessions survive server restarts
  • ️ Admin Dashboard - Web-based dashboard with real-time monitoring and API tester
  • Swagger UI - Interactive API documentation at root URL

Full Documentation

For complete and detailed documentation, please visit:

Documentation Link
Primary Docs https://docs.chatery.app
Mirror Docs https://chatery-whatsapp-documentation.appwrite.network

The documentation includes complete API reference, examples, troubleshooting guides, and more.

Table of Contents

  • Full Documentation
  • Installation
    • Standard Installation
    • Docker Installation
  • Configuration
  • API Key Authentication
  • Quick Start
  • Dashboard
  • API Documentation
    • Sessions
    • Messaging
    • Bulk Messaging
    • Chat History
    • Group Management
    • Labels
  • WebSocket Events
  • Examples

Installation

Option 1: Standard Installation

bash
# Clone the repository
git clone https://github.com/farinchan/chatery_whatsapp.git
cd chatery_whatsapp

# Install dependencies
npm install

# Create environment file
cp .env.example .env

# Start the server
npm start

# Or development mode with auto-reload
npm run dev

Option 2: Docker Installation

bash
# Clone the repository
git clone https://github.com/farinchan/chatery_whatsapp.git
cd chatery_whatsapp

# Create environment file
cp .env.example .env

# Build and run with Docker Compose
docker-compose up -d

# View logs
docker-compose logs -f

# Stop the container
docker-compose down

Docker Commands

Command Description
docker-compose up -d Start container in background
docker-compose down Stop and remove container
docker-compose logs -f View live logs
docker-compose restart Restart container
docker-compose build --no-cache Rebuild image

Docker Volumes

The following data is persisted across container restarts:

Volume Path Description
chatery_sessions /app/sessions WhatsApp session data
chatery_media /app/public/media Received media files
chatery_store /app/store Message history store

⚙ Configuration

Create a .env file in the root directory:

env
PORT=3000
CORS_ORIGIN=*

# Dashboard Authentication
DASHBOARD_USERNAME=admin
DASHBOARD_PASSWORD=securepassword123

# API Key Authentication (optional - leave empty or 'your_api_key_here' to disable)
API_KEY=your_secret_api_key_here

Note: Personal chat IDs use @c.us format (e.g., [email protected]). Group IDs use @g.us format. Phone numbers are automatically normalized (0 → 62).

API Key Authentication

All WhatsApp API endpoints are protected with API key authentication. Include the X-Api-Key header in your requests.

How to Enable

  1. Set a strong API key in your .env file:

    env
    API_KEY=your_super_secret_key_12345
  2. Include the header in all API requests:

    bash
    curl -X GET http://localhost:3000/api/whatsapp/sessions \
      -H "X-Api-Key: your_super_secret_key_12345"

Disable Authentication

To disable API key authentication, leave API_KEY empty or set it to your_api_key_here in .env:

env
API_KEY=
# or
API_KEY=your_api_key_here

Error Responses

Status Message Description
401 Missing X-Api-Key header API key not provided in request
403 Invalid API key API key doesn't match

Dashboard Integration

When logging into the dashboard, you'll be prompted to enter your API key (optional). This allows the dashboard to make authenticated API calls.

Quick Start

  1. Start the server

    bash
    npm start
  2. Create a session

    bash
    curl -X POST http://localhost:3000/api/whatsapp/sessions/mysession/connect \
      -H "X-Api-Key: your_api_key" \
      -H "Content-Type: application/json"
  3. Get QR Code - Open in browser or scan

    http://localhost:3000/api/whatsapp/sessions/mysession/qr/image

    Note: QR image endpoint also requires API key. Use curl or include header.

  4. Send a message

    bash
    curl -X POST http://localhost:3000/api/whatsapp/chats/send-text \
      -H "X-Api-Key: your_api_key" \
      -H "Content-Type: application/json" \
      -d '{"sessionId": "mysession", "chatId": "628123456789", "message": "Hello!"}'

️ Dashboard

Access the admin dashboard at http://localhost:3000/dashboard

Authentication

Dashboard requires login with username and password configured in .env file.

Field Default Value
Username admin
Password admin123

✨ Dashboard Features

Feature Description
Real-time Stats Monitor total sessions, connected/disconnected status, and WebSocket clients
Session Management Create, connect, reconnect, and delete WhatsApp sessions
QR Code Scanner Scan QR codes directly from the dashboard
Live Events Real-time WebSocket event viewer with filtering
Quick Send Send messages quickly to any number
API Tester Test all 40+ API endpoints with pre-filled templates
Bulk Messaging Send messages to multiple recipients with job tracking
Webhook Manager Add, remove, and configure webhooks per session
Logout Secure logout button in header

Screenshots

The dashboard provides a modern dark-themed interface:

  • Session Cards - View all sessions with status indicators
  • QR Modal - Full-screen QR code for easy scanning
  • Event Log - Live scrolling event feed with timestamps
  • API Tester - Dropdown with all endpoints and auto-generated request bodies

API Documentation

Base URL: http://localhost:3000/api/whatsapp

Sessions

List All Sessions

http
GET /sessions

Response:

json
{
  "success": true,
  "message": "Sessions retrieved",
  "data": [
    {
      "sessionId": "mysession",
      "status": "connected",
      "isConnected": true,
      "phoneNumber": "628123456789",
      "name": "John Doe",
      "webhooks": [
        {
          "url": "https://your-server.com/webhook",
          "events": ["message", "message_ack"]
        }
      ],
      "metadata": {
        "userId": "user123",
        "plan": "premium"
      }
    }
  ]
}
Field Type Description
sessionId string Unique session identifier
status string Current status: disconnected, connecting, qr_ready, connected
isConnected boolean Whether session is currently connected
phoneNumber string Connected WhatsApp phone number
name string WhatsApp profile name
webhooks array Configured webhooks for this session
metadata object Custom metadata associated with this session

Create/Connect Session

http
POST /sessions/:sessionId/connect

Body (Optional):

json
{
  "metadata": {
    "userId": "user123",
    "plan": "premium",
    "customField": "any value"
  },
  "webhooks": [
    { "url": "https://your-server.com/webhook", "events": ["all"] },
    { "url": "https://backup-server.com/webhook", "events": ["message"] }
  ]
}
Parameter Type Description
metadata object Optional. Custom metadata to store with session
webhooks array Optional. Array of webhook configs [{ url, events }]

Response:

json
{
  "success": true,
  "message": "Session created",
  "data": {
    "sessionId": "mysession",
    "status": "qr_ready",
    "qrCode": "data:image/png;base64,...",
    "metadata": { "userId": "user123" },
    "webhooks": [
      { "url": "https://your-server.com/webhook", "events": ["all"] }
    ]
  }
}

Update Session Config

http
PATCH /sessions/:sessionId/config

Body:

json
{
  "metadata": { "newField": "value" },
  "webhooks": [
    { "url": "https://new-webhook.com/endpoint", "events": ["message", "connection.update"] }
  ]
}

Response:

json
{
  "success": true,
  "message": "Session config updated",
  "data": {
    "sessionId": "mysession",
    "metadata": { "userId": "user123", "newField": "value" },
    "webhooks": [
      { "url": "https://new-webhook.com/endpoint", "events": ["message", "connection.update"] }
    ]
  }
}

Add Webhook

http
POST /sessions/:sessionId/webhooks

Body:

json
{
  "url": "https://another-server.com/webhook",
  "events": ["message", "connection.update"]
}

Remove Webhook

http
DELETE /sessions/:sessionId/webhooks

Body:

json
{
  "url": "https://another-server.com/webhook"
}

Get Session Status

http
GET /sessions/:sessionId/status

Get QR Code (JSON)

http
GET /sessions/:sessionId/qr

Get QR Code (Image)

http
GET /sessions/:sessionId/qr/image

Returns a PNG image that can be displayed directly in browser or scanned.

Delete Session

http
DELETE /sessions/:sessionId

Messaging

** Typing Indicator**: All messaging endpoints support typingTime parameter (in milliseconds) to simulate typing before sending the message. This makes the bot appear more human-like.

↩️ Reply to Message: All messaging endpoints support replyTo parameter to reply to a specific message. Pass the message ID to quote/reply to that message.

Send Text Message

http
POST /chats/send-text

Body:

json
{
  "sessionId": "mysession"

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言