---
title: "Conversation Outcome Mapping Trends"
method: GET
path: "/campaigns/v1/stats/outcomes/{template}/trends"
tags: ["Campaign Stats", "Stats"]
---

# Conversation Outcome Mapping Trends

`GET /campaigns/v1/stats/outcomes/{template}/trends`

Get conversation outcome category / sub category counts over time, split into
contiguous windows so the result can be rendered as a trend/bar chart.

The window size is derived from the requested period:
- **≤ 2 days** → 6-hour windows
- **≤ 14 days** → daily windows
- **≤ ~1 month** → weekly windows
- **> 1 month** → monthly windows

- **template**: Outcome mapping template to bucket outcomes by.
- **start** / **end**: ISO 8601 range. `end` is exclusive; each window's `end`
  field is its last second (e.g. `...T23:59:59Z`).
- **timezone**: IANA timezone the day/month/6-hour bars align to (local calendar);
  defaults to UTC. Weekly bars are always anchored to `start`.

Returns an empty list if the team has no outcome mapping configured yet, or if
the given range is missing or empty.

## Path parameters

- `template` 'template_v1' | 'template_v2', required

## Query parameters

- `timezone` string — IANA timezone (e.g. 'Asia/Kolkata') that day/month/6-hour bars align to; defaults to UTC.
- `size` integer — Number of items per page
- `page` integer — Page number
- `search` string, nullable — Search keywords
- `start` string, date-time, nullable — Filter by start time (ISO 8601 format)
- `end` string, date-time, nullable — Filter by end time (ISO 8601 format)

## Response `200`

Conversation outcome category / sub category counts bucketed into time windows

- OutcomeTrendsResponse
  - `message` string, required — Result description
  - `data` OutcomeTrendWindow[], required — Outcome category / sub category counts bucketed into contiguous time windows. Window size adapts to the requested period: 6-hour windows for up to 2 days, daily up to 14 days, weekly up to ~1 month, and monthly beyond that.
    - `start` string, required — Inclusive window start (ISO 8601 UTC, 'Z' suffix)
    - `end` string, required — Inclusive window end (ISO 8601 UTC, 'Z' suffix)
    - `totalCount` integer, required — Total conversations in this window
    - `categories` OutcomeCategoryStat[], required — Outcome category / sub category breakdown within this window
      - `category` OutcomeCategorySummary, required
        - `name` string, required — Outcome category name
        - `theme` string, required — Color theme for the category
        - `description` string, nullable — Category description
      - `count` integer, required — Total number of conversations in this category
      - `subCategories` OutcomeSubCategoryStat[], required — Sub category breakdown within this category
        - `name` string, required — Outcome sub category name
        - `theme` string, required — Color theme for the sub category
        - `description` string, nullable — Sub category description
        - `count` integer, required — Number of conversations in this sub category

## Other responses

- `400` — Bad request — invalid input or constraint violation
- `404` — Requested resource not found
- `422` — Validation Error
- `500` — Internal server error

## Changes

- **2026-08-27** `a9901c64edf4` — 1 info
  - added the new enum value `template_v2` to the `path` request parameter `template`
- **2026-07-27** `dd3567d69cbe` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/interactly/apis/interactly-api-2/changes/campaigns/v1/stats/outcomes/:template/trends/get.md)

---

[API](https://skmtc.dev/interactly/apis/interactly-api-2.md) · [All operations](https://skmtc.dev/interactly/apis/interactly-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/interactly/interactly-api-2/revisions/a9901c64edf4/schema)
