{
  "components": {
    "schemas": {
      "AITask": {
        "properties": {
          "actions": {
            "additionalProperties": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "readOnly": true,
            "type": "object"
          },
          "configuration": {
            "$ref": "#/components/schemas/Configuration"
          },
          "createDate": {
            "format": "date",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "description_i18n": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "enabled": {
            "type": "boolean"
          },
          "externalReferenceCode": {
            "example": "AB-34098-789-N",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "modifiedDate": {
            "format": "date",
            "type": "string"
          },
          "readOnly": {
            "type": "boolean"
          },
          "schemaVersion": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "title_i18n": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "version": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AITaskRequest": {
        "properties": {
          "input": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "AITaskResponse": {
        "properties": {
          "executionTrace": {
            "type": "object"
          },
          "output": {
            "type": "object"
          },
          "took": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Condition": {
        "properties": {
          "in": {
            "properties": {
              "field": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "value": {
                "type": "object"
              }
            },
            "type": "object"
          },
          "allConditions": {
            "items": {
              "$ref": "#/components/schemas/Condition"
            },
            "type": "array"
          },
          "anyConditions": {
            "items": {
              "$ref": "#/components/schemas/Condition"
            },
            "type": "array"
          },
          "contains": {
            "properties": {
              "field": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "value": {
                "type": "object"
              }
            },
            "type": "object"
          },
          "equals": {
            "properties": {
              "field": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "value": {
                "type": "object"
              }
            },
            "type": "object"
          },
          "exists": {
            "properties": {
              "field": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "not": {
            "$ref": "#/components/schemas/Condition"
          },
          "range": {
            "properties": {
              "field": {
                "type": "string"
              },
              "gt": {
                "type": "object"
              },
              "gte": {
                "type": "object"
              },
              "id": {
                "type": "string"
              },
              "lt": {
                "type": "object"
              },
              "lte": {
                "type": "object"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "Configuration": {
        "properties": {
          "edges": {
            "items": {
              "$ref": "#/components/schemas/Edge"
            },
            "type": "array"
          },
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/Node"
            },
            "type": "array"
          },
          "trace": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Edge": {
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "uiConfiguration": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "Node": {
        "properties": {
          "condition": {
            "$ref": "#/components/schemas/Condition"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "parameters": {
            "type": "object"
          },
          "type": {
            "type": "string"
          },
          "uiConfiguration": {
            "type": "object"
          }
        },
        "type": "object"
      }
    }
  },
  "info": {
    "description": "AI Tasks REST API",
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "title": "AI Tasks REST",
    "version": "v1.0"
  },
  "openapi": "3.0.1",
  "paths": {
    "/generate/{externalReferenceCode}": {
      "post": {
        "description": "TBD",
        "operationId": "postGenerateExternalReferenceCode",
        "parameters": [
          {
            "in": "path",
            "description": "The chat configuration external reference code.",
            "name": "externalReferenceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AITaskRequest"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/AITaskRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AITaskResponse"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/AITaskResponse"
                }
              }
            }
          }
        },
        "tags": [
          "AITaskResponse"
        ]
      }
    },
    "/stream/{externalReferenceCode}": {
      "post": {
        "description": "TBD",
        "operationId": "postStreamExternalReferenceCode",
        "parameters": [
          {
            "in": "path",
            "description": "The chat configuration external reference code.",
            "name": "externalReferenceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AITaskRequest"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/AITaskRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "application/xml": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            }
          }
        },
        "tags": [
          "AITaskResponse"
        ]
      }
    },
    "/ai-tasks": {
      "get": {
        "operationId": "getAITasksPage",
        "parameters": [
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AITask"
                  },
                  "type": "array"
                }
              },
              "application/xml": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AITask"
                  },
                  "type": "array"
                }
              }
            }
          }
        },
        "tags": [
          "AITask"
        ]
      },
      "post": {
        "operationId": "postAITask",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AITask"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/AITask"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              }
            }
          }
        },
        "tags": [
          "AITask"
        ]
      }
    },
    "/ai-tasks/by-external-reference-code/{externalReferenceCode}": {
      "get": {
        "operationId": "getAITaskByExternalReferenceCode",
        "parameters": [
          {
            "in": "path",
            "name": "externalReferenceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              }
            }
          }
        },
        "tags": [
          "AITask"
        ]
      },
      "put": {
        "operationId": "putAITaskByExternalReferenceCode",
        "parameters": [
          {
            "in": "path",
            "name": "externalReferenceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AITask"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/AITask"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              }
            }
          }
        },
        "tags": [
          "AITask"
        ]
      }
    },
    "/ai-tasks/by-external-reference-code/{externalReferenceCode}/clear-memory": {
      "post": {
        "operationId": "postAITaskByExternalReferenceCodeClear",
        "parameters": [
          {
            "in": "path",
            "name": "externalReferenceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "nodeId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {},
            "description": "No Content"
          }
        },
        "tags": [
          "AITask"
        ]
      }
    },
    "/ai-tasks/validate": {
      "post": {
        "operationId": "postAITaskValidate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "string"
              }
            },
            "application/xml": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              }
            }
          }
        },
        "tags": [
          "AITask"
        ]
      }
    },
    "/ai-tasks/{aiTaskId}": {
      "delete": {
        "operationId": "deleteAITask",
        "parameters": [
          {
            "in": "path",
            "name": "aiTaskId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {},
              "application/xml": {}
            }
          }
        },
        "tags": [
          "AITask"
        ]
      },
      "get": {
        "operationId": "getAITask",
        "parameters": [
          {
            "in": "path",
            "name": "aiTaskId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              }
            }
          }
        },
        "tags": [
          "AITask"
        ]
      },
      "patch": {
        "operationId": "patchAITask",
        "parameters": [
          {
            "in": "path",
            "name": "aiTaskId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AITask"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/AITask"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              }
            }
          }
        },
        "tags": [
          "AITask"
        ]
      },
      "put": {
        "operationId": "putAITask",
        "parameters": [
          {
            "in": "path",
            "name": "aiTaskId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AITask"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/AITask"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              }
            }
          }
        },
        "tags": [
          "AITask"
        ]
      }
    },
    "/ai-tasks/{aiTaskId}/copy": {
      "post": {
        "operationId": "postAITaskCopy",
        "parameters": [
          {
            "in": "path",
            "name": "aiTaskId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/AITask"
                }
              }
            }
          }
        },
        "tags": [
          "AITask"
        ]
      }
    },
    "/ai-tasks/{aiTaskId}/export": {
      "get": {
        "operationId": "getAITaskExport",
        "parameters": [
          {
            "in": "path",
            "name": "aiTaskId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "application/xml": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "tags": [
          "AITask"
        ]
      }
    }
  }
}