Errors using Update List Filters API

Hi,

I’m trying to update filters in an exsiting dynamic list, on a monthly basis, using the API.

According to teh documentation, the following applies:
PUT & End point: https://api.hubapi.com/crm/v3/lists/{list_id}/update-list-filters

For the life of me, I can’t get this API to work.

I simply want to update the filters to include all Contacts that have a ‘createdate’ that is, for exmaple, between March 1, 2024 and March 31, 2024 (inclusive).
Anybody have pointers or an example of the request body code I’d need here?

Hi @Lorenzoenns :waving_hand:

If you haven’t already, I think you’ll want to review HubSpot’s “List filters [BETA]” API documentation, specifically the “Is between or is not between dates” section. Using this example, I was able to successfully update the filters of a Dynamic Contact List like so:

PUT https://api.hubapi.com/crm/v3/lists/:LIST\_ID/update-list-filters

Request body:

// see this documention for filter definition schema: https://developers.hubspot.com/docs/api/crm/lists-filters
{
 "name": "Sample Date Between",
 "objectTypeId": "0-1", // "0-1" is Contact
 "processingType": "DYNAMIC",
 "filterBranch": {
 "filters": [],
 "filterBranchOperator": "OR",
 "filterBranchType": "OR",
 "filterBranches": [
 {
 "filterBranches": [],
 "filters": [
 {
 "property": "createdate",
 "operation": {
 "operator": "IS_BETWEEN",
 "includeObjectsWithNoValueSet": false,
 "lowerBoundEndpointBehavior": "INCLUSIVE",
 "upperBoundEndpointBehavior": "INCLUSIVE",
 "propertyParser": "VALUE",
 "lowerBoundTimePoint": {
 "timeType": "DATE",
 "timezoneSource": "CUSTOM",
 "zoneId": "Australia/Brisbane", // can be "UTC" or portal timezone (e.g. "Australia/Brisbane"
 "year": 2024,
 "month": 4,
 "day": 1,
 "hour": 0,
 "minute": 0,
 "second": 0,
 "millisecond": 0
 },
 "upperBoundTimePoint": {
 "timeType": "DATE",
 "timezoneSource": "CUSTOM",
 "zoneId": "Australia/Brisbane", // can be "UTC" or portal timezone (e.g. "Australia/Brisbane"
 "year": 2024,
 "month": 4,
 "day": 21,
 "hour": 23,
 "minute": 59,
 "second": 59,
 "millisecond": 999
 },
 "type": "TIME_RANGED",
 "operationType": "TIME_RANGED"
 },
 "filterType": "PROPERTY"
 }
 ],
 "filterBranchType": "AND",
 "filterBranchOperator": "AND"
 }
 ]
 }
}

I hope that proves helpful. Please let me know if you have any follow-up questions.