{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/foundplay-io/json-schema/foundplay-io-update-macro-request-schema.json",
  "title": "UpdateMacroRequest",
  "description": "Patch a macro — name, type, command, scope, image or folder; omitted fields stay unchanged. **`folder_id` is tri-state** (same pattern as folders.parent_id):\n\n- omit both `folder_id` and `clear_folder` → don't touch the folder\n- `folder_id: \"abc\"` → move into that folder (folder ID, NOT name)\n- `clear_folder: true` → move to root (Foundry: folder=null)\n\nCross-field rule: setting BOTH `folder_id` and `clear_folder: true` returns 422. Script macros (the macro is, or becomes, `type: script`) need the module setting **Allow Script Macros** (409 otherwise).",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/foundplay-io-openapi.json#/components/schemas/UpdateMacroRequest",
  "properties": {
    "clear_folder": {
      "default": false,
      "description": "Move the macro to the root. Mutually exclusive with `folder_id`. Default false.",
      "type": "boolean"
    },
    "command": {
      "minLength": 1,
      "type": "string"
    },
    "folder_id": {
      "description": "New folder ID (NOT name). Mutually exclusive with `clear_folder: true`.",
      "minLength": 1,
      "type": "string"
    },
    "img": {
      "minLength": 1,
      "type": "string"
    },
    "name": {
      "minLength": 1,
      "type": "string"
    },
    "scope": {
      "description": "Macro scope — see MacroScope.",
      "enum": [
        "global",
        "actors",
        "actor"
      ],
      "type": "string"
    },
    "type": {
      "description": "Macro type — see MacroType.",
      "enum": [
        "chat",
        "script"
      ],
      "type": "string"
    }
  },
  "type": "object"
}