📱
Sessions
0
Connected
0
💬
Today
0
📊
Total Msgs
0
📥
Inbound
0
📤
Outbound
0
👥
Contacts
0
📄
Templates
0
Active Sessions
Activity Feed

Waiting for events...

Pick your connected WhatsApp session
Include country code (e.g. +60 for Malaysia)
For normal messages, keep this as 💬 Text Message
Recent Sends
No recent messages
Group List
Loading...
👥

Select a Group

Click a group to view details

0
Name Phone Email Tags Created
Name Body Category Created
📱 Number Check
👤 Profile
Keyword Match Response Session Active Priority
URL Events Active Created
Label Key Session Created

🔐 Authentication

All endpoints require a Bearer token (JWT or API key) in the Authorization header.

# Login and get a token
curl -X POST http://localhost:3000/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"wahya2026"}'

# Response: {"token": "eyJ..."}

📱 Session Management

# Create a session
curl -X POST http://localhost:3000/api/v1/sessions \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "My Business"}'

# List sessions
curl http://localhost:3000/api/v1/sessions \
  -H "Authorization: Bearer YOUR_TOKEN"

✉ Send Messages

# Send text
curl -X POST http://localhost:3000/api/v1/messages/send \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"session":"SESSION_ID","to":"+60123456789","text":"Hello!"}'

# Send media
curl -X POST http://localhost:3000/api/v1/messages/send-media \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"session":"SESSION_ID","to":"+60123456789","url":"https://example.com/photo.jpg","type":"image","caption":"Check this out!"}'

# Bulk send
curl -X POST http://localhost:3000/api/v1/messages/send-bulk \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"session":"SESSION_ID","recipients":["+601111","+602222"],"text":"Broadcast!"}'

📋 Python SDK Example

import requests

BASE = "http://localhost:3000/api/v1"

# Login
token = requests.post(f"{BASE}/auth/login",
    json={"username": "admin", "password": "wahya2026"}
).json()["token"]

headers = {"Authorization": f"Bearer {token}"}

# Create session
session = requests.post(f"{BASE}/sessions",
    json={"name": "Bot"}, headers=headers).json()

# Send message
requests.post(f"{BASE}/messages/send", headers=headers,
    json={"session": session["id"],
          "to": "+60123456789",
          "text": "Hello from Python!"})

# Create template
requests.post(f"{BASE}/templates", headers=headers,
    json={"name": "welcome",
          "body": "Hi {{name}}, welcome to {{company}}!",
          "variables": ["name", "company"]})

# Send template
requests.post(f"{BASE}/messages/send-template", headers=headers,
    json={"session": session["id"],
          "to": "+60123456789",
          "template_name": "welcome",
          "variables": {"name": "Ali", "company": "ZeniChat"}})

# Schedule a message
requests.post(f"{BASE}/scheduled", headers=headers,
    json={"session": session["id"],
          "to": "+60123456789",
          "body": "Reminder: Meeting at 3pm",
          "send_at": "2026-02-24 15:00:00"})

# Add contact
requests.post(f"{BASE}/contacts", headers=headers,
    json={"phone": "+60123456789",
          "name": "Ali Ahmad",
          "tags": "vip,client"})

🔗 Webhook Payload Example

# Your webhook endpoint receives:
{
  "event": "message.received",
  "timestamp": "2026-02-23T10:30:00Z",
  "data": {
    "id": "msg_uuid",
    "session": "session_uuid",
    "from": "60123456789@s.whatsapp.net",
    "text": "Hello!",
    "mediaType": null,
    "pushName": "Ali"
  }
}

# Verify HMAC signature:
import hmac, hashlib
sig = hmac.new(SECRET.encode(), body, hashlib.sha256).hexdigest()
assert sig == request.headers["X-Wahya-Signature"]