/api/sentiment_report

Header
POST https://api.Fluxrails.app/api/v1/ai/sentiment_report
X-Customer-Api-Id: <uuid>
X-Secret: <secret>
Content-Type: application/json
Request Body Schema
// Request Body Schema
{
  "timeframe": "daily" | "weekly",     // grouping interval
  "entries": [
    {
      "id": "string",                  // unique feedback identifier
      "timestamp": "YYYY-MM-DD",       // entry date
      "text": "string"                 // raw feedback text
    }
  ]
}
Example Request Body
// Example Request Body
{
  "timeframe": "weekly",
  "entries": [
    { "id": "rev-001",    "timestamp": "2025-04-21", "text": "Checkout keeps crashing 😡" },
    { "id": "ticket-042", "timestamp": "2025-04-22", "text": "Great support, thank you!" },
    { "id": "tweet-088",  "timestamp": "2025-04-23", "text": "New update rocks but battery drains fast." },
    { "id": "chat-105",   "timestamp": "2025-04-23", "text": "Please add PayPal option." },
    { "id": "fb-109",     "timestamp": "2025-04-24", "text": "App still freezes on login." }
  ]
}
Example Response Body
// Example Response Body
{
  "period_start": "2025-04-21",
  "period_end":   "2025-04-24",
  "kpis": {
    "positive_pct": 20.0,
    "neutral_pct":  40.0,
    "negative_pct": 40.0,
    "top_topics": [
      "checkout",
      "crashing",
      "technical issues",
      "support",
      "customer service"
    ]
  },
  "details": [
    {
      "id": "rev-001",
      "sentiment": "negative",
      "emotion":   "frustration",
      "score":     -0.8,
      "key_topics": [
        "checkout",
        "crashing",
        "technical issues"
      ],
      "interpretation": "Score -0.80 → NEGATIVE (−1…+1). Topics: checkout, crashing, technical issues"
    },
    {
      "id": "ticket-042",
      "sentiment": "positive",
      "emotion":   "gratitude",
      "score":      0.9,
      "key_topics": [
        "support",
        "customer service"
      ],
      "interpretation": "Score +0.90 → POSITIVE (−1…+1). Topics: support, customer service"
    },
    {
      "id": "tweet-088",
      "sentiment": "mixed",
      "emotion":   "frustration",
      "score":      0.2,
      "key_topics": [
        "update",
        "battery life",
        "performance"
      ],
      "interpretation": "Score +0.20 → MIXED (−1…+1). Topics: update, battery life, performance"
    },
    {
      "id": "chat-105",
      "sentiment": "neutral",
      "emotion":   "request",
      "score":     0.0,
      "key_topics": [
        "PayPal",
        "payment options",
        "customer request"
      ],
      "interpretation": "Score +0.00 → NEUTRAL (−1…+1). Topics: PayPal, payment options, customer request"
    },
    {
      "id": "fb-109",
      "sentiment": "negative",
      "emotion":   "frustration",
      "score":     -0.7,
      "key_topics": [
        "app performance",
        "login issues",
        "freezing"
      ],
      "interpretation": "Score -0.70 → NEGATIVE (−1…+1). Topics: app performance, login issues, freezing"
    }
  ],
  "interpretation": "20.0% positive vs 40.0% negative this weekly. Top pain-points: checkout, crashing, technical issues."
}
Description

• Analyzes free-text feedback (reviews, tickets, tweets, chat logs). • Classifies each entry by sentiment (negative/neutral/mixed/positive), emotion, and extracts key topics. • Aggregates KPIs over the specified timeframe: sentiment percentages and trending topics. • Provides per-entry details and a concise human-readable summary.

Business Usage

• Monitor user satisfaction trends over time (daily alerts, weekly executive summaries). • Identify top pain-points (e.g., checkout failures, app crashes) via `top_topics`. • Drill into negative verbatims (`details` filtered by `sentiment=negative`) to prioritize fixes. • Tune data volume and granularity: batch ≥30 entries for stable topic clustering. • Feed enriched tags (e.g., “#login #bug”) to improve topic extraction.

← Back to all routes