This document explains the JSON schema used to structure metadata for customer support chat interactions. This schema helps ensure data consistency and facilitates effective management and analysis of chat data.
Chat session metadata schema
This schema describes the information we collect about each customer support chat session. The key components are described in the following sections.
Core information
These properties capture the core information of a chat session:
id
(integer). A unique identifier for each chat session. This is the primary key.lang
(string): the ISO 689 language code used in the chat. For example —en
for English,es
for Spanish.chat_type
(string). The type of chat, using a legacy set of types. Examples include "Messaging Inbound (App Chat)", "Messaging (SMS)", and "Messaging (WhatsApp)".session_type
(string): a duplicate ofchat_type
session_type_v2
(string). The type of chat, using the current set of types. This may include refinements like "Messaging Inbound (Mobile Chat)".status
(string). The current status of the chat. Possible values includequeued
,assigned
,finished
,no_response
,canceled
, andfailed
.sub_status
(string). Provides a more detailed status of the call. Possible values includewaiting_for_agent
,in_queue
, andconnected_with_agent
.created_at
(string, date-time): the timestamp when the chat session was createdassigned_at
(string, date-time, or null): the timestamp when the chat was assigned to an agent, or null if not assignedends_at
(string, date-time, or null): the timestamp when the chat session ended`
updated_at
(string, date-time): the timestamp when the chat data was last updatedfirst_msg_sent_at
(string, date-time): the timestamp when the first message was sent in the chatlast_msg_sent_at
(string, date-time): the timestamp when the last message was sent in the chatwait_duration
(integer): the total time the customer spent waiting, in secondschat_duration
(integer): the total duration of the chat, in secondsverified
(boolean): indicates if the interaction was verified through the verification smart actionrating
(integer or null): the customer satisfaction (CSAT) rating provided by the customer, or null if no rating was givenhas_feedback
(boolean): indicates whether the customer provided feedback after the chatout_ticket_id
(string): the identifier of the ticket created in the external CRM systemout_ticket_url
(string, uri): the URL of the CRM ticketis_out_ticket_account
(boolean): indicates whether the CRM ticket represents a customer (true) or a chat interaction (false)fail_reason
(string): the reason for any failure during the chat. Examples includeno_response
,expired
, andend_user_opt_out
.provider_type
(string): the type of chat provider used. For example —unknown
,messaging
,twilio_conversations
.message_count
(integer): the total number of messages exchanged in the chataverage_response_time
(integer): the average time it took for agents to respond during the chat, in secondslongest_response_time
(string): the longest time it took for an agent to respond during the chat, in seconds
Agent and virtual agent information
These properties explain who or what handled the chat:
agent_info
(object): This field can hold information about either a human agent or a virtual agent. It uses the one of keyword to specify that it can be one of two types.agent
(object): information about the human agent:id
(integer): the agent's unique IDagent_number
(string or null): an identifier assigned to the agentemail
(string, email): the agent's email addressname
(string): the agent's full namelast_name
(string): the agent's last namefirst_name
(string): the agent's first nameavatar_url
(string, uri): the URL of the agent's avatar image
virtual_agent
(object): information about the virtual agent:id
(integer): the virtual agent's unique ID.name
(string): the virtual agent's name.avatar_url
(string, uri): the URL of the virtual agent's avatar image.
Menu navigation
selected_menu (object or null): information about the menu the customer selected during the chat.
id
(integer): the ID of the menuname
(string): the name of the menuparent_id
(integer or null): The ID of the parent menu, if anyposition
(integer): the menu position relative to other menus at the same leveldeleted
(boolean): whether the menu has been deletedmenu_type
(string): the type of menu. For example —sms_menu
orweb_menu"
hidden
(boolean): whether the menu is visible and available for use
menu_path
(object or null): describes the hierarchical path of menus the customer navigated.items_count
(integer): the number of menus in the pathname
(string): a slash-separated string of menu names. For example — "Support/Billing".materialized_path
(string): a slash-separated string of menu IDs
queue_priority_level
(integer): An integer representing the priority level of the chat's selected queue
End-user details
end_user
(object): information about the customerid
(integer): the customer's internal IDidentifier
(string or null): an external identifier for the customerout_contact_id
(string or null): the customer's ID in the CRM
Customer flags
customer_flag
(object or null): flags marking notable attributes of the customerverified_customer
(boolean): whether the customer has been externally flagged as verifiedbad_actor
(boolean): whether the customer has been externally flagged as a bad actorrepeat_customer
(boolean): whether the customer has been externally flagged as a repeat customer
Media attachments
photos
(array): list of photos associated with the chatid
(integer): unique identifier for the photophoto_type
(string): The type of photo ("photo" or "screenshot")url
(integer): the storage URL of the photosmart_action_type
(array): the type of smart action associated with the phototransfer_id
(integer or null): the identifier of the comm transfer associated with the photo, if applicable
videos
(array): list of videos associated with the chatid
(integer): Unique identifier for the videourl
(integer): the storage URL of the videosmart_action_type
(array): the type of smart action associated with the videotransfer_id
(integer or null): the identifier of the comm transfer associated with the video, if applicable
Chat transfers
transfers
(array): list of transfers that occurred during the chatid
(integer): the identifier of the transferstatus
(string): status of the transfer ("transferring", "transferred", "failed", "deflected")fail_reason
(string): reason for transfer failure, if applicablecreated_at
(string, date-time): timestamp when the transfer was createdassigned_at
(string, date-time, or null): timestamp when the transfer was assignedconnected_at
(string, date-time, or null): timestamp when the transfer was connectedupdated_at
(string, date-time, or null): timestamp when the transfer was last updatedwait_duration
(integer): wait duration during the transferanswer_type_path
(string): the type of answers for the 'from' and 'to' chats, respectivelyfrom_menu_path
(object or null): menu path of the menu from which the transfer originatedto_menu_path
(object or null): menu path of the destination menu of the transfer, if applicablefrom_agent
(object or null): agent who initiated the transferto_agent
(object or null): agent who received the transferfrom_queue_priority_level
(integer): priority level of the originating queueto_queue_priority_level
(integer): priority level of the destination queue
Chat handling durations
handle_durations
(array): log data on each segment of the chat handled by an agentid
(integer): the identifier for the handle durationagent_id
(integer): identifier of the agentacw_duration
(integer): after chat work durationchat_duration
(integer): chat duration during this phasemenu_path_id
(string or null): menu path IDmenu_path
(string): menu pathlang
(string): language usedtransfer
(boolean): whether a transfer occurredtransfer_id
(string or null): transfer identifierstarted_at
(string, date-time): start timestampended_at
(string, date-time): end timestampresponse_count
(integer): number of agent responsesresponse_time_total
(integer): total agent response timeresponse_time_max
(integer): longest agent response timeresponse_time_avg
(integer): average agent response timeassigned_connection_duration
(integer): duration the end user waited while the assigned agent was connected during this phase
Queue durations
queue_durations
(array): log data on each segment of the chat where the customer was waiting in a queueid
(integer): the identifieragent_id
(integer): agent identifierended_at
(string, date-time): end timestamplang
(string): languagemenu_path_id
(integer): menu path identifiermenu_path
(string): menu pathqueue_duration
(integer): queue durationstarted_at
(string, date-time): start timestamptransfer_cold
(boolean): whether the chat was cold transferredtransfer
(boolean): whether a transfer occurredtransfer_id
(integer): transfer identifierservice_level_abandon_time_threshold
(integer): service level abandonment thresholdservice_level_event
(string): service level event statusservice_level_target_percent
(integer): service level target percentageservice_level_target_time
(integer): service level target time
Virtual agent escalations
virtual_agent_deflected_escalations
(array): details of escalations from virtual agents that were deflectedid
(integer): the identifierdeflection
(string): deflection typeescalation_id
(integer): escalation event identifierescalation_reason
(string): reason for escalationescalated_at
(string, date-time): escalation timestampmenu_path_id
(integer): menu path IDmenu_path
(string): menu pathlang
(string): languagevirtual_agent
(object): virtual agent details
Virtual agent handling durations
virtual_agent_handle_durations (array): segments of time the chat was handled by a virtual agent
id
(integer): the identifiervirtual_agent
(object): virtual agent detailschat_duration
(integer): duration of the segmentescalation_reason
(string): reason for escalationfinish_reason
(string): reason the interaction finishedresponse_count
(integer): virtual agent response countresponse_time_total
(integer): total virtual agent response timeresponse_time_max
(integer): longest virtual agent response timeresponse_time_avg
(string): average virtual agent response timefallback_response_count
(integer): fallback response countinitiated_by
(string): how the virtual agent session was initiatedmenu_path_id
(integer): menu path IDmenu_path
(string): menu pathlang
(string): languagetransfer
(boolean): whether the chat was transferredtransfer_id
(integer): transfer event identifierstarted_at
(string, date-time): start timestampended_at
(string, date-time): end timestamp
Consumer handling durations
consumer_handle_durations
(array): durations the consumer was in the chatid
(integer): identifierchat_duration
(integer): consumer segment durationstarted_at
(string, date-time): start timestampended_at
(string, date-time): end timestampmessage_count
(integer): number of consumer messagesresponse_count
(integer): number of consumer responsesresponse_time_total
(integer): total consumer response timeresponse_time_max
(integer): longest consumer response timeresponse_time_avg
(integer): average consumer response time
Consumer event durations
consumer_event_durations (array): details of consumer chat events. For example — CSAT, payment
id
(integer): identifierduration
(integer): event durationtype
(string): event typeevent
(string): event outcomemenu_path_id
(integer): menu path IDmenu_path
(string): menu pathlang
(string): languagestarted_at
(string, date-time): start timestampended_at
(string, date-time): end timestamp
Participants
participants (array): information about each participant in the chat. For example &mdash: customer, agent, virtual agent)
id
(integer): unique identifier for the participanttype
(string): type of participant, for example —end_user
,agent
,virtual_agent
, etc.entry_type
(string): how the participant entered the chatuser_id
(integer or null): user ID if the participant is an agentend_user_id
(integer or null): end-user ID if the participant is the customervirtual_agent_id
(integer or null): virtual agent ID if the participant is a virtual agentvirtual_agent_params
(object): custom metadata used by the virtual agentstatus
(string): status of the participantfail_reason
(string): reason for failure, if anyconnected_at
(string, date-time): timestamp when the participant connectedphone_number
(string): phone number of the participantchat_id
(integer): identifier for the chatchat_duration
(integer): chat duration for the participantfinished_at
(string, date-time): timestamp when the participant's involvement ended
Offer events
offer_type
(string or null): manner in which the chat was offered to the agentoffer_events
(array): events where the chat was offered to agents.casting_time
(date-time): time the chat was offeredgroup
(string): Group to which the chat was offered
Other details
dismiss_duration
(integer): duration the chat spent in the "dismissed" statusanswer_type
(string or null): how the chat was answered ("manual" or "auto")inbound_number
(string): inbound phone numberoutbound_number
(string): outbound phone numberafter_hours
(boolean): whether the chat was conducted after hoursdispositions
(array): dispositions recorded during the chatauto_session_summaries
(array): automatically generated summaries of the sessiontransfer_limit
(object): transfer limit data for the chatemail
(string, email, or null): customer's email addressfeedback
(string or null): customer feedbacksmart_action_text
(string or null): text of any smart action takencustom_data_secured
(object or null): custom, securely signed datacustom_data_not_secured
(object or null): custom, non-securely signed data
Key definitions
The schema also includes a definitions section to define reusable components:
menu_path
: describes a hierarchical menu pathagent
: describes a human agentvirtual_agent
: describes a virtual agent