Error notifications: When Contact Lens can't analyze a contact - Amazon Connect

Error notifications: When Contact Lens can't analyze a contact

It's possible that Contact Lens can't analyze a contact file, even though analysis is enabled on the contact flow. When this happens, Contact Lens sends error notifications using Amazon EventBridge events.

Events are emitted on a best effort basis.

Subscribe to EventBridge notifications

To subscribe to these notifications, create a custom EventBridge rule that matches the following:

  • "source" = "aws.connect"

  • "detail-type" = "Contact Lens Analysis State Change"

You can also add to the pattern to be notified when a specific event code occurs. For more information, see Event Patterns in the Amazon EventBridge User Guide.

The format of a notification looks like the following sample:

{ "version": "0", // set by CloudWatch Events "id": "55555555-1111-1111-1111-111111111111", // set by CloudWatch Events "source": "aws.connect", "detail-type": "Contact Lens Analysis State Change", "account": "111122223333", "time": "2020-04-27T18:43:48Z", "region": "us-east-1", // set by CloudWatch Events "resources": [ "arn:aws:connect:us-east-1:111122223333:instance/abcd1234-defg-5678-h9j0-7c822889931e", "arn:aws:connect:us-east-1:111122223333:instance/abcd1234-defg-5678-h9j0-7c822889931e/contact/efgh4567-pqrs-5678-t9c0-111111111111" ], "detail": { "instance": "arn:aws:connect:us-east-1:111122223333:instance/abcd1234-defg-5678-h9j0-7c822889931e", "contact": "arn:aws:connect:us-east-1:111122223333:instance/abcd1234-defg-5678-h9j0-7c822889931e/contact/efgh4567-pqrs-5678-t9c0-111111111111", "channel": "VOICE", "state": "FAILED", "reasonCode": "RECORDING_FILE_CANNOT_BE_READ" } }

Event codes

The following table lists the event codes that may result when Contact Lens can't analyze a contact.

Event reason code Description


Contact Lens received invalid values when the contact flow was initiated, such as an unsupported or invalid language code, or an unsupported value for redaction behavior.


Contact Lens can't get the recording file. This might be because file isn't present in the S3 bucket, or there are problems with permissions.


The recording audio file is too small for analysis (less than 105 ms).


The recording file exceeds the duration limit for analysis (more than 14,400 seconds, or 4 hours).


The audio file is invalid.


An error occurred when Contact Lens tried to read the audio file.


The audio file is empty.


The sample rate of the audio file is not supported. Contact Lens currently supports audio files with an 8kHz sample rate. That is the sample rate for Amazon Connect recordings.