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. These events include:

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

  • 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.

    A disconnect event is when:

    • A call, chat, or task is disconnected by an agent.

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

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

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.

To subscribe to Amazon Connect contact events, go to Amazon EventBridge and create a new rule by selecting Amazon Connect as the service name, and Amazon Connect contact event as the event type. For more information about configuring rules, see Amazon EventBridge rules in the Amazon EventBridge User Guide.

The following image shows what this looks like in EventBridge:

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.

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.

  • 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.

    A disconnect event is when:

    • A call, chat, or task is disconnected by an agent.

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

    • If 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, QUEUED, CONNECTED_TO_AGENT, DISCONNECTED

ContactId

The identifier for the contact.

Type: String

Length: 1-256

InitialContactId

The original identifier of the contact that was transferred.

Type: String

Length: 1-256

PreviousContactId

The original identifier of the contact that was transferred.

Type: String

Length: 1-256

InstanceARN

Amazon Resource Name 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: An agent initiated voice (phone) contact with the customer, by using the CCP to call their number. 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 CTR 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 contact flow block.

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

    A disconnect event is when:

    • A call, chat, or task is disconnected by an agent.

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

    • If 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.

QueueInfo

The QueueInfo object includes the following properties:

ARN

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

RoutingProfileArn

The Amazon Resource Name (ARN) for the agent's routing profile.

Type: String

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

{ "version": "0", "id": "abcabcab-abca-abca-abca-abcabcabcabc", "detail-type": "Amazon Connect Contact Event", "source": "aws.connect", "account": "111122223333", "time": "2021-05-01T18:43:48Z", // this is the timestamp "region": "us-west-1", "resources": [ "arn:aws..." contactArn and instanceArn ], "detail": { "eventType": "CONNECTED_TO_AGENT", "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": "INBOUND", "queueInfo": { "queueArn": "arn", "queueType": "type" }, "AgentInfo": { "AgentArn" : "arn" "RoutingProfileArn": "", } }