engine-bot menyajikan 6 endpoint di /api (semua JWT-protected) plus GET /health (public).
Base URL
HTTP routes dipasang di /api. Local default: http://localhost:1313/api.
Autentikasi
| Kategori | Auth | Catatan |
|---|---|---|
/api/* | ✅ JWT Bearer wajib | Atau IP allowlist bypass (env.allowedIP) |
/health | ❌ public | Health check, di luar /api |
Authorization: Bearer <jwt>
Content-Type: application/jsonHeader umum
Authorization: Bearer <jwt>
Content-Type: application/jsonResponse envelope
Tidak ada standardisasi — shape berbeda per endpoint:
// Chatbot reply (POST /api/chatbot-api)
{
"statusCode": 201,
"idUser": "customer_id",
"idAgent": "agent_id",
"idStore": "store_id",
"data": { "answer": ["..."], "images": [], "history": [] }
}
// Welcome (POST /api/generate_welcome)
{
"status": 201,
"message": "success",
"data": { "welcome_message": "...", "cost_request": "$0.000000" }
}
// Auth smoke test (GET /api/test)
{ "message": "berhasil" }
// Notify (POST /api/notify-new-message)
"Notification send to client" // text, bukan JSONGrup endpoint
| Grup | Halaman | Endpoint |
|---|---|---|
| Chatbot API | Chatbot API | POST /api/chatbot-api |
| AI Agent Testing | AI Agent Testing | POST /api/ai-agent-testing |
| Notify & Welcome | Notify & Welcome | POST /api/notify-new-message, POST /api/generate_welcome |
| Payment Webhook | Payment Webhook | POST /api/webhook/payment-notification |
| Instant Payment | Instant Payment | DazoApp endpoints (create-checkout, check-status) |
Daftar endpoint lengkap
| Endpoint | Method | Auth | Grup |
|---|---|---|---|
/health | GET | ❌ public | Health |
/api/test | GET | ✅ | Smoke test |
/api/chatbot-api | POST | ✅ | Chatbot |
/api/ai-agent-testing | POST | ✅ | AI testing |
/api/notify-new-message | POST | ✅ | Notify |
/api/generate_welcome | POST | ✅ | Welcome |
/api/webhook/payment-notification | POST | ✅ | Webhook |
Catatan
- Semua route
/apiPOSTatauGET /test— tidak adaPUT/DELETEdi/api - Route prefix
/api— tidak ada versioning - Socket.IO event
newMessagedibroadcast global tanpa auth atau tenant room — lihat Conventions - Root
GET /healthreturn Redis health status (tidak cek MongoDB)
Langkah berikutnya
- Detail chatbot endpoint? Baca Chatbot API.
- Detail webhook? Baca Payment Webhook.
- Cara validasi token? Baca Auth & JWT.