Get Kpi Trends
const url = 'https://api.ultimateteam.ai/api/v1/kpi/trends?window=1&category=example';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.ultimateteam.ai/api/v1/kpi/trends?window=1&category=example' \ --header 'X-API-Key: <X-API-Key>'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
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “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
Section titled “ Responses ”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
Examplegenerated
{ "category": "example", "points": [ { "category": "example", "metrics": {}, "snapshot_date": "2026-04-15" } ], "window": 1}Validation Error
object
object
object
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}