{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/percia-ai/json-schema/percia-ai-camera-schema.json",
  "title": "Camera",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/percia-ai-openapi.yml#/components/schemas/Camera",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "enum": [
        "phone",
        "push",
        "link",
        "file"
      ],
      "description": "phone = paired by link; push = a connector on a LAN pushes WHIP with a token; link = a public RTSP/RTSPS/HTTP/HTTPS address Percia pulls itself; file = an uploaded video, played once. link and file exist while PULL_CAMERAS is on."
    },
    "pull": {
      "type": "object",
      "description": "link and file cameras only: the last report of the puller. Never an address.",
      "properties": {
        "state": {
          "enum": [
            "running",
            "done",
            "failed",
            null
          ]
        },
        "reason": {
          "enum": [
            "unreachable",
            "auth",
            "private_address",
            "unsupported_codec",
            "keyframe_interval",
            "timeout",
            "other",
            null
          ]
        }
      }
    },
    "deviceKind": {
      "enum": [
        "phone",
        "tablet",
        "computer",
        null
      ],
      "description": "What device a paired camera is, when the browser that made it said so; null for older cameras and for push cameras. Wording only."
    },
    "externalId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The connector's own id for a push camera."
    },
    "status": {
      "enum": [
        "online",
        "offline",
        "never"
      ],
      "description": "online = heartbeat or an allowed publish under 60 s ago."
    },
    "lastSeenAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "watchCount": {
      "type": "integer"
    }
  }
}