Skip to main content
PUT
/
api
/
v1
/
agents
/
{uuid}
/
guard-rules
Replace agent guard rules
curl --request PUT \
  --url https://{subdomain}.mihu.ai/api/v1/agents/{uuid}/guard-rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "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
    }
  ]
}
'
{
  "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}"

Path Parameters

uuid
string<uuid>
required

Body

application/json
guard_rules
object[]

Response

Guard rules updated

data
object