-
/ — GET
Root status page: Returns a human-readable HTML status page (this page).
How to use: Open this URL in a browser or curl to verify the service is up.
Parameters: None
Returns:
HTML page showing UTC time and list of endpoints (200).
-
/health — GET
Health check: Simple JSON health-check used by load-balancers and health probes.
How to use: HTTP GET. Example: curl -sS http://HOST/health
Parameters: None
Returns:
JSON: {{"status": "ok"}} with HTTP 200 on success.
-
/ingest — POST
Ingest endpoint: Stores request payloads (JSON, form-data, files) to an ingest directory for inspection.
How to use: POST JSON or multipart/form-data (file upload) to this endpoint. Example: curl -F "upload=@notes.txt" http://HOST/ingest
Parameters:
- query args: Optional query args like source or case
- body: JSON body or form fields; files accepted via multipart/form-data
Returns:
JSON: {{"status":"stored","request_id":"","ingest_path":""}} (HTTP 201)
-
/save_message — POST
Save message endpoint: Saves message data from mwai_chatbot_reply hook to the messages table. Raw JSON not stored (space optimized).
How to use: POST the exact payload from mwai_chatbot_reply: {"rawText": "...", "query": {...}, "params": {...}, "extra": {...}}
Parameters:
- rawText: The AI response text
- query: Query object with message, ai, and system fields
- params: Parameters object including chatId
- extra: Extra data including responseId and responseDate
Returns:
JSON: {"status":"stored","id":} on success (HTTP 201).
-
/save_usage — POST
Save token usage endpoint: Saves token usage data from mwai_ai_reply hook to the token_usage table. Raw JSON not stored (space optimized).
How to use: POST the exact payload from mwai_ai_reply: {"query": {...}, "reply": {...}}
Parameters:
- query: Query object with ai and system metadata
- reply: Reply object containing usage statistics
Returns:
JSON: {"status":"stored","id":} on success (HTTP 201).