Hi Marty,
I'd suggest looking at two APIs depending on what you're trying to measure:
POST /api/v2/analytics/users/aggregates/query for average staffing. You can use the presence/routing-status durations returned for each interval to calculate the average number of agents signed in or On Queue.
POST /api/v2/analytics/users/details/query for point-in-time headcount. The user-level status data can be used to reconstruct how many agents were in a particular state at the start or end of an interval.
For larger historical datasets, the asynchronous User Details Jobs API may also be worth considering.
I'd align both datasets to the same 15- or 30-minute intervals used by the external WFM platform.
One important point: when calculating point-in-time headcount, make sure you account for statuses that started before the interval and continued into it. Otherwise, you could undercount agents who were already in that state.
So, in short: Aggregates for average staffing, Details for point-in-time headcount.
------------------------------
Akhil
------------------------------