D
API Reference

API Reference

Daftar endpoint engine-bot — /health (public), /api/* (JWT protected). Endpoint percakapan utama chatbot-api, ai-agent-testing, notify-new-message, generate_welcome, webhook/payment-notification.

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

KategoriAuthCatatan
/api/*✅ JWT Bearer wajibAtau IP allowlist bypass (env.allowedIP)
/health❌ publicHealth check, di luar /api
http
Authorization: Bearer <jwt>
Content-Type: application/json

Header umum

http
Authorization: Bearer <jwt>
Content-Type: application/json

Response envelope

Tidak ada standardisasi — shape berbeda per endpoint:

json
// 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 JSON

Grup endpoint

GrupHalamanEndpoint
Chatbot APIChatbot APIPOST /api/chatbot-api
AI Agent TestingAI Agent TestingPOST /api/ai-agent-testing
Notify & WelcomeNotify & WelcomePOST /api/notify-new-message, POST /api/generate_welcome
Payment WebhookPayment WebhookPOST /api/webhook/payment-notification
Instant PaymentInstant PaymentDazoApp endpoints (create-checkout, check-status)

Daftar endpoint lengkap

EndpointMethodAuthGrup
/healthGET❌ publicHealth
/api/testGET✅Smoke test
/api/chatbot-apiPOST✅Chatbot
/api/ai-agent-testingPOST✅AI testing
/api/notify-new-messagePOST✅Notify
/api/generate_welcomePOST✅Welcome
/api/webhook/payment-notificationPOST✅Webhook

Catatan

  • Semua route /api POST atau GET /test — tidak ada PUT/DELETE di /api
  • Route prefix /api — tidak ada versioning
  • Socket.IO event newMessage dibroadcast global tanpa auth atau tenant room — lihat Conventions
  • Root GET /health return Redis health status (tidak cek MongoDB)

Langkah berikutnya