Filter subscribers by engagement, sign-up date, state, and tags
filter_subscribersFilter subscribers by engagement, sign-up date, state, tags, custom fields, or location to segment audiences and retrieve matching account data.
Instructions
Filter subscribers by engagement, sign-up date, state, and tags. Reads account data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Array of filter conditions where ALL must be met (AND logic) | |
| account | No | Named private account from KIT_ACCOUNTS. Defaults to KIT_DEFAULT_ACCOUNT or the first configured account. | |
| include | No | Optional. Array of `{ type, ...config }` objects naming additional fields to embed on each subscriber row. Valid types: `attribution`, `tags`, `location`, `canceled_at`, `stats`, `custom_fields`. The `stats` type accepts an optional `range: { start, end }` (YYYY-MM-DD dates, defaulting to the last 90 days). The `custom_fields` type adds a `fields` object with all account custom field values (null for fields the subscriber has not set). | |
| payload | No | Complete JSON body instead of individual body flags. Supports nullable fields and nested bulk structures. Cannot be combined with body flags or payload_file. | |
| sort_field | No | Field to order results by. Base columns (`id`, `first_name`, `email_address`, `created_at`) order by that subscriber attribute. `engagement__ ` orders by an engagement stat over the trailing 90 days: counts (`sent`, `opens`, `clicks`) and rates (`open_rate`, `click_rate`); subscribers with no sends order as 0. `location__distance` orders by great-circle distance and requires a `location` filter in the same request : its `latitude`/`longitude` supply the origin, and subscribers without a primary location are excluded. Distance defaults to nearest-first (`sort_order` defaults to `asc` for this field); pass `sort_order=desc` for farthest-first. | created_at |
| sort_order | No | Sort direction (default: desc). | |
| payload_file | No | Local JSON request body file, at most 5 MB. Contents are validated before the API call and are never logged. | |
| counting_mode | No | Controls how engagement-filter count thresholds are tallied. `raw` (default) counts every event : five opens of the same email = five. `unique_email` counts distinct emails on which the action occurred : five opens of the same email = one. Applies to every engagement filter (opens, clicks, sent, delivered) in the request; ignored for other filter types. |