Skip to main content

CustomFieldFilter

A single condition on one CRM custom field, used inside LeadFilterDTO.customFields. customFieldId identifies the field (see GET /v1/open-api/lead/field for the company's fields); type tells the server how to interpret the condition.

Which keys apply depends on the mode:

  • hasValue is checked first and overrides everything else. true → only leads that have any value for this field; false → only leads that have no value for it. When hasValue is sent, values, numberStart, numberFinish and currencyId are ignored.
  • type: NUMBER (and hasValue omitted) → matches the numeric range numberStart … numberFinish (inclusive), optionally narrowed to currencyId.
  • type: ADDRESS (and hasValue omitted) → each entry in values is matched against the lead's address written as comma-separated Uzbek names, from the most specific to the least: "district,city,country", "city,country" or "country". Only address values stored with valueType: DISTRICT are matched.
  • any other type → plain equality: the lead matches when the field value equals one of values. For multi-select fields it is enough that one of the selected values matches.
customFieldIdint64required

CRM custom field ID to filter on. Required.

Example: 42
typeFieldType

Field type, decides how the condition is interpreted. Defaults to TEXT.

Possible values: [TEXT, DATE, SELECT, MULTI_SELECT, URL, TOGGLE_SWITCH, RADIO, LOCATION, COUNTER, ADDRESS, EXTENDED_TEXT, EMPLOYEE, FILE, NUMBER]

Default value: TEXT
Example: SELECT
valuesstring[]

Values to match (OR between them). Used for every type except NUMBER, and ignored when hasValue is sent. For ADDRESS send comma-separated Uzbek place names (see the description above).

Example: ["VIP"]
numberStartnumber

Lower bound for NUMBER fields (inclusive). Defaults to 0 when omitted.

Example: 1000
numberFinishnumber

Upper bound for NUMBER fields (inclusive). Unbounded when omitted.

Example: 5000
currencyIdint64

Restrict a NUMBER condition to one currency (optional). When omitted, any currency matches.

Example: 24
hasValueboolean

Presence check. true → the lead has any value for this field, false → it has none. Overrides values / numberStart / numberFinish / currencyId.

Example: true
CustomFieldFilter
{
"customFieldId": 42,
"type": "SELECT",
"values": [
"VIP"
],
"numberStart": 1000,
"numberFinish": 5000,
"currencyId": 24,
"hasValue": true
}