Get Kpi Trends
GET /api/v1/kpi/trends
Get KPI trend data for charting.
Returns daily KPI snapshots for the specified window and category, ordered by date ASC for time-series charting.
Args: window: Number of days to look back (7, 30, 90). category: KPI category filter. user: Authenticated user context. db: Async database session.
Returns: KPITrendResponse with trend points.
Raises: HTTPException: 400 if window or category invalid.
Authorizations
Parameters
Query Parameters
Lookback window in days (7, 30, 90)
Lookback window in days (7, 30, 90)
KPI category: revenue, agent_effectiveness, business_health
KPI category: revenue, agent_effectiveness, business_health
Responses
200
Successful Response
Response model for KPI trend aggregation.
Contains the requested window size, category filter, and ordered list of daily trend points for charting.
object
A single data point in a KPI trend series.
Represents one day’s snapshot for a specific KPI category.
object
object
422
Validation Error