Preview Metric

Runs a metric definition without saving it and returns its generated data. A definition
that previews successfully can be created as is: preview accepts exactly what Create
Metric does (title is optional), and returns the same results Show Metric returns for
the saved metric over the same range.

The window is set like Show Metric's: start and end (ISO 8601, together) in
timezone (default America/Chicago), or the trailing four weeks when omitted.

A metric is a chart (chart) over one or more events (events). Build events with List
Metric Events and List Metric Event Fields:

  • type and name come from List Metric Events, which also lists the charts each supports.
  • filter, group_by and aggregate use the fields List Metric Event Fields returns.
  • non_custom events (and a metric type of non_custom) name a report; only the reports
    List Metric Events lists are accepted, with the filters and group-by fields it describes.

Rules that span events: linked metrics (linked: true) have exactly two events, one
whippy_event and one custom_event, with different ranks; funnel steps are ordered by
rank; heatmaps take no aggregate; bar, column and line charts group by at most one field;
group_colors and event color take #RRGGBB hex colors.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Metric definition

A metric definition to run without saving, and the window to run it over.

boolean

Funnel charts only. When true each step counts the distinct contacts that reached the step before it; when false the steps are counted independently.

string
enum
required

The chart type the metric renders as. non_custom reports support a subset, listed per report by GET /v1/metrics/events.

string | null

Metric description.

date-time

ISO 8601 range end.

events
array of objects
required

The events the metric measures. Together with chart, this defines what the metric shows.

events*
integer | null

Font size in pixels for the chart value. Primarily used for total charts.

group_colors
object

Segment colors keyed by group_by field, then by raw group value, to a hex color. Values without an entry fall back to the default palette.

string | null
enum

Position of the legend on the chart.

Allowed:
boolean

Whether the metric is linked: exactly two events, one whippy_event and one custom_event, where one is counted only for the records that also had the other.

string | null
enum

Reading direction of the funnel bands. Only used by funnel charts; null renders vertically.

Allowed:
string | null

Text prepended to the chart value (e.g. "$"). Primarily used for total charts.

boolean | null

Whether the chart renders a legend. Primarily used for sector charts (pie, donut).

date-time

ISO 8601 range start.

string | null

Text appended to the chart value (e.g. "%"). Primarily used for total charts.

string

IANA timezone the range is interpreted in.

string

Metric title

boolean

Whether the metric renders a comparison against the previous period.

boolean

Whether a trend line is overlaid on time-bucketed charts (bar, column, line).

string
enum

Metric type. custom for metrics created by users in the UI, non_custom for metrics backed by a report defined internally by Whippy.

Allowed:
Responses

Callback
Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json