Forum Stats

  • 3,677,937 Users
  • 7,897 Discussions
  • 13,001 Comments

Discussions

How to update/refresh a segment contact count using API?

So we've been trying to automate the process of fetching contacts count in segments via API.

We're able to fetch the count of a segment without any problem using GET.

But the count never gets refreshed unless someone manually goes in the segment and either clicks on the Refresh icon, or Saves the segment to recalculate the count.

I've looked everywhere in the REST API but there's no endpoints allowing us to recalculate the Count of contacts in a segment. I've tried to update on the segment endpoint (using PUT), but all it does is just add the criteria/filters to a segment without recalculating it.

Has anyone done something not out of the box to recalculate/refresh the count in some way in segments via API?

Thanks so much!

Best Answer

Answers

  • jeremy.n
    jeremy.n Posts: 8 Red Ribbon

    Hi Tom, thanks you're the best!

    I've just tried it (with POST) and it worked! The count was refreshed automatically once I did my GET right after.

    I will keep this in mind, for sure as it's no longer supported there will be risks of data discrepancies but this is better than having to manually refresh it all the time.

    Cheers and stay safe!