Compare a window with the previous window

Returns the dashboard's KPIs for the window against the window of equal length just before it, from the same loaders as the Analytics overview, the Signals rate cards, the detector KPI tiles and the Problems trend card. Each figure is { current, previous, delta, delta_pct, spike? }; delta is in points for a _pct rate. With since (for example a deploy time) the previous window is the same span before since, so the response is a before/after comparison.

get/api/v1/data/trends

Request

  • Base URL
    https://moda.dev
  • Auth
    API key in header x-api-key

Query parameters

days_backinteger

Window ending now. Not with since/until.

sincestring

Window start (ISO 8601 date or datetime, UTC unless an offset is given). The window may span up to 90 days.

untilstring

Window end, inclusive (default now). Needs since.

agentstring

One sub-agent name (agent.options lists them). Scopes the overview section only; problems, rates and detectors are left out because their loaders have no agent filter. Cannot be combined with family.

unit'conversation' | 'segment' | 'turn'

Denominator of the rates section.

includestring

Comma-separated sections: overview, problems, rates, detectors (default all). problems needs days_back.

familystring

One detector family (emotion[:<f>], frustration, tool_failure, laziness[:<f>], hallucination): only its detector KPIs and rate. frustration and sub-families return only that family's traces and leave out rates, whose cards count the whole detector.

series'0' | '1' | 'true' | 'false'

1: add series, compact [bucket, value] arrays per hour (windows up to 2 days) or per day.

Response

Successful response.

object required

window (from, to, previous_from, previous_to, days, bucket), agent (selected, options), overview (conversations, messages, negative_emotion_rate_pct, tool_failure_rate_pct, hallucinations: a count of hallucinations, not a rate), problems (window, analysed_traces, traces_with_signal, signal_rate_pct), rates (unit, units, comparable, <detector>_pct; delta and delta_pct are null when comparable is false), detectors (emotion, tool_failure, laziness, hallucination KPI tiles), series (with series=1), notes.

Changes

No recorded changes to this operation across all 1 revision of this API.