{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coldrig-dev/json-schema/coldrig-dev-dashboard-view-update-input-schema.json",
  "title": "DashboardViewUpdateInput",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coldrig-dev-dashboard-api-openapi.yml#/components/schemas/DashboardViewUpdateInput",
  "type": "object",
  "required": [
    "rev",
    "layout"
  ],
  "properties": {
    "rev": {
      "type": "integer",
      "minimum": 1,
      "description": "Must match the view's current rev (rev-CAS)."
    },
    "layout": {
      "$ref": "#/$defs/DashboardLayout"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Optional rename; omit to leave unchanged."
    },
    "note": {
      "type": "string",
      "maxLength": 2000
    }
  },
  "$defs": {
    "DashboardLayout": {
      "type": "object",
      "required": [
        "schemaVersion",
        "widgets"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "enum": [
            1
          ]
        },
        "widgets": {
          "type": "array",
          "maxItems": 50,
          "items": {
            "type": "object",
            "required": [
              "id",
              "type",
              "gridPos",
              "visible",
              "props"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "type": {
                "type": "string",
                "enum": [
                  "kpi_row",
                  "mailbox_health",
                  "campaign_performance",
                  "activity_feed",
                  "inbox_preview",
                  "agent_log",
                  "agent_note",
                  "quota_usage"
                ]
              },
              "gridPos": {
                "type": "object",
                "required": [
                  "x",
                  "y",
                  "w",
                  "h"
                ],
                "properties": {
                  "x": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 11
                  },
                  "y": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  },
                  "w": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12
                  },
                  "h": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 20
                  }
                }
              },
              "visible": {
                "type": "boolean",
                "default": true
              },
              "props": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    }
  }
}