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

Analysis templates

Analysis templates let you define reusable configurations for post-call analysis. Instead of configuring analysis on each agent, create templates and reference them across multiple agents.

What are Analysis Templates?#

An analysis template defines:
Schema - The structured data format to extract
Prompts - Instructions for the AI analyzer
Settings - Minimum messages threshold and other options

Creating an Analysis Template#

Response:
{
  "analysis_template": {
    "id": "template-uuid",
    "name": "Customer Satisfaction Analysis",
    "description": "Extract satisfaction metrics from support calls",
    "schema": { ... },
    "messages": [ ... ],
    "min_messages_threshold": 5,
    "created_at": "2025-12-13T10:00:00.000Z"
  }
}

Template Fields#

FieldTypeRequiredDescription
namestringYesDisplay name
descriptionstringNoDescription of what this template analyzes
schemaobjectYesJSON Schema for output structure
messagesarrayYesPrompt messages with placeholders
min_messages_thresholdintegerNoMinimum messages before running analysis (default: 2)

Using Templates with Agents#

Reference a template when creating or updating an agent:
The template's configuration will be used for all calls handled by this agent.

Template Examples#

Sales Lead Qualification#

{
  "name": "Sales Lead Qualification",
  "schema": {
    "type": "object",
    "properties": {
      "lead_quality": {
        "type": "string",
        "enum": ["hot", "warm", "cold"]
      },
      "budget_discussed": {
        "type": "boolean"
      },
      "timeline": {
        "type": "string",
        "description": "When does the prospect want to buy?"
      },
      "decision_maker": {
        "type": "boolean",
        "description": "Is the caller a decision maker?"
      },
      "products_interested": {
        "type": "array",
        "items": { "type": "string" }
      },
      "next_steps": {
        "type": "string"
      }
    }
  },
  "messages": [
    {
      "role": "system",
      "content": "Analyze this sales call and qualify the lead based on BANT criteria (Budget, Authority, Need, Timeline)."
    },
    {
      "role": "user",
      "content": "Schema: {{schema}}\n\nTranscript: {{transcript}}"
    }
  ]
}

Support Ticket Classification#

{
  "name": "Support Ticket Classification",
  "schema": {
    "type": "object",
    "properties": {
      "category": {
        "type": "string",
        "enum": ["billing", "technical", "account", "product", "general"]
      },
      "priority": {
        "type": "string",
        "enum": ["low", "medium", "high", "urgent"]
      },
      "resolution_status": {
        "type": "string",
        "enum": ["resolved", "escalated", "pending", "unresolved"]
      },
      "root_cause": {
        "type": "string"
      },
      "action_items": {
        "type": "array",
        "items": { "type": "string" }
      }
    }
  },
  "messages": [
    {
      "role": "system",
      "content": "Classify this support call for ticket creation. Identify the category, priority, and resolution status."
    },
    {
      "role": "user",
      "content": "Schema: {{schema}}\n\nTranscript: {{transcript}}\n\nCall ended: {{endedReason}}"
    }
  ]
}

Appointment Booking#

{
  "name": "Appointment Booking Analysis",
  "schema": {
    "type": "object",
    "properties": {
      "appointment_booked": {
        "type": "boolean"
      },
      "appointment_date": {
        "type": "string",
        "description": "Date in YYYY-MM-DD format if booked"
      },
      "appointment_time": {
        "type": "string",
        "description": "Time in HH:MM format if booked"
      },
      "service_type": {
        "type": "string"
      },
      "customer_name": {
        "type": "string"
      },
      "notes": {
        "type": "string"
      }
    }
  },
  "messages": [
    {
      "role": "system",
      "content": "Extract appointment booking details from this call. If no appointment was booked, set appointment_booked to false."
    },
    {
      "role": "user",
      "content": "Schema: {{schema}}\n\nTranscript: {{transcript}}"
    }
  ]
}

Listing Templates#

Updating a Template#

Deleting a Template#

Deleting a template does not affect agents using it. They will continue to use the configuration they had at the time of association.

Related#

Call Analysis Guide
Analysis Templates API
End of Call Report Webhook
Modified at 2025-12-31 12:06:20
Previous
xAI Realtime Integration
Next
Billing
Built with