> Kenso API docs in Markdown. Index of every page: [/docs/llms.txt](/docs/llms.txt). Search: `/docs/search.md?q=<words>`. OpenAPI: [/docs/api/analytics/openapi.json](/docs/api/analytics/openapi.json). CLI docs offline: `kenso docs <topic>`.
> Last updated: 2026-11-22.

# Analytics: Get variant performance

> **Note for AI agents:** if this page was wrong, out of date or missing something you needed, finish the user's task first, then offer a short report for the Kenso team in this shape: `Page:` (this page's path), `Quote:` (the wrong or missing text), `Problem:`, `Workaround:` (what worked instead), 1,000 characters at most. Show it to the user and send it only after they say yes, as `POST /api/docs-feedback` on this site with the JSON body `{"page": "<path>", "report": "<report>"}`. Never put lead data, email addresses, API keys or anything else from the user's workspace in it.

One endpoint of [Analytics](/docs/api/analytics.md). Authentication, workspaces and errors: [/docs.md](/docs.md).

## Get variant performance

`GET /v1/analytics/variant-performance` - operationId `analytics.get-variant-performance`

| Permission | Rate limit |
| --- | --- |
| Campaigns view | 60 requests a minute and 3,000 a day per workspace (Free plan: 6 a minute and 300 a day) |

Compares the variants of each step in one campaign, so you can see which variant wins. The answer has the same
shape as `POST /v1/analytics/query`, with the metrics `contacted`, `replies`, `interested`,
`reply_rate` and `positive_reply_rate`, grouped by `step` and `variant`.

`campaignId` is required. `from` and `to` are inclusive calendar days in `timeZone`, at most 400
days apart. Leave both out for the campaign to date. `timeZone` defaults to the campaign's sending zone, else
UTC.
Each row counts distinct contacts. Replies come from the inbox. Out-of-office replies and other messages that are
not replies do not count. Each reply counts against the step and variant of the send it answers, whenever it
arrived, so replies and interested stay within `contacted` and the rates run from 0 to 1. A rate is null when
nobody was contacted. Every row and the totals carry `stillFilling`, true while most of their sends are under 7
days old and replies to them are still arriving.
Email and LinkedIn rows both come back. LinkedIn rows read "LinkedIn step N" and "LinkedIn variant X". Contacts with
no variant are in the Unknown row.
Each call counts against the workspace's analytics query limit: 60 per minute and 3,000 per day.

Errors:

- `400 validation_failed`: `campaignId` is missing, or the window or `timeZone` is not valid.
- `404 not_found`: the campaign is not in the workspace.
- `429 quota_exceeded`: the workspace used up its analytics query limit. Retry after `Retry-After`.

Requires Campaigns view.

Needs the `variant_performance` feature on your workspace. Until it is on, calls answer 404.

