Skip to main content
PATCH
/
api
/
v1
/
agents
/
{uuid}
Update an agent
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"
      },
      "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
      }
    }
  },
  "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
    }
  ]
}
EOF
{
  "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>",
    "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": [],
        "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": [],
        "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
      }
    ],
    "phone_numbers": [
      {
        "phone_number_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "number": "<string>",
        "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"
  }
}

Documentation Index

Fetch the complete documentation index at: https://developers.mihu.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"

Path Parameters

uuid
string<uuid>
required

Body

application/json

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.

name
string
required

Required. Internal label for this agent — used in dashboards, logs, and as the default inbound_first_message 'this is X' name. Customers should recognize the brand from the name.

Example:

"Volvo Cagliari Service Agent"

description
string | null

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.

Example:

"Inbound voice agent for Volvo Cagliari service appointments. Books service slots, qualifies vehicle issues, escalates warranty cases."

company_name
string | null

Brand the agent represents. The runtime AI references this when introducing itself.

Example:

"Volvo Cagliari"

role
string | null

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.

Example:

"Inbound service appointment scheduler for a Volvo dealership in Cagliari."

objective
string | null

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.

Example:

"Book a service appointment for the customer's vehicle. Capture: VIN or license plate, preferred date, type of service."

tone
string | null

Strong recommendation. Voice and style guide. Determines word choice, formality, and rapport tactics.

Example:

"Warm, professional, slightly formal. Use the customer's name. Avoid jargon — explain technical terms in plain language."

behavior_guidelines
string | null

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.

Example:

"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
string | null

What the company actually sells/offers. Helps the agent stay on-topic and recognize off-domain questions.

Example:

"Volvo vehicle service: maintenance, repairs, warranty work, accessories, pickup/delivery."

topic
string | null

The narrow conversational topic the agent should stay within. Anything off-topic should trigger handover or polite redirect.

Example:

"Service appointment booking and vehicle maintenance questions."

length_detail
string | null

How long replies should be. Voice agents need short crisp turns; text agents can be longer.

Example:

"Keep replies under 25 words for voice; under 200 characters for text. One question at a time."

interest_of_product
string | null

Product-marketing context the agent can use to answer questions about the offering. Useful for sales-oriented agents.

negative_response
string | null

What the agent does when the conversation goes negative. Without this set, the agent may apologize excessively or escalate inappropriately.

Example:

"If the customer becomes hostile or uses profanity, stay calm, do not escalate emotionally, and offer to transfer to a human supervisor."

status
enum<string> | null

Lifecycle state. ready = agent is live and reachable; paused = agent exists but won't accept new conversations.

Available options:
pending,
ready,
in_progress,
paused,
completed
custom_prompt
string | null

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.

language
string | null

ISO 639-1 code for the agent's primary language. Affects both voice (TTS/STT) and text (LLM language). Match settings.voice.voice_profile.language.

Example:

"en"

speed
enum<string> | null

Voice playback speed. Use fast for repeat customers who know the flow; default normal.

Available options:
normal,
fast
timezone
string | null

IANA timezone. Used for working hours, appointment booking, and follow-up scheduling.

Example:

"America/New_York"

appointment_scheduling_enabled
boolean | null

Master switch for appointment booking. When false, all schedule_assignments are inert.

appointment_scheduling_randomly
boolean | null

When multiple primary schedule_assignments match, pick randomly instead of by priority. Use for load balancing across human staff.

custom_llm_url
string | null

Optional override pointing at a custom LLM endpoint instead of the default. Advanced — reach out before using.

settings
object

Channel-specific behavior. Populate voice for phone agents, text for messaging agents — most agents need only one. See AgentVoiceSettings / AgentTextSettings for full field details.

guidelines
object[]

Ordered list of short do's and don'ts the runtime AI follows on every turn. Use for short, atomic rules. For complex multi-step workflows use procedures instead.

notes
object[]

Free-form context the runtime AI keeps available throughout conversations — product facts, business rules, edge cases. Use for reference knowledge that doesn't fit a guideline or procedure.

procedures
object[]

Multi-step workflows the agent can execute end-to-end (e.g. 'book a service appointment', 'process a refund'). Each procedure has ordered steps. The runtime AI walks the steps when the relevant intent is detected.

training
object[]

Few-shot Q&A pairs. The runtime AI uses these as examples of correct responses to common questions. Add 5-15 high-impact pairs covering frequent customer questions.

appointments
object
routing_rules
object[]

IVR-style transfer rules. The agent uses these to forward calls to extensions, phones, or other agents based on detected intent.

guard_rules
object[]

Compliance / safety / escalation triggers. Force the agent to forward or end the conversation when defined situations arise.

Response

Agent updated successfully

success
boolean

Indicates whether the request completed successfully. True for successful responses; false for documented error responses.

message
string

Human-readable response message. Safe to display in logs or simple client notifications; use structured fields for program logic.

data
object