ActiveCampaign Forum

Segmentid filter not working in API 3

I have successfully got scripts working to retrieve totals of contacts matching various criteria. These criteria include filtering by list, automations stage and tag.

However, when I try using segmentid I am unable to get the correct results. Debugging shows a null response for the id and using different ids always yields the total contacts in the database.

What am I missing?

Did you work this out in the end? I’ve just been through the same issue with the guys at AC & the answer is calls with the segmentid param need to be made twice, first time to get the segment details & a second to retrieve the contacts matching that segment.

They’ve updated the API docs to make this clear now.