curl --request PATCH \
--url https://{subdomain}.mihu.ai/api/v1/agents/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "Volvo Cagliari Service Agent",
"description": "Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.",
"company_name": "Volvo Cagliari",
"role": "Inbound service appointment scheduler for a Volvo dealership in Cagliari.",
"objective": "Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service.",
"tone": "Warm, professional, slightly formal. Use the customer's name. Avoid jargon — explain technical terms in plain language.",
"behavior_guidelines": "Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.",
"company_service": "Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.",
"topic": "Service appointment booking and vehicle maintenance questions.",
"length_detail": "Keep replies under 25 words for voice; under 200 characters for text. One question at a time.",
"interest_of_product": "<string>",
"negative_response": "If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.",
"custom_prompt": "<string>",
"language": "en",
"timezone": "America/New_York",
"appointment_scheduling_enabled": true,
"appointment_scheduling_randomly": true,
"custom_llm_url": "<string>",
"settings": {
"voice": {
"interaction": {
"customer_speak_first": false,
"inbound_first_message": "Hi, this is Sara from Volvo. How can I help you today?",
"outbound_first_message": "Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?",
"voice_mail_message": "Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.",
"end_call_message": "Thank you for calling, have a great day!",
"silence_message": "Are you still there? I want to make sure I'm helping you with what you need.",
"max_silence_prompts": 3
},
"interruption": {
"mode": "balanced"
},
"voice_profile": {
"language": "en",
"voice_uuid": "ebeba3e0-89b5-4c94-9841-9555ab155dbc",
"voice_name": "Giulia"
},
"call_behavior": {
"audio_recording": true,
"background_sound": true,
"silence_timeout_seconds": 60,
"max_call_duration_seconds": 1800,
"max_call_duration_message": "Thanks for the call — we've reached the time limit. Goodbye!"
},
"compliance": {
"eu_gdpr_compliance": true,
"hipaa_compliance": false
},
"normalizers": {
"outbound": {},
"inbound": {}
}
},
"text": {
"daily_limits": {
"daily_max_messages_per_conversation": 100,
"daily_conversation_limit_exceeded_message": "<string>"
},
"timing_and_delay": {
"base_delay": 0.5,
"pause_before_reply": 1,
"typing_speed_wpm_min": 40,
"typing_speed_wpm_max": 60,
"typing_speed_char": 0.05,
"delay_jitter_min": 0.1,
"delay_jitter_max": 1.5
},
"typing_simulation": {
"show_typing_indicator": true,
"simulate_typing_breaks": true,
"simulate_typos_corrections": false
},
"working_hours": {
"enabled": false,
"start": "9 AM",
"end": "5 PM",
"timezone": "America/New_York",
"outside_hours_behavior": "Auto-reply",
"offline_message": "<string>",
"during_hours_agent": "ai"
},
"handover": {
"enabled": false,
"handover_triggers": "User request",
"handover_method": "Assign agent",
"handover_message": "<string>",
"assignment_strategy": "First available",
"handover_timeout": 60,
"fallback_agent": "Bot assistant",
"release_after_minutes": 0,
"release_channels": [
"whatsapp",
"instagram"
]
},
"confidence_controls": {
"min_confidence_threshold": 0.7,
"ask_clarifying_questions": false
},
"message_behavior": {
"second_message_behavior": {
"enabled": false,
"chance": 0.25,
"delay_min": 1,
"delay_max": 4
},
"follow_up_behavior": {
"enabled": false,
"delay_min": 24,
"delay_max": 48
}
},
"personality": {
"use_response_variations": true,
"emoji_usage": "None",
"use_punctuation_variation": false,
"use_filler_words": false,
"enable_small_talk": false,
"energy_level": "Friendly",
"empathy_level": "Medium"
},
"advanced": {
"split_messages": true,
"simulate_message_editing": false,
"use_memory_based_context": false,
"human_first_mode": false
},
"email": {
"signature": "<p>—<br>Jane, Acme Support</p>"
}
}
},
"guidelines": [
{
"content": "Always confirm vehicle VIN or license plate before creating a service appointment.",
"order": 0
}
],
"notes": [
{
"content": "Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.",
"order": 0
}
],
"procedures": [
{
"name": "Book service appointment",
"description": "Used when the customer wants to schedule a service appointment for their vehicle.",
"steps": [
{
"order": 1,
"description": "Ask the customer for their vehicle license plate or VIN.",
"intent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
],
"training": [
{
"content": "What does Volvo's standard warranty cover?",
"intent": "warranty_inquiry",
"response": "Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?"
}
],
"appointments": {
"enabled": true,
"random_assignment": true,
"schedule_assignments": [
{
"schedule_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Service Appointment",
"description": "When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.",
"slot_rules": {
"offer_slots_from": "3_hours",
"book_slots_from": "6_hours",
"max_appointments_per_day": 10,
"conflict_resolution_enabled": true,
"alternative_slots_count": 3,
"suggestion_priority": "nearest",
"prefer_same_day": true,
"prefer_same_time_slot": false,
"include_same_week": true
},
"rescheduling": {
"policy": "always_ask",
"minor_change_hours": 2,
"minor_change_same_day": true,
"minor_change_same_week": false,
"minor_change_same_slot": false,
"min_rescheduling_notice": "2_hours"
},
"cancellation": {
"min_cancellation_notice": "24_hours",
"ai_can_cancel": false,
"require_cancellation_reason": true,
"cancellation_fee_policy": "no_fee"
},
"questions": {
"inherit_from_schedule": true,
"custom_questions": [
{
"name": "License plate",
"type": "text",
"description": "Vehicle license plate number for the service appointment.",
"required": true
}
]
},
"approval": {
"require_approval": true,
"approval_threshold": "1_hour",
"approval_for_create": false,
"approval_for_reschedule": true,
"approval_for_cancel": true,
"approval_for_notes": false,
"notify_calendar_owner": "always",
"notify_admins": "always",
"expected_response_time": "5_min"
}
}
]
},
"routing_rules": [
{
"detection_mode": "intent",
"trigger_keyword": "sales",
"department_name": "Sales Department",
"phrases": [
"I want to talk to sales"
],
"ai_prompt": "Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.",
"voice_response": "Sure, I'll transfer you to our sales team now. One moment please.",
"voice_on_error": "I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.",
"voice_on_success": "You've been successfully connected. Have a great day.",
"destination_type": "extension",
"destination": "101",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transfer_type": "transfer_call",
"transfer_config": {},
"priority": 1,
"is_active": true
}
],
"guard_rules": [
{
"name": "Legal complaint escalation",
"when_condition": "Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.",
"example_phrases": [
"I'm calling my lawyer about this"
],
"then_action": "forward",
"selected_channels": [],
"say_before_forwarding": "I understand this is important — let me connect you with someone who can help.",
"say_before_end": "I'm sorry I couldn't help further. Please contact our team directly. Goodbye.",
"destination": "<string>",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"is_default": false
}
]
}
EOFimport requests
url = "https://{subdomain}.mihu.ai/api/v1/agents/{uuid}"
payload = {
"name": "Volvo Cagliari Service Agent",
"description": "Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.",
"company_name": "Volvo Cagliari",
"role": "Inbound service appointment scheduler for a Volvo dealership in Cagliari.",
"objective": "Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service.",
"tone": "Warm, professional, slightly formal. Use the customer's name. Avoid jargon — explain technical terms in plain language.",
"behavior_guidelines": "Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.",
"company_service": "Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.",
"topic": "Service appointment booking and vehicle maintenance questions.",
"length_detail": "Keep replies under 25 words for voice; under 200 characters for text. One question at a time.",
"interest_of_product": "<string>",
"negative_response": "If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.",
"custom_prompt": "<string>",
"language": "en",
"timezone": "America/New_York",
"appointment_scheduling_enabled": True,
"appointment_scheduling_randomly": True,
"custom_llm_url": "<string>",
"settings": {
"voice": {
"interaction": {
"customer_speak_first": False,
"inbound_first_message": "Hi, this is Sara from Volvo. How can I help you today?",
"outbound_first_message": "Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?",
"voice_mail_message": "Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.",
"end_call_message": "Thank you for calling, have a great day!",
"silence_message": "Are you still there? I want to make sure I'm helping you with what you need.",
"max_silence_prompts": 3
},
"interruption": { "mode": "balanced" },
"voice_profile": {
"language": "en",
"voice_uuid": "ebeba3e0-89b5-4c94-9841-9555ab155dbc",
"voice_name": "Giulia"
},
"call_behavior": {
"audio_recording": True,
"background_sound": True,
"silence_timeout_seconds": 60,
"max_call_duration_seconds": 1800,
"max_call_duration_message": "Thanks for the call — we've reached the time limit. Goodbye!"
},
"compliance": {
"eu_gdpr_compliance": True,
"hipaa_compliance": False
},
"normalizers": {
"outbound": {},
"inbound": {}
}
},
"text": {
"daily_limits": {
"daily_max_messages_per_conversation": 100,
"daily_conversation_limit_exceeded_message": "<string>"
},
"timing_and_delay": {
"base_delay": 0.5,
"pause_before_reply": 1,
"typing_speed_wpm_min": 40,
"typing_speed_wpm_max": 60,
"typing_speed_char": 0.05,
"delay_jitter_min": 0.1,
"delay_jitter_max": 1.5
},
"typing_simulation": {
"show_typing_indicator": True,
"simulate_typing_breaks": True,
"simulate_typos_corrections": False
},
"working_hours": {
"enabled": False,
"start": "9 AM",
"end": "5 PM",
"timezone": "America/New_York",
"outside_hours_behavior": "Auto-reply",
"offline_message": "<string>",
"during_hours_agent": "ai"
},
"handover": {
"enabled": False,
"handover_triggers": "User request",
"handover_method": "Assign agent",
"handover_message": "<string>",
"assignment_strategy": "First available",
"handover_timeout": 60,
"fallback_agent": "Bot assistant",
"release_after_minutes": 0,
"release_channels": ["whatsapp", "instagram"]
},
"confidence_controls": {
"min_confidence_threshold": 0.7,
"ask_clarifying_questions": False
},
"message_behavior": {
"second_message_behavior": {
"enabled": False,
"chance": 0.25,
"delay_min": 1,
"delay_max": 4
},
"follow_up_behavior": {
"enabled": False,
"delay_min": 24,
"delay_max": 48
}
},
"personality": {
"use_response_variations": True,
"emoji_usage": "None",
"use_punctuation_variation": False,
"use_filler_words": False,
"enable_small_talk": False,
"energy_level": "Friendly",
"empathy_level": "Medium"
},
"advanced": {
"split_messages": True,
"simulate_message_editing": False,
"use_memory_based_context": False,
"human_first_mode": False
},
"email": { "signature": "<p>—<br>Jane, Acme Support</p>" }
}
},
"guidelines": [
{
"content": "Always confirm vehicle VIN or license plate before creating a service appointment.",
"order": 0
}
],
"notes": [
{
"content": "Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.",
"order": 0
}
],
"procedures": [
{
"name": "Book service appointment",
"description": "Used when the customer wants to schedule a service appointment for their vehicle.",
"steps": [
{
"order": 1,
"description": "Ask the customer for their vehicle license plate or VIN.",
"intent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
],
"training": [
{
"content": "What does Volvo's standard warranty cover?",
"intent": "warranty_inquiry",
"response": "Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?"
}
],
"appointments": {
"enabled": True,
"random_assignment": True,
"schedule_assignments": [
{
"schedule_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Service Appointment",
"description": "When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.",
"slot_rules": {
"offer_slots_from": "3_hours",
"book_slots_from": "6_hours",
"max_appointments_per_day": 10,
"conflict_resolution_enabled": True,
"alternative_slots_count": 3,
"suggestion_priority": "nearest",
"prefer_same_day": True,
"prefer_same_time_slot": False,
"include_same_week": True
},
"rescheduling": {
"policy": "always_ask",
"minor_change_hours": 2,
"minor_change_same_day": True,
"minor_change_same_week": False,
"minor_change_same_slot": False,
"min_rescheduling_notice": "2_hours"
},
"cancellation": {
"min_cancellation_notice": "24_hours",
"ai_can_cancel": False,
"require_cancellation_reason": True,
"cancellation_fee_policy": "no_fee"
},
"questions": {
"inherit_from_schedule": True,
"custom_questions": [
{
"name": "License plate",
"type": "text",
"description": "Vehicle license plate number for the service appointment.",
"required": True
}
]
},
"approval": {
"require_approval": True,
"approval_threshold": "1_hour",
"approval_for_create": False,
"approval_for_reschedule": True,
"approval_for_cancel": True,
"approval_for_notes": False,
"notify_calendar_owner": "always",
"notify_admins": "always",
"expected_response_time": "5_min"
}
}
]
},
"routing_rules": [
{
"detection_mode": "intent",
"trigger_keyword": "sales",
"department_name": "Sales Department",
"phrases": ["I want to talk to sales"],
"ai_prompt": "Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.",
"voice_response": "Sure, I'll transfer you to our sales team now. One moment please.",
"voice_on_error": "I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.",
"voice_on_success": "You've been successfully connected. Have a great day.",
"destination_type": "extension",
"destination": "101",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transfer_type": "transfer_call",
"transfer_config": {},
"priority": 1,
"is_active": True
}
],
"guard_rules": [
{
"name": "Legal complaint escalation",
"when_condition": "Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.",
"example_phrases": ["I'm calling my lawyer about this"],
"then_action": "forward",
"selected_channels": [],
"say_before_forwarding": "I understand this is important — let me connect you with someone who can help.",
"say_before_end": "I'm sorry I couldn't help further. Please contact our team directly. Goodbye.",
"destination": "<string>",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": True,
"is_default": False
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Volvo Cagliari Service Agent',
description: 'Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.',
company_name: 'Volvo Cagliari',
role: 'Inbound service appointment scheduler for a Volvo dealership in Cagliari.',
objective: 'Book a service appointment for the customer\'s vehicle. Capture: VIN or license plate, preferred date, type of service.',
tone: 'Warm, professional, slightly formal. Use the customer\'s name. Avoid jargon — explain technical terms in plain language.',
behavior_guidelines: 'Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.',
company_service: 'Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.',
topic: 'Service appointment booking and vehicle maintenance questions.',
length_detail: 'Keep replies under 25 words for voice; under 200 characters for text. One question at a time.',
interest_of_product: '<string>',
negative_response: 'If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.',
custom_prompt: '<string>',
language: 'en',
timezone: 'America/New_York',
appointment_scheduling_enabled: true,
appointment_scheduling_randomly: true,
custom_llm_url: '<string>',
settings: {
voice: {
interaction: {
customer_speak_first: false,
inbound_first_message: 'Hi, this is Sara from Volvo. How can I help you today?',
outbound_first_message: 'Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?',
voice_mail_message: 'Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.',
end_call_message: 'Thank you for calling, have a great day!',
silence_message: 'Are you still there? I want to make sure I\'m helping you with what you need.',
max_silence_prompts: 3
},
interruption: {mode: 'balanced'},
voice_profile: {
language: 'en',
voice_uuid: 'ebeba3e0-89b5-4c94-9841-9555ab155dbc',
voice_name: 'Giulia'
},
call_behavior: {
audio_recording: true,
background_sound: true,
silence_timeout_seconds: 60,
max_call_duration_seconds: 1800,
max_call_duration_message: 'Thanks for the call — we\'ve reached the time limit. Goodbye!'
},
compliance: {eu_gdpr_compliance: true, hipaa_compliance: false},
normalizers: {outbound: {}, inbound: {}}
},
text: {
daily_limits: {
daily_max_messages_per_conversation: 100,
daily_conversation_limit_exceeded_message: '<string>'
},
timing_and_delay: {
base_delay: 0.5,
pause_before_reply: 1,
typing_speed_wpm_min: 40,
typing_speed_wpm_max: 60,
typing_speed_char: 0.05,
delay_jitter_min: 0.1,
delay_jitter_max: 1.5
},
typing_simulation: {
show_typing_indicator: true,
simulate_typing_breaks: true,
simulate_typos_corrections: false
},
working_hours: {
enabled: false,
start: '9 AM',
end: '5 PM',
timezone: 'America/New_York',
outside_hours_behavior: 'Auto-reply',
offline_message: '<string>',
during_hours_agent: 'ai'
},
handover: {
enabled: false,
handover_triggers: 'User request',
handover_method: 'Assign agent',
handover_message: '<string>',
assignment_strategy: 'First available',
handover_timeout: 60,
fallback_agent: 'Bot assistant',
release_after_minutes: 0,
release_channels: ['whatsapp', 'instagram']
},
confidence_controls: {min_confidence_threshold: 0.7, ask_clarifying_questions: false},
message_behavior: {
second_message_behavior: {enabled: false, chance: 0.25, delay_min: 1, delay_max: 4},
follow_up_behavior: {enabled: false, delay_min: 24, delay_max: 48}
},
personality: {
use_response_variations: true,
emoji_usage: 'None',
use_punctuation_variation: false,
use_filler_words: false,
enable_small_talk: false,
energy_level: 'Friendly',
empathy_level: 'Medium'
},
advanced: {
split_messages: true,
simulate_message_editing: false,
use_memory_based_context: false,
human_first_mode: false
},
email: {signature: '<p>—<br>Jane, Acme Support</p>'}
}
},
guidelines: [
{
content: 'Always confirm vehicle VIN or license plate before creating a service appointment.',
order: 0
}
],
notes: [
{
content: 'Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.',
order: 0
}
],
procedures: [
{
name: 'Book service appointment',
description: 'Used when the customer wants to schedule a service appointment for their vehicle.',
steps: [
{
order: 1,
description: 'Ask the customer for their vehicle license plate or VIN.',
intent_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
]
}
],
training: [
{
content: 'What does Volvo\'s standard warranty cover?',
intent: 'warranty_inquiry',
response: 'Volvo\'s standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?'
}
],
appointments: {
enabled: true,
random_assignment: true,
schedule_assignments: [
{
schedule_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: 'Service Appointment',
description: 'When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.',
slot_rules: {
offer_slots_from: '3_hours',
book_slots_from: '6_hours',
max_appointments_per_day: 10,
conflict_resolution_enabled: true,
alternative_slots_count: 3,
suggestion_priority: 'nearest',
prefer_same_day: true,
prefer_same_time_slot: false,
include_same_week: true
},
rescheduling: {
policy: 'always_ask',
minor_change_hours: 2,
minor_change_same_day: true,
minor_change_same_week: false,
minor_change_same_slot: false,
min_rescheduling_notice: '2_hours'
},
cancellation: {
min_cancellation_notice: '24_hours',
ai_can_cancel: false,
require_cancellation_reason: true,
cancellation_fee_policy: 'no_fee'
},
questions: {
inherit_from_schedule: true,
custom_questions: [
{
name: 'License plate',
type: 'text',
description: 'Vehicle license plate number for the service appointment.',
required: true
}
]
},
approval: {
require_approval: true,
approval_threshold: '1_hour',
approval_for_create: false,
approval_for_reschedule: true,
approval_for_cancel: true,
approval_for_notes: false,
notify_calendar_owner: 'always',
notify_admins: 'always',
expected_response_time: '5_min'
}
}
]
},
routing_rules: [
{
detection_mode: 'intent',
trigger_keyword: 'sales',
department_name: 'Sales Department',
phrases: ['I want to talk to sales'],
ai_prompt: 'Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.',
voice_response: 'Sure, I\'ll transfer you to our sales team now. One moment please.',
voice_on_error: 'I\'m sorry, I couldn\'t reach sales right now. Please call back later or leave a message.',
voice_on_success: 'You\'ve been successfully connected. Have a great day.',
destination_type: 'extension',
destination: '101',
destination_agent_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
transfer_type: 'transfer_call',
transfer_config: {},
priority: 1,
is_active: true
}
],
guard_rules: [
{
name: 'Legal complaint escalation',
when_condition: 'Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.',
example_phrases: ['I\'m calling my lawyer about this'],
then_action: 'forward',
selected_channels: [],
say_before_forwarding: 'I understand this is important — let me connect you with someone who can help.',
say_before_end: 'I\'m sorry I couldn\'t help further. Please contact our team directly. Goodbye.',
destination: '<string>',
destination_agent_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
is_active: true,
is_default: false
}
]
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/agents/{uuid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.mihu.ai/api/v1/agents/{uuid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Volvo Cagliari Service Agent',
'description' => 'Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.',
'company_name' => 'Volvo Cagliari',
'role' => 'Inbound service appointment scheduler for a Volvo dealership in Cagliari.',
'objective' => 'Book a service appointment for the customer\'s vehicle. Capture: VIN or license plate, preferred date, type of service.',
'tone' => 'Warm, professional, slightly formal. Use the customer\'s name. Avoid jargon — explain technical terms in plain language.',
'behavior_guidelines' => 'Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.',
'company_service' => 'Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.',
'topic' => 'Service appointment booking and vehicle maintenance questions.',
'length_detail' => 'Keep replies under 25 words for voice; under 200 characters for text. One question at a time.',
'interest_of_product' => '<string>',
'negative_response' => 'If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.',
'custom_prompt' => '<string>',
'language' => 'en',
'timezone' => 'America/New_York',
'appointment_scheduling_enabled' => true,
'appointment_scheduling_randomly' => true,
'custom_llm_url' => '<string>',
'settings' => [
'voice' => [
'interaction' => [
'customer_speak_first' => false,
'inbound_first_message' => 'Hi, this is Sara from Volvo. How can I help you today?',
'outbound_first_message' => 'Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?',
'voice_mail_message' => 'Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.',
'end_call_message' => 'Thank you for calling, have a great day!',
'silence_message' => 'Are you still there? I want to make sure I\'m helping you with what you need.',
'max_silence_prompts' => 3
],
'interruption' => [
'mode' => 'balanced'
],
'voice_profile' => [
'language' => 'en',
'voice_uuid' => 'ebeba3e0-89b5-4c94-9841-9555ab155dbc',
'voice_name' => 'Giulia'
],
'call_behavior' => [
'audio_recording' => true,
'background_sound' => true,
'silence_timeout_seconds' => 60,
'max_call_duration_seconds' => 1800,
'max_call_duration_message' => 'Thanks for the call — we\'ve reached the time limit. Goodbye!'
],
'compliance' => [
'eu_gdpr_compliance' => true,
'hipaa_compliance' => false
],
'normalizers' => [
'outbound' => [
],
'inbound' => [
]
]
],
'text' => [
'daily_limits' => [
'daily_max_messages_per_conversation' => 100,
'daily_conversation_limit_exceeded_message' => '<string>'
],
'timing_and_delay' => [
'base_delay' => 0.5,
'pause_before_reply' => 1,
'typing_speed_wpm_min' => 40,
'typing_speed_wpm_max' => 60,
'typing_speed_char' => 0.05,
'delay_jitter_min' => 0.1,
'delay_jitter_max' => 1.5
],
'typing_simulation' => [
'show_typing_indicator' => true,
'simulate_typing_breaks' => true,
'simulate_typos_corrections' => false
],
'working_hours' => [
'enabled' => false,
'start' => '9 AM',
'end' => '5 PM',
'timezone' => 'America/New_York',
'outside_hours_behavior' => 'Auto-reply',
'offline_message' => '<string>',
'during_hours_agent' => 'ai'
],
'handover' => [
'enabled' => false,
'handover_triggers' => 'User request',
'handover_method' => 'Assign agent',
'handover_message' => '<string>',
'assignment_strategy' => 'First available',
'handover_timeout' => 60,
'fallback_agent' => 'Bot assistant',
'release_after_minutes' => 0,
'release_channels' => [
'whatsapp',
'instagram'
]
],
'confidence_controls' => [
'min_confidence_threshold' => 0.7,
'ask_clarifying_questions' => false
],
'message_behavior' => [
'second_message_behavior' => [
'enabled' => false,
'chance' => 0.25,
'delay_min' => 1,
'delay_max' => 4
],
'follow_up_behavior' => [
'enabled' => false,
'delay_min' => 24,
'delay_max' => 48
]
],
'personality' => [
'use_response_variations' => true,
'emoji_usage' => 'None',
'use_punctuation_variation' => false,
'use_filler_words' => false,
'enable_small_talk' => false,
'energy_level' => 'Friendly',
'empathy_level' => 'Medium'
],
'advanced' => [
'split_messages' => true,
'simulate_message_editing' => false,
'use_memory_based_context' => false,
'human_first_mode' => false
],
'email' => [
'signature' => '<p>—<br>Jane, Acme Support</p>'
]
]
],
'guidelines' => [
[
'content' => 'Always confirm vehicle VIN or license plate before creating a service appointment.',
'order' => 0
]
],
'notes' => [
[
'content' => 'Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.',
'order' => 0
]
],
'procedures' => [
[
'name' => 'Book service appointment',
'description' => 'Used when the customer wants to schedule a service appointment for their vehicle.',
'steps' => [
[
'order' => 1,
'description' => 'Ask the customer for their vehicle license plate or VIN.',
'intent_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]
],
'training' => [
[
'content' => 'What does Volvo\'s standard warranty cover?',
'intent' => 'warranty_inquiry',
'response' => 'Volvo\'s standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?'
]
],
'appointments' => [
'enabled' => true,
'random_assignment' => true,
'schedule_assignments' => [
[
'schedule_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => 'Service Appointment',
'description' => 'When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.',
'slot_rules' => [
'offer_slots_from' => '3_hours',
'book_slots_from' => '6_hours',
'max_appointments_per_day' => 10,
'conflict_resolution_enabled' => true,
'alternative_slots_count' => 3,
'suggestion_priority' => 'nearest',
'prefer_same_day' => true,
'prefer_same_time_slot' => false,
'include_same_week' => true
],
'rescheduling' => [
'policy' => 'always_ask',
'minor_change_hours' => 2,
'minor_change_same_day' => true,
'minor_change_same_week' => false,
'minor_change_same_slot' => false,
'min_rescheduling_notice' => '2_hours'
],
'cancellation' => [
'min_cancellation_notice' => '24_hours',
'ai_can_cancel' => false,
'require_cancellation_reason' => true,
'cancellation_fee_policy' => 'no_fee'
],
'questions' => [
'inherit_from_schedule' => true,
'custom_questions' => [
[
'name' => 'License plate',
'type' => 'text',
'description' => 'Vehicle license plate number for the service appointment.',
'required' => true
]
]
],
'approval' => [
'require_approval' => true,
'approval_threshold' => '1_hour',
'approval_for_create' => false,
'approval_for_reschedule' => true,
'approval_for_cancel' => true,
'approval_for_notes' => false,
'notify_calendar_owner' => 'always',
'notify_admins' => 'always',
'expected_response_time' => '5_min'
]
]
]
],
'routing_rules' => [
[
'detection_mode' => 'intent',
'trigger_keyword' => 'sales',
'department_name' => 'Sales Department',
'phrases' => [
'I want to talk to sales'
],
'ai_prompt' => 'Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.',
'voice_response' => 'Sure, I\'ll transfer you to our sales team now. One moment please.',
'voice_on_error' => 'I\'m sorry, I couldn\'t reach sales right now. Please call back later or leave a message.',
'voice_on_success' => 'You\'ve been successfully connected. Have a great day.',
'destination_type' => 'extension',
'destination' => '101',
'destination_agent_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'transfer_type' => 'transfer_call',
'transfer_config' => [
],
'priority' => 1,
'is_active' => true
]
],
'guard_rules' => [
[
'name' => 'Legal complaint escalation',
'when_condition' => 'Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.',
'example_phrases' => [
'I\'m calling my lawyer about this'
],
'then_action' => 'forward',
'selected_channels' => [
],
'say_before_forwarding' => 'I understand this is important — let me connect you with someone who can help.',
'say_before_end' => 'I\'m sorry I couldn\'t help further. Please contact our team directly. Goodbye.',
'destination' => '<string>',
'destination_agent_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'is_active' => true,
'is_default' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.mihu.ai/api/v1/agents/{uuid}"
payload := strings.NewReader("{\n \"name\": \"Volvo Cagliari Service Agent\",\n \"description\": \"Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.\",\n \"company_name\": \"Volvo Cagliari\",\n \"role\": \"Inbound service appointment scheduler for a Volvo dealership in Cagliari.\",\n \"objective\": \"Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service.\",\n \"tone\": \"Warm, professional, slightly formal. Use the customer's name. Avoid jargon — explain technical terms in plain language.\",\n \"behavior_guidelines\": \"Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.\",\n \"company_service\": \"Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.\",\n \"topic\": \"Service appointment booking and vehicle maintenance questions.\",\n \"length_detail\": \"Keep replies under 25 words for voice; under 200 characters for text. One question at a time.\",\n \"interest_of_product\": \"<string>\",\n \"negative_response\": \"If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.\",\n \"custom_prompt\": \"<string>\",\n \"language\": \"en\",\n \"timezone\": \"America/New_York\",\n \"appointment_scheduling_enabled\": true,\n \"appointment_scheduling_randomly\": true,\n \"custom_llm_url\": \"<string>\",\n \"settings\": {\n \"voice\": {\n \"interaction\": {\n \"customer_speak_first\": false,\n \"inbound_first_message\": \"Hi, this is Sara from Volvo. How can I help you today?\",\n \"outbound_first_message\": \"Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?\",\n \"voice_mail_message\": \"Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.\",\n \"end_call_message\": \"Thank you for calling, have a great day!\",\n \"silence_message\": \"Are you still there? I want to make sure I'm helping you with what you need.\",\n \"max_silence_prompts\": 3\n },\n \"interruption\": {\n \"mode\": \"balanced\"\n },\n \"voice_profile\": {\n \"language\": \"en\",\n \"voice_uuid\": \"ebeba3e0-89b5-4c94-9841-9555ab155dbc\",\n \"voice_name\": \"Giulia\"\n },\n \"call_behavior\": {\n \"audio_recording\": true,\n \"background_sound\": true,\n \"silence_timeout_seconds\": 60,\n \"max_call_duration_seconds\": 1800,\n \"max_call_duration_message\": \"Thanks for the call — we've reached the time limit. Goodbye!\"\n },\n \"compliance\": {\n \"eu_gdpr_compliance\": true,\n \"hipaa_compliance\": false\n },\n \"normalizers\": {\n \"outbound\": {},\n \"inbound\": {}\n }\n },\n \"text\": {\n \"daily_limits\": {\n \"daily_max_messages_per_conversation\": 100,\n \"daily_conversation_limit_exceeded_message\": \"<string>\"\n },\n \"timing_and_delay\": {\n \"base_delay\": 0.5,\n \"pause_before_reply\": 1,\n \"typing_speed_wpm_min\": 40,\n \"typing_speed_wpm_max\": 60,\n \"typing_speed_char\": 0.05,\n \"delay_jitter_min\": 0.1,\n \"delay_jitter_max\": 1.5\n },\n \"typing_simulation\": {\n \"show_typing_indicator\": true,\n \"simulate_typing_breaks\": true,\n \"simulate_typos_corrections\": false\n },\n \"working_hours\": {\n \"enabled\": false,\n \"start\": \"9 AM\",\n \"end\": \"5 PM\",\n \"timezone\": \"America/New_York\",\n \"outside_hours_behavior\": \"Auto-reply\",\n \"offline_message\": \"<string>\",\n \"during_hours_agent\": \"ai\"\n },\n \"handover\": {\n \"enabled\": false,\n \"handover_triggers\": \"User request\",\n \"handover_method\": \"Assign agent\",\n \"handover_message\": \"<string>\",\n \"assignment_strategy\": \"First available\",\n \"handover_timeout\": 60,\n \"fallback_agent\": \"Bot assistant\",\n \"release_after_minutes\": 0,\n \"release_channels\": [\n \"whatsapp\",\n \"instagram\"\n ]\n },\n \"confidence_controls\": {\n \"min_confidence_threshold\": 0.7,\n \"ask_clarifying_questions\": false\n },\n \"message_behavior\": {\n \"second_message_behavior\": {\n \"enabled\": false,\n \"chance\": 0.25,\n \"delay_min\": 1,\n \"delay_max\": 4\n },\n \"follow_up_behavior\": {\n \"enabled\": false,\n \"delay_min\": 24,\n \"delay_max\": 48\n }\n },\n \"personality\": {\n \"use_response_variations\": true,\n \"emoji_usage\": \"None\",\n \"use_punctuation_variation\": false,\n \"use_filler_words\": false,\n \"enable_small_talk\": false,\n \"energy_level\": \"Friendly\",\n \"empathy_level\": \"Medium\"\n },\n \"advanced\": {\n \"split_messages\": true,\n \"simulate_message_editing\": false,\n \"use_memory_based_context\": false,\n \"human_first_mode\": false\n },\n \"email\": {\n \"signature\": \"<p>—<br>Jane, Acme Support</p>\"\n }\n }\n },\n \"guidelines\": [\n {\n \"content\": \"Always confirm vehicle VIN or license plate before creating a service appointment.\",\n \"order\": 0\n }\n ],\n \"notes\": [\n {\n \"content\": \"Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.\",\n \"order\": 0\n }\n ],\n \"procedures\": [\n {\n \"name\": \"Book service appointment\",\n \"description\": \"Used when the customer wants to schedule a service appointment for their vehicle.\",\n \"steps\": [\n {\n \"order\": 1,\n \"description\": \"Ask the customer for their vehicle license plate or VIN.\",\n \"intent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n }\n ],\n \"training\": [\n {\n \"content\": \"What does Volvo's standard warranty cover?\",\n \"intent\": \"warranty_inquiry\",\n \"response\": \"Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?\"\n }\n ],\n \"appointments\": {\n \"enabled\": true,\n \"random_assignment\": true,\n \"schedule_assignments\": [\n {\n \"schedule_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Service Appointment\",\n \"description\": \"When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.\",\n \"slot_rules\": {\n \"offer_slots_from\": \"3_hours\",\n \"book_slots_from\": \"6_hours\",\n \"max_appointments_per_day\": 10,\n \"conflict_resolution_enabled\": true,\n \"alternative_slots_count\": 3,\n \"suggestion_priority\": \"nearest\",\n \"prefer_same_day\": true,\n \"prefer_same_time_slot\": false,\n \"include_same_week\": true\n },\n \"rescheduling\": {\n \"policy\": \"always_ask\",\n \"minor_change_hours\": 2,\n \"minor_change_same_day\": true,\n \"minor_change_same_week\": false,\n \"minor_change_same_slot\": false,\n \"min_rescheduling_notice\": \"2_hours\"\n },\n \"cancellation\": {\n \"min_cancellation_notice\": \"24_hours\",\n \"ai_can_cancel\": false,\n \"require_cancellation_reason\": true,\n \"cancellation_fee_policy\": \"no_fee\"\n },\n \"questions\": {\n \"inherit_from_schedule\": true,\n \"custom_questions\": [\n {\n \"name\": \"License plate\",\n \"type\": \"text\",\n \"description\": \"Vehicle license plate number for the service appointment.\",\n \"required\": true\n }\n ]\n },\n \"approval\": {\n \"require_approval\": true,\n \"approval_threshold\": \"1_hour\",\n \"approval_for_create\": false,\n \"approval_for_reschedule\": true,\n \"approval_for_cancel\": true,\n \"approval_for_notes\": false,\n \"notify_calendar_owner\": \"always\",\n \"notify_admins\": \"always\",\n \"expected_response_time\": \"5_min\"\n }\n }\n ]\n },\n \"routing_rules\": [\n {\n \"detection_mode\": \"intent\",\n \"trigger_keyword\": \"sales\",\n \"department_name\": \"Sales Department\",\n \"phrases\": [\n \"I want to talk to sales\"\n ],\n \"ai_prompt\": \"Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.\",\n \"voice_response\": \"Sure, I'll transfer you to our sales team now. One moment please.\",\n \"voice_on_error\": \"I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.\",\n \"voice_on_success\": \"You've been successfully connected. Have a great day.\",\n \"destination_type\": \"extension\",\n \"destination\": \"101\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transfer_type\": \"transfer_call\",\n \"transfer_config\": {},\n \"priority\": 1,\n \"is_active\": true\n }\n ],\n \"guard_rules\": [\n {\n \"name\": \"Legal complaint escalation\",\n \"when_condition\": \"Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.\",\n \"example_phrases\": [\n \"I'm calling my lawyer about this\"\n ],\n \"then_action\": \"forward\",\n \"selected_channels\": [],\n \"say_before_forwarding\": \"I understand this is important — let me connect you with someone who can help.\",\n \"say_before_end\": \"I'm sorry I couldn't help further. Please contact our team directly. Goodbye.\",\n \"destination\": \"<string>\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"is_default\": false\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{subdomain}.mihu.ai/api/v1/agents/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Volvo Cagliari Service Agent\",\n \"description\": \"Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.\",\n \"company_name\": \"Volvo Cagliari\",\n \"role\": \"Inbound service appointment scheduler for a Volvo dealership in Cagliari.\",\n \"objective\": \"Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service.\",\n \"tone\": \"Warm, professional, slightly formal. Use the customer's name. Avoid jargon — explain technical terms in plain language.\",\n \"behavior_guidelines\": \"Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.\",\n \"company_service\": \"Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.\",\n \"topic\": \"Service appointment booking and vehicle maintenance questions.\",\n \"length_detail\": \"Keep replies under 25 words for voice; under 200 characters for text. One question at a time.\",\n \"interest_of_product\": \"<string>\",\n \"negative_response\": \"If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.\",\n \"custom_prompt\": \"<string>\",\n \"language\": \"en\",\n \"timezone\": \"America/New_York\",\n \"appointment_scheduling_enabled\": true,\n \"appointment_scheduling_randomly\": true,\n \"custom_llm_url\": \"<string>\",\n \"settings\": {\n \"voice\": {\n \"interaction\": {\n \"customer_speak_first\": false,\n \"inbound_first_message\": \"Hi, this is Sara from Volvo. How can I help you today?\",\n \"outbound_first_message\": \"Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?\",\n \"voice_mail_message\": \"Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.\",\n \"end_call_message\": \"Thank you for calling, have a great day!\",\n \"silence_message\": \"Are you still there? I want to make sure I'm helping you with what you need.\",\n \"max_silence_prompts\": 3\n },\n \"interruption\": {\n \"mode\": \"balanced\"\n },\n \"voice_profile\": {\n \"language\": \"en\",\n \"voice_uuid\": \"ebeba3e0-89b5-4c94-9841-9555ab155dbc\",\n \"voice_name\": \"Giulia\"\n },\n \"call_behavior\": {\n \"audio_recording\": true,\n \"background_sound\": true,\n \"silence_timeout_seconds\": 60,\n \"max_call_duration_seconds\": 1800,\n \"max_call_duration_message\": \"Thanks for the call — we've reached the time limit. Goodbye!\"\n },\n \"compliance\": {\n \"eu_gdpr_compliance\": true,\n \"hipaa_compliance\": false\n },\n \"normalizers\": {\n \"outbound\": {},\n \"inbound\": {}\n }\n },\n \"text\": {\n \"daily_limits\": {\n \"daily_max_messages_per_conversation\": 100,\n \"daily_conversation_limit_exceeded_message\": \"<string>\"\n },\n \"timing_and_delay\": {\n \"base_delay\": 0.5,\n \"pause_before_reply\": 1,\n \"typing_speed_wpm_min\": 40,\n \"typing_speed_wpm_max\": 60,\n \"typing_speed_char\": 0.05,\n \"delay_jitter_min\": 0.1,\n \"delay_jitter_max\": 1.5\n },\n \"typing_simulation\": {\n \"show_typing_indicator\": true,\n \"simulate_typing_breaks\": true,\n \"simulate_typos_corrections\": false\n },\n \"working_hours\": {\n \"enabled\": false,\n \"start\": \"9 AM\",\n \"end\": \"5 PM\",\n \"timezone\": \"America/New_York\",\n \"outside_hours_behavior\": \"Auto-reply\",\n \"offline_message\": \"<string>\",\n \"during_hours_agent\": \"ai\"\n },\n \"handover\": {\n \"enabled\": false,\n \"handover_triggers\": \"User request\",\n \"handover_method\": \"Assign agent\",\n \"handover_message\": \"<string>\",\n \"assignment_strategy\": \"First available\",\n \"handover_timeout\": 60,\n \"fallback_agent\": \"Bot assistant\",\n \"release_after_minutes\": 0,\n \"release_channels\": [\n \"whatsapp\",\n \"instagram\"\n ]\n },\n \"confidence_controls\": {\n \"min_confidence_threshold\": 0.7,\n \"ask_clarifying_questions\": false\n },\n \"message_behavior\": {\n \"second_message_behavior\": {\n \"enabled\": false,\n \"chance\": 0.25,\n \"delay_min\": 1,\n \"delay_max\": 4\n },\n \"follow_up_behavior\": {\n \"enabled\": false,\n \"delay_min\": 24,\n \"delay_max\": 48\n }\n },\n \"personality\": {\n \"use_response_variations\": true,\n \"emoji_usage\": \"None\",\n \"use_punctuation_variation\": false,\n \"use_filler_words\": false,\n \"enable_small_talk\": false,\n \"energy_level\": \"Friendly\",\n \"empathy_level\": \"Medium\"\n },\n \"advanced\": {\n \"split_messages\": true,\n \"simulate_message_editing\": false,\n \"use_memory_based_context\": false,\n \"human_first_mode\": false\n },\n \"email\": {\n \"signature\": \"<p>—<br>Jane, Acme Support</p>\"\n }\n }\n },\n \"guidelines\": [\n {\n \"content\": \"Always confirm vehicle VIN or license plate before creating a service appointment.\",\n \"order\": 0\n }\n ],\n \"notes\": [\n {\n \"content\": \"Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.\",\n \"order\": 0\n }\n ],\n \"procedures\": [\n {\n \"name\": \"Book service appointment\",\n \"description\": \"Used when the customer wants to schedule a service appointment for their vehicle.\",\n \"steps\": [\n {\n \"order\": 1,\n \"description\": \"Ask the customer for their vehicle license plate or VIN.\",\n \"intent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n }\n ],\n \"training\": [\n {\n \"content\": \"What does Volvo's standard warranty cover?\",\n \"intent\": \"warranty_inquiry\",\n \"response\": \"Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?\"\n }\n ],\n \"appointments\": {\n \"enabled\": true,\n \"random_assignment\": true,\n \"schedule_assignments\": [\n {\n \"schedule_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Service Appointment\",\n \"description\": \"When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.\",\n \"slot_rules\": {\n \"offer_slots_from\": \"3_hours\",\n \"book_slots_from\": \"6_hours\",\n \"max_appointments_per_day\": 10,\n \"conflict_resolution_enabled\": true,\n \"alternative_slots_count\": 3,\n \"suggestion_priority\": \"nearest\",\n \"prefer_same_day\": true,\n \"prefer_same_time_slot\": false,\n \"include_same_week\": true\n },\n \"rescheduling\": {\n \"policy\": \"always_ask\",\n \"minor_change_hours\": 2,\n \"minor_change_same_day\": true,\n \"minor_change_same_week\": false,\n \"minor_change_same_slot\": false,\n \"min_rescheduling_notice\": \"2_hours\"\n },\n \"cancellation\": {\n \"min_cancellation_notice\": \"24_hours\",\n \"ai_can_cancel\": false,\n \"require_cancellation_reason\": true,\n \"cancellation_fee_policy\": \"no_fee\"\n },\n \"questions\": {\n \"inherit_from_schedule\": true,\n \"custom_questions\": [\n {\n \"name\": \"License plate\",\n \"type\": \"text\",\n \"description\": \"Vehicle license plate number for the service appointment.\",\n \"required\": true\n }\n ]\n },\n \"approval\": {\n \"require_approval\": true,\n \"approval_threshold\": \"1_hour\",\n \"approval_for_create\": false,\n \"approval_for_reschedule\": true,\n \"approval_for_cancel\": true,\n \"approval_for_notes\": false,\n \"notify_calendar_owner\": \"always\",\n \"notify_admins\": \"always\",\n \"expected_response_time\": \"5_min\"\n }\n }\n ]\n },\n \"routing_rules\": [\n {\n \"detection_mode\": \"intent\",\n \"trigger_keyword\": \"sales\",\n \"department_name\": \"Sales Department\",\n \"phrases\": [\n \"I want to talk to sales\"\n ],\n \"ai_prompt\": \"Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.\",\n \"voice_response\": \"Sure, I'll transfer you to our sales team now. One moment please.\",\n \"voice_on_error\": \"I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.\",\n \"voice_on_success\": \"You've been successfully connected. Have a great day.\",\n \"destination_type\": \"extension\",\n \"destination\": \"101\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transfer_type\": \"transfer_call\",\n \"transfer_config\": {},\n \"priority\": 1,\n \"is_active\": true\n }\n ],\n \"guard_rules\": [\n {\n \"name\": \"Legal complaint escalation\",\n \"when_condition\": \"Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.\",\n \"example_phrases\": [\n \"I'm calling my lawyer about this\"\n ],\n \"then_action\": \"forward\",\n \"selected_channels\": [],\n \"say_before_forwarding\": \"I understand this is important — let me connect you with someone who can help.\",\n \"say_before_end\": \"I'm sorry I couldn't help further. Please contact our team directly. Goodbye.\",\n \"destination\": \"<string>\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"is_default\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/agents/{uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Volvo Cagliari Service Agent\",\n \"description\": \"Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.\",\n \"company_name\": \"Volvo Cagliari\",\n \"role\": \"Inbound service appointment scheduler for a Volvo dealership in Cagliari.\",\n \"objective\": \"Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service.\",\n \"tone\": \"Warm, professional, slightly formal. Use the customer's name. Avoid jargon — explain technical terms in plain language.\",\n \"behavior_guidelines\": \"Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.\",\n \"company_service\": \"Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.\",\n \"topic\": \"Service appointment booking and vehicle maintenance questions.\",\n \"length_detail\": \"Keep replies under 25 words for voice; under 200 characters for text. One question at a time.\",\n \"interest_of_product\": \"<string>\",\n \"negative_response\": \"If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.\",\n \"custom_prompt\": \"<string>\",\n \"language\": \"en\",\n \"timezone\": \"America/New_York\",\n \"appointment_scheduling_enabled\": true,\n \"appointment_scheduling_randomly\": true,\n \"custom_llm_url\": \"<string>\",\n \"settings\": {\n \"voice\": {\n \"interaction\": {\n \"customer_speak_first\": false,\n \"inbound_first_message\": \"Hi, this is Sara from Volvo. How can I help you today?\",\n \"outbound_first_message\": \"Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?\",\n \"voice_mail_message\": \"Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.\",\n \"end_call_message\": \"Thank you for calling, have a great day!\",\n \"silence_message\": \"Are you still there? I want to make sure I'm helping you with what you need.\",\n \"max_silence_prompts\": 3\n },\n \"interruption\": {\n \"mode\": \"balanced\"\n },\n \"voice_profile\": {\n \"language\": \"en\",\n \"voice_uuid\": \"ebeba3e0-89b5-4c94-9841-9555ab155dbc\",\n \"voice_name\": \"Giulia\"\n },\n \"call_behavior\": {\n \"audio_recording\": true,\n \"background_sound\": true,\n \"silence_timeout_seconds\": 60,\n \"max_call_duration_seconds\": 1800,\n \"max_call_duration_message\": \"Thanks for the call — we've reached the time limit. Goodbye!\"\n },\n \"compliance\": {\n \"eu_gdpr_compliance\": true,\n \"hipaa_compliance\": false\n },\n \"normalizers\": {\n \"outbound\": {},\n \"inbound\": {}\n }\n },\n \"text\": {\n \"daily_limits\": {\n \"daily_max_messages_per_conversation\": 100,\n \"daily_conversation_limit_exceeded_message\": \"<string>\"\n },\n \"timing_and_delay\": {\n \"base_delay\": 0.5,\n \"pause_before_reply\": 1,\n \"typing_speed_wpm_min\": 40,\n \"typing_speed_wpm_max\": 60,\n \"typing_speed_char\": 0.05,\n \"delay_jitter_min\": 0.1,\n \"delay_jitter_max\": 1.5\n },\n \"typing_simulation\": {\n \"show_typing_indicator\": true,\n \"simulate_typing_breaks\": true,\n \"simulate_typos_corrections\": false\n },\n \"working_hours\": {\n \"enabled\": false,\n \"start\": \"9 AM\",\n \"end\": \"5 PM\",\n \"timezone\": \"America/New_York\",\n \"outside_hours_behavior\": \"Auto-reply\",\n \"offline_message\": \"<string>\",\n \"during_hours_agent\": \"ai\"\n },\n \"handover\": {\n \"enabled\": false,\n \"handover_triggers\": \"User request\",\n \"handover_method\": \"Assign agent\",\n \"handover_message\": \"<string>\",\n \"assignment_strategy\": \"First available\",\n \"handover_timeout\": 60,\n \"fallback_agent\": \"Bot assistant\",\n \"release_after_minutes\": 0,\n \"release_channels\": [\n \"whatsapp\",\n \"instagram\"\n ]\n },\n \"confidence_controls\": {\n \"min_confidence_threshold\": 0.7,\n \"ask_clarifying_questions\": false\n },\n \"message_behavior\": {\n \"second_message_behavior\": {\n \"enabled\": false,\n \"chance\": 0.25,\n \"delay_min\": 1,\n \"delay_max\": 4\n },\n \"follow_up_behavior\": {\n \"enabled\": false,\n \"delay_min\": 24,\n \"delay_max\": 48\n }\n },\n \"personality\": {\n \"use_response_variations\": true,\n \"emoji_usage\": \"None\",\n \"use_punctuation_variation\": false,\n \"use_filler_words\": false,\n \"enable_small_talk\": false,\n \"energy_level\": \"Friendly\",\n \"empathy_level\": \"Medium\"\n },\n \"advanced\": {\n \"split_messages\": true,\n \"simulate_message_editing\": false,\n \"use_memory_based_context\": false,\n \"human_first_mode\": false\n },\n \"email\": {\n \"signature\": \"<p>—<br>Jane, Acme Support</p>\"\n }\n }\n },\n \"guidelines\": [\n {\n \"content\": \"Always confirm vehicle VIN or license plate before creating a service appointment.\",\n \"order\": 0\n }\n ],\n \"notes\": [\n {\n \"content\": \"Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.\",\n \"order\": 0\n }\n ],\n \"procedures\": [\n {\n \"name\": \"Book service appointment\",\n \"description\": \"Used when the customer wants to schedule a service appointment for their vehicle.\",\n \"steps\": [\n {\n \"order\": 1,\n \"description\": \"Ask the customer for their vehicle license plate or VIN.\",\n \"intent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n }\n ],\n \"training\": [\n {\n \"content\": \"What does Volvo's standard warranty cover?\",\n \"intent\": \"warranty_inquiry\",\n \"response\": \"Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?\"\n }\n ],\n \"appointments\": {\n \"enabled\": true,\n \"random_assignment\": true,\n \"schedule_assignments\": [\n {\n \"schedule_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Service Appointment\",\n \"description\": \"When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.\",\n \"slot_rules\": {\n \"offer_slots_from\": \"3_hours\",\n \"book_slots_from\": \"6_hours\",\n \"max_appointments_per_day\": 10,\n \"conflict_resolution_enabled\": true,\n \"alternative_slots_count\": 3,\n \"suggestion_priority\": \"nearest\",\n \"prefer_same_day\": true,\n \"prefer_same_time_slot\": false,\n \"include_same_week\": true\n },\n \"rescheduling\": {\n \"policy\": \"always_ask\",\n \"minor_change_hours\": 2,\n \"minor_change_same_day\": true,\n \"minor_change_same_week\": false,\n \"minor_change_same_slot\": false,\n \"min_rescheduling_notice\": \"2_hours\"\n },\n \"cancellation\": {\n \"min_cancellation_notice\": \"24_hours\",\n \"ai_can_cancel\": false,\n \"require_cancellation_reason\": true,\n \"cancellation_fee_policy\": \"no_fee\"\n },\n \"questions\": {\n \"inherit_from_schedule\": true,\n \"custom_questions\": [\n {\n \"name\": \"License plate\",\n \"type\": \"text\",\n \"description\": \"Vehicle license plate number for the service appointment.\",\n \"required\": true\n }\n ]\n },\n \"approval\": {\n \"require_approval\": true,\n \"approval_threshold\": \"1_hour\",\n \"approval_for_create\": false,\n \"approval_for_reschedule\": true,\n \"approval_for_cancel\": true,\n \"approval_for_notes\": false,\n \"notify_calendar_owner\": \"always\",\n \"notify_admins\": \"always\",\n \"expected_response_time\": \"5_min\"\n }\n }\n ]\n },\n \"routing_rules\": [\n {\n \"detection_mode\": \"intent\",\n \"trigger_keyword\": \"sales\",\n \"department_name\": \"Sales Department\",\n \"phrases\": [\n \"I want to talk to sales\"\n ],\n \"ai_prompt\": \"Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.\",\n \"voice_response\": \"Sure, I'll transfer you to our sales team now. One moment please.\",\n \"voice_on_error\": \"I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.\",\n \"voice_on_success\": \"You've been successfully connected. Have a great day.\",\n \"destination_type\": \"extension\",\n \"destination\": \"101\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transfer_type\": \"transfer_call\",\n \"transfer_config\": {},\n \"priority\": 1,\n \"is_active\": true\n }\n ],\n \"guard_rules\": [\n {\n \"name\": \"Legal complaint escalation\",\n \"when_condition\": \"Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.\",\n \"example_phrases\": [\n \"I'm calling my lawyer about this\"\n ],\n \"then_action\": \"forward\",\n \"selected_channels\": [],\n \"say_before_forwarding\": \"I understand this is important — let me connect you with someone who can help.\",\n \"say_before_end\": \"I'm sorry I couldn't help further. Please contact our team directly. Goodbye.\",\n \"destination\": \"<string>\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"is_default\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"company_name": "<string>",
"role": "<string>",
"objective": "<string>",
"tone": "<string>",
"behavior_guidelines": "<string>",
"company_service": "<string>",
"topic": "<string>",
"length_detail": "<string>",
"interest_of_product": "<string>",
"negative_response": "<string>",
"status": "pending",
"custom_prompt": "<string>",
"language": "<string>",
"speed": "<string>",
"timezone": "<string>",
"appointment_scheduling_enabled": true,
"appointment_scheduling_randomly": true,
"custom_llm_url": "<string>",
"recommendations": "<string>",
"settings": {
"voice": {},
"text": {},
"memorize": {},
"evaluation": {}
},
"guidelines": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "Always confirm vehicle VIN or license plate before creating a service appointment.",
"order": 0
}
],
"notes": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.",
"order": 0
}
],
"procedures": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Book service appointment",
"description": "Used when the customer wants to schedule a service appointment for their vehicle.",
"steps": [
{
"order": 1,
"description": "Ask the customer for their vehicle license plate or VIN.",
"intent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
],
"training": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "What does Volvo's standard warranty cover?",
"intent": "warranty_inquiry",
"response": "Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?"
}
],
"intents": [
{
"intent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"description": "<string>",
"recommendation_actions": "<string>",
"confidence_threshold": 123,
"is_system": true,
"intent_llm_handle_by_response": true,
"webhook": {
"url": "<string>",
"auth_token": "<string>"
},
"parameters": [
{
"key": "email",
"default": "<string>",
"type": "string",
"required": true
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"webhooks": [
{
"webhook_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"events": [
"conversation_status"
],
"is_active": true,
"has_secret": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"appointments": {},
"routing_rules": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"detection_mode": "intent",
"trigger_keyword": "sales",
"department_name": "Sales Department",
"phrases": [
"I want to talk to sales"
],
"ai_prompt": "Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.",
"voice_response": "Sure, I'll transfer you to our sales team now. One moment please.",
"voice_on_error": "I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.",
"voice_on_success": "You've been successfully connected. Have a great day.",
"destination_type": "extension",
"destination": "101",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transfer_type": "transfer_call",
"transfer_config": {},
"priority": 1,
"is_active": true
}
],
"guard_rules": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Legal complaint escalation",
"when_condition": "Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.",
"example_phrases": [
"I'm calling my lawyer about this"
],
"then_action": "forward",
"selected_channels": [
"phone"
],
"say_before_forwarding": "I understand this is important — let me connect you with someone who can help.",
"say_before_end": "I'm sorry I couldn't help further. Please contact our team directly. Goodbye.",
"destination_type": "extension",
"destination": "<string>",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"is_default": false
}
],
"phone_numbers": [
{
"phone_number_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"status": "active",
"country_code": "<string>",
"type": "<string>",
"capabilities": {
"call": true,
"sms": true,
"whatsapp": true,
"whatsapp_call": true
}
}
],
"channels": [
{}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Update an agent
Updates core agent fields, voice/text settings, and any included collection sections. Use PATCH for partial changes to the agent profile or settings. If a collection section such as notes, guidelines, procedures, training, routing_rules, or guard_rules is included, that section replaces the existing section.
curl --request PATCH \
--url https://{subdomain}.mihu.ai/api/v1/agents/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "Volvo Cagliari Service Agent",
"description": "Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.",
"company_name": "Volvo Cagliari",
"role": "Inbound service appointment scheduler for a Volvo dealership in Cagliari.",
"objective": "Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service.",
"tone": "Warm, professional, slightly formal. Use the customer's name. Avoid jargon — explain technical terms in plain language.",
"behavior_guidelines": "Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.",
"company_service": "Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.",
"topic": "Service appointment booking and vehicle maintenance questions.",
"length_detail": "Keep replies under 25 words for voice; under 200 characters for text. One question at a time.",
"interest_of_product": "<string>",
"negative_response": "If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.",
"custom_prompt": "<string>",
"language": "en",
"timezone": "America/New_York",
"appointment_scheduling_enabled": true,
"appointment_scheduling_randomly": true,
"custom_llm_url": "<string>",
"settings": {
"voice": {
"interaction": {
"customer_speak_first": false,
"inbound_first_message": "Hi, this is Sara from Volvo. How can I help you today?",
"outbound_first_message": "Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?",
"voice_mail_message": "Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.",
"end_call_message": "Thank you for calling, have a great day!",
"silence_message": "Are you still there? I want to make sure I'm helping you with what you need.",
"max_silence_prompts": 3
},
"interruption": {
"mode": "balanced"
},
"voice_profile": {
"language": "en",
"voice_uuid": "ebeba3e0-89b5-4c94-9841-9555ab155dbc",
"voice_name": "Giulia"
},
"call_behavior": {
"audio_recording": true,
"background_sound": true,
"silence_timeout_seconds": 60,
"max_call_duration_seconds": 1800,
"max_call_duration_message": "Thanks for the call — we've reached the time limit. Goodbye!"
},
"compliance": {
"eu_gdpr_compliance": true,
"hipaa_compliance": false
},
"normalizers": {
"outbound": {},
"inbound": {}
}
},
"text": {
"daily_limits": {
"daily_max_messages_per_conversation": 100,
"daily_conversation_limit_exceeded_message": "<string>"
},
"timing_and_delay": {
"base_delay": 0.5,
"pause_before_reply": 1,
"typing_speed_wpm_min": 40,
"typing_speed_wpm_max": 60,
"typing_speed_char": 0.05,
"delay_jitter_min": 0.1,
"delay_jitter_max": 1.5
},
"typing_simulation": {
"show_typing_indicator": true,
"simulate_typing_breaks": true,
"simulate_typos_corrections": false
},
"working_hours": {
"enabled": false,
"start": "9 AM",
"end": "5 PM",
"timezone": "America/New_York",
"outside_hours_behavior": "Auto-reply",
"offline_message": "<string>",
"during_hours_agent": "ai"
},
"handover": {
"enabled": false,
"handover_triggers": "User request",
"handover_method": "Assign agent",
"handover_message": "<string>",
"assignment_strategy": "First available",
"handover_timeout": 60,
"fallback_agent": "Bot assistant",
"release_after_minutes": 0,
"release_channels": [
"whatsapp",
"instagram"
]
},
"confidence_controls": {
"min_confidence_threshold": 0.7,
"ask_clarifying_questions": false
},
"message_behavior": {
"second_message_behavior": {
"enabled": false,
"chance": 0.25,
"delay_min": 1,
"delay_max": 4
},
"follow_up_behavior": {
"enabled": false,
"delay_min": 24,
"delay_max": 48
}
},
"personality": {
"use_response_variations": true,
"emoji_usage": "None",
"use_punctuation_variation": false,
"use_filler_words": false,
"enable_small_talk": false,
"energy_level": "Friendly",
"empathy_level": "Medium"
},
"advanced": {
"split_messages": true,
"simulate_message_editing": false,
"use_memory_based_context": false,
"human_first_mode": false
},
"email": {
"signature": "<p>—<br>Jane, Acme Support</p>"
}
}
},
"guidelines": [
{
"content": "Always confirm vehicle VIN or license plate before creating a service appointment.",
"order": 0
}
],
"notes": [
{
"content": "Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.",
"order": 0
}
],
"procedures": [
{
"name": "Book service appointment",
"description": "Used when the customer wants to schedule a service appointment for their vehicle.",
"steps": [
{
"order": 1,
"description": "Ask the customer for their vehicle license plate or VIN.",
"intent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
],
"training": [
{
"content": "What does Volvo's standard warranty cover?",
"intent": "warranty_inquiry",
"response": "Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?"
}
],
"appointments": {
"enabled": true,
"random_assignment": true,
"schedule_assignments": [
{
"schedule_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Service Appointment",
"description": "When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.",
"slot_rules": {
"offer_slots_from": "3_hours",
"book_slots_from": "6_hours",
"max_appointments_per_day": 10,
"conflict_resolution_enabled": true,
"alternative_slots_count": 3,
"suggestion_priority": "nearest",
"prefer_same_day": true,
"prefer_same_time_slot": false,
"include_same_week": true
},
"rescheduling": {
"policy": "always_ask",
"minor_change_hours": 2,
"minor_change_same_day": true,
"minor_change_same_week": false,
"minor_change_same_slot": false,
"min_rescheduling_notice": "2_hours"
},
"cancellation": {
"min_cancellation_notice": "24_hours",
"ai_can_cancel": false,
"require_cancellation_reason": true,
"cancellation_fee_policy": "no_fee"
},
"questions": {
"inherit_from_schedule": true,
"custom_questions": [
{
"name": "License plate",
"type": "text",
"description": "Vehicle license plate number for the service appointment.",
"required": true
}
]
},
"approval": {
"require_approval": true,
"approval_threshold": "1_hour",
"approval_for_create": false,
"approval_for_reschedule": true,
"approval_for_cancel": true,
"approval_for_notes": false,
"notify_calendar_owner": "always",
"notify_admins": "always",
"expected_response_time": "5_min"
}
}
]
},
"routing_rules": [
{
"detection_mode": "intent",
"trigger_keyword": "sales",
"department_name": "Sales Department",
"phrases": [
"I want to talk to sales"
],
"ai_prompt": "Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.",
"voice_response": "Sure, I'll transfer you to our sales team now. One moment please.",
"voice_on_error": "I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.",
"voice_on_success": "You've been successfully connected. Have a great day.",
"destination_type": "extension",
"destination": "101",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transfer_type": "transfer_call",
"transfer_config": {},
"priority": 1,
"is_active": true
}
],
"guard_rules": [
{
"name": "Legal complaint escalation",
"when_condition": "Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.",
"example_phrases": [
"I'm calling my lawyer about this"
],
"then_action": "forward",
"selected_channels": [],
"say_before_forwarding": "I understand this is important — let me connect you with someone who can help.",
"say_before_end": "I'm sorry I couldn't help further. Please contact our team directly. Goodbye.",
"destination": "<string>",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"is_default": false
}
]
}
EOFimport requests
url = "https://{subdomain}.mihu.ai/api/v1/agents/{uuid}"
payload = {
"name": "Volvo Cagliari Service Agent",
"description": "Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.",
"company_name": "Volvo Cagliari",
"role": "Inbound service appointment scheduler for a Volvo dealership in Cagliari.",
"objective": "Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service.",
"tone": "Warm, professional, slightly formal. Use the customer's name. Avoid jargon — explain technical terms in plain language.",
"behavior_guidelines": "Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.",
"company_service": "Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.",
"topic": "Service appointment booking and vehicle maintenance questions.",
"length_detail": "Keep replies under 25 words for voice; under 200 characters for text. One question at a time.",
"interest_of_product": "<string>",
"negative_response": "If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.",
"custom_prompt": "<string>",
"language": "en",
"timezone": "America/New_York",
"appointment_scheduling_enabled": True,
"appointment_scheduling_randomly": True,
"custom_llm_url": "<string>",
"settings": {
"voice": {
"interaction": {
"customer_speak_first": False,
"inbound_first_message": "Hi, this is Sara from Volvo. How can I help you today?",
"outbound_first_message": "Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?",
"voice_mail_message": "Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.",
"end_call_message": "Thank you for calling, have a great day!",
"silence_message": "Are you still there? I want to make sure I'm helping you with what you need.",
"max_silence_prompts": 3
},
"interruption": { "mode": "balanced" },
"voice_profile": {
"language": "en",
"voice_uuid": "ebeba3e0-89b5-4c94-9841-9555ab155dbc",
"voice_name": "Giulia"
},
"call_behavior": {
"audio_recording": True,
"background_sound": True,
"silence_timeout_seconds": 60,
"max_call_duration_seconds": 1800,
"max_call_duration_message": "Thanks for the call — we've reached the time limit. Goodbye!"
},
"compliance": {
"eu_gdpr_compliance": True,
"hipaa_compliance": False
},
"normalizers": {
"outbound": {},
"inbound": {}
}
},
"text": {
"daily_limits": {
"daily_max_messages_per_conversation": 100,
"daily_conversation_limit_exceeded_message": "<string>"
},
"timing_and_delay": {
"base_delay": 0.5,
"pause_before_reply": 1,
"typing_speed_wpm_min": 40,
"typing_speed_wpm_max": 60,
"typing_speed_char": 0.05,
"delay_jitter_min": 0.1,
"delay_jitter_max": 1.5
},
"typing_simulation": {
"show_typing_indicator": True,
"simulate_typing_breaks": True,
"simulate_typos_corrections": False
},
"working_hours": {
"enabled": False,
"start": "9 AM",
"end": "5 PM",
"timezone": "America/New_York",
"outside_hours_behavior": "Auto-reply",
"offline_message": "<string>",
"during_hours_agent": "ai"
},
"handover": {
"enabled": False,
"handover_triggers": "User request",
"handover_method": "Assign agent",
"handover_message": "<string>",
"assignment_strategy": "First available",
"handover_timeout": 60,
"fallback_agent": "Bot assistant",
"release_after_minutes": 0,
"release_channels": ["whatsapp", "instagram"]
},
"confidence_controls": {
"min_confidence_threshold": 0.7,
"ask_clarifying_questions": False
},
"message_behavior": {
"second_message_behavior": {
"enabled": False,
"chance": 0.25,
"delay_min": 1,
"delay_max": 4
},
"follow_up_behavior": {
"enabled": False,
"delay_min": 24,
"delay_max": 48
}
},
"personality": {
"use_response_variations": True,
"emoji_usage": "None",
"use_punctuation_variation": False,
"use_filler_words": False,
"enable_small_talk": False,
"energy_level": "Friendly",
"empathy_level": "Medium"
},
"advanced": {
"split_messages": True,
"simulate_message_editing": False,
"use_memory_based_context": False,
"human_first_mode": False
},
"email": { "signature": "<p>—<br>Jane, Acme Support</p>" }
}
},
"guidelines": [
{
"content": "Always confirm vehicle VIN or license plate before creating a service appointment.",
"order": 0
}
],
"notes": [
{
"content": "Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.",
"order": 0
}
],
"procedures": [
{
"name": "Book service appointment",
"description": "Used when the customer wants to schedule a service appointment for their vehicle.",
"steps": [
{
"order": 1,
"description": "Ask the customer for their vehicle license plate or VIN.",
"intent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
],
"training": [
{
"content": "What does Volvo's standard warranty cover?",
"intent": "warranty_inquiry",
"response": "Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?"
}
],
"appointments": {
"enabled": True,
"random_assignment": True,
"schedule_assignments": [
{
"schedule_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Service Appointment",
"description": "When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.",
"slot_rules": {
"offer_slots_from": "3_hours",
"book_slots_from": "6_hours",
"max_appointments_per_day": 10,
"conflict_resolution_enabled": True,
"alternative_slots_count": 3,
"suggestion_priority": "nearest",
"prefer_same_day": True,
"prefer_same_time_slot": False,
"include_same_week": True
},
"rescheduling": {
"policy": "always_ask",
"minor_change_hours": 2,
"minor_change_same_day": True,
"minor_change_same_week": False,
"minor_change_same_slot": False,
"min_rescheduling_notice": "2_hours"
},
"cancellation": {
"min_cancellation_notice": "24_hours",
"ai_can_cancel": False,
"require_cancellation_reason": True,
"cancellation_fee_policy": "no_fee"
},
"questions": {
"inherit_from_schedule": True,
"custom_questions": [
{
"name": "License plate",
"type": "text",
"description": "Vehicle license plate number for the service appointment.",
"required": True
}
]
},
"approval": {
"require_approval": True,
"approval_threshold": "1_hour",
"approval_for_create": False,
"approval_for_reschedule": True,
"approval_for_cancel": True,
"approval_for_notes": False,
"notify_calendar_owner": "always",
"notify_admins": "always",
"expected_response_time": "5_min"
}
}
]
},
"routing_rules": [
{
"detection_mode": "intent",
"trigger_keyword": "sales",
"department_name": "Sales Department",
"phrases": ["I want to talk to sales"],
"ai_prompt": "Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.",
"voice_response": "Sure, I'll transfer you to our sales team now. One moment please.",
"voice_on_error": "I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.",
"voice_on_success": "You've been successfully connected. Have a great day.",
"destination_type": "extension",
"destination": "101",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transfer_type": "transfer_call",
"transfer_config": {},
"priority": 1,
"is_active": True
}
],
"guard_rules": [
{
"name": "Legal complaint escalation",
"when_condition": "Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.",
"example_phrases": ["I'm calling my lawyer about this"],
"then_action": "forward",
"selected_channels": [],
"say_before_forwarding": "I understand this is important — let me connect you with someone who can help.",
"say_before_end": "I'm sorry I couldn't help further. Please contact our team directly. Goodbye.",
"destination": "<string>",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": True,
"is_default": False
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Volvo Cagliari Service Agent',
description: 'Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.',
company_name: 'Volvo Cagliari',
role: 'Inbound service appointment scheduler for a Volvo dealership in Cagliari.',
objective: 'Book a service appointment for the customer\'s vehicle. Capture: VIN or license plate, preferred date, type of service.',
tone: 'Warm, professional, slightly formal. Use the customer\'s name. Avoid jargon — explain technical terms in plain language.',
behavior_guidelines: 'Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.',
company_service: 'Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.',
topic: 'Service appointment booking and vehicle maintenance questions.',
length_detail: 'Keep replies under 25 words for voice; under 200 characters for text. One question at a time.',
interest_of_product: '<string>',
negative_response: 'If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.',
custom_prompt: '<string>',
language: 'en',
timezone: 'America/New_York',
appointment_scheduling_enabled: true,
appointment_scheduling_randomly: true,
custom_llm_url: '<string>',
settings: {
voice: {
interaction: {
customer_speak_first: false,
inbound_first_message: 'Hi, this is Sara from Volvo. How can I help you today?',
outbound_first_message: 'Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?',
voice_mail_message: 'Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.',
end_call_message: 'Thank you for calling, have a great day!',
silence_message: 'Are you still there? I want to make sure I\'m helping you with what you need.',
max_silence_prompts: 3
},
interruption: {mode: 'balanced'},
voice_profile: {
language: 'en',
voice_uuid: 'ebeba3e0-89b5-4c94-9841-9555ab155dbc',
voice_name: 'Giulia'
},
call_behavior: {
audio_recording: true,
background_sound: true,
silence_timeout_seconds: 60,
max_call_duration_seconds: 1800,
max_call_duration_message: 'Thanks for the call — we\'ve reached the time limit. Goodbye!'
},
compliance: {eu_gdpr_compliance: true, hipaa_compliance: false},
normalizers: {outbound: {}, inbound: {}}
},
text: {
daily_limits: {
daily_max_messages_per_conversation: 100,
daily_conversation_limit_exceeded_message: '<string>'
},
timing_and_delay: {
base_delay: 0.5,
pause_before_reply: 1,
typing_speed_wpm_min: 40,
typing_speed_wpm_max: 60,
typing_speed_char: 0.05,
delay_jitter_min: 0.1,
delay_jitter_max: 1.5
},
typing_simulation: {
show_typing_indicator: true,
simulate_typing_breaks: true,
simulate_typos_corrections: false
},
working_hours: {
enabled: false,
start: '9 AM',
end: '5 PM',
timezone: 'America/New_York',
outside_hours_behavior: 'Auto-reply',
offline_message: '<string>',
during_hours_agent: 'ai'
},
handover: {
enabled: false,
handover_triggers: 'User request',
handover_method: 'Assign agent',
handover_message: '<string>',
assignment_strategy: 'First available',
handover_timeout: 60,
fallback_agent: 'Bot assistant',
release_after_minutes: 0,
release_channels: ['whatsapp', 'instagram']
},
confidence_controls: {min_confidence_threshold: 0.7, ask_clarifying_questions: false},
message_behavior: {
second_message_behavior: {enabled: false, chance: 0.25, delay_min: 1, delay_max: 4},
follow_up_behavior: {enabled: false, delay_min: 24, delay_max: 48}
},
personality: {
use_response_variations: true,
emoji_usage: 'None',
use_punctuation_variation: false,
use_filler_words: false,
enable_small_talk: false,
energy_level: 'Friendly',
empathy_level: 'Medium'
},
advanced: {
split_messages: true,
simulate_message_editing: false,
use_memory_based_context: false,
human_first_mode: false
},
email: {signature: '<p>—<br>Jane, Acme Support</p>'}
}
},
guidelines: [
{
content: 'Always confirm vehicle VIN or license plate before creating a service appointment.',
order: 0
}
],
notes: [
{
content: 'Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.',
order: 0
}
],
procedures: [
{
name: 'Book service appointment',
description: 'Used when the customer wants to schedule a service appointment for their vehicle.',
steps: [
{
order: 1,
description: 'Ask the customer for their vehicle license plate or VIN.',
intent_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
]
}
],
training: [
{
content: 'What does Volvo\'s standard warranty cover?',
intent: 'warranty_inquiry',
response: 'Volvo\'s standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?'
}
],
appointments: {
enabled: true,
random_assignment: true,
schedule_assignments: [
{
schedule_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: 'Service Appointment',
description: 'When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.',
slot_rules: {
offer_slots_from: '3_hours',
book_slots_from: '6_hours',
max_appointments_per_day: 10,
conflict_resolution_enabled: true,
alternative_slots_count: 3,
suggestion_priority: 'nearest',
prefer_same_day: true,
prefer_same_time_slot: false,
include_same_week: true
},
rescheduling: {
policy: 'always_ask',
minor_change_hours: 2,
minor_change_same_day: true,
minor_change_same_week: false,
minor_change_same_slot: false,
min_rescheduling_notice: '2_hours'
},
cancellation: {
min_cancellation_notice: '24_hours',
ai_can_cancel: false,
require_cancellation_reason: true,
cancellation_fee_policy: 'no_fee'
},
questions: {
inherit_from_schedule: true,
custom_questions: [
{
name: 'License plate',
type: 'text',
description: 'Vehicle license plate number for the service appointment.',
required: true
}
]
},
approval: {
require_approval: true,
approval_threshold: '1_hour',
approval_for_create: false,
approval_for_reschedule: true,
approval_for_cancel: true,
approval_for_notes: false,
notify_calendar_owner: 'always',
notify_admins: 'always',
expected_response_time: '5_min'
}
}
]
},
routing_rules: [
{
detection_mode: 'intent',
trigger_keyword: 'sales',
department_name: 'Sales Department',
phrases: ['I want to talk to sales'],
ai_prompt: 'Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.',
voice_response: 'Sure, I\'ll transfer you to our sales team now. One moment please.',
voice_on_error: 'I\'m sorry, I couldn\'t reach sales right now. Please call back later or leave a message.',
voice_on_success: 'You\'ve been successfully connected. Have a great day.',
destination_type: 'extension',
destination: '101',
destination_agent_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
transfer_type: 'transfer_call',
transfer_config: {},
priority: 1,
is_active: true
}
],
guard_rules: [
{
name: 'Legal complaint escalation',
when_condition: 'Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.',
example_phrases: ['I\'m calling my lawyer about this'],
then_action: 'forward',
selected_channels: [],
say_before_forwarding: 'I understand this is important — let me connect you with someone who can help.',
say_before_end: 'I\'m sorry I couldn\'t help further. Please contact our team directly. Goodbye.',
destination: '<string>',
destination_agent_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
is_active: true,
is_default: false
}
]
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/agents/{uuid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.mihu.ai/api/v1/agents/{uuid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Volvo Cagliari Service Agent',
'description' => 'Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.',
'company_name' => 'Volvo Cagliari',
'role' => 'Inbound service appointment scheduler for a Volvo dealership in Cagliari.',
'objective' => 'Book a service appointment for the customer\'s vehicle. Capture: VIN or license plate, preferred date, type of service.',
'tone' => 'Warm, professional, slightly formal. Use the customer\'s name. Avoid jargon — explain technical terms in plain language.',
'behavior_guidelines' => 'Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.',
'company_service' => 'Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.',
'topic' => 'Service appointment booking and vehicle maintenance questions.',
'length_detail' => 'Keep replies under 25 words for voice; under 200 characters for text. One question at a time.',
'interest_of_product' => '<string>',
'negative_response' => 'If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.',
'custom_prompt' => '<string>',
'language' => 'en',
'timezone' => 'America/New_York',
'appointment_scheduling_enabled' => true,
'appointment_scheduling_randomly' => true,
'custom_llm_url' => '<string>',
'settings' => [
'voice' => [
'interaction' => [
'customer_speak_first' => false,
'inbound_first_message' => 'Hi, this is Sara from Volvo. How can I help you today?',
'outbound_first_message' => 'Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?',
'voice_mail_message' => 'Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.',
'end_call_message' => 'Thank you for calling, have a great day!',
'silence_message' => 'Are you still there? I want to make sure I\'m helping you with what you need.',
'max_silence_prompts' => 3
],
'interruption' => [
'mode' => 'balanced'
],
'voice_profile' => [
'language' => 'en',
'voice_uuid' => 'ebeba3e0-89b5-4c94-9841-9555ab155dbc',
'voice_name' => 'Giulia'
],
'call_behavior' => [
'audio_recording' => true,
'background_sound' => true,
'silence_timeout_seconds' => 60,
'max_call_duration_seconds' => 1800,
'max_call_duration_message' => 'Thanks for the call — we\'ve reached the time limit. Goodbye!'
],
'compliance' => [
'eu_gdpr_compliance' => true,
'hipaa_compliance' => false
],
'normalizers' => [
'outbound' => [
],
'inbound' => [
]
]
],
'text' => [
'daily_limits' => [
'daily_max_messages_per_conversation' => 100,
'daily_conversation_limit_exceeded_message' => '<string>'
],
'timing_and_delay' => [
'base_delay' => 0.5,
'pause_before_reply' => 1,
'typing_speed_wpm_min' => 40,
'typing_speed_wpm_max' => 60,
'typing_speed_char' => 0.05,
'delay_jitter_min' => 0.1,
'delay_jitter_max' => 1.5
],
'typing_simulation' => [
'show_typing_indicator' => true,
'simulate_typing_breaks' => true,
'simulate_typos_corrections' => false
],
'working_hours' => [
'enabled' => false,
'start' => '9 AM',
'end' => '5 PM',
'timezone' => 'America/New_York',
'outside_hours_behavior' => 'Auto-reply',
'offline_message' => '<string>',
'during_hours_agent' => 'ai'
],
'handover' => [
'enabled' => false,
'handover_triggers' => 'User request',
'handover_method' => 'Assign agent',
'handover_message' => '<string>',
'assignment_strategy' => 'First available',
'handover_timeout' => 60,
'fallback_agent' => 'Bot assistant',
'release_after_minutes' => 0,
'release_channels' => [
'whatsapp',
'instagram'
]
],
'confidence_controls' => [
'min_confidence_threshold' => 0.7,
'ask_clarifying_questions' => false
],
'message_behavior' => [
'second_message_behavior' => [
'enabled' => false,
'chance' => 0.25,
'delay_min' => 1,
'delay_max' => 4
],
'follow_up_behavior' => [
'enabled' => false,
'delay_min' => 24,
'delay_max' => 48
]
],
'personality' => [
'use_response_variations' => true,
'emoji_usage' => 'None',
'use_punctuation_variation' => false,
'use_filler_words' => false,
'enable_small_talk' => false,
'energy_level' => 'Friendly',
'empathy_level' => 'Medium'
],
'advanced' => [
'split_messages' => true,
'simulate_message_editing' => false,
'use_memory_based_context' => false,
'human_first_mode' => false
],
'email' => [
'signature' => '<p>—<br>Jane, Acme Support</p>'
]
]
],
'guidelines' => [
[
'content' => 'Always confirm vehicle VIN or license plate before creating a service appointment.',
'order' => 0
]
],
'notes' => [
[
'content' => 'Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.',
'order' => 0
]
],
'procedures' => [
[
'name' => 'Book service appointment',
'description' => 'Used when the customer wants to schedule a service appointment for their vehicle.',
'steps' => [
[
'order' => 1,
'description' => 'Ask the customer for their vehicle license plate or VIN.',
'intent_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]
],
'training' => [
[
'content' => 'What does Volvo\'s standard warranty cover?',
'intent' => 'warranty_inquiry',
'response' => 'Volvo\'s standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?'
]
],
'appointments' => [
'enabled' => true,
'random_assignment' => true,
'schedule_assignments' => [
[
'schedule_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => 'Service Appointment',
'description' => 'When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.',
'slot_rules' => [
'offer_slots_from' => '3_hours',
'book_slots_from' => '6_hours',
'max_appointments_per_day' => 10,
'conflict_resolution_enabled' => true,
'alternative_slots_count' => 3,
'suggestion_priority' => 'nearest',
'prefer_same_day' => true,
'prefer_same_time_slot' => false,
'include_same_week' => true
],
'rescheduling' => [
'policy' => 'always_ask',
'minor_change_hours' => 2,
'minor_change_same_day' => true,
'minor_change_same_week' => false,
'minor_change_same_slot' => false,
'min_rescheduling_notice' => '2_hours'
],
'cancellation' => [
'min_cancellation_notice' => '24_hours',
'ai_can_cancel' => false,
'require_cancellation_reason' => true,
'cancellation_fee_policy' => 'no_fee'
],
'questions' => [
'inherit_from_schedule' => true,
'custom_questions' => [
[
'name' => 'License plate',
'type' => 'text',
'description' => 'Vehicle license plate number for the service appointment.',
'required' => true
]
]
],
'approval' => [
'require_approval' => true,
'approval_threshold' => '1_hour',
'approval_for_create' => false,
'approval_for_reschedule' => true,
'approval_for_cancel' => true,
'approval_for_notes' => false,
'notify_calendar_owner' => 'always',
'notify_admins' => 'always',
'expected_response_time' => '5_min'
]
]
]
],
'routing_rules' => [
[
'detection_mode' => 'intent',
'trigger_keyword' => 'sales',
'department_name' => 'Sales Department',
'phrases' => [
'I want to talk to sales'
],
'ai_prompt' => 'Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.',
'voice_response' => 'Sure, I\'ll transfer you to our sales team now. One moment please.',
'voice_on_error' => 'I\'m sorry, I couldn\'t reach sales right now. Please call back later or leave a message.',
'voice_on_success' => 'You\'ve been successfully connected. Have a great day.',
'destination_type' => 'extension',
'destination' => '101',
'destination_agent_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'transfer_type' => 'transfer_call',
'transfer_config' => [
],
'priority' => 1,
'is_active' => true
]
],
'guard_rules' => [
[
'name' => 'Legal complaint escalation',
'when_condition' => 'Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.',
'example_phrases' => [
'I\'m calling my lawyer about this'
],
'then_action' => 'forward',
'selected_channels' => [
],
'say_before_forwarding' => 'I understand this is important — let me connect you with someone who can help.',
'say_before_end' => 'I\'m sorry I couldn\'t help further. Please contact our team directly. Goodbye.',
'destination' => '<string>',
'destination_agent_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'is_active' => true,
'is_default' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.mihu.ai/api/v1/agents/{uuid}"
payload := strings.NewReader("{\n \"name\": \"Volvo Cagliari Service Agent\",\n \"description\": \"Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.\",\n \"company_name\": \"Volvo Cagliari\",\n \"role\": \"Inbound service appointment scheduler for a Volvo dealership in Cagliari.\",\n \"objective\": \"Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service.\",\n \"tone\": \"Warm, professional, slightly formal. Use the customer's name. Avoid jargon — explain technical terms in plain language.\",\n \"behavior_guidelines\": \"Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.\",\n \"company_service\": \"Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.\",\n \"topic\": \"Service appointment booking and vehicle maintenance questions.\",\n \"length_detail\": \"Keep replies under 25 words for voice; under 200 characters for text. One question at a time.\",\n \"interest_of_product\": \"<string>\",\n \"negative_response\": \"If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.\",\n \"custom_prompt\": \"<string>\",\n \"language\": \"en\",\n \"timezone\": \"America/New_York\",\n \"appointment_scheduling_enabled\": true,\n \"appointment_scheduling_randomly\": true,\n \"custom_llm_url\": \"<string>\",\n \"settings\": {\n \"voice\": {\n \"interaction\": {\n \"customer_speak_first\": false,\n \"inbound_first_message\": \"Hi, this is Sara from Volvo. How can I help you today?\",\n \"outbound_first_message\": \"Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?\",\n \"voice_mail_message\": \"Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.\",\n \"end_call_message\": \"Thank you for calling, have a great day!\",\n \"silence_message\": \"Are you still there? I want to make sure I'm helping you with what you need.\",\n \"max_silence_prompts\": 3\n },\n \"interruption\": {\n \"mode\": \"balanced\"\n },\n \"voice_profile\": {\n \"language\": \"en\",\n \"voice_uuid\": \"ebeba3e0-89b5-4c94-9841-9555ab155dbc\",\n \"voice_name\": \"Giulia\"\n },\n \"call_behavior\": {\n \"audio_recording\": true,\n \"background_sound\": true,\n \"silence_timeout_seconds\": 60,\n \"max_call_duration_seconds\": 1800,\n \"max_call_duration_message\": \"Thanks for the call — we've reached the time limit. Goodbye!\"\n },\n \"compliance\": {\n \"eu_gdpr_compliance\": true,\n \"hipaa_compliance\": false\n },\n \"normalizers\": {\n \"outbound\": {},\n \"inbound\": {}\n }\n },\n \"text\": {\n \"daily_limits\": {\n \"daily_max_messages_per_conversation\": 100,\n \"daily_conversation_limit_exceeded_message\": \"<string>\"\n },\n \"timing_and_delay\": {\n \"base_delay\": 0.5,\n \"pause_before_reply\": 1,\n \"typing_speed_wpm_min\": 40,\n \"typing_speed_wpm_max\": 60,\n \"typing_speed_char\": 0.05,\n \"delay_jitter_min\": 0.1,\n \"delay_jitter_max\": 1.5\n },\n \"typing_simulation\": {\n \"show_typing_indicator\": true,\n \"simulate_typing_breaks\": true,\n \"simulate_typos_corrections\": false\n },\n \"working_hours\": {\n \"enabled\": false,\n \"start\": \"9 AM\",\n \"end\": \"5 PM\",\n \"timezone\": \"America/New_York\",\n \"outside_hours_behavior\": \"Auto-reply\",\n \"offline_message\": \"<string>\",\n \"during_hours_agent\": \"ai\"\n },\n \"handover\": {\n \"enabled\": false,\n \"handover_triggers\": \"User request\",\n \"handover_method\": \"Assign agent\",\n \"handover_message\": \"<string>\",\n \"assignment_strategy\": \"First available\",\n \"handover_timeout\": 60,\n \"fallback_agent\": \"Bot assistant\",\n \"release_after_minutes\": 0,\n \"release_channels\": [\n \"whatsapp\",\n \"instagram\"\n ]\n },\n \"confidence_controls\": {\n \"min_confidence_threshold\": 0.7,\n \"ask_clarifying_questions\": false\n },\n \"message_behavior\": {\n \"second_message_behavior\": {\n \"enabled\": false,\n \"chance\": 0.25,\n \"delay_min\": 1,\n \"delay_max\": 4\n },\n \"follow_up_behavior\": {\n \"enabled\": false,\n \"delay_min\": 24,\n \"delay_max\": 48\n }\n },\n \"personality\": {\n \"use_response_variations\": true,\n \"emoji_usage\": \"None\",\n \"use_punctuation_variation\": false,\n \"use_filler_words\": false,\n \"enable_small_talk\": false,\n \"energy_level\": \"Friendly\",\n \"empathy_level\": \"Medium\"\n },\n \"advanced\": {\n \"split_messages\": true,\n \"simulate_message_editing\": false,\n \"use_memory_based_context\": false,\n \"human_first_mode\": false\n },\n \"email\": {\n \"signature\": \"<p>—<br>Jane, Acme Support</p>\"\n }\n }\n },\n \"guidelines\": [\n {\n \"content\": \"Always confirm vehicle VIN or license plate before creating a service appointment.\",\n \"order\": 0\n }\n ],\n \"notes\": [\n {\n \"content\": \"Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.\",\n \"order\": 0\n }\n ],\n \"procedures\": [\n {\n \"name\": \"Book service appointment\",\n \"description\": \"Used when the customer wants to schedule a service appointment for their vehicle.\",\n \"steps\": [\n {\n \"order\": 1,\n \"description\": \"Ask the customer for their vehicle license plate or VIN.\",\n \"intent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n }\n ],\n \"training\": [\n {\n \"content\": \"What does Volvo's standard warranty cover?\",\n \"intent\": \"warranty_inquiry\",\n \"response\": \"Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?\"\n }\n ],\n \"appointments\": {\n \"enabled\": true,\n \"random_assignment\": true,\n \"schedule_assignments\": [\n {\n \"schedule_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Service Appointment\",\n \"description\": \"When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.\",\n \"slot_rules\": {\n \"offer_slots_from\": \"3_hours\",\n \"book_slots_from\": \"6_hours\",\n \"max_appointments_per_day\": 10,\n \"conflict_resolution_enabled\": true,\n \"alternative_slots_count\": 3,\n \"suggestion_priority\": \"nearest\",\n \"prefer_same_day\": true,\n \"prefer_same_time_slot\": false,\n \"include_same_week\": true\n },\n \"rescheduling\": {\n \"policy\": \"always_ask\",\n \"minor_change_hours\": 2,\n \"minor_change_same_day\": true,\n \"minor_change_same_week\": false,\n \"minor_change_same_slot\": false,\n \"min_rescheduling_notice\": \"2_hours\"\n },\n \"cancellation\": {\n \"min_cancellation_notice\": \"24_hours\",\n \"ai_can_cancel\": false,\n \"require_cancellation_reason\": true,\n \"cancellation_fee_policy\": \"no_fee\"\n },\n \"questions\": {\n \"inherit_from_schedule\": true,\n \"custom_questions\": [\n {\n \"name\": \"License plate\",\n \"type\": \"text\",\n \"description\": \"Vehicle license plate number for the service appointment.\",\n \"required\": true\n }\n ]\n },\n \"approval\": {\n \"require_approval\": true,\n \"approval_threshold\": \"1_hour\",\n \"approval_for_create\": false,\n \"approval_for_reschedule\": true,\n \"approval_for_cancel\": true,\n \"approval_for_notes\": false,\n \"notify_calendar_owner\": \"always\",\n \"notify_admins\": \"always\",\n \"expected_response_time\": \"5_min\"\n }\n }\n ]\n },\n \"routing_rules\": [\n {\n \"detection_mode\": \"intent\",\n \"trigger_keyword\": \"sales\",\n \"department_name\": \"Sales Department\",\n \"phrases\": [\n \"I want to talk to sales\"\n ],\n \"ai_prompt\": \"Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.\",\n \"voice_response\": \"Sure, I'll transfer you to our sales team now. One moment please.\",\n \"voice_on_error\": \"I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.\",\n \"voice_on_success\": \"You've been successfully connected. Have a great day.\",\n \"destination_type\": \"extension\",\n \"destination\": \"101\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transfer_type\": \"transfer_call\",\n \"transfer_config\": {},\n \"priority\": 1,\n \"is_active\": true\n }\n ],\n \"guard_rules\": [\n {\n \"name\": \"Legal complaint escalation\",\n \"when_condition\": \"Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.\",\n \"example_phrases\": [\n \"I'm calling my lawyer about this\"\n ],\n \"then_action\": \"forward\",\n \"selected_channels\": [],\n \"say_before_forwarding\": \"I understand this is important — let me connect you with someone who can help.\",\n \"say_before_end\": \"I'm sorry I couldn't help further. Please contact our team directly. Goodbye.\",\n \"destination\": \"<string>\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"is_default\": false\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{subdomain}.mihu.ai/api/v1/agents/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Volvo Cagliari Service Agent\",\n \"description\": \"Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.\",\n \"company_name\": \"Volvo Cagliari\",\n \"role\": \"Inbound service appointment scheduler for a Volvo dealership in Cagliari.\",\n \"objective\": \"Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service.\",\n \"tone\": \"Warm, professional, slightly formal. Use the customer's name. Avoid jargon — explain technical terms in plain language.\",\n \"behavior_guidelines\": \"Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.\",\n \"company_service\": \"Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.\",\n \"topic\": \"Service appointment booking and vehicle maintenance questions.\",\n \"length_detail\": \"Keep replies under 25 words for voice; under 200 characters for text. One question at a time.\",\n \"interest_of_product\": \"<string>\",\n \"negative_response\": \"If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.\",\n \"custom_prompt\": \"<string>\",\n \"language\": \"en\",\n \"timezone\": \"America/New_York\",\n \"appointment_scheduling_enabled\": true,\n \"appointment_scheduling_randomly\": true,\n \"custom_llm_url\": \"<string>\",\n \"settings\": {\n \"voice\": {\n \"interaction\": {\n \"customer_speak_first\": false,\n \"inbound_first_message\": \"Hi, this is Sara from Volvo. How can I help you today?\",\n \"outbound_first_message\": \"Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?\",\n \"voice_mail_message\": \"Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.\",\n \"end_call_message\": \"Thank you for calling, have a great day!\",\n \"silence_message\": \"Are you still there? I want to make sure I'm helping you with what you need.\",\n \"max_silence_prompts\": 3\n },\n \"interruption\": {\n \"mode\": \"balanced\"\n },\n \"voice_profile\": {\n \"language\": \"en\",\n \"voice_uuid\": \"ebeba3e0-89b5-4c94-9841-9555ab155dbc\",\n \"voice_name\": \"Giulia\"\n },\n \"call_behavior\": {\n \"audio_recording\": true,\n \"background_sound\": true,\n \"silence_timeout_seconds\": 60,\n \"max_call_duration_seconds\": 1800,\n \"max_call_duration_message\": \"Thanks for the call — we've reached the time limit. Goodbye!\"\n },\n \"compliance\": {\n \"eu_gdpr_compliance\": true,\n \"hipaa_compliance\": false\n },\n \"normalizers\": {\n \"outbound\": {},\n \"inbound\": {}\n }\n },\n \"text\": {\n \"daily_limits\": {\n \"daily_max_messages_per_conversation\": 100,\n \"daily_conversation_limit_exceeded_message\": \"<string>\"\n },\n \"timing_and_delay\": {\n \"base_delay\": 0.5,\n \"pause_before_reply\": 1,\n \"typing_speed_wpm_min\": 40,\n \"typing_speed_wpm_max\": 60,\n \"typing_speed_char\": 0.05,\n \"delay_jitter_min\": 0.1,\n \"delay_jitter_max\": 1.5\n },\n \"typing_simulation\": {\n \"show_typing_indicator\": true,\n \"simulate_typing_breaks\": true,\n \"simulate_typos_corrections\": false\n },\n \"working_hours\": {\n \"enabled\": false,\n \"start\": \"9 AM\",\n \"end\": \"5 PM\",\n \"timezone\": \"America/New_York\",\n \"outside_hours_behavior\": \"Auto-reply\",\n \"offline_message\": \"<string>\",\n \"during_hours_agent\": \"ai\"\n },\n \"handover\": {\n \"enabled\": false,\n \"handover_triggers\": \"User request\",\n \"handover_method\": \"Assign agent\",\n \"handover_message\": \"<string>\",\n \"assignment_strategy\": \"First available\",\n \"handover_timeout\": 60,\n \"fallback_agent\": \"Bot assistant\",\n \"release_after_minutes\": 0,\n \"release_channels\": [\n \"whatsapp\",\n \"instagram\"\n ]\n },\n \"confidence_controls\": {\n \"min_confidence_threshold\": 0.7,\n \"ask_clarifying_questions\": false\n },\n \"message_behavior\": {\n \"second_message_behavior\": {\n \"enabled\": false,\n \"chance\": 0.25,\n \"delay_min\": 1,\n \"delay_max\": 4\n },\n \"follow_up_behavior\": {\n \"enabled\": false,\n \"delay_min\": 24,\n \"delay_max\": 48\n }\n },\n \"personality\": {\n \"use_response_variations\": true,\n \"emoji_usage\": \"None\",\n \"use_punctuation_variation\": false,\n \"use_filler_words\": false,\n \"enable_small_talk\": false,\n \"energy_level\": \"Friendly\",\n \"empathy_level\": \"Medium\"\n },\n \"advanced\": {\n \"split_messages\": true,\n \"simulate_message_editing\": false,\n \"use_memory_based_context\": false,\n \"human_first_mode\": false\n },\n \"email\": {\n \"signature\": \"<p>—<br>Jane, Acme Support</p>\"\n }\n }\n },\n \"guidelines\": [\n {\n \"content\": \"Always confirm vehicle VIN or license plate before creating a service appointment.\",\n \"order\": 0\n }\n ],\n \"notes\": [\n {\n \"content\": \"Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.\",\n \"order\": 0\n }\n ],\n \"procedures\": [\n {\n \"name\": \"Book service appointment\",\n \"description\": \"Used when the customer wants to schedule a service appointment for their vehicle.\",\n \"steps\": [\n {\n \"order\": 1,\n \"description\": \"Ask the customer for their vehicle license plate or VIN.\",\n \"intent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n }\n ],\n \"training\": [\n {\n \"content\": \"What does Volvo's standard warranty cover?\",\n \"intent\": \"warranty_inquiry\",\n \"response\": \"Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?\"\n }\n ],\n \"appointments\": {\n \"enabled\": true,\n \"random_assignment\": true,\n \"schedule_assignments\": [\n {\n \"schedule_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Service Appointment\",\n \"description\": \"When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.\",\n \"slot_rules\": {\n \"offer_slots_from\": \"3_hours\",\n \"book_slots_from\": \"6_hours\",\n \"max_appointments_per_day\": 10,\n \"conflict_resolution_enabled\": true,\n \"alternative_slots_count\": 3,\n \"suggestion_priority\": \"nearest\",\n \"prefer_same_day\": true,\n \"prefer_same_time_slot\": false,\n \"include_same_week\": true\n },\n \"rescheduling\": {\n \"policy\": \"always_ask\",\n \"minor_change_hours\": 2,\n \"minor_change_same_day\": true,\n \"minor_change_same_week\": false,\n \"minor_change_same_slot\": false,\n \"min_rescheduling_notice\": \"2_hours\"\n },\n \"cancellation\": {\n \"min_cancellation_notice\": \"24_hours\",\n \"ai_can_cancel\": false,\n \"require_cancellation_reason\": true,\n \"cancellation_fee_policy\": \"no_fee\"\n },\n \"questions\": {\n \"inherit_from_schedule\": true,\n \"custom_questions\": [\n {\n \"name\": \"License plate\",\n \"type\": \"text\",\n \"description\": \"Vehicle license plate number for the service appointment.\",\n \"required\": true\n }\n ]\n },\n \"approval\": {\n \"require_approval\": true,\n \"approval_threshold\": \"1_hour\",\n \"approval_for_create\": false,\n \"approval_for_reschedule\": true,\n \"approval_for_cancel\": true,\n \"approval_for_notes\": false,\n \"notify_calendar_owner\": \"always\",\n \"notify_admins\": \"always\",\n \"expected_response_time\": \"5_min\"\n }\n }\n ]\n },\n \"routing_rules\": [\n {\n \"detection_mode\": \"intent\",\n \"trigger_keyword\": \"sales\",\n \"department_name\": \"Sales Department\",\n \"phrases\": [\n \"I want to talk to sales\"\n ],\n \"ai_prompt\": \"Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.\",\n \"voice_response\": \"Sure, I'll transfer you to our sales team now. One moment please.\",\n \"voice_on_error\": \"I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.\",\n \"voice_on_success\": \"You've been successfully connected. Have a great day.\",\n \"destination_type\": \"extension\",\n \"destination\": \"101\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transfer_type\": \"transfer_call\",\n \"transfer_config\": {},\n \"priority\": 1,\n \"is_active\": true\n }\n ],\n \"guard_rules\": [\n {\n \"name\": \"Legal complaint escalation\",\n \"when_condition\": \"Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.\",\n \"example_phrases\": [\n \"I'm calling my lawyer about this\"\n ],\n \"then_action\": \"forward\",\n \"selected_channels\": [],\n \"say_before_forwarding\": \"I understand this is important — let me connect you with someone who can help.\",\n \"say_before_end\": \"I'm sorry I couldn't help further. Please contact our team directly. Goodbye.\",\n \"destination\": \"<string>\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"is_default\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/agents/{uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Volvo Cagliari Service Agent\",\n \"description\": \"Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases.\",\n \"company_name\": \"Volvo Cagliari\",\n \"role\": \"Inbound service appointment scheduler for a Volvo dealership in Cagliari.\",\n \"objective\": \"Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service.\",\n \"tone\": \"Warm, professional, slightly formal. Use the customer's name. Avoid jargon — explain technical terms in plain language.\",\n \"behavior_guidelines\": \"Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager.\",\n \"company_service\": \"Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery.\",\n \"topic\": \"Service appointment booking and vehicle maintenance questions.\",\n \"length_detail\": \"Keep replies under 25 words for voice; under 200 characters for text. One question at a time.\",\n \"interest_of_product\": \"<string>\",\n \"negative_response\": \"If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor.\",\n \"custom_prompt\": \"<string>\",\n \"language\": \"en\",\n \"timezone\": \"America/New_York\",\n \"appointment_scheduling_enabled\": true,\n \"appointment_scheduling_randomly\": true,\n \"custom_llm_url\": \"<string>\",\n \"settings\": {\n \"voice\": {\n \"interaction\": {\n \"customer_speak_first\": false,\n \"inbound_first_message\": \"Hi, this is Sara from Volvo. How can I help you today?\",\n \"outbound_first_message\": \"Hi, this is Sara from Volvo Cagliari calling about your service appointment. Do you have a moment to talk?\",\n \"voice_mail_message\": \"Hi, this is Sara from Volvo Cagliari. I called about your service appointment — please call us back at your convenience.\",\n \"end_call_message\": \"Thank you for calling, have a great day!\",\n \"silence_message\": \"Are you still there? I want to make sure I'm helping you with what you need.\",\n \"max_silence_prompts\": 3\n },\n \"interruption\": {\n \"mode\": \"balanced\"\n },\n \"voice_profile\": {\n \"language\": \"en\",\n \"voice_uuid\": \"ebeba3e0-89b5-4c94-9841-9555ab155dbc\",\n \"voice_name\": \"Giulia\"\n },\n \"call_behavior\": {\n \"audio_recording\": true,\n \"background_sound\": true,\n \"silence_timeout_seconds\": 60,\n \"max_call_duration_seconds\": 1800,\n \"max_call_duration_message\": \"Thanks for the call — we've reached the time limit. Goodbye!\"\n },\n \"compliance\": {\n \"eu_gdpr_compliance\": true,\n \"hipaa_compliance\": false\n },\n \"normalizers\": {\n \"outbound\": {},\n \"inbound\": {}\n }\n },\n \"text\": {\n \"daily_limits\": {\n \"daily_max_messages_per_conversation\": 100,\n \"daily_conversation_limit_exceeded_message\": \"<string>\"\n },\n \"timing_and_delay\": {\n \"base_delay\": 0.5,\n \"pause_before_reply\": 1,\n \"typing_speed_wpm_min\": 40,\n \"typing_speed_wpm_max\": 60,\n \"typing_speed_char\": 0.05,\n \"delay_jitter_min\": 0.1,\n \"delay_jitter_max\": 1.5\n },\n \"typing_simulation\": {\n \"show_typing_indicator\": true,\n \"simulate_typing_breaks\": true,\n \"simulate_typos_corrections\": false\n },\n \"working_hours\": {\n \"enabled\": false,\n \"start\": \"9 AM\",\n \"end\": \"5 PM\",\n \"timezone\": \"America/New_York\",\n \"outside_hours_behavior\": \"Auto-reply\",\n \"offline_message\": \"<string>\",\n \"during_hours_agent\": \"ai\"\n },\n \"handover\": {\n \"enabled\": false,\n \"handover_triggers\": \"User request\",\n \"handover_method\": \"Assign agent\",\n \"handover_message\": \"<string>\",\n \"assignment_strategy\": \"First available\",\n \"handover_timeout\": 60,\n \"fallback_agent\": \"Bot assistant\",\n \"release_after_minutes\": 0,\n \"release_channels\": [\n \"whatsapp\",\n \"instagram\"\n ]\n },\n \"confidence_controls\": {\n \"min_confidence_threshold\": 0.7,\n \"ask_clarifying_questions\": false\n },\n \"message_behavior\": {\n \"second_message_behavior\": {\n \"enabled\": false,\n \"chance\": 0.25,\n \"delay_min\": 1,\n \"delay_max\": 4\n },\n \"follow_up_behavior\": {\n \"enabled\": false,\n \"delay_min\": 24,\n \"delay_max\": 48\n }\n },\n \"personality\": {\n \"use_response_variations\": true,\n \"emoji_usage\": \"None\",\n \"use_punctuation_variation\": false,\n \"use_filler_words\": false,\n \"enable_small_talk\": false,\n \"energy_level\": \"Friendly\",\n \"empathy_level\": \"Medium\"\n },\n \"advanced\": {\n \"split_messages\": true,\n \"simulate_message_editing\": false,\n \"use_memory_based_context\": false,\n \"human_first_mode\": false\n },\n \"email\": {\n \"signature\": \"<p>—<br>Jane, Acme Support</p>\"\n }\n }\n },\n \"guidelines\": [\n {\n \"content\": \"Always confirm vehicle VIN or license plate before creating a service appointment.\",\n \"order\": 0\n }\n ],\n \"notes\": [\n {\n \"content\": \"Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.\",\n \"order\": 0\n }\n ],\n \"procedures\": [\n {\n \"name\": \"Book service appointment\",\n \"description\": \"Used when the customer wants to schedule a service appointment for their vehicle.\",\n \"steps\": [\n {\n \"order\": 1,\n \"description\": \"Ask the customer for their vehicle license plate or VIN.\",\n \"intent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n }\n ],\n \"training\": [\n {\n \"content\": \"What does Volvo's standard warranty cover?\",\n \"intent\": \"warranty_inquiry\",\n \"response\": \"Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?\"\n }\n ],\n \"appointments\": {\n \"enabled\": true,\n \"random_assignment\": true,\n \"schedule_assignments\": [\n {\n \"schedule_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"Service Appointment\",\n \"description\": \"When the customer requires routine maintenance, oil change, or scheduled service for their vehicle.\",\n \"slot_rules\": {\n \"offer_slots_from\": \"3_hours\",\n \"book_slots_from\": \"6_hours\",\n \"max_appointments_per_day\": 10,\n \"conflict_resolution_enabled\": true,\n \"alternative_slots_count\": 3,\n \"suggestion_priority\": \"nearest\",\n \"prefer_same_day\": true,\n \"prefer_same_time_slot\": false,\n \"include_same_week\": true\n },\n \"rescheduling\": {\n \"policy\": \"always_ask\",\n \"minor_change_hours\": 2,\n \"minor_change_same_day\": true,\n \"minor_change_same_week\": false,\n \"minor_change_same_slot\": false,\n \"min_rescheduling_notice\": \"2_hours\"\n },\n \"cancellation\": {\n \"min_cancellation_notice\": \"24_hours\",\n \"ai_can_cancel\": false,\n \"require_cancellation_reason\": true,\n \"cancellation_fee_policy\": \"no_fee\"\n },\n \"questions\": {\n \"inherit_from_schedule\": true,\n \"custom_questions\": [\n {\n \"name\": \"License plate\",\n \"type\": \"text\",\n \"description\": \"Vehicle license plate number for the service appointment.\",\n \"required\": true\n }\n ]\n },\n \"approval\": {\n \"require_approval\": true,\n \"approval_threshold\": \"1_hour\",\n \"approval_for_create\": false,\n \"approval_for_reschedule\": true,\n \"approval_for_cancel\": true,\n \"approval_for_notes\": false,\n \"notify_calendar_owner\": \"always\",\n \"notify_admins\": \"always\",\n \"expected_response_time\": \"5_min\"\n }\n }\n ]\n },\n \"routing_rules\": [\n {\n \"detection_mode\": \"intent\",\n \"trigger_keyword\": \"sales\",\n \"department_name\": \"Sales Department\",\n \"phrases\": [\n \"I want to talk to sales\"\n ],\n \"ai_prompt\": \"Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.\",\n \"voice_response\": \"Sure, I'll transfer you to our sales team now. One moment please.\",\n \"voice_on_error\": \"I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.\",\n \"voice_on_success\": \"You've been successfully connected. Have a great day.\",\n \"destination_type\": \"extension\",\n \"destination\": \"101\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"transfer_type\": \"transfer_call\",\n \"transfer_config\": {},\n \"priority\": 1,\n \"is_active\": true\n }\n ],\n \"guard_rules\": [\n {\n \"name\": \"Legal complaint escalation\",\n \"when_condition\": \"Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.\",\n \"example_phrases\": [\n \"I'm calling my lawyer about this\"\n ],\n \"then_action\": \"forward\",\n \"selected_channels\": [],\n \"say_before_forwarding\": \"I understand this is important — let me connect you with someone who can help.\",\n \"say_before_end\": \"I'm sorry I couldn't help further. Please contact our team directly. Goodbye.\",\n \"destination\": \"<string>\",\n \"destination_agent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"is_default\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"company_name": "<string>",
"role": "<string>",
"objective": "<string>",
"tone": "<string>",
"behavior_guidelines": "<string>",
"company_service": "<string>",
"topic": "<string>",
"length_detail": "<string>",
"interest_of_product": "<string>",
"negative_response": "<string>",
"status": "pending",
"custom_prompt": "<string>",
"language": "<string>",
"speed": "<string>",
"timezone": "<string>",
"appointment_scheduling_enabled": true,
"appointment_scheduling_randomly": true,
"custom_llm_url": "<string>",
"recommendations": "<string>",
"settings": {
"voice": {},
"text": {},
"memorize": {},
"evaluation": {}
},
"guidelines": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "Always confirm vehicle VIN or license plate before creating a service appointment.",
"order": 0
}
],
"notes": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "Service appointments take 60-90 minutes for standard maintenance, 2-4 hours for warranty work. Same-day pickup is available before 4 PM.",
"order": 0
}
],
"procedures": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Book service appointment",
"description": "Used when the customer wants to schedule a service appointment for their vehicle.",
"steps": [
{
"order": 1,
"description": "Ask the customer for their vehicle license plate or VIN.",
"intent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
],
"training": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "What does Volvo's standard warranty cover?",
"intent": "warranty_inquiry",
"response": "Volvo's standard warranty covers 4 years or 100,000 km, whichever comes first, including parts and labor at any authorized service center. Would you like the details for your specific model?"
}
],
"intents": [
{
"intent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"description": "<string>",
"recommendation_actions": "<string>",
"confidence_threshold": 123,
"is_system": true,
"intent_llm_handle_by_response": true,
"webhook": {
"url": "<string>",
"auth_token": "<string>"
},
"parameters": [
{
"key": "email",
"default": "<string>",
"type": "string",
"required": true
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"webhooks": [
{
"webhook_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"events": [
"conversation_status"
],
"is_active": true,
"has_secret": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"appointments": {},
"routing_rules": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"detection_mode": "intent",
"trigger_keyword": "sales",
"department_name": "Sales Department",
"phrases": [
"I want to talk to sales"
],
"ai_prompt": "Detect when the customer wants to speak with the sales team — they may ask about pricing, new products, quotes, or directly mention sales.",
"voice_response": "Sure, I'll transfer you to our sales team now. One moment please.",
"voice_on_error": "I'm sorry, I couldn't reach sales right now. Please call back later or leave a message.",
"voice_on_success": "You've been successfully connected. Have a great day.",
"destination_type": "extension",
"destination": "101",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"transfer_type": "transfer_call",
"transfer_config": {},
"priority": 1,
"is_active": true
}
],
"guard_rules": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Legal complaint escalation",
"when_condition": "Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action.",
"example_phrases": [
"I'm calling my lawyer about this"
],
"then_action": "forward",
"selected_channels": [
"phone"
],
"say_before_forwarding": "I understand this is important — let me connect you with someone who can help.",
"say_before_end": "I'm sorry I couldn't help further. Please contact our team directly. Goodbye.",
"destination_type": "extension",
"destination": "<string>",
"destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"is_default": false
}
],
"phone_numbers": [
{
"phone_number_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"status": "active",
"country_code": "<string>",
"type": "<string>",
"capabilities": {
"call": true,
"sms": true,
"whatsapp": true,
"whatsapp_call": true
}
}
],
"channels": [
{}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Body
Full agent configuration. Fields fall into three groups: (1) identity (name, company, role) — what the agent IS; (2) behavior prompts (objective, tone, behavior_guidelines, custom_prompt, negative_response) — HOW the runtime AI thinks and talks; (3) capabilities (settings.voice, settings.text, guidelines, notes, procedures, training, appointments, routing_rules, guard_rules) — WHAT the agent can do. For an agent to actually behave well at runtime, populate at least: name, role, objective, tone, behavior_guidelines, language, plus the relevant settings.voice OR settings.text block. Skipping prompt fields produces hollow agents that respond generically.
Internal one-paragraph description of what this agent does. Helps your team understand the agent's purpose at a glance — not used by the runtime AI, but useful when AI-builder agents (via MCP) decide which existing agent to update vs create new.
"Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases."
Strong recommendation. Concrete one-sentence role definition the runtime AI reads as system prompt context. Specific roles produce focused agents — 'Inbound service scheduler for a Volvo dealership' beats 'sales agent'. Without this set, the agent has no identity and answers everything generically.
"Inbound service appointment scheduler for a Volvo dealership in Cagliari."
Strong recommendation. The single primary outcome the agent should drive every conversation toward. Should be measurable. Without an objective the agent talks but doesn't close.
"Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service."
Critical. Free-form instructions that shape how the runtime AI handles edge cases, escalations, and brand-sensitive moments. Treat this as the agent's SOP. Empty = the agent has no rules.
"Always confirm vehicle details before booking. Never quote prices for warranty repairs — escalate to a human. If the customer is upset about a previous service, acknowledge the frustration first, then offer to connect them with a manager."
What the agent does when the conversation goes negative. Without this set, the agent may apologize excessively or escalate inappropriately.
"If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor."
Advanced. Raw additional system-prompt text appended to whatever the runtime AI assembles from the structured fields above. Use only when the structured fields can't express what you need — most cases are better served by tightening behavior_guidelines or adding procedures.
Response
Agent updated successfully