API Documentation

WhatsApp Bot Manager API endpoints and documentation

Backend Offline
Interactive Swagger UI

Full interactive API documentation with try-it-out functionality

OpenAPI JSON Spec

Raw OpenAPI 3.0 specification in JSON format

Base URL

API base URL for all endpoints

API Endpoints Overview

Bot Management
GET/api/bots

Get all bots

GET/api/bots/{id}

Get bot by ID

POST/api/bots

Create new bot

PUT/api/bots/{id}

Update bot

DELETE/api/bots/{id}

Delete bot

Bot Proxy - Core Operations
GET/api/bots/{id}/status

Get bot operational status by ID

POST/api/bots/qr-code

Get QR code for WhatsApp authentication (botId in request body)

POST/api/bots/qr-code/update

Update QR code (botId in request body)

POST/api/bots/change-fallback-number

Change fallback number (botId in request body)

POST/api/bots/change-port

Change bot port (botId in request body)

Bot Proxy - Messaging Operations
POST/api/bots/send-message

Send WhatsApp message with optional file (botId in request body)

POST/api/bots/get-groups

Get WhatsApp groups (botId in request body)

POST/api/bots/pending

Send pending message (botId in request body)

POST/api/bots/followup

Send followup message (botId in request body)

POST/api/bots/receive-image-and-json

Send image with JSON data (botId in request body)

POST/api/bots/confirmation

Send confirmation message (botId in request body)

Bot Messaging (Legacy)
POST/api/bots/{id}/send

Send WhatsApp message with optional file attachment (Legacy)

Bot Spawning
POST/api/bots/spawn/whatsapp

Spawn new WhatsApp bot

DELETE/api/bots/{id}/terminate

Terminate bot completely

POST/api/bots/{id}/start

Start existing bot

POST/api/bots/{id}/stop

Stop existing bot

POST/api/bots/{id}/restart

Restart existing bot

PM2 Management
POST/api/bots/{id}/pm2/restart

Restart PM2 service

POST/api/bots/{id}/pm2/recreate

Recreate PM2 service

GET/api/bots/{id}/pm2/status

Get PM2 status

Usage Examples

Note: Bot proxy endpoints now use botId in the request body instead of URL parameters

Get Bot Status (New Proxy API)

curl -X GET "/api/bots/{bot-id}/status" \
  -H "Content-Type: application/json"

Send WhatsApp Message (New Proxy API)

curl -X POST "/api/bots/send-message" \
  -H "Content-Type: application/json" \
  -d '{
    "botId": "whatsapp-bot-1234567890",
    "phoneNumber": "+1234567890",
    "message": "Hello from the API!"
  }'

Get WhatsApp Groups (New Proxy API)

curl -X POST "/api/bots/get-groups" \
  -H "Content-Type: application/json" \
  -d '{
    "botId": "whatsapp-bot-1234567890"
  }'

Restart Bot (Administrative API)

curl -X POST "/api/bots/{bot-id}/restart" \
  -H "Content-Type: application/json"

Get All Bots

curl -X GET "/api/bots" \
  -H "Accept: application/json"

Spawn New WhatsApp Bot

curl -X POST "/api/bots/spawn/whatsapp" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My WhatsApp Bot",
    "apiPort": 3000,
    "apiHost": "localhost"
  }'

Legacy Send Message (Old API)

curl -X POST "/api/bots/{bot-id}/send" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumber": "+1234567890",
    "message": "Hello from the API!"
  }'
API Migration Notice

New Unified Bot Proxy API: All bot operations now use a unified proxy API where the bot ID is passed in the request body instead of URL parameters.

Key Changes:

  • • Bot ID is now passed in the request body as botId
  • • All bot proxy endpoints use POST method (for consistency)
  • • Endpoints are now at /api/bots/operation instead of /api/bots/{id}/operation
  • • Better error handling with validation for required botId
  • • Unified documentation and Swagger specs

Benefits: This new structure provides better consistency, easier payload management, and improved error handling across all bot operations.