Create Filter with custom date property on list api


#1

How do I create a filter on a list using a custom date property using the between filter?

When I'm using the list creator in the hubspot UI, it sends this information:

property: "(propertyName)"
filterFamily: "PropertyValue"
highValue: "1538351999999"
longValue: 1530403200000
operator: "BETWEEN"
strValue: "1530403200000"
type: "date"
withinLastTimeMode: "PAST"

However, if I try to post that to the the api, I get a 400 error:

I also noticed that the operator: "BETWEEN" isn't documented on this page:


#2

Hi @bao,

I'm not able to reproduce this on my end. The following request body creates an active list, with a date range filter from 8/01 to 8/08:

{
    "name": "Test Date Range Via API List",
    "dynamic": true,
    "portalId": 1234567,
    "filters": 
    [
        [{
            "operator": "BETWEEN",
            "value": 1533081600000,
            "highValue" : 1533772799999,
            "property": "test_date_property",
            "type": "date"
        }]
    ]
}