CXone Reporting API v2: Querying agent state history for last 24 hours

What’s the right way to pull agent state history for the last 24 hours using the CXone Reporting API v2? We’re trying to build a real-time dashboard in our custom agent desktop that shows how long agents have been in specific states like Available or On Break. The goal is to query this data every minute and update the UI accordingly. We’ve tried using the /api/v2/analytics/agents/details endpoint with a groupBy parameter set to agent.id and state.type, but the response doesn’t seem to include historical state changes. Instead, it only gives us aggregated metrics like total talk time or handle time. We also tried the /api/v2/analytics/conversations/details endpoint, but that’s more focused on conversation data rather than agent states. Is there a specific endpoint or query parameter we’re missing? The current approach feels clunky, and we’re not sure if we’re overcomplicating this. Any insights would be appreciated.