Skip to main content

LeadFilterDTO

Lead filter request body. Pagination plus optional filters. The channel / UTM filters (sources, channels, utmSource, utmMedium, utmContent, utmCampaign, utmTerm) are matched against a single attribution per lead, selected by attributionOrder.

pageint32

Page number, 1-based. Min 1.

Possible values: >= 1

Default value: 1
Example: 1
sizeint32

Page size. Min 1, max 50.

Possible values: >= 1 and <= 50

Default value: 10
Example: 10
pipeStatusIdsint64[]

Filter by pipeline status IDs (optional).

Example: [979]
searchstring

Free-text search across lead name and contact name.

Default value:
Example: Odil
phonestring

Filter by contact phone. The server matches on the last 9 digits (phone.takeLast(9)) against each contact phone's 9-digit suffix, so send digits only (no spaces or symbols). Optional.

Example: 901234567
startint64

Lower bound for createdTimestamp (epoch seconds, optional)

Example: 1730419200
finishint64

Upper bound for createdTimestamp (epoch seconds, optional)

Example: 1733011200
createdByIdsint32[]

Filter by creator employee IDs (optional).

Example: [95]
responsibleByIdsint32[]

Filter by responsible employee IDs (optional).

Example: [101]
tagIdsint64[]

Filter by tag IDs (optional).

Example: [3,7]
customFields object[]

Filter by CRM custom field values (optional). Every item is applied as a separate condition and all of them must match (AND between items); within a single item values are matched as OR. See CustomFieldFilter.

  • Array [
  • 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
  • ]
  • attributionOrderAttributionOrder

    Selects which of a lead's attributions the channel / UTM filters are matched against.

    • FIRST — the lead's first (earliest) attribution
    • LAST — the lead's most recent attribution

    Possible values: [FIRST, LAST]

    Default value: FIRST
    Example: LAST
    sourcesLeadChannelSource[]

    Filter by channel source of the selected attribution (optional).

    Possible values: [INSTAGRAM, FACEBOOK, FACEBOOK_FORM, TELEGRAM, TELEGRAM_BUSINESS, TELEGRAM_BOT, WHATSAPP, WABA, VK, VIBER, AVITO, WEBSITE, AMO_CRM, ONLINE_PBX, UTEL, SIPUNI, ASTERISK, MOI_ZVONKI, WEB_FORM, EMPLOYEE, UNKNOWN]

    channelsint64[]

    Filter by channel IDs of the selected attribution (optional).

    Example: [12]
    utmSourcestring

    Filter by UTM source of the selected attribution (optional)

    Example: instagram
    utmMediumstring

    Filter by UTM medium of the selected attribution (optional)

    Example: cpc
    utmContentstring

    Filter by UTM content of the selected attribution (optional)

    Example: banner_a
    utmCampaignstring

    Filter by UTM campaign of the selected attribution (optional)

    Example: spring_sale
    utmTermstring

    Filter by UTM term of the selected attribution (optional)

    Example: apartment
    LeadFilterDTO
    {
    "page": 1,
    "size": 10,
    "pipeStatusIds": [
    979
    ],
    "search": "Odil",
    "phone": "901234567",
    "start": 1730419200,
    "finish": 1733011200,
    "createdByIds": [
    95
    ],
    "responsibleByIds": [
    101
    ],
    "tagIds": [
    3,
    7
    ],
    "customFields": [
    {
    "customFieldId": 42,
    "type": "SELECT",
    "values": [
    "VIP"
    ],
    "numberStart": 1000,
    "numberFinish": 5000,
    "currencyId": 24,
    "hasValue": true
    }
    ],
    "attributionOrder": "LAST",
    "sources": [
    "INSTAGRAM"
    ],
    "channels": [
    12
    ],
    "utmSource": "instagram",
    "utmMedium": "cpc",
    "utmContent": "banner_a",
    "utmCampaign": "spring_sale",
    "utmTerm": "apartment"
    }