{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/everypage-co/json-schema/everypage-co-variant-update-schema.json",
  "title": "VariantUpdate",
  "description": "All fields optional; omitted fields keep their current value. One exception in granularity: `overrides`, when present, REPLACES the stored override set as a whole object - it is never merged key by key. Send every override you want to keep: `{\"overrides\": {\"allowDownload\": true}}` also removes a stored `pageRange` override, `{\"overrides\": {}}` removes all overrides, and only omitting `overrides` entirely leaves the stored set untouched.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/everypage-co-variants-api-openapi.yml#/components/schemas/VariantUpdate",
  "type": "object",
  "properties": {
    "label": {
      "type": "string",
      "maxLength": 200,
      "description": "New label; empty string clears it. Rejected (409) on a redacted variant."
    },
    "overrides": {
      "$ref": "#/$defs/VariantOverrides"
    },
    "revoked": {
      "type": "boolean",
      "description": "true revokes (viewers get 404), false un-revokes."
    }
  },
  "$defs": {
    "PageRange": {
      "type": "object",
      "description": "A non-owner page window, 1-based and inclusive. `{\"from\":0,\"to\":0}` is the explicit \"no range\" value (clears the file-level range; as a variant override it serves the full document through that variant).\n",
      "properties": {
        "from": {
          "type": "integer",
          "minimum": 0,
          "description": "First shared page (1-based)."
        },
        "to": {
          "type": "integer",
          "minimum": 0,
          "maximum": 20000,
          "description": "Last shared page (inclusive; must be >= from)."
        }
      }
    },
    "VariantOverrides": {
      "type": "object",
      "description": "Per-variant setting overrides applied to viewers arriving through this variant. Omitted keys inherit the file's settings. On update the object is stored exactly as sent (whole-object replace, never a per-key merge).",
      "properties": {
        "allowDownload": {
          "type": "boolean",
          "description": "Override the file's explicit-download permission for this variant's viewers."
        },
        "pageRange": {
          "allOf": [
            {
              "$ref": "#/$defs/PageRange"
            }
          ],
          "description": "Override the file-level page range for this variant's viewers: a valid pair (1 <= from <= to; file at most 100MB) replaces the file's range outright, and the explicit `{\"from\":0,\"to\":0}` serves the FULL document through this variant even when the file has a range. Omitted, the file-level range (if any) applies. The variant-effective window is what the variant's public metadata advertises and what its viewers' bytes are trimmed to; like the file-level range it keeps enforcing after a Pro downgrade.\n"
        }
      }
    }
  }
}