Create Metric

Creates a metric in the organization. The response is the metric's definition; run it with
Show Metric, or try a definition first with Preview Metric.

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.

Requests made with an API key are attributed to the user who created the key.

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

Metric definition

A metric definition.

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.

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).

string | null

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

string
required

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