I’m trying to build a dashboard that shows real-time queue stats for our support tier. I assumed I could just grab the conversation list and count the active ones, but the numbers don’t match the analytics endpoint. I’m using the Python SDK. Here’s what I’m doing:
# Method A: List conversations
conversations_api = gen_api.conversations_api
response = conversations_api.get_conversations_all(expand=[''])
active_count = len([c for c in response.entities if c..status == 'ACTIVE'])
# Method B: Analytics summary
analytics_api = gen_api.analytics_api
query = {
'interval': '5m',
'entity': {'id': 'queue', 'filter': {'id': 'our-queue-id'}},
'metrics': ['conversation.count']
}
summary = analytics_api.post_analytics_conversations_query(query)
Method A gives me 42 active conversations. Method B returns a count of 18 for the same 5-minute window. The difference is huge. I’ve checked the timezone settings; everything is set to Europe/Berlin. I’m wondering if the list endpoint is caching data or if the analytics engine has a delay. Or maybe I’m filtering the list wrong. The docs are vague on which one is the source of truth for live monitoring. What’s the actual use case for each?