Skip to main content
POST
/
api
/
v1
/
agents
Create an agent
curl --request POST \
  --url https://{subdomain}.mihu.ai/api/v1/agents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Sales Agent",
  "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": "en",
  "speed": "normal",
  "timezone": "Europe/Istanbul",
  "appointment_scheduling_enabled": true,
  "appointment_scheduling_randomly": true,
  "custom_llm_url": "<string>",
  "settings": {
    "voice": {},
    "text": {}
  },
  "guidelines": [
    {
      "content": "<string>",
      "order": 0
    }
  ],
  "notes": [
    {
      "content": "<string>",
      "order": 0
    }
  ],
  "procedures": [
    {
      "name": "<string>",
      "description": "<string>",
      "steps": [
        {
          "order": 123,
          "description": "<string>",
          "intent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        }
      ]
    }
  ],
  "training": [
    {
      "content": "<string>",
      "intent": "<string>",
      "response": "<string>"
    }
  ],
  "appointments": {
    "enabled": true,
    "random_assignment": true,
    "schedule_assignments": [
      {
        "schedule_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "priority": "primary",
        "status": "active",
        "name": "<string>",
        "description": "<string>",
        "slot_rules": {},
        "rescheduling": {},
        "cancellation": {},
        "questions": {},
        "approval": {}
      }
    ]
  },
  "routing_rules": [
    {
      "detection_mode": "exact",
      "trigger_keyword": "<string>",
      "department_name": "<string>",
      "phrases": [
        "<string>"
      ],
      "ai_prompt": "<string>",
      "voice_response": "<string>",
      "voice_on_error": "<string>",
      "voice_on_success": "<string>",
      "destination_type": "extension",
      "destination": "<string>",
      "destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "priority": 123,
      "is_active": true
    }
  ],
  "guard_rules": [
    {
      "name": "<string>",
      "when_condition": "<string>",
      "example_phrases": [
        "<string>"
      ],
      "then_action": "forward",
      "selected_channels": [
        "phone"
      ],
      "say_before_forwarding": "<string>",
      "say_before_end": "<string>",
      "destination_type": "extension",
      "destination": "<string>",
      "destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "is_active": true,
      "is_default": true
    }
  ]
}
'
{
  "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": "<string>",
        "order": 0
      }
    ],
    "notes": [
      {
        "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "content": "<string>",
        "order": 0
      }
    ],
    "procedures": [
      {
        "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "description": "<string>",
        "steps": [
          {
            "order": 123,
            "description": "<string>",
            "intent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
          }
        ]
      }
    ],
    "training": [
      {
        "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "content": "<string>",
        "intent": "<string>",
        "response": "<string>"
      }
    ],
    "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": "exact",
        "trigger_keyword": "<string>",
        "department_name": "<string>",
        "phrases": [
          "<string>"
        ],
        "ai_prompt": "<string>",
        "voice_response": "<string>",
        "voice_on_error": "<string>",
        "voice_on_success": "<string>",
        "destination_type": "extension",
        "destination": "<string>",
        "destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "priority": 123,
        "is_active": true
      }
    ],
    "guard_rules": [
      {
        "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "when_condition": "<string>",
        "example_phrases": [
          "<string>"
        ],
        "then_action": "forward",
        "selected_channels": [
          "phone"
        ],
        "say_before_forwarding": "<string>",
        "say_before_end": "<string>",
        "destination_type": "extension",
        "destination": "<string>",
        "destination_agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "is_active": true,
        "is_default": true
      }
    ],
    "phone_numbers": [
      {
        "phone_number_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "number": "<string>",
        "provider": "mihu",
        "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

Authorization
string
header
required

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

Body

application/json
name
string
required
Example:

"Sales Agent"

description
string | null
company_name
string | null
role
string | null
objective
string | null
tone
string | null
behavior_guidelines
string | null
company_service
string | null
topic
string | null
length_detail
string | null
interest_of_product
string | null
negative_response
string | null
status
enum<string> | null
Available options:
pending,
ready,
in_progress,
paused,
completed
custom_prompt
string | null
language
string | null
Example:

"en"

speed
enum<string> | null
Available options:
normal,
fast
timezone
string | null
Example:

"Europe/Istanbul"

appointment_scheduling_enabled
boolean | null
appointment_scheduling_randomly
boolean | null
custom_llm_url
string | null
settings
object
guidelines
object[]
notes
object[]
procedures
object[]
training
object[]
appointments
object
routing_rules
object[]
guard_rules
object[]

Response

Agent created successfully

success
boolean
message
string
data
object