Amazon Connect contact events - Amazon Connect

Amazon Connect contact events

Amazon Connect allows you to subscribe to a near real-time stream of contact (voice calls, chat, and task) events (for example, call is queued) in your Amazon Connect contact center.

You can use contact events to create analytics dashboards to monitor and track contact activity, integrate into workforce management (WFM) solutions to better understand contact center performance, or to integrate applications that react to events (for example, call disconnected) in real-time.

Subscribe to Amazon Connect contact events

Amazon Connect contact events are published using Amazon EventBridge, and can be enabled in a couple of steps for your Amazon Connect instance in the Amazon EventBridge console by creating a new rule. Although events are not ordered, they have a timestamp which enables you to consume the data.

Events are emitted on a best effort basis.

To subscribe to Amazon Connect contact events:

  1. In the Amazon EventBridge console, choose Create rule.

  2. On the Default rule detail page, assign a name to the rule, choose Rule with an event pattern, and then choose Next.

  3. On the Build event pattern page, under Event source, verify that AWS events or EventBridge partner events is selected.

  4. Under Sample event type, choose AWS events, and then choose Amazon Connect Contact Event from the dropdown box.

  5. For Creation method choose Use pattern form. In the Event pattern section, choose AWS services, Amazon Connect, Amazon Connect Contact Event, and then choose Next.

  6. On the Select target(s) page, you can then select a target of your choice, which includes a Lambda function, SQS queue, or SNS topic. For information about configuring targets, Amazon EventBridge targets.

  7. Optionally configure tags. On the Review and create page, choose Create rule.

For more information about configuring rules, see Amazon EventBridge rules in the Amazon EventBridge User Guide.

Contact events data model

Contact events are generated in JSON. For each event type, a JSON blob is sent to the target of your choice, as configured in the rule. The following contact events are available:

  • INITIATED - A voice call, chat, or task is initiated or transferred.

  • CONNECTED_TO_SYSTEM - The contact has established media (for example, was answered by a human or a machine). This event uses the following status codes to identify the actual disposition if the contact was connected to Amazon Connect:

    • HUMAN_ANSWERED: The dial request was answered by a person.

    • SIT_TONE-DETECTED: A special information tone (SIT) was detected.

    • FAX_MACHINE_DETECTED: A fax machine was detected.

    • VOICEMAIL_BEEP: The dial request was answered by voicemail with a beep.

    • VOICEMAIL_NO_BEEP: The dial request was answered by a voicemail with no beep.

    • AMD_UNANSWERED: The dial attempt was connected, but the call was not picked up.

    • AMD_UNRESOLVED: The dial attempt was connected, but AMD detection not able to determine whether it was a human voice or voicemail.

    • AMD_ERROR: The dial attempt was connected, but there was error in AMD.

    Note

    This event is generated for outbound calls (Amazon Connect Campaign with answering machine detection enabled), Tasks, and Chats.

  • QUEUED - A voice call, chat, or task is queued to be assigned to an agent.

  • CONNECTED_TO_AGENT - A voice call, chat, or task is connected to an agent.

  • DISCONNECTED - A voice call, chat, or task is disconnected. For outbound calls, the dial attempt is not successful, the attempt is connected but the call is not picked up, or the attempt results in a SIT tone.

    A disconnect event is when:

    • A call, chat, or task is disconnected.

    • A call is disconnected by a customer, agent, third party, supervisor, flow, telecom problem, API, or any other reason.

    • A task is disconnected as a result of a flow action.

    • A task expires. The task is automatically disconnected if it is not completed in 7 days.

Contact event

The Contact object includes the following properties:

EventType

The type of event published.

Type: String

Valid values: INITIATED, CONNECTED_TO_SYSTEM, QUEUED, CONNECTED_TO_AGENT, DISCONNECTED

ContactId

The identifier for the contact.

Type: String

Length: 1-256

InitialContactId

The identifier of the initial contact.

Type: String

Length: 1-256

PreviousContactId

The original identifier of the contact that was transferred.

Type: String

Length: 1-256

InstanceArn

Amazon Resource Name (ARN) for the Amazon Connect instance in which the agent's user account is created.

Type: ARN

Channel

The type of channel.

Type: VOICE, CHAT, or TASK

QueueInfo

The queue the contact was placed in.

Type: QueueInfo object

AgentInfo

The agent the contact was assigned to.

Type: AgentInfo object

InitiationMethod

Indicates how the contact was initiated.

