Reports and analytics
Run Report
Run a leads, traffic, ads or calls report with POST /api/reports/: metrics, breakdowns, filters, date ranges and period comparison, computed like the Octanist dashboards.
POST
Run Report
Run a report for BI tools, spreadsheets or your own dashboards. The numbers are computed like the dashboards in the app, and the query body is the same as the
run_*_report tools of the MCP server.
Reports need an active Octanist plan. Read-only API keys can run reports.
Call
GET /api/reports first for the metric ids, channel ids and date range presets.
Path Parameters
Request Body
Fields for every report:
Lead reports also take
breakdownKey: the custom field key for the custom_field breakdown or split.
Breakdowns
channel, source, medium, campaign, source_medium and source_medium_campaign on lead reports credit leads with the attribution model. ad_campaign shows ad platform campaigns with their spend, for cost per lead per campaign.
splitBy takes the dimensions of the same report, without date, weekday, hour and weekday_hour. Traffic reports cannot be split.
Filters
Leads
A condition is
{ "field": "visit_country", "op": "is", "values": ["NL", "BE"] }. op is is_set or is_not_set (no values), is or is_not (matches any of the values, case-insensitive), or contains (one value). The fields are listed in GET /api/reports.
Traffic
Ads
Calls reports have no filters.
Example Request
Won leads and cost per lead per channel for last month, compared with the month before:Example Response
Response Fields
Rates such as
qualify_rate and win_rate are percentages (0 to 100). Money metrics are in currency.
Error Responses
Path Parameters
Body
application/json
- leads
- traffic
- ads
- calls
Metric ids, most important first
Required array length:
1 - 4 elementsAvailable options:
total_leads, open_leads, qualified_leads, won_leads, lost_leads, value_won, value_lost, avg_lead_value, total_spend, extra_costs, total_cost, cpl, cpql, cpwl, cpc, qualify_rate, win_rate, close_rate, ctr, clicks, impressions, roas, win_lose_ratio Example:
Available options:
none, date, channel, source, medium, campaign, source_medium, source_medium_campaign, ad_campaign, status, label, form, created_via, visit_country, device, browser, os, landing_domain, landing_path, referrer_host, utm_source, utm_medium, utm_campaign, phone_country, lost_reason, custom_field, weekday, hour, weekday_hour Example:
"channel"
Only with breakdown date: one series per value of this dimension (top values, the rest as "Other"). Uses the first metric only and does not compare periods.
Available options:
none, channel, source, medium, campaign, source_medium, source_medium_campaign, ad_campaign, status, label, form, created_via, visit_country, device, browser, os, landing_domain, landing_path, referrer_host, utm_source, utm_medium, utm_campaign, phone_country, lost_reason, custom_field Run Report