Skip to main content
POST
/
api
/
v1
/
external
/
whatsapp
curl -X POST "https://olive-gateway-a6ba.onrender.com/api/v1/external/whatsapp" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "message",
    "message": "What is my balance?",
    "from": "23279648205@c.us",
    "phoneE164": "+23279648205"
  }'
{
  "answer": "Your balance is 5,000 SLE",
  "status": "success"
}
Receive and process WhatsApp messages via Agent-TS. Supports both external clients (whatsapp-web.js) and Meta Business API.

Endpoints

MethodEndpointDescription
POST/api/v1/external/whatsappExternal client messages
GET/api/v1/webhooks/whatsappMeta webhook verification
POST/api/v1/webhooks/whatsappMeta webhook messages

External Client Request

event
string
required
Event type (e.g., message)
message
string
required
Message content from user
from
string
required
WhatsApp ID (e.g., 23279648205@c.us)
phoneE164
string
required
Phone number in E.164 format

Response

answer
string
Agent response message
status
string
Processing status (success, error)

Examples

curl -X POST "https://olive-gateway-a6ba.onrender.com/api/v1/external/whatsapp" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "message",
    "message": "What is my balance?",
    "from": "23279648205@c.us",
    "phoneE164": "+23279648205"
  }'
{
  "answer": "Your balance is 5,000 SLE",
  "status": "success"
}

Meta Business API

Verification (GET)

Meta sends a verification request when setting up the webhook:
GET /api/v1/webhooks/whatsapp?hub.mode=subscribe&hub.verify_token=YOUR_TOKEN&hub.challenge=CHALLENGE
Return hub.challenge if hub.verify_token matches.

Messages (POST)

Meta sends incoming messages as POST requests with the message payload.

Agent-TS Webhooks

Detailed webhook configuration and message handling