Valid values:

  • INBOUND: The customer initiated voice (phone) contact with your contact center.

  • OUTBOUND: Represents an agent-initiated outbound voice call from the Contact Control Panel (CCP). This initiation method calls the StartOutboundVoiceContact API.

  • TRANSFER: The contact was transferred by an agent to another agent or to a queue, using quick connects in the CCP. This results in a new contact record being created.

  • CALLBACK: The customer was contacted as part of a callback flow. For more information about the InitiationMethod in this scenario, see About queued callbacks in metrics.

  • API: The contact was initiated with Amazon Connect by API. This could be an outbound contact you created and queued to an agent, using the StartOutboundVoiceContact API, or it could be a live chat that was initiated by the customer with your contact center, where you called the StartChatContact API, or it could be a tasks initiated by the customer by calling the StartTaskContact API.

  • QUEUE_TRANSFER: While the contact is one queue, and was then transferred into another queue using a flow block.

  • MONITOR: A supervisor initiated monitor on an agent. The supervisor can silently monitor the agent and customer, or barge the conversation.

  • DISCONNECT: When a Set disconnect flow block is triggered, it specifies which flow to run after a disconnect event.

    A disconnect event is when:

    • A call, chat, or task is disconnected.

    • A call is disconnected by a customer, agent, third party, supervisor, flow, telecom problem, API, or any other reason.

    • A task is disconnected as a result of a flow action.

    • A task expires. The task is automatically disconnected if it is not completed in 7 days.

    When the disconnect event occurs, the corresponding content flow runs. If a new contact is created while running a disconnect flow, then the initiation method for that new contact is DISCONNECT.

RelatedContactId

The contactId that is related to this contact.

Type: String

Length: Minimum of 1. Maximum of 256.

QueueInfo

The QueueInfo object includes the following properties:

QueueArn

The Amazon Resource Name (ARN) for the queue.

Type: String

QueueType

The type of queue.

Type: String

AgentInfo

The AgentInfo object includes the following properties:

AgentArn

The Amazon Resource Name (ARN) for the agent account.

Type: ARN

CustomerVoiceActivity

The CustomerVoiceActivity object includes the following properties:

GreetingStartTimestamp

The date and time that measures the beginning of the customer greeting from an outbound voice call, in UTC time.

Type: String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

GreetingEndTimestamp

The date and time that measures the end of the customer greeting from an outbound voice call, in UTC time.

Type: String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

Contact timestamps

InitiationTimestamp

The date and time this contact was initiated, in UTC time.

Type: String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

ConnectedToSystemTimestamp

The date and time the customer endpoint connected to Amazon Connect, in UTC time.

EnqueueTimestamp

The date and time the contact was added to the queue, in UTC time.

Type: String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

ConnectedToAgentTimestamp

The date and time the contact was connected to the agent, in UTC time.

Type: String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

DisconnectTimestamp

The date and time that the customer endpoint disconnected from Amazon Connect, in UTC time

Type: String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

ScheduledTimestamp

The date and time when this contact was scheduled to trigger the flow to run, in UTC time. This is supported only for the task channel.

Type: String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

GreetingStartTimestamp

The date and time that measures the beginning of the customer greeting from an outbound voice call, in UTC time.

Type: String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

GreetingEndTimestamp

The date and time that measures the end of the customer greeting from an outbound voice call, in UTC time.

Type: String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

Sample contact event for when a voice call is connected to an agent

{ "initiationTimestamp":"2021-08-04T17:17:53.000Z", "contactId":"11111111-1111-1111-1111-111111111111", "channel":"VOICE", "instanceArn":"arn:aws::connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012", "initiationMethod":"INBOUND", "eventType":"CONNECTED_TO_AGENT", "agentInfo":{ "agentArn":"arn:aws::connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012/agent/12345678-1234-1234-1234-123456789012", "connectedToAgentTimestamp":"2021-08-04T17:29:09.000Z" }, "queueInfo": { "queueType":"type", "queueArn":"arn:aws::connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012/queue/12345678-1234-1234-1234-123456789012", "enqueueTimestamp":"2021-08-04T17:29:04.000Z" } }

Sample contact event for when a voice call is disconnected

{ "version": "0", "id": "abcabcab-abca-abca-abca-abcabcabcabc", "detail-type": "Amazon Connect Contact Event", "source": "aws.connect", "account": "111122223333", "time": "2021-08-04T17:43:48Z", "region": "us-west-1", "resources": [ "arn:aws:...", "contactArn", "instanceArn" ], "detail": { "eventType": "DISCONNECTED", "contactId": "11111111-1111-1111-1111-111111111111", "initialContactId": "11111111-2222-3333-4444-555555555555", "previousContactId": "11111111-2222-3333-4444-555555555555", "channel": "Voice", "instanceArn": "arn:aws::connect:us-west-2:123456789012:instance/12345678-1234-1234-1234-123456789012", "initiationMethod": "OUTBOUND", "initiationTimestamp":"2021-08-04T17:17:53.000Z", "connectedToSystemTimestamp":"2021-08-04T17:17:55.000Z", "disconnectTimestamp":"2021-08-04T17:18:37.000Z", "queueInfo": { "queueArn": "arn", "queueType": "type", "enqueueTimestamp": "2021-08-04T17:29:04.000Z" }, "AgentInfo": { "AgentArn": "arn", "connectedToAgentTimestamp":"2021-08-04T17:29:09.000Z" }, "CustomerVoiceActivity": { "greetingStartTimestamp":"2021-08-04T17:29:20.000Z", "greetingEndTimestamp":"2021-08-04T17:29:22.000Z", } } }