HubSpot Ideas

KristofKipp

Extend Contact-List API

A small request for the API-Team: I'd love to have some more control over Contact-Lists via API Calls. Currently I can only create new Lists that reside in the root folder of all Contact-Lists ( `objectLists/folders?folderId=0`).

 

What I specifically would enjoy are a few endpoints in the Contact Lists API:

# List ContactList Folders (GET /contacts/v1/folders)

- no required parameters

- optional parameters: "{recursive: true|false}" and "{root_id: $folder_id}"

 

=> returns a json array of all contact list folders matching the input params

 

# Create Contact List Folder (POST /contacts/v1/folders)

- required parameters: "{name: $name}"

- optional parameters: "{parent_id: $parent_id}"

 

=> returns some status message concernign the creation state (similar to 'create a contact list'

 

If you've got any questions left, feel free to contact me 🙂

 

Cheers

Kristof Kipp

4 Replies
KFerreira0
Member

Likewise, the ability to set the parent folder ID when creating or updating the Contact List feels like a pretty fundamental piece of functionality.

For the docs here:

https://legacydocs.hubspot.com/docs/methods/lists/create_list

 

If we could simply allow the below, it would make a significant different in keeping HubSpot tidy (note the parentFolderId):

{
    "name": "tweeters",
    "dynamic": true,
    "portalId": 62515,
    "parentFolderId": 1234,
    "filters": 
    [
        [{
            "operator": "EQ",
            "value": "@hubspot",
            "property": "twitterhandle",
            "type": "string"
        }]
    ]
}

 

FredrikWendt
Contributor

Our use case is that we create lots of lists automatically, and while they are used and provide value, they also clutter up the views and manual work done by humans.

TCable
Member

I was able to find a way to create a contact list directly into a pre-created folder in HubSpot. 

Here is what I used, where parentId is the folder id in HubSpot.  You will need to put a contact list into the folder and then get the information on that contact list to see the folder id.


POST to https://api.hubapi.com/contacts/v1/lists

{"name":"Tony Test Contact List 4","parentId"60940867"limitExempt":true}
FredrikWendt
Contributor

Thanks @TCable for sharing this undocument but working solution.