Skip to main content

Log sessions preview

Query

Access information about all the log sessions by executing:

query SessionsPreviewV2(
$accountId: uuid
$deskIds: _uuid
$brainIds: _uuid
$integrationIds: _uuid
$brainVersions: _int4
$channels: _text
$startDate: timestamp
$endDate: timestamp
$minNumUserMessages: Int
$maxConfidence: float8
$minHumanResponseTime: float8
$ratings: _int4
$tags: _text
$rule_ids: _uuid
$sessionId: String
$userId: String
$userName: String
$userEmail: String
$channelUserId: String
$externalUserId: String
$isContained: Boolean
$isCovered: Boolean
$isTest: Boolean
$hasCollection: Boolean
$hasCollectionSources: Boolean
$agentIds: _text
$isMeaningful: Boolean
$limit: Int
) {
rows: logs_sessions_preview_v2(
limit: $limit
args: {
start_time: $startDate
end_time: $endDate
account_id: $accountId
brain_parent_ids: $brainIds
desk_ids: $deskIds
integration_ids: $integrationIds
brain_versions: $brainVersions
channels: $channels
min_num_user_messages: $minNumUserMessages
max_confidence: $maxConfidence
min_human_response_time: $minHumanResponseTime
ratings: $ratings
tags: $tags
rule_ids: $rule_ids
session_id: $sessionId
user_id: $userId
user_name: $userName
user_email: $userEmail
channel_user_id: $channelUserId
external_user_id: $externalUserId
is_contained: $isContained
is_covered: $isCovered
is_test: $isTest
has_collection: $hasCollection
has_collection_sources: $hasCollectionSources
agent_ids: $agentIds
is_meaningful: $isMeaningful
}
) {
avg_confidence
brain_id
brain_parent_id
brain_version
channel
channel_user_id
user_id
user_name
user_email
desk_id
start_time
end_time
expired_time
external_user_id
integration_id
is_contained
is_covered
is_test
min_confidence
participated_brains
participated_collections
participated_agents
rating
feedback
session_id
tags
rule_ids
total_user_messages
avg_human_response_time
avg_response_time
human_first_response_time
}
}

Input Arguments

The following Sessions Preview arguments can specify and fine tune the search for sessions

ArgumentTypeDescription
deskIds_uuidA set of desk Ids to filter sessions coming from the input desk(s)
brainIds_uuidA set of brain Ids to filter sessions coming from the input brain(s)
integrationIds_uuidA set of integration Ids to filter sessions coming from the input integration(s)
brainVersions_int4A set of brain versions to filter sessions coming from the input version(s)
channels_textA set of channels to filter sessions coming from the input channel(s)
startDatetimestampThe start date in format yyyy-mm-dd
endDatetimestampThe end date in format yyyy-mm-dd
minNumUserMessagesIntAn integer to filter sessions with more messages than minNumUserMessages
maxConfidencefloat8A float to filter sessions with minimum confidence less than maxConfidence
ratings_int4A set of integers to filter sessions with the input ratings
tags_textA set of strings to filter sessions with the specified tags
sessionIdStringOnly the session with the specified session Id will be returned
userIdStringOnly the session(s) with the specified user Id will be returned
channelUserIdStringOnly the session(s) with the specified channel user Id will be returned
externalUserIdStringOnly the session(s) with the specified external user Id will be returned
isContainedBooleanFilter the contained or non-contained sessions
isCoveredBooleanFilter the covered or non-covered sessions
isTestBooleanFilter out test sessions (i.e sessions coming from the webchat preview)
agentIds_textA set of agent Ids to filter sessions in which any of the input agents participated
limitIntAn integer to specify the maximum number of returned sessions

Return Fields

The Sessions Preview query returns a list of Sessions, where each Session has the following fields:

FieldTypeDescription
desk_iduuidThe desk Id in which the session belongs
brain_parent_iduuidThe brain Id in which the session belongs
integration_iduuidThe integration Id in which the session belongs
brain_versionint4The version of the brain in which the session belongs
channelStringThe channel from which the session started
start_timetimestampThe time the session started
end_timetimestampThe time the session ended
total_user_messagesIntThe number of user messages in the session
min_confidencefloat8The minimum confidence across all brain predictions in the session
avg_confidencefloat8The average confidence across all brain predictions in the session
ratingIntThe rating the session received. Null if the session was not rated
tags_textThe tags of the session. Null if no tags exist
sessionIdStringThe Id of the session
user_idStringUser Id of the user participating in the session
channel_user_idStringChannel User Id of the user participating in the session. Null if the channel is web
external_user_idStringExternal Id of the user participating in the session. Null if not set
user_nameStringThe name of the user participating in the session
is_containedBooleanTrue if the session is contained, false otherwise
is_coveredBooleanTrue if the session is covered, false otherwise
is_testBooleanTrue if the session is test, false otherwise
participated_agents_textA list of agent Ids and agent names participated in the session

Examples

Below are some examples of how SessionsPreviewV2 can be called.

{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"startDate": "2022-04-08",
"endDate": "2022-04-17"
}

Example Result

{
"data": {
"rows": [
{
"avg_confidence": 0.9334274,
"brain_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
"brain_parent_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
"brain_version": 8,
"channel": "web",
"channel_user_id": null,
"user_id": "pMyA-YY75nmw45XbqWg88",
"user_name": "Visitor 438",
"desk_id": "d2be0283-9b53-4d7b-b77d-2650f3a1a99c",
"start_time": "2022-04-07T11:40:28.772",
"end_time": "2022-04-07T11:48:41.092",
"external_user_id": null,
"integration_id": "1388a63d-2275-4446-9f20-povv9203w000",
"is_contained": false,
"is_covered": true,
"is_test": true,
"min_confidence": 0.8668548,
"participated_agents": [
{
"agent_id": "4v57b8ba-c1de-42ac-94ad-564e0c6858c9",
"agent_name": "George Johnson"
}
],
"rating": 5,
"session_id": "1234a3ba-33fd-4add-be5e-f73030242bee",
"tags": null,
"total_user_messages": 2
},
{
"avg_confidence": 0.8721187,
"brain_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
"brain_parent_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
"brain_version": 8,
"channel": "web",
"channel_user_id": null,
"user_id": "BEzx-zR1Jh4wlY9PnyTe9",
"user_name": "Visitor 435",
"desk_id": "d2be0283-9b53-4d7b-b77d-2650f3a1a99c",
"start_time": "2022-04-06T15:09:43.491",
"end_time": "2022-04-06T15:12:07.31",
"external_user_id": null,
"integration_id": "1388a63d-2275-4446-9f20-povv9203w000",
"is_contained": true,
"is_covered": true,
"is_test": false,
"min_confidence": 0.74423736,
"participated_agents": null,
"rating": 2,
"session_id": "58be4fe7-96af-409b-8ae2-cf6b1c4b44cc",
"tags": [
"moveo_start"
],
"total_user_messages": 4
}
]