Hierarchical traffic time series for a scope
Returns a stacked time series suitable for an ECharts stacked area / bar chart, plus a breadcrumb describing the drill-down path. The shape mirrors the Customer Analytics Dashboard contract (C-1045).
Scopes form a hierarchy organization → brand → product (optional) → trade_item; the response’s series[*].type discriminator tells the frontend whether clicking a stacked segment should drill into another product, an ungrouped trade item, or stop.
Data comes from the pre-aggregated ScanDailySummary table — no raw event scans are queried at request time. Today’s partial day is excluded; pre-aggregation runs nightly.
Caller must be a member of organization_id or a 404 is returned. scope_id (when supplied) must belong to that organization or a 404 is returned.
Authorizations
Query Parameters
UUID of the organization to query (caller must be a member).
22^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$Hierarchy level being viewed. Defaults to organization (the top-level entry view).
organization, brand, product, trade_item UUID of the brand / product / trade item to scope to. Required for every scope_type other than organization.
22^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$Override the default child grouping. Most callers leave this blank — the service derives it from scope_type (org → brand, brand → product_and_trade_item, product → trade_item).
brand, product_and_trade_item, trade_item Time bucket size for the X-axis.
day, week, month Window start (UTC, inclusive). Defaults to 30 days before end.
Window end (UTC, exclusive). Defaults to now.
Counter to plot on the Y-axis. resolves = every scan the resolver served; page_visits = the hosted-page subset.
resolves, page_visits Cap on distinct stacked series. The remainder collapses into a single Others series so the chart stays readable.
1 <= x <= 50Response
OK
Stacked traffic time series for a scope, ready for ECharts.
Shape mirrors the ticket's Response shape example. The frontend feeds
timestamps to the X-axis and each :class:SeriesEntryOut to a
stacked series; total / previous_period_total power the summary
cards above the chart.
Entity the chart is currently zoomed into.
Drill-down path from the org root to the current scope. The frontend renders this as a click-to-navigate trail.
Time bucket size used to build timestamps.
day, week, month Which counter the data arrays report.
resolves, page_visits Window covered by timestamps.
Sum of every series total within period — top summary card.
x >= 0Sum for the immediately preceding equal-length window. Used to compute the delta-vs-previous summary and per-series trend indicator. Zero when no historical data exists.
x >= 0Children of the current scope, ranked by total descending. High-cardinality scopes apply a Top N + Others collapse — see top_n query param.
X-axis bucket starts, ISO date / datetime. Length matches every series' data array.