Contact Lists Pagination

Hello,

I’m trying to pull in all lists for a client using this endpoint but I believe pagination isn’t working as intended.

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

From what I can tell our client has over 2500 unqiue lists.

When I make the above request with the following params

{“count”: 1, “vidOffset”: 10} # I’ve also tried “offset” param which doesn’t work either

I find that I get the same list constantly as if the offset param doesn’t work.

Also in the response it gives the offset and it is never the same as what I set it to.
In general I believe there is a flaw in the pagination logic.

I can still get all the lists but it takes over 60 seconds and 90 different calls to get them all

Hey, @JoelHendy :waving_hand: Thanks for reaching out. For questions like this, adding a simple example of how your request is set up helps the community understand what might be the root issue.

Here’s my quick test:

  • I have a portal with 52 Lists

  • Using this endpoint — Get all contact lists, I set my count to be 5 so that I will get back 5/52 lists per call

  • Request

    GET https://api.hubapi.com/contacts/v1/lists?count=5

  • Response

    {
     "offset": 18,
     "total": null,
     "lists": [
     {
     "portalId": 22245342,
     "listId": 1,
     "createdAt": 1660754855714,
     "updatedAt": 1660754866875,
     "name": "Testerr-1",
    ...
     }
    ...
     {
     "portalId": 22245342,
     "listId": 5,
     "createdAt": 1667511749448,
     "updatedAt": 1667511757333,
     "name": "BobsBugersData-csv.csv",
     "listType": "STATIC",
     ...
     }
     ],
     "has-more": true
    }​
    
  • I grabbed the offset value returned — “18” in this case, and add it as a query parameter for my next request (which returned list IDs 6-10 for my portal). (PS it’s not documented what determines the value for the offset, in case you are looking for a logic there)
    GET https://api.hubapi.com/contacts/v1/lists?count=5&offset=18​

  • From here, we could use the offset value of “30” to return lists 11-15 for my portal, etc. for

Have fun building! — Jaycee

Hey @Jaycee_Lewis thank you for your response.

I was assuming the offset param worked like most other APIs for pagination.

I’ve got it working correctly now thank you