Configuration
Analysis Templates
Define reusable configurations for post-call analysis and reference them across multiple assistants.
Analysis templates let you define reusable configurations for post-call analysis. Instead of configuring analysis on each assistant, create templates and reference them across multiple assistants.
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
curl -X POST https://api.hmsovereign.com/api/v1/analysis-templates \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Customer Satisfaction Analysis",
"description": "Extract satisfaction metrics from support calls",
"schema": {
"type": "object",
"properties": {
"satisfaction_score": {
"type": "integer",
"minimum": 1,
"maximum": 10,
"description": "Overall customer satisfaction (1=very dissatisfied, 10=very satisfied)"
},
"issue_resolved": {
"type": "boolean",
"description": "Was the customer issue fully resolved?"
},
"sentiment": {
"type": "string",
"enum": ["positive", "neutral", "negative"]
},
"topics": {
"type": "array",
"items": { "type": "string" },
"description": "Main topics discussed"
},
"follow_up_needed": {
"type": "boolean"
}
}
},
"messages": [
{
"role": "system",
"content": "Analyze the customer support call transcript and extract structured data according to the schema. Be objective and base your analysis on the actual conversation content."
},
{
"role": "user",
"content": "Schema: {{schema}}\n\nTranscript:\n{{transcript}}\n\nCall ended because: {{ended_reason}}\n\nProvide your analysis as valid JSON."
}
],
"min_messages_threshold": 5
}'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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name |
description | string | No | Description of what this template analyzes |
schema | object | Yes | JSON Schema for output structure |
messages | array | Yes | Prompt messages with placeholders |
min_messages_threshold | integer | No | Minimum messages before running analysis (default: 2) |
Using Templates with Assistants
Reference a template when creating or updating an assistant:
curl -X PATCH https://api.hmsovereign.com/api/v1/assistants/ASSISTANT_ID \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"analysis_template_id": "template-uuid"
}'The template's configuration will be used for all calls handled by this assistant.
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: {{ended_reason}}"
}
]
}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
curl https://api.hmsovereign.com/api/v1/analysis-templates \
-H "Authorization: Bearer YOUR_API_KEY"Updating a Template
curl -X PATCH https://api.hmsovereign.com/api/v1/analysis-templates/TEMPLATE_ID \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"min_messages_threshold": 3
}'Deleting a Template
curl -X DELETE https://api.hmsovereign.com/api/v1/analysis-templates/TEMPLATE_ID \
-H "Authorization: Bearer YOUR_API_KEY"Warning: Deleting a template does not affect assistants using it. They will continue to use the configuration they had at the time of association.