Flireo AI
WebsiteLinkedin
WebsiteLinkedin
  1. Api's
  • 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. Api's

Analysis templates

Analysis Templates allow you to define reusable structured data extraction schemas for call analysis. Each template includes prompts and a JSON schema that defines what information should be extracted from call transcripts.
Analysis templates are saved as objects in agent configurations, not as references. This means agents continue working even if you delete a template.

Endpoints#

MethodEndpointDescription
GET/analysis-templatesList analysis templates
POST/analysis-templatesCreate analysis template
GET/analysis-templates/{id}Get analysis template
PATCH/analysis-templates/{id}Update analysis template
DELETE/analysis-templates/{id}Delete analysis template

List Analysis Templates#

Retrieve all analysis templates for your organization.
GET /analysis-templates

Request#

Response#

{
  "analysisTemplates": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "org_id": "7461b868-afc1-4fe2-871a-5e7c0f3d5772",
      "name": "Customer Satisfaction Survey",
      "description": "Extract customer satisfaction metrics and feedback",
      "system_prompt": "You are analyzing a customer service call. Extract key satisfaction indicators.",
      "user_prompt": "Analyze this call transcript and extract the required data.\n\nTranscript: {{transcript}}",
      "schema": {
        "type": "object",
        "properties": {
          "satisfaction_level": {
            "type": "string",
            "description": "Overall customer satisfaction",
            "enum": ["very_satisfied", "satisfied", "neutral", "dissatisfied", "very_dissatisfied"]
          },
          "main_issues": {
            "type": "array",
            "description": "List of issues discussed"
          },
          "issue_resolved": {
            "type": "boolean",
            "description": "Whether the customer's issue was resolved"
          }
        }
      },
      "created_at": "2024-01-15T10:00:00Z",
      "updated_at": "2024-01-15T10:00:00Z"
    }
  ]
}

Create Analysis Template#

Create a new analysis template.
POST /analysis-templates

Request Body#

FieldTypeRequiredDescription
namestringYesDisplay name for the template
descriptionstringNoDescription of what this template extracts
system_promptstringNoSystem instructions for the analysis AI
user_promptstringNoUser prompt with {{transcript}} placeholder
schemaobjectYesJSON Schema defining extracted data structure

Example Request#

Response (201 Created)#

{
  "analysisTemplate": {
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "org_id": "7461b868-afc1-4fe2-871a-5e7c0f3d5772",
    "name": "Lead Qualification",
    "description": "Qualify sales leads based on call content",
    ...
  }
}

Get Analysis Template#

Retrieve a specific analysis template by ID.
GET /analysis-templates/{id}

Parameters#

NameInTypeDescription
idpathUUIDAnalysis template UUID

Request#

Response#

{
  "analysisTemplate": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Customer Satisfaction Survey",
    ...
  }
}

Update Analysis Template#

Update an existing analysis template. Only provided fields will be updated.
PATCH /analysis-templates/{id}

Parameters#

NameInTypeDescription
idpathUUIDAnalysis template UUID

Request Body#

All fields are optional. Only include fields you want to update.

Example Request#

Response#

{
  "analysisTemplate": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Customer Satisfaction Survey v2",
    ...
  }
}

Delete Analysis Template#

Delete an analysis template.
DELETE /analysis-templates/{id}
Deleting a template does not affect agents that are using it. The analysis configuration is stored as an object in the agent, not as a reference.

Parameters#

NameInTypeDescription
idpathUUIDAnalysis template UUID

Request#

Response#

{
  "success": true
}

Using Analysis Templates with Agents#

Analysis templates define reusable configurations. When you select a template for an agent, the configuration is copied to the agent's analysis_plan field.

Agent Analysis Plan Structure#

{
  "analysis_plan": {
    "structuredDataPlan": {
      "enabled": true,
      "schema": {
        "type": "object",
        "properties": {
          "satisfaction_level": {
            "type": "string",
            "enum": ["very_satisfied", "satisfied", "neutral", "dissatisfied"]
          }
        }
      },
      "messages": [
        {
          "role": "system",
          "content": "You are analyzing a customer service call..."
        },
        {
          "role": "user",
          "content": "Analyze this call transcript...\n\nTranscript: {{transcript}}"
        }
      ]
    },
    "minMessagesThreshold": 3
  }
}
See the Call Analysis Guide for detailed usage instructions.

Schema Definition#

The schema field follows JSON Schema specification. Supported types:
TypeDescriptionExample
stringText values"type": "string"
integerWhole numbers"type": "integer", "minimum": 1, "maximum": 10
numberDecimal numbers"type": "number"
booleantrue/false"type": "boolean"
arrayLists"type": "array", "items": { "type": "string" }
objectNested objects"type": "object", "properties": {...}

Example: Complete Schema#

{
  "type": "object",
  "properties": {
    "sentiment": {
      "type": "string",
      "description": "Overall call sentiment",
      "enum": ["positive", "neutral", "negative"]
    },
    "satisfaction_score": {
      "type": "integer",
      "description": "Customer satisfaction 1-10",
      "minimum": 1,
      "maximum": 10
    },
    "issue_resolved": {
      "type": "boolean",
      "description": "Whether the issue was resolved"
    },
    "topics": {
      "type": "array",
      "description": "Topics discussed",
      "items": { "type": "string" }
    },
    "follow_up": {
      "type": "object",
      "description": "Follow-up action if needed",
      "properties": {
        "required": { "type": "boolean" },
        "reason": { "type": "string" }
      }
    }
  }
}

Prompt Placeholders#

User prompts support the following placeholders:
PlaceholderDescription
{{transcript}}Full call transcript
{{schema}}Your JSON Schema (auto-injected)
{{endedReason}}Why the call ended

Error Responses#

StatusDescription
400Invalid request (e.g., invalid schema format)
401Unauthorized (invalid or missing API key)
403Forbidden (no access to this resource)
404Analysis template not found
{
  "error": "Analysis template not found"
}
Modified at 2025-12-29 14:17:24
Previous
Domains
Next
Tool templates
Built with