Skip to main content

chat-init-v1 Event

The chat-init-v1 event is triggered when a chat interaction is successfully initialized, providing the initial message history.

Properties

Object containing the following properties:

PropertyDescriptionType
interactionId (*)Unique identifier of the interactionstring
messages (*)Initial message history for the chatArray of ChatMessage — see below
schemaVersion (*)Current schema version of the event'1.0.0'

(*) Required.

ChatMessage Properties

PropertyDescriptionType
id (*)Unique message identifierstring
timestamp (*)Message creation timestamp (epoch ms)number
type (*)Message typestring
rawMessage (*)Raw message contentstring | Record<string, string>
lastUpdatedTimestampTimestamp of last update (epoch ms)number
botNameName of the bot if message is from a botstring
msgStatusMessage delivery statusstring
attachmentsFile attachmentsArray of Attachment
translatedMessageTranslated content if translation is enabledstring | null
originalMessageOriginal content before translationstring
displayNameSender display namestring
authorAuthor detailsObject with id, email, name
variablesCustom variablesRecord<string, string>
resentWhether the message was resentboolean
isBotWhether the message originated from a botboolean
isDeletedWhether the message was deletedboolean

Event Emission

The chat-init-v1 event is emitted by the Agent Workspace MFE when a new chat interaction is opened, delivering the existing message history to the integrator.

Listeners

The event is consumed by third-party integrators that need to display or process the chat history when a new interaction is initialized.

Additional Information

Sample event payload:

{
"interactionId": "interaction-12345",
"messages": [
{
"id": "msg-abc123",
"timestamp": 1746522286592,
"type": "text",
"rawMessage": "Hi, I need help with my account",
"displayName": "Customer Name",
"author": {
"id": "customer-001",
"email": "customer@example.com",
"name": "Customer Name"
},
"isBot": false
}
],
"schemaVersion": "1.0.0"
}