call_stats
Retrieve grouped totals of call metrics—such as total calls, missed calls, and leads—by dimension (source, campaign, etc.) for a date range.
Instructions
Server-side call aggregation via CallRail's /calls/summary.json.
One request instead of paginating every call — prefer this over
call_summary (which fetches and counts calls client-side) when
you only need grouped totals. call_summary remains useful for
metrics this endpoint doesn't expose (first-time vs repeat split,
per-source-name breakdown, exact duration sums).
Args:
group_by: Dimension to group by. One of: 'source', 'keywords',
'campaign', 'referrer', 'landing_page', 'company'.
days: Lookback (default 30). Ignored if start_date given.
start_date / end_date: 'YYYY-MM-DD'. Explicit dates win.
company_id: Filter to one company.
fields: Comma-separated metrics, e.g.
'total_calls,missed_calls,answered_calls,first_time_callers,
average_duration,leads'. Default: total_calls only.
account_id: Auto-resolves if omitted.
Returns:
JSON string with start_date, end_date, time_zone,
total_results and grouped_results[] ({key, }).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | ||
| fields | No | ||
| end_date | No | ||
| group_by | No | source | |
| account_id | No | ||
| company_id | No | ||
| start_date | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |