Skip to main content

Field Reference

This page provides detailed documentation for all fields that appear in event payloads, including field value codes, transformations, and the comprehensive attachedData keys reference.

Comprehensive AttachedData Keys Reference

The attachedData field can contain a wide variety of keys depending on the interaction type, channel, and system configuration. Below is a comprehensive reference organized by category:

Basic Interaction Fields

KeyTypeDescription
phoneNumnumberPrimary phone number for the interaction
phomixedPhone number (short key)
callingNamemixedCaller's name or calling number
callerIdnumberCaller ID number
@prinumberPriority value
prioritynumberQueue priority (50 is standard)
medstringMedia type code
"T" for phone
"C" for chat/SMS
chamixedChannel identifier
channelNamemixedChannel/queue name
cntnumberCounter field
connumberContact/record ID
toknumberToken identifier

Queue and Routing Fields

KeyTypeDescription
questringQueue identifier (format: tenant~~queue~~media~~id)
oqustringOriginal queue before transfer
queueDirectionstring"in" (inbound)
"out" (outbound)
tenantNamestringTenant name
tenantSkillNamestringSkill/queue name

Timing Fields

KeyTypeDescription
timnumberTimestamp (seconds since epoch)
otimnumberOriginal/queue entry time (seconds)
waitTimenumberWait time in seconds
callAnsweredTimenumberCall answered timestamp (milliseconds)
callHangupTimenumberCall hangup timestamp (milliseconds)
callAnsweredTenantTTstringAnswered time formatted in tenant timezone
callHangupTenantTTstringHangup time formatted in tenant timezone
callDurationstringCall duration formatted (HH:MM:SS)
callDurationSecnumberCall duration in seconds
phoneQueueInteractionStartTimenumberPhone queue interaction start (seconds)

Recording Fields

KeyTypeDescription
tenantRecServerstringRecording server name (e.g., "eu10nfs01")
aAgtCallRecstringAgent call recording setting
"yes"
"no"
agtInitVRstringAgent initiated recording
"NotSet"
etc.
callerPermstringCaller permission for recording
"yes"
"no"
vRecPnumberRecording parameter

Outbound and Campaign Fields

KeyTypeDescription
ctl_transTypestringTransaction type
"agentdial"
"campaign"
etc.
destTypestringDestination type
"external"
etc.
outboundTclItemIdmixedOutbound transaction code list item ID
outboundTclListIdmixedOutbound transaction code list ID
outboundTclShortCodestringOutbound TCL short code
campIdnumberCampaign ID
campNamestringCampaign name
dialModestringDial mode
"preview"
"progressive"
etc.
extRecordIdnumberExternal record ID
extRecordTypestringExternal record type
"customer"
etc.
phoneListstringPhone list for campaign
previewTimeoutstringPreview timeout setting
rejectOnPreviewTimeoutbooleanWhether to reject on preview timeout
retry_countnumberRetry count for outbound call
showSkipButtonbooleanWhether skip button is shown

Transfer and Original Interaction Fields

KeyTypeDescription
originalInteractionGuidstringGUID of original interaction before transfer
originalTokenIdnumberToken ID of original interaction
originalTransactionIdnumberTransaction ID of original interaction

Transaction Codes and Disposition

KeyTypeDescription
tclSelectedItemsstringSelected transaction codes in format "listId|itemId,listId|itemId" - see Transaction Codes section for details

Digital Channel Fields (Chat, SMS, Email)

KeyTypeDescription
chaletChatbooleanWhether this is a Chalet chat
chaletRoomstringChalet room identifier
channelIdstringChannel ID (short form)
createInteractionTimestampNanosnumberCreation timestamp in nanoseconds
customerLanguagestringCustomer language code (e.g., "en")
extTransactionDatastringExternal transaction data (formatted string)
extTransactionDataIDstringExternal transaction data ID
sessionIdstringSession identifier
timezoneOffsetnumberTimezone offset
typestringInteraction type (e.g., "SMS")
namstringName field for digital channels

Remote Participant Fields

KeyTypeDescription
remoteCallingNamestringRemote caller name (formatted)
remotePhoneNumstringRemote phone number (formatted with country code)

Advanced/System Fields

KeyTypeDescription
ctl_userdatastringControl user data
externalUserDatastringExternal user data string
carrierCallBlockingChecknumberCarrier call blocking check result
record_phone_indexnumberPhone record index
schema_userstringDatabase schema user

Note: Not all keys will be present in every event. The keys present depend on:

  • Media type (phone, chat, email, SMS)
  • Interaction direction (inbound vs outbound)
  • System configuration and enabled features
  • Customer-specific customizations

Field Values Reference

Many fields in event payloads use numeric ordinal values to represent states, modes, and types. This section documents what these numeric values mean.

Resource Type Codes

The resourceType field indicates the media channel type:

