If you’re trying to see contacts waiting in your Amazon Connect queues in real-time, relying on the SearchContacts API may not give you the complete picture. This API mainly provides information about contacts after they have finished, so you won’t see active calls or contacts still waiting in the queue until they disconnect.
Instead, a better way to monitor contacts as they happen is to use Amazon Connect contact events through Amazon EventBridge. This method provides immediate updates for contact activities, giving you a live view of what’s happening in your contact center.
When a contact arrives and enters a queue, an event called QUEUED is sent automatically. This event includes the contact’s ID, queue details, and exactly when they joined the queue. These events happen instantly whenever the contact’s status changes, no matter if an agent is available or not.
You’ll want to listen for a few key events:
– QUEUED — Fires when a contact joins a queue, providing important info like ContactId and timestamps.
– CONNECTED_TO_AGENT — Fires when an agent answers the call (not relevant if your queue isn’t staffed).
– DISCONNECTED — Fires when the contact leaves the system, ending their session.
By setting up rules in EventBridge to catch these QUEUED events, you can do many useful things:
– Track each contact as they wait in the queue.
– Measure how long they stay waiting.
– Automatically start cleanup or escalation processes.
– Keep an up-to-the-minute list of contacts stuck in the queue.
Here’s how to set it up: Make an EventBridge rule that filters for QUEUED events on your particular queues. Send these events to a Lambda function or an SQS queue, which then updates a tracking database like DynamoDB. When the contact ends (DISCONNECTED event), delete their information from the table. This way, you always have a real-time list of contacts who are waiting, no matter how busy your agents are.
The SearchContacts API and other agent-focused tools are useful for looking at past interactions or agent activity, but they don’t work well for tracking contacts still waiting in the queue at this moment. For live monitoring of active contacts, using EventBridge contact events is the most reliable and efficient way.
For more details, you can check the official Amazon Connect documentation on contact events.
