View a markdown version of this page

Cases data in the Connect Customer analytics data lake - Amazon Connect Customer

Cases data in the Connect Customer analytics data lake

This topic details the content in the Connect Customer data lake cases tables. The tables list the column, type, and description of the content.

There are two ways to access the analytics data lake and configure data to be shared:

If you are unable to access the scheduling tables by using Option 1, try using Option 2.

Case events

Table name: case_events

Description: Records case lifecycle events (created, updated, deleted), including case metadata, status changes, template information, and custom field values for Connect Cases.

Primary key: instance_id, event_id

Partition key: event_timestamp (daily)

Join keys:

  • instance_id — Joins to all tables

  • case_id — Joins to case_related_item_events (as associated_case_id)

Column Type Nullable Description
instance_id string No The ID of the Connect Customer instance.
aws_account_id string Yes The ID of the AWS account that owns the case.
event_id string No The unique ID of the case event.
case_id string Yes The ID of the case.
event_timestamp Timestamp Yes The timestamp when the event occurred, in UTC.
changed_field_ids array(string) Yes The list of field IDs that were modified in this event.
event_type string Yes The type of event. Valid values: CASE.CREATED, CASE.UPDATED, CASE.DELETED.
performed_by_iam_principal string Yes The IAM principal ARN of the entity that triggered the event.
performed_by_user_arn string Yes The ARN of the user that performed the action.
performed_by_custom_entity string Yes The custom entity that performed the action.
cases_domain_arn string Yes The ARN of the Connect Customer Cases domain.
template_id string Yes The ID of the case template used to create the case.
template_name string Yes The name of the case template. This value is empty if the template has been deleted.
last_updated_user string Yes The last user who updated the case. This references the last_updated_user system field value.
reference_number string Yes The human-readable reference number for the case. This references the reference_number system field value.
status string Yes The status of the case. This references the status system field value.
assigned_user string Yes The ARN of the user assigned to the case. This references the assigned_user system field value.
assigned_queue string Yes The ARN of the queue assigned to the case. This references the assigned_queue system field value.
case_reason string Yes The reason for opening the case. This references the case_reason system field value.
case_title string Yes The title of the case. This references the title system field value.
case_summary string Yes The summary of the case. This references the summary system field value.
customer_profile_arn string Yes The ARN of the customer profile associated with the case. This references the customer_id system field value.
created_timestamp Timestamp Yes The timestamp when the case was created, in UTC. This references the created_datetime system field value.
last_updated_timestamp Timestamp Yes The timestamp when the case was last updated, in UTC. This references the last_updated_datetime system field value.
next_sla_breach_timestamp Timestamp Yes The timestamp of the next SLA breach deadline, in UTC. This references the next_sla_breach_datetime system field value.
last_closed_timestamp Timestamp Yes The timestamp when the case was last closed, in UTC. This references the last_closed_datetime system field value.
last_reopened_timestamp Timestamp Yes The timestamp when the case was last reopened, in UTC. This references the last_reopened_datetime system field value.
custom_fields array(struct) Yes An array of objects containing custom field data associated with the case. Each object includes the field id, field_name, and a type-specific value field (string_value, double_value, boolean_value, or timestamp_value).

Sample queries

The following example query in Athena creates a view that flattens custom fields from the case events table:

CREATE VIEW case_events_flattened AS SELECT ce.event_id, ce.case_id, ce.event_timestamp, ce.event_type, ce.instance_id, -- ... other system fields -- Flattened custom fields cf.id AS custom_field_id, cf.field_name AS custom_field_name, CASE WHEN cf.string_value IS NOT NULL THEN 'string' WHEN cf.double_value IS NOT NULL THEN 'double' WHEN cf.timestamp_value IS NOT NULL THEN 'timestamp' WHEN cf.boolean_value IS NOT NULL THEN 'boolean' ELSE 'unknown' END AS custom_field_type, cf.string_value AS custom_field_string_value, cf.double_value AS custom_field_double_value, -- Cast milliseconds to timestamp CAST(from_unixtime(cf.timestamp_value / 1000.0) AS TIMESTAMP) AS custom_field_timestamp_value, cf.boolean_value AS custom_field_boolean_value FROM "case_events resource link table name" ce CROSS JOIN UNNEST(ce.custom_fields) AS t(cf)

The following example creates a view that returns the latest state for each case:

CREATE OR REPLACE VIEW latest_case_state AS SELECT * FROM ( SELECT *, ROW_NUMBER() OVER ( PARTITION BY case_id, instance_id ORDER BY event_timestamp DESC ) AS rn FROM "case_events resource link table name" ) t WHERE rn = 1;

Table name: case_related_item_events

Description: Records events for items related to cases, including comments, contacts, file attachments, SLA tracking, and custom related items.

Primary key: instance_id, event_id

Partition key: event_timestamp (daily)

Join keys:

  • instance_id — Joins to all tables

  • associated_case_id — Joins to case_events (as case_id)

  • contact_id — Joins to Contact Record

Column Type Nullable Description
instance_id string No The ID of the Connect Customer instance.
aws_account_id string Yes The ID of the AWS account that owns the related item.
event_id string No The unique ID of the related item event.
related_item_id string Yes The ID of the related item.
event_timestamp Timestamp Yes The timestamp when the event occurred, in UTC.
event_type string Yes The type of event. Valid values: CASE.RELATED_ITEM.CREATED, CASE.RELATED_ITEM.UPDATED, CASE.RELATED_ITEM.DELETED.
performed_by_iam_principal string Yes The IAM principal ARN of the entity that triggered the event.
performed_by_user_arn string Yes The ARN of the user who performed the action.
performed_by_custom_entity string Yes The custom entity identifier that performed the action.
cases_domain_arn string Yes The ARN of the Connect Customer Cases domain.
associated_case_id string Yes The ID of the case that this related item is associated with.
related_item_type string Yes The type of related item. Valid values: comment, file, sla, connect, contact, custom.
created_timestamp Timestamp Yes The timestamp when the related item was created, in UTC.
comment_body string Yes The body text of the comment.
comment_content_type string Yes The content type of the comment body. For example, Text/Plain.
related_case_id string Yes The ID of the related case.
contact_channel string Yes The communication channel of the contact. For example, VOICE, CHAT, TASK, EMAIL.
contact_id string Yes The ID of the contact.
file_arn string Yes The ARN of the file attachment.
sla_name string Yes The name of the SLA.
sla_status string Yes The current status of the SLA. For example, active, overdue, met, notmet.
sla_target_timestamp Timestamp Yes The timestamp of the target deadline for the SLA, in UTC.
sla_type string Yes The type of SLA metric being tracked. For example, CaseField.
sla_completion_timestamp Timestamp Yes The timestamp when the SLA was completed, in UTC.
sla_target_field_id string Yes The ID of the field that the SLA is targeting.
sla_target_field_values array(string) Yes The target field values for the sla_target_field_id in order for the SLA to be completed.
custom_related_item_fields array(struct) Yes An array of objects containing custom field data associated with the related item. Each object includes the field id, field_name, and a type-specific value field (string_value, double_value, boolean_value, or timestamp_value).