CodeMedia TypeDescription
0PhoneVoice call interaction
1EmailEmail interaction
2ChatChat or messaging interaction
3SMSSMS text message interaction
4VideoVideo call interaction

Example:

{
"resourceType": 0,
"mediaType": "phone"
}

Note: The mediaType field provides a normalized string representation ("phone", "email", "chat"), while resourceType contains the numeric code.

Recording Mode Codes

The recordingMode field indicates the recording state:

CodeModeDescription
0OffRecording is disabled
1RecordRecording is active
2MonitorMonitoring mode (recording without notification)

In JSON, these appear as strings:

{
"recordingMode": "yes", // Corresponds to code 1 (Record)
"recordingMode": "no" // Corresponds to code 0 (Off)
}

Call State Codes

The callState field indicates the current state of an interaction throughout its lifecycle:

CodeDescriptionTypical Events
CS_IDLEInitial state - interaction created but not yet queuedInteractionCreated
CS_QUEUEDInteraction waiting in queue to be assigned to an agentInteractionQueued, InteractionUnqueued
CS_INPROGRESSInteraction assigned to agent but not yet connected (ringing/alerting)InteractionAssigned
CS_CONNECTEDActive interaction - agent and customer are connectedInteractionAccepted, InteractionCustomerAccepted
CS_HOLDInteraction is on holdLineHoldStatus (status: true)
CS_DISCONNECTEDInteraction has ended - one or more parties disconnectedInteractionDeleted, InteractionPostProcess

State Transitions:

Typical interaction lifecycle for inbound calls:

Typical interaction lifecycle for outbound calls:

Example in events:

{
"event": "InteractionQueued",
"callState": "CS_QUEUED",
"queueTime": 1744819217
}
{
"event": "InteractionAccepted",
"callState": "CS_CONNECTED",
"agentId": "agAglVJkg0TU28dok9y9UQKg"
}

Note: The callState field appears in most Interaction events and is essential for tracking interaction progress through the system.

Agent State Codes

Agent-related events use numeric codes for states and presence:

Login State

CodeStateDescription
0LOGGED_OUTAgent is logged out
1LOGGED_INAgent is logged in

Presence

CodePresenceDescription
0OfflineAgent is offline
1OnlineAgent is online and available
2DNDDo Not Disturb (busy/unavailable)

Example from AgentStatusChange event:

{
"newState": 5, // Current agent state
"newSubState": "none", // Sub-state description
"newSubStateReason": "none"
}

Reject Reason Codes

The rejectReason field (in InteractionRejected events) indicates why an interaction was rejected:

CodeReasonDescription
0UnknownRejection reason not specified
1TimeoutAgent did not respond in time
2Agent RejectAgent explicitly rejected the interaction

Hangup Reason Codes

The callHangupReason field (in InteractionDeleted events) indicates why a call ended. This provides detailed information about call termination beyond just who initiated the hangup.

CodeCategoryDescriptionCommon Scenarios
CEC_NONENormalNo specific reason providedDefault value, generic termination
CEC_DISCONNECT_NORMALNormalNormal call termination - call completed successfullyCustomer and agent finished conversation
CEC_DISCONNECT_BUSYFailedCalled number was busyOutbound call to busy number
CEC_DISCONNECT_BADADDRESSFailedInvalid phone number or unreachable destinationMalformed number, disconnected number
CEC_DISCONNECT_NOANSWERFailedCalled party did not answerOutbound call rang but no answer
CEC_DISCONNECT_CANCELLEDCancelledCall was cancelled before connectionAgent or customer cancelled during ring
CEC_DISCONNECT_REJECTEDRejectedCall was rejected by the called party or systemCustomer/system declined call
CEC_DISCONNECT_FAILEDFailedCall failed due to system or network errorNetwork issues, system errors
CEC_DISCONNECT_BLOCKEDBlockedCall was blocked (e.g., by spam filter, DNC list)Compliance blocking, spam detection

Usage with hangupInitiator:

The callHangupReason works in conjunction with hangupInitiator to provide complete termination information:

hangupInitiatorcallHangupReasonInterpretation
CUSTOMERCEC_DISCONNECT_NORMALCustomer hung up normally
AGENTCEC_DISCONNECT_NORMALAgent hung up normally
SYSTEMCEC_DISCONNECT_NOANSWERSystem terminated - customer didn't answer
SYSTEMCEC_DISCONNECT_FAILEDSystem terminated - technical failure
SYSTEMCEC_DISCONNECT_BLOCKEDSystem terminated - call blocked

Example in InteractionDeleted event:

{
"event": "InteractionDeleted",
"callState": "CS_DISCONNECTED",
"hangupInitiator": "SYSTEM",
"callHangupReason": "CEC_DISCONNECT_NOANSWER",
"dispositionCode": 1000
}

Interpretation: System terminated the call because the customer didn't answer.

