Flireo AI
WebsiteLinkedin
WebsiteLinkedin
  1. Guides
  • API Reference
    • Agents
      • List all agents
      • Create a new agent
      • Get an agent
      • Update an agent
      • Delete an agent
    • Tool Templates
      • List all tool templates
      • Create a new tool template
      • Get a tool template
      • Update a tool template
      • Delete a tool template
    • Numbers
      • List all phone numbers
      • Register a phone number
      • Get a phone number
      • Update a phone number
      • Delete a phone number
    • Calls
      • List calls
      • Get call by ID
      • Initiate outbound call
    • Call Control
      • Send control command to active call
    • Usage
      • Get usage logs
    • SIP Trunks
      • List SIP trunks
      • Create a SIP trunk
      • Get a SIP trunk
      • Delete a SIP trunk
    • Voices
      • List available voices
    • BYOK
      • Get BYOK configurations
      • Add BYOK configuration
      • Delete BYOK configuration
      • Get BYOK provider configurations
    • Domains
      • Get your domain
      • Add a domain
      • Delete your domain
      • List available Resend domains
      • Select and sync a Resend domain
      • Verify domain DNS records
      • Refresh domain status
    • Webhooks
      • Dynamic assistant configuration webhook
      • Tool/Function Call
      • Call Status Update
      • End of Call Report
    • Analysis Templates
      • List analysis templates
      • Create analysis template
      • Get analysis template
      • Update analysis template
      • Delete analysis template
    • Organization
      • Get organization information
    • Campaigns
      • List all campaigns
      • Create a campaign
      • Get a campaign
      • Update a campaign
      • Delete a campaign
      • List campaign leads
      • Add a lead
      • Remove a lead
  • Documentation
    • Get started
      • Quickstart
      • Introduction
      • Authentication
    • Core concepts
      • Agents
      • Phone numbers
      • Calls
      • Webhooks
    • Api's
      • Organization
      • Agents
      • Phone numbers
      • Sip trunks
      • Calls
      • Call control
      • Usage
      • Voices
      • BYOK
      • Domains
      • Analysis templates
      • Tool templates
    • Webhooks
      • Overview
      • Assistant request
      • Tool calls
      • Status update
      • End of call report
      • Security
    • Guides
      • BYOK Setup
      • Call analysis
      • Custom Tools
      • Call Transfers
      • xAI Realtime Integration
      • Analysis templates
      • Billing
      • Error codes
      • Rate limits
      • Sip Trunks
      • Tool templates
      • Troubleshooting
WebsiteLinkedin
WebsiteLinkedin
  1. Guides

Call analysis

Call analysis extracts structured data from call transcripts using AI. Use it to automatically capture customer sentiment, intents, outcomes, and any other data you need.

How It Works#

1.
Configure an analysis_plan on your agent
2.
After each call, the transcript is analyzed
3.
Structured data matching your schema is extracted
4.
Results are included in the end-of-call report webhook

Basic Configuration#

Add an analysis plan to your agent:

Schema Design#

Define the exact data you want to extract using JSON Schema:
{
  "type": "object",
  "properties": {
    "sentiment": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10,
      "description": "Overall customer sentiment (1=very negative, 10=very positive)"
    },
    "primary_intent": {
      "type": "string",
      "enum": ["support", "sales", "complaint", "inquiry", "appointment", "other"],
      "description": "Main reason for the call"
    },
    "topics_discussed": {
      "type": "array",
      "items": { "type": "string" },
      "description": "List of main topics covered in the conversation"
    },
    "action_items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "task": { "type": "string" },
          "assigned_to": { "type": "string", "enum": ["agent", "customer", "other"] }
        }
      }
    },
    "customer_satisfied": {
      "type": "boolean"
    },
    "follow_up_needed": {
      "type": "boolean"
    },
    "summary": {
      "type": "string",
      "description": "Brief summary of the call outcome"
    }
  }
}

Prompt Templates#

The messages array defines how the transcript is analyzed. Use placeholders:
PlaceholderDescription
{{schema}}Your JSON Schema (auto-injected)
{{transcript}}Full call transcript
{{endedReason}}Why the call ended

Example Prompts#

Basic analysis:
{
  "messages": [
    {
      "role": "system",
      "content": "You are a call analyst. Extract structured data from the call transcript according to the provided schema. Return valid JSON only."
    },
    {
      "role": "user",
      "content": "Schema: {{schema}}\n\nCall transcript:\n{{transcript}}\n\nThe call ended because: {{endedReason}}"
    }
  ]
}
Detailed analysis with instructions:
{
  "messages": [
    {
      "role": "system",
      "content": "Analyze customer service calls and extract data according to the schema. Guidelines:\n- Sentiment: 1-3 negative, 4-6 neutral, 7-10 positive\n- Only mark resolved=true if the issue was fully addressed\n- Include all mentioned topics, not just the main one"
    },
    {
      "role": "user",
      "content": "Schema:\n{{schema}}\n\nTranscript:\n{{transcript}}\n\nCall ended: {{endedReason}}\n\nProvide your analysis as JSON."
    }
  ]
}

Minimum Messages Threshold#

Set minMessagesThreshold to skip analysis for very short calls:
{
  "minMessagesThreshold": 5
}
Default: 2 messages
Set higher for meaningful analysis
Analysis is skipped if threshold not met

Receiving Analysis Results#

Analysis results are included in the end-of-call report webhook:
{
  "message": {
    "type": "end-of-call-report",
    "durationSeconds": 84,
    "summary": "Klant vroeg naar openingstijden...",
    "analysis": {
      "sentiment": 8,
      "primary_intent": "inquiry",
      "topics_discussed": ["openingstijden", "locatie", "parkeren"],
      "customer_satisfied": true,
      "follow_up_needed": false,
      "summary": "Klant kreeg alle gevraagde informatie."
    }
  }
}

Use Cases#

Customer Satisfaction Tracking#

{
  "schema": {
    "type": "object",
    "properties": {
      "csat_score": { "type": "integer", "minimum": 1, "maximum": 5 },
      "would_recommend": { "type": "boolean" },
      "pain_points": { "type": "array", "items": { "type": "string" } }
    }
  }
}

Sales Lead Qualification#

{
  "schema": {
    "type": "object",
    "properties": {
      "lead_quality": { "type": "string", "enum": ["hot", "warm", "cold"] },
      "budget_mentioned": { "type": "boolean" },
      "timeline": { "type": "string" },
      "decision_maker": { "type": "boolean" },
      "products_interested": { "type": "array", "items": { "type": "string" } }
    }
  }
}

Support Ticket Classification#

{
  "schema": {
    "type": "object",
    "properties": {
      "category": { "type": "string", "enum": ["billing", "technical", "account", "product", "other"] },
      "priority": { "type": "string", "enum": ["low", "medium", "high", "urgent"] },
      "resolution_status": { "type": "string", "enum": ["resolved", "escalated", "pending", "unresolved"] },
      "root_cause": { "type": "string" }
    }
  }
}

Best Practices#

1.
Keep schemas focused - Extract only what you'll actually use
2.
Use enums - Predefined values make data more consistent
3.
Add descriptions - Help the AI understand what you want
4.
Test prompts - Refine your prompts based on actual results
5.
Set appropriate thresholds - Skip analysis for calls too short to be meaningful
See AnalysisPlan Schema and End of Call Report Webhook for complete details.
Modified at 2025-12-29 14:24:06
Previous
BYOK Setup
Next
Custom Tools
Built with