K-Lens

GET /kcam/cameras

List cameras

Returns the list of cameras Frigate has provisioned, with detect/record/audio toggles and live FPS counters.

Status Codes:
Response JSON Object:
  • [] (object)

POST /kcam/cameras/probe

Probe a camera (ONVIF)

Runs a unicast ONVIF Profile S probe (12s deadline) to discover device info + RTSP stream profiles. Credentials are never echoed back.

Request JSON Object:
  • ip (string) – (required)

  • password (string) – (required)

  • username (string) – (required)

Status Codes:
Response JSON Object:
  • firmware_version (string)

  • hardware_id (string)

  • main_stream_url (string)

  • manufacturer (string)

  • model (string)

  • profiles[].codec (string)

  • profiles[].framerate (integer)

  • profiles[].height (integer)

  • profiles[].name (string)

  • profiles[].token (string)

  • profiles[].uri (string) – URI is the RTSP URL with user/pass injected so callers can hand it directly to go2rtc / ffmpeg.

  • profiles[].width (integer)

  • serial_number (string)

  • sub_stream_url (string)

POST /kcam/cameras/{id}/audio

Toggle camera audio detection

Flips YAMNet audio detection at runtime.

Parameters:
  • id (string) – Camera id

Request JSON Object:
  • enabled (boolean)

Status Codes:
POST /kcam/cameras/{id}/detect

Toggle camera detection

Flips detect at runtime; in-memory only. Frigate auto-enables motion when detect goes on.

Parameters:
  • id (string) – Camera id

Request JSON Object:
  • enabled (boolean)

Status Codes:
GET /kcam/cameras/{id}/latest

Latest camera snapshot (jpeg)

Streams the most recent processed frame as image/jpeg.

Parameters:
  • id (string) – Camera id

Status Codes:
GET /kcam/cameras/{id}/live

Live MSE WebSocket

Bridges the browser’s MSE-over-WS connection to Frigate’s go2rtc /live/mse/api/ws using the camera substream. Live quality is capped at the substream resolution.

Parameters:
  • id (string) – Camera id

Status Codes:
POST /kcam/cameras/{id}/motion

Toggle camera motion detection

Flips motion at runtime. Frigate refuses to disable motion while detect is on.

Parameters:
  • id (string) – Camera id

Request JSON Object:
  • enabled (boolean)

Status Codes:
GET /kcam/cameras/{id}/preview-frames

List preview frames (per-second webp)

Parameters:
  • id (string) – Camera id

Query Parameters:
  • after (number) – Window start (unix seconds)

  • before (number) – Window end (unix seconds)

Status Codes:
Response JSON Object:
  • [] (string)

GET /kcam/cameras/{id}/previews

List preview clips (per hour)

Returns Frigate’s hourly preview metadata; treats Frigate’s “no previews found” 404 as an empty 200 so the SPA can fall back to /preview-frames.

Parameters:
  • id (string) – Camera id

Query Parameters:
  • after (number) – Window start (unix seconds)

  • before (number) – Window end (unix seconds)

Status Codes:
Response JSON Object:
  • [] (object)

POST /kcam/cameras/{id}/recording

Toggle camera recording

Flips record.enabled at runtime. Frigate restarts to apply, dropping the live stream for ~30s; the toggle returns immediately.

Parameters:
  • id (string) – Camera id

Request JSON Object:
  • enabled (boolean)

Status Codes:
GET /kcam/cameras/{id}/recording/clip

Recording clip

Streams a concatenated MP4 covering [start, end] unix-seconds. Pass download=1 to send Content-Disposition: attachment (capped at 30 minutes).

Parameters:
  • id (string) – Camera id

Query Parameters:
  • start (number) – Range start (unix seconds)

  • end (number) – Range end (unix seconds)

  • download (string) – Set to 1 to force browser-download with attachment header

Status Codes:
GET /kcam/cameras/{id}/recording/hls/{path}

Recording HLS proxy

