Analytics API
GET /api/v1/conversations/analytics/overview
Summary: Get Conversation Analytics
Get conversation analytics.
Response Schema (ConversationAnalyticsResponse - Status 200):
| Property | Type | Required | Description |
|---|---|---|---|
total_conversations | integer | * | |
total_messages | integer | * | |
avg_messages_per_conversation | number | * | |
positive_messages | integer | * | |
negative_messages | integer | * | |
sentiment_distribution | object | * | |
topic_distribution | object | * | |
conversations_by_status | object | * | |
conversations_by_product | object | * |
GET /api/v1/analytics/usage
Summary: Get Usage Stats
Get system usage statistics.
Returns aggregated usage metrics for the specified time period. Defaults to last 24 hours if no dates provided.
Response Schema (UsageStats - Status 200):
| Property | Type | Required | Description |
|---|---|---|---|
total_queries | integer | * | |
total_documents | integer | * | |
avg_query_latency_ms | number | * | |
avg_iterations | number | * | |
avg_critique_score | number | * | |
success_rate | number | * | Query success rate |
period_start | string | * | |
period_end | string | * |
GET /api/v1/analytics/queries/recent
Summary: Get Recent Queries
Get recent query analytics.
Returns the most recent queries with their performance metrics.
GET /api/v1/analytics/queries/thread/{thread_id}
Summary: Get Thread Queries
Get all queries for a conversation thread.
Returns queries in chronological order.
GET /api/v1/analytics/metrics
Summary: Get Query Metrics
Get query performance metrics.
Returns latency percentiles and performance statistics.
Response Schema (QueryMetrics - Status 200):
| Property | Type | Required | Description |
|---|---|---|---|
total_queries | integer | * | |
avg_latency_ms | number | * | |
min_latency_ms | number | * | |
max_latency_ms | number | * | |
p50_latency_ms | number | * | |
p95_latency_ms | number | * | |
p99_latency_ms | number | * | |
period_days | integer | * |
GET /api/v1/analytics/coverage-gaps
Summary: Get Coverage Gaps
Content-gap report (kapa-style): clusters low-confidence / unanswered questions into themes, each with a finding and a documentation recommendation.
Response Schema (CoverageGapsReport - Status 200):
| Property | Type | Required | Description |
|---|---|---|---|
window_days | integer | * | |
questions_analyzed | integer | * | |
clusters | array of CoverageGapCluster |
GET /api/v1/widgets/{widget_id}/analytics/metrics
Summary: Get Widget Metrics
Get comprehensive metrics for a widget.
Returns conversation, message, visitor, and quality metrics for the specified time period.
Response Schema (WidgetMetricsResponse - Status 200):
| Property | Type | Required | Description |
|---|---|---|---|
total_conversations | integer | * | |
conversations_today | integer | * | |
conversations_this_week | integer | * | |
conversations_this_month | integer | * | |
avg_messages_per_conversation | number | * | |
total_messages | integer | * | |
messages_today | integer | * | |
user_messages | integer | * | |
assistant_messages | integer | * | |
total_visitors | integer | * | |
unique_visitors_today | integer | * | |
returning_visitors | integer | * | |
avg_session_duration_seconds | number | * | |
positive_feedback_count | integer | * | |
negative_feedback_count | integer | * | |
feedback_ratio | number | * | |
avg_response_latency_ms | number | * | |
widget_opens | integer | * | |
messages_per_visitor | number | * |
GET /api/v1/widgets/{widget_id}/analytics/conversations
Summary: Get Widget Conversations
Get list of conversations for a widget.
Returns conversation summaries with visitor info and metrics.
Response Schema (WidgetConversationsListResponse - Status 200):
| Property | Type | Required | Description |
|---|---|---|---|
items | array of WidgetConversationSummary | * | |
total | integer | * |
GET /api/v1/widgets/{widget_id}/analytics/messages-trend
Summary: Get Messages Trend
Get message count trend over time.
Returns time series data for charting.
Response Schema (WidgetTimeSeriesResponse - Status 200):
| Property | Type | Required | Description |
|---|---|---|---|
data | array of TimeSeriesPointResponse | * | |
granularity | string | * |
GET /api/v1/widgets/{widget_id}/analytics/satisfaction-trend
Summary: Get Satisfaction Trend
Get satisfaction score trend over time.
Returns percentage of positive feedback per day.
Response Schema (WidgetTimeSeriesResponse - Status 200):
| Property | Type | Required | Description |
|---|---|---|---|
data | array of TimeSeriesPointResponse | * | |
granularity | string | * |