{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nice/json-schema/nice-contact-schema.json",
  "title": "Contact",
  "description": "contains details of annotated interaction",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nice-interactionanalytics-interactions-openapi.yml#/components/schemas/Contact",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "Describes the type of the interaction. This can be CALL, CHAT, EMAIL, etc."
    },
    "language": {
      "type": "string",
      "description": "Language code of the interaction (e.g., en-us, en, es). Represents the primary language detected or configured for this interaction."
    },
    "recordSource": {
      "type": "string",
      "description": "Describes where the underlying interaction information came from for debug purposes.  This field is largely for historic purposes, and currently should always be S3."
    },
    "fromInterwovenTranscript": {
      "type": "boolean",
      "description": "A boolean field providing debug information, indicating the source of the transcript blocks."
    },
    "annotatedDateTime": {
      "type": "string",
      "format": "date-time",
      "description": "Indicates the Date and Time when the interaction was annotated by pipeline-annotator in the annotation pipeline. This field is not present for voice (CALL) interactions but is available for CHAT and other channel types."
    },
    "voiceFile": {
      "type": "string",
      "description": "For call data, indicates the locations of the voice file."
    },
    "transcriptBlocks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TranscriptBlock"
      },
      "description": "Shows the text of the interaction between participants. Each block indicates a different participant."
    },
    "annotations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TranscriptAnnotation"
      },
      "description": "An array of annotations produces by the annotation pipeline based on the text for each participant."
    },
    "enlightenMetrics": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EnlightenMetric"
      },
      "description": "An array of enlighten metric data as generated by the content of the interaction."
    },
    "metrics": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "A map of key/value pairs, indicating various metrics associated with the interaction segment. This includes different set of ids, types, time stamps etc."
    },
    "segmentSummary": {
      "allOf": [
        {
          "$ref": "#/$defs/SegmentSummary"
        }
      ],
      "description": "Auto-generated summary of the segment. May not be present in all responses depending on environment configuration and licensing."
    }
  },
  "$defs": {
    "Action": {
      "type": "object",
      "description": "an action that took place during interaction",
      "properties": {
        "text": {
          "type": "string",
          "description": "name of the action"
        },
        "score": {
          "description": "Score represents the accuracy of this snippet and how close it to the semantic centroid of this Action.",
          "format": "double",
          "type": "number"
        },
        "snippet": {
          "$ref": "#/$defs/Snippet"
        }
      }
    },
    "ChatMetadata": {
      "type": "object",
      "description": "Metadata information provided for interactions of type Chat.",
      "properties": {
        "timestamp": {
          "type": "integer",
          "format": "int32",
          "description": "The time relative to the start of the chat in which a person submits a chat response for the block of text in a Chat."
        }
      }
    },
    "EmailMetadata": {
      "type": "object",
      "description": "Metadata information provided for interactions of type Email.",
      "properties": {
        "sentDate": {
          "type": "integer",
          "format": "int32",
          "description": "The date this portion of the email interaction was sent."
        },
        "subject": {
          "type": "string",
          "description": "The subject line for this portion of the email interaction."
        },
        "from": {
          "type": "string",
          "description": "The email address of the participant who sent this portion of the email interaction."
        },
        "to": {
          "type": "string",
          "description": "The email address of the participant who received this portion of the email interaction."
        }
      }
    },
    "EnlightenMetric": {
      "type": "object",
      "description": "represents enlighten metrics",
      "properties": {
        "behaviorName": {
          "type": "string",
          "description": "Name of the Enlighten behavioral metric depending on the Enlighten package model."
        },
        "indexScore": {
          "type": "integer",
          "format": "int32",
          "description": "Normalized score value from zero to ten for the metric. The NICE Enlighten AI index provides a standardized scoring approach-based ranges of results on billions of real-life consumer interactions. A score of 6 or higher is considered a positive performance for the behavior. A score of 4 or lower is considered a negative performance for the behavior."
        },
        "rawScore": {
          "type": "number",
          "format": "double",
          "description": "The raw score for the agent performance in the behavioral metric for this interaction. The index score is more helpful for finding insights."
        },
        "enlightenPackageModels": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The type of Enlighten model. Possible values are CustomerSatisfaction or SalesEffectiveness."
        }
      }
    },
    "Intent": {
      "type": "object",
      "description": "an intent/a purpose of the interaction",
      "properties": {
        "category": {
          "type": "string",
          "description": "level 1 intent name"
        },
        "score": {
          "description": "Score represents the accuracy of this snippet and how close it to the semantic centroid of this Intent.",
          "format": "double",
          "type": "number"
        },
        "topic": {
          "type": "string",
          "description": "level 2 intent name"
        },
        "name": {
          "type": "string",
          "description": "level 3 intent name"
        },
        "snippet": {
          "$ref": "#/$defs/Snippet"
        }
      }
    },
    "Outcome": {
      "type": "object",
      "description": "an outcome that occurred in the interaction",
      "properties": {
        "name": {
          "type": "string",
          "description": "name of the outcome"
        },
        "score": {
          "type": "number",
          "format": "double",
          "description": "score used for CXone internal purposes"
        },
        "snippet": {
          "$ref": "#/$defs/Snippet"
        }
      }
    },
    "SegmentSummary": {
      "type": "object",
      "description": "CXone enlighten SegmentSummary details for voice interactions",
      "properties": {
        "summary": {
          "type": "string",
          "description": "overall interaction segment summary text"
        },
        "actions": {
          "type": "array",
          "description": "list of actions that occurred during the interaction",
          "items": {
            "$ref": "#/$defs/Action"
          }
        },
        "primaryIntent": {
          "$ref": "#/$defs/Intent"
        },
        "outcomes": {
          "type": "array",
          "description": "list of outcomes that occurred during the interaction",
          "items": {
            "$ref": "#/$defs/Outcome"
          }
        }
      }
    },
    "Snippet": {
      "type": "object",
      "description": "snippet of the interaction that is related",
      "properties": {
        "snippet": {
          "type": "string",
          "description": "snippet in the interaction"
        },
        "text": {
          "type": "string",
          "description": "snippet text/sentence in the interaction"
        },
        "startOffset": {
          "type": "integer",
          "format": "int32",
          "description": "position of the sentence start in interaction"
        },
        "endOffset": {
          "type": "integer",
          "format": "int32",
          "description": "position of the sentence end in interaction"
        }
      }
    },
    "TranscriptAnnotation": {
      "type": "object",
      "description": "represents an annotation",
      "properties": {
        "objectType": {
          "type": "string",
          "description": "The type of annotation. i.e. BeginSentimentAnnotation, CategoryAnnotation etc."
        },
        "type": {
          "type": "string",
          "description": "The kind of annotation being presented. i.e. ENTITY, CATEGORY_MATCH, SENTIMENT_CUE, etc."
        },
        "value": {
          "type": "string",
          "description": "The value of the annotation. This will vary greatly depending on the type of the annotation."
        },
        "offset": {
          "type": "integer",
          "format": "int32",
          "description": "The offset of the text within a single participant's whole text that caused the annotation to be produced."
        },
        "highlightLength": {
          "type": "integer",
          "format": "int32",
          "description": "The length of the text the caused the annotation to be produced."
        },
        "transcriptOffset": {
          "type": "integer",
          "format": "int32",
          "description": "The offset within a single transcript block of the text that caused the annotation to be produced."
        },
        "transcriptChunk": {
          "type": "integer",
          "format": "int32",
          "description": "The id of the transcript block that contains the transcriptOffset for the annotation."
        },
        "channelName": {
          "type": "string",
          "description": "The name of the channel, usually indicating the participant for the text causing the annotation to be produced."
        },
        "categoryPath": {
          "type": "string",
          "description": "full path of the category identified. This is part of CategoryAnnotation type."
        },
        "datasetIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int64"
          },
          "description": "data set ids the interaction segment is categorized under. This is part of CategoryAnnotation type."
        },
        "domainRole": {
          "type": "string",
          "description": "domain identified for the text. This is part of EntityAnnotation type."
        },
        "stem": {
          "type": "string",
          "description": "exact text found in the conversation for a keyword. This is part of KeywordAnnotation type."
        },
        "displayText": {
          "type": "string",
          "description": "text displayed for the keyword. This is part of KeywordAnnotation type."
        },
        "sentimentCueStrength": {
          "type": "integer",
          "format": "int32",
          "description": "strength of the sentiment cue identified text. This is part of SentimentCueAnnotation type."
        }
      }
    },
    "TranscriptBlock": {
      "type": "object",
      "properties": {
        "channelId": {
          "type": "integer",
          "format": "int32",
          "description": "Indicates channel id, the text came from."
        },
        "channelName": {
          "type": "string",
          "description": "The type of participant within the interaction. The participant is either the AGENT or the CLIENT."
        },
        "offset": {
          "type": "integer",
          "format": "int32",
          "description": "If the text for a single channel is combined, this indicates the offset of the block text within the larger set."
        },
        "length": {
          "type": "integer",
          "format": "int32",
          "description": "The length of the block text."
        },
        "blockId": {
          "type": "integer",
          "format": "int32",
          "description": "An id for each block which also indicates the order of the blocks within the interaction."
        },
        "text": {
          "type": "string",
          "description": "The text for the block"
        },
        "userId": {
          "type": "string",
          "description": "Unique alphanumeric identifier assigned by CXone to an agent or client."
        },
        "channelUuid": {
          "type": "string",
          "description": "Unique identifier for the channel through which this transcript block was received."
        },
        "channelType": {
          "type": "string",
          "description": "Type of channel used for this transcript block (e.g., IN_APP_MESSAGING, WEB_FORM, CHAT, EMAIL)."
        },
        "userType": {
          "type": "string",
          "description": "Type of user who generated this transcript block. Possible values are AGENT or CLIENT."
        },
        "voiceMetadata": {
          "$ref": "#/$defs/VoiceMetadata"
        },
        "chatMetadata": {
          "$ref": "#/$defs/ChatMetadata"
        },
        "emailMetadata": {
          "$ref": "#/$defs/EmailMetadata"
        }
      }
    },
    "VoiceMetadata": {
      "type": "object",
      "description": "Metadata information provided for interactions of type Call.",
      "properties": {
        "startTime": {
          "type": "integer",
          "format": "int32",
          "description": "The start time of the block text appears within the voice file of a Call."
        },
        "endTime": {
          "type": "integer",
          "format": "int32",
          "description": "The end time of the block text within the voice file of a Call."
        },
        "confidence": {
          "type": "integer",
          "format": "int32",
          "description": "The average confidence of the ASR transcriptions for each word within the block text of a Call."
        }
      }
    }
  }
}