{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/figma/json-schema/figma-variable-change-schema.json",
  "title": "VariableChange",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/figma-variables-api-openapi.yml#/components/schemas/VariableChange",
  "oneOf": [
    {
      "$ref": "#/$defs/VariableCreate"
    },
    {
      "$ref": "#/$defs/VariableUpdate"
    },
    {
      "$ref": "#/$defs/VariableDelete"
    }
  ],
  "$defs": {
    "VariableCodeSyntax": {
      "type": "object",
      "description": "An object containing platform-specific code syntax definitions for a variable. All platforms are optional.",
      "properties": {
        "WEB": {
          "type": "string"
        },
        "ANDROID": {
          "type": "string"
        },
        "iOS": {
          "type": "string"
        }
      }
    },
    "VariableCreate": {
      "type": "object",
      "description": "An object that contains details about creating a `Variable`.",
      "properties": {
        "action": {
          "type": "string",
          "description": "The action to perform for the variable.",
          "enum": [
            "CREATE"
          ]
        },
        "id": {
          "type": "string",
          "description": "A temporary id for this variable."
        },
        "name": {
          "type": "string",
          "description": "The name of this variable."
        },
        "variableCollectionId": {
          "type": "string",
          "description": "The variable collection that will contain the variable. You can use the temporary id of a variable collection."
        },
        "resolvedType": {
          "$ref": "#/$defs/VariableResolvedDataType",
          "description": "The resolved type of the variable."
        },
        "description": {
          "type": "string",
          "description": "The description of this variable."
        },
        "hiddenFromPublishing": {
          "type": "boolean",
          "description": "Whether this variable is hidden when publishing the current file as a library.",
          "default": false
        },
        "scopes": {
          "type": "array",
          "description": "An array of scopes in the UI where this variable is shown. Setting this property will show/hide this variable in the variable picker UI for different fields.",
          "items": {
            "$ref": "#/$defs/VariableScope"
          }
        },
        "codeSyntax": {
          "$ref": "#/$defs/VariableCodeSyntax"
        }
      },
      "required": [
        "action",
        "name",
        "variableCollectionId",
        "resolvedType"
      ]
    },
    "VariableDelete": {
      "type": "object",
      "description": "An object that contains details about deleting a `Variable`.",
      "properties": {
        "action": {
          "type": "string",
          "description": "The action to perform for the variable.",
          "enum": [
            "DELETE"
          ]
        },
        "id": {
          "type": "string",
          "description": "The id of the variable to delete."
        }
      },
      "required": [
        "action",
        "id"
      ]
    },
    "VariableResolvedDataType": {
      "type": "string",
      "description": "Defines the types of data a VariableData object can eventually equal",
      "enum": [
        "BOOLEAN",
        "FLOAT",
        "STRING",
        "COLOR"
      ]
    },
    "VariableScope": {
      "type": "string",
      "enum": [
        "ALL_SCOPES",
        "TEXT_CONTENT",
        "CORNER_RADIUS",
        "WIDTH_HEIGHT",
        "GAP",
        "ALL_FILLS",
        "FRAME_FILL",
        "SHAPE_FILL",
        "TEXT_FILL",
        "STROKE_COLOR",
        "STROKE_FLOAT",
        "EFFECT_FLOAT",
        "EFFECT_COLOR",
        "OPACITY",
        "COLOR_OPACITY",
        "FONT_FAMILY",
        "FONT_STYLE",
        "FONT_WEIGHT",
        "FONT_SIZE",
        "LINE_HEIGHT",
        "LETTER_SPACING",
        "PARAGRAPH_SPACING",
        "PARAGRAPH_INDENT",
        "FONT_VARIATIONS"
      ],
      "description": "Scopes allow a variable to be shown or hidden in the variable picker for various fields. This declutters the Figma UI if you have a large number of variables. Variable scopes are currently supported on `FLOAT`, `STRING`, and `COLOR` variables.\n\n`ALL_SCOPES` is a special scope that means that the variable will be shown in the variable picker for all variable fields. If `ALL_SCOPES` is set, no additional scopes can be set.\n\n`ALL_FILLS` is a special scope that means that the variable will be shown in the variable picker for all fill fields. If `ALL_FILLS` is set, no additional fill scopes can be set.\n\nValid scopes for `FLOAT` variables:\n- `ALL_SCOPES`\n- `TEXT_CONTENT`\n- `WIDTH_HEIGHT`\n- `GAP`\n- `STROKE_FLOAT`\n- `EFFECT_FLOAT`\n- `OPACITY`\n- `COLOR_OPACITY`\n- `FONT_WEIGHT`\n- `FONT_SIZE`\n- `LINE_HEIGHT`\n- `LETTER_SPACING`\n- `PARAGRAPH_SPACING`\n- `PARAGRAPH_INDENT`\n\n`OPACITY` corresponds to layer opacity, while `COLOR_OPACITY` corresponds to the opacity channel of a color.\n\nValid scopes for `STRING` variables:\n- `ALL_SCOPES`\n- `TEXT_CONTENT`\n- `FONT_FAMILY`\n- `FONT_STYLE`\n\nValid scopes for `COLOR` variables:\n- `ALL_SCOPES`\n- `ALL_FILLS`\n- `FRAME_FILL`\n- `SHAPE_FILL`\n- `TEXT_FILL`\n- `STROKE_COLOR`\n- `EFFECT_COLOR`"
    },
    "VariableUpdate": {
      "type": "object",
      "description": "An object that contains details about updating a `Variable`.",
      "properties": {
        "action": {
          "type": "string",
          "description": "The action to perform for the variable.",
          "enum": [
            "UPDATE"
          ]
        },
        "id": {
          "type": "string",
          "description": "The id of the variable to update."
        },
        "name": {
          "type": "string",
          "description": "The name of this variable."
        },
        "description": {
          "type": "string",
          "description": "The description of this variable."
        },
        "hiddenFromPublishing": {
          "type": "boolean",
          "description": "Whether this variable is hidden when publishing the current file as a library.",
          "default": false
        },
        "scopes": {
          "type": "array",
          "description": "An array of scopes in the UI where this variable is shown. Setting this property will show/hide this variable in the variable picker UI for different fields.",
          "items": {
            "$ref": "#/$defs/VariableScope"
          }
        },
        "codeSyntax": {
          "$ref": "#/$defs/VariableCodeSyntax"
        }
      },
      "required": [
        "action",
        "id"
      ]
    }
  }
}