Overview
This guide covers the Amazon Connect solution pattern, which consists of the following components to receive speech audio and call signals, and return call transcripts:- Media gateways for receiving call audio from Amazon Kinesis Video Streams
- Start/Stop API for Lambda functions to provide call data and signals for when to start and stop transcribing call audio
ASAPP can also accept requests to start and stop transcription via API from other call-state aware services. AWS Lambda functions are the approach outlined in this guide.
- Required AWS IAM role to allow access to Kinesis Video Streams
- Webhook to POST real-time transcripts to a designated URL of your choosing, alongside two additional APIs to retrieve transcripts after-call

Integration Steps
There are five parts of the integration process:- Setup Authentication for Kineses Video Streams
- Enable Audio Streaming to Kinesis Video Streams
- Add Start Media and Stop Media To Flows
- Send Start and Stop Requests to ASAPP
- Receive Transcript Outputs
Requirements
Audio Stream Codec AWS Kinesis Video Streams provides MKV format, which is supported by ASAPP. No modification or additional transcoding is needed when forking audio to ASAPP.When supplying recorded audio to ASAPP for AutoTranscribe model training prior to implementation, send uncompressed .WAV media files with speaker-separated channels.
- Access relevant API documentation (e.g. OpenAPI reference schemas)
- Access API keys for authorization
- Manage user accounts and apps
Visit the Get Started for instructions on creating a developer account, managing teams and apps, and setup for using AI Service APIs.
Integrate with Amazon Connect
1. Setup Authentication for Kineses Video Streams
The audio streams for Amazon Connect are stored in the Amazon Kinesis Video Streams service in your AWS account where the Amazon Connect instance resides. The access to the Kinesis Video Streams service is controlled by IAM policies. ASAPP will use IAM Roles for Service accounts (IRSA) to receive a specific IAM role in the ASAPP account, for exampleasapp-prod-mg-amazonconnect-role
.
Setup your account’s IAM role (e.g., kinesis-connect-access-role-for-asapp
) to trust asapp-prod-mg-amazonconnect-role
to assume it and create a policy permitting list/read operations on appropriate Kinesis Video Streams associated with Amazon Connect instance.
2. Enable Audio Streaming to Kinesis Video Streams
ASAPP retrieves streaming audio by sending requests to Kineses Video Streams. Streaming media is not enabled by default and must be turned on manually. Enable live media streaming for applicable instances in your Amazon Connect console to ensure audio is available when ASAPP sends requests to Kinesis Video Streams.If you choose to use a non-default KMS key, ensure that the IAM role for Service Accounts (IRSA) created for ASAPP has access to this KMS key.Amazon provides documentation to guide enabling live media streaming to Kinesis Video Streams.
3. Add Start Media and Stop Media To Flows
Sending streaming media to Kinesis Video Streams is initiated and stopped by inserting preset blocks - called Start media streaming and Stop media streaming - into Amazon Connect flows. Place these blocks into your flows to programmatically set when media will be streamed and stopped - this determines what audio will be available for transcription Typically for ASAPP, audio streaming begins as close as possible to when the agent is assigned. Audio streaming typically stops ahead of parts of calls that should not be transcribed such as holds, transfers, and post-call surveys.When placing the Start media streaming block, ensure From the customer and To the customer menu boxes are checked so that both participants’ call media streams are available for transcription.
4. Send Start and Stop Requests to ASAPP
AWS Lambda functions can be inserted into Amazon Connect flows in order to send requests directly to ASAPP APIs to start and stop transcription.ASAPP can also accept requests to start and stop transcription via API from other call-state aware services. If you are using another service to interact with ASAPP APIs, you can use AWS Lambda functions to send important call metadata to your other services before they send requests to ASAPP.The approach outlined in this guide is to call ASAPP APIs directly using AWS Lambda functions.
- NOW: NOW will start transcribing from the most recent audio data in the Kinesis stream.
- FRAGMENT_NUMBER: FRAGMENT_NUMBER will require another parameter afterFragmentNumber to be populated and would be the fragment within the media stream to start (for example, the start fragment number to capture all transcripts in the stream prior to start-streaming being called).
The
/start-streaming
endpoint request requires several fields, but three specific attributes must come from Amazon:- Amazon Connect Contact Id (multiple possible sources)
JSONPath formats:
$.ContactId
,$.InitialContactId
,$.PreviousContactId
- Audio Stream ARN
JSONPath format:
$.MediaStreams.Customer.Audio.StreamARN
- [OPTIONAL] Start Fragment Number
JSONPath format:
$.MediaStreams.Customer.Audio.StartFragmentNumber
Requests to/start-streaming
also require agent and customer identifiers. These identifiers can be sourced from Amazon Connect but may also originate from other systems if your use case requires it.
AutoTranscribe is only meant to transcribe conversations between customers and agents - start and stop requests should be implemented to ensure non-conversation audio (e.g. hold music, IVR menus, surveys) is not being transcribed. Attempted transcription of non-conversation audio will negatively impact other services meant to consume conversation transcripts, such as ASAPP AutoSummary.
Adding Lambda Functions to Flows
First, create and deploy two new Lambda functions in the AWS Lambda console: one for sending a request to ASAPP’s/start-streaming
endpoint and another for sending a request to ASAPP’s /stop-streaming
endpoint.
Refer to the API Reference in ASAPP’s Developer Portal for detailed specifications for sending requests to each endpoint.
- For requests to
/start-streaming
endpoint, place the Lambda block following the Start media streaming flow block - For requests to
/stop-streaming
endpoint, place the Lambda block immediately before the Stop media streaming flow block.
5. Receive Transcript Outputs
AutoTranscribe outputs transcripts using three separate mechanisms, each corresponding to a different temporal use case:- Real-time: Webhook posts complete utterances to your target endpoint as they are transcribed during the live conversation
- After-call: GET endpoint responds to your requests for a designated call with the full set of utterances from that completed conversation
- Batch: File Exporter service responds to your request for a designated time interval with a link to a data feed file that includes all utterances from that interval’s conversations
Real-Time via Webhook
ASAPP sends transcript outputs in real-time via HTTPS POST requests to a target URL of your choosing. Authentication Once the target is selected, work with your ASAPP account team to implement one of the following supported authentication mechanisms:- Custom CAs: Custom CA certificates for regular TLS (1.2 or above).
- mTLS: Mutual TLS using custom certificates provided by the customer.
- Secrets: A secret token. The secret name is configurable as is whether it appears in the HTTP header or as a URL parameter.
- OAuth2 (client_credentials): Client credentials to fetch tokens from an authentication server.
/start-streaming
endpoint, AutoTranscribe begins to publish transcript
messages, each of which contains a full utterance for a single call participant.
The expected latency between when ASAPP receives audio for a completed utterance and provides a transcription of that same utterance is 200-600ms.
Perceived latency will also be influenced by any network delay sending audio to ASAPP and receiving transcription messages in return.
transcript
type messages is JSON encoded with these fields:
Field | Subfield | Description | Example Value |
---|---|---|---|
externalConversationId | Unique identifier with the Amazon Connect Contact Id for the call | 8c259fea-8764-4a92-adc4-73572e9cf016 | |
streamId | Unique identifier assigned by ASAPP to each call participant’s stream returned in response to /start-streaming and /stop-streaming | 5ce2b755-3f38-11ed-b755-7aed4b5c38d5 | |
sender | externalId | Customer or agent identifier as provided in request to /start-streaming | ef53245 |
sender | role | A participant role, either customer or agent | customer, agent |
autotranscribeResponse | message | Type of message | transcript |
autotranscribeResponse | start | The start ms of the utterance | 0 |
autotranscribeResponse | end | Elapsed ms since the start of the utterance | 1000 |
autotranscribeResponse | utterance | Transcribed utterance text | Are you there? |
transcript
message format:
Error Handling
Should your target server return an error in response to a POST request, ASAPP will record the error details for the failed message delivery and drop the message.After-Call via GET Request
AutoTranscribe makes a full transcript available at the following endpoint for a given completed call:GET /conversation/v1/conversation/messages
Once a conversation is complete, make a request to the endpoint using a conversation identifier and receive back every message in the conversation.
Message Limit
This endpoint will respond with up to 1,000 transcribed messages per conversation, approximately a two-hour continuous call. All messages are received in a single response without any pagination. To retrieve all messages for calls that exceed this limit, use either a real-time mechanism or File Exporter for transcript retrieval.Transcription settings (e.g. language, detailed tokens, redaction), for a given call are set with the Start/Stop API, when call transcription is initiated. All transcripts retrieved after the call will reflect the initially requested settings with the Start/Stop API.
Batch via File Exporter
AutoTranscribe makes full transcripts for batches of calls available using the File Exporter service’sutterances
data feed.
The File Exporter service is meant to be used as a batch mechanism for exporting data to your data warehouse, either on a scheduled basis (e.g. nightly, weekly) or for ad hoc analyses. Data that populates feeds for the File Exporter service updates once daily at 2:00AM UTC.
Visit Retrieving Data from ASAPP Messaging for a guide on how to interact with the File Exporter service.
Use Case Example
Real-Time Transcription This real-time transcription use case example consists of an English language call between an agent and customer with redaction enabled, ending with a hold. Note that redaction is enabled by default and does not need to be requested explicitly.-
When the customer and agent are connected, send ASAPP a request to start transcription for the call:
POST
/mg-autotranscribe/v1/start-streaming
RequestResponse STATUS 200: Router processed the request, details are in the response body -
The agent and customer begin their conversation and separate HTTPS POST
transcript
messages are sent for each participant from ASAPP’s webhook publisher to a target endpoint configured to receive the messages. HTTPS POST for Customer UtteranceHTTPS POST for Agent Utterance -
Later in the conversation, the agent puts the customer on hold. This triggers a request to the
/stop-streaming
endpoint to pause transcription and prevents hold music and promotional messages from being transcribed. POST/mg-autotranscribe/v1/stop-streaming
RequestResponse STATUS 200: Router processed the request, details are in the response body