Intelligence endpoints

Public intelligence service and app bridge endpoint contracts.

Last updated:

Standalone intelligence service

These endpoints are served by the standalone intelligence service.

Service health

GET /health

  • Returns service status and health metadata.

Generic chat

POST /chat

Request body:

{
  "message": "Summarise today's operational risks",
  "actor": "ops.lead"
}

Response body:

{
  "requestId": "UUID",
  "answer": "..."
}

Intelligence query

POST /intelligence/query

Request body:

{
  "question": "Why did conversion drop this week?",
  "windowDays": 30,
  "actor": "ops.lead"
}

Response body:

{
  "requestId": "UUID",
  "dataWindowDays": 30,
  "answer": "..."
}

Guardrail: model output is generated from approved deterministic facts, not model-authored SQL.

ChannelWeave app bridge endpoints (session-authenticated)

The main ChannelWeave app exposes session-authenticated routes for the Intelligence UI:

  • GET /chat
  • GET /api/intelligence/health
  • GET /api/intelligence/status
  • GET /api/intelligence/conversations
  • POST /api/intelligence/conversations
  • GET /api/intelligence/conversations/:conversation_id/messages
  • POST /api/intelligence/chat
  • POST /api/intelligence/query
  • POST /api/intelligence/ebay-listing-seed

POST /api/intelligence/query

Validation:

  • question is required (trimmed, bounded length).
  • conversationId is optional.

Response shape:

{
  "ok": true,
  "request_id": "UUID",
  "conversation_id": "UUID",
  "data_window_days": 30,
  "answer": "..."
}

POST /api/intelligence/chat

Validation:

  • message is required (trimmed, bounded length).

Response shape:

{
  "ok": true,
  "request_id": "UUID",
  "answer": "..."
}

Conversation routes

These routes provide per-user chat persistence within the signed-in workspace:

  • GET /api/intelligence/conversations
    • optional limit query (1..100, default 40)
  • POST /api/intelligence/conversations
    • optional body: { "title": "<text>" }
  • GET /api/intelligence/conversations/:conversation_id/messages
    • optional limit query (1..500, default 400)

POST /api/intelligence/ebay-listing-seed

Validation:

  • seedText is required (3..240 chars after trim).
  • marketplaceId is optional.

Response shape:

{
  "ok": true,
  "facts": {
    "seed_text": "athleta swimwear black size L",
    "marketplace_id": "EBAY_GB",
    "title_score": 84,
    "title_suggestions": [],
    "selected_category": {
      "category_id": "63867",
      "category_name": "Swimwear",
      "confidence": 0.91
    },
    "required_aspects": [],
    "suggested_aspects": [],
    "unresolved_required_aspects": []
  }
}