Pre-built Report Endpoints
Specialized analytical endpoints for funnel analysis, cohort retention, flow comparison, and flow group performance. These endpoints execute purpose-built queries that go beyond the generic report builder.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /v1/reports/funnel | Email or flow funnel analysis |
POST | /v1/reports/cohort | Cohort retention analysis |
POST | /v1/reports/compare-flows | Compare 2--4 flows side by side |
POST | /v1/reports/flow-groups | Flow metrics grouped by tags |
All endpoints require JWT authentication and analytics:read permission.
Funnel Analysis
Visualize the email delivery pipeline or a specific flow's conversion funnel.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
funnel_type | string | Yes | email or flow |
flow_id | UUID | Flow only | Required when funnel_type is flow |
date_range | string | No | Preset: 1d, 7d, 30d (default), 90d |
from_date | string | No | ISO 8601 start date |
to_date | string | No | ISO 8601 end date |
Email Funnel Response
Flow Funnel Request
Flow Funnel Response
For flow funnels, "Completed" refers to contacts who finished all flow steps, not email clicks. A flow can have a high completion rate even if email engagement is lower, because not all flows are email-centric -- some include wait steps, conditions, or contact updates.
Funnel Step Fields
| Field | Type | Description |
|---|---|---|
label | string | Step name |
count | integer | Number of records at this step |
percentage | float | Percentage of total_entered |
drop_off_rate | float | Percentage lost from the previous step |
Cohort Retention
Group contacts by signup period and track engagement over subsequent periods.
Request Body
| Field | Type | Default | Description |
|---|---|---|---|
granularity | string | monthly | weekly or monthly |
metric | string | any_activity | Retention metric: email_opened, email_clicked, event_active, any_activity |
periods | integer | 6 | Number of periods to track (2--12) |
date_range | string | 90d | Preset date range for cohort selection |
from_date | string | ISO 8601 start date | |
to_date | string | ISO 8601 end date |
Retention Metrics
| Metric | Counts as "active" |
|---|---|
email_opened | Opened at least one email in the period |
email_clicked | Clicked at least one email link in the period |
event_active | Triggered at least one custom event in the period |
any_activity | Union of email opens and custom events |
Response
Response Fields
| Field | Type | Description |
|---|---|---|
period_labels | string[] | Column headers for the retention table |
cohorts | array | One row per cohort |
cohorts[].cohort_label | string | Human-readable label (e.g., "Jan 2026" or "W5 2026") |
cohorts[].cohort_start | string | ISO date of the cohort period start |
cohorts[].cohort_size | integer | Number of contacts in this cohort |
cohorts[].retention | (float or null)[] | Retention percentage per period (null = future period) |
cohorts[].counts | integer[] | Active contact count per period |
total_contacts | integer | Sum of all cohort sizes |
average_retention | (float or null)[] | Average retention across all cohorts per period |
Flow Comparison
Compare 2 to 4 flows side by side. The response identifies the "winner" (highest completion rate).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
flow_ids | UUID[] | Yes | 2--4 flow IDs to compare |
date_range | string | No | Preset: 1d, 7d, 30d (default), 90d |
from_date | string | No | ISO 8601 start date |
to_date | string | No | ISO 8601 end date |
Response
Per-Flow Metrics
| Field | Type | Description |
|---|---|---|
flow_id | UUID | Flow identifier |
flow_name | string | Flow name |
flow_status | string | Current status (draft, active, paused, archived) |
tags | string[] | Flow tags |
total_trips | integer | Trips started in the period |
completed | integer | Trips completed |
failed | integer | Trips failed |
completion_rate | float | completed / total_trips * 100 |
emails_sent | integer | Emails sent through this flow |
open_rate | float | Emails opened / emails sent * 100 |
click_rate | float | Emails clicked / emails sent * 100 |
The winner field is the flow_id with the highest completion rate among flows that have at least one trip. If no flows have trips, winner is null.
Flow Group Performance
Aggregate flow metrics by tag. Useful for comparing categories of flows (e.g., "onboarding" vs "retention" vs "transactional").
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
tags | string[] | No | Filter to specific tags. null or omitted = all tags. |
date_range | string | No | Preset: 1d, 7d, 30d (default), 90d |
from_date | string | No | ISO 8601 start date |
to_date | string | No | ISO 8601 end date |
Response
A single flow with multiple tags appears in each tag group it belongs to. This means metrics can appear in multiple groups -- the totals across groups may exceed the actual totals if flows have overlapping tags.
Flows without tags are grouped under "untagged". If no flows match the specified tags, the response returns an "untagged" group containing all flows.