Skip to main content
Use this endpoint to programmatically define a new segment of accounts or contacts based on any combination of firmographic, behavioral, or demographic criteria. Once created, you can reference the returned id anywhere the API accepts a filter_set_id.

Endpoint

Required Scope

Your API key must have the filter_sets:write scope (or the broader all:write scope) to call this endpoint.

Request Body

string
required
A human-readable label for the filter set (e.g. "Series B SaaS companies"). This name appears in the Knock2 dashboard and in list responses.
string
required
Specifies whether the filter set targets "account" or "contact" records. This value cannot be changed after creation.
array
required
An array of filter rule objects that define the segment criteria. All rules in the array are applied as AND conditions — a record must satisfy every rule to match.

Example Request

Response

Returns 201 Created with a FilterSetDetailResponse object containing the newly created filter set.

Response Fields

string
The unique identifier of the newly created filter set. Use this as filter_set_id in subsequent API requests.
string
The human-readable label you provided in the request body.
string
The record type this filter set targets — either "account" or "contact".

Error Responses