Begins processing statistics asynchronously, returning a request id to get the status and retrieve the results by calling GET /stats/{request_id}.
Stats for the whole company will be processed by default. An office_id can be provided to limit stats to a single office. A target_id and target_type can be provided to limit stats to a single target.
A company-wide export, meaning a request with no office_id and no target, requires either a company admin's API key or a company-level API key. Without that permission the request fails with a 403 response. The coaching_group and coaching_team flags do not limit the scope on their own, so a request with only those flags still asks for company-wide data and needs the same permission.
Call records (stat_type calls with export_type records) can be limited to a time of day on each day in the date range by passing start_time_of_day and end_time_of_day, for example 17:00 and 20:00. They are evaluated in the request timezone. The start is inclusive and the end is exclusive, and an end_time_of_day earlier than start_time_of_day describes a window that crosses midnight.
Requires scope: stats:export (included by default for unrestricted API keys)
Rate limit: 200 per hour.