Analyze emotions with full conversation context for more accurate detection and understanding of emotional progression.
This API analyzes emotions while considering the full conversation history, providing deeper insights into how emotions evolve and interact throughout a dialogue.
/v1/emotion/analyzeAnalyze emotions with full conversation context.
messagesarrayRequiredArray of conversation messages for context
userIdstringUser identifier for tracking emotional patterns
sessionIdstringSession identifier for conversation continuity
curl -X POST "https://api.kaiko.ai/v1/emotion/analyze" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": "I have been waiting for 2 hours",
"timestamp": "2024-01-15T10:00:00Z"
},
{
"role": "assistant",
"content": "I apologize for the wait. Let me check on that.",
"timestamp": "2024-01-15T10:01:00Z"
},
{
"role": "user",
"content": "This is completely unacceptable!",
"timestamp": "2024-01-15T10:15:00Z"
}
],
"userId": "user_123",
"sessionId": "session_456"
}'{
"analysis": {
"currentEmotion": {
"primary": "anger",
"intensity": 0.89,
"secondary": ["frustration", "disappointment"]
},
"emotionalProgression": [
{
"timestamp": "2024-01-15T10:00:00Z",
"emotion": "impatience",
"intensity": 0.65
},
{
"timestamp": "2024-01-15T10:15:00Z",
"emotion": "anger",
"intensity": 0.89
}
],
"triggers": [
"extended wait time",
"lack of resolution"
],
"recommendations": [
"Immediate escalation recommended",
"Offer concrete solution or compensation",
"Acknowledge frustration explicitly"
]
},
"sentiment": {
"score": -0.85,
"label": "very negative",
"trend": "worsening"
}
}