We have a static list that is populated via an API call. Prior to populating it is necessary for us to delete the Contacts within the list previously. After looking through the API docs, it seems the only way is to Get contacts in that list (https://api.hubapi.com/contacts/v1/lists/XXX/contacts/all?hapikey=XXX) and then Remove contacts from the list (https://api.hubapi.com/contacts/v1/lists/XXX/remove?hapikey=XXX).
After noticing some issues I began debugging the code and I realized that even if I just forced the code to delete the contacts in the list it would only delete some. I then placed the Get contacts in that list (/api.hubapi.com/contacts/v1/lists/XXX/contacts/all?hapikey=XXX) in the browser and it only shows about half of the people within the list. This would explain why my list would never empty.
Can someone explain why this is happening and how do I achieve my goal?