APIs & Integrations

bkolb-anexinet
Member

View Contact List Folders in API

Hello,

 

Is there a way to view the folder structure of the contact lists via the API? For example, we have a folder named "events" and subfolders named "2019, 2018, 2017" etc. I would like to make an API call that shows me all folders, including events. I would also like to be able to see the parent child relationship between events and its subfolders if possible.

 

Thanks!

0 Upvotes
3 Replies 3
WendyGoh
HubSpot Employee
HubSpot Employee

View Contact List Folders in API

Hi @bkolb-anexinet,

 

Currently, there isn't an API to return the contact list folder structure. That said, we can use this endpoint here: Get a contact list by its unique ID and if the list is in a folder, it'll return the folder id that the list is in by looking at the parentFolderId property in the response body.

 

Hope this helps to clarify!

 

 

 

0 Upvotes
bkolb-anexinet
Member

View Contact List Folders in API

Hey @WendyGoh ,

 

Thanks for the reply and for your insight! I do see the parent folder ID field, but that only solves part of the problem. 

 

The end goal of what I'm doing to put together a list of all the contact lists that are in this a folder, including any contact lists that are in the subfolders.

 

So if I'm looking in folder "A" and it has two subfolders "B" and "C", I need to know about all contacts lists in all of those folders, as well contact lists in any subfolders that may be in "B" and "C".

 

Parent folder ID helps, I could say "give me all lists that have a parent folder ID of X" and get all the top level lists in that folder, but I still need to know which sub-folders are in this top folder so I can inlcude those folder IDs in my search as well. Are there any API calls that could help me determine what sub folders are in a folder? That's what I would need to solve the whole problem.

 

 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

View Contact List Folders in API

Hi @bkolb-anexinet,

 

Thank you for sharing your end goal with me. 

 

There's currently no public API that returns the list folder structure e.g. to determine which sub folders are in a folder. Moving forward, I can honestly see a use case for this request and if you haven't already, I'd recommend jumping over to the HubSpot Ideas Forum and posting this idea there so that it's visible to the HubSpot product team and other HubSpot customers and developers. Hopefully this will gather more interest.

 

If you post a link to that post here, I'll jump over and give it an upvote!

0 Upvotes