Create a Session
Click + New Session on the Dashboard tab. Each session represents one WhatsApp number.
WhatsApp Gateway Platform
Waiting for events...
Click a group to view details
| Name | Phone | Tags | Created |
|---|
| Name | Body | Category | Created |
|---|
| Keyword | Match | Response | Session | Active | Priority |
|---|
| URL | Events | Active | Created |
|---|
| Label | Key | Session | Created |
|---|
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..."}
# 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 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!"}'
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"})
# 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"]