Audience

An audience object has an id, a name, and a conditions array.

AttributeTypeDescription
idIntegerThe audience ID assigned by Clerk. To create an audience, send id: 0. Then use List audiences to find the assigned ID.
nameStringThe name of the audience.
conditionsArray of condition objectsThe rules used to calculate audience membership.

For complete request examples, see Create an audience and Update an audience.

Condition object

AttributeTypeDescription
metricStringThe customer attribute or activity to evaluate.
operatorStringThe comparison to apply. Operators include =, !=, >, >=, <, <=, in, not in, and query.
valueString or integerThe value to compare against.
timeframeObjectThe time period to evaluate for the condition.

Metrics include products, product_operators, loyalty, life_cycle, price_affinity, orders, interests, orders_count, orders_avg_value, orders_made, orders_first_made, and orders_last_made.

Timeframe object

AttributeTypeDescription
operatorStringOne of more_than, exactly, less_than, after, on, before, or between.
valueString, date-time, or objectA timeframe value. A date range is an object with start and end date-time values.