Skip to main content
Knock2’s filtering system gives you precise control over which accounts and contacts are returned from list endpoints. Whether you need a quick one-off query scoped to a single industry or a complex multi-condition filter you reuse across your automation workflows, Knock2 supports both patterns through inline filters and saved filter sets.

Two Filtering Approaches

Inline filters are the simplest way to narrow a result set. You pass a filters query parameter containing a JSON array of filter objects directly in your request URL. Inline filters are ideal for ad-hoc queries or when the filter conditions are dynamic and change per request. Filter sets let you save a named filter configuration once — via POST /v1/filter-sets — and reuse it across multiple requests by referencing its filter_set_id. Filter sets are recommended for complex, multi-condition criteria that your team uses regularly, such as “all enterprise accounts in the software industry that visited the pricing page in the last 30 days.”
filters and filter_set_id are not mutually exclusive — you can pass both on the same request. When you do, the saved filter set’s conditions are used as the base and your inline filters are appended on top (both must match, as with any other combination of filters).

Inline Filter Example

Pass a filters query parameter as a URL-encoded JSON array. Each element in the array is a filter object with key, keyType, condition, and value fields.
The decoded filters value for the request above is:
Always URL-encode the JSON array when passing it as a query parameter. Most HTTP client libraries handle this automatically when you pass filter values as a structured parameter rather than building the URL string manually.
You can pass multiple filter objects in the array — Knock2 applies them as a logical AND, returning only records that satisfy every condition.

Filter Key Types

Each filter object must include a keyType that tells Knock2 how to interpret the value field and which condition operators are valid. The conditions below are exhaustive — passing anything else returns a 400 invalid_filters error naming the offending filter index.
Use string for text fields like business_email or crm_deal_name.Example — contacts whose title starts with “VP”:
string_searchable (e.g. title, company_name) and string_with_id (e.g. owner, which pairs a display name with an ID) accept the same condition set as string: is, is_not, contains, does_not_contain, starts_with, ends_with, exists, does_not_exist, and (on email fields) exclude_personal_emails.
Use string_arr for fields that hold a list of values, such as industry or technology_tags.Example — contacts with industry SaaS or Fintech:
Use boolean for fields like is_qualified. A value of true or false is required.Example — contacts that are qualified:
Use number for plain numeric fields (e.g. page_visits, crm_deal_value) and number_with_id for numeric fields tied to a model ID (e.g. lead_score, which references a scoring model).There is no between condition for number — use two filters (gte + lte) if you need a range.Example — accounts with a lead score of at least 80:
Use existence to filter on whether a field has any value at all. No value field is required.Example — contacts that have a LinkedIn URL on record:
Use date_range for timestamp fields like last_visit or created_at.For before/after, pass value as a single date string. For between, pass a two-element array [start, end] (contact filters) — the second element may be null for an open-ended range; account filters also accept an equivalent {start, end} object.Example — accounts whose last visit was after June 1, 2024:
Use employee_range (employees/company_employees) or revenue_range (annual_revenue/company_annual_revenue) to filter by standardized size buckets rather than raw numbers.Each bucket in the value array is a JSON-stringified [min, max] tuple (use null for an open-ended upper bound) — not a display-label string. Check the dashboard’s Settings → API → Filter Sets Reference tab for the exact bucket values currently configured.Example — accounts with 51–200 or 201–500 employees:

Using a Saved Filter Set

Create a reusable filter set by POSTing your filter array to /v1/filter-sets:
Once created, pass the returned id as the filter_set_id query parameter on any list endpoint:
Filter sets are available to all API keys in your account and can also be selected directly in the Knock2 dashboard’s Contacts and Accounts views.
For the full list of valid key values by filter type — including accepted enum strings for address_country and the exact bucket format for employee_range/revenue_range — open Settings → API → Filter Sets Reference in the Knock2 dashboard.