I wanted to retrieve the info from the endpoint: POST/api/v2/analytics/conversations/aggregates/query
Which tag should I select to group by - userID and selectedagentID? or something else?
Could you please explain the difference between userID and selectedagentID
UserId is who actually participated in the conversation.
selectedAgentId and requestedAgentId are for direct-agent routing and only populate if you're using direct-agent routing which would be indicated in the RequestedRoutings dimension.
If you refer to https://developer.genesys.cloud/api/rest/v2/analytics/conversation_detail_model and expand the dimensions you can see that User is the only one you named that is an actual Participant dimension, the others are in session and segment because they're routing related. It's still not as clear as it should be, because it expects you to understand their separation logic.