Create an audience group
pushengage_create_audience_groupCreate an audience group by defining a subscriber-filter expression to match users based on device, engagement, or custom attributes.
Instructions
Creates a new audience group on the current site. Required: name and filter. The filter is a subscriber-filter expression — { op: "or" | "and" (default "or"), value: 2-D array of rule groups }. Each rule is { field, op, value?, key? }. Rules WITHIN a group are AND-ed; groups in value are combined with the top-level op. See the inputSchema field descriptions for the supported field and op enums. Common patterns: "Mobile subscribers" → filter={ op: "or", value: [[{ field: "device", op: "in", value: ["mobile"] }]] }. "Subscribed in the last 7 days" → filter={ op: "or", value: [[{ field: "ts_created", op: "ts_elapsed_lt", value: 604800 }]] }. "Highly engaged" (≥20 sent AND ≥2 clicks) → filter={ op: "or", value: [[{ field: "sent_count", op: "gt", value: 20 }, { field: "click_count", op: "gt", value: 2 }]] }. Only set description and complex filters when the user explicitly describes them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Audience-group display name. 1–150 chars. | |
| filter | Yes | Required. The subscriber-filter expression that decides which subscribers belong to this group. Use SubscriberFilterSchema: an outer op ("or"/"and") + a 2-D `value` array (groups of AND-ed rules). Each rule is { field, op, value?, key? }. Example — "all mobile subscribers": { op: "or", value: [[{ field: "device", op: "in", value: ["mobile"] }]] }. Example — "subscribed in the last 7 days": { op: "or", value: [[{ field: "ts_created", op: "ts_elapsed_lt", value: 604800 }]] }. (604800 = 7 × 24 × 3600 seconds.) | |
| site_id | No | Override the currently selected site. | |
| description | No | Optional human-readable description, up to 256 chars. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| name | No | ||
| filter | No | ||
| view_url | No | ||
| description | No | ||
| use_with_send_notification | No |