Analytics Use Cases:

  • Call completion rates: Count CEC_DISCONNECT_NORMAL vs other reasons
  • Technical issues: Monitor CEC_DISCONNECT_FAILED for system problems
  • Contact rates: Track CEC_DISCONNECT_NOANSWER and CEC_DISCONNECT_BUSY for outbound campaigns
  • Compliance monitoring: Track CEC_DISCONNECT_BLOCKED for regulatory compliance

Field Transformations

The system performs several transformations on field values between the internal event format and the output you receive. Understanding these transformations helps explain why certain fields have specific formats.

GUID Extraction

Agent IDs are stored internally as GUIDs with the format "X-AgentId-Y", but are extracted to simpler agent IDs for output:

Internal format: "tenant01-agAglVJkg0TU28dok9y9UQKg-e46672cd-660c-46f5-b8f0-856eaf18f65c"

Extracted agentId: "agAglVJkg0TU28dok9y9UQKg"

The extraction process:

  1. GUID is split by - delimiter
  2. The component starting with ag is extracted
  3. This becomes the agentId field value
  4. The full GUID is preserved in agentGUID field

Example in event:

{
"agentGUID": "tenant01-agAglVJkg0TU28dok9y9UQKg-e46672cd-660c-46f5-b8f0-856eaf18f65c",
"agentId": "agAglVJkg0TU28dok9y9UQKg"
}

Queue ID Parsing

Queue identifiers are stored internally using a ~~ (double-tilde) separated format: "tenant~~queue~~media~~id", but are parsed to extract just the numeric queue ID:

Internal format: "tenant01~~1162~~phone~~b1e3e2f2-b01a-4a03-ba3d-f30859414d97"

Extracted queueId: 1162

The parsing process:

  1. Split the string by ~~ delimiter
  2. Extract the numeric queue ID component
  3. This becomes the queueId field value

Example in attachedData:

{
"attachedData": {
"attachedDatum": [
{"attachedDataKey": "que", "attachedDataValue": "tenant01~~1162~~phone~~..."}
]
},
"queueId": 1162
}

Media Type Normalization

The mediaType field is normalized from numeric resourceType codes to human-readable strings:

resourceTypemediaType
0"phone"
1"email"
2"chat"
3"chat"
4"phone"

Example:

{
"resourceType": 0,
"mediaType": "phone"
}

Participating Agents Array Parsing

The participatingAgents field contains semicolon-separated agent IDs that are parsed from internal GUID format:

Internal format: "tenant01-agAglVJkg0TU28dok9y9UQKg-guid1;tenant01-agBbcDef123-guid2"

Parsed output: "agAglVJkg0TU28dok9y9UQKg,agBbcDef123" (comma-separated agent IDs)

Note: In some events, this may appear as comma-separated instead of semicolon-separated, depending on the transformation stage.

Boolean String Representation

Boolean values in events are represented as strings ("true", "false") rather than native JSON booleans:

{
"isAgentInitiated": false, // JSON boolean in some contexts
"isOutboundCall": true, // JSON boolean
"isDirectAccess": "false", // String in other contexts
"isExternal": "true" // String
}

This is due to the internal message format constraints. When consuming events, be prepared to handle both boolean and string representations.

Timestamp Formats

Events include timestamps in multiple formats:

Field NameFormatExampleDescription
eventTSSeconds since epoch (integer)1744819217Event occurrence time
interactionEventTSSeconds since epoch (integer)1744819217Interaction-specific event time
queueTimeSeconds since epoch (integer)1744819217Time entered queue
msgInfo.timestampMilliseconds since epoch1744819217000Message metadata timestamp

Converting to Date/Time:

// From seconds
eventTime := time.Unix(event.EventTS, 0)

// From milliseconds
msgTime := time.UnixMilli(event.MsgInfo.Timestamp)

Transaction Codes and Disposition

Interaction events related to call wrap-up include two important but distinct fields for tracking call outcomes:

dispositionCode vs transactionCodeList

dispositionCode

A single primary outcome code representing the overall call result:

  • Simple string or numeric value
  • High-level categorization of what happened
  • Examples: "CALLBACK", "SALE", "NO_ANSWER", 1000
  • Always a single value
  • Appears in InteractionDeleted and InteractionEndPostProcess events

Example:

{
"event": "InteractionDeleted",
"dispositionCode": 1000,
"agentNotes": "Customer requested callback tomorrow"
}

transactionCodeList

Multiple detailed transaction codes for granular categorization:

  • Structured format: "listId|itemId,listId|itemId"
  • Can contain multiple codes for different aspects of the interaction
  • References database-defined Transaction Code Lists (TCL)
  • Used for detailed analytics, compliance tracking, and business intelligence
  • Agents can select multiple codes during wrap-up
  • System may auto-apply mandatory codes

