I’m building a custom dashboard component using the Embeddable Client App SDK that needs to show an agent’s state changes over the past 24 hours. The goal is to replicate the ‘Agent State History’ view but with a custom UI layer. I’m looking for an endpoint that provides this data, but I’m struggling to find the right one in the standard analytics paths.
The tricky part is constructing the query to filter by time and specific agent states correctly. I want to avoid pulling massive datasets and filtering client-side, so I’m trying to push as much logic as possible to the server. My current attempt looks like this:
GET /api/v2/quality/agents/activity?startTime=2023-10-26T10:00:00.000Z&endTime=2023-10-27T10:00:00.000Z&agentUserId={agentId}
The response comes back, but it feels sparse. I’m getting a list of activities, not the granular state transitions I need for a timeline view. I’ve tried adding expand parameters to see if that breaks it down further, but the result is still just a summary of activities, not the sequence of changes.
Is there a way to query the actual state change events rather than the aggregated analytics data? Or am I stuck using the activity endpoints and having to reconstruct the timeline by comparing intervals? The documentation is a bit vague on whether these endpoints support event-level granularity or if they’re strictly for aggregated reporting.
Also, the SDK doesn’t seem to have a specific method for this, so I’m making raw HTTP calls through the client’s API wrapper. If I’m on the wrong endpoint, what’s the alternative? I don’t want to poll the conversation history API since that doesn’t capture idle states or breaks effectively.