An audience object has an id, a name, and a conditions array.
| Attribute | Type | Description |
|---|---|---|
id | Integer | The audience ID assigned by Clerk. To create an audience, send id: 0. Then use List audiences to find the assigned ID. |
name | String | The name of the audience. |
conditions | Array of condition objects | The rules used to calculate audience membership. |
For complete request examples, see Create an audience and Update an audience.
Condition object
| Attribute | Type | Description |
|---|---|---|
metric | String | The customer attribute or activity to evaluate. |
operator | String | The comparison to apply. Operators include =, !=, >, >=, <, <=, in, not in, and query. |
value | String or integer | The value to compare against. |
timeframe | Object | The 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
| Attribute | Type | Description |
|---|---|---|
operator | String | One of more_than, exactly, less_than, after, on, before, or between. |
value | String, date-time, or object | A timeframe value. A date range is an object with start and end date-time values. |