Proxies /cameras/{id}/recording/hls/* to Frigate’s /vod/{id}/<rest> so .m3u8 relative segment URLs resolve back here.

Parameters:
  • id (string) – Camera id

Status Codes:
GET /kcam/cameras/{id}/recording/segments

Recording segments

Returns the 10s segment list (start/end_time, motion, objects) inside the [after, before] unix-seconds window.

Parameters:
  • id (string) – Camera id

Query Parameters:
  • after (number) – Window start (unix seconds)

  • before (number) – Window end (unix seconds)

Status Codes:
Response JSON Object:
  • [] (object)

GET /kcam/cameras/{id}/recording/summary

Recording summary

Returns per-day / per-hour recording availability for a camera. Pass the IANA timezone so day buckets match the user’s wall clock.

Parameters:
  • id (string) – Camera id

Query Parameters:
  • timezone (string) – IANA timezone, e.g. America/New_York

Status Codes:
Response JSON Object:
  • [] (object)

GET /kcam/cameras/{id}/webrtc

Live WebRTC signaling

Bridges WebRTC SDP/ICE signaling to Frigate’s go2rtc /live/webrtc/api/ws. Media flows browser ↔ go2rtc directly after negotiation.

Parameters:
  • id (string) – Camera id

Status Codes:
GET /kcam/clips/{path}

Get a /clips file

Proxies Frigate’s nginx /clips/* tree. Range header is forwarded.

Parameters:
  • path (string) – Path under /clips/

Status Codes:
DELETE /kcam/current

Delete current K-Lens

Tear down the K-Lens VM, GPU offering, and CloudStack records. Rejected with 409 while still in Creating state.

Status Codes:
Response JSON Object:
  • instance_id (string)

  • message (string)

  • state (string)

GET /kcam/current

Get current K-Lens instance

Returns the singleton K-Lens deployment row, or 200 + null when none exists. The SPA polls this to choose between InitForm and dashboard.

Status Codes:
Response JSON Object:
  • admin_password_acknowledged (boolean)

  • camera_ip (string)

  • cores (integer)

  • created_at (string)

  • error_message (string)

  • frigate_admin_password (string)

  • frigate_version (string)

  • gpu_count (integer)

  • id (string)

  • memory_mb (integer)

  • name (string)

  • network_id (string)

  • state (string)

  • vm_id (string)

  • vm_ip_address (string)

  • zone_id (string)

POST /kcam/current/admin-password

Change Frigate admin password

Rotates the persistent Frigate admin credential and persists the new value. Frigate invalidates the current JWT on success.

Request JSON Object:
  • new_password (string) – (required)

Status Codes:
POST /kcam/current/admin-password/ack

Acknowledge first-boot Frigate password

Records that the operator has noted Frigate’s auto-generated first-boot admin password. Idempotent.

Status Codes:
POST /kcam/current/admin-password/verify

Verify Frigate admin password

Validates a user-supplied password against Frigate’s /api/login without polluting the persistent client cookie jar; persists it on success.

Request JSON Object:
  • password (string) – (required)

Status Codes:
GET /kcam/events

List events

Returns the filtered event feed. Backend caps at limit=500. Pass include_thumbnails=1 only when needed; thumbs inflate response size.

Query Parameters:
  • limit (integer) – Max rows (capped at 500)

  • after (number) – Window start (unix seconds)

  • before (number) – Window end (unix seconds)

  • cameras (string) – Comma-separated camera names

  • labels (string) – Comma-separated labels (person, car, …)

  • zones (string) – Comma-separated zone names

  • has_snapshot (string) – 1 to require a snapshot, 0 to exclude

  • has_clip (string) – 1 to require a clip

  • include_thumbnails (string) – 1 to include base64 thumbs

Status Codes:
Response JSON Object:
  • [] (object)

GET /kcam/events/stream

Events WebSocket

Bridges the SPA WebSocket to Frigate’s /ws topic feed (events, state changes).

Status Codes:
DELETE /kcam/events/{id}

Delete event

Parameters:
  • id (string) – Event id

Status Codes:
GET /kcam/events/{id}

Get event

Parameters:
  • id (string) – Event id

Status Codes:
GET /kcam/events/{id}/clip

Event clip (mp4)

Parameters:
  • id (string) – Event id

Status Codes:
GET /kcam/events/{id}/snapshot

Event snapshot (jpeg)

Parameters:
  • id (string) – Event id

Status Codes:
GET /kcam/events/{id}/thumbnail

Event thumbnail

Lower-resolution thumbnail; covers in-progress events where snapshot.jpg returns 404.

Parameters:
  • id (string) – Event id

Status Codes:
GET /kcam/faces

List faces

Returns Frigate’s face library: { name: [filename, …] }.

Status Codes:
DELETE /kcam/faces/{name}

Delete a face person bucket

Parameters:
  • name (string) – Person name

Status Codes:
POST /kcam/faces/{name}

Upload face image

Uploads a face image (max 10 MiB) to the named person bucket as multipart/form-data with field “file”.

Parameters:
  • name (string) – Person name

Status Codes:
POST /kcam/faces/{name}/classify

Train (label) a face from the train bucket

Promotes an image in Frigate’s faces/train/ bucket to the named person.

Parameters:
  • name (string) – Person name

Request JSON Object:
  • training_file (string) – (required)

Status Codes:
POST /kcam/faces/{name}/create

Create face person bucket

Parameters:
  • name (string) – Person name

Status Codes:
DELETE /kcam/faces/{name}/{filename}

Delete a face image

Parameters:
  • name (string) – Person name

  • filename (string) – Face image filename

Status Codes:
POST /kcam/initialize

Initialize K-Lens

Provision the singleton K-Lens VM (Frigate NVR + camera) for this Karios instance. Idempotent: returns 409 if one already exists.

Request JSON Object:
  • audio_stream_url (string)

  • camera_ip (string) – (required)

  • camera_manufacturer (string)

  • camera_model (string)

  • cores (integer) – (required)

  • gpu_count (integer) – (required)

  • main_stream_url (string) – RTSP URLs resolved by the InitForm. When empty the cloud-init template falls back to Hikvision-style /Streaming/Channels paths.

  • memory_mb (integer) – (required)

  • network_id (string) – (required)

  • password (string) – (required)

  • recording_disk_gb (integer) – (required)

  • sub_stream_url (string)

  • username (string) – (required)

  • vgpu_profile_id (string) – (required)

Status Codes:
Response JSON Object:
  • instance_id (string)

  • message (string)

  • state (string)

GET /kcam/preview-frames/{filename}

Get preview frame (webp)

Parameters:
  • filename (string) – Preview-frame filename

Status Codes:
GET /kcam/review

List review segments

Returns review segments (alerts, detections, significant_motion) inside an optional [after, before] window. Backend caps at limit=500.

Query Parameters:
  • limit (integer) – Max rows (capped at 500)

  • after (number) – Window start (unix seconds)

  • before (number) – Window end (unix seconds)

  • cameras (string) – Comma-separated camera names

  • labels (string) – Comma-separated labels

  • zones (string) – Comma-separated zones

  • severity (string) – alert | detection | significant_motion

  • reviewed (string) – 0 = unreviewed, 1 = reviewed

Status Codes:
Response JSON Object:
  • [] (object)

GET /kcam/review/activity/motion

Motion activity

Returns the motion-energy time series for the timeline waveform. scale=15 = one bucket per timeline segment.

Query Parameters:
  • after (number) – Window start (unix seconds)

  • before (number) – Window end (unix seconds)

  • scale (integer) – Bucket size in seconds (default 30, min 15)

  • cameras (string) – Comma-separated camera names

Status Codes:
Response JSON Object:
  • [] (object)

POST /kcam/reviews/viewed

Mark review segments reviewed

Request JSON Object:
  • ids[] (string)

  • reviewed (boolean)

Status Codes:
GET /kcam/stats

Frigate stats

Per-detector / per-process / per-storage stats from Frigate /api/stats.

Status Codes:
GET /kcam/template

K-Lens template status

Returns the registration / download state of the K-Lens Frigate template in this zone.

Status Codes:
Response JSON Object:
  • message (string)

  • progress (integer) – 0..100 only when downloading

  • state (string) – missing | downloading | ready | failed

  • template_id (string)

  • template_name (string)

  • zone_id (string)

POST /kcam/template

Register K-Lens template

Idempotent. The download runs async on secondary storage; callers poll GetTemplateStatus for progress.

Status Codes:
Response JSON Object:
  • message (string)

  • progress (integer) – 0..100 only when downloading

  • state (string) – missing | downloading | ready | failed

  • template_id (string)

  • template_name (string)

  • zone_id (string)