{
  "openapi": "3.0.0",
  "paths": {
    "/group/{groupId}/webhook/{eventType}": {
      "delete": {
        "description": "이 프로젝트의 이 이벤트 설정을 지운다. 그 뒤로는 계정 기본으로 간다 (계정 기본이 없으면 보내지 않음). MEDIA_STREAM 을 지우면 착신 웹훅·statusCallbackUrl·스트림 연결 서명이 계정 비밀값으로 돌아간다. PK005",
        "operationId": "GroupWebhookController_remove",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "eventType",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "MESSAGE_RECEIVED",
                "SEND_RESULT",
                "CALL_RECEIVED",
                "CALL_COMPLETED",
                "INTAKE",
                "AI_OUTBOUND",
                "MEDIA_STREAM",
                "BUDGET",
                "WEB_CHAT_RECEIVED",
                "CALL_EVENT"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "프로젝트 웹훅 지우기 (KAT Cloud)",
        "tags": [
          "Webhook Config"
        ]
      }
    },
    "/group/{groupId}/webhook/test": {
      "post": {
        "description": "이 이벤트를 실제로 보낼 곳(프로젝트 → 계정 기본)으로, 그 범위의 비밀값으로 서명해 보낸다. 보낼 곳이 없으면 PK005",
        "operationId": "GroupWebhookController_test",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestGroupWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupWebhookTestResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "프로젝트 웹훅 시험 발송 (KAT Cloud)",
        "tags": [
          "Webhook Config"
        ]
      }
    },
    "/group/{groupId}/webhook/secret/rotate": {
      "post": {
        "description": "없으면 만들고 있으면 새로 만든다. 이 뒤로 이 프로젝트 설정으로 보내는 알림부터 새 값으로 서명한다. 계정 기본·다른 프로젝트 값은 그대로. 프로젝트 주소를 저장하기 전에 만들어 받는 서버에 넣어 둘 수 있다 (서명 범위는 바뀌지 않는다)",
        "operationId": "GroupWebhookController_rotateSecret",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "프로젝트 서명 비밀값 만들기·재발급 (KAT Cloud)",
        "tags": [
          "Webhook Config"
        ]
      }
    },
    "/group/{groupId}/webhook/secret": {
      "get": {
        "description": "이 프로젝트 주소(scope=GROUP)로 보내는 웹훅의 서명 값. 계정 기본 값과 다르다. 아직 없으면 null — 만들지 않는다 (주소를 처음 저장하거나 secret/rotate 로 만들면 생긴다)",
        "operationId": "GroupWebhookController_getSecret",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupWebhookSecretResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "프로젝트 서명 비밀값 조회 (KAT Cloud)",
        "tags": [
          "Webhook Config"
        ]
      }
    },
    "/group/{groupId}/webhook": {
      "get": {
        "description": "이벤트마다 실제로 보내는 곳. scope=GROUP 은 이 프로젝트 설정, ACCOUNT 는 프로젝트 설정이 없어 계정 기본을 쓰는 중",
        "operationId": "GroupWebhookController_list",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GroupWebhookResponse"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "프로젝트 웹훅 목록 (KAT Cloud)",
        "tags": [
          "Webhook Config"
        ]
      },
      "put": {
        "description": "이 프로젝트의 이벤트 주소. 없으면 만들고 있으면 바꾼다. 처음 저장하면 프로젝트 서명 비밀값이 생긴다 (먼저 secret/rotate 로 만들어 둘 수 있다). MEDIA_STREAM 을 저장하면 이 프로젝트의 착신 웹훅·statusCallbackUrl·스트림 연결 서명도 프로젝트 비밀값으로 바뀐다. PK008",
        "operationId": "GroupWebhookController_put",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutGroupWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupWebhookResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "프로젝트 웹훅 저장 (KAT Cloud)",
        "tags": [
          "Webhook Config"
        ]
      }
    },
    "/webhook/{webhookId}/test": {
      "post": {
        "operationId": "WebhookConfigController_test",
        "parameters": [
          {
            "name": "webhookId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "Webhook 테스트 발송",
        "tags": [
          "Webhook Config"
        ]
      }
    },
    "/webhook/{webhookId}": {
      "patch": {
        "operationId": "WebhookConfigController_update",
        "parameters": [
          {
            "name": "webhookId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookConfigRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookConfigResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "Webhook 설정 수정",
        "tags": [
          "Webhook Config"
        ]
      },
      "delete": {
        "operationId": "WebhookConfigController_delete",
        "parameters": [
          {
            "name": "webhookId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "Webhook 설정 삭제",
        "tags": [
          "Webhook Config"
        ]
      }
    },
    "/webhook/secret/rotate": {
      "post": {
        "description": "이 뒤로 보내는 알림부터 새 값으로 서명한다. 예전 값으로 검증하면 틀린다",
        "operationId": "WebhookConfigController_rotateSecret",
        "parameters": [],
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "Webhook 서명 비밀값 재발급",
        "tags": [
          "Webhook Config"
        ]
      }
    },
    "/webhook/secret": {
      "get": {
        "description": "없으면 만든다. 이 API 키 계정의 값만 보인다",
        "operationId": "WebhookConfigController_getSecret",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "Webhook 서명 비밀값 조회",
        "tags": [
          "Webhook Config"
        ]
      }
    },
    "/webhook": {
      "get": {
        "operationId": "WebhookConfigController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookConfigResponse"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "Webhook 설정 목록 조회",
        "tags": [
          "Webhook Config"
        ]
      },
      "post": {
        "operationId": "WebhookConfigController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookConfigRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookConfigResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "Webhook 설정 추가",
        "tags": [
          "Webhook Config"
        ]
      }
    },
    "/phone-number-pool/available": {
      "get": {
        "operationId": "PhoneNumberPoolController_getAvailable",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailablePhoneNumberResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "발급 가능한 번호 조회",
        "tags": [
          "Phone Number Pool"
        ]
      }
    },
    "/payment/group/{groupId}/usage": {
      "get": {
        "operationId": "PaymentController_getGroupUsage",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupUsageResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "그룹별 기본 제공량 대비 사용량 조회",
        "tags": [
          "Payment"
        ]
      }
    },
    "/payment/credit/history": {
      "get": {
        "operationId": "PaymentController_getCreditHistory",
        "parameters": [
          {
            "name": "startDate",
            "required": false,
            "in": "query",
            "description": "조회 시작일 (KST 기준, YYYY-MM-DD)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "required": false,
            "in": "query",
            "description": "조회 종료일 (KST 기준, YYYY-MM-DD)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "USAGE_DEDUCT",
                "PLAN_DEDUCT",
                "AUTO_RECHARGE",
                "MANUAL_ADJUST",
                "AI_CALL_REFUND",
                "CAMPAIGN_USAGE",
                "STORAGE_FEE_DEDUCT",
                "STT_USAGE_DEDUCT",
                "CREDIT_GRANT",
                "CREDIT_GRANT_EXPIRE",
                "CREDIT_GRANT_REVOKE",
                "UNKNOWN"
              ]
            }
          },
          {
            "name": "groupBy",
            "required": false,
            "in": "query",
            "schema": {
              "default": "day",
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ]
            }
          },
          {
            "name": "fillEmptyBuckets",
            "required": false,
            "in": "query",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "name": "includeDetails",
            "required": false,
            "in": "query",
            "description": "상세 내역 포함 여부",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 500,
              "default": 100,
              "type": "number"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 0,
              "default": 0,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditHistoryViewResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "크레딧 사용/충전 이력 조회",
        "tags": [
          "Payment"
        ]
      }
    },
    "/payment/credit/summary": {
      "get": {
        "operationId": "PaymentController_getSummary",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditSummaryResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "크레딧 현황 조회",
        "tags": [
          "Payment"
        ]
      }
    },
    "/chat-room/{id}": {
      "delete": {
        "operationId": "ChatRoomController_exitChatRoom",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "채팅방 나가기",
        "tags": [
          "ChatRoom"
        ]
      }
    },
    "/chat-room/{chatRoomId}": {
      "get": {
        "operationId": "ChatRoomController_getChatRoom",
        "parameters": [
          {
            "name": "chatRoomId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "채팅방 조회",
        "tags": [
          "ChatRoom"
        ]
      }
    },
    "/chat-room": {
      "get": {
        "operationId": "ChatRoomController_getList",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "query",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "phoneNumber",
            "required": false,
            "in": "query",
            "description": "전화번호 검색 (게스트 전화번호)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyword",
            "required": false,
            "in": "query",
            "description": "키워드 검색 (채팅 메시지 내용)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "페이지네이션 커서 (Base64 encoded). 응답의 nextCursor 또는 prevCursor 값을 그대로 사용",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "required": false,
            "in": "query",
            "description": "페이지 크기",
            "schema": {
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "채팅방 목록 조회",
        "tags": [
          "ChatRoom"
        ]
      },
      "post": {
        "operationId": "ChatRoomController_createChatRoom",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostChatRoomRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "채팅방 생성",
        "tags": [
          "ChatRoom"
        ]
      }
    },
    "/chat/media/upload": {
      "post": {
        "operationId": "ChatController_uploadMedia",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "채팅 미디어 업로드",
        "tags": [
          "Chat"
        ]
      }
    },
    "/chat": {
      "get": {
        "operationId": "ChatController_getList",
        "parameters": [
          {
            "name": "chatRoomId",
            "required": true,
            "in": "query",
            "description": "채팅방 ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursorDate",
            "required": false,
            "in": "query",
            "description": "커서 날짜",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "페이지네이션 커서 (Base64 encoded). 응답의 nextCursor 또는 prevCursor 값을 그대로 사용",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "required": false,
            "in": "query",
            "description": "페이지 크기",
            "schema": {
              "maximum": 200,
              "default": 50,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "채팅 대화 조회",
        "tags": [
          "Chat"
        ]
      },
      "post": {
        "operationId": "ChatController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostChatRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "채팅 메시지 발송",
        "tags": [
          "Chat"
        ]
      }
    },
    "/group/{groupId}/message-retention": {
      "get": {
        "operationId": "CallRecordPrivacyController_getMessageRetention",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID (KAT Cloud 그룹)",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "문자 보관기간 조회",
        "tags": [
          "Call Record Privacy"
        ]
      },
      "put": {
        "description": "문자 후 N개월(1~36)이 지나면 매일 배치가 본문·제목·이미지를 지운다. 발신·수신 번호와 시각은 max(N, 12)개월 뒤 가린다 (통신사실확인자료 보존). null 이면 기본(본문 유지, 번호 36개월). 줄이면 이미 지난 문자는 다음 배치에서 지워지고 되돌릴 수 없다.",
        "operationId": "CallRecordPrivacyController_updateMessageRetention",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID (KAT Cloud 그룹)",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMessageRetentionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "문자 보관기간 설정",
        "tags": [
          "Call Record Privacy"
        ]
      }
    },
    "/group/{groupId}/call-record-privacy": {
      "get": {
        "operationId": "CallRecordPrivacyController_getSetting",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID (KAT Cloud 그룹)",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상대 번호 조기 마스킹 설정 조회",
        "tags": [
          "Call Record Privacy"
        ]
      },
      "put": {
        "description": "통화 후 N개월(12~36)이 지난 통화 기록의 번호를 매일 배치가 마스킹한다. null 이면 기본(36개월).",
        "operationId": "CallRecordPrivacyController_updateSetting",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID (KAT Cloud 그룹)",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCallPrivacySettingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상대 번호 조기 마스킹 설정",
        "tags": [
          "Call Record Privacy"
        ]
      }
    },
    "/group/{groupId}/call-history/{callHistoryId}": {
      "delete": {
        "description": "번호 마스킹, 녹음·받아쓰기·요약 삭제, 조회·목록에서 제외. 되돌릴 수 없다. 이미 지운 통화도 200 (alreadyDeleted).",
        "operationId": "CallRecordPrivacyController_deleteCall",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID (KAT Cloud 그룹)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "callHistoryId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "통화 기록 한 건 삭제",
        "tags": [
          "Call Record Privacy"
        ]
      }
    },
    "/group/{groupId}/call-history/counterpart-erasure": {
      "post": {
        "description": "그룹 안에서 그 번호와 오간 통화를 MASK(번호 마스킹) 또는 DELETE(녹음까지 삭제)한다. dryRun 으로 건수를 먼저 볼 수 있다. 되돌릴 수 없다. 한 번에 MASK 5000건·DELETE 500건까지 — remainingCalls 가 0 이 될 때까지 같은 요청을 다시 보낸다.",
        "operationId": "CallRecordPrivacyController_eraseByCounterpart",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID (KAT Cloud 그룹)",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EraseCounterpartRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상대 번호의 통화 기록 마스킹·삭제",
        "tags": [
          "Call Record Privacy"
        ]
      }
    },
    "/group/{groupId}/calls/{callId}/events": {
      "get": {
        "description": "시간순. 통화가 진행 중이면 지금까지의 이벤트만 온다. 통화 중 기록이 없는 길(내 SIP 트렁크 등)은 통화 기록으로 들어옴·연결·끝남을 채운다(id null). 도구 호출은 이름·성공 여부·걸린 시간만 — 인자·결과·대화 내용은 싣지 않는다.",
        "operationId": "CallEventController_list",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "callId",
            "required": true,
            "in": "path",
            "description": "통화 기록 ID (GET /call-history 의 id)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallEventListResponse"
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · KC166 — KAT 프로젝트가 아님"
          },
          "404": {
            "description": "CH001 — 이 프로젝트 번호의 통화가 아님"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "통화 이벤트 타임라인",
        "tags": [
          "Call History"
        ]
      }
    },
    "/group/{groupId}/sip-trunks/{trunkId}/credential/reissue": {
      "post": {
        "description": "옛 비밀번호는 바로 무효. 새 비밀번호는 이 응답에서만 보인다",
        "operationId": "SipTrunkController_reissue",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "trunkId",
            "required": true,
            "in": "path",
            "description": "트렁크 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KatcloudSipTrunkCredentialResponse"
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹"
          },
          "404": {
            "description": "AO001 — KAT 그룹이 아님 · ST001 — 이 프로젝트의 트렁크가 아님"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "SIP 트렁크 비밀번호 재발급",
        "tags": [
          "SIP Trunk"
        ]
      }
    },
    "/group/{groupId}/sip-trunks/{trunkId}": {
      "patch": {
        "description": "보낸 칸만 바뀐다. 다음 통화부터 적용. status DISABLED 면 발신·수신 넘김을 멈춘다",
        "operationId": "SipTrunkController_update",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "trunkId",
            "required": true,
            "in": "path",
            "description": "트렁크 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KatcloudUpdateSipTrunkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KatcloudSipTrunkResponse"
                }
              }
            }
          },
          "400": {
            "description": "ST003 허용 IP 형식 · ST004 수신 넘김인데 상대 주소 없음 · ST005 상대 인증 사용자명 접두어(u-·pc·dp·tk) · ST006 상대 인증 사용자명을 바꾸는데 비밀번호 없음 · ST007 공인 주소가 아닌 상대 주소 · ST008 요청 URI 사용자 형식"
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹"
          },
          "404": {
            "description": "AO001 — KAT 그룹이 아님 · ST001 — 이 프로젝트의 트렁크가 아님"
          },
          "409": {
            "description": "KC068 — 받는 방식을 정하지 않은 번호에 직통번호·분배·ARS 가 걸려 있는데 수신 넘김을 새로 켬"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "SIP 트렁크 고치기·멈추기",
        "tags": [
          "SIP Trunk"
        ]
      },
      "delete": {
        "description": "받는 방식이 SIP 인 번호는 방식이 지워져 지금 순서로 돌아간다",
        "operationId": "SipTrunkController_remove",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "trunkId",
            "required": true,
            "in": "path",
            "description": "트렁크 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "removed": true
                  }
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹"
          },
          "404": {
            "description": "AO001 — KAT 그룹이 아님 · ST001 — 이 프로젝트의 트렁크가 아님"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "SIP 트렁크 지우기",
        "tags": [
          "SIP Trunk"
        ]
      }
    },
    "/group/{groupId}/sip-trunks": {
      "get": {
        "description": "프로젝트당 1개라 0개 또는 1개. 비밀번호(sipPassword)는 나오지 않는다",
        "operationId": "SipTrunkController_list",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KatcloudSipTrunkResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹"
          },
          "404": {
            "description": "AO001 — KAT 그룹이 아님"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "프로젝트 SIP 트렁크 목록",
        "tags": [
          "SIP Trunk"
        ]
      },
      "post": {
        "description": "프로젝트당 1개 (KC009). 동시 통화 10. sipPassword 는 이 응답에서만 나간다. 번호를 이 트렁크로 받으려면 PUT /group/{groupId}/numbers/{number}/routing {\"mode\":\"SIP\"}",
        "operationId": "SipTrunkController_create",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KatcloudCreateSipTrunkRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KatcloudCreatedSipTrunkResponse"
                }
              }
            }
          },
          "400": {
            "description": "ST003 허용 IP 형식 · ST004 수신 넘김인데 상대 주소 없음 · ST005 상대 인증 사용자명 접두어(u-·pc·dp·tk) · ST006 상대 인증 사용자명을 바꾸는데 비밀번호 없음 · ST007 공인 주소가 아닌 상대 주소 · ST008 요청 URI 사용자 형식"
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹"
          },
          "404": {
            "description": "AO001 — KAT 그룹이 아님"
          },
          "409": {
            "description": "KC009 — 이미 트렁크가 있음 (프로젝트당 1개) · KC068 — 받는 방식을 정하지 않은 번호에 직통번호·분배·ARS 가 걸려 있는데 수신 넘김을 켬"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "SIP 트렁크 만들기",
        "tags": [
          "SIP Trunk"
        ]
      }
    },
    "/group/{groupId}/numbers/{number}/routing": {
      "get": {
        "description": "mode 가 null 이면 받는 방식을 정하지 않은 번호다 — 지금 순서 그대로 받고, currentMode 가 지금 가는 곳이다",
        "operationId": "NumberRoutingController_get",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "number",
            "required": true,
            "in": "path",
            "description": "그룹의 070 번호 (하이픈 있어도 됨)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹"
          },
          "404": {
            "description": "AO001 — KAT 그룹이 아님 · KC065 — 그룹 번호가 아님"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "번호의 받는 방식",
        "tags": [
          "Number Routing"
        ]
      },
      "put": {
        "description": "AI_AGENT(agentId, 없으면 KC154) · SIP(프로젝트 SIP 트렁크, 없으면 KC155) · WEBSOCKET(stream, 없으면 KC156) · HUMAN(울릴 사람 — 직통번호·직원 분배·ARS, 없으면 KC157. 직통번호는 콘솔 멤버에서 준다) · WEBHOOK(fallbackMode 필수, KC158). 다른 방식의 설정은 지우지 않는다 — 스트림 수신은 꺼 두고, 받는 상담원 연결은 뗀다",
        "operationId": "NumberRoutingController_put",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "number",
            "required": true,
            "in": "path",
            "description": "그룹의 070 번호 (하이픈 있어도 됨)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutKatNumberRoutingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹"
          },
          "404": {
            "description": "AO001 — KAT 그룹이 아님 · KC065 — 그룹 번호가 아님"
          },
          "503": {
            "description": "KC160 — 번호별 받는 방식이 아직 열리지 않음 (교환기 반영 전 — 다시 시도해도 같다)"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "번호의 받는 방식 저장",
        "tags": [
          "Number Routing"
        ]
      }
    },
    "/group/{groupId}/media-stream/inbound/{number}": {
      "put": {
        "description": "이 번호로 전화가 오면 받기 전에 webhookUrl 로 media_stream.call.incoming 을 POST 한다. 5초 안에 {\"action\":\"stream\"|\"reject\"|\"forward\"} 로 응답하면 WebSocket 으로 잇거나 거절하거나 번호로 넘긴다. fallback 을 넣으면 웹훅 · WebSocket 접속이 실패할 때 끊는 대신 그 번호들을 차례로 건다",
        "operationId": "MediaStreamController_putInbound",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "number",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutMediaStreamInboundRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "번호에 스트림 수신 웹훅 걸기",
        "tags": [
          "Media Stream"
        ]
      },
      "delete": {
        "description": "다음 전화부터 원래 수신 흐름으로 돌아간다",
        "operationId": "MediaStreamController_removeInbound",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "number",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "번호의 스트림 수신 웹훅 지우기",
        "tags": [
          "Media Stream"
        ]
      }
    },
    "/group/{groupId}/media-stream/inbound": {
      "get": {
        "description": "수신 웹훅을 건 번호들",
        "operationId": "MediaStreamController_listInbound",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "스트림 수신 설정 목록",
        "tags": [
          "Media Stream"
        ]
      }
    },
    "/group/{groupId}/media-stream/calls/{callId}/transfer": {
      "post": {
        "description": "통화 중인 받는 스트림 통화(callId = 착신 웹훅의 callId)를 targets 순서대로 걸어 받은 사람에게 넘긴다. 접수만 하고 202. 진행은 WebSocket transfer.ringing · transfer.answered · transfer.failed 와 상태 웹훅으로 온다. 진행 중인 통화가 아니거나 발신 스트림 통화면 409 AO026",
        "operationId": "MediaStreamController_transfer",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "callId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferMediaStreamCallRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "스트림 수신 통화를 번호로 넘기기",
        "tags": [
          "Media Stream"
        ]
      }
    },
    "/group/{groupId}/media-stream/calls/{callId}/termination": {
      "post": {
        "description": "울리는 중이면 취소, 통화 중이면 끊는다",
        "operationId": "MediaStreamController_terminate",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "callId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "스트림 통화 끊기",
        "tags": [
          "Media Stream"
        ]
      }
    },
    "/group/{groupId}/media-stream/calls/{callId}": {
      "get": {
        "operationId": "MediaStreamController_get",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "callId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "스트림 발신 상태",
        "tags": [
          "Media Stream"
        ]
      }
    },
    "/group/{groupId}/media-stream/calls": {
      "post": {
        "description": "상대가 받으면 streamUrl(wss)로 WebSocket 을 열어 통화 음성을 G.711 μ-law 8kHz 로 주고받는다. 접수만 하고 202 를 돌려준다. 진행 상황은 상태 웹훅(media_stream.call.*)과 GET /calls/{callId} 로 본다",
        "operationId": "MediaStreamController_create",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "idempotency-key",
            "required": false,
            "in": "header",
            "description": "Idempotency-Key — 그룹 내 요청 고유 키(선택). 재시도는 같은 키와 본문.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMediaStreamCallRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "스트림 발신 걸기",
        "tags": [
          "Media Stream"
        ]
      }
    },
    "/call-history/{callHistoryId}": {
      "get": {
        "operationId": "CallHistoryController_getDetail",
        "parameters": [
          {
            "name": "callHistoryId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "required": true,
            "in": "query",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "includeTracks",
            "required": false,
            "in": "query",
            "description": "화자별 녹음 파일(customer/agent) URL 포함 여부. 외부 STT 에 화자별로 넣을 때 사용한다.",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallHistoryApiResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "통화 기록 상세 조회",
        "tags": [
          "Call History"
        ]
      }
    },
    "/call-history": {
      "get": {
        "operationId": "CallHistoryController_getList",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "query",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "channelId",
            "required": false,
            "in": "query",
            "description": "채널 ID (지정하지 않으면 그룹 전체)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "phoneNumber",
            "required": false,
            "in": "query",
            "description": "전화번호 검색 (발신/수신 번호)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyword",
            "required": false,
            "in": "query",
            "description": "키워드 검색 (요약 내용)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updatedAfter",
            "required": false,
            "in": "query",
            "description": "이 시각 이후 갱신된 기록만 조회(ISO 8601). 지정 시 정렬이 updatedAt 오름차순으로 바뀐다. 응답의 updatedAt 을 커서로 이어서 호출할 것. offset 과 함께 쓰지 말 것.",
            "schema": {
              "format": "date-time",
              "example": "2026-09-02T04:00:00.000Z",
              "type": "string"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "시작 인덱스 (기본값: 0)",
            "schema": {
              "default": 0,
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "조회 개수 (기본값: 20, 최대: 100)",
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "includeTracks",
            "required": false,
            "in": "query",
            "description": "화자별 녹음 파일(customer/agent) URL 포함 여부. 외부 STT 에 화자별로 넣을 때 사용한다.",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallHistoryListApiResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "통화 기록 목록 조회",
        "tags": [
          "Call History"
        ]
      }
    },
    "/message/kakao/messages": {
      "get": {
        "description": "resultStatus=FAILED 면 실패 내역 — 접수 거절 사유(rejectedReason)·카카오/대체발송 실패 코드와 사유",
        "operationId": "KakaoMessageController_list",
        "parameters": [
          {
            "name": "groupId",
            "required": false,
            "in": "query",
            "description": "그룹 ID. 비우면 키의 모든 그룹",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "resultStatus",
            "required": false,
            "in": "query",
            "description": "PENDING(결과 대기) · SUCCESS(전달, 대체 문자 포함) · FAILED(접수 거절·전달 실패 — 실패 내역)",
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "SUCCESS",
                "FAILED"
              ]
            }
          },
          {
            "name": "from",
            "required": false,
            "in": "query",
            "description": "이 시각 이후 보낸 것 (ISO 8601)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "required": false,
            "in": "query",
            "description": "이 시각 전에 보낸 것 (ISO 8601)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "한 번에 (기본 50, 최대 100)",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "type": "number"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "건너뛸 개수",
            "schema": {
              "minimum": 0,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "알림톡 발송 기록",
        "tags": [
          "Kakao Alimtalk"
        ]
      }
    },
    "/message/kakao/send-result/{chatId}": {
      "get": {
        "description": "알림톡·대체발송 결과 코드와 사유, 실제 전달 매체(deliveredVia)",
        "operationId": "KakaoMessageController_getResult",
        "parameters": [
          {
            "name": "chatId",
            "required": true,
            "in": "path",
            "description": "POST /message/kakao/send 결과의 chatId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "알림톡 발송 결과",
        "tags": [
          "Kakao Alimtalk"
        ]
      }
    },
    "/message/kakao/send": {
      "post": {
        "description": "chatId 를 돌려준다. 결과는 SEND_RESULT 웹훅 또는 GET /message/kakao/send-result/{chatId}. 대체발송은 기본 꺼짐 (fallbackEnabled)",
        "operationId": "KakaoMessageController_send",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendKakaoMessageRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "알림톡을 보냅니다.",
        "tags": [
          "Kakao Alimtalk"
        ]
      }
    },
    "/message/kakao/templates": {
      "get": {
        "description": "sendable=true 인 것만 보낼 수 있다. variables 를 채워 보낸다",
        "operationId": "KakaoMessageController_listTemplates",
        "parameters": [
          {
            "name": "groupId",
            "required": false,
            "in": "query",
            "description": "그룹 ID. 비우면 키의 모든 그룹",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "알림톡 템플릿 목록",
        "tags": [
          "Kakao Alimtalk"
        ]
      }
    },
    "/message/media/upload": {
      "post": {
        "operationId": "MessageController_uploadMedia",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "MMS용 미디어를 업로드합니다.",
        "tags": [
          "Message"
        ]
      }
    },
    "/message/send-result/{chatId}": {
      "get": {
        "operationId": "MessageController_getSendResult",
        "parameters": [
          {
            "name": "chatId",
            "required": true,
            "in": "path",
            "description": "메시지 ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSendResultResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "메시지 발송 결과 조회",
        "tags": [
          "Message"
        ]
      }
    },
    "/message/send": {
      "post": {
        "operationId": "MessageController_sendMessage",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "chat id를 반환합니다. webhook 또는 조회 API에서 chatId로 발송결과를 확인할 수 있습니다."
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "문자를 발송합니다.",
        "tags": [
          "Message"
        ]
      }
    },
    "/group/{groupId}/budget": {
      "get": {
        "description": "이번 결제 기간 사용료(부가세 포함)·예산·사용률·알림 기준·넘을 때 동작·걸린 멈춤. 사용료는 결제 배치가 센 값이라 몇 분 늦다",
        "operationId": "GroupBudgetController_get",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KatcloudBudgetResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "프로젝트 예산 (KAT Cloud)",
        "tags": [
          "Group"
        ]
      },
      "put": {
        "description": "예산(null = 없음)·넘을 때 동작·알림 기준(50·80·100%). 저장하면 바로 다시 확인해 예산 안이면 멈춤을 푼다. 알림(메일·웹훅 BUDGET budget.threshold)은 기준마다 결제 기간에 한 번. KC162·KC163",
        "operationId": "GroupBudgetController_put",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutKatcloudBudgetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KatcloudBudgetResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "프로젝트 예산 저장 (KAT Cloud)",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}/call-announcement/audio": {
      "put": {
        "description": "form 필드 file. WAV(16bit PCM·μ-law) 또는 MP3, 5MB·20초 이내(종류는 파일 앞 바이트로 판단). 올리면 바로 그 방향의 CUSTOM_AUDIO 로 쓴다. query direction(INBOUND·OUTBOUND, 빼면 둘 다). KC031 읽을 수 없는 파일, KC034 20초 초과",
        "operationId": "GroupCallAnnouncementController_uploadAudio",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "direction",
            "required": false,
            "in": "query",
            "description": "INBOUND | OUTBOUND | BOTH",
            "schema": {
              "type": "string",
              "enum": [
                "INBOUND",
                "OUTBOUND",
                "BOTH"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallAnnouncementResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "안내 음성 파일 올리기·바꾸기 (KAT Cloud)",
        "tags": [
          "Group"
        ]
      },
      "delete": {
        "description": "쓰고 있었으면 기본 문구로 돌아간다. query direction(INBOUND·OUTBOUND, 빼면 둘 다)",
        "operationId": "GroupCallAnnouncementController_deleteAudio",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "direction",
            "required": false,
            "in": "query",
            "description": "INBOUND | OUTBOUND | BOTH",
            "schema": {
              "type": "string",
              "enum": [
                "INBOUND",
                "OUTBOUND",
                "BOTH"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallAnnouncementResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "올린 안내 음성 지우기 (KAT Cloud)",
        "tags": [
          "Group"
        ]
      },
      "get": {
        "description": "8kHz 16bit PCM WAV. query direction(INBOUND·OUTBOUND, 빼면 켜진 방향)",
        "operationId": "GroupCallAnnouncementController_download",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "direction",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "INBOUND",
                "OUTBOUND"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "지금 재생되는 안내 음성 내려받기 (KAT Cloud)",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}/call-announcement": {
      "get": {
        "operationId": "GroupCallAnnouncementController_get",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallAnnouncementResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "통화 시작 안내 멘트 설정 (KAT Cloud)",
        "tags": [
          "Group"
        ]
      },
      "put": {
        "description": "받는 전화(inbound)·거는 전화(outbound)를 따로 보내거나, 예전 방식(enabled·direction·messageType)으로 보낸다. 다음 통화부터, PBX 반영까지 최대 5분. KC032·KC033·KC034·KC035·KC037",
        "operationId": "GroupCallAnnouncementController_put",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutCallAnnouncementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallAnnouncementResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "통화 시작 안내 멘트 저장 (KAT Cloud)",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}/member/{groupMemberId}/call-receive": {
      "patch": {
        "operationId": "GroupController_patchMemberCallReceive",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "groupMemberId",
            "required": true,
            "in": "path",
            "description": "대상 그룹 멤버 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchGroupMemberCallReceiveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "멤버 전화 수신 여부 수정",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}/member/{groupMemberId}": {
      "delete": {
        "operationId": "GroupController_removeMember",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "groupMemberId",
            "required": true,
            "in": "path",
            "description": "대상 그룹 멤버 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "멤버 제거",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}/member": {
      "post": {
        "operationId": "GroupController_appendMember",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteGroupMemberRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "멤버 추가",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}/call-forward": {
      "get": {
        "operationId": "GroupController_getCallForward",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "착신전환 설정 조회",
        "tags": [
          "Group"
        ]
      },
      "patch": {
        "operationId": "GroupController_patchCallForward",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchCallForwardRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "착신전환 설정 수정",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}/ai-usage": {
      "get": {
        "operationId": "GroupController_getAiUsage",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "그룹 AI 사용량 조회",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}/numbers/{number}": {
      "delete": {
        "description": "번호를 풀로 돌려준다(30일 동안 다른 고객에게 나가지 않음). 이 번호의 AI 상담원 연결·미디어 스트림 수신·직원 분배 설정도 지운다. 번호 요금은 다음 결제 기간부터 빠진다(이번 기간 환불·일할 없음). 이미 반납한 번호면 200 alreadyReleased: true.",
        "operationId": "GroupController_releaseKatcloudNumber",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "KAT Cloud 그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "number",
            "required": true,
            "in": "path",
            "description": "반납할 070 번호 (예: 07012345678, 하이픈 허용)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "channelId · phoneNumber · released · alreadyReleased · removedMonthlyFee · notice"
          },
          "400": {
            "description": "KC100 — KAT 그룹이 아니다"
          },
          "404": {
            "description": "KC116 — 이 그룹의 번호가 아니다"
          },
          "409": {
            "description": "KC117 — 처음 번호·마지막 번호, KC118 — 번호이동 번호, KC119 — 발신 표시번호가 붙은 번호, KC120 — 멤버 직통번호·다른 번호의 ARS 연결·진행 중 AI 발신이 쓰는 번호, KC121 — 받은 뒤 아직 번호 요금이 한 번도 매겨지지 않은 번호(다음 결제 기간 이후 반납)"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "KAT 그룹 번호 하나 반납",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}/numbers": {
      "post": {
        "operationId": "GroupController_addKatcloudNumber",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "KAT Cloud 그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "idempotency-key",
            "required": true,
            "in": "header",
            "description": "Idempotency-Key — 이 추가 동작의 고유 키(1~128자, 없으면 400). 같은 키로 다시 보내면 처음 붙인 번호를 돌려준다",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddKatcloudNumberRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "channelId · phoneNumber · addedMonthlyFee · notice"
          },
          "400": {
            "description": "KC100 — KAT 그룹이 아니다 (제로콜은 POST /group)"
          },
          "403": {
            "description": "KC101 — 유료 플랜 ACTIVE 도 체험 중도 아니다"
          },
          "409": {
            "description": "KC102 — 그룹 번호 한도(기본 30개, 체험 중 3개, 계약에 따라 다름)"
          },
          "429": {
            "description": "KC103 — 그룹당 1시간 한도(기본 3개, 콘솔·MCP 포함), CH008 — 그룹장 명의 회선 한도"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "KAT 그룹에 070 번호 하나 추가 (유료 플랜 ACTIVE 또는 체험 중, 그룹 번호·그룹당 1시간 한도까지 — 기본 30개·3개)",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}/numbers/quote": {
      "get": {
        "operationId": "GroupController_quoteKatcloudNumber",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "KAT Cloud 그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "blockedCode 가 있으면 지금 추가하면 그 코드로 거절된다"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "KAT 그룹 번호 추가 — 늘어날 월 요금 미리보기 (추가하지 않음)",
        "tags": [
          "Group"
        ]
      }
    },
    "/group": {
      "get": {
        "operationId": "GroupController_getMyGroups",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "그룹 목록 조회",
        "tags": [
          "Group"
        ]
      },
      "post": {
        "operationId": "GroupController_issue",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "number"
                }
              }
            }
          },
          "403": {
            "description": "GR047 — 계정 주인이 본인인증을 하지 않았다 (제로콜 웹·앱에서 본인인증 후 다시 요청)"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "그룹 생성",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}": {
      "get": {
        "operationId": "GroupController_getDetail",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "그룹 상세 조회",
        "tags": [
          "Group"
        ]
      },
      "patch": {
        "operationId": "GroupController_patch",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "그룹 수정",
        "tags": [
          "Group"
        ]
      },
      "delete": {
        "operationId": "GroupController_release",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "그룹 삭제",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/plans": {
      "get": {
        "operationId": "GroupController_getAvailablePlans",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailablePlanListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "사용 가능한 요금제 목록 조회",
        "tags": [
          "Group"
        ]
      }
    },
    "/group/{groupId}/ai-outbound/calls/{requestId}/termination": {
      "post": {
        "description": "본문 없이 보냅니다. 교환기로 보내기 전이면 바로 CANCELED·CUSTOMER_TERMINATED, 이미 걸고 있으면 terminationRequestedAt 만 찍고 돌려줍니다 (여러 번 보내도 같음). 응답은 상세와 같은 모양(202).",
        "operationId": "AiOutboundController_terminate",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID — API 키에 묶인 그룹",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "requestId",
            "required": true,
            "in": "path",
            "description": "발신 요청 ID (UUID)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": ""
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹"
          },
          "404": {
            "description": "AO015 — 발신 요청 없음"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "AI 발신 끊기",
        "tags": [
          "AI Outbound"
        ]
      }
    },
    "/group/{groupId}/ai-outbound/calls/{requestId}": {
      "get": {
        "description": "상태(status)·종료 사유(endReason)·정산 상태·통화 기록 ID(callHistoryId)를 돌려줍니다.",
        "operationId": "AiOutboundController_get",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID — API 키에 묶인 그룹",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "requestId",
            "required": true,
            "in": "path",
            "description": "발신 요청 ID (UUID)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹"
          },
          "404": {
            "description": "AO015 — 발신 요청 없음"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "AI 발신 상세",
        "tags": [
          "AI Outbound"
        ]
      }
    },
    "/group/{groupId}/ai-outbound/calls": {
      "post": {
        "description": "AI 상담원(방향 OUTBOUND·ACTIVE)이 destination 으로 전화를 겁니다. DB 에 접수(202 ACCEPTED)만 하고, 발신은 뒤에서 진행됩니다.\n같은 Idempotency-Key 로 다시 보내면 새로 걸지 않고 처음 요청을 돌려줍니다 (같은 키에 다른 본문은 409 AO006).\n접수 때 상담원 설정·그룹 녹음 설정을 고정합니다. 진행·종료는 상세 조회 또는 AI_OUTBOUND 웹훅으로 확인합니다.",
        "operationId": "AiOutboundController_accept",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID — API 키에 묶인 그룹",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "idempotency-key",
            "required": true,
            "in": "header",
            "description": "Idempotency-Key — 그룹 내 요청 고유 키(공백 없는 ASCII 1~128자, 없거나 틀리면 400 AO005). 재시도는 같은 키와 본문.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAiOutboundCallRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "접수됨 — 상세 조회와 같은 모양 (status ACCEPTED)"
          },
          "400": {
            "description": "AO005 — 받는 번호·inputs 규칙 위반 (details.reason) · AO010 — 발신 번호가 개통된 번호가 아님 · GL002 — 검증 실패"
          },
          "403": {
            "description": "AO002 — 운영자가 발신을 멈춘 그룹 · AO003 — 이용이 멈춘 그룹 · AO011 — 수신 거부·차단 번호 · AO016 — 체험 발신 포함량 부족 · KC161 — 프로젝트 예산으로 AI 발신·문자 멈춤"
          },
          "404": {
            "description": "AO007 — 발신 상담원 없음 (OUTBOUND·ACTIVE 아님)"
          },
          "409": {
            "description": "AO006 — 같은 Idempotency-Key 에 다른 본문"
          },
          "429": {
            "description": "AO013 — 동시 발신 한도 · AO014 — 하루 발신 수 한도"
          },
          "503": {
            "description": "AO009 — AI 발신을 잠시 멈춤"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "AI 발신 요청",
        "tags": [
          "AI Outbound"
        ]
      },
      "get": {
        "description": "최신 순 { items, nextCursor }. 다음 쪽은 nextCursor 를 cursor 에 그대로 넣습니다 (없으면 null). 스트림 발신도 함께 나오며 agentId 가 0 입니다.",
        "operationId": "AiOutboundController_list",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹(프로젝트) ID — API 키에 묶인 그룹",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "1~100, 기본 20",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "앞 응답의 nextCursor",
            "schema": {
              "maxLength": 150,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹"
          },
          "404": {
            "description": "AO001 — KAT 그룹이 아님"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "AI 발신 목록",
        "tags": [
          "AI Outbound"
        ]
      }
    },
    "/group/{groupId}/voice-model": {
      "get": {
        "description": "상담원 liveModel 에 넣을 수 있는 모델 — 이름·회사·분당 단가(원, 부가세 별도)·상태, 이 그룹에서 지금 고를 수 있는지. 준비 중(AG017)·지원이 끝난 모델(AG018)은 고를 수 없고, KAT 프로젝트는 무료 체험 중(유료 시작 전)이고 카드가 없으면 분당 30원 이하만(AG019)",
        "operationId": "AiAgentVoiceModelController_list",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AiAgentLiveModelResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "음성 모델 목록",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/group/{groupId}/agent/{agentId}/tool/{toolId}/test": {
      "post": {
        "description": "등록한 주소·인증으로 실제로 부르고 상태 코드·걸린 시간·응답 앞부분을 돌려준다. 쓰기 도구도 실제로 부르므로 고객사 시험 서버로 할 것. 인증값은 돌려주지 않는다",
        "operationId": "AiAgentToolController_test",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "toolId",
            "required": true,
            "in": "path",
            "description": "도구 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestAiAgentToolRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAgentToolTestResponse"
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          },
          "404": {
            "description": "AG010"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상담원 도구 시험 호출",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/group/{groupId}/agent/{agentId}/tool/{toolId}/refresh": {
      "post": {
        "description": "MCP 서버의 tools/list 를 다시 받아 저장한다. 바뀌었으면 상담원 버전이 오른다 (통화 시작 때는 목록을 받지 않는다)",
        "operationId": "AiAgentToolController_refresh",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "toolId",
            "required": true,
            "in": "path",
            "description": "도구 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAgentToolResponse"
                }
              }
            }
          },
          "400": {
            "description": "AG015 — 목록을 받지 못함"
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "MCP 도구 목록 다시 받기",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/group/{groupId}/agent/{agentId}/tool/{toolId}": {
      "patch": {
        "description": "생략 = 그대로, authHeaderName·authSecret 은 null = 비움. 바뀐 칸이 있으면 상담원 버전이 오른다",
        "operationId": "AiAgentToolController_patch",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "toolId",
            "required": true,
            "in": "path",
            "description": "도구 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchAiAgentToolRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAgentToolResponse"
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          },
          "404": {
            "description": "AG010"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상담원 도구 수정",
        "tags": [
          "AI Agent"
        ]
      },
      "delete": {
        "description": "상담원 버전이 오른다",
        "operationId": "AiAgentToolController_remove",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "toolId",
            "required": true,
            "in": "path",
            "description": "도구 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상담원 도구 삭제",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/group/{groupId}/agent/{agentId}/tool": {
      "get": {
        "description": "인증값은 내보내지 않는다 (hasAuthSecret 만)",
        "operationId": "AiAgentToolController_getList",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AiAgentToolResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상담원 도구 목록",
        "tags": [
          "AI Agent"
        ]
      },
      "post": {
        "description": "통화 중에 모델이 부른다. GET 은 인자를 쿼리로, POST 는 JSON 본문으로 보내고 X-Zerocall-Call-Id·X-Zerocall-Agent-Id·X-Zerocall-Caller(발신번호) 헤더를 붙인다. 응답은 timeoutMs(기본 5초, 상한 8초) 안에, 32KB 까지 읽는다. 리다이렉트는 따라가지 않는다. 상담원 하나에 10개까지(AG012). 상담원 버전이 오르고 수정 이력에 남는다",
        "operationId": "AiAgentToolController_create",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAiAgentToolRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAgentToolResponse"
                }
              }
            }
          },
          "400": {
            "description": "AG011 — 쓸 수 없는 주소 · AG013 — 인자 스키마"
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          },
          "409": {
            "description": "AG014 — 같은 이름의 도구"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상담원 도구 등록 (HTTP·MCP)",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/group/{groupId}/agent/{agentId}/channel": {
      "get": {
        "operationId": "AiAgentChannelController_getAgentChannels",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GroupChannelResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상담원에 연결한 번호",
        "tags": [
          "AI Agent"
        ]
      },
      "put": {
        "description": "같은 그룹의 전화번호만(AG006). 받는 전화용(INBOUND) 상담원은 번호 하나에 하나(409 AG008)이고, 그룹이 운영·운영시간 외 모두 사람만 받는 모드면 연결할 수 없다(AG007). AI 로 받는 번호에 받는 전화용 상담원을 연결하면 그 번호로 온 AI 응대를 그 상담원이 맡는다",
        "operationId": "AiAgentChannelController_putAgentChannels",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutAiAgentChannelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GroupChannelResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          },
          "409": {
            "description": "AG008 — 이미 다른 받는 전화용 상담원이 연결된 번호"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상담원 번호 연결 (통째로 바꾸기)",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/group/{groupId}/channel": {
      "get": {
        "description": "상담원에 연결할 번호를 고를 때 쓴다. 대표 번호 먼저",
        "operationId": "AiAgentChannelController_getGroupChannels",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GroupChannelResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "그룹 전화번호 목록",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/group/{groupId}/agent/{agentId}/manual/{manualId}": {
      "patch": {
        "description": "생략 = 그대로, description·noteFields 는 null = 비움. 바뀐 칸이 있으면 상담원 버전이 오른다",
        "operationId": "AiAgentManualController_patch",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "manualId",
            "required": true,
            "in": "path",
            "description": "매뉴얼 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchAiAgentManualRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAgentManualResponse"
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          },
          "404": {
            "description": "AG003"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상담원 전용 매뉴얼 수정",
        "tags": [
          "AI Agent"
        ]
      },
      "delete": {
        "description": "상담원 버전이 오른다",
        "operationId": "AiAgentManualController_remove",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "manualId",
            "required": true,
            "in": "path",
            "description": "매뉴얼 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상담원 전용 매뉴얼 삭제",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/group/{groupId}/agent/{agentId}/manual": {
      "get": {
        "operationId": "AiAgentManualController_getList",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AiAgentManualResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상담원 전용 매뉴얼 목록",
        "tags": [
          "AI Agent"
        ]
      },
      "post": {
        "description": "상담원 하나에 30개까지(AG004). 상담원 버전이 오르고 수정 이력에 남는다",
        "operationId": "AiAgentManualController_create",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAiAgentManualRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAgentManualResponse"
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "상담원 전용 매뉴얼 등록",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/group/{groupId}/agent/{agentId}/revision": {
      "get": {
        "description": "최신 50개, 버전 내림차순. 지운 상담원의 이력도 본다",
        "operationId": "AiAgentController_getRevisions",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AiAgentRevisionResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "AI 상담원 수정 이력",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/group/{groupId}/agent/{agentId}": {
      "get": {
        "operationId": "AiAgentController_getOne",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAgentResponse"
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          },
          "404": {
            "description": "AG001"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "AI 상담원 상세",
        "tags": [
          "AI Agent"
        ]
      },
      "patch": {
        "description": "생략 = 그대로, null = 비움(그룹 값·기본값). 바뀐 칸이 있으면 버전이 오르고 수정 이력에 남는다. 방향은 바꿀 수 없다",
        "operationId": "AiAgentController_patch",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchAiAgentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAgentResponse"
                }
              }
            }
          },
          "400": {
            "description": "AG017 — 준비 중인 음성 모델(liveModel) · AG018 — 지원이 끝난 음성 모델 (모델 목록: GET /group/:groupId/voice-model)"
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹 · AG019 — 무료 체험 중이고 카드가 없는 KAT 프로젝트의 분당 30원 초과 음성 모델"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "AI 상담원 수정",
        "tags": [
          "AI Agent"
        ]
      },
      "delete": {
        "description": "번호 연결도 끊는다. 수정 이력은 남는다",
        "operationId": "AiAgentController_remove",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "agentId",
            "required": true,
            "in": "path",
            "description": "상담원 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "AI 상담원 삭제",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/group/{groupId}/agent": {
      "post": {
        "description": "버전 1 로 만들고 수정 이력에 남긴다. 그룹 하나에 20개까지 (AG009)",
        "operationId": "AiAgentController_create",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAiAgentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAgentResponse"
                }
              }
            }
          },
          "400": {
            "description": "AG009 — 그룹당 상담원 20개 초과 · AG017 — 준비 중인 음성 모델(liveModel) · AG018 — 지원이 끝난 음성 모델 (모델 목록: GET /group/:groupId/voice-model)"
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹 · AG019 — 무료 체험 중이고 카드가 없는 KAT 프로젝트의 분당 30원 초과 음성 모델"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "AI 상담원 등록",
        "tags": [
          "AI Agent"
        ]
      },
      "get": {
        "description": "방향·상태로 거를 수 있다",
        "operationId": "AiAgentController_getList",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "description": "그룹 ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "direction",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "INBOUND",
                "OUTBOUND"
              ]
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "ACTIVE",
                "DISABLED"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AiAgentResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "PK004 — 키에 묶이지 않은 그룹 · AG002 — AI 상담원을 켜지 않은 그룹"
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "AI 상담원 목록",
        "tags": [
          "AI Agent"
        ]
      }
    },
    "/auth-check": {
      "get": {
        "operationId": "StudioApiController_getHello2",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUserDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "Studio API 인증 확인",
        "tags": [
          "Studio API"
        ]
      }
    },
    "/": {
      "get": {
        "operationId": "StudioApiController_getHello",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-api-key": []
          }
        ],
        "summary": "Studio API 상태 확인",
        "tags": [
          "Studio API"
        ]
      }
    }
  },
  "info": {
    "title": "KAT Cloud API",
    "description": "KAT Cloud 개발자 API (studio-api). 콘솔에서 만든 API 키를 `x-api-key` 헤더에 넣어 부릅니다.\n주소는 `https://api.katcloud.kr` 입니다. 이전 주소 `https://studio-gateway.zerocall.kr` 도 같은 서버라 계속 동작합니다.\n설명·예제가 있는 문서: https://katcloud.kr/docs/api\n\n## 사용 범위와 권한\n- KAT 프로젝트는 체험 중이거나 유료 플랜(개인, 비즈니스)을 쓰는 동안 문자 발신을 포함한 모든 API를 사용할 수 있습니다. 요금제에 따른 `403 AU017` 은 KAT 프로젝트에 나오지 않습니다.\n- 체험이 끝났거나 이용이 멈춘 프로젝트는 모든 API가 `403 KC008` 입니다. 키가 묶이지 않은 다른 프로젝트 ID를 넣으면 `403 PK004` 입니다.\n\n## KAT Cloud 그룹 (콘솔의 프로젝트)\n- 콘솔의 프로젝트가 API 의 그룹입니다 (`groupId` = 프로젝트 id). 콘솔에서 만든 키는 그 키를 만든 프로젝트 하나에만 묶입니다.\n- KAT Cloud 번호는 콘솔 가입 때 받습니다. KAT 키로 `POST /group`, KAT 그룹의 `DELETE /group/{groupId}` 는 `403 KC006` 입니다.\n- KAT 그룹에 번호를 더 받으려면 `POST /group/{groupId}/numbers` 를 씁니다 (요금 미리보기 `GET /group/{groupId}/numbers/quote`).\n  유료 플랜 ACTIVE 일 때만, `confirmMonthlyFee: true`·`Idempotency-Key` 헤더 필요, 그룹 번호·그룹당 1시간 한도(기본 30개·3개, 계약에 따라 다름, 콘솔 포함)까지.\n- 번호 반납은 `DELETE /group/{groupId}/numbers/{number}` 입니다. 번호 요금은 다음 결제 기간부터 빠집니다.\n  처음 번호(그룹을 만들 때 받은 첫 번호)·마지막 번호 `409 KC117`, 번호이동 번호 `KC118`, 발신 표시번호가 붙은 번호 `KC119`, 직통번호·ARS 연결·진행 중 AI 발신 `KC120`.\n  번호 요금은 일할 없이 기간 단위라, 새로 받은 번호는 첫 번호 요금이 매겨진 다음 기간부터 반납할 수 있습니다 (`409 KC121`).\n- 프로젝트 멤버는 콘솔의 멤버 화면에서 초대·관리합니다. Studio API 로 멤버 추가·제거·수신 설정은 `403 KC007` 입니다.\n- 체험이 끝났거나 이용이 멈춘 KAT 그룹은 문자 발신을 포함한 모든 API 가 `403 KC008` 입니다 (프로젝트 예산 `GET/PUT /group/{groupId}/budget` 은 열림).\n- 프로젝트 예산이 「AI 발신·문자 멈춤」이면 문자(`/message/send`·`/chat`)·알림톡·AI 발신·스트림 발신이 `403 KC161` 입니다. 통화 중 AI 상담원이 보내는 문자는 멈추지 않습니다.\n\n## 오류 응답\n- 실패는 `{ \"status\", \"code\", \"message\" }` 입니다. 분기는 `code`(예: `PK004`, `KC008`)로 합니다. 코드 표: https://katcloud.kr/docs/api#errors\n- 호출 한도: API 키마다 · API 마다 60초 1,200회. 넘으면 `429 G429` + `Retry-After`(초).",
    "version": "1.16.0",
    "contact": {}
  },
  "tags": [],
  "servers": [
    {
      "url": "https://api.katcloud.kr",
      "description": "KAT Cloud (이전 주소 https://studio-gateway.zerocall.kr 도 계속 동작)"
    }
  ],
  "components": {
    "securitySchemes": {
      "x-api-key": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "ApiUserDto": {
        "type": "object",
        "properties": {
          "apiKeyId": {
            "type": "number"
          },
          "userId": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "keyHash": {
            "type": "string"
          },
          "groupIdList": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "b2bClientId": {
            "type": "number",
            "nullable": true,
            "description": "B2B 클라이언트 ID (부기사 등 B2B 연동 시 설정)"
          }
        },
        "required": [
          "apiKeyId",
          "userId",
          "name",
          "keyHash",
          "groupIdList",
          "b2bClientId"
        ]
      },
      "CreateAiAgentRequest": {
        "type": "object",
        "properties": {
          "outboundInputSchema": {
            "type": "object",
            "nullable": true,
            "description": "발신 요청에서 허용할 등록 입력 스키마. null = 입력 없음"
          },
          "context": {
            "type": "string",
            "description": "회사·상품 배경 (8,000자 이하)",
            "nullable": true
          },
          "greeting": {
            "type": "string",
            "description": "수신은 첫 인사, 발신은 첫 마디 지침 (600자 이하). 비우면 모델이 만든다",
            "nullable": true
          },
          "voice": {
            "type": "string",
            "enum": [
              "HIGH_FEMALE",
              "LOW_FEMALE",
              "HIGH_MALE",
              "LOW_MALE"
            ],
            "description": "음성. 비우면 그룹 음성",
            "nullable": true
          },
          "language": {
            "type": "string",
            "enum": [
              "KO",
              "EN",
              "JA",
              "ZH",
              "TH"
            ],
            "description": "언어. 비우면 그룹 기본 언어",
            "nullable": true
          },
          "liveModel": {
            "type": "string",
            "enum": [
              "qwen3.8-omni-flash-realtime",
              "gemini-3.1-flash-live",
              "gemini-3.8-live",
              "gemini-2.5-flash-live",
              "nova-2-sonic",
              "gpt-realtime-2.1-mini",
              "grok-voice-think-fast-1.0",
              "ultravox",
              "hume-evi",
              "gpt-live-1",
              "gpt-realtime-2.1",
              "deepgram-voice-agent",
              "grok-voice-think-fast-2.0",
              "elevenlabs-agents"
            ],
            "description": "음성 모델 id. 비우면 그룹·기본 모델. 고를 수 있는 모델과 단가·상태는 모델 목록(voice-model)에서 — 준비 중은 AG017, 지원이 끝난 모델은 AG018, KAT 프로젝트가 무료 체험 중이고 카드가 없을 때 분당 30원 넘는 모델은 AG019",
            "nullable": true
          },
          "maxCallSeconds": {
            "type": "number",
            "description": "최대 통화 시간(초, 30~480). 비우면 480",
            "nullable": true
          },
          "aiInterruptionEnabled": {
            "type": "boolean",
            "description": "끼어들기 — true 면 손님이 말할 때 상담원이 하던 말을 멈춘다. false 면 상담원이 말하는 동안 손님 소리를 듣지 않는다. 비우면 그룹 설정(기본 false). 켜면 스피커폰처럼 상담원 목소리가 손님 마이크로 다시 들어가는 전화에서 상담원이 제 말에 멈출 수 있다",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "상담원 이름 (100자 이하)"
          },
          "direction": {
            "type": "string",
            "enum": [
              "INBOUND",
              "OUTBOUND"
            ],
            "description": "받는 전화용(INBOUND)·거는 전화용(OUTBOUND). 만든 뒤 바꿀 수 없다"
          },
          "prompt": {
            "type": "string",
            "description": "역할·목표·말투·금지 사항 (8,000자 이하)"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "DISABLED"
            ],
            "description": "기본 ACTIVE"
          }
        },
        "required": [
          "name",
          "direction",
          "prompt"
        ]
      },
      "AiAgentResponse": {
        "type": "object",
        "properties": {
          "outboundInputSchema": {
            "type": "object",
            "nullable": true
          },
          "id": {
            "type": "number"
          },
          "groupId": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "enum": [
              "INBOUND",
              "OUTBOUND"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "DISABLED"
            ]
          },
          "prompt": {
            "type": "string"
          },
          "context": {
            "type": "string",
            "nullable": true
          },
          "greeting": {
            "type": "string",
            "nullable": true
          },
          "voice": {
            "type": "string",
            "enum": [
              "HIGH_FEMALE",
              "LOW_FEMALE",
              "HIGH_MALE",
              "LOW_MALE"
            ],
            "nullable": true,
            "description": "null = 그룹 음성"
          },
          "language": {
            "type": "string",
            "enum": [
              "KO",
              "EN",
              "JA",
              "ZH",
              "TH"
            ],
            "nullable": true,
            "description": "null = 그룹 기본 언어"
          },
          "liveModel": {
            "type": "string",
            "nullable": true,
            "description": "null = 그룹·기본 모델"
          },
          "maxCallSeconds": {
            "type": "number",
            "nullable": true,
            "description": "null = 480초"
          },
          "aiInterruptionEnabled": {
            "type": "boolean",
            "nullable": true,
            "description": "끼어들기. null = 그룹 설정"
          },
          "version": {
            "type": "number",
            "description": "본문·매뉴얼이 바뀔 때마다 1씩 오른다"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "outboundInputSchema",
          "id",
          "groupId",
          "name",
          "direction",
          "status",
          "prompt",
          "context",
          "greeting",
          "voice",
          "language",
          "liveModel",
          "maxCallSeconds",
          "aiInterruptionEnabled",
          "version",
          "createdAt",
          "updatedAt"
        ]
      },
      "PatchAiAgentRequest": {
        "type": "object",
        "properties": {
          "outboundInputSchema": {
            "type": "object",
            "nullable": true,
            "description": "발신 요청에서 허용할 등록 입력 스키마. null = 입력 없음"
          },
          "context": {
            "type": "string",
            "description": "회사·상품 배경 (8,000자 이하)",
            "nullable": true
          },
          "greeting": {
            "type": "string",
            "description": "수신은 첫 인사, 발신은 첫 마디 지침 (600자 이하). 비우면 모델이 만든다",
            "nullable": true
          },
          "voice": {
            "type": "string",
            "enum": [
              "HIGH_FEMALE",
              "LOW_FEMALE",
              "HIGH_MALE",
              "LOW_MALE"
            ],
            "description": "음성. 비우면 그룹 음성",
            "nullable": true
          },
          "language": {
            "type": "string",
            "enum": [
              "KO",
              "EN",
              "JA",
              "ZH",
              "TH"
            ],
            "description": "언어. 비우면 그룹 기본 언어",
            "nullable": true
          },
          "liveModel": {
            "type": "string",
            "enum": [
              "qwen3.8-omni-flash-realtime",
              "gemini-3.1-flash-live",
              "gemini-3.8-live",
              "gemini-2.5-flash-live",
              "nova-2-sonic",
              "gpt-realtime-2.1-mini",
              "grok-voice-think-fast-1.0",
              "ultravox",
              "hume-evi",
              "gpt-live-1",
              "gpt-realtime-2.1",
              "deepgram-voice-agent",
              "grok-voice-think-fast-2.0",
              "elevenlabs-agents"
            ],
            "description": "음성 모델 id. 비우면 그룹·기본 모델. 고를 수 있는 모델과 단가·상태는 모델 목록(voice-model)에서 — 준비 중은 AG017, 지원이 끝난 모델은 AG018, KAT 프로젝트가 무료 체험 중이고 카드가 없을 때 분당 30원 넘는 모델은 AG019",
            "nullable": true
          },
          "maxCallSeconds": {
            "type": "number",
            "description": "최대 통화 시간(초, 30~480). 비우면 480",
            "nullable": true
          },
          "aiInterruptionEnabled": {
            "type": "boolean",
            "description": "끼어들기 — true 면 손님이 말할 때 상담원이 하던 말을 멈춘다. false 면 상담원이 말하는 동안 손님 소리를 듣지 않는다. 비우면 그룹 설정(기본 false). 켜면 스피커폰처럼 상담원 목소리가 손님 마이크로 다시 들어가는 전화에서 상담원이 제 말에 멈출 수 있다",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "상담원 이름 (100자 이하)"
          },
          "prompt": {
            "type": "string",
            "description": "역할·목표·말투·금지 사항 (8,000자 이하)"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "DISABLED"
            ],
            "description": "DISABLED = 통화에 쓰지 않는다"
          }
        }
      },
      "AiAgentRevisionResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "number"
          },
          "snapshot": {
            "type": "object",
            "description": "그 버전의 본문 전체와 매뉴얼 목록"
          },
          "changedApiKeyId": {
            "type": "number",
            "nullable": true,
            "description": "바꾼 API 키"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "version",
          "snapshot",
          "changedApiKeyId",
          "createdAt"
        ]
      },
      "AiAgentManualResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "aiAgentId": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "content": {
            "type": "string"
          },
          "manualKind": {
            "type": "string",
            "enum": [
              "GENERAL",
              "NOTE"
            ]
          },
          "noteFields": {
            "nullable": true,
            "description": "NOTE 일 때 받아 적을 항목",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "noteHandoffEnabled": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "aiAgentId",
          "name",
          "description",
          "content",
          "manualKind",
          "noteFields",
          "noteHandoffEnabled",
          "isActive",
          "createdAt",
          "updatedAt"
        ]
      },
      "ManualNoteFieldRequest": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "필드 키. 영문/숫자/언더스코어만 허용",
            "example": "requestedAt"
          },
          "label": {
            "type": "string",
            "description": "상담원이 고객에게 확인할 필드명",
            "example": "요청 시간"
          },
          "type": {
            "type": "string",
            "description": "필드 타입. DATE = 예약·방문처럼 앞으로의 날짜 (YYYY-MM-DD 로 받고, 없는 날짜·오늘 이전 날짜는 접수하지 않는다), TIME = 시각 (HH:mm 24시간), PHONE = 전화번호 (숫자만, 비우면 지금 전화한 번호), ENUM = options 중 하나",
            "enum": [
              "TEXT",
              "NUMBER",
              "BOOLEAN",
              "DATE",
              "TIME",
              "PHONE",
              "ENUM"
            ],
            "default": "TEXT"
          },
          "required": {
            "type": "boolean",
            "description": "필수 여부",
            "default": true
          },
          "description": {
            "type": "string",
            "description": "필드 수집 힌트"
          },
          "options": {
            "description": "type 이 ENUM 일 때의 선택지 (20개까지, 하나에 40자까지)",
            "example": [
              "홀",
              "포장"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "key",
          "label"
        ]
      },
      "CreateAiAgentManualRequest": {
        "type": "object",
        "properties": {
          "manualKind": {
            "type": "string",
            "enum": [
              "GENERAL",
              "NOTE"
            ],
            "description": "GENERAL = 안내, NOTE = 정해진 항목을 받아 적는 기록형",
            "default": "GENERAL"
          },
          "noteFields": {
            "description": "NOTE 일 때 받아 적을 항목 (20개까지)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManualNoteFieldRequest"
            }
          },
          "noteHandoffEnabled": {
            "type": "boolean",
            "description": "NOTE 일 때 받아 적은 뒤 담당자 연결",
            "default": false
          },
          "name": {
            "type": "string",
            "description": "매뉴얼 이름 (100자 이하)"
          },
          "description": {
            "type": "string",
            "description": "언제 쓰는지 — 모델이 읽는다 (300자 이하)",
            "nullable": true
          },
          "content": {
            "type": "string",
            "description": "본문 (1500자 이하)"
          },
          "isActive": {
            "type": "boolean",
            "description": "사용 여부",
            "default": true
          }
        },
        "required": [
          "name",
          "content"
        ]
      },
      "PatchAiAgentManualRequest": {
        "type": "object",
        "properties": {
          "manualKind": {
            "type": "string",
            "enum": [
              "GENERAL",
              "NOTE"
            ],
            "description": "GENERAL = 안내, NOTE = 정해진 항목을 받아 적는 기록형",
            "default": "GENERAL"
          },
          "noteFields": {
            "description": "NOTE 일 때 받아 적을 항목 (20개까지)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManualNoteFieldRequest"
            }
          },
          "noteHandoffEnabled": {
            "type": "boolean",
            "description": "NOTE 일 때 받아 적은 뒤 담당자 연결",
            "default": false
          },
          "name": {
            "type": "string",
            "description": "매뉴얼 이름 (100자 이하)"
          },
          "description": {
            "type": "string",
            "description": "언제 쓰는지 (300자 이하)",
            "nullable": true
          },
          "content": {
            "type": "string",
            "description": "본문 (1500자 이하)"
          },
          "isActive": {
            "type": "boolean",
            "description": "사용 여부"
          }
        }
      },
      "GroupChannelResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "번호(channel) ID"
          },
          "phoneNumber": {
            "type": "string",
            "description": "전화번호"
          },
          "displayName": {
            "type": "string",
            "nullable": true,
            "description": "번호 이름"
          },
          "isPrimary": {
            "type": "boolean",
            "description": "대표 번호"
          }
        },
        "required": [
          "id",
          "phoneNumber",
          "displayName",
          "isPrimary"
        ]
      },
      "PutAiAgentChannelRequest": {
        "type": "object",
        "properties": {
          "channelIdList": {
            "description": "연결할 번호(channel) ID 목록 — 이 목록으로 통째로 바꾼다. [] = 모두 끊기",
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "required": [
          "channelIdList"
        ]
      },
      "AiAgentMcpToolResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "toolName": {
            "type": "string",
            "description": "모델에 보이는 이름"
          },
          "description": {
            "type": "string"
          },
          "readOnly": {
            "type": "boolean",
            "description": "조회 도구 (readOnlyHint). 아니면 되읽고 확인받은 뒤에만 부른다"
          },
          "usable": {
            "type": "boolean",
            "description": "통화에 붙는가 — 인자 스키마를 Gemini 가 받는 모양으로 줄일 수 있었는가"
          },
          "unusableReason": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "name",
          "toolName",
          "description",
          "readOnly",
          "usable",
          "unusableReason"
        ]
      },
      "AiAgentToolResponse": {
        "type": "object",
        "properties": {
          "inputBindings": {
            "type": "object",
            "nullable": true
          },
          "id": {
            "type": "number"
          },
          "aiAgentId": {
            "type": "number"
          },
          "kind": {
            "type": "string",
            "enum": [
              "HTTP",
              "MCP"
            ]
          },
          "name": {
            "type": "string"
          },
          "toolName": {
            "type": "string",
            "description": "모델에 보이는 이름 (HTTP ext_<name>, MCP mcp_<name>_<도구>) — 실행 기록(action_log)의 도구 이름"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string"
          },
          "httpMethod": {
            "type": "string",
            "enum": [
              "GET",
              "POST"
            ],
            "nullable": true
          },
          "inputSchema": {
            "type": "object",
            "nullable": true
          },
          "authType": {
            "type": "string",
            "enum": [
              "NONE",
              "BEARER",
              "HEADER"
            ]
          },
          "authHeaderName": {
            "type": "string",
            "nullable": true
          },
          "hasAuthSecret": {
            "type": "boolean",
            "description": "인증값이 저장돼 있는가"
          },
          "timeoutMs": {
            "type": "number"
          },
          "write": {
            "type": "boolean",
            "description": "고객사 데이터를 바꾸는 도구 — 되읽고 확인받은 뒤에만 부른다 (MCP 는 도구마다 readOnly)"
          },
          "allowedTools": {
            "nullable": true,
            "description": "MCP 만: 모델에 보여 줄 도구 이름. null 이면 전부",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mcpTools": {
            "nullable": true,
            "description": "MCP 만: 마지막으로 받은 도구 목록",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AiAgentMcpToolResponse"
            }
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "inputBindings",
          "id",
          "aiAgentId",
          "kind",
          "name",
          "toolName",
          "description",
          "url",
          "httpMethod",
          "inputSchema",
          "authType",
          "authHeaderName",
          "hasAuthSecret",
          "timeoutMs",
          "write",
          "allowedTools",
          "mcpTools",
          "isActive",
          "createdAt",
          "updatedAt"
        ]
      },
      "CreateAiAgentToolRequest": {
        "type": "object",
        "properties": {
          "inputBindings": {
            "type": "object",
            "nullable": true,
            "description": "HTTP 인자의 고정값 또는 등록 발신 입력 바인딩"
          },
          "kind": {
            "type": "string",
            "enum": [
              "HTTP",
              "MCP"
            ],
            "default": "HTTP",
            "description": "HTTP = API 하나(ext_<name>), MCP = MCP 서버 하나(Streamable HTTP). MCP 는 등록할 때 tools/list 를 받아 저장하고, 도구마다 mcp_<name>_<도구> 로 보인다. readOnlyHint 가 없는 도구는 쓰기 도구로 다룬다"
          },
          "allowedTools": {
            "description": "MCP 만: 모델에 보여 줄 도구 이름. 비우면(null) 쓸 수 있는 도구 전부",
            "nullable": true,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "name": {
            "type": "string",
            "description": "HTTP 는 함수 이름(영문 소문자로 시작하는 영문 소문자·숫자·밑줄 48자, 모델에는 ext_<name>), MCP 는 서버 별칭(16자)",
            "example": "order_status"
          },
          "description": {
            "type": "string",
            "description": "언제 쓰는지 — 모델이 읽고 도구를 고른다 (1000자 이하)",
            "example": "주문번호로 배송 상태를 조회한다"
          },
          "url": {
            "type": "string",
            "description": "부를 주소 — https 만, 내부망·사설 주소는 거절(AG011)",
            "example": "https://api.example.com/orders"
          },
          "httpMethod": {
            "type": "string",
            "enum": [
              "GET",
              "POST"
            ],
            "default": "GET",
            "description": "GET 은 인자를 쿼리로, POST 는 JSON 본문으로"
          },
          "inputSchema": {
            "type": "object",
            "description": "인자의 JSON Schema. 최상위 { \"type\": \"object\", \"properties\": {…}, \"required\": […] }, 인자마다 type·description·enum·items·properties·required 만 (3단계까지). 생략하면 인자 없음"
          },
          "authType": {
            "type": "string",
            "enum": [
              "NONE",
              "BEARER",
              "HEADER"
            ],
            "default": "NONE",
            "description": "BEARER = Authorization: Bearer <authSecret>, HEADER = <authHeaderName>: <authSecret>"
          },
          "authHeaderName": {
            "type": "string",
            "description": "HEADER 일 때 헤더 이름",
            "example": "X-Api-Key",
            "nullable": true
          },
          "authSecret": {
            "type": "string",
            "description": "인증값 — 암호화해 저장하고 응답에는 다시 내보내지 않는다 (1000자 이하)",
            "nullable": true
          },
          "timeoutMs": {
            "type": "number",
            "description": "응답을 기다리는 시간(ms), 1000~8000",
            "default": 5000
          },
          "write": {
            "type": "boolean",
            "description": "고객사 데이터를 바꾸는 도구(주문 취소·예약 변경 등). 켜면 상담원이 손님께 내용을 되읽고 확인받은 뒤에만 부른다",
            "default": false
          },
          "isActive": {
            "type": "boolean",
            "description": "끄면 통화에 쓰지 않는다",
            "default": true
          }
        },
        "required": [
          "name",
          "description",
          "url"
        ]
      },
      "PatchAiAgentToolRequest": {
        "type": "object",
        "properties": {
          "inputBindings": {
            "type": "object",
            "nullable": true,
            "description": "HTTP 인자의 고정값 또는 등록 발신 입력 바인딩"
          },
          "allowedTools": {
            "description": "MCP 만: 모델에 보여 줄 도구 이름. null 이면 전부",
            "nullable": true,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "name": {
            "type": "string",
            "description": "함수 이름"
          },
          "description": {
            "type": "string",
            "description": "언제 쓰는지 (1000자 이하)"
          },
          "url": {
            "type": "string",
            "description": "부를 주소 — https 만"
          },
          "httpMethod": {
            "type": "string",
            "enum": [
              "GET",
              "POST"
            ]
          },
          "inputSchema": {
            "type": "object",
            "description": "인자의 JSON Schema. 최상위 { \"type\": \"object\", \"properties\": {…}, \"required\": […] }, 인자마다 type·description·enum·items·properties·required 만 (3단계까지). 생략하면 인자 없음"
          },
          "authType": {
            "type": "string",
            "enum": [
              "NONE",
              "BEARER",
              "HEADER"
            ]
          },
          "authHeaderName": {
            "type": "string",
            "nullable": true
          },
          "authSecret": {
            "type": "string",
            "description": "인증값 — null 이면 지운다",
            "nullable": true
          },
          "timeoutMs": {
            "type": "number"
          },
          "write": {
            "type": "boolean",
            "description": "고객사 데이터를 바꾸는 도구 — 되읽고 확인받은 뒤에만 부른다"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "TestAiAgentToolRequest": {
        "type": "object",
        "properties": {
          "outboundInputs": {
            "type": "object",
            "description": "등록된 발신 입력의 시험 값"
          },
          "args": {
            "type": "object",
            "description": "보낼 인자 (inputSchema 모양)",
            "example": {
              "orderNo": "A-1"
            }
          },
          "callerPhoneNumber": {
            "type": "string",
            "description": "X-Zerocall-Caller 로 보낼 시험 발신번호 (숫자만)",
            "example": "01012345678"
          }
        }
      },
      "AiAgentToolTestResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "2xx 로 답했는가"
          },
          "status": {
            "type": "number",
            "nullable": true,
            "description": "고객 서버의 상태 코드 (보내지 못했으면 없음)"
          },
          "latencyMs": {
            "type": "number",
            "description": "걸린 시간(ms)"
          },
          "bodyPreview": {
            "type": "string",
            "nullable": true,
            "description": "응답 앞부분 (2000자까지)"
          },
          "truncated": {
            "type": "boolean",
            "description": "32KB 를 넘어 통화 중에도 잘리는 응답인가"
          },
          "error": {
            "type": "string",
            "nullable": true,
            "description": "시간 초과·막은 주소·연결 실패"
          }
        },
        "required": [
          "ok",
          "status",
          "latencyMs",
          "bodyPreview",
          "truncated",
          "error"
        ]
      },
      "AiAgentLiveModelResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "모델 id — 상담원 liveModel 에 넣는 값",
            "example": "gemini-3.8-live"
          },
          "name": {
            "type": "string",
            "example": "Gemini 3.8 Live"
          },
          "company": {
            "type": "string",
            "description": "제공 회사",
            "example": "Google"
          },
          "pricePerMinute": {
            "type": "number",
            "description": "분당 단가(원, 부가세 별도)",
            "example": 30
          },
          "status": {
            "type": "string",
            "enum": [
              "AVAILABLE",
              "PREPARING",
              "SUNSET"
            ],
            "description": "AVAILABLE 제공 중 · PREPARING 준비 중(고를 수 없음) · SUNSET 종료 예정(sunsetAt 전까지 고를 수 있음)"
          },
          "sunsetAt": {
            "type": "string",
            "nullable": true,
            "description": "이 시각부터 고를 수 없고, 이 모델 상담원은 replacedBy 모델로 바뀐다",
            "example": "2026-12-13T00:00:00+09:00"
          },
          "replacedBy": {
            "type": "string",
            "nullable": true,
            "description": "종료 뒤 대신 쓰는 모델 id",
            "example": "gemini-3.8-live"
          },
          "selectable": {
            "type": "boolean",
            "description": "이 그룹(프로젝트)에서 지금 고를 수 있는지"
          },
          "unavailableReason": {
            "type": "string",
            "nullable": true,
            "enum": [
              "PREPARING",
              "ENDED",
              "CARD_REQUIRED"
            ],
            "description": "고를 수 없는 까닭 — PREPARING 준비 중(AG017) · ENDED 지원 끝남(AG018) · CARD_REQUIRED 무료 체험 중이고 카드가 없는 KAT 프로젝트는 분당 30원 이하만(AG019)"
          }
        },
        "required": [
          "id",
          "name",
          "company",
          "pricePerMinute",
          "status",
          "sunsetAt",
          "replacedBy",
          "selectable",
          "unavailableReason"
        ]
      },
      "CreateAiOutboundCallRequest": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "number",
            "description": "발신 상담원 ID (방향 OUTBOUND·ACTIVE)",
            "minimum": 1
          },
          "callerChannelId": {
            "type": "number",
            "description": "발신에 쓸 그룹 전화번호(채널) ID",
            "minimum": 1
          },
          "destination": {
            "type": "string",
            "description": "받는 국내 번호",
            "maxLength": 32,
            "example": "010-1234-5678"
          },
          "inputs": {
            "type": "object",
            "additionalProperties": true,
            "description": "상담원 발신 입력 칸의 값. 입력 칸이 없는 상담원이면 {}"
          },
          "timeLimit": {
            "type": "number",
            "description": "이 통화의 최대 시간(초). 상담원 maxCallSeconds 보다 길면 상담원 값, 비우면 상담원 값",
            "minimum": 30,
            "maximum": 480
          }
        },
        "required": [
          "agentId",
          "callerChannelId",
          "destination",
          "inputs"
        ]
      },
      "PlanInfoResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "플랜 ID",
            "example": 1
          },
          "name": {
            "type": "string",
            "description": "플랜 이름",
            "example": "에코"
          },
          "serverPlanName": {
            "type": "string",
            "description": "서버 플랜 이름",
            "enum": [
              "ECHO",
              "BASIC",
              "BUSINESS"
            ],
            "example": "ECHO"
          },
          "monthlyPrice": {
            "type": "number",
            "description": "월 요금",
            "example": 1980
          },
          "regularPrice": {
            "type": "number",
            "description": "표기 정가",
            "example": 4900
          },
          "callMinutes": {
            "type": "number",
            "description": "제공 통화 분",
            "example": 0
          },
          "messageCount": {
            "type": "number",
            "description": "제공 메시지 수",
            "example": 0
          },
          "description": {
            "description": "플랜 설명",
            "example": [
              "070 번호 발급",
              "문자/전화 수신 가능"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "name",
          "serverPlanName",
          "monthlyPrice",
          "regularPrice",
          "callMinutes",
          "messageCount",
          "description"
        ]
      },
      "AvailablePlanListResponse": {
        "type": "object",
        "properties": {
          "plans": {
            "description": "사용 가능한 플랜 목록",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanInfoResponse"
            }
          }
        },
        "required": [
          "plans"
        ]
      },
      "CreateGroupRequest": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "description": "특정 번호 지정 발급 (미입력 시 랜덤 발급)",
            "example": "07012345678"
          },
          "groupTitle": {
            "type": "string",
            "description": "생성할 그룹 이름 (미입력 시 자동 생성)",
            "example": "Partner A SMS Channel"
          },
          "plan": {
            "type": "string",
            "description": "요금제 (미입력 시 BASIC)",
            "enum": [
              "ECHO",
              "BASIC",
              "BUSINESS"
            ],
            "example": "BASIC"
          },
          "aiServiceEnabled": {
            "type": "boolean",
            "description": "AI 추가 서비스(add-on) 신청 여부 (BASIC/BUSINESS만 가능)"
          }
        }
      },
      "AddKatcloudNumberRequest": {
        "type": "object",
        "properties": {
          "confirmMonthlyFee": {
            "type": "boolean",
            "description": "늘어날 월 요금(GET /group/{groupId}/numbers/quote 의 addedMonthlyFee)을 확인했으면 true. 다음 결제 기간부터 빠집니다",
            "example": true
          }
        },
        "required": [
          "confirmMonthlyFee"
        ]
      },
      "PatchGroupRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "그룹명"
          },
          "routeToAi": {
            "type": "boolean",
            "description": "AI 라우팅 여부 (그룹 내 모든 채널에 적용됨)"
          },
          "handoffEnabled": {
            "type": "boolean",
            "description": "담당자 연결 기능 활성화 여부"
          },
          "recordingEnabled": {
            "type": "boolean",
            "description": "통화 녹음 활성화 여부"
          },
          "transcriptionEnabled": {
            "type": "boolean",
            "description": "KAT Cloud 그룹만: 받아쓰기·요약 켜기. 녹음이 켜져 있어야 켤 수 있고(KC107), 녹음을 끄면 같이 꺼진다. 빼면 녹음을 끔→켬으로 바꿀 때 같이 켜지고 그 밖에는 그대로다. 녹음만 원하면 false 를 같이 보낸다. 켜면 받아쓰기를 위해 음성이 국외 AI 사업자로 간다(처리 뒤 지운다). 제로콜 그룹은 요금제가 정한다(KC109)"
          },
          "useSMSTool": {
            "type": "boolean",
            "description": "SMS tool 활성화 여부"
          },
          "useCRMTool": {
            "type": "boolean",
            "description": "CRM tool 활성화 여부"
          },
          "handoffDisabledMessage": {
            "type": "string",
            "description": "담당자 연결 비활성화 시 안내 메시지"
          }
        }
      },
      "PatchCallForwardRequest": {
        "type": "object",
        "properties": {
          "isCallForwardEnabled": {
            "type": "boolean",
            "description": "착신전환 활성화 여부"
          },
          "callForwardNumber": {
            "type": "string",
            "description": "착신전환 전화번호"
          }
        },
        "required": [
          "isCallForwardEnabled"
        ]
      },
      "InviteGroupMemberRequest": {
        "type": "object",
        "properties": {
          "invitePhoneNumberList": {
            "description": "초대받을 사람 전화번호 목록",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PatchGroupMemberCallReceiveRequest": {
        "type": "object",
        "properties": {
          "isCallReceiveEnabled": {
            "type": "boolean",
            "description": "전화 수신 가능 여부"
          }
        },
        "required": [
          "isCallReceiveEnabled"
        ]
      },
      "CallAnnouncementLegResponse": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "messageType": {
            "type": "string",
            "enum": [
              "AI_NOTICE",
              "RECORDING_NOTICE",
              "AI_AND_RECORDING",
              "CUSTOM_TEXT",
              "CUSTOM_AUDIO"
            ]
          },
          "customText": {
            "type": "string",
            "nullable": true,
            "description": "저장된 직접 쓴 문구"
          },
          "spokenText": {
            "type": "string",
            "nullable": true,
            "description": "재생되는 문구. 올린 음성이면 null"
          },
          "hasCustomAudio": {
            "type": "boolean",
            "description": "올린 음성 파일이 있는지"
          },
          "customAudioDurationMs": {
            "type": "number",
            "nullable": true
          },
          "audioReady": {
            "type": "boolean",
            "description": "재생 음성이 준비됐는지. 저장 후 PBX 반영까지 최대 5분"
          },
          "audioUpdatedAt": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "enabled",
          "messageType",
          "hasCustomAudio",
          "audioReady"
        ]
      },
      "CallAnnouncementResponse": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "messageType": {
            "type": "string",
            "enum": [
              "AI_NOTICE",
              "RECORDING_NOTICE",
              "AI_AND_RECORDING",
              "CUSTOM_TEXT",
              "CUSTOM_AUDIO"
            ]
          },
          "customText": {
            "type": "string",
            "nullable": true,
            "description": "저장된 직접 쓴 문구"
          },
          "spokenText": {
            "type": "string",
            "nullable": true,
            "description": "재생되는 문구. 올린 음성이면 null"
          },
          "hasCustomAudio": {
            "type": "boolean",
            "description": "올린 음성 파일이 있는지"
          },
          "customAudioDurationMs": {
            "type": "number",
            "nullable": true
          },
          "audioReady": {
            "type": "boolean",
            "description": "재생 음성이 준비됐는지. 저장 후 PBX 반영까지 최대 5분"
          },
          "audioUpdatedAt": {
            "format": "date-time",
            "type": "string",
            "nullable": true
          },
          "direction": {
            "type": "string",
            "enum": [
              "INBOUND",
              "OUTBOUND",
              "BOTH"
            ]
          },
          "inbound": {
            "description": "받는 전화(070 으로 온 전화를 SIP 트렁크로 넘길 때)",
            "allOf": [
              {
                "$ref": "#/components/schemas/CallAnnouncementLegResponse"
              }
            ]
          },
          "outbound": {
            "description": "거는 전화(SIP 트렁크로 건 전화를 상대가 받았을 때)",
            "allOf": [
              {
                "$ref": "#/components/schemas/CallAnnouncementLegResponse"
              }
            ]
          }
        },
        "required": [
          "enabled",
          "messageType",
          "hasCustomAudio",
          "audioReady",
          "direction",
          "inbound",
          "outbound"
        ]
      },
      "CallAnnouncementLegRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "이 방향의 안내 멘트 켜기. 끄면 저장된 음성은 남고 재생만 하지 않는다"
          },
          "messageType": {
            "type": "string",
            "enum": [
              "AI_NOTICE",
              "RECORDING_NOTICE",
              "AI_AND_RECORDING",
              "CUSTOM_TEXT",
              "CUSTOM_AUDIO"
            ],
            "description": "AI_NOTICE·RECORDING_NOTICE·AI_AND_RECORDING = 기본 문구, CUSTOM_TEXT = customText 를 음성으로, CUSTOM_AUDIO = 이 방향에 올린 음성 파일(먼저 음성 파일 올리기)"
          },
          "customText": {
            "type": "string",
            "description": "직접 쓴 문구(200자 이내, 읽어서 20초 이내). 빼면 저장된 문구를 그대로 둔다",
            "example": "이 통화는 AI 상담원이 응대하며 녹음될 수 있습니다."
          }
        }
      },
      "PutCallAnnouncementRequest": {
        "type": "object",
        "properties": {
          "inbound": {
            "description": "받는 전화(070 으로 온 전화를 SIP 트렁크로 넘길 때 손님에게)",
            "allOf": [
              {
                "$ref": "#/components/schemas/CallAnnouncementLegRequest"
              }
            ]
          },
          "outbound": {
            "description": "거는 전화(SIP 트렁크로 건 전화를 상대가 받았을 때 상대에게)",
            "allOf": [
              {
                "$ref": "#/components/schemas/CallAnnouncementLegRequest"
              }
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "[예전 방식] 안내 멘트 켜기 — direction 이 가리키는 방향에"
          },
          "direction": {
            "type": "string",
            "enum": [
              "INBOUND",
              "OUTBOUND",
              "BOTH"
            ],
            "description": "[예전 방식] INBOUND = 받는 전화만, OUTBOUND = 거는 전화만, BOTH = 둘 다 같은 내용. 방향마다 따로 정하려면 inbound·outbound 를 쓴다"
          },
          "messageType": {
            "type": "string",
            "enum": [
              "AI_NOTICE",
              "RECORDING_NOTICE",
              "AI_AND_RECORDING",
              "CUSTOM_TEXT",
              "CUSTOM_AUDIO"
            ],
            "description": "[예전 방식] 무엇을 틀지"
          },
          "customText": {
            "type": "string",
            "description": "[예전 방식] 직접 쓴 문구(200자 이내)"
          }
        }
      },
      "KatcloudBudgetPeriodResponse": {
        "type": "object",
        "properties": {
          "startedAt": {
            "format": "date-time",
            "type": "string"
          },
          "endsAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "startedAt",
          "endsAt"
        ]
      },
      "KatcloudBudgetPauseResponse": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "NOTIFY",
              "PAUSE_OUTBOUND",
              "PAUSE_ALL"
            ]
          },
          "at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "action",
          "at"
        ]
      },
      "KatcloudBudgetResponse": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "number"
          },
          "amount": {
            "type": "number",
            "nullable": true,
            "description": "예산(원, 부가세 포함). null 이면 예산 없음"
          },
          "overAction": {
            "type": "string",
            "enum": [
              "NOTIFY",
              "PAUSE_OUTBOUND",
              "PAUSE_ALL"
            ],
            "description": "예산을 다 쓰면 할 동작"
          },
          "alertThresholds": {
            "description": "알림 기준(%)",
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "period": {
            "nullable": true,
            "description": "지금 결제 기간. 유료 시작 전(체험)·해지면 null",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/KatcloudBudgetPeriodResponse"
              }
            ]
          },
          "spent": {
            "type": "number",
            "description": "이번 결제 기간 사용료(원, 부가세 포함) — 결제 배치가 마지막으로 센 값"
          },
          "percent": {
            "type": "number",
            "nullable": true,
            "description": "사용률(%, 버림). 예산이 없으면 null"
          },
          "countedAt": {
            "format": "date-time",
            "type": "string",
            "nullable": true,
            "description": "사용료를 마지막으로 센 시각"
          },
          "paused": {
            "nullable": true,
            "description": "예산 때문에 걸린 멈춤. 없으면 null",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/KatcloudBudgetPauseResponse"
              }
            ]
          },
          "alertsSent": {
            "description": "이번 결제 기간에 이미 보낸 알림 기준(%)",
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "managedByB2b": {
            "type": "boolean",
            "description": "파트너사가 관리하는 프로젝트 — 보기만 (바꾸면 KC162)"
          },
          "batchMinutes": {
            "type": "number",
            "description": "사용액 확인 주기(분)"
          },
          "maxDelayMinutes": {
            "type": "number",
            "description": "넘은 뒤 멈추기까지 늦을 수 있는 시간(분)"
          }
        },
        "required": [
          "groupId",
          "overAction",
          "alertThresholds",
          "spent",
          "alertsSent",
          "managedByB2b",
          "batchMinutes",
          "maxDelayMinutes"
        ]
      },
      "PutKatcloudBudgetRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "nullable": true,
            "description": "결제 기간(유료 시작일 기준 한 달) 사용료 예산(원, 부가세 포함). 월 요금·번호 요금은 세지 않는다. null 이면 예산 없음(무제한). 1,000원 이상. 빼면 지금 값 그대로",
            "example": 100000
          },
          "overAction": {
            "type": "string",
            "enum": [
              "NOTIFY",
              "PAUSE_OUTBOUND",
              "PAUSE_ALL"
            ],
            "description": "예산을 다 쓰면: NOTIFY = 알림만(기본), PAUSE_OUTBOUND = AI 발신·문자·알림톡 발송 멈춤(그 API 가 KC161, 통화 중 AI 상담원이 보내는 문자는 제외), PAUSE_ALL = 모든 통화 멈춤(받기·걸기 모두, 그룹이 멈춘 상태 KC008). 빼면(또는 null) 지금 값 그대로. 예산을 올리거나 다음 결제 기간이 되면 자동으로 풀린다. 사용액은 10분마다 확인해 최대 15분쯤 늦게 멈출 수 있다"
          },
          "alertThresholds": {
            "description": "알림 기준(%) — 50·80·100 중에서. 빼면(또는 null) 지금 값 그대로(처음이면 셋 다). 빈 배열이면 알림 없음(넘을 때 동작은 그대로)",
            "example": [
              50,
              80,
              100
            ],
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        }
      },
      "SendMessageRequest": {
        "type": "object",
        "properties": {
          "fromPhoneNumber": {
            "type": "string",
            "description": "발신 번호 (내 그룹 번호만 가능)"
          },
          "toPhoneNumber": {
            "type": "string",
            "description": "수신 번호"
          },
          "subject": {
            "type": "string",
            "description": "LMS 제목 (선택)"
          },
          "imageList": {
            "description": "이미지/동영상 목록 (S3 key 또는 URL). 존재하면 MMS로 발송됩니다.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "content": {
            "type": "string",
            "description": "메시지 본문 (최대 2000자)",
            "example": "안녕하세요. 예약이 확정되었습니다."
          }
        },
        "required": [
          "toPhoneNumber",
          "content"
        ]
      },
      "MessageSendResultResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "메시지 ID"
          },
          "content": {
            "type": "string",
            "description": "내용"
          },
          "subject": {
            "type": "string",
            "description": "제목"
          },
          "imageList": {
            "description": "이미지 목록",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "externalMessageId": {
            "type": "string",
            "description": "외부 메시지 ID"
          },
          "fromPhoneNumber": {
            "type": "string",
            "description": "발신 번호"
          },
          "toPhoneNumber": {
            "type": "string",
            "description": "수신 번호"
          },
          "sendStatus": {
            "type": "string",
            "description": "발송 상태"
          },
          "chatType": {
            "type": "string",
            "description": "메시지 타입"
          },
          "resultStatus": {
            "type": "string",
            "description": "결과 상태 코드"
          },
          "resultMessage": {
            "type": "string",
            "description": "결과 메시지"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "생성일시"
          }
        },
        "required": [
          "id",
          "content",
          "imageList",
          "createdAt"
        ]
      },
      "SendKakaoMessageRequest": {
        "type": "object",
        "properties": {
          "templateId": {
            "type": "number",
            "minimum": 1,
            "description": "알림톡 템플릿 ID (GET /message/kakao/templates 의 id)"
          },
          "toPhoneNumber": {
            "type": "string",
            "maxLength": 20,
            "description": "받는 휴대폰 번호",
            "example": "01012345678"
          },
          "variables": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "템플릿 변수 값 — 템플릿의 variables 마다 하나씩. 빠지거나 템플릿에 없는 이름이면 KK006",
            "example": {
              "이름": "홍길동"
            }
          },
          "fromPhoneNumber": {
            "type": "string",
            "maxLength": 20,
            "description": "발신 번호 (그룹의 KAT 번호). 비우면 대표 번호"
          },
          "fallbackEnabled": {
            "type": "boolean",
            "description": "알림톡 실패 시 문자 대체발송 (기본 false). 켜면 90바이트 이하 SMS, 넘으면 LMS — 문자 요금이 따로 든다"
          },
          "fallbackContent": {
            "type": "string",
            "maxLength": 2000,
            "description": "대체발송 본문. 비우면 알림톡 본문 그대로"
          },
          "fallbackSubject": {
            "type": "string",
            "maxLength": 64,
            "description": "대체발송 LMS 제목"
          }
        },
        "required": [
          "templateId",
          "toPhoneNumber"
        ]
      },
      "STTChatApiResponse": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "역할 (agent/customer)"
          },
          "text": {
            "type": "string",
            "description": "텍스트"
          },
          "timestamp": {
            "type": "number",
            "description": "타임스탬프 (second)"
          }
        },
        "required": [
          "role",
          "text"
        ]
      },
      "RecordingFileApiResponse": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "S3 Presigned URL (재생/다운로드용)"
          },
          "expiresAt": {
            "type": "string",
            "description": "URL 만료 시각 (ISO 8601)",
            "example": "2024-01-01T12:05:00.000Z"
          },
          "contentLength": {
            "type": "number",
            "description": "파일 크기 (bytes)"
          },
          "contentType": {
            "type": "string",
            "description": "Content-Type",
            "example": "audio/wav"
          }
        },
        "required": [
          "url",
          "expiresAt",
          "contentLength",
          "contentType"
        ]
      },
      "RecordingApiResponse": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "S3 Presigned URL (재생/다운로드용)"
          },
          "expiresAt": {
            "type": "string",
            "description": "URL 만료 시각 (ISO 8601)",
            "example": "2024-01-01T12:05:00.000Z"
          },
          "contentLength": {
            "type": "number",
            "description": "파일 크기 (bytes)"
          },
          "contentType": {
            "type": "string",
            "description": "Content-Type",
            "example": "audio/wav"
          },
          "customer": {
            "description": "고객 음성만 담긴 녹음 (includeTracks=true)",
            "allOf": [
              {
                "$ref": "#/components/schemas/RecordingFileApiResponse"
              }
            ]
          },
          "agent": {
            "description": "상담원(AI 통화는 AI) 음성만 담긴 녹음 (includeTracks=true)",
            "allOf": [
              {
                "$ref": "#/components/schemas/RecordingFileApiResponse"
              }
            ]
          }
        },
        "required": [
          "url",
          "expiresAt",
          "contentLength",
          "contentType"
        ]
      },
      "CallHistoryApiResponse": {
        "type": "object",
        "properties": {
          "callHistoryId": {
            "type": "string",
            "description": "통화 기록 ID"
          },
          "fromNumber": {
            "type": "string",
            "description": "발신 전화번호"
          },
          "toNumber": {
            "type": "string",
            "description": "수신 전화번호"
          },
          "isInbound": {
            "type": "boolean",
            "description": "수신 여부"
          },
          "status": {
            "type": "string",
            "description": "통화 상태 (구버전 호환용. 진행 중이면 UNKNOWN, 발신은 항상 ANSWERED)",
            "enum": [
              "ANSWERED",
              "MISSED",
              "REJECTED",
              "UNKNOWN"
            ]
          },
          "callPhase": {
            "type": "string",
            "description": "통화 생명주기 단계. 교환기 이벤트로 기록된 값이며, 없으면 아직 이 경로를 안 탄 통화다",
            "enum": [
              "RECEIVED",
              "AI_TALKING",
              "QUEUED",
              "RINGING",
              "TALKING",
              "ANSWERED",
              "MISSED",
              "ABANDONED",
              "REJECTED",
              "FAILED",
              "BLOCKED"
            ]
          },
          "tag": {
            "type": "string",
            "description": "통화 태그 (AI/DIRECT/AI_TO_DIRECT)",
            "enum": [
              "AI",
              "DIRECT",
              "AI_TO_DIRECT",
              "UNKNOWN"
            ]
          },
          "duration": {
            "type": "number",
            "description": "통화 시간 (초)"
          },
          "summary": {
            "type": "string",
            "description": "통화 요약"
          },
          "sttAI": {
            "description": "AI STT 대화 내역",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/STTChatApiResponse"
            }
          },
          "sttDirect": {
            "description": "Direct STT 대화 내역",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/STTChatApiResponse"
            }
          },
          "channelId": {
            "type": "number",
            "description": "채널 ID"
          },
          "groupId": {
            "type": "number",
            "description": "그룹 ID"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "통화 시작 시간"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "마지막 갱신 시각. updatedAfter 커서로 사용한다"
          },
          "recordingAI": {
            "description": "녹음 파일 정보 (AI 통화)",
            "allOf": [
              {
                "$ref": "#/components/schemas/RecordingApiResponse"
              }
            ]
          },
          "recordingDirect": {
            "description": "녹음 파일 정보 (Direct 통화)",
            "allOf": [
              {
                "$ref": "#/components/schemas/RecordingApiResponse"
              }
            ]
          },
          "isRecorded": {
            "type": "boolean",
            "description": "통화 당시 녹음 활성화 여부"
          },
          "connection": {
            "type": "string",
            "description": "연결 방식. 고객사 WebSocket 으로 음성을 중계한 미디어 스트림 통화면 STREAM, 그 밖에는 없다",
            "enum": [
              "STREAM"
            ]
          }
        },
        "required": [
          "callHistoryId",
          "fromNumber",
          "toNumber",
          "isInbound",
          "status",
          "tag",
          "duration",
          "channelId",
          "groupId",
          "createdAt",
          "updatedAt",
          "isRecorded"
        ]
      },
      "CallHistoryListApiResponse": {
        "type": "object",
        "properties": {
          "data": {
            "description": "통화 기록 목록",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallHistoryApiResponse"
            }
          },
          "total": {
            "type": "number",
            "description": "전체 개수"
          },
          "offset": {
            "type": "number",
            "description": "시작 인덱스"
          },
          "limit": {
            "type": "number",
            "description": "조회 개수"
          }
        },
        "required": [
          "data",
          "total",
          "offset",
          "limit"
        ]
      },
      "CreateMediaStreamCallRequest": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "그룹의 KAT 번호(070) 또는 그 번호에 붙인 발신 표시번호",
            "maxLength": 32,
            "example": "07012345678"
          },
          "to": {
            "type": "string",
            "description": "받는 국내 번호, 또는 국제 발신을 연 그룹이면 E.164 국제 번호",
            "maxLength": 32,
            "example": "01012345678"
          },
          "streamUrl": {
            "type": "string",
            "description": "받은 뒤 음성을 이을 wss 주소",
            "maxLength": 500,
            "example": "wss://example.com/stream"
          },
          "statusCallbackUrl": {
            "type": "string",
            "description": "상태 웹훅을 받을 주소. 없으면 MEDIA_STREAM 으로 등록한 웹훅",
            "maxLength": 500
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "WebSocket start.customParameters 와 상태 웹훅에 그대로 실린다 (JSON 4KB 이내)"
          },
          "timeLimit": {
            "type": "number",
            "description": "받은 뒤 최대 통화 시간(초). 기본 3600",
            "minimum": 10,
            "maximum": 14400
          },
          "codec": {
            "type": "string",
            "enum": [
              "PCMU",
              "PCMA"
            ],
            "description": "WebSocket 음성 코덱. PCMU(μ-law, 기본) 또는 PCMA(A-law). 둘 다 8kHz 모노"
          }
        },
        "required": [
          "from",
          "to",
          "streamUrl"
        ]
      },
      "TransferMediaStreamCallRequest": {
        "type": "object",
        "properties": {
          "targets": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "차례로 걸 번호 [{ number, timeoutSec }] — 1~5개"
          },
          "onFail": {
            "type": "string",
            "enum": [
              "hangup",
              "resume"
            ],
            "description": "아무도 받지 않으면 resume(스트림으로 돌아옴) 또는 hangup(기본)"
          }
        },
        "required": [
          "targets"
        ]
      },
      "PutMediaStreamInboundRequest": {
        "type": "object",
        "properties": {
          "webhookUrl": {
            "type": "string",
            "description": "전화가 오면 받을지 묻는 주소",
            "maxLength": 500
          },
          "statusCallbackUrl": {
            "type": "string",
            "description": "상태 웹훅을 받을 주소. 수신 웹훅 응답의 statusCallbackUrl 이 먼저",
            "maxLength": 500
          },
          "fallback": {
            "type": "object",
            "additionalProperties": true,
            "description": "고객 서버 장애 때 끊는 대신 걸 번호 — { targets: [{ number, timeoutSec }], onFail: \"hangup\" }"
          },
          "fallbackOnStreamClose": {
            "type": "boolean",
            "description": "통화 중 소켓이 비정상으로 닫혀도 우회한다. 기본 false, fallback 이 있어야 켤 수 있다"
          }
        },
        "required": [
          "webhookUrl"
        ]
      },
      "KatNumberRoutingStreamRequest": {
        "type": "object",
        "properties": {
          "webhookUrl": {
            "type": "string",
            "description": "전화가 오면 받을지 묻는 착신 웹훅 주소 (응답으로 WebSocket 주소를 준다)"
          },
          "statusCallbackUrl": {
            "type": "string",
            "description": "상태 웹훅을 받을 주소",
            "nullable": true
          },
          "fallback": {
            "type": "object",
            "description": "고객 서버 장애 때 걸 번호 목록 — 연결 계획 { targets: [{ number, timeoutSec }], onFail: \"hangup\" }"
          },
          "fallbackOnStreamClose": {
            "type": "boolean",
            "description": "통화 중 소켓이 비정상으로 닫혀도 우회. fallback 이 있어야 켤 수 있다"
          }
        },
        "required": [
          "webhookUrl"
        ]
      },
      "PutKatNumberRoutingRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "AI_AGENT",
              "SIP",
              "WEBSOCKET",
              "WEBHOOK",
              "HUMAN"
            ],
            "description": "받는 방식"
          },
          "fallbackMode": {
            "type": "string",
            "enum": [
              "AI_AGENT",
              "SIP",
              "WEBSOCKET",
              "WEBHOOK",
              "HUMAN"
            ],
            "nullable": true,
            "description": "대체 방식. WEBHOOK 이면 필수, 받는 방식과 같거나 WEBHOOK 이면 KC158. 빼면 없음"
          },
          "agentId": {
            "type": "number",
            "description": "AI_AGENT(방식 또는 대체)로 받을 받는 전화 상담원 id. 빼면 번호에 연결된 상담원"
          },
          "stream": {
            "description": "WEBSOCKET(방식 또는 대체)의 스트림 수신 설정. 빼면 저장된 설정을 다시 켠다",
            "allOf": [
              {
                "$ref": "#/components/schemas/KatNumberRoutingStreamRequest"
              }
            ]
          }
        },
        "required": [
          "mode"
        ]
      },
      "SipTrunkInboundNumberResponse": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "description": "번호 (070)"
          },
          "groupId": {
            "type": "number"
          },
          "mode": {
            "type": "string",
            "nullable": true,
            "enum": [
              "SIP"
            ],
            "description": "SIP = 받는 방식을 「내 SIP」로 정한 번호. null = 방식을 정하지 않아 수신 넘김(inboundEnabled)으로 오는 번호"
          }
        },
        "required": [
          "number",
          "groupId",
          "mode"
        ]
      },
      "KatcloudSipTrunkResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "DISABLED"
            ]
          },
          "maxChannels": {
            "type": "number",
            "description": "동시 통화 상한 (발신·수신 넘김 합산)"
          },
          "allowedCidrs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sipUsername": {
            "type": "string",
            "description": "인증 계정 (digest 사용자명)"
          },
          "inboundEnabled": {
            "type": "boolean"
          },
          "peerHost": {
            "type": "string"
          },
          "peerPort": {
            "type": "number"
          },
          "peerTransport": {
            "type": "string",
            "enum": [
              "TLS",
              "TCP",
              "UDP"
            ]
          },
          "peerAuthUsername": {
            "type": "string"
          },
          "peerRequestUser": {
            "type": "string",
            "description": "수신 넘김 요청 URI 사용자. null 이면 착신번호"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "inboundNumbers": {
            "description": "이 트렁크로 받는 번호 (번호별 받는 방식, 에픽 R5)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SipTrunkInboundNumberResponse"
            }
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "maxChannels",
          "allowedCidrs",
          "sipUsername",
          "inboundEnabled",
          "peerTransport",
          "createdAt",
          "inboundNumbers"
        ]
      },
      "KatcloudCreateSipTrunkRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "트렁크 이름",
            "example": "우리 회사 교환기"
          },
          "allowedCidrs": {
            "description": "허용 출발지. IPv4 주소 또는 CIDR. 비우면 출발지를 가리지 않는다",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "inboundEnabled": {
            "type": "boolean",
            "description": "수신 넘김 — 받는 방식을 정하지 않은 번호로 온 전화를 상대 SIP 서버로 보낸다 (받는 방식이 SIP 인 번호는 이 값과 상관없이 트렁크로 온다)"
          },
          "peerHost": {
            "type": "string",
            "description": "우리가 걸 상대 SIP 서버 호스트. null 이면 수신 설정을 지운다",
            "nullable": true
          },
          "peerPort": {
            "type": "number",
            "minimum": 1,
            "maximum": 65535
          },
          "peerTransport": {
            "type": "string",
            "enum": [
              "TLS",
              "TCP",
              "UDP"
            ]
          },
          "peerAuthUsername": {
            "type": "string",
            "description": "상대가 요구하는 digest 사용자명. null 이면 인증 없이 건다",
            "nullable": true
          },
          "peerAuthPassword": {
            "type": "string",
            "description": "상대가 요구하는 digest 비밀번호. 보낼 때만 바뀐다"
          },
          "peerRequestUser": {
            "type": "string",
            "description": "수신 넘김 INVITE 의 요청 URI 사용자 부분. 비우면(null) 착신번호(+8270…). OpenAI SIP 는 프로젝트 ID(proj_…). 넣으면 원래 착신번호는 X-KAT-Called-Number 헤더로 간다",
            "nullable": true,
            "example": "proj_abc123"
          }
        },
        "required": [
          "name",
          "allowedCidrs"
        ]
      },
      "KatcloudCreatedSipTrunkResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "DISABLED"
            ]
          },
          "maxChannels": {
            "type": "number",
            "description": "동시 통화 상한 (발신·수신 넘김 합산)"
          },
          "allowedCidrs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sipUsername": {
            "type": "string",
            "description": "인증 계정 (digest 사용자명)"
          },
          "inboundEnabled": {
            "type": "boolean"
          },
          "peerHost": {
            "type": "string"
          },
          "peerPort": {
            "type": "number"
          },
          "peerTransport": {
            "type": "string",
            "enum": [
              "TLS",
              "TCP",
              "UDP"
            ]
          },
          "peerAuthUsername": {
            "type": "string"
          },
          "peerRequestUser": {
            "type": "string",
            "description": "수신 넘김 요청 URI 사용자. null 이면 착신번호"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "inboundNumbers": {
            "description": "이 트렁크로 받는 번호 (번호별 받는 방식, 에픽 R5)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SipTrunkInboundNumberResponse"
            }
          },
          "sipPassword": {
            "type": "string",
            "description": "비밀번호 — 이 응답에서만 볼 수 있다"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "maxChannels",
          "allowedCidrs",
          "sipUsername",
          "inboundEnabled",
          "peerTransport",
          "createdAt",
          "inboundNumbers",
          "sipPassword"
        ]
      },
      "KatcloudUpdateSipTrunkRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "트렁크 이름",
            "example": "우리 회사 교환기"
          },
          "allowedCidrs": {
            "description": "허용 출발지. IPv4 주소 또는 CIDR. 비우면 출발지를 가리지 않는다",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "inboundEnabled": {
            "type": "boolean",
            "description": "수신 넘김 — 받는 방식을 정하지 않은 번호로 온 전화를 상대 SIP 서버로 보낸다 (받는 방식이 SIP 인 번호는 이 값과 상관없이 트렁크로 온다)"
          },
          "peerHost": {
            "type": "string",
            "description": "우리가 걸 상대 SIP 서버 호스트. null 이면 수신 설정을 지운다",
            "nullable": true
          },
          "peerPort": {
            "type": "number",
            "minimum": 1,
            "maximum": 65535
          },
          "peerTransport": {
            "type": "string",
            "enum": [
              "TLS",
              "TCP",
              "UDP"
            ]
          },
          "peerAuthUsername": {
            "type": "string",
            "description": "상대가 요구하는 digest 사용자명. null 이면 인증 없이 건다",
            "nullable": true
          },
          "peerAuthPassword": {
            "type": "string",
            "description": "상대가 요구하는 digest 비밀번호. 보낼 때만 바뀐다"
          },
          "peerRequestUser": {
            "type": "string",
            "description": "수신 넘김 INVITE 의 요청 URI 사용자 부분. 비우면(null) 착신번호(+8270…). OpenAI SIP 는 프로젝트 ID(proj_…). 넣으면 원래 착신번호는 X-KAT-Called-Number 헤더로 간다",
            "nullable": true,
            "example": "proj_abc123"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "DISABLED"
            ],
            "description": "DISABLED 면 그 트렁크의 발신·수신 넘김을 멈춘다"
          }
        }
      },
      "KatcloudSipTrunkCredentialResponse": {
        "type": "object",
        "properties": {
          "sipUsername": {
            "type": "string",
            "description": "인증 계정"
          },
          "sipPassword": {
            "type": "string",
            "description": "비밀번호 — 이 응답에서만 볼 수 있다"
          }
        },
        "required": [
          "sipUsername",
          "sipPassword"
        ]
      },
      "CallEventItemResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true,
            "description": "이벤트 id — CALL_EVENT 웹훅의 eventId 와 같다. 통화 기록으로 채운 줄(통화 중 기록이 없는 트렁크 통화 등)은 null"
          },
          "type": {
            "type": "string",
            "enum": [
              "call.started",
              "call.routed",
              "call.answered",
              "ai.first_response",
              "ai.interrupted",
              "ai.tool_called",
              "call.transferred",
              "call.ended",
              "recording.ready",
              "transcript.ready"
            ],
            "description": "이벤트 이름. 새 이름이 더해질 수 있다"
          },
          "occurredAt": {
            "type": "string",
            "description": "일어난 시각 (ISO 8601)"
          },
          "data": {
            "type": "object",
            "description": "이벤트별 값 — call.started: direction·from·to · call.routed: mode·action · ai.first_response: latencyMs · ai.tool_called: name·ok·latencyMs · call.transferred: target·to·ok · call.ended: reason·durationSeconds · transcript.ready: summary",
            "additionalProperties": true
          }
        },
        "required": [
          "id",
          "type",
          "occurredAt",
          "data"
        ]
      },
      "CallEventListResponse": {
        "type": "object",
        "properties": {
          "callId": {
            "type": "string",
            "description": "통화 기록 ID (통화 기록 API 의 id)"
          },
          "items": {
            "description": "시간순",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallEventItemResponse"
            }
          }
        },
        "required": [
          "callId",
          "items"
        ]
      },
      "EraseCounterpartRequest": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "description": "상대 전화번호 (010-1234-5678, 01012345678, +821012345678 모두 같다)"
          },
          "mode": {
            "type": "string",
            "enum": [
              "MASK",
              "DELETE"
            ],
            "description": "MASK = 상대 번호만 가운데 마스킹 / DELETE = 마스킹 + 녹음·받아쓰기·요약 삭제 + 조회에서 제외"
          },
          "dryRun": {
            "type": "boolean",
            "description": "true 면 바꾸지 않고 대상 건수만 돌려준다",
            "default": false
          }
        },
        "required": [
          "phoneNumber",
          "mode"
        ]
      },
      "UpdateCallPrivacySettingRequest": {
        "type": "object",
        "properties": {
          "maskCounterpartAfterMonths": {
            "type": "number",
            "nullable": true,
            "minimum": 12,
            "maximum": 36,
            "description": "통화 후 몇 개월이 지나면 상대 번호를 마스킹할지. null 이면 기본(36개월)"
          }
        },
        "required": [
          "maskCounterpartAfterMonths"
        ]
      },
      "UpdateMessageRetentionRequest": {
        "type": "object",
        "properties": {
          "messageRetentionMonths": {
            "type": "number",
            "nullable": true,
            "minimum": 1,
            "maximum": 36,
            "description": "문자 후 몇 개월이 지나면 본문·제목·이미지를 지울지. 발신·수신 번호는 max(이 값, 12)개월 뒤 가린다. null 이면 기본(본문 유지, 번호 36개월)"
          }
        },
        "required": [
          "messageRetentionMonths"
        ]
      },
      "PostChatRequest": {
        "type": "object",
        "properties": {
          "chatRoomId": {
            "type": "string",
            "description": "채팅방 ID"
          },
          "content": {
            "type": "string",
            "description": "텍스트"
          },
          "imageList": {
            "description": "이미지 목록",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "externalMessageId": {
            "type": "string",
            "description": "외부 메시지 ID (중복 방지용)"
          },
          "subject": {
            "type": "string",
            "description": "제목 (LMS인 경우)"
          },
          "source": {
            "type": "string",
            "description": "메시지 소스",
            "enum": [
              "MANUAL",
              "CAMPAIGN",
              "API"
            ],
            "default": "MANUAL"
          }
        },
        "required": [
          "chatRoomId",
          "content"
        ]
      },
      "PostChatRoomRequest": {
        "type": "object",
        "properties": {
          "channelId": {
            "type": "number",
            "description": "채널 ID"
          },
          "phoneNumber": {
            "type": "string",
            "description": "메시지를 보낼 전화번호"
          }
        },
        "required": [
          "channelId",
          "phoneNumber"
        ]
      },
      "CreditSummaryResponse": {
        "type": "object",
        "properties": {
          "creditBalance": {
            "type": "number"
          },
          "billingStatus": {
            "type": "string"
          },
          "autoRechargeThreshold": {
            "type": "number"
          },
          "autoRechargeAmount": {
            "type": "number"
          },
          "costMap": {
            "type": "object"
          },
          "billingAnchorAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "creditBalance",
          "billingStatus",
          "autoRechargeThreshold",
          "autoRechargeAmount"
        ]
      },
      "CreditHistorySummaryBucketResponse": {
        "type": "object",
        "properties": {
          "periodStart": {
            "type": "string"
          },
          "periodEnd": {
            "type": "string"
          },
          "count": {
            "type": "number"
          },
          "totalAmount": {
            "type": "number"
          },
          "startBalance": {
            "type": "number",
            "description": "해당 버킷 시작 시점 잔액"
          },
          "endBalance": {
            "type": "number",
            "description": "해당 버킷 종료 시점 잔액"
          },
          "amountByType": {
            "type": "object"
          },
          "amountByUsageCategory": {
            "type": "object",
            "description": "사용 카테고리별 금액 합계 (CALL/MESSAGE/PLAN/AI_CALL/RECHARGE/ADJUST/REFUND/UNKNOWN)"
          }
        },
        "required": [
          "periodStart",
          "periodEnd",
          "count",
          "totalAmount",
          "startBalance",
          "endBalance",
          "amountByType",
          "amountByUsageCategory"
        ]
      },
      "CreditHistoryResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "type": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "absAmount": {
            "type": "number",
            "description": "시각화용 절대 금액"
          },
          "direction": {
            "type": "string",
            "enum": [
              "DEBIT",
              "CREDIT"
            ],
            "description": "금액 방향 (차감/충전)"
          },
          "sourceType": {
            "type": "string",
            "enum": [
              "USAGE_DEDUCT",
              "PLAN_DEDUCT",
              "AUTO_RECHARGE",
              "MANUAL_ADJUST",
              "AI_CALL_REFUND",
              "CAMPAIGN_USAGE",
              "STORAGE_FEE_DEDUCT",
              "STT_USAGE_DEDUCT",
              "CREDIT_GRANT",
              "CREDIT_GRANT_EXPIRE",
              "CREDIT_GRANT_REVOKE"
            ],
            "description": "원본 이력 타입"
          },
          "usageCategory": {
            "type": "string",
            "enum": [
              "CALL",
              "MESSAGE",
              "PLAN",
              "AI_CALL",
              "RECHARGE",
              "ADJUST",
              "REFUND",
              "STORAGE",
              "STT",
              "UNKNOWN"
            ],
            "description": "사용 카테고리"
          },
          "balanceBefore": {
            "type": "number"
          },
          "balanceAfter": {
            "type": "number"
          },
          "chatId": {
            "type": "string",
            "nullable": true
          },
          "callHistoryId": {
            "type": "string",
            "nullable": true
          },
          "campaignId": {
            "type": "string",
            "nullable": true
          },
          "appliedPaymentHistoryId": {
            "type": "number",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "amount",
          "absAmount",
          "direction",
          "sourceType",
          "usageCategory",
          "balanceBefore",
          "balanceAfter",
          "chatId",
          "callHistoryId",
          "campaignId",
          "appliedPaymentHistoryId",
          "description",
          "createdAt"
        ]
      },
      "CreditHistoryViewResponse": {
        "type": "object",
        "properties": {
          "effectiveStartDate": {
            "type": "string",
            "description": "서버가 실제 적용한 조회 시작 시각 (KST, inclusive)"
          },
          "effectiveEndDate": {
            "type": "string",
            "description": "서버가 실제 적용한 조회 종료 시각 (KST, exclusive)"
          },
          "totalCount": {
            "type": "number"
          },
          "totalAmount": {
            "type": "number"
          },
          "summary": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditHistorySummaryBucketResponse"
            }
          },
          "details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditHistoryResponse"
            }
          },
          "hasMoreDetails": {
            "type": "boolean"
          }
        },
        "required": [
          "effectiveStartDate",
          "effectiveEndDate",
          "totalCount",
          "totalAmount",
          "summary",
          "details",
          "hasMoreDetails"
        ]
      },
      "KatcloudGroupUsageDetail": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "TRIAL / TRIAL_ENDED / ACTIVE / UNPAID / SUSPENDED / CANCELED"
          },
          "plan": {
            "type": "string",
            "description": "PERSONAL / BUSINESS (체험은 개인 플랜 포함량)"
          },
          "included": {
            "type": "object",
            "description": "포함량 — 발신·수신은 분, SMS 는 건"
          },
          "usage": {
            "type": "object",
            "description": "사용량 — 발신·수신 분(통화마다 1분 올림), SMS·LMS·MMS 건, 모델별 AI 분, 받아쓰기·요약 분. 기록에서 바로 센 값"
          },
          "usageCharged": {
            "type": "number",
            "description": "이번 기간에 뺀 사용료, 부가세 포함 (원). 체험은 0"
          }
        },
        "required": [
          "status",
          "plan",
          "included",
          "usage",
          "usageCharged"
        ]
      },
      "GroupUsageResponse": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "number",
            "description": "그룹 ID"
          },
          "plan": {
            "type": "string",
            "description": "플랜",
            "enum": [
              "ECHO",
              "BASIC",
              "BUSINESS",
              "PRO"
            ]
          },
          "startDate": {
            "format": "date-time",
            "type": "string",
            "description": "결제 기간 시작일"
          },
          "endDate": {
            "format": "date-time",
            "type": "string",
            "description": "결제 기간 종료일"
          },
          "initialCallSecond": {
            "type": "number",
            "description": "기본 제공 통화 시간 (초)"
          },
          "useCallSecond": {
            "type": "number",
            "description": "사용한 통화 시간 (초, 실제 통화 시간). 청구는 billedCallSecond 기준"
          },
          "remainingCallSecond": {
            "type": "number",
            "description": "남은 통화 시간 (초)"
          },
          "billedCallSecond": {
            "type": "number",
            "description": "청구 기준 사용 통화 (초). 통화마다 1분 단위 올림 (61초 통화 = 120). 기본 제공량 차감·초과 요금은 이 값으로 계산한다"
          },
          "initialCallMinute": {
            "type": "number",
            "description": "기본 제공 통화 (분)"
          },
          "useCallMinute": {
            "type": "number",
            "description": "청구 기준 사용 통화 (분, 1분 = 1도수) = billedCallSecond / 60"
          },
          "remainingCallMinute": {
            "type": "number",
            "description": "청구 기준 남은 통화 (분) = initialCallMinute − useCallMinute"
          },
          "initialMessageCount": {
            "type": "number",
            "description": "기본 제공 메시지 건수"
          },
          "useSmsCount": {
            "type": "number",
            "description": "사용한 SMS 건수"
          },
          "useLmsCount": {
            "type": "number",
            "description": "사용한 LMS 건수"
          },
          "useMmsCount": {
            "type": "number",
            "description": "사용한 MMS 건수"
          },
          "useTotalMessageCount": {
            "type": "number",
            "description": "사용한 총 메시지 건수"
          },
          "remainingMessageCount": {
            "type": "number",
            "description": "남은 메시지 건수"
          },
          "initialAiCallCount": {
            "type": "number",
            "description": "기본 제공 AI 통화 건수"
          },
          "useAiCallCount": {
            "type": "number",
            "description": "사용한 AI 통화 건수"
          },
          "remainingAiCallCount": {
            "type": "number",
            "description": "남은 AI 통화 건수"
          },
          "useIntlCallUnit": {
            "type": "number",
            "description": "국제 통화 도수 (통화마다 1분 올림). 기본 제공 통화 시간과 따로 센다"
          },
          "intlCallAmount": {
            "type": "number",
            "description": "국제 통화 요금 (원, 부가세 포함). 나라·유무선별 요율 × 도수의 합"
          },
          "katcloud": {
            "description": "KAT 그룹만. 위 공통 칸에는 통화 = 발신, 메시지 = SMS 로 넣고 AI 건수는 0 이다 (KAT 는 AI 를 분으로 센다)",
            "allOf": [
              {
                "$ref": "#/components/schemas/KatcloudGroupUsageDetail"
              }
            ]
          }
        },
        "required": [
          "groupId",
          "plan",
          "startDate",
          "endDate",
          "initialCallSecond",
          "useCallSecond",
          "remainingCallSecond",
          "billedCallSecond",
          "initialCallMinute",
          "useCallMinute",
          "remainingCallMinute",
          "initialMessageCount",
          "useSmsCount",
          "useLmsCount",
          "useMmsCount",
          "useTotalMessageCount",
          "remainingMessageCount",
          "initialAiCallCount",
          "useAiCallCount",
          "remainingAiCallCount"
        ]
      },
      "AvailablePhoneNumberResponse": {
        "type": "object",
        "properties": {
          "isAvailable": {
            "type": "boolean",
            "description": "발급 가능한 번호가 있는지 여부",
            "example": true
          },
          "phoneNumber": {
            "type": "string",
            "description": "샘플 전화번호",
            "example": "070-1234-5678"
          }
        },
        "required": [
          "isAvailable"
        ]
      },
      "WebhookConfigResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Webhook 설정 ID"
          },
          "eventType": {
            "type": "string",
            "description": "이벤트 타입",
            "enum": [
              "MESSAGE_RECEIVED",
              "SEND_RESULT",
              "CALL_RECEIVED",
              "CALL_COMPLETED",
              "INTAKE",
              "AI_OUTBOUND",
              "MEDIA_STREAM",
              "BUDGET",
              "WEB_CHAT_RECEIVED",
              "CALL_EVENT"
            ]
          },
          "url": {
            "type": "string",
            "description": "Webhook URL"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "생성 일시"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "수정 일시"
          }
        },
        "required": [
          "id",
          "eventType",
          "url",
          "createdAt",
          "updatedAt"
        ]
      },
      "CreateWebhookConfigRequest": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string",
            "description": "이벤트 타입",
            "enum": [
              "MESSAGE_RECEIVED",
              "SEND_RESULT",
              "CALL_RECEIVED",
              "CALL_COMPLETED",
              "INTAKE",
              "AI_OUTBOUND",
              "MEDIA_STREAM",
              "BUDGET",
              "WEB_CHAT_RECEIVED",
              "CALL_EVENT"
            ]
          },
          "url": {
            "type": "string",
            "description": "Webhook URL",
            "example": "https://example.com/webhook"
          }
        },
        "required": [
          "eventType",
          "url"
        ]
      },
      "WebhookSecretResponse": {
        "type": "object",
        "properties": {
          "secret": {
            "type": "string",
            "description": "웹훅 서명 비밀값. X-Webhook-Signature = v1=HMAC-SHA256(비밀값, \"X-Webhook-Timestamp.본문\")",
            "example": "whsec_3f1c…"
          }
        },
        "required": [
          "secret"
        ]
      },
      "UpdateWebhookConfigRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Webhook URL",
            "example": "https://example.com/webhook"
          }
        },
        "required": [
          "url"
        ]
      },
      "WebhookTestResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "성공 여부"
          },
          "statusCode": {
            "type": "number",
            "description": "HTTP 상태 코드"
          },
          "responseTime": {
            "type": "number",
            "description": "응답 시간 (ms)"
          },
          "error": {
            "type": "string",
            "description": "에러 메시지"
          }
        },
        "required": [
          "success",
          "responseTime"
        ]
      },
      "GroupWebhookResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Webhook 설정 ID"
          },
          "eventType": {
            "type": "string",
            "description": "이벤트 타입",
            "enum": [
              "MESSAGE_RECEIVED",
              "SEND_RESULT",
              "CALL_RECEIVED",
              "CALL_COMPLETED",
              "INTAKE",
              "AI_OUTBOUND",
              "MEDIA_STREAM",
              "BUDGET",
              "WEB_CHAT_RECEIVED",
              "CALL_EVENT"
            ]
          },
          "url": {
            "type": "string",
            "description": "Webhook URL"
          },
          "scope": {
            "type": "string",
            "description": "GROUP = 이 프로젝트 설정(프로젝트 비밀값으로 서명). ACCOUNT = 프로젝트 설정이 없어 계정 기본(/webhook)으로 보내는 중(계정 비밀값으로 서명). ACCOUNT 는 여기서 고치지 않는다 — 이 이벤트를 PUT 하면 이 프로젝트만 따로 보낸다",
            "enum": [
              "GROUP",
              "ACCOUNT"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "생성 일시"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "수정 일시"
          }
        },
        "required": [
          "id",
          "eventType",
          "url",
          "scope",
          "createdAt",
          "updatedAt"
        ]
      },
      "PutGroupWebhookRequest": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string",
            "description": "이벤트 타입",
            "enum": [
              "MESSAGE_RECEIVED",
              "SEND_RESULT",
              "CALL_RECEIVED",
              "CALL_COMPLETED",
              "INTAKE",
              "AI_OUTBOUND",
              "MEDIA_STREAM",
              "BUDGET",
              "WEB_CHAT_RECEIVED",
              "CALL_EVENT"
            ]
          },
          "url": {
            "type": "string",
            "description": "Webhook URL",
            "example": "https://example.com/webhook"
          }
        },
        "required": [
          "eventType",
          "url"
        ]
      },
      "GroupWebhookSecretResponse": {
        "type": "object",
        "properties": {
          "secret": {
            "type": "string",
            "description": "이 프로젝트의 서명 비밀값. 아직 없으면 null — 이 프로젝트 주소를 처음 저장(PUT)하면 생긴다. X-Webhook-Signature = v1=HMAC-SHA256(비밀값, \"X-Webhook-Timestamp.본문\")",
            "nullable": true
          }
        }
      },
      "TestGroupWebhookRequest": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string",
            "description": "시험 발송할 이벤트 타입",
            "enum": [
              "MESSAGE_RECEIVED",
              "SEND_RESULT",
              "CALL_RECEIVED",
              "CALL_COMPLETED",
              "INTAKE",
              "AI_OUTBOUND",
              "MEDIA_STREAM",
              "BUDGET",
              "WEB_CHAT_RECEIVED",
              "CALL_EVENT"
            ]
          }
        },
        "required": [
          "eventType"
        ]
      },
      "GroupWebhookTestResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "성공 여부"
          },
          "statusCode": {
            "type": "number",
            "description": "HTTP 상태 코드"
          },
          "responseTime": {
            "type": "number",
            "description": "응답 시간 (ms)"
          },
          "error": {
            "type": "string",
            "description": "에러 메시지"
          },
          "scope": {
            "type": "string",
            "description": "보낸 곳의 범위 — 서명 비밀값도 이 범위의 것",
            "enum": [
              "GROUP",
              "ACCOUNT"
            ]
          }
        },
        "required": [
          "success",
          "responseTime",
          "scope"
        ]
      }
    }
  }
}
