{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/kontaktio/main/json-schema/kontaktio-occupancy-image-schema.json",
  "title": "OccupancyImage",
  "description": "Occupancy image taken from occupancy-capable device.",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kontaktio-device-portal-beam-api-openapi.yml#/components/schemas/OccupancyImage",
  "type": "object",
  "x-stoplight": {
    "id": "blcpt1fqfd6zh"
  },
  "properties": {
    "captured": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when image was captured. If present in POST request, will be accounted for, otherwise defaults to now()"
    },
    "raw": {
      "type": "string",
      "format": "byte",
      "description": "Raw Base64-encoded bytes received from device."
    },
    "content": {
      "type": "string",
      "format": "byte",
      "description": "Base64-encoded PNG image."
    },
    "calibration": {
      "type": "string",
      "format": "byte",
      "description": "Base64-encoded calibration mask received from device."
    },
    "recognitionBoxes": {
      "type": "array",
      "description": "Objects recognized as humans by occupancy model on the device.",
      "items": {
        "allOf": [
          {
            "$ref": "#/$defs/Polygon"
          }
        ]
      }
    }
  },
  "$defs": {
    "Polygon": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "polygon": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "x": {
                "type": "integer"
              },
              "y": {
                "type": "integer"
              }
            }
          }
        }
      }
    }
  }
}