Skip to main content
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

Authorizations

X-API-KEY
string
header
required

API key for authentication

Path Parameters

source
enum<string>
required

Which report to run

Available options:
leads,
traffic,
ads,
calls
Example:

"leads"

Body

application/json
metrics
enum<string>[]
required

Metric ids, most important first

Required array length: 1 - 4 elements
Available 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:
breakdown
enum<string>
required
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"

dateRange
Preset · object
required

A preset, resolved in the organization timezone each time the report runs, or fixed dates (YYYY-MM-DD).

breakdownKey
string

Custom field key, for the custom_field breakdown or split

Maximum string length: 200
splitBy
enum<string>

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
filters
object
interval
enum<string>

Bucket size for the date breakdown. Default auto.

Available options:
auto,
day,
week,
month,
quarter,
year
compareTo
enum<string>

Earlier period to compute the same numbers for. Default none.

Available options:
none,
previous_period,
previous_month,
previous_year
limit
integer

Maximum rows for a dimension breakdown (default 10)

Required range: 1 <= x <= 25

Response

Report result

success
boolean
Example:

true

data
object
meta
object