{"openapi":"3.0.3","info":{"title":"AI CAM WebServer API","version":"1.0.0","description":"AI CAM WebServer REST API specification.\n\n## 공통 규칙\n\n### 입력 검증\n- **safestring**: 대부분의 텍스트 필드는 `< > \" ' ; | \\`` 문자가 금지됩니다.\n- **password**: 최소 8자 이상이어야 합니다.\n- **userid**: `^[a-zA-Z0-9_-]{1,64}$` 패턴만 허용됩니다.\n\n### 인증\n- JWT Bearer 토큰 인증 (`Authorization: Bearer {access_token}`)\n- Admin 전용 API는 `administrator` role 필요\n\n### Rate Limiting\n- **Login**: 5회/분 (초과 시 5분 × 락아웃 횟수 차단)\n- **Sensitive API** (설정 변경, 계정 관리): 60회/분 (1분 차단)\n- **General API** (인증된 모든 API): 120회/분 (1분 차단)\n- 응답 헤더: `X-RateLimit-Remaining`\n\n### 보안 응답 헤더 (모든 응답)\n- `X-Content-Type-Options: nosniff`\n- `Referrer-Policy: no-referrer`\n- `X-Frame-Options: DENY`\n- `Content-Security-Policy: default-src 'self'; ...`\n- `Strict-Transport-Security: max-age=31536000`\n\n### 커스텀 에러 코드\n| Code | Reason | HTTP Status |\n|------|--------|-------------|\n| 40000 | INVALID_CREDENTIALS | 400 |\n| 40100 | TOKEN_EXPIRED | 401 |\n| 40101 | SESSION_REPLACED | 401 |\n| 40102 | TOKEN_INVALID | 401 |\n| 40103 | SESSION_KICKED | 401 |\n| 40300 | FORBIDDEN | 403 |\n| 42900 | RATE_LIMIT_EXCEEDED | 429 |\n| 42901 | ACCOUNT_LOCKED | 429 |\n| 50300 | SERVICE_UNAVAILABLE | 503 |\n\n### PATCH Content-Type 지원 (Users)\n- `application/merge-patch+json` — RFC 7386 Merge Patch (변경 필드만 전송)\n- `application/json-patch+json` — RFC 6902 JSON Patch (op/path/value 배열)\n\n### WebRTC\n- **WHEP 채널 이름 규칙**: `ch{N}_primary` (Main), `ch{N}_secondary` (Sub)\n- **DataChannel**: `ai-events-report` 채널로 AI 이벤트 실시간 전송 (multi-chunk 조립)\n- MediaMTX Reverse Proxy 헤더: `ETag`, `Link`, `Location`, `Accept-Patch` 전달\n"},"servers":[{"url":"http://localhost:8080/v1/api","description":"Local Dev"}],"tags":[{"name":"Common"},{"name":"Authentication"},{"name":"WebRTC"},{"name":"Live View"},{"name":"AI Events"},{"name":"Settings/Basic/Video Profile"},{"name":"Settings/Camera","description":"Camera image quality, white balance, WDR, and mounting type settings"},{"name":"Settings/Privacy & Overlay","description":"Privacy areas, face privacy, OSD overlay settings"},{"name":"Settings/Network"},{"name":"Settings/DateTime"},{"name":"Settings/AI & Event/AI Event"},{"name":"Settings/AI & Event/Rule Settings"},{"name":"People"},{"name":"People Counting","description":"People counting areas and reset operations"},{"name":"Face Authentication","description":"Area 설정은 AI Event 타입별 setting.*_areas[]에서 관리 (face_areas, entry_areas, intrusion_areas). 이 섹션은 실시간 인증 사용자 조회 전용.\n"},{"name":"System/Device"},{"name":"System/Audio","description":"Audio clip management and playback"},{"name":"System/Account"},{"name":"System/Logs"},{"name":"WebRTC Reverse Proxy","description":"MediaMTX Reverse Proxy API. 프론트엔드 reader.js에서 내부적으로 사용합니다.\n\n**채널 이름 규칙:**\n- `ch1_primary` — Channel 1 Main stream\n- `ch1_secondary` — Channel 1 Sub stream\n- `ch2_primary` — Channel 2 Main stream\n- `ch2_secondary` — Channel 2 Sub stream\n\n**WebRTC DataChannel:**\n- 채널 이름: `ai-events-report`\n- 용도: AI 이벤트 실시간 전송 (multi-chunk message 조립)\n\n**Forwarded Headers (MediaMTX ↔ Client):**\n- Request → MediaMTX: `Content-Type`, `Authorization`, `If-Match`\n- MediaMTX → Response: `Content-Type`, `ETag`, `ID`, `Accept-Patch`, `Link`, `Location`\n- `Location` 헤더는 `/v1/api/webrtc/rp/` prefix로 재작성됩니다\n"},{"name":"People (추가)","description":"OpenAPI 미정의였으나 구현된 추가 People 엔드포인트"},{"name":"Settings/Face","description":"Face consent 및 face settings 관리"},{"name":"System/Device (추가)","description":"OpenAPI 미정의였으나 구현된 추가 Device 엔드포인트"},{"name":"Integration/CLUe","description":"CLUe 클라우드 연동 설정"}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ApiResponse":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","example":200},"message":{"type":"string","example":"OK"},"data":{"nullable":true}}},"ErrorResponse":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"}],"description":"Standard error envelope (same shape as ApiResponse)"},"EmptyObject":{"type":"object","additionalProperties":false},"VersionInfo":{"type":"object","description":"Device and version information (public)","properties":{"model":{"type":"string","description":"Device model name","example":"AICAM-ABCD"},"device_sn":{"type":"string","description":"Device serial number","example":"12345678"},"hw_version":{"type":"string","description":"Hardware version","example":"1.0.1 2025/08/21 10:00:01"},"kernel_version":{"type":"string","description":"Kernel version","example":"1.0.1 2025/08/21 10:00:01"},"firmware_version":{"type":"string","description":"Firmware version","example":"1.0.1 2025/08/21 10:00:01"},"webserver_be_version":{"type":"string","description":"BE version and build date (major.minor.patch YYYY-MM-DDThh:mm:ssZ)","example":"1.0.0 2026-02-20T10:00:00Z"},"webserver_fe_version":{"type":"string","description":"FE version and build date (parsed from index.html meta tags, empty if unavailable)","example":"0.1.0 2026-02-20T00:00:00Z"}}},"Capabilities":{"type":"object","description":"Device capabilities payload","properties":{"channel":{"type":"object","properties":{"max_channel_count":{"type":"integer","example":2},"view_types":{"type":"array","items":{"type":"string"},"example":["Fisheye","Single","Double","Quad"]},"resolutions":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"example":{"Fisheye":["3520x3520","1280x1280","880x880"],"Single":["4096x1024","2048x640"],"Double":["2048x2048","1024x1024"],"Quad":["2048x2048","1024x1024"]}},"codecs":{"type":"array","items":{"type":"string"},"example":["H.264"]},"frame_rates":{"type":"array","items":{"type":"integer"},"example":[30,25,20,15,10]},"bitrate_controls":{"type":"array","items":{"type":"string"},"example":["VBR","CBR"]},"bitrate_kbps":{"type":"object","description":"비트레이트 범위 (kbps)","properties":{"min":{"type":"integer","example":100},"max":{"type":"integer","example":46080},"step":{"type":"integer","example":512}}},"supported_gop_lengths":{"type":"array","items":{"type":"integer"},"example":[5,10,15,20,25,30,35,40,45,50,55,60]},"channels":{"type":"array","description":"채널별 정보 (뷰 타입, WebRTC 스트림명)","items":{"type":"object","properties":{"channel_id":{"type":"integer"},"view_types":{"type":"array","items":{"type":"string"}},"main":{"type":"object","properties":{"stream_name":{"type":"string"}}},"sub":{"type":"object","properties":{"stream_name":{"type":"string"}}}}},"example":[{"channel_id":1,"view_types":["Fisheye"],"main":{"stream_name":"ch1_primary"},"sub":{"stream_name":"ch1_secondary"}},{"channel_id":2,"view_types":["Single","Double","Quad"],"main":{"stream_name":"ch2_primary"},"sub":{"stream_name":"ch2_secondary"}}]}}},"time_zones":{"type":"array","description":"Supported IANA time zones","items":{"type":"string"},"example":["Pacific/Midway","Pacific/Honolulu","America/Anchorage","America/Los_Angeles","America/Denver","America/Chicago","America/New_York","America/Sao_Paulo","Europe/London","Europe/Paris","Europe/Berlin","Europe/Moscow","Asia/Dubai","Asia/Kolkata","Asia/Bangkok","Asia/Shanghai","Asia/Seoul","Asia/Tokyo","Australia/Sydney","Pacific/Auckland"]},"ai_event":{"type":"object","properties":{"ai_event_types":{"type":"array","items":{"type":"string"},"example":["FaceMovementTracking","Intrusion","LineCrossing","PeopleCounting"]},"face_movement_tracking":{"type":"object","properties":{"min_face_size":{"type":"object","additionalProperties":{"type":"object","properties":{"width":{"type":"integer","example":50},"height":{"type":"integer","example":50}}}}}}}},"camera":{"type":"object","description":"Camera settings capabilities","properties":{"range":{"type":"object","description":"각 설정값의 허용 범위","properties":{"saturation":{"type":"object","properties":{"min":{"type":"integer","example":0},"max":{"type":"integer","example":100}}},"sharpness":{"type":"object","properties":{"min":{"type":"integer","example":0},"max":{"type":"integer","example":100}}},"brightness":{"type":"object","properties":{"min":{"type":"integer","example":0},"max":{"type":"integer","example":100}}},"contrast":{"type":"object","properties":{"min":{"type":"integer","example":0},"max":{"type":"integer","example":100}}},"white_balance_red":{"type":"object","properties":{"min":{"type":"integer","example":0},"max":{"type":"integer","example":100}}},"white_balance_blue":{"type":"object","properties":{"min":{"type":"integer","example":0},"max":{"type":"integer","example":100}}},"time_filter":{"type":"object","properties":{"min":{"type":"integer","example":0},"max":{"type":"integer","example":100}}}}}}},"face_settings":{"type":"object","description":"Face recognition settings capabilities","properties":{"auth_timeout_seconds":{"type":"object","properties":{"min":{"type":"integer","example":1},"max":{"type":"integer","example":10},"step":{"type":"integer","example":1}}},"security_levels":{"type":"array","items":{"type":"string"},"example":["Normal","Secure","Most Secure"]},"fake_detection_levels":{"type":"array","items":{"type":"string"},"example":["Off","On (Beta)"]}}},"privacy_overlay":{"type":"object","description":"Privacy & Overlay capabilities (flat structure)","properties":{"max_privacy_areas":{"type":"integer","example":10},"privacy_modes":{"type":"array","items":{"type":"string"},"example":["Face Only","Full Body"]},"date_formats":{"type":"array","items":{"type":"string"},"example":["YYYY-MM-DD","MM-DD-YYYY","DD-MM-YYYY"]},"time_formats":{"type":"array","items":{"type":"string"},"example":["HH:mm:SS","HH:mm"]},"overlay_colors":{"type":"array","items":{"type":"string"},"example":["white","black","red","green","blue","yellow"]},"overlay_font_sizes":{"type":"array","items":{"type":"integer"},"example":[16,20,24,28,32]}}}}},"ColorEntry":{"type":"object","description":"Color entry","required":["index","name"],"properties":{"index":{"type":"integer","description":"Color index (0-15)","example":0},"name":{"type":"string","description":"Color name","example":"Aqua"}}},"AdminStatus":{"type":"object","required":["admin_password_exists"],"properties":{"admin_password_exists":{"type":"boolean","example":true}}},"SuccessResult":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","example":true}}},"LoginRequest":{"type":"object","required":["id","password"],"properties":{"id":{"type":"string","description":"로그인 ID (패턴: ^[a-zA-Z0-9_-]{1,64}$)","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]{1,64}$"},"password":{"type":"string","minLength":1}}},"LoginResponseData":{"type":"object","properties":{"account_id":{"type":"integer","example":1},"name":{"type":"string","example":""},"role":{"type":"string","description":"User role (administrator, operator, user)","example":"administrator"},"permissions":{"type":"object","description":"CRUD permissions per scope. 'default' is the base; resource-specific overrides may exist.","additionalProperties":{"type":"object","properties":{"view":{"type":"boolean"},"edit":{"type":"boolean"},"create":{"type":"boolean"},"delete":{"type":"boolean"}}},"example":{"default":{"view":true,"edit":true,"create":true,"delete":true}}},"access_token":{"type":"string"},"refresh_token":{"type":"string"},"access_token_expiry":{"type":"string","format":"date-time","example":"2025-09-16T01:01:01.000Z"},"refresh_token_expiry":{"type":"string","format":"date-time","example":"2025-09-23T01:01:01.000Z"}}},"AccessTokenResponseData":{"type":"object","properties":{"access_token":{"type":"string"},"access_token_expiry":{"type":"string","format":"date-time","example":"2025-09-16T01:01:01.000Z"}}},"RefreshTokenResponseData":{"type":"object","properties":{"access_token":{"type":"string"},"refresh_token":{"type":"string"},"access_token_expiry":{"type":"string","format":"date-time","example":"2025-09-16T01:01:01.000Z"},"refresh_token_expiry":{"type":"string","format":"date-time","example":"2025-09-23T01:01:01.000Z"}}},"AuthErrorResponse":{"type":"object","description":"인증 오류 응답. code 값에 따라 reason 결정:\n- 40100: TOKEN_EXPIRED — 토큰 만료\n- 40101: SESSION_REPLACED — 다른 기기에서 로그인하여 세션 교체\n- 40102: TOKEN_INVALID — 유효하지 않은 토큰\n- 40103: SESSION_KICKED — 관리자에 의해 세션 종료\n- 40300: FORBIDDEN — 권한 부족\n","properties":{"code":{"type":"integer","description":"40100=TOKEN_EXPIRED, 40101=SESSION_REPLACED, 40102=TOKEN_INVALID, 40103=SESSION_KICKED, 40300=FORBIDDEN","example":40101},"message":{"type":"string","example":"token invalidated by another login"},"data":{"type":"object","properties":{"reason":{"type":"string","enum":["TOKEN_EXPIRED","SESSION_REPLACED","TOKEN_INVALID","SESSION_KICKED","FORBIDDEN"],"example":"SESSION_REPLACED"}}}}},"RateLimitResponse":{"type":"object","description":"Rate Limit 초과 응답 (HTTP 429).\n응답 헤더 `X-RateLimit-Remaining`에 남은 요청 수가 포함됩니다.\n- Sensitive API: 60회/분, 1분 차단\n- General API: 120회/분, 1분 차단\n","properties":{"code":{"type":"integer","description":"42900=RATE_LIMIT_EXCEEDED","example":42900},"message":{"type":"string","example":"rate limit exceeded"},"data":{"type":"object","properties":{"reason":{"type":"string","enum":["RATE_LIMIT_EXCEEDED"],"example":"RATE_LIMIT_EXCEEDED"}}}}},"ServiceUnavailableResponse":{"type":"object","description":"서비스 불가 응답 (HTTP 503). VideoCore 등 내부 서비스 응답 실패 시.","properties":{"code":{"type":"integer","description":"50300=SERVICE_UNAVAILABLE","example":50300},"message":{"type":"string","example":"service unavailable"},"data":{"type":"object","properties":{"reason":{"type":"string","enum":["SERVICE_UNAVAILABLE"],"example":"SERVICE_UNAVAILABLE"}}}}},"LoginFailureResponse":{"type":"object","description":"Login failure response (before lockout)","properties":{"code":{"type":"integer","description":"40000=INVALID_CREDENTIALS","example":40000},"message":{"type":"string","example":"invalid credentials"},"data":{"type":"object","properties":{"remaining_attempts":{"type":"integer","description":"Remaining login attempts before lockout","example":3}}}}},"AccountLockedResponse":{"type":"object","description":"Account locked due to too many failed login attempts","properties":{"code":{"type":"integer","description":"42901=ACCOUNT_LOCKED","example":42901},"message":{"type":"string","example":"account temporarily locked due to too many failed login attempts"},"data":{"type":"object","properties":{"reason":{"type":"string","enum":["ACCOUNT_LOCKED"],"example":"ACCOUNT_LOCKED"},"remaining_seconds":{"type":"integer","description":"Seconds until lockout expires","example":300},"remaining_minutes":{"type":"integer","description":"Minutes until lockout expires (rounded up)","example":5},"lockout_count":{"type":"integer","description":"Number of times account has been locked out","example":1}}}}},"WebRTCOfferRequest":{"type":"object","required":["offer_base64","channel_id"],"properties":{"offer_base64":{"type":"string"},"channel_id":{"type":"integer","example":1}}},"WebRTCOfferResponseData":{"type":"object","description":"Contains connection_id, channel info, and answer_base64.","properties":{"connection_id":{"type":"integer","format":"int64","example":1760931648862},"channel":{"$ref":"#/components/schemas/Channel"},"answer_base64":{"type":"string"},"ai_event_reporting":{"type":"boolean","example":false}}},"WebRTCConnectionPatchRequest":{"type":"object","description":"Patch either channel_id or ai_event_reporting.","additionalProperties":false,"properties":{"channel_id":{"type":"integer","example":2},"ai_event_reporting":{"type":"boolean","example":true}}},"ChannelSimple":{"type":"object","required":["channel_id","view_type","video_profiles"],"properties":{"channel_id":{"type":"integer","example":1},"view_type":{"type":"string","example":"Fisheye"},"video_profiles":{"type":"object","properties":{"main":{"type":"object","properties":{"stream_name":{"type":"string","example":"ch1_primary","description":"WebRTC WHEP 스트림명 (읽기 전용)","readOnly":true},"resolution":{"type":"string","example":"2560x1920"}}},"sub":{"type":"object","properties":{"stream_name":{"type":"string","example":"ch1_secondary","description":"WebRTC WHEP 스트림명 (읽기 전용)","readOnly":true},"resolution":{"type":"string","example":"640x480"}}}}}}},"StreamProfile":{"type":"object","description":"Individual stream encoding profile (main or sub)","properties":{"stream_name":{"type":"string","description":"WebRTC WHEP 스트림명 (읽기 전용, 응답에만 포함)","readOnly":true,"example":"ch1_primary"},"codec":{"type":"string","description":"코덱 (capabilities에서 허용 값 확인)","example":"H.264"},"resolution":{"type":"string","description":"해상도 (capabilities에서 view_type별 허용 값 확인)","example":"3520x3520"},"frame_rate":{"type":"integer","description":"프레임 레이트 (capabilities에서 허용 값 확인)","minimum":1,"maximum":60,"example":30},"bitrate":{"type":"integer","description":"비트레이트 Kbps (capabilities에서 min/max 확인)","minimum":100,"maximum":50000,"example":2048},"bitrate_control":{"type":"string","description":"비트레이트 제어 (capabilities에서 허용 값 확인)","example":"VBR"},"gov_length":{"type":"integer","description":"GOP Length (capabilities에서 허용 값 확인)","minimum":1,"maximum":300,"example":30}}},"VideoProfiles":{"type":"object","description":"Main and Sub stream profiles","properties":{"main":{"$ref":"#/components/schemas/StreamProfile"},"sub":{"$ref":"#/components/schemas/StreamProfile"}}},"Channel":{"type":"object","required":["channel_id","view_type","video_profiles"],"properties":{"channel_id":{"type":"integer","example":1},"view_type":{"type":"string","description":"Fisheye, Single, Double, Quad","example":"Fisheye"},"video_profiles":{"$ref":"#/components/schemas/VideoProfiles"},"flip":{"type":"boolean","example":false},"mirror":{"type":"boolean","example":false}}},"ChannelUpdateRequest":{"type":"object","description":"채널 전체 수정 (PUT)","properties":{"view_type":{"type":"string","maxLength":64,"description":"뷰 모드","example":"Fisheye"},"video_profiles":{"$ref":"#/components/schemas/VideoProfiles"},"flip":{"type":"boolean","example":false},"mirror":{"type":"boolean","example":false}}},"ChannelPatchRequest":{"type":"object","description":"채널 부분 수정 (PATCH) - 변경 필드만 전송","properties":{"view_type":{"type":"string","maxLength":64},"video_profiles":{"$ref":"#/components/schemas/VideoProfiles"},"flip":{"type":"boolean"},"mirror":{"type":"boolean"}}},"NetworkConfig":{"type":"object","description":"Network configuration payload","properties":{"mac":{"type":"string","description":"MAC 주소 (읽기 전용)","readOnly":true,"example":"E3:12:CC:EE:DD"},"ipv4":{"$ref":"#/components/schemas/NetworkIPv4Config"},"ipv6":{"$ref":"#/components/schemas/NetworkIPv6Config"},"ports":{"$ref":"#/components/schemas/NetworkPortsConfig"},"ai_event":{"$ref":"#/components/schemas/NetworkMeta"}}},"NetworkIPv4Config":{"type":"object","description":"IPv4 configuration","properties":{"enabled":{"type":"boolean","description":"IPv4 활성화 여부","example":true},"dhcp":{"type":"boolean","description":"DHCP 사용 여부","example":true},"ip_address":{"type":"string","format":"ipv4","description":"IP 주소","example":"192.168.1.14"},"subnet_mask":{"type":"string","format":"ipv4","description":"서브넷 마스크","example":"255.255.255.0"},"gateway":{"type":"string","format":"ipv4","description":"게이트웨이 주소","example":"192.168.1.1"},"dns":{"type":"array","description":"DNS 서버 주소 목록 (최대 2개)","maxItems":2,"items":{"type":"string","format":"ipv4"},"example":["8.8.8.8","8.8.4.4"]},"mtu":{"type":"integer","description":"MTU 크기","minimum":1280,"maximum":1500,"example":1500}}},"NetworkIPv6Config":{"type":"object","description":"IPv6 configuration","properties":{"supported":{"type":"boolean","description":"IPv6 지원 여부","example":false},"enabled":{"type":"boolean","description":"IPv6 활성화 여부","example":false}}},"NetworkPortsConfig":{"type":"object","description":"Port configuration (표준 포트 또는 1024-65535, 포트 간 중복 불가)","properties":{"http":{"type":"integer","description":"HTTP 포트 (80 또는 1024-65535). 다른 포트와 중복 불가.","minimum":80,"maximum":65535,"example":80},"https":{"type":"integer","description":"HTTPS 포트 (443 또는 1024-65535). 다른 포트와 중복 불가.","minimum":443,"maximum":65535,"example":443},"rtsp":{"type":"integer","description":"RTSP 포트 (554 또는 1024-65535). 다른 포트와 중복 불가.","minimum":554,"maximum":65535,"example":554}}},"NetworkMeta":{"type":"object","description":"Response-only metadata for network changes","properties":{"network_restart_required":{"type":"boolean","description":"네트워크 재시작 필요 여부","example":true},"reboot_required":{"type":"boolean","description":"시스템 재부팅 필요 여부","example":false},"effective_after_ms":{"type":"integer","description":"설정 적용까지 소요 시간 (ms)","example":3000},"reconnect_hint":{"$ref":"#/components/schemas/NetworkReconnectHint"}}},"NetworkReconnectHint":{"type":"object","description":"IP 변경 시 재연결 힌트","properties":{"https_url":{"type":"string","description":"새 HTTPS 접속 URL","example":"https://192.168.1.14:443"}}},"PatchNetworkRequest":{"type":"object","description":"네트워크 설정 변경 요청 (Partial Update - 모든 필드 optional)","properties":{"ipv4":{"type":"object","description":"IPv4 설정 (변경할 필드만 포함)","properties":{"enabled":{"type":"boolean","description":"IPv4 활성화 여부","example":true},"dhcp":{"type":"boolean","description":"DHCP 사용 여부","example":false},"ip_address":{"type":"string","description":"IP 주소","example":"192.168.1.100"},"subnet_mask":{"type":"string","description":"서브넷 마스크","example":"255.255.255.0"},"gateway":{"type":"string","description":"게이트웨이 주소","example":"192.168.1.1"},"dns":{"type":"array","description":"DNS 서버 주소 목록 (최대 2개)","maxItems":2,"items":{"type":"string"},"example":["8.8.8.8","8.8.4.4"]},"mtu":{"type":"integer","description":"MTU 크기","minimum":1280,"maximum":1500,"example":1500}}},"ipv6":{"type":"object","description":"IPv6 설정 (변경할 필드만 포함)","properties":{"enabled":{"type":"boolean","description":"IPv6 활성화 여부","example":false}}},"ports":{"type":"object","description":"포트 설정 (변경할 필드만 포함, 표준 포트 또는 1024-65535, 포트 간 중복 불가)","properties":{"http":{"type":"integer","description":"HTTP 포트 (80 또는 1024-65535)","example":8080},"https":{"type":"integer","description":"HTTPS 포트 (443 또는 1024-65535)","example":443},"rtsp":{"type":"integer","description":"RTSP 포트 (554 또는 1024-65535)","example":554}}}},"example":{"ipv4":{"dhcp":false,"ip_address":"192.168.1.100","subnet_mask":"255.255.255.0","gateway":"192.168.1.1"}}},"WhiteBalance":{"type":"object","description":"White balance settings","properties":{"auto":{"type":"boolean","description":"White balance auto mode (true: auto, false: manual)","example":false},"red":{"type":"integer","description":"Red channel white balance","minimum":1,"maximum":100,"example":50},"blue":{"type":"integer","description":"Blue channel white balance","minimum":1,"maximum":100,"example":50}}},"CameraSettings":{"type":"object","description":"Camera image settings","properties":{"saturation":{"type":"integer","description":"Color saturation","minimum":1,"maximum":100,"example":26},"sharpness":{"type":"integer","description":"Image edge sharpness","minimum":1,"maximum":100,"example":55},"brightness":{"type":"integer","description":"Overall image brightness","minimum":1,"maximum":100,"example":50},"contrast":{"type":"integer","description":"Brightness/darkness difference","minimum":1,"maximum":100,"example":50},"white_balance":{"$ref":"#/components/schemas/WhiteBalance"},"time_filter":{"type":"integer","description":"Temporal noise filtering strength","minimum":1,"maximum":100,"example":55},"wdr":{"type":"boolean","description":"Wide Dynamic Range ON/OFF","example":false},"ceiling_mounting":{"type":"boolean","description":"Installation type (true: ceiling, false: wall)","example":true}}},"PatchCameraSettingsRequest":{"type":"object","description":"Camera settings partial update (all fields optional)","properties":{"saturation":{"type":"integer","minimum":0,"maximum":100},"sharpness":{"type":"integer","minimum":0,"maximum":100},"brightness":{"type":"integer","minimum":0,"maximum":100},"contrast":{"type":"integer","minimum":0,"maximum":100},"white_balance":{"type":"object","properties":{"auto":{"type":"boolean"},"red":{"type":"integer","minimum":0,"maximum":100},"blue":{"type":"integer","minimum":0,"maximum":100}}},"time_filter":{"type":"integer","minimum":0,"maximum":100},"wdr":{"type":"boolean"},"ceiling_mounting":{"type":"boolean"}}},"CoordinateResolution":{"type":"object","description":"Coordinate resolution","properties":{"width":{"type":"integer","example":1920},"height":{"type":"integer","example":1080}}},"OverlayPosition":{"type":"object","properties":{"coordinate_system":{"type":"string","description":"Coordinate system name","example":"Fisheye"},"coordinate_resolution":{"$ref":"#/components/schemas/CoordinateResolution"},"x":{"type":"integer","minimum":0,"example":10},"y":{"type":"integer","minimum":0,"example":10},"width":{"type":"integer","minimum":0,"description":"Overlay area width (px)","example":200},"height":{"type":"integer","minimum":0,"description":"Overlay area height (px)","example":30}}},"PrivacyArea":{"type":"object","description":"직사각형 프라이버시 영역 (x, y, width, height)","required":["privacy_area_id","name","order","color","coordinate_system","coordinate_resolution","position"],"properties":{"privacy_area_id":{"type":"integer","minimum":1,"maximum":10,"example":1},"name":{"type":"string","maxLength":64,"example":"Area 1"},"order":{"type":"integer","minimum":1,"maximum":10,"example":1},"color":{"type":"string","maxLength":32,"example":"black"},"coordinate_system":{"type":"string","description":"Coordinate system name","example":"Fisheye"},"coordinate_resolution":{"$ref":"#/components/schemas/CoordinateResolution"},"position":{"type":"object","description":"직사각형 위치 및 크기","required":["x","y","width","height"],"properties":{"x":{"type":"integer","minimum":0,"example":100},"y":{"type":"integer","minimum":0,"example":100},"width":{"type":"integer","minimum":1,"example":200},"height":{"type":"integer","minimum":1,"example":150}}}}},"FacePrivacy":{"type":"object","properties":{"enabled":{"type":"boolean","example":false},"mode":{"type":"string","enum":["face_only","full_body"],"example":"face_only"}}},"OverlayDateTime":{"type":"object","properties":{"date_enabled":{"type":"boolean","example":true},"time_enabled":{"type":"boolean","example":true},"date_format":{"type":"string","enum":["YYYY-MM-DD","MM-DD-YYYY","DD-MM-YYYY"],"example":"YYYY-MM-DD"},"time_format":{"type":"string","enum":["HH:mm:SS","HH:mm"],"example":"HH:mm:SS"},"font_size":{"type":"integer","minimum":1,"example":24},"color":{"type":"string","maxLength":32,"example":"white"},"position":{"$ref":"#/components/schemas/OverlayPosition"}}},"OverlayCameraName":{"type":"object","properties":{"enabled":{"type":"boolean","example":true},"name":{"type":"string","maxLength":255,"example":"CAM-01"},"font_size":{"type":"integer","minimum":1,"example":24},"color":{"type":"string","maxLength":32,"example":"white"},"position":{"$ref":"#/components/schemas/OverlayPosition"}}},"Overlay":{"type":"object","properties":{"enabled":{"type":"boolean","example":true},"date_time":{"$ref":"#/components/schemas/OverlayDateTime"},"camera_name":{"$ref":"#/components/schemas/OverlayCameraName"}}},"PrivacyOverlaySettings":{"type":"object","description":"Privacy & Overlay settings","properties":{"privacy_areas":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/PrivacyArea"}},"face_privacy":{"$ref":"#/components/schemas/FacePrivacy"},"overlay":{"$ref":"#/components/schemas/Overlay"}}},"ClueConfig":{"type":"object","description":"CLUe cloud connection configuration","properties":{"enabled":{"type":"boolean","description":"CLUe 활성화 여부","example":false},"status":{"type":"string","description":"CLUe 연결 상태 (읽기 전용)","readOnly":true,"enum":[false,"connecting","can_connect","no_certificate","connection_failed"],"example":false}}},"PatchClueRequest":{"type":"object","properties":{"enabled":{"type":"boolean","description":"CLUe 활성화 여부","example":true}}},"FaceEnrollmentConsentResponse":{"type":"object","properties":{"consented":{"type":"boolean","example":false},"consented_at":{"type":"string","format":"date-time","nullable":true,"description":"동의 시각 (ISO 8601). 미동의 시 null","example":null},"consented_by":{"type":"string","nullable":true,"description":"동의한 관리자 ID. 미동의 시 null","example":null}}},"FaceEnrollmentConsentRequest":{"type":"object","required":["consented"],"properties":{"consented":{"type":"boolean","description":"true=동의, false=철회","example":true}}},"FaceAnalyticsConsentResponse":{"type":"object","properties":{"consented":{"type":"boolean","example":false},"consented_at":{"type":"string","format":"date-time","nullable":true,"description":"동의 시각 (ISO 8601). 미동의 시 null","example":null},"consented_by":{"type":"string","nullable":true,"description":"동의한 관리자 ID. 미동의 시 null","example":null}}},"FaceAnalyticsConsentRequest":{"type":"object","required":["consented"],"properties":{"consented":{"type":"boolean","description":"true=동의, false=철회","example":true}}},"FaceSettingsInfo":{"type":"object","properties":{"operation":{"type":"object","properties":{"auth_timeout_seconds":{"type":"integer","description":"얼굴 인증 타임아웃 (초)","minimum":1,"maximum":10,"example":10},"enroll_duplication_check":{"type":"boolean","description":"얼굴 등록 중복 체크 여부","example":true}}},"recognition":{"type":"object","properties":{"security_level":{"type":"string","description":"보안 수준 (capabilities에서 허용 값 확인)","example":"Normal"},"fake_detection_level":{"type":"string","description":"위조 탐지 수준 (capabilities에서 허용 값 확인)","example":"Off"}}}}},"PutFaceSettingsRequest":{"type":"object","description":"Face Settings 수정 (변경할 필드만 전송)","properties":{"operation":{"type":"object","properties":{"auth_timeout_seconds":{"type":"integer","minimum":1,"maximum":10},"enroll_duplication_check":{"type":"boolean"}}},"recognition":{"type":"object","properties":{"security_level":{"type":"string"},"fake_detection_level":{"type":"string"}}}}},"AIEventSimple":{"type":"object","description":"AI Event 간단 응답 (목록용)","properties":{"ai_event_id":{"type":"integer","format":"int64"},"ai_event_type":{"type":"string","enum":["FaceMovementTracking","Intrusion","LineCrossing","PeopleCounting"]},"name":{"type":"string"}}},"RuleSimple":{"type":"object","description":"Rule 간단 응답 (목록용)","properties":{"rule_id":{"type":"integer","format":"int64"},"enable":{"type":"boolean"},"name":{"type":"string"},"type":{"type":"string","description":"AI Event 타입"},"event":{"type":"string","description":"관련 area/line 이름 (쉼표 구분)"},"schedule":{"type":"string","description":"Always, Never, 또는 Scheduled","enum":["Always","Never","Scheduled"]}}},"CountingAreaStatus":{"type":"object","properties":{"counting_area_id":{"type":"integer","format":"int64","example":1},"name":{"type":"string","example":"Lobby"},"current_count":{"type":"integer","example":5}}},"CountingAreasResponse":{"type":"object","properties":{"counting_areas":{"type":"array","items":{"$ref":"#/components/schemas/CountingAreaStatus"}}}},"FaceAuthenticatedUser":{"type":"object","properties":{"user_id":{"type":"string","description":"External user ID","example":"EXT001"},"internal_user_id":{"type":"integer","format":"int64","description":"Internal user ID (from VideoCore)","example":3},"timestamp":{"type":"string","description":"Authentication timestamp (ISO 8601)","example":"2026-03-03T10:00:00Z"}}},"FaceAuthenticationArea":{"type":"object","description":"area-of-interest와 동일 패턴: area_id + area_id_type으로 원본 설정 영역 식별","properties":{"area_id":{"type":"integer","format":"int64","description":"Area ID","example":1},"area_id_type":{"type":"string","description":"원본 설정의 ID 필드명","enum":["face_area_id","entry_area_id","intrusion_area_id"],"example":"face_area_id"},"name":{"type":"string","description":"Area name (from AI Event setting)","example":"Region 1"},"users":{"type":"array","items":{"$ref":"#/components/schemas/FaceAuthenticatedUser"}}}},"FaceAuthenticationResponse":{"type":"object","properties":{"areas":{"type":"array","items":{"$ref":"#/components/schemas/FaceAuthenticationArea"}}}},"NtpSettings":{"type":"object","description":"NTP synchronization settings","properties":{"use":{"type":"boolean","description":"NTP synchronization enabled (true=NTP mode, false=Manual mode)","example":true},"ntp_servers":{"type":"array","description":"NTP server addresses (max 4). ntp_servers[0] required when use=true.","maxItems":4,"items":{"type":"string","maxLength":255},"example":["kr.pool.ntp.org","asia.pool.ntp.org"]},"editable":{"type":"boolean","description":"Settings editable flag (read-only, false when CLUe mode is active)","readOnly":true,"example":true}}},"DateTimeInfo":{"type":"object","required":["current_datetime","timezone"],"properties":{"current_datetime":{"type":"string","format":"date-time","description":"RFC3339 format with timezone offset required (e.g., 2025-08-12T12:48:41+09:00)","example":"2025-08-12T12:48:41+09:00"},"timezone":{"type":"string","description":"IANA timezone identifier (e.g., Asia/Seoul, America/New_York, Europe/London)","example":"Asia/Seoul"},"daylight_savings":{"type":"boolean","description":"Daylight saving time (DST) enabled","example":false},"ntp":{"$ref":"#/components/schemas/NtpSettings"}}},"PatchDateTimeRequest":{"type":"object","properties":{"current_datetime":{"type":"string","format":"date-time","description":"RFC3339 format with timezone offset required. Returns 400 error when ntp.use=true.","example":"2025-08-12T12:48:41+09:00"},"timezone":{"type":"string","description":"IANA timezone identifier (e.g., Asia/Seoul, America/New_York, Europe/London)","example":"Asia/Seoul"},"daylight_savings":{"type":"boolean","description":"Daylight saving time (DST) enabled","example":false},"ntp":{"type":"object","description":"NTP settings to update","properties":{"use":{"type":"boolean","description":"NTP synchronization enabled"},"ntp_servers":{"type":"array","description":"NTP server addresses (max 4). ntp_servers[0] required when use=true.","maxItems":4,"items":{"type":"string","maxLength":255}}}}}},"AIEventsLog":{"type":"object","description":"One AI events log record","properties":{"ai_events_log_id":{"type":"integer","example":1},"timestamp":{"type":"string","format":"date-time","example":"2024-01-15T10:30:45.123Z"},"event_type":{"type":"integer","description":"4097=FaceDetection, 4098=FaceAuthentication, 4099=PersonDetection, 4100=EntryAreaEnter, 4101=EntryAreaExit","example":4098},"event_type_name":{"type":"string","example":"FaceAuthentication"},"camera_id":{"type":"integer","example":1},"frame_id":{"type":"integer","example":12345},"event_face_authentication":{"type":"object","nullable":true,"properties":{"result":{"type":"string","enum":["AUTHENTICATED","UNKNOWN_FACE"],"example":"AUTHENTICATED"},"image_base64":{"type":"string"},"face_id":{"type":"integer","example":1},"internal_user_id":{"type":"integer","example":1},"user_id":{"type":"string","example":"1"},"user_name":{"type":"string","example":"John Doe"},"profile_image_base64":{"type":"string"}}},"event_face_detection":{"type":"object","nullable":true},"event_person_detection":{"type":"object","nullable":true},"event_person_entered_area":{"type":"object","nullable":true,"properties":{"area_id":{"type":"integer","example":1},"face_id":{"type":"integer","example":1},"user_id":{"type":"string","example":"1"},"user_name":{"type":"string","example":"John Doe"},"profile_image_base64":{"type":"string"}}},"event_person_exited_area":{"type":"object","nullable":true,"properties":{"area_id":{"type":"integer","example":1},"face_id":{"type":"integer","example":1},"user_id":{"type":"string","example":"1"},"user_name":{"type":"string","example":"John Doe"},"profile_image_base64":{"type":"string"}}}}},"CursorListResponse":{"type":"object","required":["limit","next_cursor","has_next"],"properties":{"limit":{"type":"integer","example":10},"next_cursor":{"type":"string","nullable":true},"has_next":{"type":"boolean","example":true}}},"AIEventsLogsList":{"allOf":[{"$ref":"#/components/schemas/CursorListResponse"},{"type":"object","properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/AIEventsLog"}}}}]},"AreaOfInterestResponse":{"type":"object","description":"Areas of interest payload","properties":{"areas":{"type":"array","items":{"type":"object","properties":{"area_id":{"type":"integer","example":1},"area_id_type":{"type":"string","example":"face_area_id","description":"영역 ID 타입 (face_area_id, entry_area_id, intrusion_area_id, crossing_line_id, counting_area_id)"},"name":{"type":"string","example":"Region 1"},"coordinate_system":{"type":"string","example":"Fisheye"},"coordinate_resolution":{"type":"string","example":"1920x1080"},"properties":{"type":"object","description":"타입별 추가 속성 (crossing_line_id: direction 등). 해당 속성이 없는 타입은 생략됨.","additionalProperties":true,"example":{"direction":"A->B"}},"points":{"type":"array","items":{"type":"object","properties":{"x":{"type":"integer","example":100},"y":{"type":"integer","example":100}}}},"ai_event":{"type":"object","properties":{"ai_event_id":{"type":"integer","example":1},"ai_event_type":{"type":"string","example":"FaceMovementTracking"}}}}}}}},"AICountResponse":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","example":3}}},"Point":{"type":"object","description":"좌표 값은 number(실수)로 전송할 수 있으며, 서버에서 가장 가까운 정수로 반올림하여 저장합니다.","required":["x","y"],"properties":{"x":{"type":"number","description":"X 좌표 (실수 허용, 서버에서 정수로 반올림)"},"y":{"type":"number","description":"Y 좌표 (실수 허용, 서버에서 정수로 반올림)"}}},"EventCondition":{"type":"object","properties":{"entry":{"type":"boolean"},"exit":{"type":"boolean"},"event_delay_duration_seconds":{"type":"integer"}}},"FaceArea":{"type":"object","description":"Closed polygon (마지막 point = 첫 point)","required":["name","coordinate_system","coordinate_resolution","points"],"properties":{"face_area_id":{"type":"integer","format":"int64","description":"서버 자동 생성. POST 시 생략, PUT 시 기존 area는 ID 포함 (미포함 시 새 ID 할당).\n"},"name":{"type":"string"},"coordinate_system":{"type":"string"},"coordinate_resolution":{"$ref":"#/components/schemas/CoordinateResolution"},"points":{"type":"array","description":"Closed polygon — 마지막 좌표가 첫 좌표와 동일해야 함 (최소 4+1개)","items":{"$ref":"#/components/schemas/Point"}}}},"EntryArea":{"type":"object","description":"Closed polygon (마지막 point = 첫 point)","required":["name","coordinate_system","coordinate_resolution","points","face_recognition"],"properties":{"entry_area_id":{"type":"integer","format":"int64","description":"서버 자동 생성. POST 시 생략, PUT 시 기존 area는 ID 포함 (미포함 시 새 ID 할당).\n"},"name":{"type":"string"},"coordinate_system":{"type":"string"},"coordinate_resolution":{"$ref":"#/components/schemas/CoordinateResolution"},"points":{"type":"array","description":"Closed polygon — 마지막 좌표가 첫 좌표와 동일해야 함 (최소 4+1개)","items":{"$ref":"#/components/schemas/Point"}},"face_recognition":{"type":"boolean"}}},"IntrusionArea":{"type":"object","description":"Closed polygon (마지막 point = 첫 point)","required":["name","coordinate_system","coordinate_resolution","points"],"properties":{"intrusion_area_id":{"type":"integer","format":"int64","description":"서버 자동 생성. POST 시 생략, PUT 시 기존 area는 ID 포함 (미포함 시 새 ID 할당).\n"},"name":{"type":"string"},"coordinate_system":{"type":"string"},"coordinate_resolution":{"$ref":"#/components/schemas/CoordinateResolution"},"points":{"type":"array","description":"Closed polygon — 마지막 좌표가 첫 좌표와 동일해야 함 (최소 4+1개)","items":{"$ref":"#/components/schemas/Point"}},"face_matching":{"type":"boolean","description":"영역별 얼굴 매칭 활성화 여부"}}},"LineCrossingLine":{"type":"object","description":"Open line (닫히지 않는 선분, closed polygon이 아님)","required":["name","coordinate_system","coordinate_resolution","points","direction"],"properties":{"crossing_line_id":{"type":"integer","format":"int64","description":"서버 자동 생성. POST 시 생략, PUT 시 기존 line은 ID 포함 (미포함 시 새 ID 할당).\n"},"name":{"type":"string"},"coordinate_system":{"type":"string"},"coordinate_resolution":{"$ref":"#/components/schemas/CoordinateResolution"},"points":{"type":"array","description":"Open line — 시작점과 끝점으로 구성된 선분 (최소 2개, 닫히지 않음)","items":{"$ref":"#/components/schemas/Point"}},"direction":{"type":"string","enum":["A->B","B->A","A<->B"]},"face_matching":{"type":"boolean"}}},"CountingArea":{"type":"object","description":"Closed polygon (마지막 point = 첫 point)","required":["name","coordinate_system","coordinate_resolution","points"],"properties":{"counting_area_id":{"type":"integer","format":"int64","description":"서버 자동 생성. POST 시 생략, PUT 시 기존 area는 ID 포함 (미포함 시 새 ID 할당).\n"},"name":{"type":"string"},"coordinate_system":{"type":"string"},"coordinate_resolution":{"$ref":"#/components/schemas/CoordinateResolution"},"points":{"type":"array","description":"Closed polygon — 마지막 좌표가 첫 좌표와 동일해야 함 (최소 4+1개)","items":{"$ref":"#/components/schemas/Point"}},"color":{"type":"string","enum":["white","green","red","blue","gray","black"]},"condition":{"type":"string","enum":["every_change","count_limit"]},"count_limit":{"type":"integer","minimum":1,"maximum":100},"duration_seconds":{"type":"integer","minimum":0,"maximum":60},"face_matching":{"type":"boolean"},"count_label_position":{"$ref":"#/components/schemas/Point"}}},"AllAreaCountReset":{"type":"object","properties":{"enabled":{"type":"boolean","default":true},"reset_time":{"type":"string","description":"HH:MM format, default 00:00","example":"00:00"}}},"SettingFaceMovementTracking":{"type":"object","required":["face_areas","entry_areas","event_condition"],"properties":{"face_areas":{"type":"array","items":{"$ref":"#/components/schemas/FaceArea"}},"entry_areas":{"type":"array","items":{"$ref":"#/components/schemas/EntryArea"}},"event_condition":{"$ref":"#/components/schemas/EventCondition"}}},"SettingIntrusion":{"type":"object","required":["intrusion_areas","event_condition"],"properties":{"intrusion_areas":{"type":"array","items":{"$ref":"#/components/schemas/IntrusionArea"}},"event_condition":{"$ref":"#/components/schemas/EventCondition"}}},"SettingLineCrossing":{"type":"object","required":["lines","event_condition"],"properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/LineCrossingLine"}},"event_condition":{"type":"object","properties":{"event_delay_duration_seconds":{"type":"integer"}}}}},"SettingPeopleCounting":{"type":"object","required":["counting_areas"],"properties":{"counting_areas":{"type":"array","items":{"$ref":"#/components/schemas/CountingArea"}},"all_area_reset":{"$ref":"#/components/schemas/AllAreaCountReset"}}},"AiEventSetting":{"description":"ai_event_type 값에 의해 스키마가 결정됨","oneOf":[{"$ref":"#/components/schemas/SettingFaceMovementTracking"},{"$ref":"#/components/schemas/SettingIntrusion"},{"$ref":"#/components/schemas/SettingLineCrossing"},{"$ref":"#/components/schemas/SettingPeopleCounting"}]},"AICreateOrUpdateEventRequest":{"type":"object","required":["ai_event_type","name","setting"],"properties":{"ai_event_type":{"type":"string","enum":["FaceMovementTracking","Intrusion","LineCrossing","PeopleCounting"]},"name":{"type":"string","description":"AI Event 이름 (최대 64자, 패턴: 문자/숫자/_.\\-()# + 공백)","maxLength":64,"pattern":"^[\\p{L}\\p{N}_.\\-()#]+[\\p{L}\\p{N} _.\\-()#]*$"},"setting":{"$ref":"#/components/schemas/AiEventSetting"}}},"AIEvent":{"type":"object","properties":{"ai_event_id":{"type":"integer","format":"int64"},"ai_event_type":{"type":"string","enum":["FaceMovementTracking","Intrusion","LineCrossing","PeopleCounting"]},"name":{"type":"string"},"setting":{"$ref":"#/components/schemas/AiEventSetting"}}},"RuleConditionConfig":{"description":"condition_type에 따라 스키마 결정. AIEvent인 경우 ai_event_type에 따라 세부 필드 결정 (oneOf)","oneOf":[{"$ref":"#/components/schemas/RuleConditionAiEventFMT"},{"$ref":"#/components/schemas/RuleConditionAiEventIntrusion"},{"$ref":"#/components/schemas/RuleConditionAiEventLineCrossing"},{"$ref":"#/components/schemas/RuleConditionAiEventPeopleCounting"}]},"RuleConditionAiEventFMT":{"type":"object","required":["ai_event_id","ai_event_type","entry_area_ids","event_type"],"properties":{"ai_event_id":{"type":"integer","format":"int64"},"ai_event_type":{"type":"string","enum":["FaceMovementTracking"]},"entry_area_ids":{"type":"array","items":{"type":"integer"}},"event_type":{"type":"object","properties":{"face_recognition":{"type":"boolean"},"entry_area":{"type":"boolean"}}}}},"RuleConditionAiEventIntrusion":{"type":"object","required":["ai_event_id","ai_event_type","intrusion_area_ids"],"properties":{"ai_event_id":{"type":"integer","format":"int64"},"ai_event_type":{"type":"string","enum":["Intrusion"]},"intrusion_area_ids":{"type":"array","items":{"type":"integer"}}}},"RuleConditionAiEventLineCrossing":{"type":"object","required":["ai_event_id","ai_event_type","crossing_line_ids"],"properties":{"ai_event_id":{"type":"integer","format":"int64"},"ai_event_type":{"type":"string","enum":["LineCrossing"]},"crossing_line_ids":{"type":"array","items":{"type":"integer"}}}},"RuleConditionAiEventPeopleCounting":{"type":"object","required":["ai_event_id","ai_event_type","counting_area_ids"],"properties":{"ai_event_id":{"type":"integer","format":"int64"},"ai_event_type":{"type":"string","enum":["PeopleCounting"]},"counting_area_ids":{"type":"array","items":{"type":"integer"}}}},"RuleCondition":{"type":"object","required":["condition_type"],"properties":{"condition_type":{"type":"string","enum":["AIEvent"]},"config":{"$ref":"#/components/schemas/RuleConditionConfig"}}},"ActionWebhook":{"type":"object","required":["method","url"],"properties":{"method":{"type":"string","enum":["POST","GET","PUT","DELETE"]},"url":{"type":"string","format":"uri"},"headers":{"type":"string"},"body":{"type":"string"}}},"ActionAudio":{"type":"object","required":["audio_clip_id"],"properties":{"audio_clip_id":{"type":"integer"},"repeat":{"type":"integer"}}},"RuleSchedule":{"type":"object","properties":{"always":{"type":"boolean"},"never":{"type":"boolean"},"schedule_id":{"type":"integer","nullable":true}}},"RuleActionConfig":{"description":"action_type에 따라 스키마 결정 (oneOf)","oneOf":[{"$ref":"#/components/schemas/ActionWebhook"},{"$ref":"#/components/schemas/ActionAudio"}]},"RuleAction":{"type":"object","required":["action_type","schedule"],"description":"action_type 값에 따라 config 스키마가 결정됨 (oneOf)","properties":{"action_type":{"type":"string","enum":["Webhook","Audio"]},"config":{"$ref":"#/components/schemas/RuleActionConfig"},"schedule":{"$ref":"#/components/schemas/RuleSchedule"}}},"RuleCreateOrUpdateRequest":{"type":"object","required":["name","enable","condition","actions"],"properties":{"name":{"type":"string"},"enable":{"type":"boolean"},"condition":{"$ref":"#/components/schemas/RuleCondition"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/RuleAction"}}}},"Rule":{"type":"object","properties":{"rule_id":{"type":"integer","format":"int64"},"name":{"type":"string"},"enable":{"type":"boolean"},"condition":{"$ref":"#/components/schemas/RuleCondition"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/RuleAction"}}}},"Face":{"type":"object","properties":{"face_id":{"type":"integer","example":1},"face_name":{"type":"string","description":"얼굴 이름 (safestring, 최대 255자)","maxLength":255,"example":"Face 1"},"description":{"type":"string","description":"설명 (safestring, 최대 256자)","maxLength":256,"example":"Description for Face 1"},"image_base64":{"type":"string","description":"Base64 인코딩 이미지 (PNG/JPEG, 2~10MB). 요청 시 사용."},"profile_image_base64":{"type":"string","description":"Base64 인코딩 프로필 이미지 (응답 전용)"},"last_modified":{"type":"string","description":"Last modified timestamp","example":"2025-09-16T00:00:00.000Z"}}},"User":{"type":"object","properties":{"user_id":{"type":"string","description":"사용자 ID (패턴: ^[a-zA-Z0-9_-]{1,64}$)","maxLength":64,"pattern":"^[a-zA-Z0-9_-]{1,64}$","example":"user_id_1"},"user_name":{"type":"string","description":"사용자 이름 (safestring, 최대 64자)","maxLength":64,"example":"user_name_1"},"description":{"type":"string","description":"설명 (safestring, 최대 256자)","maxLength":256,"example":"no description"},"custom_field":{"type":"string","description":"커스텀 필드 (패턴: ^[A-Za-z0-9_-]{0,64}$, unique)","maxLength":64,"pattern":"^[A-Za-z0-9_-]{0,64}$","example":"custom_field_1"},"enabled":{"type":"boolean","example":true},"last_modified":{"type":"string","format":"date-time","example":"2025-09-16T00:00:00.000Z"},"internal_user_id":{"type":"integer","example":1},"faces":{"type":"array","items":{"$ref":"#/components/schemas/Face"}}}},"UsersListResponse":{"allOf":[{"$ref":"#/components/schemas/CursorListResponse"},{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}]},"DeviceGps":{"type":"object","description":"GPS 좌표 정보. 위경도는 DD(Decimal Degrees) 형식의 실수값.","properties":{"enable":{"type":"boolean","example":false},"longitude":{"type":"number","format":"double","nullable":true,"description":"경도, DD(Decimal Degrees) 형식 실수값 (-180.0 ~ 180.0)","minimum":-180,"maximum":180,"example":126.978},"latitude":{"type":"number","format":"double","nullable":true,"description":"위도, DD(Decimal Degrees) 형식 실수값 (-90.0 ~ 90.0)","minimum":-90,"maximum":90,"example":37.5665}}},"DeviceInfo":{"type":"object","required":["model","device_sn","hw_version","kernel_version","firmware_version"],"properties":{"model":{"type":"string","description":"Device model name (read-only)","example":"AICAM-ABCD"},"device_sn":{"type":"string","description":"Device serial number (read-only)","example":"12345678"},"hw_version":{"type":"string","description":"Hardware version (read-only)","example":"1.0.2"},"kernel_version":{"type":"string","description":"Kernel version (read-only)","example":"1.0.1.2025082110001"},"firmware_version":{"type":"string","description":"Firmware version (read-only)","example":"1.10.1"},"webserver_be_version":{"type":"string","description":"WebServer backend version (read-only)","example":"1.0.1 2025/08/21 10:00:01"},"webserver_fe_version":{"type":"string","description":"WebServer frontend version (read-only)","example":"1.0.1 2025/08/21 10:00:01"},"name":{"type":"string","description":"Device name (safestring, 최대 64자)","maxLength":64,"example":"Front Entrance Camera"},"memo":{"type":"string","description":"Memo (safestring, 최대 64자)","maxLength":64,"example":"1층 로비 출입구"},"location":{"type":"string","description":"Location (safestring, 최대 64자)","maxLength":64,"example":"Building A, 1F"},"gps":{"$ref":"#/components/schemas/DeviceGps"}}},"PatchDeviceRequest":{"type":"object","description":"편집 가능 필드만 포함 (name, memo, location, gps). 변경할 필드만 전송.","properties":{"name":{"type":"string","maxLength":64,"description":"safestring, 최대 64자"},"memo":{"type":"string","maxLength":64,"description":"safestring, 최대 64자"},"location":{"type":"string","maxLength":64,"description":"safestring, 최대 64자"},"gps":{"$ref":"#/components/schemas/DeviceGps"}}},"FirmwareUploadResponseData":{"type":"object","properties":{"status":{"type":"string","example":"uploading"}}},"FirmwareStatus":{"type":"object","properties":{"status":{"type":"string","description":"idle: 업그레이드 전, uploading: 파일 업로드 중, verifying: 펌웨어 검증/설치 중, completed: 완료, failed: 실패","enum":["idle","uploading","verifying","completed","failed"],"example":"verifying"},"progress_percent":{"type":"integer","description":"진행률 (0-100)","example":100},"current_version":{"type":"string","description":"현재 펌웨어 버전","example":"1.10.1"},"reboot_required":{"type":"boolean","description":"재부팅 필요 여부 (completed 시)","example":true},"error":{"type":"string","nullable":true,"description":"에러 메시지 (failed 시)"}}},"RebootRequest":{"type":"object","properties":{"reboot_ms_time":{"type":"integer","description":"재부팅 지연 시간 (ms). 0 또는 미전송 시 즉시 재부팅","example":5000}}},"ConfigResetRequest":{"type":"object","properties":{"exclude_network":{"type":"boolean","description":"true이면 네트워크 설정 유지"}}},"FactoryResetRequest":{"type":"object","required":["password"],"properties":{"password":{"type":"string","description":"사용자 의도 재확인을 위한 현재 로그인 비밀번호","minLength":8},"exclude_network":{"type":"boolean","description":"true이면 네트워크 설정 유지"}}},"AudioClip":{"type":"object","properties":{"audio_clip_id":{"type":"integer","format":"int64","example":1},"filename":{"type":"string","description":"WAV 파일명 (패턴: ^[a-zA-Z0-9_-]{1,64}\\.wav$)","maxLength":68,"pattern":"^[a-zA-Z0-9_\\-]{1,64}\\.wav$","example":"alert_sound.wav"},"volume":{"type":"integer","minimum":0,"maximum":10,"example":5},"size_bytes":{"type":"integer","format":"int64","example":1572864},"used_in_rules":{"type":"array","description":"이 클립을 사용 중인 Rule ID 목록","items":{"type":"integer"},"example":[1,3]}}},"AudioClipListResponse":{"type":"object","properties":{"total_capacity_kb":{"type":"integer","example":30720},"remaining_capacity_kb":{"type":"integer","example":26112},"clips":{"type":"array","items":{"$ref":"#/components/schemas/AudioClip"}}}},"PatchAudioClipRequest":{"type":"object","properties":{"volume":{"type":"integer","minimum":0,"maximum":10}}},"PermissionSet":{"type":"object","description":"화면/기능 단위 권한. 추후 확장 시 개별 키로 오버라이드.","properties":{"view":{"type":"boolean","example":true},"edit":{"type":"boolean","example":true},"create":{"type":"boolean","example":true},"delete":{"type":"boolean","example":true}}},"Permissions":{"type":"object","description":"default=전체 기본 권한. 추후 화면별 키(camera, rules 등) 추가 시 default를 오버라이드.","properties":{"default":{"$ref":"#/components/schemas/PermissionSet"}},"additionalProperties":{"$ref":"#/components/schemas/PermissionSet"}},"AccountInfo":{"type":"object","properties":{"account_id":{"type":"integer","example":1},"login_id":{"type":"string","example":"admin"},"role":{"type":"string","enum":["administrator","operator","user"],"example":"administrator"},"permissions":{"$ref":"#/components/schemas/Permissions"},"enabled":{"type":"boolean","example":true}}},"MemberInfo":{"type":"object","properties":{"account_id":{"type":"integer","example":2},"login_id":{"type":"string","example":"operator1"},"role":{"type":"string","enum":["operator","user"],"example":"operator"},"permissions":{"$ref":"#/components/schemas/Permissions"},"enabled":{"type":"boolean","example":true}}},"MemberListResponse":{"type":"object","properties":{"members":{"type":"array","items":{"$ref":"#/components/schemas/MemberInfo"}}}},"CreateMemberRequest":{"type":"object","required":["login_id","password","role","permissions"],"properties":{"login_id":{"type":"string","description":"로그인 ID (패턴: ^[a-zA-Z0-9_-]{1,64}$)","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]{1,64}$"},"password":{"type":"string","description":"비밀번호 (최소 8자)","minLength":8},"role":{"type":"string","enum":["operator","user"]},"permissions":{"$ref":"#/components/schemas/Permissions"}}},"PatchMemberRequest":{"type":"object","properties":{"permissions":{"$ref":"#/components/schemas/Permissions"},"enabled":{"type":"boolean"}}},"ChangeMyPasswordRequest":{"type":"object","required":["current_password","new_password"],"properties":{"current_password":{"type":"string","minLength":1},"new_password":{"type":"string","description":"새 비밀번호 (최소 8자)","minLength":8}}},"ResetMemberPasswordRequest":{"type":"object","required":["new_password"],"properties":{"new_password":{"type":"string","description":"새 비밀번호 (최소 8자)","minLength":8}}},"SystemLogRecord":{"type":"object","properties":{"log_id":{"type":"string","example":"1234567890"},"timestamp":{"type":"string","format":"date-time","example":"2025-08-25T17:12:34.000Z"},"category":{"type":"string","enum":["ai_event","event","system","access"],"example":"access"},"type":{"type":"integer","description":"Log type code. Ranges by category:\n- ai_event: 10000~19999 (10000 + Camera Core original code)\n- event: 20000~29999\n- system: 30000~39999\n- access: 40000~49999\n","example":40001},"type_name":{"type":"string","description":"Format: CAM_{CATEGORY}_{EVENT_NAME}","example":"CAM_ACC_LOGIN"},"description":{"type":"string","example":"Admin login from 192.168.1.100"},"level":{"type":"string","enum":["info","warning","error"],"example":"info"},"meta":{"type":"object","additionalProperties":true}}},"LogTypeAiEvent":{"type":"integer","description":"ai_event (10000~19999) — AI camera core events (10000 + Camera Core code)\n\n| Type  | TypeName                        | Description          |\n|-------|---------------------------------|----------------------|\n| 14097 | CAM_AI_FACE_DETECTION           | 얼굴 감지            |\n| 14098 | CAM_AI_FACE_AUTHENTICATION      | 얼굴 인증 (성공/실패) |\n| 14099 | CAM_AI_PERSON_DETECTION         | 사람 감지            |\n| 14100 | CAM_AI_PERSON_ENTERED_AREA      | 영역 진입            |\n| 14101 | CAM_AI_PERSON_EXITED_AREA       | 영역 이탈            |\n| 14102 | CAM_AI_INTRUSION_DETECTED       | 침입 감지            |\n| 14103 | CAM_AI_LINE_CROSSED             | 라인 크로싱          |\n| 14104 | CAM_AI_PEOPLE_COUNTED           | 인원 카운트          |\n","enum":[14097,14098,14099,14100,14101,14102,14103,14104]},"LogTypeEvent":{"type":"integer","description":"event (20000~29999) — Rule, Webhook, Face User, AI Analysis, People Count, Audio\n\n| Type  | TypeName                              | Description                       |\n|-------|---------------------------------------|-----------------------------------|\n| 20001 | CAM_EVT_RULE_TRIGGERED                | 룰 트리거됨                       |\n| 20002 | CAM_EVT_RULE_CREATED                  | 룰 생성                           |\n| 20003 | CAM_EVT_RULE_UPDATED                  | 룰 수정                           |\n| 20004 | CAM_EVT_RULE_DELETED                  | 룰 삭제                           |\n| 20005 | CAM_EVT_RULE_ENABLED                  | 룰 활성화 (OFF→ON)                |\n| 20006 | CAM_EVT_RULE_DISABLED                 | 룰 비활성화 (ON→OFF)              |\n| 20100 | CAM_EVT_WEBHOOK_SEND                  | 웹훅 전송 시도                    |\n| 20101 | CAM_EVT_WEBHOOK_SENT                  | 웹훅 전송 성공 (응답 코드 포함)    |\n| 20102 | CAM_EVT_WEBHOOK_FAILED                | 웹훅 전송 실패 (실패 사유 포함)    |\n| 20103 | CAM_EVT_WEBHOOK_CREATED               | 웹훅 생성                         |\n| 20104 | CAM_EVT_WEBHOOK_UPDATED               | 웹훅 수정                         |\n| 20105 | CAM_EVT_WEBHOOK_DELETED               | 웹훅 삭제                         |\n| 20200 | CAM_EVT_FACE_USER_CREATED             | 얼굴 사용자 생성                  |\n| 20201 | CAM_EVT_FACE_USER_UPDATED             | 얼굴 사용자 수정                  |\n| 20202 | CAM_EVT_FACE_USER_DELETED             | 얼굴 사용자 삭제                  |\n| 20300 | CAM_EVT_AI_ANALYSIS_CREATED           | AI 분석 이벤트 생성               |\n| 20301 | CAM_EVT_AI_ANALYSIS_UPDATED           | AI 분석 이벤트 수정               |\n| 20302 | CAM_EVT_AI_ANALYSIS_DELETED           | AI 분석 이벤트 삭제               |\n| 20400 | CAM_EVT_PEOPLE_COUNT_THRESHOLD        | 인원수 임계값 초과                |\n| 20401 | CAM_EVT_PEOPLE_COUNT_RESET            | 카운트 수동 초기화                |\n| 20402 | CAM_EVT_PEOPLE_COUNT_AUTO_RESET       | 카운트 자동 초기화 (스케줄)        |\n| 20500 | CAM_EVT_AUDIO_CLIP_UPLOADED           | 오디오 클립 업로드                |\n| 20501 | CAM_EVT_AUDIO_CLIP_DELETED            | 오디오 클립 삭제                  |\n| 20502 | CAM_EVT_AUDIO_CLIP_PLAY               | 오디오 클립 재생 요청              |\n| 20503 | CAM_EVT_AUDIO_CLIP_PLAYED             | 오디오 클립 재생 성공              |\n| 20504 | CAM_EVT_AUDIO_CLIP_PLAY_FAILED        | 오디오 클립 재생 실패              |\n","enum":[20001,20002,20003,20004,20005,20006,20100,20101,20102,20103,20104,20105,20200,20201,20202,20300,20301,20302,20400,20401,20402,20500,20501,20502,20503,20504]},"LogTypeSystem":{"type":"integer","description":"system (30000~39999) — Network, DateTime, Firmware, System, CLUe, Consent, AI\n\n| Type  | TypeName                                | Description                       |\n|-------|-----------------------------------------|-----------------------------------|\n| 30001 | CAM_SYS_NETWORK_CHANGE                  | 네트워크 설정 변경 (IP/Port)      |\n| 30002 | CAM_SYS_NETWORK_DHCP_FALLBACK           | DHCP 실패 Link-local 전환         |\n| 30100 | CAM_SYS_DATETIME_CHANGE                 | 날짜/시간 설정 변경               |\n| 30101 | CAM_SYS_NTP_SYNC_FAILED                 | NTP 동기화 실패                   |\n| 30200 | CAM_SYS_FIRMWARE_UPGRADE                | 펌웨어 업그레이드                 |\n| 30300 | CAM_SYS_SYSTEM_REBOOT                   | 시스템 재부팅                     |\n| 30301 | CAM_SYS_FACTORY_RESET                   | 공장 초기화                       |\n| 30302 | CAM_SYS_CONFIG_RESET                    | 설정 초기화 (네트워크 제외)        |\n| 30400 | CAM_SYS_CLUE_ENABLED                    | CLUe 활성화 성공                  |\n| 30401 | CAM_SYS_CLUE_DISABLED                   | CLUe 비활성화                     |\n| 30402 | CAM_SYS_CLUE_ENABLE_FAILED              | CLUe 활성화 실패                  |\n| 30500 | CAM_SYS_CONSENT_ENROLLMENT_CHANGED      | 얼굴 등록 동의 변경               |\n| 30501 | CAM_SYS_CONSENT_ANALYTICS_CHANGED       | 얼굴 분석 동의 변경               |\n| 30600 | CAM_SYS_AI_SETTINGS_CHANGED             | AI 설정 변경                      |\n| 30601 | CAM_SYS_AI_LOAD_FAILED                  | AI 기능 로딩 실패                 |\n","enum":[30001,30002,30100,30101,30200,30300,30301,30302,30400,30401,30402,30500,30501,30600,30601]},"LogTypeAccess":{"type":"integer","description":"access (40000~49999) — Auth, Session, Account\n\n| Type  | TypeName                          | Description                       |\n|-------|-----------------------------------|-----------------------------------|\n| 40001 | CAM_ACC_LOGIN                     | 로그인 성공                       |\n| 40002 | CAM_ACC_LOGOUT                    | 로그아웃 (수동/강제)              |\n| 40003 | CAM_ACC_TOKEN_REFRESH             | 토큰 갱신                         |\n| 40004 | CAM_ACC_PASSWORD_CHANGE           | 비밀번호 변경                     |\n| 40005 | CAM_ACC_AUTH_FAILURE              | 인증 실패                         |\n| 40006 | CAM_ACC_REFRESH_TOKEN_REUSE       | 리프레시 토큰 재사용 감지          |\n| 40007 | CAM_ACC_SESSION_INVALIDATED       | 세션 무효화                       |\n| 40008 | CAM_ACC_RATE_LIMIT_EXCEEDED       | 요청 제한 초과                    |\n| 40009 | CAM_ACC_FORBIDDEN_ACCESS          | 권한 없는 접근                    |\n| 40010 | CAM_ACC_PASSWORD_SETUP            | 초기 비밀번호 설정 완료            |\n| 40011 | CAM_ACC_ACCOUNT_LOCKED            | 계정 잠금 (N회 실패)              |\n| 40012 | CAM_ACC_SESSION_EXPIRED           | 세션 타임아웃 만료                |\n| 40013 | CAM_ACC_ACCOUNT_CREATED           | 계정 생성 (Operator)              |\n| 40014 | CAM_ACC_ACCOUNT_UPDATED           | 계정 수정                         |\n| 40015 | CAM_ACC_ACCOUNT_DELETED           | 계정 삭제                         |\n| 40016 | CAM_ACC_ACCOUNT_DISABLED          | 계정 비활성화                     |\n","enum":[40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,40011,40012,40013,40014,40015,40016]},"SystemLogsList":{"allOf":[{"$ref":"#/components/schemas/CursorListResponse"},{"type":"object","properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/SystemLogRecord"}}}}]},"RealtimePersonDetectionEvent":{"type":"object","additionalProperties":true},"RealtimeFaceDetectionEvent":{"type":"object","additionalProperties":true},"RealtimeFaceAuthenticationEvent":{"type":"object","additionalProperties":true},"RealtimeEntryEvent":{"type":"object","additionalProperties":true},"RealtimeMultipartChunkEvent":{"type":"object","additionalProperties":true}}},"security":[{"BearerAuth":[]}],"paths":{"/capabilities":{"get":{"tags":["Common"],"summary":"Capabilities","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Capabilities"}}}]}}}}}}},"/version":{"get":{"tags":["Common"],"summary":"Version","description":"Returns BE/FE version information. No authentication required.","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VersionInfo"}}}]}}}}}}},"/auth/admin-status":{"get":{"tags":["Authentication"],"summary":"Admin Status","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AdminStatus"}}}]}}}}}}},"/auth/admin-initialize":{"post":{"tags":["Authentication"],"summary":"Admin 초기 암호 설정","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["new_password"],"properties":{"new_password":{"type":"string","minLength":8}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SuccessResult"}}}]}}}},"400":{"description":"Password validation failed","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"code":{"type":"string","example":"PASSWORD_TOO_SHORT"},"message":{"type":"string","example":"Password must be at least 12 characters"}}}}}]}}}},"409":{"description":"Admin password already set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/auth/login":{"post":{"tags":["Authentication"],"summary":"Login","description":"로그인하여 JWT 토큰을 발급받습니다.\n로그인 시 session_version이 증가하여 기존에 발급된 모든 토큰이 무효화됩니다.\n\n**로그인 실패 락아웃 정책:**\n- 5회 로그인 실패 시 계정이 일시적으로 잠깁니다.\n- 락아웃 시간: 5분 × 락아웃 횟수 (점진적 증가)\n  - 1차 락아웃: 5분, 2차: 10분, 3차: 15분, ...\n- 락아웃은 IP + 계정 ID 조합으로 적용됩니다.\n- 로그인 성공 시 실패 횟수와 락아웃 횟수가 초기화됩니다.\n\n**응답 헤더:**\n- `X-Login-Attempts-Remaining`: 락아웃 전 남은 로그인 시도 횟수\n","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"OK","headers":{"X-Login-Attempts-Remaining":{"description":"Remaining login attempts before lockout","schema":{"type":"integer","example":5}}},"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoginResponseData"}}}]}}}},"400":{"description":"Invalid credentials (before lockout)","headers":{"X-Login-Attempts-Remaining":{"description":"Remaining login attempts before lockout","schema":{"type":"integer","example":3}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginFailureResponse"}}}},"429":{"description":"Account locked due to too many failed login attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountLockedResponse"}}}}}}},"/auth/access-token":{"post":{"tags":["Authentication"],"summary":"Access Token 재발급","description":"Refresh Token을 사용하여 새로운 Access Token을 발급받습니다.\nAuthorization 헤더에 Refresh Token을 Bearer 형식으로 전달해야 합니다.\n","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccessTokenResponseData"}}}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponse"}}}}}}},"/auth/refresh-token":{"post":{"tags":["Authentication"],"summary":"Refresh Token 회전","description":"Refresh Token을 회전(rotation)하여 새로운 Access Token과 Refresh Token을 발급받습니다.\n기존 Refresh Token은 즉시 무효화됩니다 (session_version 증가).\nAuthorization 헤더에 Refresh Token을 Bearer 형식으로 전달해야 합니다.\n","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RefreshTokenResponseData"}}}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponse"}}}}}}},"/auth/logout":{"post":{"tags":["Authentication"],"summary":"Logout","description":"로그아웃하여 현재 세션을 무효화합니다.\nsession_version이 증가하여 해당 계정의 모든 Access/Refresh Token이 즉시 무효화됩니다.\n","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthErrorResponse"}}}}}}},"/channels/simples":{"get":{"tags":["Live View"],"summary":"Channel 목록 간단 조회 with 조건","security":[],"parameters":[{"name":"view_type","in":"query","required":false,"schema":{"type":"string","example":"Fisheye"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChannelSimple"}}}}]}}}}}}},"/channels":{"get":{"tags":["Settings/Basic/Video Profile"],"summary":"Video channel 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}}}}]}}}}}}},"/channels/{channel_id}":{"get":{"tags":["Settings/Basic/Video Profile"],"summary":"Video channel 단일 조회","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Channel"}}}]}}}}}},"put":{"tags":["Settings/Basic/Video Profile"],"summary":"Video channel 전체 수정","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelUpdateRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Channel"}}}]}}}}}},"patch":{"tags":["Settings/Basic/Video Profile"],"summary":"Video channel 부분 수정","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelPatchRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Channel"}}}]}}}}}}},"/channels/{channel_id}/reset":{"post":{"tags":["Settings/Basic/Video Profile"],"summary":"Video channel 초기화 (기본값 복원)","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyObject"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Channel"}}}]}}}}}}},"/settings/camera":{"get":{"tags":["Settings/Camera"],"summary":"Camera Settings 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CameraSettings"}}}]}}}}}},"patch":{"tags":["Settings/Camera"],"summary":"Camera Settings 수정","description":"변경하고자 하는 필드만 포함하여 전송 (Partial Update). Admin 전용, Rate Limited.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchCameraSettingsRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CameraSettings"}}}]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}},"503":{"description":"VideoCore 응답 실패","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}}}},"/settings/camera/reset":{"post":{"tags":["Settings/Camera"],"summary":"Camera Settings 초기화","description":"카메라 설정을 공장 기본값으로 복원합니다. Admin 전용, Rate Limited.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CameraSettings"}}}]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}}}}},"/settings/privacy-overlay":{"get":{"tags":["Settings/Privacy & Overlay"],"summary":"Privacy & Overlay 조회","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PrivacyOverlaySettings"}}}]}}}}}},"patch":{"tags":["Settings/Privacy & Overlay"],"summary":"Privacy & Overlay 수정","security":[{"BearerAuth":[]}],"description":"변경하고자 하는 필드만 포함하여 전송 (Partial Update).\nprivacy_areas를 전송하면 전체 교체 (Full Replace).\nprivacy_areas의 각 항목은 직사각형 (position: x, y, width, height).\nAdmin 권한 필요.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyOverlaySettings"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PrivacyOverlaySettings"}}}]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}},"503":{"description":"VideoCore 응답 실패","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}}}},"/settings/privacy-overlay/reset":{"post":{"tags":["Settings/Privacy & Overlay"],"summary":"Privacy & Overlay 초기화","security":[{"BearerAuth":[]}],"description":"Privacy & Overlay 설정을 기본값으로 복원합니다. Admin 전용, Rate Limited.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PrivacyOverlaySettings"}}}]}}}}}}},"/ai-events/count":{"get":{"tags":["AI Events"],"summary":"AI Event 갯수 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AICountResponse"}}}]}}}}}}},"/ai-events/logs":{"get":{"tags":["AI Events"],"summary":"AI Events Log 조회 with 조건","parameters":[{"name":"timestamp_gt","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_gte","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_lt","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_lte","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"user_id","in":"query","schema":{"type":"string"}},{"name":"event_type_name","in":"query","schema":{"type":"string"}},{"name":"event_type","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"order_by","in":"query","schema":{"type":"string","example":"timestamp"}},{"name":"order_direction","in":"query","schema":{"type":"string","enum":["ASC","DESC"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AIEventsLogsList"}}}]}}}}}}},"/ai-events/logs/count":{"get":{"tags":["AI Events"],"summary":"AI Events Log 갯수 조회","parameters":[{"name":"timestamp_gt","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_gte","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_lt","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_lte","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"user_id","in":"query","schema":{"type":"string"}},{"name":"event_type_name","in":"query","schema":{"type":"string"}},{"name":"event_type","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"total":{"type":"integer"}}}}}]}}}}}}},"/ai-events/logs/{ai_events_log_id}":{"get":{"tags":["AI Events"],"summary":"AI Events Log 단일 조회","parameters":[{"name":"ai_events_log_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AIEventsLog"}}}]}}}}}}},"/ai-events/area-of-interest":{"get":{"tags":["AI Events"],"summary":"AI Events 의 Area of Interest 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AreaOfInterestResponse"}}}]}}}}}}},"/ai-events":{"post":{"tags":["Settings/AI & Event/AI Event"],"summary":"AI Event 생성","description":"Face Analytics Consent가 사전에 동의되어 있어야 한다. 미동의 시 403 Forbidden.\nai_event_type은 FaceMovementTracking, Intrusion, LineCrossing, PeopleCounting 중 하나여야 한다.\n지원하지 않는 타입 전송 시 400 Bad Request.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AICreateOrUpdateEventRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"Unsupported ai_event_type"},"403":{"description":"Face Analytics Consent 미동의"}}},"get":{"tags":["Settings/AI & Event/AI Event"],"summary":"AI Event 조회 with 조건","parameters":[{"name":"channel_id","in":"query","schema":{"type":"integer"}},{"name":"ai_event_type","in":"query","schema":{"type":"string","enum":["FaceMovementTracking","Intrusion","LineCrossing","PeopleCounting"]}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}},{"name":"limit","in":"query","schema":{"type":"integer","default":10}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AIEvent"}}}}]}}}}}}},"/ai-events/simples":{"get":{"tags":["Settings/AI & Event/AI Event"],"summary":"AI Event 목록 간단 조회","parameters":[{"name":"channel_id","in":"query","schema":{"type":"integer"}},{"name":"ai_event_type","in":"query","schema":{"type":"string"}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}},{"name":"limit","in":"query","schema":{"type":"integer","default":10}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AIEventSimple"}}}}]}}}}}}},"/ai-events/{ai_event_id}":{"get":{"tags":["Settings/AI & Event/AI Event"],"summary":"AI Event 단일 조회","parameters":[{"name":"ai_event_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AIEvent"}}}]}}}}}},"put":{"tags":["Settings/AI & Event/AI Event"],"summary":"AI Event 수정","description":"기존 area/line을 유지하려면 해당 area의 ID(face_area_id, entry_area_id 등)를 포함해야 합니다.\nID가 없는 area는 새로 생성되어 새 ID가 할당됩니다.\nai_event_type은 FaceMovementTracking, Intrusion, LineCrossing, PeopleCounting 중 하나여야 한다.\n지원하지 않는 타입 전송 시 400 Bad Request.\n","parameters":[{"name":"ai_event_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AICreateOrUpdateEventRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"Unsupported ai_event_type"}}},"delete":{"tags":["Settings/AI & Event/AI Event"],"summary":"AI Event 삭제","parameters":[{"name":"ai_event_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"204":{"description":"No Content"}}}},"/rules":{"post":{"tags":["Settings/AI & Event/Rule Settings"],"summary":"Rule 생성","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreateOrUpdateRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Rule"}}}]}}}}}},"get":{"tags":["Settings/AI & Event/Rule Settings"],"summary":"Rule 조회","parameters":[{"name":"ai_event_type","in":"query","schema":{"type":"string","enum":["FaceMovementTracking","Intrusion","LineCrossing","PeopleCounting"]}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}},{"name":"limit","in":"query","schema":{"type":"integer","default":10}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Rule"}}}}]}}}}}}},"/rules/simples":{"get":{"tags":["Settings/AI & Event/Rule Settings"],"summary":"Rule 목록 간단 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RuleSimple"}}}}]}}}}}}},"/rules/{rule_id}":{"get":{"tags":["Settings/AI & Event/Rule Settings"],"summary":"Rule 단일 조회","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Rule"}}}]}}}}}},"put":{"tags":["Settings/AI & Event/Rule Settings"],"summary":"Rule 수정","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreateOrUpdateRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}},"patch":{"tags":["Settings/AI & Event/Rule Settings"],"summary":"Rule 부분 수정","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}},"delete":{"tags":["Settings/AI & Event/Rule Settings"],"summary":"Rule 삭제","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"204":{"description":"No Content"}}}},"/users":{"post":{"tags":["People"],"summary":"User 생성","description":"Face Enrollment Consent가 사전에 동의되어 있어야 한다. 미동의 시 403 Forbidden.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"403":{"description":"Face Enrollment Consent 미동의"}}},"get":{"tags":["People"],"summary":"User 조회 with 조건","parameters":[{"name":"last_modified_gt","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"last_modified_gte","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"last_modified_lt","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"last_modified_lte","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"cursor","in":"query","description":"Base64 인코딩된 커서 (다음 페이지 조회)","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}},{"name":"order_by","in":"query","schema":{"type":"string","enum":["lastModified","userName","externalUserId","customField"],"default":"lastModified"}},{"name":"order_direction","in":"query","schema":{"type":"string","enum":["ASC","DESC"],"default":"ASC"}},{"name":"search","in":"query","description":"검색 키워드 (최대 64자)","schema":{"type":"string","maxLength":64}},{"name":"search_by","in":"query","description":"검색 대상 필드","schema":{"type":"string","enum":["user_name","user_id"],"default":"user_name"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UsersListResponse"}}}]}}}}}}},"/users/next-user-id":{"get":{"tags":["People"],"summary":"User Next User Id","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/users/statistics":{"get":{"tags":["People"],"summary":"User/Face 통계 조회","description":"활성(status=1) 사용자 수와 얼굴 수를 조회합니다.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"total_users":{"type":"integer","description":"활성 사용자 수","example":42},"total_faces":{"type":"integer","description":"활성 얼굴 수","example":87}}}}}]}}}}}}},"/users/{user_id}":{"get":{"tags":["People"],"summary":"User 단일 조회","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}},"put":{"tags":["People"],"summary":"User 수정","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}},"patch":{"tags":["People"],"summary":"User 부분 수정","description":"사용자 정보를 부분 수정합니다. 두 가지 Patch 모드를 지원합니다:\n- **Merge Patch** (Content-Type: application/merge-patch+json 또는 application/json): 변경할 필드만 전송\n- **JSON Patch RFC 6902** (Content-Type: application/json-patch+json): op/path/value 배열로 전송\nfaces 필드가 포함된 경우 얼굴 Diff + 원격 등록/삭제가 수행됩니다.\n","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/merge-patch+json":{"schema":{"type":"object","description":"변경할 필드만 전송 (Merge Patch)","properties":{"user_name":{"type":"string","maxLength":64},"description":{"type":"string","maxLength":256},"custom_field":{"type":"string","maxLength":64},"enabled":{"type":"boolean"},"faces":{"type":"array","items":{"type":"object","properties":{"face_name":{"type":"string","maxLength":255},"description":{"type":"string","maxLength":1024},"image_base64":{"type":"string","format":"byte"}}}}}}},"application/json-patch+json":{"schema":{"type":"array","description":"RFC 6902 JSON Patch operations","items":{"type":"object","required":["op","path"],"properties":{"op":{"type":"string","enum":["add","remove","replace"]},"path":{"type":"string","description":"JSON Pointer (RFC 6901)"},"value":{"description":"New value (required for add/replace)"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"404":{"description":"User not found"},"409":{"description":"Duplicate custom_field"}}},"delete":{"tags":["People"],"summary":"User 삭제","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/users/{user_id}/faces":{"get":{"tags":["People"],"summary":"User의 Face 목록 조회","description":"특정 사용자에 등록된 얼굴(Face) 목록을 조회합니다.","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string"},"description":"사용자 외부 ID (external_user_id)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/Face"},"description":"사용자가 존재하지 않으면 null 반환"}}}]}}}}}}},"/ai-events/{ai_event_id}/counting-areas":{"get":{"tags":["People Counting"],"summary":"Counting Areas 조회","parameters":[{"name":"ai_event_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CountingAreasResponse"}}}]}}}}}}},"/ai-events/{ai_event_id}/counting-areas/{counting_area_id}":{"get":{"tags":["People Counting"],"summary":"Counting Area 단일 조회","parameters":[{"name":"ai_event_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"counting_area_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CountingArea"}}}]}}}}}}},"/ai-events/{ai_event_id}/counting-areas/{counting_area_id}/reset":{"post":{"tags":["People Counting"],"summary":"Counting Area 카운트 초기화 (AI Event 기반)","security":[{"BearerAuth":[]}],"parameters":[{"name":"ai_event_id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"counting_area_id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"Invalid ai_event_id or counting_area_id parameter"},"404":{"description":"AI event or counting area not found"}}}},"/ai-events/{ai_event_id}/counting-areas/reset-all":{"post":{"tags":["People Counting"],"summary":"Counting Areas 전체 카운트 초기화 (AI Event 기반)","security":[{"BearerAuth":[]}],"parameters":[{"name":"ai_event_id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"Invalid ai_event_id parameter"},"404":{"description":"AI event not found"}}}},"/ai-events/{ai_event_id}/face-authentications":{"get":{"tags":["Face Authentication"],"summary":"인증된 사용자 목록 조회","description":"Face area 설정은 AI Event (FaceMovementTracking) 의 setting.face_areas[]에서 관리. 이 API는 실시간 인증 사용자 조회 전용.\n","security":[{"BearerAuth":[]}],"parameters":[{"name":"ai_event_id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FaceAuthenticationResponse"}}}]}}}},"400":{"description":"Invalid ai_event_id parameter"},"404":{"description":"AI event not found"},"500":{"description":"VideoCore query failed or timed out"}}}},"/system/network":{"get":{"tags":["Settings/Network"],"summary":"Network 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/NetworkConfig"}}}]}}}}}},"patch":{"tags":["Settings/Network"],"summary":"Network 설정","description":"네트워크 설정을 변경합니다. 모든 필드는 optional이며, 전달된 필드만 업데이트됩니다 (Partial Update). Admin 전용, Rate Limited.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchNetworkRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"Bad Request - 다음 경우에 반환됩니다:\n- 포트 범위 초과 (표준 포트(80/443/554) 또는 1024~65535 범위 밖)\n- 포트 충돌 (HTTP, HTTPS, RTSP 간 동일 포트 사용)\n- MTU 범위 초과 (1280~1500 범위 밖)\n","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"message":{"type":"string","example":"Port conflict: http and https cannot use the same port 8080"}}}]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}},"503":{"description":"VideoCore 응답 실패","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}}}},"/integration/3rd/clue":{"get":{"tags":["Integration/CLUe"],"summary":"CLUe 상태 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ClueConfig"}}}]}}}}}},"patch":{"tags":["Integration/CLUe"],"summary":"CLUe 설정","description":"CLUe 클라우드 연결을 활성화/비활성화합니다.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchClueRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ClueConfig"}}}]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}}}}},"/system/datetime":{"get":{"tags":["Settings/DateTime"],"summary":"Date & Time 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DateTimeInfo"}}}]}}}}}},"patch":{"tags":["Settings/DateTime"],"summary":"Date & Time 설정","description":"Admin 전용, Rate Limited.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDateTimeRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DateTimeInfo"}}}]}}}},"400":{"description":"Bad Request - ntp.use=true 상태에서 current_datetime 수동 변경 시도","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}},"503":{"description":"VideoCore 응답 실패","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}}}},"/system/device":{"get":{"tags":["System/Device"],"summary":"Device 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeviceInfo"}}}]}}}}}},"patch":{"tags":["System/Device"],"summary":"Device 부분 수정","description":"Admin 전용, Rate Limited.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDeviceRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeviceInfo"}}}]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}},"503":{"description":"VideoCore 응답 실패","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResponse"}}}}}}},"/system/device/licenses":{"get":{"tags":["System/Device"],"summary":"Device OSS 조회","description":"팝업 창에서 표시할 오픈소스 라이선스 HTML 반환.\n인증 불필요 (Public API) — 오픈소스 라이선스는 공개 의무 정보.\n","security":[],"responses":{"200":{"description":"HTML","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/system/device/firmware":{"post":{"tags":["System/Device"],"summary":"Firmware Upgrade","description":"펌웨어 파일을 업로드하고 업그레이드를 요청합니다. Admin 전용, Rate Limited.\nBody size limit: 100MB.\n\n1. 파일을 임시 경로에 저장\n2. Redis Pub/Sub으로 SaiCam에 펌웨어 업그레이드 요청\n3. SaiCam 응답 대기 후 결과 반환\n\n성공 시 `{\"status\": \"completed\"}`, 실패 시 500 에러를 반환합니다.\n","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"firmware binary (.bin, .fw, .img). 최소 1KB ~ 최대 100MB."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FirmwareUploadResponseData"}}}]}}}},"409":{"description":"펌웨어 업로드 이미 진행 중"},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}}}}},"/system/device/firmware/status":{"get":{"tags":["System/Device"],"summary":"Firmware Upgrade 상태 조회","description":"펌웨어 업그레이드 진행 상태를 조회합니다.\n\n상태값은 WebServer 메모리에 저장됩니다. 서버 재시작 시 idle로 초기화됩니다.\n\n**상태 설명:**\n- idle: 펌웨어 업그레이드 요청 전\n- uploading: 펌웨어 파일 저장 중\n- verifying: 파일 저장 완료, SaiCam에 Pub/Sub 요청 중\n- completed: 펌웨어 업그레이드 완료 (reboot_required 확인 필요)\n- failed: 펌웨어 업그레이드 실패 (error 필드에 원인 표시)\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FirmwareStatus"}}}]}}}}}}},"/system/device/reboot":{"post":{"tags":["System/Device"],"summary":"Device Reboot","description":"디바이스를 재부팅합니다. request body가 없거나 reboot_ms_time이 0이면 즉시 재부팅, 값이 있으면 해당 시간(ms) 후 재부팅합니다.","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RebootRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}}}}},"/system/device/config-reset":{"post":{"tags":["System/Device"],"summary":"Device Config Reset (설정 초기화)","description":"설정값만 초기화. 사용자 데이터, 이벤트, 로그는 유지됨. exclude_network가 true이면 네트워크 설정도 유지.","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigResetRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}}}}},"/system/device/factory-reset":{"post":{"tags":["System/Device"],"summary":"Device Factory Reset (공장 초기화)","description":"사용자, 이벤트, 로그, 비밀번호 등 전체 삭제. 비밀번호 재입력으로 사용자 의도 재확인.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactoryResetRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}}}}},"/system/audio/clips":{"get":{"tags":["System/Audio"],"summary":"Audio Clip 목록 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AudioClipListResponse"}}}]}}}}}},"post":{"tags":["System/Audio"],"summary":"Audio Clip 추가","description":"WAV 파일 업로드 (48kHz/24kHz, 영문 파일명, 64자 이내). 잔여 용량 범위 내에서만 가능.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"WAV 파일"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AudioClip"}}}]}}}}}}},"/system/audio/clips/{audio_clip_id}":{"get":{"tags":["System/Audio"],"summary":"Audio Clip 단일 조회","parameters":[{"name":"audio_clip_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AudioClip"}}}]}}}}}},"patch":{"tags":["System/Audio"],"summary":"Audio Clip 수정 (Volume)","parameters":[{"name":"audio_clip_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchAudioClipRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AudioClip"}}}]}}}}}},"delete":{"tags":["System/Audio"],"summary":"Audio Clip 삭제","description":"Rule Action에서 사용 중인 클립 삭제 시 해당 Rule Action에서 자동 제외됨.","parameters":[{"name":"audio_clip_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/system/audio/clips/{audio_clip_id}/play":{"post":{"tags":["System/Audio"],"summary":"Audio Clip 재생","parameters":[{"name":"audio_clip_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/system/audio/clips/{audio_clip_id}/stop":{"post":{"tags":["System/Audio"],"summary":"Audio Clip 정지","parameters":[{"name":"audio_clip_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/system/account/me":{"get":{"tags":["System/Account"],"summary":"현재 로그인 계정 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountInfo"}}}]}}}}}}},"/system/account/me/password":{"patch":{"tags":["System/Account"],"summary":"현재 로그인 계정 비밀번호 변경","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeMyPasswordRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/system/account/members":{"get":{"tags":["System/Account"],"summary":"Member 목록 조회","description":"Administrator만 접근 가능.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberListResponse"}}}]}}}}}},"post":{"tags":["System/Account"],"summary":"Member 생성","description":"Administrator만 접근 가능. Operator 최대 10명.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMemberRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberInfo"}}}]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}}}}},"/system/account/members/{account_id}":{"patch":{"tags":["System/Account"],"summary":"Member 수정","description":"Administrator만 접근 가능. permissions, enabled 변경 가능.","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchMemberRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MemberInfo"}}}]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}}}},"delete":{"tags":["System/Account"],"summary":"Member 삭제","description":"Administrator만 접근 가능.","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}}}}},"/system/account/members/{account_id}/password":{"patch":{"tags":["System/Account"],"summary":"Member 비밀번호 초기화","description":"Administrator만 접근 가능.","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetMemberPasswordRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}}}}},"/system/logs":{"get":{"tags":["System/Logs"],"summary":"Logs 조회","parameters":[{"name":"timestamp_gt","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_gte","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_lt","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_lte","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"category","in":"query","description":"카테고리 필터. 콤마 구분으로 다중 지정 가능 (예: ai_event,event)","schema":{"type":"string","example":"ai_event,event"}},{"name":"cursor","in":"query","description":"Base64 인코딩된 커서 (다음 페이지 조회)","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"order_by","in":"query","schema":{"type":"string","enum":["timestamp","type","type_name","level","category"],"default":"timestamp"}},{"name":"order_direction","in":"query","schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SystemLogsList"}}}]}}}}}}},"/system/logs/export":{"get":{"tags":["System/Logs"],"summary":"Logs Export CSV","description":"CSV 파일로 로그를 다운로드합니다.\nContent-Disposition: attachment; filename=\"logs_YYYYMMDD_HHMMSS.csv\"\nCSV 컬럼: log_id, timestamp, category, type, type_name, description, level\nlimit 파라미터는 내부적으로 최대 10000으로 오버라이드됩니다.\n","parameters":[{"name":"timestamp_gt","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_gte","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_lt","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"timestamp_lte","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"category","in":"query","description":"카테고리 필터. 콤마 구분으로 다중 지정 가능 (예: ai_event,event)","schema":{"type":"string","example":"ai_event,event"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","description":"내부적으로 최대 10000으로 오버라이드","schema":{"type":"integer","default":10}},{"name":"order_by","in":"query","schema":{"type":"string","enum":["timestamp","type","type_name","level","category"],"default":"timestamp"}},{"name":"order_direction","in":"query","schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"}}],"responses":{"200":{"description":"CSV 파일 다운로드","headers":{"Content-Disposition":{"schema":{"type":"string"},"example":"attachment; filename=\"logs_20260225_120000.csv\""}},"content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/system/logs/download":{"get":{"tags":["System/Logs"],"summary":"Logs Download ZIP","description":"장치의 로그 파일들을 ZIP으로 압축하여 다운로드합니다.\nContent-Disposition: attachment; filename=\"logs_YYYYMMDD_HHMMSS.zip\"\nDATABASE_PATH/logs 디렉토리의 모든 파일을 포함합니다.\n서브디렉토리는 포함하지 않습니다 (1레벨만).\n","responses":{"200":{"description":"ZIP 파일 다운로드","headers":{"Content-Disposition":{"schema":{"type":"string"},"example":"attachment; filename=\"logs_20260227_120000.zip\""}},"content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"로그 디렉토리 또는 파일이 없음","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}}}},"/webrtc/rp/{channel_id}/whep":{"options":{"tags":["WebRTC Reverse Proxy"],"summary":"WHEP CORS preflight","parameters":[{"name":"channel_id","in":"path","required":true,"description":"MediaMTX 채널 ID (예: ch1_primary, ch1_secondary, ch2_primary, ch2_secondary)","schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"}}],"responses":{"204":{"description":"No Content"}}},"post":{"tags":["WebRTC Reverse Proxy"],"summary":"WHEP session create","description":"WHEP 세션을 생성합니다. SDP Offer를 전송하고 SDP Answer를 수신합니다.\n성공 시 `Location` 헤더에 세션 관리용 URL이 반환됩니다.\n","parameters":[{"name":"channel_id","in":"path","required":true,"description":"MediaMTX 채널 ID (예: ch1_primary, ch1_secondary)","schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"}}],"responses":{"201":{"description":"Created","headers":{"Location":{"description":"세션 관리 URL (/v1/api/webrtc/rp/{channel_id}/whep/{secret})","schema":{"type":"string"}},"ETag":{"description":"세션 ETag (ICE candidate 추가 시 If-Match에 사용)","schema":{"type":"string"}}}}}}},"/webrtc/rp/{channel_id}/whep/{secret}":{"patch":{"tags":["WebRTC Reverse Proxy"],"summary":"WHEP ICE candidate 추가","description":"ICE candidate를 추가합니다. `If-Match` 헤더에 ETag 값을 포함해야 합니다.","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"}},{"name":"secret","in":"path","required":true,"description":"POST 응답의 Location 헤더에서 받은 세션 secret","schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,128}$"}}],"responses":{"204":{"description":"No Content"},"404":{"description":"Session not found"}}},"delete":{"tags":["WebRTC Reverse Proxy"],"summary":"WHEP session 종료","description":"WHEP 세션을 종료합니다.","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"}},{"name":"secret","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,128}$"}}],"responses":{"200":{"description":"OK"}}}},"/webrtc/rp/{channel_id}/whip":{"options":{"tags":["WebRTC Reverse Proxy"],"summary":"WHIP CORS preflight","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"}}],"responses":{"204":{"description":"No Content"}}},"post":{"tags":["WebRTC Reverse Proxy"],"summary":"WHIP session create","description":"WHIP 세션을 생성합니다. SDP Offer를 전송하고 SDP Answer를 수신합니다.","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"}}],"responses":{"201":{"description":"Created","headers":{"Location":{"description":"세션 관리 URL","schema":{"type":"string"}}}}}}},"/webrtc/rp/{channel_id}/whip/{secret}":{"patch":{"tags":["WebRTC Reverse Proxy"],"summary":"WHIP ICE candidate 추가","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"}},{"name":"secret","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,128}$"}}],"responses":{"204":{"description":"No Content"}}},"delete":{"tags":["WebRTC Reverse Proxy"],"summary":"WHIP session 종료","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,64}$"}},{"name":"secret","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,128}$"}}],"responses":{"200":{"description":"OK"}}}},"/users/all":{"delete":{"tags":["People"],"summary":"User 전체 삭제","description":"모든 사용자를 삭제합니다. Face Enrollment Consent 미동의 시 403.\n실제 엔드포인트는 `DELETE /v1/api/users/` (trailing slash)입니다.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"403":{"description":"Face Enrollment Consent 미동의"}}}},"/settings/face-enrollment-consent":{"get":{"tags":["Settings/Face"],"summary":"Face Enrollment Consent 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FaceEnrollmentConsentResponse"}}}]}}}}}},"post":{"tags":["Settings/Face"],"summary":"Face Enrollment Consent 설정","description":"얼굴 등록 동의/철회. Admin 권한 필요.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FaceEnrollmentConsentRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FaceEnrollmentConsentResponse"}}}]}}}}}}},"/settings/face-analytics-consent":{"get":{"tags":["Settings/Face"],"summary":"Face Analytics Consent 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FaceAnalyticsConsentResponse"}}}]}}}}}},"post":{"tags":["Settings/Face"],"summary":"Face Analytics Consent 설정","description":"얼굴 분석 동의/철회. Admin 권한 필요.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FaceAnalyticsConsentRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FaceAnalyticsConsentResponse"}}}]}}}}}}},"/settings/face":{"get":{"tags":["Settings/Face"],"summary":"Face Settings 조회","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FaceSettingsInfo"}}}]}}}}}},"put":{"tags":["Settings/Face"],"summary":"Face Settings 수정","description":"변경할 필드만 전송. capabilities에서 허용 값 범위 확인 필요.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutFaceSettingsRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FaceSettingsInfo"}}}]}}}}}}}}}