{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudinary/json-schema/cloudinary-video-canvas-applet-content-payload-schema.json",
  "title": "VideoCanvasAppletContentPayload",
  "description": "The full content of a Video Canvas applet: its inputs, blocks,\nconnections, and outputs. The blocks are ordered by the connections and\ntheir action-group content is compiled to validate it. For derived\napplets, the result is saved as a Cloudinary named transformation;\ncreate applets don't get one.\n",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudinary-video-openapi.yml#/components/schemas/VideoCanvasAppletContentPayload",
  "type": "object",
  "required": [
    "name",
    "blocks"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "A display name for the applet."
    },
    "description": {
      "type": "string",
      "description": "An optional description of what the applet does."
    },
    "kind": {
      "type": "string",
      "description": "Applet kind. Derived applets compile into a named transformation; create applets do not. Omit on update to keep the current kind. Switching to create leaves an existing named transformation as is; switching to derived creates or redefines it.",
      "enum": [
        "derived",
        "create"
      ],
      "default": "derived"
    },
    "inputs": {
      "type": "array",
      "description": "The applet's declared parameters.",
      "items": {
        "$ref": "#/$defs/VideoCanvasInputPayload"
      }
    },
    "blocks": {
      "type": "array",
      "description": "The nodes on the canvas.",
      "items": {
        "$ref": "#/$defs/VideoCanvasBlockPayload"
      }
    },
    "connections": {
      "type": "array",
      "description": "The directed edges between block ports.",
      "items": {
        "$ref": "#/$defs/VideoCanvasConnectionPayload"
      }
    },
    "outputs": {
      "type": "array",
      "description": "The applet's declared results.",
      "items": {
        "$ref": "#/$defs/VideoCanvasOutputPayload"
      }
    }
  },
  "$defs": {
    "VideoCanvasBlockMetadata": {
      "type": "object",
      "description": "Editor state of a block",
      "additionalProperties": false,
      "required": [
        "position_x",
        "position_y"
      ],
      "properties": {
        "position_x": {
          "type": "number",
          "format": "double"
        },
        "position_y": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "VideoCanvasBlockPayload": {
      "type": "object",
      "description": "A node on the canvas. Most blocks are action groups; a kind ending in\n`_input` or `_output` marks a boundary block, and `preview_node` marks a\npreview tap.\n",
      "required": [
        "id",
        "kind",
        "metadata"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Client-supplied id, unique within the applet."
        },
        "kind": {
          "type": "string",
          "description": "Either a special type or the name of a group of actions, and it\ndetermines how `content` is read. Special types: a kind ending in\n`_input` or `_output` is a boundary block (content is an\n`{\"input\":...}`/`{\"output\":...}` reference) and `preview_node` is a\npreview tap (no content). Any other value is an action group whose\ncontent is an array of serializer actions; the exact string (e.g.\n`group`) only names the actions for the UI and has no backend role\nbeyond that grouping.\n"
        },
        "content": {
          "description": "For an action group, an ordered array of serializer action items\n(opaque to this service), e.g. `[{\"actionType\":\"scale\",\"dimensions\":{\"width\":200}}]`.\nThe groups are concatenated in connection order and encoded into a\nCloudinary transformation. The action item format (actionType and its\nfields) is defined by the JSON Schema at\nhttps://production-transformations-bff.cloudinary.com/schemas/transformation.json.\nFor an input boundary block (kind ending in `_input`) it references a\ndeclared input (`{\"input\":\"<inputId>\"}`); for an output boundary block\n(kind ending in `_output`) a declared output (`{\"output\":\"<outputId>\"}`).\n"
        },
        "metadata": {
          "$ref": "#/$defs/VideoCanvasBlockMetadata"
        }
      }
    },
    "VideoCanvasConnectionPayload": {
      "type": "object",
      "description": "A directed edge between two block ports. Endpoints reference blocks by\ntheir client-supplied id. Connections define the order in which action\ngroups are applied.\n",
      "required": [
        "id",
        "source_block_id",
        "source_port_id",
        "target_block_id",
        "target_port_id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Client-supplied id, unique within the applet."
        },
        "source_block_id": {
          "type": "string",
          "description": "Client-supplied id of the source block."
        },
        "source_port_id": {
          "type": "string",
          "description": "The output port on the source block."
        },
        "target_block_id": {
          "type": "string",
          "description": "Client-supplied id of the target block."
        },
        "target_port_id": {
          "type": "string",
          "description": "The input port on the target block."
        }
      }
    },
    "VideoCanvasInputPayload": {
      "type": "object",
      "description": "A declared parameter of the applet. Its id can be referenced by the serializer inline as `$<id>`.",
      "required": [
        "id",
        "kind",
        "state"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Client-supplied id. Must match `^[a-zA-Z_][a-zA-Z0-9_]*$` and be at most 64 characters."
        },
        "kind": {
          "type": "string",
          "description": "The value type of the input.",
          "enum": [
            "video",
            "image",
            "text"
          ]
        },
        "state": {
          "type": "string",
          "description": "How the caller supplies the value. `required` means the caller must provide it, `optional` uses `value` as an overridable default, and `hidden` bakes `value` in and does not expose it to callers.",
          "enum": [
            "required",
            "optional",
            "hidden"
          ]
        },
        "value": {
          "type": "string",
          "description": "The default (for `optional`) or fixed (for `hidden`) value."
        },
        "label": {
          "type": "string",
          "description": "A human-readable label for the input."
        }
      }
    },
    "VideoCanvasOutputPayload": {
      "type": "object",
      "description": "A declared result of the applet.",
      "required": [
        "id",
        "kind"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Client-supplied id, unique within the applet."
        },
        "kind": {
          "type": "string",
          "description": "The type of the result.",
          "enum": [
            "image",
            "video",
            "video_player",
            "raw"
          ]
        },
        "label": {
          "type": "string",
          "description": "A human-readable label for the output."
        }
      }
    }
  }
}