{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kaitoi-io/json-schema/kaitoi-io-public-template-run-create-request-schema.json",
  "title": "PublicTemplateRunCreateRequest",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kaitoi-io-openapi.json#/components/schemas/PublicTemplateRunCreateRequest",
  "properties": {
    "inputs": {
      "additionalProperties": {
        "anyOf": [
          {
            "oneOf": [
              {
                "$ref": "#/$defs/PublicRunFileInput"
              },
              {
                "$ref": "#/$defs/PublicRunStringInput"
              },
              {
                "$ref": "#/$defs/PublicRunNumberInput"
              },
              {
                "$ref": "#/$defs/PublicRunBooleanInput"
              },
              {
                "$ref": "#/$defs/PublicRunJsonInput"
              },
              {
                "$ref": "#/$defs/PublicRunNullInput"
              }
            ]
          },
          {
            "type": "string"
          },
          {
            "type": "integer"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "additionalProperties": true,
            "type": "object"
          },
          {
            "items": {},
            "type": "array"
          },
          {
            "type": "null"
          }
        ]
      },
      "type": "object",
      "title": "Inputs",
      "description": "Input values keyed by exposed endpoint fieldName. File inputs should use {\"type\":\"file\",\"fileId\":\"...\"}; primitive values may use typed wrappers or direct JSON values."
    },
    "externalId": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 512
        },
        {
          "type": "null"
        }
      ],
      "title": "Externalid"
    },
    "externalUserId": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 512
        },
        {
          "type": "null"
        }
      ],
      "title": "Externaluserid",
      "description": "Developer end-user guard. Referenced files with externalUserId must match this value."
    },
    "externalWorkspaceId": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 512
        },
        {
          "type": "null"
        }
      ],
      "title": "Externalworkspaceid"
    },
    "outputs": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 200,
          "minItems": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Outputs",
      "description": "Output fieldNames to make. The run makes only these outputs and the nodes that feed them, and returns only these. Leave it out to make every output."
    },
    "fromTaskId": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Fromtaskid",
      "description": "taskId of an earlier succeeded run of this endpoint to build on. Its results are put back instead of made again, so the nodes that only fed them do not run or spend credits again, and inputs that only feed them are ignored. The run must be the same owner's, from the last 24 hours and from the template as it is now; with an externalUserId, it must also have been made for that externalUserId."
    }
  },
  "type": "object",
  "$defs": {
    "PublicRunBooleanInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "boolean",
          "title": "Type"
        },
        "value": {
          "type": "boolean",
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "title": "PublicRunBooleanInput"
    },
    "PublicRunFileInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "file",
          "title": "Type",
          "description": "Input value is a REST API file reference."
        },
        "fileId": {
          "type": "string",
          "title": "Fileid",
          "description": "REST API file id returned by file upload completion."
        }
      },
      "type": "object",
      "required": [
        "type",
        "fileId"
      ],
      "title": "PublicRunFileInput"
    },
    "PublicRunJsonInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "json",
          "title": "Type"
        },
        "value": {
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "title": "PublicRunJsonInput"
    },
    "PublicRunNullInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "null",
          "title": "Type"
        },
        "value": {
          "type": "null",
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type"
      ],
      "title": "PublicRunNullInput"
    },
    "PublicRunNumberInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "number",
          "title": "Type"
        },
        "value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            }
          ],
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "title": "PublicRunNumberInput"
    },
    "PublicRunStringInput": {
      "properties": {
        "type": {
          "type": "string",
          "const": "string",
          "title": "Type"
        },
        "value": {
          "type": "string",
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "title": "PublicRunStringInput"
    }
  }
}