Retrieve real-time Contact Lens conversational analytics (transcript, sentiment, categories) for a live voice contact
domain: docs.aws.amazon.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Enable Contact Lens real-time conversational analytics on the relevant contact flow (per the Amazon Connect admin guide's contact analysis segment stream setup) so voice contacts are analyzed as they happen.
During or immediately after the call, call the ListRealtimeContactAnalysisSegments API with POST /realtime-contact-analysis/analysis-segments, passing InstanceId and ContactId (MaxResults up to 100) to page through analysis segments.
Parse returned Segments entries for Transcript objects (ParticipantRole, Content, Sentiment, BeginOffsetMillis/EndOffsetMillis, IssuesDetected) and Categories objects (MatchedCategories/MatchedDetails with PointsOfInterest) as they accumulate during the call.
If the response includes a NextToken, call the API again to retrieve additional segments; when a PostContactSummary segment with a completed Status appears and NextToken is absent, the analysis session has finished.
For scale beyond simple polling, subscribe to the Kinesis Data Stream-based real-time contact analysis segment stream instead, which delivers STARTED/SEGMENTS/COMPLETED/FAILED events and avoids the polling API's rate limits.
Known gotchas
Voice contact analysis data is only retained for 24 hours — ListRealtimeContactAnalysisSegments must be called within that window or the data is gone.
This is the voice-specific API; chat contacts require the separate ListRealtimeContactAnalysisSegmentsV2 operation, and the two are not interchangeable.
The polling API has throttling limits (ThrottlingException, HTTP 429) and requires explicit IAM permission (AccessDeniedException otherwise); high-volume or low-latency use cases should use the Kinesis segment-stream integration instead of polling.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?