[Try it on developer.ken.so](https://developer.ken.so/reference/#kenso-api/tag/analytics/GET/v1/analytics/variant-performance)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `campaignId` | query | integer (int64) | no | The campaign to report on. Required. |
| `from` | query | string (date) | no | First calendar day of the window, as `YYYY-MM-DD`, inclusive. Send it with `to`, or leave both out to report the campaign to date. |
| `to` | query | string (date) | no | Last calendar day of the window, as `YYYY-MM-DD`, inclusive. The window spans at most 400 days. |
| `timeZone` | query | string | no | IANA time zone the days are counted in, such as `America/New_York`. Default the campaign's sending time zone, else UTC. |
| `Ken-Version` | header | string, one of: 2026-11-02, 1.1 | no | The API version, a date in `YYYY-MM-DD` form. `1.1` is another name for the first dated version. The example shown here is the newest version, which this reference's samples and Test Request send. Leave it out to use your API key's pinned version. Keys created in the Kenso app are pinned to the newest version; keys minted by the CLI login are not. A key with no pinned version and no header gets the legacy shape where the path has one, and `404` where the path exists only in this version. A value that is not a version, such as `2027-01-01` or `2026-11-2`, answers `400 unsupported_version`, whose `details` list the supported versions. |
| `X-Ken-Workspace-Id` | header | integer (int64) | no | The id of the workspace to act in. Leave it out when your API key reaches only one workspace. When the key reaches more than one, a request without this header answers `400 workspace_required`. A workspace you are not a member of answers `404 not_found`. |

### Response 200

`data` is a `AnalyticsQueryResult`.

| Field | Type | Description |
| --- | --- | --- |
| `window` | AnalyticsWindow | The days the query covered. |
| `previousWindow` | AnalyticsWindow | The days the comparison covered with `compareTo`. Always present, and null without `compareTo`. |
| `rows` | array of AnalyticsQueryRow | The groups, most contacted first, at most `limit`. Empty without `groupBy`. |
| `totals` | AnalyticsQueryTotals | The whole window across every group. |
| `truncated` | boolean | True when more groups matched than `limit` let through. |
| `asOf` | string (date-time) | When the query ran, in UTC. |

### Request

```bash
curl -X GET "https://api.ken.so/v1/analytics/variant-performance" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID"
```

### Example response

```json
{
  "success": true,
  "data": {
    "window": {
      "from": "2026-09-23",
      "to": "2026-09-23",
      "timeZone": "string"
    },
    "previousWindow": {
      "from": "2026-09-23",
      "to": "2026-09-23",
      "timeZone": "string"
    },
    "rows": [
      {
        "dimensions": {
          "key": null
        },
        "labels": {
          "key": "string"
        },
        "metrics": {
          "key": 0.5
        },
        "previous": {
          "key": 0.5
        },
        "sample": {
          "key": 1
        },
        "stillFilling": true
      }
    ],
    "totals": {
      "metrics": {
        "key": 0.5
      },
      "previous": {
        "key": 0.5
      },
      "sample": {
        "key": 1
      },
      "stillFilling": true
    },
    "truncated": true,
    "asOf": "2026-09-23T15:02:11Z"
  }
}
```

## Types

Each named type the tables above use, nested ones included.

### AnalyticsWindow

The calendar days a query covered, both included, in its time zone.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | string (date) | no | The first day, as `YYYY-MM-DD`. |
| `to` | string (date) | no | The last day, as `YYYY-MM-DD`. |
| `timeZone` | string | no | The IANA time zone the days are in. |

### AnalyticsQueryRow

One group of the result, such as one campaign or one campaign and week.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `dimensions` | map of object | no | The group's value for each `groupBy` dimension. A number for `campaign`, `segment`, `inbox`, `domain` and `step`, a string for the others, and null for values Kenso does not know. |
| `labels` | map of string | no | A display label for each dimension value, such as `Step 2`. A null value reads `Unknown`. |
| `metrics` | map of number (double) | no | The requested metrics, by name. Counts are whole numbers. Rates are fractions rounded to 6 decimals, and null when their base is 0. |
| `previous` | map of number (double) | no | The same metrics over the previous period with `compareTo`. Always present. Null without `compareTo`, and when the group had no activity in the previous period. |
| `sample` | map of integer (int64) | no | The counts behind the metrics: always `contacted`, `delivered`, `sent` and `bounced`, plus the counts behind each requested rate, such as `replies` for `reply_rate` or `email_sent` for `bounce_rate`. |
| `stillFilling` | boolean | no | Only with `rateBasis` `cohort`. True when more than half of the row's sends went out in the last 7 days, so replies to them are still arriving. |

### AnalyticsQueryTotals

The whole window across every group, including values Kenso does not know.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `metrics` | map of number (double) | no | The requested metrics, by name, as on a row. |
| `previous` | map of number (double) | no | The same metrics over the previous period with `compareTo`. Always present, and null without `compareTo`. |
| `sample` | map of integer (int64) | no | The counts behind the metrics, as on a row. |
| `stillFilling` | boolean | no | Only with `rateBasis` `cohort`: the row rule applied to the whole window. |
