# Retrieve analytics

This endpoint retrieves aggregated analytics over conversations and/or in-app user activity as JSON rows.

Use the query parameters to:
- Control the time range (start_date, end_date, or days)
- Filter by dimensions such as vendor, rep_id, campaign, department, and subcampaign
- Choose which metrics to include via the metric parameter

The groupby parameter controls how results are grouped, for example:
- groupby=date → one row per calendar date
- groupby=date,campaign → one row per date per campaign
- groupby=rep_id → one row per user

Time variables week, month, and quarter automatically imply year. The half time variable
groups data into an earlier and later half of the period.

Endpoint: GET /report
Version: 1.0.5
Security: ApiKeyAuth

## Query parameters:

  - `start_date` (string)
    Oldest date to include. Default: 30 days ago.

  - `end_date` (string)
    Newest date to include. Default: today.

  - `days` (integer)
    Number of days to include up to and including end_date. Alternative to start_date. Default: 30

  - `vendor` (array)
    Filter on one or more vendor values, default:null (unfiltered)

  - `rep_id` (array)
    Filter on one or more rep_id values, default:null (unfiltered)

  - `campaign` (array)
    Filter on one or more campaign values, default:null (unfiltered)

  - `department` (array)
    Filter on one or more department values, default:null (unfiltered)

  - `subcampaign` (array)
    Filter on one or more subcampaign values, default:null (unfiltered)

  - `metric` (string)
    Metric to calculate. Behavioral call metrics from Converz, or metrics attached via calls POST or /event POST.

  - `groupby` (array)
    One or more grouping variables. For example, groupby=date returns one row per calendar date, groupby=date,campaign returns one row per calendar date per campaign. Time variables week, month, and quarter automatically imply year. Time variable half doesn't refer to half of a year. Rather, it groups the data into an earlier and later half. Allowed values: date week month quarter year half vendor rep_id campaign department subcampaign metric.

## Response 400 fields (application/json):

  - `error` (string)
    Error message

  - `code` (string)
    Error code

## Response 401 fields (application/json):

  - `error` (string)
    Error message

  - `code` (string)
    Error code