Format: Comma-separated pairs of listId|itemId

Example:

{
"attachedData": {
"attachedDatum": [
{"attachedDataKey": "tclSelectedItems", "attachedDataValue": "5|12,6|45,8|99"}
]
}
}

This translates to:

  • List 5, Item 12: "Product Type - Insurance"
  • List 6, Item 45: "Customer Sentiment - Satisfied"
  • List 8, Item 99: "Follow-up Required - Yes"

Complete Example

A typical wrap-up scenario showing both fields:

{
"event": "InteractionDeleted",
"dispositionCode": "SALE",
"agentNotes": "Sold premium insurance package",
"attachedData": {
"attachedDatum": [
{"attachedDataKey": "tclSelectedItems", "attachedDataValue": "5|12,6|45,8|99"}
]
}
}

Here:

  • dispositionCode = "SALE" (overall outcome: sale was made)
  • transactionCodeList = "5|12,6|45,8|99" (detailed categorization: insurance product, satisfied customer, follow-up needed)

Configuration

Transaction Code Lists are configured by administrators in 8x8 Configuration Manager:

Creating Transaction Code Lists

  1. Navigate to: Configuration Menu → Transaction Codes → Add
  2. Configure properties for the code list (name, description, settings)
  3. Define individual codes in the Codes tab
  4. Optional: Translate codes to secondary languages

Viewing List and Item IDs

To understand the numeric IDs in tclSelectedItems:

  • List ID: In the Transaction Codes list, select dropdown → Columns → ID to show the list ID column
  • Item ID: Edit a list → Codes tab → Select dropdown → Columns → ID to show individual transaction code IDs

These numeric IDs (listId and itemId) are what appear in tclSelectedItems as "listId|itemId".

Assignment

  • Transaction code lists are assigned to agent groups or queues
  • Multiple transaction code lists can be applied to a single agent group or queue
  • Agents only see codes from lists assigned to their group/queue

Agent Selection

  • Agents select transaction codes during interaction wrap-up in Agent Console/Workspace
  • Selected codes are recorded in the tclSelectedItems field
  • System may automatically apply mandatory codes if configured

Documentation References

UserData Extraction

The attachedData object contains an array of key-value pairs. Many of these keys are extracted from a nested internal structure called userData and transformed into top-level fields or remain in attachedData.

Extraction Mapping

The following table shows how nested userData fields are extracted and mapped:

userData KeyOutput FieldDescriptionExample Value
userData.otimeventTSOriginal/queue entry timestamp (seconds since epoch)1744819217
userData.tclSelectedItemsattachedData: tclSelectedItemsTransaction code list (format: listId|itemId,...)"5|12,6|45,8|99"
userData.queueDirectiondirectionQueue direction (inbound/outbound)"in", "out"
userData.chainboundChannelidInbound channel identifier441733968848
userData.quequeueIdQueue ID (parsed from ~~ separated format)1162
userData.timqueueTimeTime when interaction entered queue (seconds)1744819217
userData.emaemailSourceAddressEmail source address (for email interactions)user@example.com
userData.aAgtCallRecoverrideAutoInteractionRecordingOverride auto recording setting"yes", "no"
userData.agtCallRecallowAgentOverrideInteractionRecordingAllow agent to override recording"yes", "no"
userData.callerPermcallerPermissionCaller permission for recording"yes", "no"

How Extraction Works

  1. Internal Event Creation: The system creates an internal event with nested userData structure
  2. Field Extraction: Specific keys from userData are extracted to top-level fields or separate attachedData entries
  3. Format Transformation: Some fields undergo additional transformation (e.g., queue ID parsing from ~~ format)
  4. Preservation: The complete userData structure is also preserved in attachedData for reference

Example

Internal userData structure:

userData = {
"otim": "1744819217",
"que": "tenant01~~1162~~phone~~b1e3e2f2-b01a-4a03-ba3d-f30859414d97",
"queueDirection": "in",
"cha": "441733968848",
"tclSelectedItems": "5|12,6|45"
}

Extracted to output event:

{
"eventTS": 1744819217,
"queueId": 1162,
"direction": "in",
"inboundChannelid": 441733968848,
"attachedData": {
"attachedDatum": [
{"attachedDataKey": "que", "attachedDataValue": "tenant01~~1162~~phone~~..."},
{"attachedDataKey": "queueDirection", "attachedDataValue": "in"},
{"attachedDataKey": "cha", "attachedDataValue": 441733968848},
{"attachedDataKey": "tclSelectedItems", "attachedDataValue": "5|12,6|45"}
]
}
}

Note:

  • eventTS is extracted from userData.otim
  • queueId is extracted and parsed from userData.que (removing the ~~ format)
  • direction is extracted from userData.queueDirection
  • inboundChannelid is extracted from userData.cha
  • Original values are preserved in attachedData for reference

Next Steps