{
  "openapi": "3.0.3",
  "info": {
    "version": "1.304.2",
    "title": "Windmill API",
    "contact": {
      "name": "Windmill Team",
      "email": "contact@windmill.dev",
      "url": "https://windmill.dev"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "x-logo": {
      "url": "https://windmill.dev/img/windmill.svg"
    }
  },
  "externalDocs": {
    "description": "documentation portal",
    "url": "https://windmill.dev"
  },
  "servers": [
    {
      "url": "/api"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "cookieAuth": []
    }
  ],
  "paths": {
    "/version": {
      "get": {
        "summary": "get backend version",
        "operationId": "backendVersion",
        "tags": [
          "settings"
        ],
        "responses": {
          "200": {
            "description": "git version of backend",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/uptodate": {
      "get": {
        "summary": "is backend up to date",
        "operationId": "backendUptodate",
        "tags": [
          "settings"
        ],
        "responses": {
          "200": {
            "description": "is backend up to date",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/ee_license": {
      "get": {
        "summary": "get license id",
        "operationId": "getLicenseId",
        "tags": [
          "settings"
        ],
        "responses": {
          "200": {
            "description": "get license id (empty if not ee)",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.yaml": {
      "get": {
        "summary": "get openapi yaml spec",
        "operationId": "getOpenApiYaml",
        "tags": [
          "settings"
        ],
        "responses": {
          "200": {
            "description": "openapi yaml file content",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/audit/get/{id}": {
      "get": {
        "summary": "get audit log (requires admin privilege)",
        "operationId": "getAuditLog",
        "tags": [
          "audit"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/PathId"
          }
        ],
        "responses": {
          "200": {
            "description": "an audit log",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLog"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/audit/list": {
      "get": {
        "summary": "list audit logs (requires admin privilege)",
        "operationId": "listAuditLogs",
        "tags": [
          "audit"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "$ref": "#/components/parameters/Before"
          },
          {
            "$ref": "#/components/parameters/After"
          },
          {
            "$ref": "#/components/parameters/Username"
          },
          {
            "$ref": "#/components/parameters/Operation"
          },
          {
            "$ref": "#/components/parameters/ResourceName"
          },
          {
            "$ref": "#/components/parameters/ActionKind"
          }
        ],
        "responses": {
          "200": {
            "description": "a list of audit logs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AuditLog"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/login": {
      "post": {
        "security": [],
        "summary": "login with password",
        "operationId": "login",
        "tags": [
          "user"
        ],
        "requestBody": {
          "description": "credentials",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Login"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully authenticated. The session ID is returned in a cookie named `token` and as plaintext response. Preferred method of authorization is through the bearer token. The cookie is only for browser convenience.\n",
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "type": "string",
                  "example": "token=abcde12345; Path=/; HttpOnly"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "security": [],
        "summary": "logout",
        "operationId": "logout",
        "tags": [
          "user"
        ],
        "responses": {
          "200": {
            "description": "clear cookies and clear token (if applicable)",
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/users/{username}": {
      "get": {
        "summary": "get user (require admin privilege)",
        "operationId": "getUser",
        "tags": [
          "user",
          "admin"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "username",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "user created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/users/update/{username}": {
      "post": {
        "summary": "update user (require admin privilege)",
        "operationId": "updateUser",
        "tags": [
          "user",
          "admin"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "username",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "new user",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditWorkspaceUser"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "edited user",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/users/is_owner/{path}": {
      "get": {
        "summary": "is owner of path",
        "operationId": "isOwnerOfPath",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "is owner",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/users/setpassword": {
      "post": {
        "summary": "set password",
        "operationId": "setPassword",
        "tags": [
          "user"
        ],
        "requestBody": {
          "description": "set password",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "password set",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/create": {
      "post": {
        "summary": "create user",
        "operationId": "createUserGlobally",
        "tags": [
          "user"
        ],
        "requestBody": {
          "description": "user info",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "super_admin": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "company": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "password",
                  "super_admin"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "user created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/update/{email}": {
      "post": {
        "summary": "global update user (require super admin)",
        "operationId": "globalUserUpdate",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "new user info",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "is_super_admin": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "user updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/username_info/{email}": {
      "get": {
        "summary": "global username info (require super admin)",
        "operationId": "globalUsernameInfo",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "user renamed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "username": {
                      "type": "string"
                    },
                    "workspace_usernames": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "workspace_id": {
                            "type": "string"
                          },
                          "username": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "workspace_id",
                          "username"
                        ]
                      }
                    }
                  },
                  "required": [
                    "username",
                    "workspace_usernames"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/users/rename/{email}": {
      "post": {
        "summary": "global rename user (require super admin)",
        "operationId": "globalUserRename",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "new username",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "new_username": {
                    "type": "string"
                  }
                },
                "required": [
                  "new_username"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "user renamed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/delete/{email}": {
      "delete": {
        "summary": "global delete user (require super admin)",
        "operationId": "globalUserDelete",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "user deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/users/delete/{username}": {
      "delete": {
        "summary": "delete user (require admin privilege)",
        "operationId": "deleteUser",
        "tags": [
          "user",
          "admin"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "username",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "delete user",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/list": {
      "get": {
        "summary": "list all workspaces visible to me",
        "operationId": "listWorkspaces",
        "tags": [
          "workspace"
        ],
        "responses": {
          "200": {
            "description": "all workspaces",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Workspace"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/allowed_domain_auto_invite": {
      "get": {
        "summary": "is domain allowed for auto invi",
        "operationId": "isDomainAllowed",
        "tags": [
          "workspace"
        ],
        "responses": {
          "200": {
            "description": "domain allowed or not",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/users": {
      "get": {
        "summary": "list all workspaces visible to me with user info",
        "operationId": "listUserWorkspaces",
        "tags": [
          "workspace"
        ],
        "responses": {
          "200": {
            "description": "workspace with associated username",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWorkspaceList"
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/list_as_superadmin": {
      "get": {
        "summary": "list all workspaces as super admin (require to be super admin)",
        "operationId": "listWorkspacesAsSuperAdmin",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "workspaces",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Workspace"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/create": {
      "post": {
        "summary": "create workspace",
        "operationId": "createWorkspace",
        "tags": [
          "workspace"
        ],
        "requestBody": {
          "description": "new token",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkspace"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "token created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/exists": {
      "post": {
        "summary": "exists workspace",
        "operationId": "existsWorkspace",
        "tags": [
          "workspace"
        ],
        "requestBody": {
          "description": "id of workspace",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/exists_username": {
      "post": {
        "summary": "exists username",
        "operationId": "existsUsername",
        "tags": [
          "workspace"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "username": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "username"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/settings/global/{key}": {
      "get": {
        "summary": "get global settings",
        "operationId": "getGlobal",
        "tags": [
          "setting"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Key"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "post": {
        "summary": "post global settings",
        "operationId": "setGlobal",
        "tags": [
          "setting"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Key"
          }
        ],
        "requestBody": {
          "description": "value set",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/settings/local": {
      "get": {
        "summary": "get local settings",
        "operationId": "getLocal",
        "tags": [
          "setting"
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/settings/test_smtp": {
      "post": {
        "summary": "test smtp",
        "operationId": "testSmtp",
        "tags": [
          "setting"
        ],
        "requestBody": {
          "description": "test smtp payload",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string"
                  },
                  "smtp": {
                    "type": "object",
                    "properties": {
                      "host": {
                        "type": "string"
                      },
                      "username": {
                        "type": "string"
                      },
                      "password": {
                        "type": "string"
                      },
                      "port": {
                        "type": "integer"
                      },
                      "from": {
                        "type": "string"
                      },
                      "tls_implicit": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "host",
                      "username",
                      "password",
                      "port",
                      "from",
                      "tls_implicit"
                    ]
                  }
                },
                "required": [
                  "to",
                  "smtp"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/settings/test_license_key": {
      "post": {
        "summary": "test license key",
        "operationId": "testLicenseKey",
        "tags": [
          "setting"
        ],
        "requestBody": {
          "description": "test license key",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "license_key": {
                    "type": "string"
                  }
                },
                "required": [
                  "license_key"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/settings/test_object_storage_config": {
      "post": {
        "summary": "test object storage config",
        "operationId": "testObjectStorageConfig",
        "tags": [
          "setting"
        ],
        "requestBody": {
          "description": "test object storage config",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/settings/send_stats": {
      "post": {
        "summary": "send stats",
        "operationId": "sendStats",
        "tags": [
          "setting"
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/saml/test_metadata": {
      "post": {
        "summary": "test metadata",
        "operationId": "testMetadata",
        "tags": [
          "setting"
        ],
        "requestBody": {
          "description": "test metadata",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/email": {
      "get": {
        "summary": "get current user email (if logged in)",
        "operationId": "getCurrentEmail",
        "tags": [
          "user"
        ],
        "responses": {
          "200": {
            "description": "user email",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/refresh_token": {
      "get": {
        "summary": "refresh the current token",
        "operationId": "refreshUserToken",
        "tags": [
          "user"
        ],
        "responses": {
          "200": {
            "description": "free usage",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/tutorial_progress": {
      "get": {
        "summary": "get tutorial progress",
        "operationId": "getTutorialProgress",
        "tags": [
          "user"
        ],
        "responses": {
          "200": {
            "description": "tutorial progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "progress": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "update tutorial progress",
        "operationId": "updateTutorialProgress",
        "tags": [
          "user"
        ],
        "requestBody": {
          "description": "progress update",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "progress": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "tutorial progress",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/leave_instance": {
      "post": {
        "summary": "leave instance",
        "operationId": "leaveInstance",
        "tags": [
          "user"
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/usage": {
      "get": {
        "summary": "get current usage outside of premium workspaces",
        "operationId": "getUsage",
        "tags": [
          "user"
        ],
        "responses": {
          "200": {
            "description": "free usage",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "number"
                }
              }
            }
          }
        }
      }
    },
    "/users/all_runnables": {
      "get": {
        "summary": "get all runnables in every workspace",
        "operationId": "getRunnable",
        "tags": [
          "user"
        ],
        "responses": {
          "200": {
            "description": "free all runnables",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspace": {
                      "type": "string"
                    },
                    "endpoint_async": {
                      "type": "string"
                    },
                    "endpoint_sync": {
                      "type": "string"
                    },
                    "endpoint_openai_sync": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "workspace",
                    "endpoint_async",
                    "endpoint_sync",
                    "endpoint_openai_sync",
                    "summary",
                    "kind"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/users/whoami": {
      "get": {
        "summary": "get current global whoami (if logged in)",
        "operationId": "globalWhoami",
        "tags": [
          "user"
        ],
        "responses": {
          "200": {
            "description": "user email",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalUserInfo"
                }
              }
            }
          }
        }
      }
    },
    "/users/list_invites": {
      "get": {
        "summary": "list all workspace invites",
        "operationId": "listWorkspaceInvites",
        "tags": [
          "user"
        ],
        "responses": {
          "200": {
            "description": "list all workspace invites",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceInvite"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/users/whoami": {
      "get": {
        "summary": "whoami",
        "operationId": "whoami",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          }
        }
      }
    },
    "/users/accept_invite": {
      "post": {
        "summary": "accept invite to workspace",
        "operationId": "acceptInvite",
        "tags": [
          "user"
        ],
        "requestBody": {
          "description": "accept invite",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string"
                  },
                  "username": {
                    "type": "string"
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/decline_invite": {
      "post": {
        "summary": "decline invite to workspace",
        "operationId": "declineInvite",
        "tags": [
          "user"
        ],
        "requestBody": {
          "description": "decline invite",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/invite_user": {
      "post": {
        "summary": "invite user to workspace",
        "operationId": "inviteUser",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "WorkspaceInvite",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "is_admin": {
                    "type": "boolean"
                  },
                  "operator": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "email",
                  "is_admin",
                  "operator"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/add_user": {
      "post": {
        "summary": "add user to workspace",
        "operationId": "addUser",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "WorkspaceInvite",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "is_admin": {
                    "type": "boolean"
                  },
                  "username": {
                    "type": "string"
                  },
                  "operator": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "email",
                  "is_admin",
                  "operator"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/delete_invite": {
      "post": {
        "summary": "delete user invite",
        "operationId": "delete invite",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "WorkspaceInvite",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "is_admin": {
                    "type": "boolean"
                  },
                  "operator": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "email",
                  "is_admin",
                  "operator"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/archive": {
      "post": {
        "summary": "archive workspace",
        "operationId": "archiveWorkspace",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/unarchive/{workspace}": {
      "post": {
        "summary": "unarchive workspace",
        "operationId": "unarchiveWorkspace",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/delete/{workspace}": {
      "delete": {
        "summary": "delete workspace (require super admin)",
        "operationId": "deleteWorkspace",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/leave": {
      "post": {
        "summary": "leave workspace",
        "operationId": "leaveWorkspace",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/get_workspace_name": {
      "get": {
        "summary": "get workspace name",
        "operationId": "getWorkspaceName",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/change_workspace_name": {
      "post": {
        "summary": "change workspace name",
        "operationId": "changeWorkspaceName",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "new_name": {
                    "type": "string"
                  }
                },
                "required": [
                  "username"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/change_workspace_id": {
      "post": {
        "summary": "change workspace id",
        "operationId": "changeWorkspaceId",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "new_id": {
                    "type": "string"
                  },
                  "new_name": {
                    "type": "string"
                  }
                },
                "required": [
                  "username"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/users/whois/{username}": {
      "get": {
        "summary": "whois",
        "operationId": "whois",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "username",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          }
        }
      }
    },
    "/users/exists/{email}": {
      "get": {
        "summary": "exists email",
        "operationId": "existsEmail",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/users/list_as_super_admin": {
      "get": {
        "summary": "list all users as super admin (require to be super amdin)",
        "operationId": "listUsersAsSuperAdmin",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GlobalUserInfo"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/list_pending_invites": {
      "get": {
        "summary": "list pending invites for a workspace",
        "operationId": "listPendingInvites",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceInvite"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/get_settings": {
      "get": {
        "summary": "get settings",
        "operationId": "getSettings",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspace_id": {
                      "type": "string"
                    },
                    "slack_name": {
                      "type": "string"
                    },
                    "slack_team_id": {
                      "type": "string"
                    },
                    "slack_command_script": {
                      "type": "string"
                    },
                    "auto_invite_domain": {
                      "type": "string"
                    },
                    "auto_invite_operator": {
                      "type": "boolean"
                    },
                    "auto_add": {
                      "type": "boolean"
                    },
                    "plan": {
                      "type": "string"
                    },
                    "automatic_billing": {
                      "type": "boolean"
                    },
                    "customer_id": {
                      "type": "string"
                    },
                    "webhook": {
                      "type": "string"
                    },
                    "deploy_to": {
                      "type": "string"
                    },
                    "openai_resource_path": {
                      "type": "string"
                    },
                    "code_completion_enabled": {
                      "type": "boolean"
                    },
                    "error_handler": {
                      "type": "string"
                    },
                    "error_handler_extra_args": {
                      "$ref": "#/components/schemas/ScriptArgs"
                    },
                    "error_handler_muted_on_cancel": {
                      "type": "boolean"
                    },
                    "large_file_storage": {
                      "$ref": "#/components/schemas/LargeFileStorage"
                    },
                    "git_sync": {
                      "$ref": "#/components/schemas/WorkspaceGitSyncSettings"
                    },
                    "default_app": {
                      "type": "string"
                    },
                    "default_scripts": {
                      "$ref": "#/components/schemas/WorkspaceDefaultScripts"
                    }
                  },
                  "required": [
                    "code_completion_enabled",
                    "automatic_billing",
                    "error_handler_muted_on_cancel"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/get_deploy_to": {
      "get": {
        "summary": "get deploy to",
        "operationId": "getDeployTo",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deploy_to": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/is_premium": {
      "get": {
        "summary": "get if workspace is premium",
        "operationId": "getIsPremium",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/premium_info": {
      "get": {
        "summary": "get premium info",
        "operationId": "getPremiumInfo",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "premium": {
                      "type": "boolean"
                    },
                    "usage": {
                      "type": "number"
                    },
                    "seats": {
                      "type": "number"
                    },
                    "automatic_billing": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "premium",
                    "automatic_billing"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/set_automatic_billing": {
      "post": {
        "summary": "set automatic billing",
        "operationId": "setAutomaticBilling",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "automatic billing",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "automatic_billing": {
                    "type": "boolean"
                  },
                  "seats": {
                    "type": "number"
                  }
                },
                "required": [
                  "automatic_billing"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/edit_slack_command": {
      "post": {
        "summary": "edit slack command",
        "operationId": "editSlackCommand",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "WorkspaceInvite",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slack_command_script": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/run_slack_message_test_job": {
      "post": {
        "summary": "run a job that sends a message to Slack",
        "operationId": "runSlackMessageTestJob",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "path to hub script to run and its corresponding args",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hub_script_path": {
                    "type": "string"
                  },
                  "channel": {
                    "type": "string"
                  },
                  "test_msg": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_uuid": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/edit_deploy_to": {
      "post": {
        "summary": "edit deploy to",
        "operationId": "editDeployTo",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deploy_to": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/edit_auto_invite": {
      "post": {
        "summary": "edit auto invite",
        "operationId": "editAutoInvite",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "WorkspaceInvite",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "operator": {
                    "type": "boolean"
                  },
                  "invite_all": {
                    "type": "boolean"
                  },
                  "auto_add": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/edit_webhook": {
      "post": {
        "summary": "edit webhook",
        "operationId": "editWebhook",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "WorkspaceWebhook",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "webhook": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/edit_copilot_config": {
      "post": {
        "summary": "edit copilot config",
        "operationId": "editCopilotConfig",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "WorkspaceCopilotConfig",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code_completion_enabled"
                ],
                "properties": {
                  "openai_resource_path": {
                    "type": "string"
                  },
                  "code_completion_enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/get_copilot_info": {
      "get": {
        "summary": "get copilot info",
        "operationId": "getCopilotInfo",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "exists_openai_resource_path": {
                      "type": "boolean"
                    },
                    "code_completion_enabled": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "exists_openai_resource_path",
                    "code_completion_enabled"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/edit_error_handler": {
      "post": {
        "summary": "edit error handler",
        "operationId": "editErrorHandler",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "WorkspaceErrorHandler",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "error_handler": {
                    "type": "string"
                  },
                  "error_handler_extra_args": {
                    "$ref": "#/components/schemas/ScriptArgs"
                  },
                  "error_handler_muted_on_cancel": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/edit_large_file_storage_config": {
      "post": {
        "summary": "edit large file storage settings",
        "operationId": "editLargeFileStorageConfig",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "LargeFileStorage info",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "large_file_storage": {
                    "$ref": "#/components/schemas/LargeFileStorage"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/edit_git_sync_config": {
      "post": {
        "summary": "edit workspace git sync settings",
        "operationId": "editWorkspaceGitSyncConfig",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "Workspace Git sync settings",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "git_sync_settings": {
                    "$ref": "#/components/schemas/WorkspaceGitSyncSettings"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/edit_default_app": {
      "post": {
        "summary": "edit default app for workspace",
        "operationId": "editWorkspaceDefaultApp",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "Workspace default app",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "default_app_path": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/default_scripts": {
      "post": {
        "summary": "edit default scripts for workspace",
        "operationId": "editDefaultScripts",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "Workspace default app",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceDefaultScripts"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "get default scripts for workspace",
        "operationId": "get default scripts",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceDefaultScripts"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/set_environment_variable": {
      "post": {
        "summary": "set environment variable",
        "operationId": "setEnvironmentVariable",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "Workspace default app",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/encryption_key": {
      "get": {
        "summary": "retrieves the encryption key for this workspace",
        "operationId": "getWorkspaceEncryptionKey",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "key"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "update the encryption key for this workspace",
        "operationId": "setWorkspaceEncryptionKey",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "New encryption key",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "new_key": {
                    "type": "string"
                  }
                },
                "required": [
                  "new_key"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/default_app": {
      "get": {
        "summary": "get default app for workspace",
        "operationId": "getWorkspaceDefaultApp",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "default_app_path": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/get_large_file_storage_config": {
      "get": {
        "summary": "get large file storage config",
        "operationId": "getLargeFileStorageConfig",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LargeFileStorage"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/workspaces/usage": {
      "get": {
        "summary": "get usage",
        "operationId": "getWorkspaceUsage",
        "tags": [
          "workspace"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "usage",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "number"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/users/list": {
      "get": {
        "summary": "list users",
        "operationId": "listUsers",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/User"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/users/list_usage": {
      "get": {
        "summary": "list users usage",
        "operationId": "listUsersUsage",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserUsage"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/users/list_usernames": {
      "get": {
        "summary": "list usernames",
        "operationId": "listUsernames",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users/tokens/create": {
      "post": {
        "summary": "create token",
        "operationId": "createToken",
        "tags": [
          "user"
        ],
        "requestBody": {
          "description": "new token",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewToken"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "token created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/tokens/impersonate": {
      "post": {
        "summary": "create token to impersonate a user (require superadmin)",
        "operationId": "createTokenImpersonate",
        "tags": [
          "user"
        ],
        "requestBody": {
          "description": "new token",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewTokenImpersonate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "token created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/tokens/delete/{token_prefix}": {
      "delete": {
        "summary": "delete token",
        "operationId": "deleteToken",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "name": "token_prefix",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "delete token",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/users/tokens/list": {
      "get": {
        "summary": "list token",
        "operationId": "listTokens",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "name": "exclude_ephemeral",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "truncated token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TruncatedToken"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/oidc/token/{audience}": {
      "post": {
        "summary": "get OIDC token (ee only)",
        "operationId": "getOidcToken",
        "tags": [
          "oidc"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "audience",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "new oidc token",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/variables/create": {
      "post": {
        "summary": "create variable",
        "operationId": "createVariable",
        "tags": [
          "variable"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "already_encrypted",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "description": "new variable",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVariable"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "variable created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/variables/encrypt": {
      "post": {
        "summary": "encrypt value",
        "operationId": "encryptValue",
        "tags": [
          "variable"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "new variable",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "encrypted value",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/variables/delete/{path}": {
      "delete": {
        "summary": "delete variable",
        "operationId": "deleteVariable",
        "tags": [
          "variable"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "variable deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/variables/update/{path}": {
      "post": {
        "summary": "update variable",
        "operationId": "updateVariable",
        "tags": [
          "variable"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          },
          {
            "name": "already_encrypted",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "description": "updated variable",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditVariable"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "variable updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/variables/get/{path}": {
      "get": {
        "summary": "get variable",
        "operationId": "getVariable",
        "tags": [
          "variable"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          },
          {
            "name": "decrypt_secret",
            "description": "ask to decrypt secret if this variable is secret\n(if not secret no effect, default: true)\n",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_encrypted",
            "description": "ask to include the encrypted value if secret and decrypt secret is not true (default: false)\n",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "variable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListableVariable"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/variables/get_value/{path}": {
      "get": {
        "summary": "get variable value",
        "operationId": "getVariableValue",
        "tags": [
          "variable"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "variable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/variables/exists/{path}": {
      "get": {
        "summary": "does variable exists at path",
        "operationId": "existsVariable",
        "tags": [
          "variable"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "variable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/variables/list": {
      "get": {
        "summary": "list variables",
        "operationId": "listVariable",
        "tags": [
          "variable"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "variable list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ListableVariable"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/variables/list_contextual": {
      "get": {
        "summary": "list contextual variables",
        "operationId": "listContextualVariables",
        "tags": [
          "variable"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "contextual variable list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContextualVariable"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oauth/login_callback/{client_name}": {
      "post": {
        "security": [],
        "summary": "login with oauth authorization flow",
        "operationId": "loginWithOauth",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ClientName"
          }
        ],
        "requestBody": {
          "description": "Partially filled script",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully authenticated. The session ID is returned in a cookie named `token` and as plaintext response. Preferred method of authorization is through the bearer token. The cookie is only for browser convenience.\n",
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "type": "string",
                  "example": "token=abcde12345; Path=/; HttpOnly"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/oauth/connect_slack_callback": {
      "post": {
        "summary": "connect slack callback",
        "operationId": "connectSlackCallback",
        "tags": [
          "oauth"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "code endpoint",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "state"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "slack token",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/connect_callback/{client_name}": {
      "post": {
        "summary": "connect callback",
        "operationId": "connectCallback",
        "tags": [
          "oauth"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ClientName"
          }
        ],
        "requestBody": {
          "description": "code endpoint",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "state"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "oauth token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/oauth/create_account": {
      "post": {
        "summary": "create OAuth account",
        "operationId": "createAccount",
        "tags": [
          "oauth"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "code endpoint",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "refresh_token": {
                    "type": "string"
                  },
                  "expires_in": {
                    "type": "integer"
                  },
                  "client": {
                    "type": "string"
                  }
                },
                "required": [
                  "expires_in",
                  "client"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "account set",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/oauth/refresh_token/{id}": {
      "post": {
        "summary": "refresh token",
        "operationId": "refreshToken",
        "tags": [
          "oauth"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/AccountId"
          }
        ],
        "requestBody": {
          "description": "variable path",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  }
                },
                "required": [
                  "path"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "token refreshed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/oauth/disconnect/{id}": {
      "post": {
        "summary": "disconnect account",
        "operationId": "disconnectAccount",
        "tags": [
          "oauth"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/AccountId"
          }
        ],
        "responses": {
          "200": {
            "description": "disconnected client",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/oauth/disconnect_slack": {
      "post": {
        "summary": "disconnect slack",
        "operationId": "disconnectSlack",
        "tags": [
          "oauth"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "disconnected slack",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/list_logins": {
      "get": {
        "summary": "list oauth logins",
        "operationId": "listOAuthLogins",
        "tags": [
          "oauth"
        ],
        "responses": {
          "200": {
            "description": "list of oauth and saml login clients",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "oauth": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "saml": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "oauth"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/oauth/list_connects": {
      "get": {
        "summary": "list oauth connects",
        "operationId": "listOAuthConnects",
        "tags": [
          "oauth"
        ],
        "responses": {
          "200": {
            "description": "list of oauth connects clients",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "extra_params": {
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "scopes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/create": {
      "post": {
        "summary": "create resource",
        "operationId": "createResource",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "update_if_exists",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "description": "new resource",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateResource"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "resource created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/delete/{path}": {
      "delete": {
        "summary": "delete resource",
        "operationId": "deleteResource",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "resource deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/update/{path}": {
      "post": {
        "summary": "update resource",
        "operationId": "updateResource",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "requestBody": {
          "description": "updated resource",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditResource"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "resource updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/update_value/{path}": {
      "post": {
        "summary": "update resource value",
        "operationId": "updateResourceValue",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "requestBody": {
          "description": "updated resource",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "resource value updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/get/{path}": {
      "get": {
        "summary": "get resource",
        "operationId": "getResource",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Resource"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/get_value_interpolated/{path}": {
      "get": {
        "summary": "get resource interpolated (variables and resources are fully unrolled)",
        "operationId": "getResourceValueInterpolated",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          },
          {
            "name": "job_id",
            "description": "job id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "resource value",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/get_value/{path}": {
      "get": {
        "summary": "get resource value",
        "operationId": "getResourceValue",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "resource value",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/exists/{path}": {
      "get": {
        "summary": "does resource exists",
        "operationId": "existsResource",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "does resource exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/list": {
      "get": {
        "summary": "list resources",
        "operationId": "listResource",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "resource_type",
            "description": "resource_types to list from, separated by ',',",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource_type_exclude",
            "description": "resource_types to not list from, separated by ',',",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "resource list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ListableResource"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/list_search": {
      "get": {
        "summary": "list resources for search",
        "operationId": "listSearchResource",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "resource list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string"
                      },
                      "value": {}
                    },
                    "required": [
                      "path",
                      "value"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/list_names/{name}": {
      "get": {
        "summary": "list resource names",
        "operationId": "listResourceNames",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "resource list names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name",
                      "path"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/type/create": {
      "post": {
        "summary": "create resource_type",
        "operationId": "createResourceType",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "new resource_type",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResourceType"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "resource_type created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/type/delete/{path}": {
      "delete": {
        "summary": "delete resource_type",
        "operationId": "deleteResourceType",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "resource_type deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/type/update/{path}": {
      "post": {
        "summary": "update resource_type",
        "operationId": "updateResourceType",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "requestBody": {
          "description": "updated resource_type",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditResourceType"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "resource_type updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/type/get/{path}": {
      "get": {
        "summary": "get resource_type",
        "operationId": "getResourceType",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "resource_type deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceType"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/type/exists/{path}": {
      "get": {
        "summary": "does resource_type exists",
        "operationId": "existsResourceType",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "does resource_type exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/type/list": {
      "get": {
        "summary": "list resource_types",
        "operationId": "listResourceType",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "resource_type list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ResourceType"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/resources/type/listnames": {
      "get": {
        "summary": "list resource_types names",
        "operationId": "listResourceTypeNames",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "resource_type list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/embeddings/query_resource_types": {
      "get": {
        "summary": "query resource types by similarity",
        "operationId": "queryResourceTypes",
        "tags": [
          "resource"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "text",
            "description": "query text",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "description": "query limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "resource type details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "score": {
                        "type": "number"
                      },
                      "schema": {}
                    },
                    "required": [
                      "name",
                      "score"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/integrations/hub/list": {
      "get": {
        "summary": "list hub integrations",
        "operationId": "listHubIntegrations",
        "tags": [
          "integration"
        ],
        "parameters": [
          {
            "name": "kind",
            "description": "query integrations kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "integrations details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/flows/hub/list": {
      "get": {
        "summary": "list all hub flows",
        "operationId": "listHubFlows",
        "tags": [
          "flow"
        ],
        "responses": {
          "200": {
            "description": "hub flows list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "flows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "flow_id": {
                            "type": "number"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "apps": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "approved": {
                            "type": "boolean"
                          },
                          "votes": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "flow_id",
                          "summary",
                          "apps",
                          "approved",
                          "votes"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/flows/hub/get/{id}": {
      "get": {
        "summary": "get hub flow by id",
        "operationId": "getHubFlowById",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ],
        "responses": {
          "200": {
            "description": "flow",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "flow": {
                      "$ref": "#/components/schemas/OpenFlow"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/apps/hub/list": {
      "get": {
        "summary": "list all hub apps",
        "operationId": "listHubApps",
        "tags": [
          "app"
        ],
        "responses": {
          "200": {
            "description": "hub apps list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "app_id": {
                            "type": "number"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "apps": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "approved": {
                            "type": "boolean"
                          },
                          "votes": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "app_id",
                          "summary",
                          "apps",
                          "approved",
                          "votes"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/apps/hub/get/{id}": {
      "get": {
        "summary": "get hub app by id",
        "operationId": "getHubAppById",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ],
        "responses": {
          "200": {
            "description": "app",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "object",
                      "properties": {
                        "summary": {
                          "type": "string"
                        },
                        "value": {}
                      },
                      "required": [
                        "summary",
                        "value"
                      ]
                    }
                  },
                  "required": [
                    "app"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/scripts/hub/get/{path}": {
      "get": {
        "summary": "get hub script content by path",
        "operationId": "getHubScriptContentByPath",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "script details",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/scripts/hub/get_full/{path}": {
      "get": {
        "summary": "get full hub script by path",
        "operationId": "getHubScriptByPath",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "script details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "string"
                    },
                    "lockfile": {
                      "type": "string"
                    },
                    "schema": {},
                    "language": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "content",
                    "language"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/scripts/hub/top": {
      "get": {
        "summary": "get top hub scripts",
        "operationId": "getTopHubScripts",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "name": "limit",
            "description": "query limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "app",
            "description": "query scripts app",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "description": "query scripts kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "hub scripts list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "asks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "ask_id": {
                            "type": "number"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "app": {
                            "type": "string"
                          },
                          "version_id": {
                            "type": "number"
                          },
                          "kind": {
                            "$ref": "#/components/schemas/HubScriptKind"
                          },
                          "votes": {
                            "type": "number"
                          },
                          "views": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "ask_id",
                          "summary",
                          "app",
                          "version_id",
                          "kind",
                          "views",
                          "votes"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/embeddings/query_hub_scripts": {
      "get": {
        "summary": "query hub scripts by similarity",
        "operationId": "queryHubScripts",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "name": "text",
            "description": "query text",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "description": "query scripts kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "description": "query limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "app",
            "description": "query scripts app",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "script details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "ask_id": {
                        "type": "number"
                      },
                      "id": {
                        "type": "number"
                      },
                      "version_id": {
                        "type": "number"
                      },
                      "summary": {
                        "type": "string"
                      },
                      "app": {
                        "type": "string"
                      },
                      "kind": {
                        "$ref": "#/components/schemas/HubScriptKind"
                      },
                      "score": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "ask_id",
                      "id",
                      "version_id",
                      "summary",
                      "app",
                      "kind",
                      "score"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/list_search": {
      "get": {
        "summary": "list scripts for search",
        "operationId": "listSearchScript",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "script list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string"
                      },
                      "content": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "path",
                      "content"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/list": {
      "get": {
        "summary": "list all scripts",
        "operationId": "listScripts",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "$ref": "#/components/parameters/OrderDesc"
          },
          {
            "$ref": "#/components/parameters/CreatedBy"
          },
          {
            "name": "path_start",
            "description": "mask to filter matching starting path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path_exact",
            "description": "mask to filter exact matching path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "first_parent_hash",
            "description": "mask to filter scripts whom first direct parent has exact hash",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "last_parent_hash",
            "description": "mask to filter scripts whom last parent in the chain has exact hash. \nBeware that each script stores only a limited number of parents. Hence\nthe last parent hash for a script is not necessarily its top-most parent.\nTo find the top-most parent you will have to jump from last to last hash\n until finding the parent\n",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "parent_hash",
            "description": "is the hash present in the array of stored parent hashes for this script.\nThe same warning applies than for last_parent_hash. A script only store a\nlimited number of direct parent\n",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "show_archived",
            "description": "(default false)\nshow also the archived files.\nwhen multiple archived hash share the same path, only the ones with the latest create_at\nare \ned.\n",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "is_template",
            "description": "(default regardless)\nif true show only the templates\nif false show only the non templates\nif not defined, show all regardless of if the script is a template\n",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "kinds",
            "description": "(default regardless)\nscript kinds to filter, split by comma\n",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "starred_only",
            "description": "(default false)\nshow only the starred items\n",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "All scripts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Script"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/list_paths": {
      "get": {
        "summary": "list all scripts paths",
        "operationId": "listScriptPaths",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "list of script paths",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/drafts/create": {
      "post": {
        "summary": "create draft",
        "operationId": "createDraft",
        "tags": [
          "draft"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "typ": {
                    "type": "string",
                    "enum": [
                      "flow",
                      "script",
                      "app"
                    ]
                  },
                  "value": {}
                },
                "required": [
                  "path",
                  "typ",
                  "enum"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "draft created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/drafts/delete/{kind}/{path}": {
      "delete": {
        "summary": "delete draft",
        "operationId": "deleteDraft",
        "tags": [
          "draft"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "script",
                "flow",
                "app"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "draft deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/create": {
      "post": {
        "summary": "create script",
        "operationId": "createScript",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "Partially filled script",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewScript"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "script created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/toggle_workspace_error_handler/p/{path}": {
      "post": {
        "summary": "Toggle ON and OFF the workspace error handler for a given script",
        "operationId": "toggleWorkspaceErrorHandlerForScript",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "requestBody": {
          "description": "Workspace error handler enabled",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "muted": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "error handler toggled",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/workers/custom_tags": {
      "get": {
        "summary": "get all instance custom tags (tags are used to dispatch jobs to different worker groups)",
        "operationId": "getCustomTags",
        "tags": [
          "worker"
        ],
        "responses": {
          "200": {
            "description": "list of custom tags",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/workers/get_default_tags": {
      "get": {
        "summary": "get all instance default tags",
        "operationId": "geDefaultTags",
        "tags": [
          "worker"
        ],
        "responses": {
          "200": {
            "description": "list of default tags",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/workers/is_default_tags_per_workspace": {
      "get": {
        "summary": "is default tags per workspace",
        "operationId": "isDefaultTagsPerWorkspace",
        "tags": [
          "worker"
        ],
        "responses": {
          "200": {
            "description": "is the default tags per workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/archive/p/{path}": {
      "post": {
        "summary": "archive script by path",
        "operationId": "archiveScriptByPath",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "script archived",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/archive/h/{hash}": {
      "post": {
        "summary": "archive script by hash",
        "operationId": "archiveScriptByHash",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptHash"
          }
        ],
        "responses": {
          "200": {
            "description": "script details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Script"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/delete/h/{hash}": {
      "post": {
        "summary": "delete script by hash (erase content but keep hash, require admin)",
        "operationId": "deleteScriptByHash",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptHash"
          }
        ],
        "responses": {
          "200": {
            "description": "script details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Script"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/delete/p/{path}": {
      "post": {
        "summary": "delete all scripts at a given path (require admin)",
        "operationId": "deleteScriptByPath",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "script path",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/get/p/{path}": {
      "get": {
        "summary": "get script by path",
        "operationId": "getScriptByPath",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "script details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Script"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/get/draft/{path}": {
      "get": {
        "summary": "get script by path with draft",
        "operationId": "getScriptByPathWithDraft",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "script details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewScriptWithDraft"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/history/p/{path}": {
      "get": {
        "summary": "get history of a script by path",
        "operationId": "getScriptHistoryByPath",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "script history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ScriptHistory"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/history_update/h/{hash}/p/{path}": {
      "post": {
        "summary": "update history of a script",
        "operationId": "updateScriptHistory",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptHash"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "requestBody": {
          "description": "Script deployment message",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deployment_msg": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/raw/p/{path}": {
      "get": {
        "summary": "raw script by path",
        "operationId": "rawScriptByPath",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "script content",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/scripts_u/tokened_raw/{workspace}/{token}/{path}": {
      "get": {
        "summary": "raw script by path with a token (mostly used by lsp to be used with import maps to resolve scripts)",
        "operationId": "rawScriptByPathTokened",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Token"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "script content",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/exists/p/{path}": {
      "get": {
        "summary": "exists script by path",
        "operationId": "existsScriptByPath",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "does it exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/get/h/{hash}": {
      "get": {
        "summary": "get script by hash",
        "operationId": "getScriptByHash",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptHash"
          }
        ],
        "responses": {
          "200": {
            "description": "script details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Script"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/raw/h/{path}": {
      "get": {
        "summary": "raw script by hash",
        "operationId": "rawScriptByHash",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "script content",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/scripts/deployment_status/h/{hash}": {
      "get": {
        "summary": "get script deployment status",
        "operationId": "getScriptDeploymentStatus",
        "tags": [
          "script"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptHash"
          }
        ],
        "responses": {
          "200": {
            "description": "script details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "lock": {
                      "type": "string"
                    },
                    "lock_error_logs": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/run/p/{path}": {
      "post": {
        "summary": "run script by path",
        "operationId": "runScriptByPath",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          },
          {
            "name": "scheduled_for",
            "description": "when to schedule this job (leave empty for immediate run)",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "scheduled_in_secs",
            "description": "schedule the script to execute in the number of seconds starting now",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/ParentJob"
          },
          {
            "$ref": "#/components/parameters/WorkerTag"
          },
          {
            "$ref": "#/components/parameters/CacheTtl"
          },
          {
            "$ref": "#/components/parameters/NewJobId"
          },
          {
            "name": "invisible_to_owner",
            "description": "make the run invisible to the the script owner (default false)",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "description": "script args",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptArgs"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "job created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/openai_sync/p/{path}": {
      "post": {
        "summary": "run script by path in openai format",
        "operationId": "openaiSyncScriptByPath",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          },
          {
            "$ref": "#/components/parameters/ParentJob"
          },
          {
            "$ref": "#/components/parameters/NewJobId"
          },
          {
            "$ref": "#/components/parameters/IncludeHeader"
          },
          {
            "$ref": "#/components/parameters/QueueLimit"
          }
        ],
        "requestBody": {
          "description": "script args",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptArgs"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "job result",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/run_wait_result/p/{path}": {
      "post": {
        "summary": "run script by path",
        "operationId": "runWaitResultScriptByPath",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          },
          {
            "$ref": "#/components/parameters/ParentJob"
          },
          {
            "$ref": "#/components/parameters/WorkerTag"
          },
          {
            "$ref": "#/components/parameters/CacheTtl"
          },
          {
            "$ref": "#/components/parameters/NewJobId"
          },
          {
            "$ref": "#/components/parameters/IncludeHeader"
          },
          {
            "$ref": "#/components/parameters/QueueLimit"
          }
        ],
        "requestBody": {
          "description": "script args",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptArgs"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "job result",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "get": {
        "summary": "run script by path with get",
        "operationId": "runWaitResultScriptByPathGet",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          },
          {
            "$ref": "#/components/parameters/ParentJob"
          },
          {
            "$ref": "#/components/parameters/WorkerTag"
          },
          {
            "$ref": "#/components/parameters/CacheTtl"
          },
          {
            "$ref": "#/components/parameters/NewJobId"
          },
          {
            "$ref": "#/components/parameters/IncludeHeader"
          },
          {
            "$ref": "#/components/parameters/QueueLimit"
          },
          {
            "$ref": "#/components/parameters/Payload"
          }
        ],
        "responses": {
          "200": {
            "description": "job result",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/openai_sync/f/{path}": {
      "post": {
        "summary": "run flow by path and wait until completion in openai format",
        "operationId": "openaiSyncFlowByPath",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          },
          {
            "$ref": "#/components/parameters/IncludeHeader"
          },
          {
            "$ref": "#/components/parameters/QueueLimit"
          },
          {
            "$ref": "#/components/parameters/NewJobId"
          }
        ],
        "requestBody": {
          "description": "script args",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptArgs"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "job result",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/run_wait_result/f/{path}": {
      "post": {
        "summary": "run flow by path and wait until completion",
        "operationId": "runWaitResultFlowByPath",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          },
          {
            "$ref": "#/components/parameters/IncludeHeader"
          },
          {
            "$ref": "#/components/parameters/QueueLimit"
          },
          {
            "$ref": "#/components/parameters/NewJobId"
          }
        ],
        "requestBody": {
          "description": "script args",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptArgs"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "job result",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/result_by_id/{flow_job_id}/{node_id}": {
      "get": {
        "summary": "get job result by id",
        "operationId": "resultById",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "flow_job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "node_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "job result",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/list_paths": {
      "get": {
        "summary": "list all flow paths",
        "operationId": "listFlowPaths",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "list of flow paths",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/list_search": {
      "get": {
        "summary": "list flows for search",
        "operationId": "listSearchFlow",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "flow list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string"
                      },
                      "value": {}
                    },
                    "required": [
                      "path",
                      "value"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/list": {
      "get": {
        "summary": "list all flows",
        "operationId": "listFlows",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "$ref": "#/components/parameters/OrderDesc"
          },
          {
            "$ref": "#/components/parameters/CreatedBy"
          },
          {
            "name": "path_start",
            "description": "mask to filter matching starting path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path_exact",
            "description": "mask to filter exact matching path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "show_archived",
            "description": "(default false)\nshow also the archived files.\nwhen multiple archived hash share the same path, only the ones with the latest create_at\nare displayed.\n",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "starred_only",
            "description": "(default false)\nshow only the starred items\n",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "All flow",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/Flow"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "has_draft": {
                            "type": "boolean"
                          },
                          "draft_only": {
                            "type": "boolean"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/get/{path}": {
      "get": {
        "summary": "get flow by path",
        "operationId": "getFlowByPath",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "flow details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flow"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/toggle_workspace_error_handler/{path}": {
      "post": {
        "summary": "Toggle ON and OFF the workspace error handler for a given flow",
        "operationId": "toggleWorkspaceErrorHandlerForFlow",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "requestBody": {
          "description": "Workspace error handler enabled",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "muted": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "error handler toggled",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/get/draft/{path}": {
      "get": {
        "summary": "get flow by path with draft",
        "operationId": "getFlowByPathWithDraft",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "flow details with draft",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Flow"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "draft": {
                          "$ref": "#/components/schemas/Flow"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/exists/{path}": {
      "get": {
        "summary": "exists flow by path",
        "operationId": "existsFlowByPath",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "flow details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/create": {
      "post": {
        "summary": "create flow",
        "operationId": "createFlow",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "Partially filled flow",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/OpenFlowWPath"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "draft_only": {
                        "type": "boolean"
                      },
                      "deployment_message": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "flow created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/update/{path}": {
      "post": {
        "summary": "update flow",
        "operationId": "updateFlow",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "requestBody": {
          "description": "Partially filled flow",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/OpenFlowWPath"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "deployment_message": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "flow updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/archive/{path}": {
      "post": {
        "summary": "archive flow by path",
        "operationId": "archiveFlowByPath",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "requestBody": {
          "description": "archiveFlow",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "archived": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "flow archived",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/delete/{path}": {
      "delete": {
        "summary": "delete flow by path",
        "operationId": "deleteFlowByPath",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "flow delete",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/flows/input_history/p/{path}": {
      "get": {
        "summary": "list inputs for previous completed flow jobs",
        "operationId": "getFlowInputHistoryByPath",
        "tags": [
          "flow"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "input history for completed jobs with this flow path",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Input"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/raw_apps/list": {
      "get": {
        "summary": "list all raw apps",
        "operationId": "listRawApps",
        "tags": [
          "raw_app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "$ref": "#/components/parameters/OrderDesc"
          },
          {
            "$ref": "#/components/parameters/CreatedBy"
          },
          {
            "name": "path_start",
            "description": "mask to filter matching starting path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path_exact",
            "description": "mask to filter exact matching path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "starred_only",
            "description": "(default false)\nshow only the starred items\n",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "All raw apps",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ListableRawApp"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/raw_apps/exists/{path}": {
      "get": {
        "summary": "does an app exisst at path",
        "operationId": "existsRawApp",
        "tags": [
          "raw_app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "app exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/get_data/{version}/{path}": {
      "get": {
        "summary": "get app by path",
        "operationId": "getRawAppData",
        "tags": [
          "raw_app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/VersionId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "app details",
            "content": {
              "text/javascript": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/list_search": {
      "get": {
        "summary": "list apps for search",
        "operationId": "listSearchApp",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "app list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string"
                      },
                      "value": {}
                    },
                    "required": [
                      "path",
                      "value"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/list": {
      "get": {
        "summary": "list all apps",
        "operationId": "listApps",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "$ref": "#/components/parameters/OrderDesc"
          },
          {
            "$ref": "#/components/parameters/CreatedBy"
          },
          {
            "name": "path_start",
            "description": "mask to filter matching starting path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path_exact",
            "description": "mask to filter exact matching path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "starred_only",
            "description": "(default false)\nshow only the starred items\n",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "All apps",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ListableApp"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/create": {
      "post": {
        "summary": "create app",
        "operationId": "createApp",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "new app",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "value": {},
                  "summary": {
                    "type": "string"
                  },
                  "policy": {
                    "$ref": "#/components/schemas/Policy"
                  },
                  "draft_only": {
                    "type": "boolean"
                  },
                  "deployment_message": {
                    "type": "string"
                  }
                },
                "required": [
                  "path",
                  "value",
                  "summary",
                  "policy"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "app created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/exists/{path}": {
      "get": {
        "summary": "does an app exisst at path",
        "operationId": "existsApp",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "app exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/get/p/{path}": {
      "get": {
        "summary": "get app by path",
        "operationId": "getAppByPath",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "app details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppWithLastVersion"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/get/draft/{path}": {
      "get": {
        "summary": "get app by path with draft",
        "operationId": "getAppByPathWithDraft",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "app details with draft",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppWithLastVersionWDraft"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/history/p/{path}": {
      "get": {
        "summary": "get app history by path",
        "operationId": "getAppHistoryByPath",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "responses": {
          "200": {
            "description": "app history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AppHistory"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/history_update/a/{id}/v/{version}": {
      "post": {
        "summary": "update app history",
        "operationId": "updateAppHistory",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/PathId"
          },
          {
            "$ref": "#/components/parameters/PathVersion"
          }
        ],
        "requestBody": {
          "description": "App deployment message",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deployment_msg": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps_u/public_app/{path}": {
      "get": {
        "summary": "get public app by secret",
        "operationId": "getPublicAppBySecret",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "app details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppWithLastVersion"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps_u/public_resource/{path}": {
      "get": {
        "summary": "get public resource",
        "operationId": "get public resource",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "resource value",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/secret_of/{path}": {
      "get": {
        "summary": "get public secret of app",
        "operationId": "getPublicSecretOfApp",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "app secret",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/get/v/{id}": {
      "get": {
        "summary": "get app by version",
        "operationId": "getAppByVersion",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/PathId"
          }
        ],
        "responses": {
          "200": {
            "description": "app details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppWithLastVersion"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/raw_apps/create": {
      "post": {
        "summary": "create raw app",
        "operationId": "createRawApp",
        "tags": [
          "raw_app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "new raw app",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  },
                  "summary": {
                    "type": "string"
                  }
                },
                "required": [
                  "path",
                  "value",
                  "summary"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "raw app created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/raw_apps/update/{path}": {
      "post": {
        "summary": "update app",
        "operationId": "updateRawApp",
        "tags": [
          "raw_app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "requestBody": {
          "description": "updateraw  app",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "summary": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "app updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/raw_apps/delete/{path}": {
      "delete": {
        "summary": "delete raw app",
        "operationId": "deleteRawApp",
        "tags": [
          "raw_app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "app deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/delete/{path}": {
      "delete": {
        "summary": "delete app",
        "operationId": "deleteApp",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "app deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps/update/{path}": {
      "post": {
        "summary": "update app",
        "operationId": "updateApp",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "requestBody": {
          "description": "update app",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "summary": {
                    "type": "string"
                  },
                  "value": {},
                  "policy": {
                    "$ref": "#/components/schemas/Policy"
                  },
                  "deployment_message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "app updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/apps_u/execute_component/{path}": {
      "post": {
        "summary": "executeComponent",
        "operationId": "executeComponent",
        "tags": [
          "app"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          }
        ],
        "requestBody": {
          "description": "update app",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "component": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string"
                  },
                  "args": {},
                  "raw_code": {
                    "type": "object",
                    "properties": {
                      "content": {
                        "type": "string"
                      },
                      "language": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string"
                      },
                      "cache_ttl": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "content",
                      "language"
                    ]
                  },
                  "force_viewer_static_fields": {
                    "type": "object"
                  }
                },
                "required": [
                  "args",
                  "component"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "job uuid",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/run/f/{path}": {
      "post": {
        "summary": "run flow by path",
        "operationId": "runFlowByPath",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptPath"
          },
          {
            "name": "scheduled_for",
            "description": "when to schedule this job (leave empty for immediate run)",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "scheduled_in_secs",
            "description": "schedule the script to execute in the number of seconds starting now",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/ParentJob"
          },
          {
            "$ref": "#/components/parameters/WorkerTag"
          },
          {
            "$ref": "#/components/parameters/NewJobId"
          },
          {
            "$ref": "#/components/parameters/IncludeHeader"
          },
          {
            "name": "invisible_to_owner",
            "description": "make the run invisible to the the flow owner (default false)",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "description": "flow args",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptArgs"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "job created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/restart/f/{id}/from/{step_id}/{branch_or_iteration_n}": {
      "post": {
        "summary": "restart a completed flow at a given step",
        "operationId": "restartFlowAtStep",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "name": "step_id",
            "description": "step id to restart the flow from",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "branch_or_iteration_n",
            "description": "for branchall or loop, the iteration at which the flow should restart",
            "required": true,
            "in": "path",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "scheduled_for",
            "description": "when to schedule this job (leave empty for immediate run)",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "scheduled_in_secs",
            "description": "schedule the script to execute in the number of seconds starting now",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/ParentJob"
          },
          {
            "$ref": "#/components/parameters/WorkerTag"
          },
          {
            "$ref": "#/components/parameters/NewJobId"
          },
          {
            "$ref": "#/components/parameters/IncludeHeader"
          },
          {
            "name": "invisible_to_owner",
            "description": "make the run invisible to the the flow owner (default false)",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "description": "flow args",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptArgs"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "job created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/run/h/{hash}": {
      "post": {
        "summary": "run script by hash",
        "operationId": "runScriptByHash",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/ScriptHash"
          },
          {
            "name": "scheduled_for",
            "description": "when to schedule this job (leave empty for immediate run)",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "scheduled_in_secs",
            "description": "schedule the script to execute in the number of seconds starting now",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/ParentJob"
          },
          {
            "$ref": "#/components/parameters/WorkerTag"
          },
          {
            "$ref": "#/components/parameters/CacheTtl"
          },
          {
            "$ref": "#/components/parameters/NewJobId"
          },
          {
            "$ref": "#/components/parameters/IncludeHeader"
          },
          {
            "name": "invisible_to_owner",
            "description": "make the run invisible to the the script owner (default false)",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "description": "Partially filled args",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "job created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/run/preview": {
      "post": {
        "summary": "run script preview",
        "operationId": "runScriptPreview",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IncludeHeader"
          },
          {
            "name": "invisible_to_owner",
            "description": "make the run invisible to the the script owner (default false)",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/NewJobId"
          }
        ],
        "requestBody": {
          "description": "preview",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Preview"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "job created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/workflow_as_code/{job_id}/{entrypoint}": {
      "post": {
        "summary": "run code-workflow task",
        "operationId": "runCodeWorkflowTask",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entrypoint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "preview",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowTask"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "job created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/run/dependencies": {
      "post": {
        "summary": "run a one-off dependencies job",
        "operationId": "runRawScriptDependencies",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "raw script content",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "raw_scripts": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/RawScriptForDependencies"
                    }
                  },
                  "entrypoint": {
                    "type": "string"
                  }
                },
                "required": [
                  "entrypoint",
                  "raw_scripts"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "dependency job result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "lock": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "lock"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/run/preview_flow": {
      "post": {
        "summary": "run flow preview",
        "operationId": "runFlowPreview",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/IncludeHeader"
          },
          {
            "name": "invisible_to_owner",
            "description": "make the run invisible to the the script owner (default false)",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/NewJobId"
          }
        ],
        "requestBody": {
          "description": "preview",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowPreview"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "job created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/queue/list": {
      "get": {
        "summary": "list all queued jobs",
        "operationId": "listQueue",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/OrderDesc"
          },
          {
            "$ref": "#/components/parameters/CreatedBy"
          },
          {
            "$ref": "#/components/parameters/ParentJob"
          },
          {
            "$ref": "#/components/parameters/ScriptExactPath"
          },
          {
            "$ref": "#/components/parameters/ScriptStartPath"
          },
          {
            "$ref": "#/components/parameters/SchedulePath"
          },
          {
            "$ref": "#/components/parameters/ScriptExactHash"
          },
          {
            "$ref": "#/components/parameters/StartedBefore"
          },
          {
            "$ref": "#/components/parameters/StartedAfter"
          },
          {
            "$ref": "#/components/parameters/Success"
          },
          {
            "$ref": "#/components/parameters/ScheduledForBeforeNow"
          },
          {
            "$ref": "#/components/parameters/JobKinds"
          },
          {
            "$ref": "#/components/parameters/Suspended"
          },
          {
            "$ref": "#/components/parameters/Running"
          },
          {
            "$ref": "#/components/parameters/ArgsFilter"
          },
          {
            "$ref": "#/components/parameters/ResultFilter"
          },
          {
            "$ref": "#/components/parameters/Tag"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "all_workspaces",
            "description": "get jobs from all workspaces (only valid if request come from the `admins` workspace)",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "All queued jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QueuedJob"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/queue/count": {
      "get": {
        "summary": "get queue count",
        "operationId": "getQueueCount",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "all_workspaces",
            "description": "get jobs from all workspaces (only valid if request come from the `admins` workspace)",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "queue count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "database_length": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "database_length"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/completed/count": {
      "get": {
        "summary": "get completed count",
        "operationId": "getCompletedCount",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "completed count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "database_length": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "database_length"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/queue/cancel_all": {
      "post": {
        "summary": "cancel all jobs",
        "operationId": "cancelAll",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "uuids of canceled jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/completed/list": {
      "get": {
        "summary": "list all completed jobs",
        "operationId": "listCompletedJobs",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/OrderDesc"
          },
          {
            "$ref": "#/components/parameters/CreatedBy"
          },
          {
            "$ref": "#/components/parameters/ParentJob"
          },
          {
            "$ref": "#/components/parameters/ScriptExactPath"
          },
          {
            "$ref": "#/components/parameters/ScriptStartPath"
          },
          {
            "$ref": "#/components/parameters/SchedulePath"
          },
          {
            "$ref": "#/components/parameters/ScriptExactHash"
          },
          {
            "$ref": "#/components/parameters/StartedBefore"
          },
          {
            "$ref": "#/components/parameters/StartedAfter"
          },
          {
            "$ref": "#/components/parameters/Success"
          },
          {
            "$ref": "#/components/parameters/JobKinds"
          },
          {
            "$ref": "#/components/parameters/ArgsFilter"
          },
          {
            "$ref": "#/components/parameters/ResultFilter"
          },
          {
            "$ref": "#/components/parameters/Tag"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "is_skipped",
            "description": "is the job skipped",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "is_flow_step",
            "description": "is the job a flow step",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "has_null_parent",
            "description": "has null parent",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "All completed jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CompletedJob"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/list": {
      "get": {
        "summary": "list all jobs",
        "operationId": "listJobs",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/CreatedBy"
          },
          {
            "$ref": "#/components/parameters/ParentJob"
          },
          {
            "$ref": "#/components/parameters/ScriptExactPath"
          },
          {
            "$ref": "#/components/parameters/ScriptStartPath"
          },
          {
            "$ref": "#/components/parameters/SchedulePath"
          },
          {
            "$ref": "#/components/parameters/ScriptExactHash"
          },
          {
            "$ref": "#/components/parameters/StartedBefore"
          },
          {
            "$ref": "#/components/parameters/StartedAfter"
          },
          {
            "$ref": "#/components/parameters/CreatedOrStartedBefore"
          },
          {
            "$ref": "#/components/parameters/Running"
          },
          {
            "$ref": "#/components/parameters/ScheduledForBeforeNow"
          },
          {
            "$ref": "#/components/parameters/CreatedOrStartedAfter"
          },
          {
            "$ref": "#/components/parameters/JobKinds"
          },
          {
            "$ref": "#/components/parameters/ArgsFilter"
          },
          {
            "$ref": "#/components/parameters/Tag"
          },
          {
            "$ref": "#/components/parameters/ResultFilter"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "is_skipped",
            "description": "is the job skipped",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "is_flow_step",
            "description": "is the job a flow step",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "has_null_parent",
            "description": "has null parent",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "success",
            "description": "filter on successful jobs",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "all_workspaces",
            "description": "get jobs from all workspaces (only valid if request come from the `admins` workspace)",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "All jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Job"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/jobs/db_clock": {
      "get": {
        "summary": "get db clock",
        "operationId": "getDbClock",
        "tags": [
          "job"
        ],
        "responses": {
          "200": {
            "description": "the timestamp of the db that can be used to compute the drift",
            "content": {
              "application/json": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/get/{id}": {
      "get": {
        "summary": "get job",
        "operationId": "getJob",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "name": "no_logs",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "job details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/get_root_job_id/{id}": {
      "get": {
        "summary": "get root job id",
        "operationId": "getRootJobId",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "responses": {
          "200": {
            "description": "get root job id",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/get_logs/{id}": {
      "get": {
        "summary": "get job logs",
        "operationId": "getJob logs",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "responses": {
          "200": {
            "description": "job details",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/getupdate/{id}": {
      "get": {
        "summary": "get job updates",
        "operationId": "getJobUpdates",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "name": "running",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "log_offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "job details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "running": {
                      "type": "boolean"
                    },
                    "completed": {
                      "type": "boolean"
                    },
                    "new_logs": {
                      "type": "string"
                    },
                    "log_offset": {
                      "type": "integer"
                    },
                    "mem_peak": {
                      "type": "integer"
                    },
                    "flow_status": {
                      "$ref": "#/components/schemas/WorkflowStatusRecord"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/get_flow_debug_info/{id}": {
      "get": {
        "summary": "get flow debug info",
        "operationId": "getFlowDebugInfo",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "responses": {
          "200": {
            "description": "flow debug info details",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/completed/get/{id}": {
      "get": {
        "summary": "get completed job",
        "operationId": "getCompletedJob",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "responses": {
          "200": {
            "description": "job details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompletedJob"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/completed/get_result/{id}": {
      "get": {
        "summary": "get completed job result",
        "operationId": "getCompletedJobResult",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "responses": {
          "200": {
            "description": "result",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/completed/get_result_maybe/{id}": {
      "get": {
        "summary": "get completed job result if job is completed",
        "operationId": "getCompletedJobResultMaybe",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "$ref": "#/components/parameters/GetStarted"
          }
        ],
        "responses": {
          "200": {
            "description": "result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "completed": {
                      "type": "boolean"
                    },
                    "result": {},
                    "success": {
                      "type": "boolean"
                    },
                    "started": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "completed",
                    "result"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/completed/delete/{id}": {
      "post": {
        "summary": "delete completed job (erase content but keep run id)",
        "operationId": "deleteCompletedJob",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "responses": {
          "200": {
            "description": "job details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompletedJob"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/queue/cancel/{id}": {
      "post": {
        "summary": "cancel queued job",
        "operationId": "cancelQueuedJob",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "requestBody": {
          "description": "reason",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "job canceled",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/queue/cancel_persistent/{path}": {
      "post": {
        "summary": "cancel all queued jobs for persistent script",
        "operationId": "cancelPersistentQueuedJobs",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "requestBody": {
          "description": "reason",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "persistent job scaled down to zero",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/queue/force_cancel/{id}": {
      "post": {
        "summary": "force cancel queued job",
        "operationId": "forceCancelQueuedJob",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "requestBody": {
          "description": "reason",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "job canceled",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/job_signature/{id}/{resume_id}": {
      "get": {
        "summary": "create an HMac signature given a job id and a resume id",
        "operationId": "createJobSignature",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "name": "resume_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "approver",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "job signature",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/resume_urls/{id}/{resume_id}": {
      "get": {
        "summary": "get resume urls given a job_id, resume_id and a nonce to resume a flow",
        "operationId": "getResumeUrls",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "name": "resume_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "approver",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "url endpoints",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "approvalPage": {
                      "type": "string"
                    },
                    "resume": {
                      "type": "string"
                    },
                    "cancel": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "approvalPage",
                    "resume",
                    "cancel"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}": {
      "get": {
        "summary": "resume a job for a suspended flow",
        "operationId": "resumeSuspendedJobGet",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "$ref": "#/components/parameters/Payload"
          },
          {
            "name": "resume_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "signature",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "approver",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "job resumed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "resume a job for a suspended flow",
        "operationId": "resumeSuspendedJobPost",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "name": "resume_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "signature",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "approver",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "job resumed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/flow/user_states/{id}/{key}": {
      "post": {
        "summary": "set flow user state at a given key",
        "operationId": "setFlowUserState",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "new value",
          "required": true,
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "flow user state updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "get flow user state at a given key",
        "operationId": "getFlowUserState",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "flow user state updated",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs/flow/resume/{id}": {
      "post": {
        "summary": "resume a job for a suspended flow as an owner",
        "operationId": "resumeSuspendedFlowAsOwner",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "job resumed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/cancel/{id}/{resume_id}/{signature}": {
      "get": {
        "summary": "cancel a job for a suspended flow",
        "operationId": "cancelSuspendedJobGet",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "name": "resume_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "signature",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "approver",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "job canceled",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "cancel a job for a suspended flow",
        "operationId": "cancelSuspendedJobPost",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "name": "resume_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "signature",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "approver",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "job canceled",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/jobs_u/get_flow/{id}/{resume_id}/{signature}": {
      "get": {
        "summary": "get parent flow job of suspended job",
        "operationId": "getSuspendedJobFlow",
        "tags": [
          "job"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          },
          {
            "name": "resume_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "signature",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "approver",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "parent flow details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job": {
                      "$ref": "#/components/schemas/Job"
                    },
                    "approvers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "resume_id": {
                            "type": "integer"
                          },
                          "approver": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "resume_id",
                          "approver"
                        ]
                      }
                    }
                  },
                  "required": [
                    "job",
                    "approvers"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/schedules/preview": {
      "post": {
        "summary": "preview schedule",
        "operationId": "previewSchedule",
        "tags": [
          "schedule"
        ],
        "requestBody": {
          "description": "schedule",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "schedule": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  }
                },
                "required": [
                  "schedule",
                  "timezone"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "List of 5 estimated upcoming execution events (in UTC)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/schedules/create": {
      "post": {
        "summary": "create schedule",
        "operationId": "createSchedule",
        "tags": [
          "schedule"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "new schedule",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewSchedule"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "schedule created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/schedules/update/{path}": {
      "post": {
        "summary": "update schedule",
        "operationId": "updateSchedule",
        "tags": [
          "schedule"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "requestBody": {
          "description": "updated schedule",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditSchedule"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "schedule updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/schedules/setenabled/{path}": {
      "post": {
        "summary": "set enabled schedule",
        "operationId": "setScheduleEnabled",
        "tags": [
          "schedule"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "requestBody": {
          "description": "updated schedule enable",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "schedule enabled set",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/schedules/delete/{path}": {
      "delete": {
        "summary": "delete schedule",
        "operationId": "deleteSchedule",
        "tags": [
          "schedule"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "schedule deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/schedules/get/{path}": {
      "get": {
        "summary": "get schedule",
        "operationId": "getSchedule",
        "tags": [
          "schedule"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "schedule deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Schedule"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/schedules/exists/{path}": {
      "get": {
        "summary": "does schedule exists",
        "operationId": "existsSchedule",
        "tags": [
          "schedule"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "schedule exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/schedules/list": {
      "get": {
        "summary": "list schedules",
        "operationId": "listSchedules",
        "tags": [
          "schedule"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "$ref": "#/components/parameters/ArgsFilter"
          },
          {
            "name": "path",
            "description": "filter by path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_flow",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "schedule list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Schedule"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/schedules/list_with_jobs": {
      "get": {
        "summary": "list schedules with last 20 jobs",
        "operationId": "listSchedulesWithJobs",
        "tags": [
          "schedule"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "schedule list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ScheduleWJobs"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/schedules/setdefaulthandler": {
      "post": {
        "summary": "Set default error or recoevery handler",
        "operationId": "setDefaultErrorOrRecoveryHandler",
        "tags": [
          "schedule"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "Handler description",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "handler_type": {
                    "type": "string",
                    "enum": [
                      "error",
                      "recovery"
                    ]
                  },
                  "override_existing": {
                    "type": "boolean"
                  },
                  "path": {
                    "type": "string"
                  },
                  "extra_args": {
                    "type": "object"
                  },
                  "number_of_occurence": {
                    "type": "integer"
                  },
                  "number_of_occurence_exact": {
                    "type": "boolean"
                  },
                  "workspace_handler_muted": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "handler_type",
                  "override_existing"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "default error handler set"
          }
        }
      }
    },
    "/groups/list": {
      "get": {
        "summary": "list instance groups",
        "operationId": "listInstanceGroups",
        "tags": [
          "group"
        ],
        "responses": {
          "200": {
            "description": "instance group list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InstanceGroup"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/groups/get/{name}": {
      "get": {
        "summary": "get instance group",
        "operationId": "getInstanceGroup",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "instance group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceGroup"
                }
              }
            }
          }
        }
      }
    },
    "/groups/create": {
      "post": {
        "summary": "create instance group",
        "operationId": "createInstanceGroup",
        "tags": [
          "group"
        ],
        "requestBody": {
          "description": "create instance group",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "summary": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "instance group created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/groups/update/{name}": {
      "post": {
        "summary": "update instance group",
        "operationId": "updateInstanceGroup",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "description": "update instance group",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "new_summary": {
                    "type": "string"
                  }
                },
                "required": [
                  "new_summary"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "instance group updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/groups/delete/{name}": {
      "delete": {
        "summary": "delete instance group",
        "operationId": "deleteInstanceGroup",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "instance group deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/groups/adduser/{name}": {
      "post": {
        "summary": "add user to instance group",
        "operationId": "addUserToInstanceGroup",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "description": "user to add to instance group",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "user added to instance group",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/groups/removeuser/{name}": {
      "post": {
        "summary": "remove user from instance group",
        "operationId": "removeUserFromInstanceGroup",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "description": "user to remove from instance group",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "user removed from instance group",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/groups/list": {
      "get": {
        "summary": "list groups",
        "operationId": "listGroups",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "group list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Group"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/groups/listnames": {
      "get": {
        "summary": "list group names",
        "operationId": "listGroupNames",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "only_member_of",
            "in": "query",
            "description": "only list the groups the user is member of (default false)",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "group list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/groups/create": {
      "post": {
        "summary": "create group",
        "operationId": "createGroup",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "create group",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "summary": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "group created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/groups/update/{name}": {
      "post": {
        "summary": "update group",
        "operationId": "updateGroup",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "description": "updated group",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "summary": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "group updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/groups/delete/{name}": {
      "delete": {
        "summary": "delete group",
        "operationId": "deleteGroup",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "group deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/groups/get/{name}": {
      "get": {
        "summary": "get group",
        "operationId": "getGroup",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/groups/adduser/{name}": {
      "post": {
        "summary": "add user to group",
        "operationId": "addUserToGroup",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "description": "added user to group",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "user added to group",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/groups/removeuser/{name}": {
      "post": {
        "summary": "remove user to group",
        "operationId": "removeUserToGroup",
        "tags": [
          "group"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "description": "added user to group",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "user removed from group",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/folders/list": {
      "get": {
        "summary": "list folders",
        "operationId": "listFolders",
        "tags": [
          "folder"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "folder list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Folder"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/folders/listnames": {
      "get": {
        "summary": "list folder names",
        "operationId": "listFolderNames",
        "tags": [
          "folder"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "only_member_of",
            "in": "query",
            "description": "only list the folders the user is member of (default false)",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "folder list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/folders/create": {
      "post": {
        "summary": "create folder",
        "operationId": "createFolder",
        "tags": [
          "folder"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "create folder",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "owners": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "extra_perms": {
                    "additionalProperties": {
                      "type": "boolean"
                    }
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "folder created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/folders/update/{name}": {
      "post": {
        "summary": "update folder",
        "operationId": "updateFolder",
        "tags": [
          "folder"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "description": "update folder",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "owners": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "extra_perms": {
                    "additionalProperties": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "folder updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/folders/delete/{name}": {
      "delete": {
        "summary": "delete folder",
        "operationId": "deleteFolder",
        "tags": [
          "folder"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "folder deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/folders/get/{name}": {
      "get": {
        "summary": "get folder",
        "operationId": "getFolder",
        "tags": [
          "folder"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "folder",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Folder"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/folders/getusage/{name}": {
      "get": {
        "summary": "get folder usage",
        "operationId": "getFolderUsage",
        "tags": [
          "folder"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "folder",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scripts": {
                      "type": "number"
                    },
                    "flows": {
                      "type": "number"
                    },
                    "apps": {
                      "type": "number"
                    },
                    "resources": {
                      "type": "number"
                    },
                    "variables": {
                      "type": "number"
                    },
                    "schedules": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "scripts",
                    "flows",
                    "apps",
                    "resources",
                    "variables",
                    "schedules"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/folders/addowner/{name}": {
      "post": {
        "summary": "add owner to folder",
        "operationId": "addOwnerToFolder",
        "tags": [
          "folder"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "description": "owner user to folder",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "owner": {
                    "type": "string"
                  }
                },
                "required": [
                  "owner"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "owner added to folder",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/folders/removeowner/{name}": {
      "post": {
        "summary": "remove owner to folder",
        "operationId": "removeOwnerToFolder",
        "tags": [
          "folder"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "description": "added owner to folder",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "owner": {
                    "type": "string"
                  },
                  "write": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "owner"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "owner removed from folder",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/workers/list": {
      "get": {
        "summary": "list workers",
        "operationId": "listWorkers",
        "tags": [
          "worker"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "name": "ping_since",
            "in": "query",
            "required": false,
            "description": "number of seconds the worker must have had a last ping more recent of (default to 300)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "a list of workers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkerPing"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/workers/exists_worker_with_tag": {
      "get": {
        "summary": "exists worker with tag",
        "operationId": "existsWorkerWithTag",
        "tags": [
          "worker"
        ],
        "parameters": [
          {
            "name": "tag",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "whether a worker with the tag exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/configs/list_worker_groups": {
      "get": {
        "summary": "list worker groups",
        "operationId": "listWorkerGroups",
        "tags": [
          "config"
        ],
        "responses": {
          "200": {
            "description": "a list of worker group configs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "config": {}
                    },
                    "required": [
                      "name",
                      "config"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/configs/get/{name}": {
      "get": {
        "summary": "get config",
        "operationId": "get config",
        "tags": [
          "config"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "a config",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/configs/update/{name}": {
      "post": {
        "summary": "Update config",
        "operationId": "updateConfig",
        "tags": [
          "config"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "requestBody": {
          "description": "worker group",
          "required": true,
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a worker group",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete Config",
        "operationId": "deleteConfig",
        "tags": [
          "config"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Name"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete config",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/acls/get/{kind}/{path}": {
      "get": {
        "summary": "get granular acls",
        "operationId": "getGranularAcls",
        "tags": [
          "granular_acl"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "script",
                "group_",
                "resource",
                "schedule",
                "variable",
                "flow",
                "folder",
                "app",
                "raw_app"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "acls",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/acls/add/{kind}/{path}": {
      "post": {
        "summary": "add granular acls",
        "operationId": "addGranularAcls",
        "tags": [
          "granular_acl"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "script",
                "group_",
                "resource",
                "schedule",
                "variable",
                "flow",
                "folder",
                "app",
                "raw_app"
              ]
            }
          }
        ],
        "requestBody": {
          "description": "acl to add",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "owner": {
                    "type": "string"
                  },
                  "write": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "owner"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "granular acl added",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/acls/remove/{kind}/{path}": {
      "post": {
        "summary": "remove granular acls",
        "operationId": "removeGranularAcls",
        "tags": [
          "granular_acl"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "script",
                "group_",
                "resource",
                "schedule",
                "variable",
                "flow",
                "folder",
                "app",
                "raw_app"
              ]
            }
          }
        ],
        "requestBody": {
          "description": "acl to add",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "owner": {
                    "type": "string"
                  }
                },
                "required": [
                  "owner"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "granular acl removed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/capture_u/{path}": {
      "post": {
        "summary": "update flow preview capture",
        "operationId": "updateCapture",
        "tags": [
          "capture"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "204": {
            "description": "flow preview captured"
          }
        }
      }
    },
    "/w/{workspace}/capture/{path}": {
      "put": {
        "summary": "create flow preview capture",
        "operationId": "createCapture",
        "tags": [
          "capture"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "201": {
            "description": "flow preview capture created"
          }
        }
      },
      "get": {
        "summary": "get flow preview capture",
        "operationId": "getCapture",
        "tags": [
          "capture"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "description": "captured flow preview",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "capture does not exist for this flow"
          }
        }
      }
    },
    "/w/{workspace}/favorites/star": {
      "post": {
        "summary": "star item",
        "operationId": "star",
        "tags": [
          "favorite"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "favorite_kind": {
                    "type": "string",
                    "enum": [
                      "flow",
                      "app",
                      "script",
                      "raw_app"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "star item"
          }
        }
      }
    },
    "/w/{workspace}/favorites/unstar": {
      "post": {
        "summary": "unstar item",
        "operationId": "unstar",
        "tags": [
          "favorite"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "favorite_kind": {
                    "type": "string",
                    "enum": [
                      "flow",
                      "app",
                      "script",
                      "raw_app"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "unstar item"
          }
        }
      }
    },
    "/w/{workspace}/inputs/history": {
      "get": {
        "summary": "List Inputs used in previously completed jobs",
        "operationId": "getInputHistory",
        "tags": [
          "input"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RunnableId"
          },
          {
            "$ref": "#/components/parameters/RunnableTypeQuery"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "Input history for completed jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Input"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/inputs/list": {
      "get": {
        "summary": "List saved Inputs for a Runnable",
        "operationId": "listInputs",
        "tags": [
          "input"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RunnableId"
          },
          {
            "$ref": "#/components/parameters/RunnableTypeQuery"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "Saved Inputs for a Runnable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Input"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/inputs/create": {
      "post": {
        "summary": "Create an Input for future use in a script or flow",
        "operationId": "createInput",
        "tags": [
          "input"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/RunnableId"
          },
          {
            "$ref": "#/components/parameters/RunnableTypeQuery"
          }
        ],
        "requestBody": {
          "description": "Input",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Input created",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/inputs/update": {
      "post": {
        "summary": "Update an Input",
        "operationId": "updateInput",
        "tags": [
          "input"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "UpdateInput",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Input updated",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/inputs/delete/{input}": {
      "post": {
        "summary": "Delete a Saved Input",
        "operationId": "deleteInput",
        "tags": [
          "input"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/InputId"
          }
        ],
        "responses": {
          "200": {
            "description": "Input deleted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/duckdb_connection_settings": {
      "post": {
        "summary": "Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket",
        "operationId": "duckdbConnectionSettings",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "S3 resource to connect to",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "s3_resource": {
                    "$ref": "#/components/schemas/S3Resource"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connection_settings_str": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/v2/duckdb_connection_settings": {
      "post": {
        "summary": "Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket",
        "operationId": "duckdbConnectionSettingsV2",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "S3 resource path to use to generate the connection settings. If empty, the S3 resource defined in the workspace settings will be used",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "s3_resource_path": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connection_settings_str": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connection_settings_str"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/polars_connection_settings": {
      "post": {
        "summary": "Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket",
        "operationId": "polarsConnectionSettings",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "S3 resource to connect to",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "s3_resource": {
                    "$ref": "#/components/schemas/S3Resource"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "endpoint_url": {
                      "type": "string"
                    },
                    "key": {
                      "type": "string"
                    },
                    "secret": {
                      "type": "string"
                    },
                    "use_ssl": {
                      "type": "boolean"
                    },
                    "cache_regions": {
                      "type": "boolean"
                    },
                    "client_kwargs": {
                      "$ref": "#/components/schemas/PolarsClientKwargs"
                    }
                  },
                  "required": [
                    "endpoint_url",
                    "use_ssl",
                    "cache_regions",
                    "client_kwargs"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/v2/polars_connection_settings": {
      "post": {
        "summary": "Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket",
        "operationId": "polarsConnectionSettingsV2",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "S3 resource path to use to generate the connection settings. If empty, the S3 resource defined in the workspace settings will be used",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "s3_resource_path": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "s3fs_args": {
                      "type": "object",
                      "properties": {
                        "endpoint_url": {
                          "type": "string"
                        },
                        "key": {
                          "type": "string"
                        },
                        "secret": {
                          "type": "string"
                        },
                        "use_ssl": {
                          "type": "boolean"
                        },
                        "cache_regions": {
                          "type": "boolean"
                        },
                        "client_kwargs": {
                          "$ref": "#/components/schemas/PolarsClientKwargs"
                        }
                      },
                      "required": [
                        "endpoint_url",
                        "use_ssl",
                        "cache_regions",
                        "client_kwargs"
                      ]
                    },
                    "storage_options": {
                      "type": "object",
                      "properties": {
                        "aws_endpoint_url": {
                          "type": "string"
                        },
                        "aws_access_key_id": {
                          "type": "string"
                        },
                        "aws_secret_access_key": {
                          "type": "string"
                        },
                        "aws_region": {
                          "type": "string"
                        },
                        "aws_allow_http": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "aws_endpoint_url",
                        "aws_region",
                        "aws_allow_http"
                      ]
                    }
                  },
                  "required": [
                    "s3fs_args",
                    "storage_options"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/v2/s3_resource_info": {
      "post": {
        "summary": "Returns the s3 resource associated to the provided path, or the workspace default S3 resource",
        "operationId": "s3ResourceInfo",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "requestBody": {
          "description": "S3 resource path to use. If empty, the S3 resource defined in the workspace settings will be used",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "s3_resource_path": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/S3Resource"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/test_connection": {
      "get": {
        "summary": "Test connection to the workspace datasets storage",
        "operationId": "datasetStorageTestConnection",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Connection settings",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/list_stored_files": {
      "get": {
        "summary": "List the file keys available in the workspace files storage (S3)",
        "operationId": "listStoredFiles",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "max_keys",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "marker",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "prefix",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of file keys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "next_marker": {
                      "type": "string"
                    },
                    "windmill_large_files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WindmillLargeFile"
                      }
                    },
                    "restricted_access": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "windmill_large_files"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/load_file_metadata": {
      "get": {
        "summary": "Load metadata of the file",
        "operationId": "loadFileMetadata",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "file_key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "FileMetadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WindmillFileMetadata"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/load_file_preview": {
      "get": {
        "summary": "Load a preview of the file",
        "operationId": "loadFilePreview",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "file_key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "file_size_in_bytes",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "file_mime_type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "csv_separator",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "csv_has_header",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "read_bytes_from",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "read_bytes_length",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "FilePreview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WindmillFilePreview"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/load_parquet_preview/{path}": {
      "get": {
        "summary": "Load a preview of a parquet file",
        "operationId": "loadParquetPreview",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/Path"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sort_col",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_desc",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search_col",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search_term",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Parquet Preview",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/delete_s3_file": {
      "delete": {
        "summary": "Permanently delete file from S3",
        "operationId": "deleteS3File",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "file_key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmation",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/move_s3_file": {
      "get": {
        "summary": "Move a S3 file from one path to the other within the same bucket",
        "operationId": "moveS3File",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "src_file_key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dest_file_key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmation",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/upload_s3_file": {
      "post": {
        "summary": "Upload file to S3 bucket",
        "operationId": "fileUpload",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "file_key",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "file_extension",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "s3_resource_path",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "File content",
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File upload status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "file_key": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "file_key"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_helpers/download_s3_file": {
      "get": {
        "summary": "Download file to S3 bucket",
        "operationId": "fileDownload",
        "tags": [
          "helpers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "name": "file_key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "s3_resource_path",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Chunk of the downloaded file",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/w/{workspace}/job_metrics/get/{id}": {
      "post": {
        "summary": "get job metrics",
        "operationId": "getJobMetrics",
        "tags": [
          "metrics"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WorkspaceId"
          },
          {
            "$ref": "#/components/parameters/JobId"
          }
        ],
        "requestBody": {
          "description": "parameters for statistics retrieval",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "timeseries_max_datapoints": {
                    "type": "integer"
                  },
                  "from_timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "to_timestamp": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "job details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "metrics_metadata": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MetricMetadata"
                      }
                    },
                    "scalar_metrics": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ScalarMetric"
                      }
                    },
                    "timeseries_metrics": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TimeseriesMetric"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/concurrency_groups/list": {
      "get": {
        "summary": "List all concurrency groups",
        "operationId": "listConcurrencyGroups",
        "tags": [
          "concurrencyGroups"
        ],
        "responses": {
          "200": {
            "description": "all concurrency groups",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConcurrencyGroup"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/concurrency_groups/{concurrency_id}": {
      "delete": {
        "summary": "Delete concurrency group",
        "operationId": "deleteConcurrencyGroup",
        "tags": [
          "concurrencyGroups"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConcurrencyId"
          }
        ],
        "responses": {
          "200": {
            "description": "concurrency group removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "cookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "token"
      }
    },
    "parameters": {
      "Key": {
        "name": "key",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "WorkspaceId": {
        "name": "workspace",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "VersionId": {
        "name": "version",
        "in": "path",
        "required": true,
        "schema": {
          "type": "number"
        }
      },
      "Token": {
        "name": "token",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "AccountId": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        }
      },
      "ClientName": {
        "name": "client_name",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "ScriptPath": {
        "name": "path",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "ScriptHash": {
        "name": "hash",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "JobId": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "Path": {
        "name": "path",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "PathId": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        }
      },
      "PathVersion": {
        "name": "version",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        }
      },
      "Name": {
        "name": "name",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "Page": {
        "name": "page",
        "description": "which page to return (start at 1, default 1)",
        "in": "query",
        "schema": {
          "type": "integer"
        }
      },
      "PerPage": {
        "name": "per_page",
        "description": "number of items to return for a given page (default 30, max 100)",
        "in": "query",
        "schema": {
          "type": "integer"
        }
      },
      "OrderDesc": {
        "name": "order_desc",
        "description": "order by desc order (default true)",
        "in": "query",
        "schema": {
          "type": "boolean"
        }
      },
      "CreatedBy": {
        "name": "created_by",
        "description": "mask to filter exact matching user creator",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "ParentJob": {
        "name": "parent_job",
        "description": "The parent job that is at the origin and responsible for the execution of this script if any",
        "in": "query",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "WorkerTag": {
        "name": "tag",
        "description": "Override the tag to use",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "CacheTtl": {
        "name": "cache_ttl",
        "description": "Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "NewJobId": {
        "name": "job_id",
        "description": "The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request)",
        "in": "query",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "IncludeHeader": {
        "name": "include_header",
        "description": "List of headers's keys (separated with ',') whove value are added to the args\nHeader's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key\n",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "QueueLimit": {
        "name": "queue_limit",
        "description": "The maximum size of the queue for which the request would get rejected if that job would push it above that limit\n",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "Payload": {
        "name": "payload",
        "description": "The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent\n`encodeURIComponent(btoa(JSON.stringify({a: 2})))`\n",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "ScriptStartPath": {
        "name": "script_path_start",
        "description": "mask to filter matching starting path",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "SchedulePath": {
        "name": "schedule_path",
        "description": "mask to filter by schedule path",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "ScriptExactPath": {
        "name": "script_path_exact",
        "description": "mask to filter exact matching path",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "ScriptExactHash": {
        "name": "script_hash",
        "description": "mask to filter exact matching path",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "StartedBefore": {
        "name": "started_before",
        "description": "filter on started before (inclusive) timestamp",
        "in": "query",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "StartedAfter": {
        "name": "started_after",
        "description": "filter on started after (exclusive) timestamp",
        "in": "query",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "CreatedOrStartedAfter": {
        "name": "created_or_started_after",
        "description": "filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp",
        "in": "query",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "CreatedOrStartedBefore": {
        "name": "created_or_started_before",
        "description": "filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp",
        "in": "query",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "Success": {
        "name": "success",
        "description": "filter on successful jobs",
        "in": "query",
        "schema": {
          "type": "boolean"
        }
      },
      "ScheduledForBeforeNow": {
        "name": "scheduled_for_before_now",
        "description": "filter on jobs scheduled_for before now (hence waitinf for a worker)",
        "in": "query",
        "schema": {
          "type": "boolean"
        }
      },
      "Suspended": {
        "name": "suspended",
        "description": "filter on suspended jobs",
        "in": "query",
        "schema": {
          "type": "boolean"
        }
      },
      "Running": {
        "name": "running",
        "description": "filter on running jobs",
        "in": "query",
        "schema": {
          "type": "boolean"
        }
      },
      "ArgsFilter": {
        "name": "args",
        "description": "filter on jobs containing those args as a json subset (@> in postgres)",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "Tag": {
        "name": "tag",
        "description": "filter on jobs with a given tag/worker group",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "ResultFilter": {
        "name": "result",
        "description": "filter on jobs containing those result as a json subset (@> in postgres)",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "After": {
        "name": "after",
        "description": "filter on created after (exclusive) timestamp",
        "in": "query",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "Before": {
        "name": "before",
        "description": "filter on created before (exclusive) timestamp",
        "in": "query",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "Username": {
        "name": "username",
        "description": "filter on exact username of user",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "Operation": {
        "name": "operation",
        "description": "filter on exact or prefix name of operation",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "ResourceName": {
        "name": "resource",
        "description": "filter on exact or prefix name of resource",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "ActionKind": {
        "name": "action_kind",
        "description": "filter on type of operation",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "Create",
            "Update",
            "Delete",
            "Execute"
          ]
        }
      },
      "JobKinds": {
        "name": "job_kinds",
        "description": "filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by,",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "RunnableId": {
        "name": "runnable_id",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "RunnableTypeQuery": {
        "name": "runnable_type",
        "in": "query",
        "schema": {
          "$ref": "#/components/schemas/RunnableType"
        }
      },
      "InputId": {
        "name": "input",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "GetStarted": {
        "name": "get_started",
        "in": "query",
        "schema": {
          "type": "boolean"
        }
      },
      "ConcurrencyId": {
        "name": "concurrency_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "Script": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "parent_hashes": {
            "type": "array",
            "description": "The first element is the direct parent of the script, the second is the parent of the first, etc\n",
            "items": {
              "type": "string"
            }
          },
          "summary": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "archived": {
            "type": "boolean"
          },
          "schema": {
            "type": "object"
          },
          "deleted": {
            "type": "boolean"
          },
          "is_template": {
            "type": "boolean"
          },
          "extra_perms": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "lock": {
            "type": "string"
          },
          "lock_error_logs": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "python3",
              "deno",
              "go",
              "bash",
              "powershell",
              "postgresql",
              "mysql",
              "bigquery",
              "snowflake",
              "mssql",
              "graphql",
              "nativets",
              "bun"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "script",
              "failure",
              "trigger",
              "command",
              "approval"
            ]
          },
          "starred": {
            "type": "boolean"
          },
          "tag": {
            "type": "string"
          },
          "has_draft": {
            "type": "boolean"
          },
          "draft_only": {
            "type": "boolean"
          },
          "envs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "concurrent_limit": {
            "type": "integer"
          },
          "concurrency_time_window_s": {
            "type": "integer"
          },
          "cache_ttl": {
            "type": "number"
          },
          "dedicated_worker": {
            "type": "boolean"
          },
          "ws_error_handler_muted": {
            "type": "boolean"
          },
          "priority": {
            "type": "integer"
          },
          "restart_unless_cancelled": {
            "type": "boolean"
          },
          "timeout": {
            "type": "integer"
          },
          "delete_after_use": {
            "type": "boolean"
          },
          "visible_to_runner_only": {
            "type": "boolean"
          }
        },
        "required": [
          "hash",
          "path",
          "summary",
          "description",
          "content",
          "created_by",
          "created_at",
          "archived",
          "deleted",
          "is_template",
          "extra_perms",
          "language",
          "kind",
          "starred"
        ]
      },
      "NewScript": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "parent_hash": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "schema": {
            "type": "object"
          },
          "is_template": {
            "type": "boolean"
          },
          "lock": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "python3",
              "deno",
              "go",
              "bash",
              "powershell",
              "postgresql",
              "mysql",
              "bigquery",
              "snowflake",
              "mssql",
              "graphql",
              "nativets",
              "bun"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "script",
              "failure",
              "trigger",
              "command",
              "approval"
            ]
          },
          "tag": {
            "type": "string"
          },
          "draft_only": {
            "type": "boolean"
          },
          "envs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "concurrent_limit": {
            "type": "integer"
          },
          "concurrency_time_window_s": {
            "type": "integer"
          },
          "cache_ttl": {
            "type": "number"
          },
          "dedicated_worker": {
            "type": "boolean"
          },
          "ws_error_handler_muted": {
            "type": "boolean"
          },
          "priority": {
            "type": "integer"
          },
          "restart_unless_cancelled": {
            "type": "boolean"
          },
          "timeout": {
            "type": "integer"
          },
          "delete_after_use": {
            "type": "boolean"
          },
          "deployment_message": {
            "type": "string"
          },
          "concurrency_key": {
            "type": "string"
          },
          "visible_to_runner_only": {
            "type": "boolean"
          }
        },
        "required": [
          "path",
          "summary",
          "description",
          "content",
          "language"
        ]
      },
      "NewScriptWithDraft": {
        "allOf": [
          {
            "$ref": "#/components/schemas/NewScript"
          },
          {
            "type": "object",
            "properties": {
              "draft": {
                "$ref": "#/components/schemas/NewScript"
              },
              "hash": {
                "type": "string"
              }
            },
            "required": [
              "hash"
            ]
          }
        ]
      },
      "ScriptHistory": {
        "type": "object",
        "properties": {
          "script_hash": {
            "type": "string"
          },
          "deployment_msg": {
            "type": "string"
          }
        },
        "required": [
          "script_hash"
        ]
      },
      "ScriptArgs": {
        "type": "object",
        "additionalProperties": {}
      },
      "Input": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "args": {
            "type": "object"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "is_public": {
            "type": "boolean"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "args",
          "created_by",
          "created_at",
          "is_public"
        ]
      },
      "CreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "args": {
            "type": "object"
          }
        },
        "required": [
          "name",
          "args",
          "created_by"
        ]
      },
      "UpdateInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "is_public": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "is_public"
        ]
      },
      "RunnableType": {
        "type": "string",
        "enum": [
          "ScriptHash",
          "ScriptPath",
          "FlowPath"
        ]
      },
      "QueuedJob": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "parent_job": {
            "type": "string",
            "format": "uuid"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "scheduled_for": {
            "type": "string",
            "format": "date-time"
          },
          "running": {
            "type": "boolean"
          },
          "script_path": {
            "type": "string"
          },
          "script_hash": {
            "type": "string"
          },
          "args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "logs": {
            "type": "string"
          },
          "raw_code": {
            "type": "string"
          },
          "canceled": {
            "type": "boolean"
          },
          "canceled_by": {
            "type": "string"
          },
          "canceled_reason": {
            "type": "string"
          },
          "last_ping": {
            "type": "string",
            "format": "date-time"
          },
          "job_kind": {
            "type": "string",
            "enum": [
              "script",
              "preview",
              "dependencies",
              "flowdependencies",
              "appdependencies",
              "flow",
              "flowpreview",
              "script_hub",
              "identity",
              "deploymentcallback",
              "singlescriptflow"
            ]
          },
          "schedule_path": {
            "type": "string"
          },
          "permissioned_as": {
            "type": "string",
            "description": "The user (u/userfoo) or group (g/groupfoo) whom \nthe execution of this script will be permissioned_as and by extension its DT_TOKEN.\n"
          },
          "flow_status": {
            "$ref": "#/components/schemas/FlowStatus"
          },
          "raw_flow": {
            "$ref": "#/components/schemas/FlowValue"
          },
          "is_flow_step": {
            "type": "boolean"
          },
          "language": {
            "type": "string",
            "enum": [
              "python3",
              "deno",
              "go",
              "bash",
              "powershell",
              "postgresql",
              "mysql",
              "bigquery",
              "snowflake",
              "mssql",
              "graphql",
              "nativets",
              "bun"
            ]
          },
          "email": {
            "type": "string"
          },
          "visible_to_owner": {
            "type": "boolean"
          },
          "mem_peak": {
            "type": "integer"
          },
          "tag": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "running",
          "canceled",
          "job_kind",
          "permissioned_as",
          "is_flow_step",
          "email",
          "visible_to_owner",
          "tag"
        ]
      },
      "CompletedJob": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "parent_job": {
            "type": "string",
            "format": "uuid"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "duration_ms": {
            "type": "integer"
          },
          "success": {
            "type": "boolean"
          },
          "script_path": {
            "type": "string"
          },
          "script_hash": {
            "type": "string"
          },
          "args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "result": {},
          "logs": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          },
          "raw_code": {
            "type": "string"
          },
          "canceled": {
            "type": "boolean"
          },
          "canceled_by": {
            "type": "string"
          },
          "canceled_reason": {
            "type": "string"
          },
          "job_kind": {
            "type": "string",
            "enum": [
              "script",
              "preview",
              "dependencies",
              "flow",
              "flowdependencies",
              "appdependencies",
              "flowpreview",
              "script_hub",
              "identity",
              "deploymentcallback",
              "singlescriptflow"
            ]
          },
          "schedule_path": {
            "type": "string"
          },
          "permissioned_as": {
            "type": "string",
            "description": "The user (u/userfoo) or group (g/groupfoo) whom \nthe execution of this script will be permissioned_as and by extension its DT_TOKEN.\n"
          },
          "flow_status": {
            "$ref": "#/components/schemas/FlowStatus"
          },
          "raw_flow": {
            "$ref": "#/components/schemas/FlowValue"
          },
          "is_flow_step": {
            "type": "boolean"
          },
          "language": {
            "type": "string",
            "enum": [
              "python3",
              "deno",
              "go",
              "bash",
              "powershell",
              "postgresql",
              "mysql",
              "bigquery",
              "snowflake",
              "mssql",
              "graphql",
              "nativets",
              "bun"
            ]
          },
          "is_skipped": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "visible_to_owner": {
            "type": "boolean"
          },
          "mem_peak": {
            "type": "integer"
          },
          "tag": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "created_by",
          "duration_ms",
          "created_at",
          "started_at",
          "success",
          "canceled",
          "job_kind",
          "permissioned_as",
          "is_flow_step",
          "is_skipped",
          "email",
          "visible_to_owner",
          "tag"
        ]
      },
      "Job": {
        "allOf": [
          {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CompletedJob"
              },
              {
                "$ref": "#/components/schemas/QueuedJob"
              }
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "CompletedJob",
                  "QueuedJob"
                ]
              }
            }
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "User": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "is_admin": {
            "type": "boolean"
          },
          "is_super_admin": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "operator": {
            "type": "boolean"
          },
          "disabled": {
            "type": "boolean"
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "folders": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "folders_owners": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "email",
          "username",
          "is_admin",
          "is_super_admin",
          "created_at",
          "operator",
          "disabled",
          "folders",
          "folders_owners"
        ]
      },
      "UserUsage": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "executions": {
            "type": "number"
          }
        }
      },
      "Login": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "password"
        ]
      },
      "EditWorkspaceUser": {
        "type": "object",
        "properties": {
          "is_admin": {
            "type": "boolean"
          },
          "operator": {
            "type": "boolean"
          },
          "disabled": {
            "type": "boolean"
          }
        }
      },
      "TruncatedToken": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "expiration": {
            "type": "string",
            "format": "date-time"
          },
          "token_prefix": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "token_prefix",
          "created_at",
          "last_used_at"
        ]
      },
      "NewToken": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "expiration": {
            "type": "string",
            "format": "date-time"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "NewTokenImpersonate": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "expiration": {
            "type": "string",
            "format": "date-time"
          },
          "impersonate_email": {
            "type": "string"
          }
        },
        "required": [
          "impersonate_email"
        ]
      },
      "ListableVariable": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "is_secret": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "account": {
            "type": "integer"
          },
          "is_oauth": {
            "type": "boolean"
          },
          "extra_perms": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "is_expired": {
            "type": "boolean"
          },
          "refresh_error": {
            "type": "string"
          },
          "is_linked": {
            "type": "boolean"
          },
          "is_refreshed": {
            "type": "boolean"
          }
        },
        "required": [
          "workspace_id",
          "path",
          "is_secret",
          "extra_perms"
        ]
      },
      "ContextualVariable": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "is_custom": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "value",
          "description",
          "is_custom"
        ]
      },
      "CreateVariable": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "is_secret": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "account": {
            "type": "integer"
          },
          "is_oauth": {
            "type": "boolean"
          }
        },
        "required": [
          "path",
          "value",
          "is_secret",
          "description"
        ]
      },
      "EditVariable": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "is_secret": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "AuditLog": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "username": {
            "type": "string"
          },
          "operation": {
            "type": "string",
            "enum": [
              "jobs.run",
              "jobs.run.script",
              "jobs.run.preview",
              "jobs.run.flow",
              "jobs.run.flow_preview",
              "jobs.run.script_hub",
              "jobs.run.dependencies",
              "jobs.run.identity",
              "jobs.run.noop",
              "jobs.flow_dependencies",
              "jobs",
              "jobs.cancel",
              "jobs.force_cancel",
              "jobs.disapproval",
              "jobs.delete",
              "account.delete",
              "openai.request",
              "resources.create",
              "resources.update",
              "resources.delete",
              "resource_types.create",
              "resource_types.update",
              "resource_types.delete",
              "schedule.create",
              "schedule.setenabled",
              "schedule.edit",
              "schedule.delete",
              "scripts.create",
              "scripts.update",
              "scripts.archive",
              "scripts.delete",
              "users.create",
              "users.delete",
              "users.update",
              "users.login",
              "users.logout",
              "users.accept_invite",
              "users.decline_invite",
              "users.token.create",
              "users.token.delete",
              "users.add_to_workspace",
              "users.add_global",
              "users.setpassword",
              "users.impersonate",
              "users.leave_workspace",
              "oauth.login",
              "oauth.signup",
              "variables.create",
              "variables.delete",
              "variables.update",
              "flows.create",
              "flows.update",
              "flows.delete",
              "flows.archive",
              "apps.create",
              "apps.update",
              "apps.delete",
              "folder.create",
              "folder.update",
              "folder.delete",
              "folder.add_owner",
              "folder.remove_owner",
              "group.create",
              "group.delete",
              "group.edit",
              "group.adduser",
              "group.removeuser",
              "igroup.create",
              "igroup.delete",
              "igroup.adduser",
              "igroup.removeuser",
              "variables.decrypt_secret",
              "workspaces.edit_command_script",
              "workspaces.edit_deploy_to",
              "workspaces.edit_auto_invite_domain",
              "workspaces.edit_webhook",
              "workspaces.edit_copilot_config",
              "workspaces.edit_error_handler",
              "workspaces.create",
              "workspaces.update",
              "workspaces.archive",
              "workspaces.unarchive",
              "workspaces.delete"
            ]
          },
          "action_kind": {
            "type": "string",
            "enum": [
              "Created",
              "Updated",
              "Delete",
              "Execute"
            ]
          },
          "resource": {
            "type": "string"
          },
          "parameters": {
            "type": "object"
          }
        },
        "required": [
          "id",
          "timestamp",
          "username",
          "operation",
          "action_kind"
        ]
      },
      "MainArgSignature": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "Valid",
              "Invalid"
            ]
          },
          "error": {
            "type": "string"
          },
          "star_args": {
            "type": "boolean"
          },
          "star_kwargs": {
            "type": "boolean"
          },
          "args": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "typ": {
                  "oneOf": [
                    {
                      "type": "string",
                      "enum": [
                        "float",
                        "int",
                        "bool",
                        "email",
                        "unknown",
                        "bytes",
                        "dict",
                        "datetime",
                        "sql"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "resource": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "resource"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "str": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "nullable": true
                        }
                      },
                      "required": [
                        "str"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "object": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "typ": {
                                "oneOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "float",
                                      "int",
                                      "bool",
                                      "email",
                                      "unknown",
                                      "bytes",
                                      "dict",
                                      "datetime",
                                      "sql"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "str": {}
                                    },
                                    "required": [
                                      "str"
                                    ]
                                  }
                                ]
                              }
                            },
                            "required": [
                              "key",
                              "typ"
                            ]
                          }
                        }
                      },
                      "required": [
                        "object"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "list": {
                          "oneOf": [
                            {
                              "type": "string",
                              "enum": [
                                "float",
                                "int",
                                "bool",
                                "email",
                                "unknown",
                                "bytes",
                                "dict",
                                "datetime",
                                "sql"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "str": {}
                              },
                              "required": [
                                "str"
                              ]
                            }
                          ],
                          "nullable": true
                        }
                      },
                      "required": [
                        "list"
                      ]
                    }
                  ]
                },
                "has_default": {
                  "type": "boolean"
                },
                "default": {}
              },
              "required": [
                "name",
                "typ"
              ]
            }
          }
        },
        "required": [
          "star_args",
          "start_kwargs",
          "args",
          "type",
          "error"
        ]
      },
      "Preview": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "language": {
            "type": "string",
            "enum": [
              "python3",
              "deno",
              "go",
              "bash",
              "powershell",
              "postgresql",
              "mysql",
              "bigquery",
              "snowflake",
              "mssql",
              "graphql",
              "nativets",
              "bun"
            ]
          },
          "tag": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "code",
              "identity",
              "http"
            ]
          },
          "dedicated_worker": {
            "type": "boolean"
          },
          "lock": {
            "type": "string"
          }
        },
        "required": [
          "args"
        ]
      },
      "WorkflowTask": {
        "type": "object",
        "properties": {
          "args": {
            "$ref": "#/components/schemas/ScriptArgs"
          }
        },
        "required": [
          "args"
        ]
      },
      "WorkflowStatusRecord": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/WorkflowStatus"
        }
      },
      "WorkflowStatus": {
        "type": "object",
        "properties": {
          "scheduled_for": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "duration_ms": {
            "type": "number"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "CreateResource": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "value": {},
          "description": {
            "type": "string"
          },
          "resource_type": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "value",
          "resource_type"
        ]
      },
      "EditResource": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "value": {}
        }
      },
      "Resource": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "resource_type": {
            "type": "string"
          },
          "value": {},
          "is_oauth": {
            "type": "boolean"
          },
          "extra_perms": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        },
        "required": [
          "path",
          "resource_type",
          "is_oauth"
        ]
      },
      "ListableResource": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "resource_type": {
            "type": "string"
          },
          "value": {},
          "is_oauth": {
            "type": "boolean"
          },
          "extra_perms": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "is_expired": {
            "type": "boolean"
          },
          "refresh_error": {
            "type": "string"
          },
          "is_linked": {
            "type": "boolean"
          },
          "is_refreshed": {
            "type": "boolean"
          },
          "account": {
            "type": "number"
          }
        },
        "required": [
          "path",
          "resource_type",
          "is_oauth",
          "is_linked",
          "is_refreshed"
        ]
      },
      "ResourceType": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "schema": {},
          "description": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      },
      "EditResourceType": {
        "type": "object",
        "properties": {
          "schema": {},
          "description": {
            "type": "string"
          }
        }
      },
      "Schedule": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "edited_by": {
            "type": "string"
          },
          "edited_at": {
            "type": "string",
            "format": "date-time"
          },
          "schedule": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "script_path": {
            "type": "string"
          },
          "is_flow": {
            "type": "boolean"
          },
          "args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "extra_perms": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "email": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "on_failure": {
            "type": "string"
          },
          "on_failure_times": {
            "type": "number"
          },
          "on_failure_exact": {
            "type": "boolean"
          },
          "on_failure_extra_args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "on_recovery": {
            "type": "string"
          },
          "on_recovery_times": {
            "type": "number"
          },
          "on_recovery_extra_args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "ws_error_handler_muted": {
            "type": "boolean"
          },
          "retry": {
            "$ref": "#/components/schemas/Retry"
          },
          "summary": {
            "type": "string"
          },
          "no_flow_overlap": {
            "type": "boolean"
          },
          "tag": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "edited_by",
          "edited_at",
          "schedule",
          "script_path",
          "timezone",
          "extra_perms",
          "is_flow",
          "enabled",
          "email"
        ]
      },
      "ScheduleWJobs": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Schedule"
          },
          {
            "type": "object",
            "properties": {
              "jobs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "success": {
                      "type": "boolean"
                    },
                    "duration_ms": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "id",
                    "success",
                    "duration_ms"
                  ]
                }
              }
            }
          }
        ]
      },
      "NewSchedule": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "schedule": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "script_path": {
            "type": "string"
          },
          "is_flow": {
            "type": "boolean"
          },
          "args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "enabled": {
            "type": "boolean"
          },
          "on_failure": {
            "type": "string"
          },
          "on_failure_times": {
            "type": "number"
          },
          "on_failure_exact": {
            "type": "boolean"
          },
          "on_failure_extra_args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "on_recovery": {
            "type": "string"
          },
          "on_recovery_times": {
            "type": "number"
          },
          "on_recovery_extra_args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "ws_error_handler_muted": {
            "type": "boolean"
          },
          "retry": {
            "$ref": "#/components/schemas/Retry"
          },
          "no_flow_overlap": {
            "type": "boolean"
          },
          "summary": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "schedule",
          "timezone",
          "script_path",
          "is_flow",
          "args"
        ]
      },
      "EditSchedule": {
        "type": "object",
        "properties": {
          "schedule": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "on_failure": {
            "type": "string"
          },
          "on_failure_times": {
            "type": "number"
          },
          "on_failure_exact": {
            "type": "boolean"
          },
          "on_failure_extra_args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "on_recovery": {
            "type": "string"
          },
          "on_recovery_times": {
            "type": "number"
          },
          "on_recovery_extra_args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "ws_error_handler_muted": {
            "type": "boolean"
          },
          "retry": {
            "$ref": "#/components/schemas/Retry"
          },
          "no_flow_overlap": {
            "type": "boolean"
          },
          "summary": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          }
        },
        "required": [
          "schedule",
          "timezone",
          "script_path",
          "is_flow",
          "args"
        ]
      },
      "Group": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "members": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "extra_perms": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        },
        "required": [
          "name"
        ]
      },
      "InstanceGroup": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name"
        ]
      },
      "Folder": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "owners": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "extra_perms": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        },
        "required": [
          "name",
          "owners",
          "extra_perms"
        ]
      },
      "WorkerPing": {
        "type": "object",
        "properties": {
          "worker": {
            "type": "string"
          },
          "worker_instance": {
            "type": "string"
          },
          "last_ping": {
            "type": "number"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ip": {
            "type": "string"
          },
          "jobs_executed": {
            "type": "integer"
          },
          "custom_tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "worker_group": {
            "type": "string"
          },
          "wm_version": {
            "type": "string"
          }
        },
        "required": [
          "worker",
          "worker_instance",
          "ping_at",
          "started_at",
          "ip",
          "jobs_executed",
          "worker_group",
          "wm_version"
        ]
      },
      "UserWorkspaceList": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "workspaces": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "username": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "username"
              ]
            }
          }
        },
        "required": [
          "email",
          "workspaces"
        ]
      },
      "CreateWorkspace": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "Workspace": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "owner"
        ]
      },
      "WorkspaceInvite": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "is_admin": {
            "type": "boolean"
          },
          "operator": {
            "type": "boolean"
          }
        },
        "required": [
          "workspace_id",
          "email",
          "is_admin",
          "operator"
        ]
      },
      "GlobalUserInfo": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "login_type": {
            "type": "string",
            "enum": [
              "password",
              "github"
            ]
          },
          "super_admin": {
            "type": "boolean"
          },
          "verified": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "login_type",
          "super_admin",
          "verified"
        ]
      },
      "Flow": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OpenFlow"
          },
          {
            "$ref": "#/components/schemas/FlowMetadata"
          }
        ]
      },
      "FlowMetadata": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "edited_by": {
            "type": "string"
          },
          "edited_at": {
            "type": "string",
            "format": "date-time"
          },
          "archived": {
            "type": "boolean"
          },
          "extra_perms": {
            "type": "object"
          },
          "additionalProperties": {
            "type": "boolean"
          },
          "starred": {
            "type": "boolean"
          },
          "draft_only": {
            "type": "boolean"
          },
          "tag": {
            "type": "string"
          },
          "ws_error_handler_muted": {
            "type": "boolean"
          },
          "priority": {
            "type": "integer"
          },
          "dedicated_worker": {
            "type": "boolean"
          },
          "timeout": {
            "type": "number"
          },
          "visible_to_runner_only": {
            "type": "boolean"
          }
        },
        "required": [
          "path",
          "edited_by",
          "edited_at",
          "archived",
          "extra_perms"
        ]
      },
      "OpenFlowWPath": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OpenFlow"
          },
          {
            "type": "object",
            "properties": {
              "path": {
                "type": "string"
              },
              "tag": {
                "type": "string"
              },
              "ws_error_handler_muted": {
                "type": "boolean"
              },
              "priority": {
                "type": "integer"
              },
              "dedicated_worker": {
                "type": "boolean"
              },
              "timeout": {
                "type": "number"
              },
              "visible_to_runner_only": {
                "type": "boolean"
              }
            },
            "required": [
              "path"
            ]
          }
        ]
      },
      "FlowPreview": {
        "type": "object",
        "properties": {
          "value": {
            "$ref": "#/components/schemas/FlowValue"
          },
          "path": {
            "type": "string"
          },
          "args": {
            "$ref": "#/components/schemas/ScriptArgs"
          },
          "tag": {
            "type": "string"
          },
          "restarted_from": {
            "$ref": "#/components/schemas/RestartedFrom"
          }
        },
        "required": [
          "value",
          "content",
          "args"
        ]
      },
      "RestartedFrom": {
        "type": "object",
        "properties": {
          "flow_job_id": {
            "type": "string",
            "format": "uuid"
          },
          "step_id": {
            "type": "string"
          },
          "branch_or_iteration_n": {
            "type": "integer"
          }
        }
      },
      "Policy": {
        "type": "object",
        "properties": {
          "triggerables": {
            "type": "object",
            "additionalProperties": {
              "type": "object"
            }
          },
          "execution_mode": {
            "type": "string",
            "enum": [
              "viewer",
              "publisher",
              "anonymous"
            ]
          },
          "on_behalf_of": {
            "type": "string"
          },
          "on_behalf_of_email": {
            "type": "string"
          }
        }
      },
      "ListableApp": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "workspace_id": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "extra_perms": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "starred": {
            "type": "boolean"
          },
          "edited_at": {
            "type": "string",
            "format": "date-time"
          },
          "execution_mode": {
            "type": "string",
            "enum": [
              "viewer",
              "publisher",
              "anonymous"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "path",
          "summary",
          "version",
          "extra_perms",
          "edited_at",
          "execution_mode"
        ]
      },
      "ListableRawApp": {
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "extra_perms": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "starred": {
            "type": "boolean"
          },
          "version": {
            "type": "number"
          },
          "edited_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "workspace_id",
          "path",
          "summary",
          "extra_perms",
          "version",
          "edited_at"
        ]
      },
      "AppWithLastVersion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "workspace_id": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "value": {},
          "policy": {
            "$ref": "#/components/schemas/Policy"
          },
          "execution_mode": {
            "type": "string",
            "enum": [
              "viewer",
              "publisher",
              "anonymous"
            ]
          },
          "extra_perms": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        },
        "required": [
          "id",
          "workspace_id",
          "path",
          "summary",
          "versions",
          "created_by",
          "created_at",
          "value",
          "policy",
          "execution_mode",
          "extra_perms"
        ]
      },
      "AppWithLastVersionWDraft": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AppWithLastVersion"
          },
          {
            "type": "object",
            "properties": {
              "draft_only": {
                "type": "boolean"
              },
              "draft": {}
            }
          }
        ]
      },
      "AppHistory": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer"
          },
          "deployment_msg": {
            "type": "string"
          }
        },
        "required": [
          "version"
        ]
      },
      "SlackToken": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string"
          },
          "team_id": {
            "type": "string"
          },
          "team_name": {
            "type": "string"
          },
          "bot": {
            "type": "object",
            "properties": {
              "bot_access_token": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "access_token",
          "team_id",
          "team_name",
          "bot"
        ]
      },
      "TokenResponse": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string"
          },
          "expires_in": {
            "type": "integer"
          },
          "refresh_token": {
            "type": "string"
          },
          "scope": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "access_token"
        ]
      },
      "HubScriptKind": {
        "name": "kind",
        "schema": {
          "type": "string",
          "enum": [
            "script",
            "failure",
            "trigger",
            "approval"
          ]
        }
      },
      "PolarsClientKwargs": {
        "type": "object",
        "properties": {
          "region_name": {
            "type": "string"
          }
        },
        "required": [
          "region_name"
        ]
      },
      "LargeFileStorage": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "S3Storage",
              "AzureBlobStorage",
              "AzureWorkloadIdentity",
              "S3AwsOidc"
            ]
          },
          "s3_resource_path": {
            "type": "string"
          },
          "azure_blob_resource_path": {
            "type": "string"
          },
          "public_resource": {
            "type": "boolean"
          }
        }
      },
      "WindmillLargeFile": {
        "type": "object",
        "properties": {
          "s3": {
            "type": "string"
          }
        },
        "required": [
          "s3"
        ]
      },
      "WindmillFileMetadata": {
        "type": "object",
        "properties": {
          "mime_type": {
            "type": "string"
          },
          "size_in_bytes": {
            "type": "integer"
          },
          "last_modified": {
            "type": "string",
            "format": "date-time"
          },
          "expires": {
            "type": "string",
            "format": "date-time"
          },
          "version_id": {
            "type": "string"
          }
        }
      },
      "WindmillFilePreview": {
        "type": "object",
        "properties": {
          "msg": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "content_type": {
            "type": "string",
            "enum": [
              "RawText",
              "Csv",
              "Parquet",
              "Unknown"
            ]
          }
        },
        "required": [
          "content_type"
        ]
      },
      "S3Resource": {
        "type": "object",
        "properties": {
          "bucket": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "endPoint": {
            "type": "string"
          },
          "useSSL": {
            "type": "boolean"
          },
          "accessKey": {
            "type": "string"
          },
          "secretKey": {
            "type": "string"
          },
          "pathStyle": {
            "type": "boolean"
          }
        },
        "required": [
          "bucket",
          "region",
          "endPoint",
          "useSSL",
          "pathStyle"
        ]
      },
      "WorkspaceGitSyncSettings": {
        "type": "object",
        "properties": {
          "include_path": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "include_type": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "script",
                "flow",
                "app",
                "folder",
                "resource",
                "variable",
                "secret",
                "resourcetype",
                "schedule",
                "user",
                "group"
              ]
            }
          },
          "repositories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GitRepositorySettings"
            }
          }
        }
      },
      "WorkspaceDefaultScripts": {
        "type": "object",
        "properties": {
          "order": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hidden": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "default_script_content": {
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "GitRepositorySettings": {
        "type": "object",
        "properties": {
          "script_path": {
            "type": "string"
          },
          "git_repo_resource_path": {
            "type": "string"
          },
          "use_individual_branch": {
            "type": "boolean"
          },
          "group_by_folder": {
            "type": "boolean"
          },
          "exclude_types_override": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "script",
                "flow",
                "app",
                "folder",
                "resource",
                "variable",
                "secret",
                "resourcetype",
                "schedule",
                "user",
                "group"
              ]
            }
          }
        },
        "required": [
          "script_path",
          "git_repo_resource_path"
        ]
      },
      "UploadFilePart": {
        "type": "object",
        "properties": {
          "part_number": {
            "type": "integer"
          },
          "tag": {
            "type": "string"
          }
        },
        "required": [
          "part_number",
          "tag"
        ]
      },
      "MetricMetadata": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ]
      },
      "ScalarMetric": {
        "type": "object",
        "properties": {
          "metric_id": {
            "type": "string"
          },
          "value": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "value"
        ]
      },
      "TimeseriesMetric": {
        "type": "object",
        "properties": {
          "metric_id": {
            "type": "string"
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetricDataPoint"
            }
          }
        },
        "required": [
          "id",
          "values"
        ]
      },
      "MetricDataPoint": {
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "value": {
            "type": "number"
          }
        },
        "required": [
          "timestamp",
          "value"
        ]
      },
      "RawScriptForDependencies": {
        "type": "object",
        "properties": {
          "raw_code": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "python3",
              "deno",
              "go",
              "bash",
              "powershell",
              "postgresql",
              "mysql",
              "bigquery",
              "snowflake",
              "mssql",
              "graphql",
              "nativets",
              "bun"
            ]
          }
        },
        "required": [
          "raw_code",
          "path",
          "language"
        ]
      },
      "ConcurrencyGroup": {
        "type": "object",
        "properties": {
          "concurrency_id": {
            "type": "string"
          },
          "job_uuids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "concurrency_id",
          "job_uuids"
        ]
      },
      "StaticTransform": {
        "type": "object",
        "properties": {
          "value": {},
          "type": {
            "type": "string",
            "enum": [
              "javascript"
            ]
          }
        },
        "required": [
          "expr",
          "type"
        ]
      },
      "JavascriptTransform": {
        "type": "object",
        "properties": {
          "expr": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "javascript"
            ]
          }
        },
        "required": [
          "expr",
          "type"
        ]
      },
      "InputTransform": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/StaticTransform"
          },
          {
            "$ref": "#/components/schemas/JavascriptTransform"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "static": "#/components/schemas/StaticTransform",
            "javascript": "#/components/schemas/JavascriptTransform"
          }
        }
      },
      "RawScript": {
        "type": "object",
        "properties": {
          "input_transforms": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/InputTransform"
            }
          },
          "content": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "deno",
              "bun",
              "python3",
              "go",
              "bash",
              "powershell",
              "postgresql",
              "mysql",
              "bigquery",
              "snowflake",
              "mssql",
              "graphql",
              "nativets"
            ]
          },
          "path": {
            "type": "string"
          },
          "lock": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "rawscript"
            ]
          },
          "tag": {
            "type": "string"
          },
          "concurrent_limit": {
            "type": "number"
          },
          "concurrency_time_window_s": {
            "type": "number"
          }
        },
        "required": [
          "type",
          "content",
          "language",
          "input_transforms"
        ]
      },
      "PathScript": {
        "type": "object",
        "properties": {
          "input_transforms": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/InputTransform"
            }
          },
          "path": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "script"
            ]
          }
        },
        "required": [
          "type",
          "path",
          "input_transforms"
        ]
      },
      "PathFlow": {
        "type": "object",
        "properties": {
          "input_transforms": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/InputTransform"
            }
          },
          "path": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "flow"
            ]
          }
        },
        "required": [
          "type",
          "path",
          "input_transforms"
        ]
      },
      "FlowModule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "value": {
            "$ref": "#/components/schemas/FlowModuleValue"
          },
          "stop_after_if": {
            "type": "object",
            "properties": {
              "skip_if_stopped": {
                "type": "boolean"
              },
              "expr": {
                "type": "string"
              }
            },
            "required": [
              "expr"
            ]
          },
          "sleep": {
            "$ref": "#/components/schemas/InputTransform"
          },
          "cache_ttl": {
            "type": "number"
          },
          "timeout": {
            "type": "number"
          },
          "delete_after_use": {
            "type": "boolean"
          },
          "summary": {
            "type": "string"
          },
          "mock": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "return_value": {}
            }
          },
          "suspend": {
            "type": "object",
            "properties": {
              "required_events": {
                "type": "integer"
              },
              "timeout": {
                "type": "integer"
              },
              "resume_form": {
                "type": "object",
                "properties": {
                  "schema": {
                    "type": "object"
                  }
                }
              },
              "user_auth_required": {
                "type": "boolean"
              },
              "user_groups_required": {
                "$ref": "#/components/schemas/InputTransform"
              },
              "self_approval_disabled": {
                "type": "boolean"
              },
              "hide_cancel": {
                "type": "boolean"
              }
            }
          },
          "priority": {
            "type": "number"
          },
          "continue_on_error": {
            "type": "boolean"
          },
          "retry": {
            "$ref": "#/components/schemas/Retry"
          }
        },
        "required": [
          "value",
          "id"
        ]
      },
      "ForloopFlow": {
        "type": "object",
        "properties": {
          "modules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowModule"
            }
          },
          "iterator": {
            "$ref": "#/components/schemas/InputTransform"
          },
          "skip_failures": {
            "type": "boolean"
          },
          "type": {
            "type": "string",
            "enum": [
              "forloopflow"
            ]
          },
          "parallel": {
            "type": "boolean"
          },
          "parallelism": {
            "type": "integer"
          }
        },
        "required": [
          "modules",
          "iterator",
          "skip_failures",
          "type"
        ]
      },
      "WhileloopFlow": {
        "type": "object",
        "properties": {
          "modules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowModule"
            }
          },
          "skip_failures": {
            "type": "boolean"
          },
          "type": {
            "type": "string",
            "enum": [
              "forloopflow"
            ]
          },
          "parallel": {
            "type": "boolean"
          },
          "parallelism": {
            "type": "integer"
          }
        },
        "required": [
          "modules",
          "skip_failures",
          "type"
        ]
      },
      "BranchOne": {
        "type": "object",
        "properties": {
          "branches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "summary": {
                  "type": "string"
                },
                "expr": {
                  "type": "string"
                },
                "modules": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FlowModule"
                  }
                }
              },
              "required": [
                "modules",
                "expr"
              ]
            }
          },
          "default": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowModule"
            },
            "required": [
              "modules"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "branchone"
            ]
          }
        },
        "required": [
          "branches",
          "default",
          "type"
        ]
      },
      "BranchAll": {
        "type": "object",
        "properties": {
          "branches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "summary": {
                  "type": "string"
                },
                "skip_failure": {
                  "type": "boolean"
                },
                "modules": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FlowModule"
                  }
                }
              },
              "required": [
                "modules",
                "expr"
              ]
            }
          },
          "type": {
            "type": "string",
            "enum": [
              "branchall"
            ]
          },
          "parallel": {
            "type": "boolean"
          }
        },
        "required": [
          "branches",
          "type"
        ]
      },
      "Identity": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "identity"
            ]
          },
          "flow": {
            "type": "boolean"
          }
        },
        "required": [
          "type"
        ]
      },
      "FlowModuleValue": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/RawScript"
          },
          {
            "$ref": "#/components/schemas/PathScript"
          },
          {
            "$ref": "#/components/schemas/PathFlow"
          },
          {
            "$ref": "#/components/schemas/ForloopFlow"
          },
          {
            "$ref": "#/components/schemas/WhileloopFlow"
          },
          {
            "$ref": "#/components/schemas/BranchOne"
          },
          {
            "$ref": "#/components/schemas/BranchAll"
          },
          {
            "$ref": "#/components/schemas/Identity"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "rawscript": "#/components/schemas/RawScript",
            "script": "#/components/schemas/PathScript",
            "flow": "#/components/schemas/PathFlow",
            "forloopflow": "#/components/schemas/ForloopFlow",
            "whileloopflow": "#/components/schemas/WhileloopFlow",
            "branchone": "#/components/schemas/BranchOne",
            "branchall": "#/components/schemas/BranchAll",
            "identity": "#/components/schemas/Identity"
          }
        }
      },
      "Retry": {
        "type": "object",
        "properties": {
          "constant": {
            "type": "object",
            "properties": {
              "attempts": {
                "type": "integer"
              },
              "seconds": {
                "type": "integer"
              }
            }
          },
          "exponential": {
            "type": "object",
            "properties": {
              "attempts": {
                "type": "integer"
              },
              "multiplier": {
                "type": "integer"
              },
              "seconds": {
                "type": "integer"
              },
              "random_factor": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              }
            }
          }
        }
      },
      "FlowValue": {
        "type": "object",
        "properties": {
          "modules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowModule"
            }
          },
          "failure_module": {
            "$ref": "#/components/schemas/FlowModule"
          },
          "same_worker": {
            "type": "boolean"
          },
          "concurrent_limit": {
            "type": "number"
          },
          "concurrency_time_window_s": {
            "type": "number"
          },
          "skip_expr": {
            "type": "string"
          },
          "cache_ttl": {
            "type": "number"
          },
          "priority": {
            "type": "number"
          },
          "early_return": {
            "type": "string"
          }
        },
        "required": [
          "modules"
        ]
      },
      "OpenFlow": {
        "type": "object",
        "properties": {
          "summary": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "value": {
            "$ref": "#/components/schemas/FlowValue"
          },
          "schema": {
            "type": "object"
          }
        },
        "required": [
          "summary",
          "value"
        ]
      },
      "FlowStatusModule": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "WaitingForPriorSteps",
              "WaitingForEvents",
              "WaitingForExecutor",
              "InProgress",
              "Success",
              "Failure"
            ]
          },
          "id": {
            "type": "string"
          },
          "job": {
            "type": "string",
            "format": "uuid"
          },
          "count": {
            "type": "integer"
          },
          "iterator": {
            "type": "object",
            "properties": {
              "index": {
                "type": "integer"
              },
              "itered": {
                "type": "array",
                "items": {}
              },
              "args": {}
            }
          },
          "flow_jobs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "branch_chosen": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "branch",
                  "default"
                ]
              },
              "branch": {
                "type": "integer"
              }
            },
            "required": [
              "type"
            ]
          },
          "branchall": {
            "type": "object",
            "properties": {
              "branch": {
                "type": "integer"
              },
              "len": {
                "type": "integer"
              }
            },
            "required": [
              "branch",
              "len"
            ]
          },
          "approvers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "resume_id": {
                  "type": "integer"
                },
                "approver": {
                  "type": "string"
                }
              },
              "required": [
                "resume_id",
                "approver"
              ]
            }
          }
        },
        "required": [
          "type"
        ]
      },
      "FlowStatus": {
        "type": "object",
        "properties": {
          "step": {
            "type": "integer"
          },
          "modules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowStatusModule"
            }
          },
          "user_states": {
            "additionalProperties": true
          },
          "failure_module": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FlowStatusModule"
              },
              {
                "type": "object",
                "properties": {
                  "parent_module": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "retry": {
            "type": "object",
            "properties": {
              "fail_count": {
                "type": "integer"
              },
              "failed_jobs": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        },
        "required": [
          "step",
          "modules",
          "failure_module"
        ]
      }
    }
  }
}