Interaction
Overview
The Interaction message is the enhanced successor to the Customer Interaction message type, providing improved real-time processing and analysis of customer interactions across multiple communication channels. It offers advanced intelligent routing, enhanced context preservation, and sophisticated automated response generation to optimize customer engagement and support workflows.
This message type replaces the Customer Interaction message, which will be deprecated in future versions. We recommend migrating to the Interaction message for all new implementations to take advantage of improved features and ongoing support.
API Reference
Endpoint
- WebSocket URL:
wss://ws-{{tenant}}.oco.optave.{{tld}} - REST Endpoint (POST):
https://{{tenant}}.oco.optave.{{tld}}/message/interaction
To be able to send messages, it is necessary to authenticate first.
Request Payload
The interaction message requires a payload containing the conversation history (conversations), connections.threadId, and context.organizationId (your client-specific organization ID). The other fields are optional.
- REST
- WebSocket
{
session: {
sessionId: "a1b2c3d4-e5f6-7890-abcd-123456789012",
channel: { language: "en-US" },
interface: { type: "chat" }
},
request: {
requestId: "a1b2c3d4-e5f6-7890-1234-56789ab2345",
attributes: {
variant: "A"
},
connections: {
journeyId: "",
parentId: "",
threadId: "9e8d7c6b-5a49-3827-1605-948372615abc" // REQUIRED
},
context: { // generated by optave
caseId: "",
departmentId: "",
operatorId: "",
organizationId: "f7e8d9c0-b1a2-3456-7890-123456789abc", // REQUIRED
userId: ""
},
reference: {
ids: [
{ name: "ticket_id", value: "T12345" }
],
labels: [],
tags: []
},
resources: {
codes: [],
links: [],
offers: []
},
scope: {
conversations: [ // REQUIRED
{
conversationId: "",
participants: [
{
participantId: "2c4f8a9b-1d3e-5f70-8293-456789012def",
displayName: "John Doe",
role: "user"
},
{
participantId: "5b8c9d0e-2f4a-6b1c-9d8e-123456789abc",
displayName: "Sarah Smith",
role: "operator"
}
],
messages: [
{
content: "Hi, can you help me?",
participantId: "2c4f8a9b-1d3e-5f70-8293-456789012def",
timestamp: "2024-01-15T10:30:00.000Z"
},
{
content: "Hello! I'd be happy to assist you today. What can I help you with?",
participantId: "5b8c9d0e-2f4a-6b1c-9d8e-123456789abc",
timestamp: "2024-01-15T10:30:15.000Z"
}
],
metadata: {}
}
],
interactions: [
{
content: "Support ticket T12345 has been created for user John Doe",
id: "1",
name: "ticket_created",
role: "system",
timestamp: "2024-01-15T10:29:45.000Z"
}
]
}
}
}
{
headers: {
correlationId: "20e35101-61e8-46e0-926d-6af84b378d95",
tenantId: "6e3j5hdgemmjmoqih5u9b4mmqhrr",
traceId: "405101-61e8-46e0-926d-6af84b378d95",
idempotencyKey: "30e35101-61e8-46e0-926d-6af84b378d95",
identifier: "message",
action: "interaction",
schemaRef: "optave.message.v3",
sdkVersion: "3.2.1",
timestamp: "2025-09-05T16:30:00.000Z"
},
payload: {
session: {
sessionId: "a1b2c3d4-e5f6-7890-abcd-123456789012",
channel: { language: "en-US" },
interface: { type: "chat" }
},
request: {
requestId: "a1b2c3d4-e5f6-7890-1234-56789ab2345",
attributes: {
variant: "A"
},
connections: {
journeyId: "",
parentId: "",
threadId: "9e8d7c6b-5a49-3827-1605-948372615abc" // REQUIRED
},
context: { // generated by optave
caseId: "",
departmentId: "",
operatorId: "",
organizationId: "f7e8d9c0-b1a2-3456-7890-123456789abc", // REQUIRED
userId: ""
},
reference: {
ids: [
{ name: "ticket_id", value: "T12345" }
],
labels: [],
tags: []
},
resources: {
codes: [],
links: [],
offers: []
},
scope: {
conversations: [ // REQUIRED
{
conversationId: "",
participants: [
{
participantId: "2c4f8a9b-1d3e-5f70-8293-456789012def",
displayName: "John Doe",
role: "user"
},
{
participantId: "5b8c9d0e-2f4a-6b1c-9d8e-123456789abc",
displayName: "Sarah Smith",
role: "operator"
}
],
messages: [
{
content: "Hi, can you help me?",
participantId: "2c4f8a9b-1d3e-5f70-8293-456789012def",
timestamp: "2024-01-15T10:30:00.000Z"
},
{
content: "Hello! I'd be happy to assist you today. What can I help you with?",
participantId: "5b8c9d0e-2f4a-6b1c-9d8e-123456789abc",
timestamp: "2024-01-15T10:30:15.000Z"
}
],
metadata: {}
}
],
interactions: [
{
content: "Support ticket T12345 has been created for user John Doe",
id: "1",
name: "ticket_created",
role: "system",
timestamp: "2024-01-15T10:29:45.000Z"
}
]
}
}
},
action: "message"
}
Responses
🟢 Success (200-201)
When using the WebSocket, multiple superpowers and different state updates will be received, such as:
- Sentiment Analysis
- Risk Assessment (Media, Hacker, Financial)
- Escalation Need
- Language Identification
- Search Requirements
Each superpower will be sent as a separate message with its specific actionType and relevant results.
🔴 Error
Error messages are similar in format to success messages, but contain an error state and a "response" JSON object:
{
action: "superpower",
actionType: "<superpower-name>",
state: "error",
message: {
results: [
{
response: [
{
content: 'Error while fetching results'
}
]
}
]
}
}