{
  "openapi": "3.0.3",
  "info": {
    "title": "Builder API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://app.quick.bot/api"
    }
  ],
  "externalDocs": {
    "url": "https://docs.quick.bot/api"
  },
  "paths": {
    "/v1/bots/{botId}/linkedBots": {
      "get": {
        "operationId": "getLinkedBots",
        "summary": "Get linked bots",
        "tags": [
          "Bot"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "bots": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "version": {
                            "type": "string",
                            "enum": [
                              "6"
                            ]
                          },
                          "groups": {
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/group"
                            }
                          },
                          "variables": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "isSystemVariable": {
                                  "type": "boolean"
                                },
                                "isSavedVariable": {
                                  "type": "boolean"
                                },
                                "isSecretVariable": {
                                  "type": "boolean"
                                },
                                "value": {
                                  "nullable": true,
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "nullable": true
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ]
                            }
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "version",
                          "groups",
                          "variables",
                          "name"
                        ]
                      }
                    }
                  },
                  "required": [
                    "bots"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/{botId}/flow": {
      "get": {
        "operationId": "analytics-getAnalyticsFlow",
        "summary": "List total answers in blocks and off-default paths visited edges",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "timeFilter",
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "last7Days",
                "last30Days",
                "monthToDate",
                "lastMonth",
                "yearToDate",
                "allTime"
              ],
              "default": "last30Days"
            }
          },
          {
            "in": "query",
            "name": "timeZone",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totalAnswers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "blockId": {
                            "type": "string"
                          },
                          "itemId": {
                            "type": "string"
                          },
                          "total": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "blockId",
                          "total"
                        ]
                      }
                    },
                    "offDefaultPathVisitedEdges": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "edgeId": {
                            "type": "string"
                          },
                          "total": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "edgeId",
                          "total"
                        ]
                      }
                    }
                  },
                  "required": [
                    "totalAnswers",
                    "offDefaultPathVisitedEdges"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics": {
      "get": {
        "operationId": "analytics-getAnalytics",
        "summary": "Get aggregated analytics stats for multiple bots",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "botIds",
            "description": "Comma-separated list of bot IDs",
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "Comma-separated list of bot IDs"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "timeFilter",
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "last7Days",
                "last30Days",
                "monthToDate",
                "lastMonth",
                "yearToDate",
                "allTime"
              ],
              "default": "last30Days"
            }
          },
          {
            "in": "query",
            "name": "timeZone",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stats": {
                      "type": "object",
                      "properties": {
                        "totalBots": {
                          "type": "number"
                        },
                        "totalViews": {
                          "type": "number"
                        },
                        "totalStarts": {
                          "type": "number"
                        },
                        "totalCompleted": {
                          "type": "number"
                        },
                        "totalViewsPerDay": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "type": "string"
                              },
                              "count": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "date",
                              "count"
                            ]
                          }
                        },
                        "totalStartsPerDay": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "type": "string"
                              },
                              "count": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "date",
                              "count"
                            ]
                          }
                        },
                        "totalCompletedPerDay": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "type": "string"
                              },
                              "count": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "date",
                              "count"
                            ]
                          }
                        },
                        "completionRate": {
                          "type": "number"
                        },
                        "viewToStartRate": {
                          "type": "number"
                        },
                        "dropOffRate": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "totalBots",
                        "totalViews",
                        "totalStarts",
                        "totalCompleted",
                        "totalViewsPerDay",
                        "totalStartsPerDay",
                        "totalCompletedPerDay",
                        "completionRate",
                        "viewToStartRate",
                        "dropOffRate"
                      ]
                    }
                  },
                  "required": [
                    "stats"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/{botId}/by-variable": {
      "get": {
        "operationId": "analytics-getAnalyticsByVariable",
        "summary": "Get analytics stats grouped by variable values",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true
          },
          {
            "in": "query",
            "name": "variableId",
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true
          },
          {
            "in": "query",
            "name": "timeFilter",
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "last7Days",
                "last30Days",
                "monthToDate",
                "lastMonth",
                "yearToDate",
                "allTime"
              ],
              "default": "last30Days"
            }
          },
          {
            "in": "query",
            "name": "timeZone",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "analytics": {
                      "type": "object",
                      "properties": {
                        "variableId": {
                          "type": "string"
                        },
                        "variableName": {
                          "type": "string"
                        },
                        "isNumeric": {
                          "type": "boolean"
                        },
                        "averageValue": {
                          "type": "number"
                        },
                        "valueStats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "value": {
                                "type": "string"
                              },
                              "totalStarts": {
                                "type": "number"
                              },
                              "totalCompleted": {
                                "type": "number"
                              },
                              "completionRate": {
                                "type": "number"
                              },
                              "dropOffRate": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "value",
                              "totalStarts",
                              "totalCompleted",
                              "completionRate",
                              "dropOffRate"
                            ]
                          }
                        },
                        "emptyStats": {
                          "type": "object",
                          "properties": {
                            "totalStarts": {
                              "type": "number"
                            },
                            "totalCompleted": {
                              "type": "number"
                            },
                            "completionRate": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "totalStarts",
                            "totalCompleted",
                            "completionRate"
                          ]
                        },
                        "totalStarts": {
                          "type": "number"
                        },
                        "totalCompleted": {
                          "type": "number"
                        },
                        "collectionRate": {
                          "type": "number"
                        },
                        "usersWithValue": {
                          "type": "number"
                        },
                        "usersWithoutValue": {
                          "type": "number"
                        },
                        "collectionRatePerDay": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "type": "string"
                              },
                              "collectionRate": {
                                "type": "number"
                              },
                              "usersWithValue": {
                                "type": "number"
                              },
                              "totalStarts": {
                                "type": "number"
                              },
                              "averageValue": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "date",
                              "collectionRate",
                              "usersWithValue",
                              "totalStarts"
                            ]
                          }
                        }
                      },
                      "required": [
                        "variableId",
                        "variableName",
                        "isNumeric",
                        "valueStats",
                        "emptyStats",
                        "totalStarts",
                        "totalCompleted",
                        "collectionRate",
                        "usersWithValue",
                        "usersWithoutValue",
                        "collectionRatePerDay"
                      ]
                    }
                  },
                  "required": [
                    "analytics"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces": {
      "get": {
        "operationId": "workspace-listWorkspaces",
        "summary": "List workspaces",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "icon": {
                            "type": "string",
                            "nullable": true
                          },
                          "billingPlan": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "key": {
                                "type": "string",
                                "enum": [
                                  "FREE",
                                  "PERSONAL",
                                  "BUSINESS",
                                  "ENTERPRISE",
                                  "UNLIMITED",
                                  "CUSTOM",
                                  "LIFETIME_PERSONAL",
                                  "LIFETIME_BUSINESS",
                                  "LIFETIME_ENTERPRISE"
                                ]
                              },
                              "price": {
                                "type": "number"
                              },
                              "chatsLimit": {
                                "type": "number",
                                "nullable": true
                              },
                              "agentPromptLimit": {
                                "type": "number",
                                "nullable": true
                              },
                              "storageLimit": {
                                "type": "number",
                                "nullable": true
                              },
                              "botsLimit": {
                                "type": "number",
                                "nullable": true
                              },
                              "membersLimit": {
                                "type": "number",
                                "nullable": true
                              },
                              "isSystem": {
                                "type": "boolean"
                              },
                              "chatMeteredUnitPrice": {
                                "type": "number",
                                "nullable": true
                              },
                              "extraMemberPrice": {
                                "type": "number",
                                "nullable": true
                              },
                              "currency": {
                                "type": "string"
                              },
                              "isYearly": {
                                "type": "boolean",
                                "nullable": true
                              },
                              "allowCustomDomain": {
                                "type": "boolean"
                              },
                              "allowWhatsapp": {
                                "type": "boolean"
                              },
                              "allowAnalytics": {
                                "type": "boolean"
                              },
                              "allowedBotBlocks": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "allowGuests": {
                                "type": "boolean"
                              },
                              "allowResults": {
                                "type": "boolean"
                              },
                              "allowRemoveBrand": {
                                "type": "boolean"
                              },
                              "allowInbox": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "key",
                              "price",
                              "chatsLimit",
                              "agentPromptLimit",
                              "storageLimit",
                              "botsLimit",
                              "membersLimit",
                              "isSystem",
                              "chatMeteredUnitPrice",
                              "extraMemberPrice",
                              "currency",
                              "isYearly",
                              "allowCustomDomain",
                              "allowWhatsapp",
                              "allowAnalytics",
                              "allowedBotBlocks",
                              "allowGuests",
                              "allowResults",
                              "allowRemoveBrand",
                              "allowInbox"
                            ]
                          },
                          "currentUserRole": {
                            "type": "string",
                            "enum": [
                              "ADMIN",
                              "MEMBER",
                              "GUEST"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "icon",
                          "billingPlan"
                        ]
                      }
                    }
                  },
                  "required": [
                    "workspaces"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "workspace-createWorkspace",
        "summary": "Create workspace",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "icon": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "icon": {
                          "type": "string",
                          "nullable": true
                        },
                        "billingPlan": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "key": {
                              "type": "string",
                              "enum": [
                                "FREE",
                                "PERSONAL",
                                "BUSINESS",
                                "ENTERPRISE",
                                "UNLIMITED",
                                "CUSTOM",
                                "LIFETIME_PERSONAL",
                                "LIFETIME_BUSINESS",
                                "LIFETIME_ENTERPRISE"
                              ]
                            },
                            "price": {
                              "type": "number"
                            },
                            "chatsLimit": {
                              "type": "number",
                              "nullable": true
                            },
                            "agentPromptLimit": {
                              "type": "number",
                              "nullable": true
                            },
                            "storageLimit": {
                              "type": "number",
                              "nullable": true
                            },
                            "botsLimit": {
                              "type": "number",
                              "nullable": true
                            },
                            "membersLimit": {
                              "type": "number",
                              "nullable": true
                            },
                            "isSystem": {
                              "type": "boolean"
                            },
                            "chatMeteredUnitPrice": {
                              "type": "number",
                              "nullable": true
                            },
                            "extraMemberPrice": {
                              "type": "number",
                              "nullable": true
                            },
                            "currency": {
                              "type": "string"
                            },
                            "isYearly": {
                              "type": "boolean",
                              "nullable": true
                            },
                            "allowCustomDomain": {
                              "type": "boolean"
                            },
                            "allowWhatsapp": {
                              "type": "boolean"
                            },
                            "allowAnalytics": {
                              "type": "boolean"
                            },
                            "allowedBotBlocks": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "allowGuests": {
                              "type": "boolean"
                            },
                            "allowResults": {
                              "type": "boolean"
                            },
                            "allowRemoveBrand": {
                              "type": "boolean"
                            },
                            "allowInbox": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "key",
                            "price",
                            "chatsLimit",
                            "agentPromptLimit",
                            "storageLimit",
                            "botsLimit",
                            "membersLimit",
                            "isSystem",
                            "chatMeteredUnitPrice",
                            "extraMemberPrice",
                            "currency",
                            "isYearly",
                            "allowCustomDomain",
                            "allowWhatsapp",
                            "allowAnalytics",
                            "allowedBotBlocks",
                            "allowGuests",
                            "allowResults",
                            "allowRemoveBrand",
                            "allowInbox"
                          ]
                        },
                        "billingPlanId": {
                          "type": "string"
                        },
                        "stripeId": {
                          "type": "string",
                          "nullable": true
                        },
                        "billingEmail": {
                          "type": "string",
                          "nullable": true,
                          "format": "email"
                        },
                        "billingCompany": {
                          "type": "string",
                          "nullable": true
                        },
                        "billingVatType": {
                          "type": "string",
                          "nullable": true
                        },
                        "billingVatValue": {
                          "type": "string",
                          "nullable": true
                        },
                        "purchasedExtraSeats": {
                          "type": "number"
                        },
                        "lifetimeActivatedAt": {
                          "type": "string",
                          "nullable": true
                        },
                        "isSuspended": {
                          "type": "boolean"
                        },
                        "isPastDue": {
                          "type": "boolean"
                        },
                        "isVerified": {
                          "type": "boolean",
                          "nullable": true
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "icon",
                        "billingPlan",
                        "billingPlanId",
                        "stripeId",
                        "billingEmail",
                        "billingCompany",
                        "billingVatType",
                        "billingVatValue",
                        "purchasedExtraSeats",
                        "lifetimeActivatedAt",
                        "isSuspended",
                        "isPastDue",
                        "isVerified"
                      ]
                    }
                  },
                  "required": [
                    "workspace"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}": {
      "get": {
        "operationId": "workspace-getWorkspace",
        "summary": "Get workspace",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "icon": {
                          "type": "string",
                          "nullable": true
                        },
                        "billingPlan": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "key": {
                              "type": "string",
                              "enum": [
                                "FREE",
                                "PERSONAL",
                                "BUSINESS",
                                "ENTERPRISE",
                                "UNLIMITED",
                                "CUSTOM",
                                "LIFETIME_PERSONAL",
                                "LIFETIME_BUSINESS",
                                "LIFETIME_ENTERPRISE"
                              ]
                            },
                            "price": {
                              "type": "number"
                            },
                            "chatsLimit": {
                              "type": "number",
                              "nullable": true
                            },
                            "agentPromptLimit": {
                              "type": "number",
                              "nullable": true
                            },
                            "storageLimit": {
                              "type": "number",
                              "nullable": true
                            },
                            "botsLimit": {
                              "type": "number",
                              "nullable": true
                            },
                            "membersLimit": {
                              "type": "number",
                              "nullable": true
                            },
                            "isSystem": {
                              "type": "boolean"
                            },
                            "chatMeteredUnitPrice": {
                              "type": "number",
                              "nullable": true
                            },
                            "extraMemberPrice": {
                              "type": "number",
                              "nullable": true
                            },
                            "currency": {
                              "type": "string"
                            },
                            "isYearly": {
                              "type": "boolean",
                              "nullable": true
                            },
                            "allowCustomDomain": {
                              "type": "boolean"
                            },
                            "allowWhatsapp": {
                              "type": "boolean"
                            },
                            "allowAnalytics": {
                              "type": "boolean"
                            },
                            "allowedBotBlocks": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "allowGuests": {
                              "type": "boolean"
                            },
                            "allowResults": {
                              "type": "boolean"
                            },
                            "allowRemoveBrand": {
                              "type": "boolean"
                            },
                            "allowInbox": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "key",
                            "price",
                            "chatsLimit",
                            "agentPromptLimit",
                            "storageLimit",
                            "botsLimit",
                            "membersLimit",
                            "isSystem",
                            "chatMeteredUnitPrice",
                            "extraMemberPrice",
                            "currency",
                            "isYearly",
                            "allowCustomDomain",
                            "allowWhatsapp",
                            "allowAnalytics",
                            "allowedBotBlocks",
                            "allowGuests",
                            "allowResults",
                            "allowRemoveBrand",
                            "allowInbox"
                          ]
                        },
                        "billingPlanId": {
                          "type": "string"
                        },
                        "stripeId": {
                          "type": "string",
                          "nullable": true
                        },
                        "billingEmail": {
                          "type": "string",
                          "nullable": true
                        },
                        "billingCompany": {
                          "type": "string",
                          "nullable": true
                        },
                        "billingVatType": {
                          "type": "string",
                          "nullable": true
                        },
                        "billingVatValue": {
                          "type": "string",
                          "nullable": true
                        },
                        "purchasedExtraSeats": {
                          "type": "number"
                        },
                        "lifetimeActivatedAt": {
                          "type": "string",
                          "nullable": true
                        },
                        "isSuspended": {
                          "type": "boolean"
                        },
                        "isPastDue": {
                          "type": "boolean"
                        },
                        "isVerified": {
                          "type": "boolean",
                          "nullable": true
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "icon",
                        "billingPlan",
                        "billingPlanId",
                        "stripeId",
                        "billingEmail",
                        "billingCompany",
                        "billingVatType",
                        "billingVatValue",
                        "purchasedExtraSeats",
                        "lifetimeActivatedAt",
                        "isSuspended",
                        "isPastDue",
                        "isVerified"
                      ]
                    },
                    "currentRole": {
                      "type": "string",
                      "enum": [
                        "ADMIN",
                        "MEMBER",
                        "GUEST"
                      ]
                    }
                  },
                  "required": [
                    "workspace",
                    "currentRole"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "workspace-updateWorkspace",
        "summary": "Update workspace",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "icon": {
                    "type": "string",
                    "nullable": true
                  },
                  "billingEmail": {
                    "type": "string",
                    "format": "email"
                  },
                  "billingCompany": {
                    "type": "string"
                  },
                  "billingVatType": {
                    "type": "string"
                  },
                  "billingVatValue": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "icon": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "name",
                        "icon"
                      ]
                    }
                  },
                  "required": [
                    "workspace"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "workspace-deleteWorkspace",
        "summary": "Delete workspace",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots": {
      "post": {
        "operationId": "bot-createBot",
        "summary": "Create a bot",
        "tags": [
          "Bot"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "bot": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "icon": {
                        "type": "string",
                        "nullable": true
                      },
                      "selectedThemeTemplateId": {
                        "type": "string",
                        "nullable": true
                      },
                      "groups": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/group"
                        }
                      },
                      "events": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/event"
                            },
                            {
                              "$ref": "#/components/schemas/followUpEvent"
                            }
                          ],
                          "discriminator": {
                            "propertyName": "type",
                            "mapping": {
                              "start": "#/components/schemas/event",
                              "follow-up": "#/components/schemas/followUpEvent"
                            }
                          }
                        }
                      },
                      "theme": {
                        "$ref": "#/components/schemas/theme"
                      },
                      "settings": {
                        "$ref": "#/components/schemas/settings"
                      },
                      "folderId": {
                        "type": "string",
                        "nullable": true
                      },
                      "variables": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "isSystemVariable": {
                              "type": "boolean"
                            },
                            "isSavedVariable": {
                              "type": "boolean"
                            },
                            "isSecretVariable": {
                              "type": "boolean"
                            },
                            "value": {
                              "nullable": true,
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ]
                        }
                      },
                      "edges": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "from": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "blockId": {
                                      "type": "string"
                                    },
                                    "itemId": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "blockId"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eventId": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "eventId"
                                  ]
                                }
                              ]
                            },
                            "to": {
                              "type": "object",
                              "properties": {
                                "groupId": {
                                  "type": "string"
                                },
                                "blockId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "groupId"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "from",
                            "to"
                          ]
                        }
                      },
                      "publicId": {
                        "type": "string",
                        "nullable": true
                      },
                      "customDomain": {
                        "type": "string",
                        "nullable": true
                      }
                    }
                  }
                },
                "required": [
                  "workspaceId",
                  "bot"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "bot": {
                      "$ref": "#/components/schemas/bot"
                    }
                  },
                  "required": [
                    "bot"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "bot-listBots",
        "summary": "List bots",
        "tags": [
          "Bot"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "workspaceId",
            "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "folderId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "bots": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "icon": {
                            "type": "string",
                            "nullable": true
                          },
                          "id": {
                            "type": "string"
                          },
                          "publicId": {
                            "type": "string",
                            "nullable": true
                          },
                          "customDomain": {
                            "type": "string",
                            "nullable": true
                          },
                          "isClosed": {
                            "type": "boolean"
                          },
                          "publishedBotId": {
                            "type": "string"
                          },
                          "totalViews": {
                            "type": "number"
                          },
                          "totalStarts": {
                            "type": "number"
                          },
                          "totalCompleted": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "name",
                          "icon",
                          "id",
                          "publicId",
                          "customDomain",
                          "isClosed"
                        ]
                      }
                    }
                  },
                  "required": [
                    "bots"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots/{botId}": {
      "patch": {
        "operationId": "bot-updateBot",
        "summary": "Update a bot",
        "tags": [
          "Bot"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bot": {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string",
                        "enum": [
                          "6"
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "icon": {
                        "type": "string",
                        "nullable": true
                      },
                      "selectedThemeTemplateId": {
                        "type": "string",
                        "nullable": true
                      },
                      "groups": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/group"
                        }
                      },
                      "theme": {
                        "$ref": "#/components/schemas/theme"
                      },
                      "settings": {
                        "$ref": "#/components/schemas/settings"
                      },
                      "folderId": {
                        "type": "string",
                        "nullable": true
                      },
                      "variables": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "isSystemVariable": {
                              "type": "boolean"
                            },
                            "isSavedVariable": {
                              "type": "boolean"
                            },
                            "isSecretVariable": {
                              "type": "boolean"
                            },
                            "value": {
                              "nullable": true,
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ]
                        }
                      },
                      "edges": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "from": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "blockId": {
                                      "type": "string"
                                    },
                                    "itemId": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "blockId"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eventId": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "eventId"
                                  ]
                                }
                              ]
                            },
                            "to": {
                              "type": "object",
                              "properties": {
                                "groupId": {
                                  "type": "string"
                                },
                                "blockId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "groupId"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "from",
                            "to"
                          ]
                        }
                      },
                      "publicId": {
                        "type": "string",
                        "nullable": true
                      },
                      "customDomain": {
                        "type": "string",
                        "nullable": true
                      },
                      "isClosed": {
                        "type": "boolean"
                      },
                      "riskLevel": {
                        "type": "number",
                        "nullable": true
                      },
                      "events": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/event"
                            },
                            {
                              "$ref": "#/components/schemas/followUpEvent"
                            }
                          ],
                          "discriminator": {
                            "propertyName": "type",
                            "mapping": {
                              "start": "#/components/schemas/event",
                              "follow-up": "#/components/schemas/followUpEvent"
                            }
                          }
                        }
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "title": "Bot"
                  }
                },
                "required": [
                  "bot"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "bot": {
                      "$ref": "#/components/schemas/bot"
                    }
                  },
                  "required": [
                    "bot"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "bot-getBot",
        "summary": "Get a bot",
        "tags": [
          "Bot"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "migrateToLatestVersion",
            "description": "If enabled, the bot will be converted to the latest schema version",
            "schema": {
              "type": "boolean",
              "default": false,
              "description": "If enabled, the bot will be converted to the latest schema version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "bot": {
                      "$ref": "#/components/schemas/bot"
                    },
                    "currentUserMode": {
                      "type": "string",
                      "enum": [
                        "guest",
                        "read",
                        "write"
                      ]
                    }
                  },
                  "required": [
                    "bot",
                    "currentUserMode"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "bot-deleteBot",
        "summary": "Delete a bot",
        "tags": [
          "Bot"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots/{botId}/publishedBot": {
      "get": {
        "operationId": "bot-getPublishedBot",
        "summary": "Get published bot",
        "tags": [
          "Bot"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "migrateToLatestVersion",
            "description": "If enabled, the bot will be converted to the latest schema version",
            "schema": {
              "type": "boolean",
              "default": false,
              "description": "If enabled, the bot will be converted to the latest schema version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "publishedBot": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/publicBot"
                        }
                      ],
                      "nullable": true
                    },
                    "version": {
                      "type": "string",
                      "enum": [
                        "6"
                      ],
                      "description": "Provides the version of the published bot. Kept for backwards compatibility."
                    }
                  },
                  "required": [
                    "publishedBot"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots/{botId}/publish": {
      "post": {
        "operationId": "bot-publishBot",
        "summary": "Publish a bot",
        "tags": [
          "Bot"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "bot": {
                      "type": "object",
                      "properties": {
                        "version": {
                          "type": "string",
                          "enum": [
                            "6"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "icon": {
                          "type": "string",
                          "nullable": true
                        },
                        "selectedThemeTemplateId": {
                          "type": "string",
                          "nullable": true
                        },
                        "groups": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/group"
                          }
                        },
                        "theme": {
                          "$ref": "#/components/schemas/theme"
                        },
                        "settings": {
                          "$ref": "#/components/schemas/settings"
                        },
                        "folderId": {
                          "type": "string",
                          "nullable": true
                        },
                        "variables": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "isSystemVariable": {
                                "type": "boolean"
                              },
                              "isSavedVariable": {
                                "type": "boolean"
                              },
                              "isSecretVariable": {
                                "type": "boolean"
                              },
                              "value": {
                                "nullable": true,
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "nullable": true
                                    }
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ]
                          }
                        },
                        "edges": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "from": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "blockId": {
                                        "type": "string"
                                      },
                                      "itemId": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "blockId"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "eventId": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "eventId"
                                    ]
                                  }
                                ]
                              },
                              "to": {
                                "type": "object",
                                "properties": {
                                  "groupId": {
                                    "type": "string"
                                  },
                                  "blockId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "groupId"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "from",
                              "to"
                            ]
                          }
                        },
                        "publicId": {
                          "type": "string",
                          "nullable": true
                        },
                        "customDomain": {
                          "type": "string",
                          "nullable": true
                        },
                        "isClosed": {
                          "type": "boolean"
                        },
                        "riskLevel": {
                          "type": "number",
                          "nullable": true
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "$ref": "#/components/schemas/event"
                              },
                              {
                                "$ref": "#/components/schemas/followUpEvent"
                              }
                            ],
                            "discriminator": {
                              "propertyName": "type",
                              "mapping": {
                                "start": "#/components/schemas/event",
                                "follow-up": "#/components/schemas/followUpEvent"
                              }
                            }
                          }
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "required": [
                    "bot"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots/{botId}/unpublish": {
      "post": {
        "operationId": "bot-unpublishBot",
        "summary": "Unpublish a bot",
        "tags": [
          "Bot"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots/import": {
      "post": {
        "operationId": "bot-importBot",
        "summary": "Import a bot",
        "tags": [
          "Bot"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string",
                    "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)"
                  },
                  "bot": {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string",
                        "enum": [
                          "6"
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "events": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/event"
                            },
                            {
                              "$ref": "#/components/schemas/followUpEvent"
                            }
                          ],
                          "discriminator": {
                            "propertyName": "type",
                            "mapping": {
                              "start": "#/components/schemas/event",
                              "follow-up": "#/components/schemas/followUpEvent"
                            }
                          }
                        }
                      },
                      "groups": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/group"
                        }
                      },
                      "edges": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "from": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "blockId": {
                                      "type": "string"
                                    },
                                    "itemId": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "blockId"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eventId": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "eventId"
                                  ]
                                }
                              ]
                            },
                            "to": {
                              "type": "object",
                              "properties": {
                                "groupId": {
                                  "type": "string"
                                },
                                "blockId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "groupId"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "from",
                            "to"
                          ]
                        }
                      },
                      "variables": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "isSystemVariable": {
                              "type": "boolean"
                            },
                            "isSavedVariable": {
                              "type": "boolean"
                            },
                            "isSecretVariable": {
                              "type": "boolean"
                            },
                            "value": {
                              "nullable": true,
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ]
                        }
                      },
                      "theme": {
                        "$ref": "#/components/schemas/theme"
                      },
                      "settings": {
                        "$ref": "#/components/schemas/settings"
                      },
                      "icon": {
                        "type": "string",
                        "nullable": true
                      },
                      "folderId": {
                        "type": "string",
                        "nullable": true
                      },
                      "selectedThemeTemplateId": {
                        "type": "string",
                        "nullable": true
                      }
                    },
                    "required": [
                      "version",
                      "name",
                      "events",
                      "groups",
                      "edges",
                      "variables",
                      "theme",
                      "settings",
                      "icon"
                    ],
                    "title": "Bot"
                  }
                },
                "required": [
                  "workspaceId",
                  "bot"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "bot": {
                      "$ref": "#/components/schemas/bot"
                    }
                  },
                  "required": [
                    "bot"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots/{botId}/end-all-active-conversations": {
      "post": {
        "operationId": "bot-forceEndActiveConversations",
        "summary": "Force-end all active conversations for a bot",
        "tags": [
          "Bot"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my bot's ID?](https://docs.quick.bot/api/general#how-to-find-my-botid)"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "endedConversationsCount": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "endedConversationsCount"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots/templates/{fileName}": {
      "get": {
        "operationId": "bot-getTemplate",
        "summary": "Get bot template",
        "tags": [
          "Templates"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "fileName",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "string",
                      "enum": [
                        "6"
                      ]
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/event"
                          },
                          {
                            "$ref": "#/components/schemas/followUpEvent"
                          }
                        ],
                        "discriminator": {
                          "propertyName": "type",
                          "mapping": {
                            "start": "#/components/schemas/event",
                            "follow-up": "#/components/schemas/followUpEvent"
                          }
                        }
                      }
                    },
                    "groups": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/group"
                      }
                    },
                    "edges": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "from": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "blockId": {
                                    "type": "string"
                                  },
                                  "itemId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "blockId"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "eventId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "eventId"
                                ]
                              }
                            ]
                          },
                          "to": {
                            "type": "object",
                            "properties": {
                              "groupId": {
                                "type": "string"
                              },
                              "blockId": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "groupId"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "from",
                          "to"
                        ]
                      }
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "isSystemVariable": {
                            "type": "boolean"
                          },
                          "isSavedVariable": {
                            "type": "boolean"
                          },
                          "isSecretVariable": {
                            "type": "boolean"
                          },
                          "value": {
                            "nullable": true,
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "nullable": true
                                }
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      }
                    },
                    "theme": {
                      "$ref": "#/components/schemas/theme"
                    },
                    "selectedThemeTemplateId": {
                      "type": "string",
                      "nullable": true
                    },
                    "settings": {
                      "$ref": "#/components/schemas/settings"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "icon": {
                      "type": "string",
                      "nullable": true
                    },
                    "folderId": {
                      "type": "string",
                      "nullable": true
                    },
                    "publicId": {
                      "type": "string",
                      "nullable": true
                    },
                    "customDomain": {
                      "type": "string",
                      "nullable": true
                    },
                    "workspaceId": {
                      "type": "string",
                      "nullable": true
                    },
                    "isArchived": {
                      "type": "boolean"
                    },
                    "isClosed": {
                      "type": "boolean"
                    },
                    "riskLevel": {
                      "type": "number",
                      "nullable": true
                    }
                  },
                  "required": [
                    "version",
                    "id",
                    "name",
                    "events",
                    "groups",
                    "edges",
                    "variables",
                    "theme",
                    "selectedThemeTemplateId",
                    "settings",
                    "createdAt",
                    "updatedAt",
                    "icon",
                    "folderId",
                    "publicId",
                    "customDomain",
                    "workspaceId",
                    "isArchived",
                    "isClosed",
                    "riskLevel"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/subscription/checkout": {
      "post": {
        "operationId": "billing-checkoutSubscription",
        "summary": "Create checkout session to create a new subscription",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "plan": {
                    "type": "string",
                    "enum": [
                      "FREE",
                      "PERSONAL",
                      "BUSINESS",
                      "ENTERPRISE",
                      "UNLIMITED",
                      "CUSTOM",
                      "LIFETIME_PERSONAL",
                      "LIFETIME_BUSINESS",
                      "LIFETIME_ENTERPRISE"
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "usd",
                      "eur"
                    ]
                  },
                  "returnUrl": {
                    "type": "string"
                  },
                  "discount": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "workspaceId",
                  "plan",
                  "currency",
                  "returnUrl"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "checkoutUrl": {
                      "type": "string"
                    },
                    "discountStatus": {
                      "type": "string",
                      "enum": [
                        "applied",
                        "invalid",
                        "none"
                      ]
                    }
                  },
                  "required": [
                    "checkoutUrl",
                    "discountStatus"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/subscription": {
      "get": {
        "operationId": "billing-getSubscription",
        "summary": "Get subscription",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "workspaceId",
            "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "canceled",
                            "past_due",
                            "incomplete",
                            "incomplete_expired",
                            "trialing",
                            "unpaid",
                            "paused",
                            "disabled"
                          ]
                        },
                        "currency": {
                          "type": "string",
                          "enum": [
                            "usd",
                            "eur"
                          ]
                        },
                        "totalChatsUsed": {
                          "type": "number"
                        },
                        "nextPaymentAmount": {
                          "type": "number"
                        },
                        "agentPromptsUsed": {
                          "type": "number"
                        },
                        "agentPromptLimit": {
                          "type": "number",
                          "nullable": true
                        },
                        "resetsAt": {
                          "type": "string"
                        },
                        "startsAt": {
                          "type": "string"
                        },
                        "cancelAt": {
                          "type": "string"
                        },
                        "portalUrl": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "status",
                        "currency",
                        "totalChatsUsed",
                        "nextPaymentAmount",
                        "agentPromptsUsed",
                        "agentPromptLimit"
                      ]
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "billing-switchSubscription",
        "summary": "Switch subscription",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "returnUrl": {
                    "type": "string"
                  },
                  "workspaceId": {
                    "type": "string"
                  },
                  "plan": {
                    "type": "string",
                    "enum": [
                      "FREE",
                      "PERSONAL",
                      "BUSINESS",
                      "ENTERPRISE",
                      "UNLIMITED",
                      "CUSTOM",
                      "LIFETIME_PERSONAL",
                      "LIFETIME_BUSINESS",
                      "LIFETIME_ENTERPRISE"
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "usd",
                      "eur"
                    ]
                  },
                  "discount": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "returnUrl",
                  "workspaceId",
                  "plan",
                  "currency"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pendingPlan": {
                      "type": "string",
                      "nullable": true
                    },
                    "checkoutUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "discountStatus": {
                      "type": "string",
                      "enum": [
                        "applied",
                        "invalid",
                        "none"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/invoices": {
      "get": {
        "operationId": "billing-listInvoices",
        "summary": "List invoices",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "workspaceId",
            "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invoices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "number"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "date": {
                            "type": "number",
                            "nullable": true
                          }
                        },
                        "required": [
                          "id",
                          "url",
                          "amount",
                          "currency",
                          "date"
                        ]
                      }
                    }
                  },
                  "required": [
                    "invoices"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/plans": {
      "get": {
        "operationId": "billing-listPlans",
        "summary": "List subscription plans",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "key": {
                        "type": "string",
                        "enum": [
                          "FREE",
                          "PERSONAL",
                          "BUSINESS",
                          "ENTERPRISE",
                          "UNLIMITED",
                          "CUSTOM",
                          "LIFETIME_PERSONAL",
                          "LIFETIME_BUSINESS",
                          "LIFETIME_ENTERPRISE"
                        ]
                      },
                      "price": {
                        "type": "number"
                      },
                      "chatsLimit": {
                        "type": "number",
                        "nullable": true
                      },
                      "agentPromptLimit": {
                        "type": "number",
                        "nullable": true
                      },
                      "storageLimit": {
                        "type": "number",
                        "nullable": true
                      },
                      "botsLimit": {
                        "type": "number",
                        "nullable": true
                      },
                      "membersLimit": {
                        "type": "number",
                        "nullable": true
                      },
                      "isSystem": {
                        "type": "boolean"
                      },
                      "chatMeteredUnitPrice": {
                        "type": "number",
                        "nullable": true
                      },
                      "extraMemberPrice": {
                        "type": "number",
                        "nullable": true
                      },
                      "currency": {
                        "type": "string"
                      },
                      "isYearly": {
                        "type": "boolean",
                        "nullable": true
                      },
                      "allowCustomDomain": {
                        "type": "boolean"
                      },
                      "allowWhatsapp": {
                        "type": "boolean"
                      },
                      "allowAnalytics": {
                        "type": "boolean"
                      },
                      "allowedBotBlocks": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "allowGuests": {
                        "type": "boolean"
                      },
                      "allowResults": {
                        "type": "boolean"
                      },
                      "allowRemoveBrand": {
                        "type": "boolean"
                      },
                      "allowInbox": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "key",
                      "price",
                      "chatsLimit",
                      "agentPromptLimit",
                      "storageLimit",
                      "botsLimit",
                      "membersLimit",
                      "isSystem",
                      "chatMeteredUnitPrice",
                      "extraMemberPrice",
                      "currency",
                      "isYearly",
                      "allowCustomDomain",
                      "allowWhatsapp",
                      "allowAnalytics",
                      "allowedBotBlocks",
                      "allowGuests",
                      "allowResults",
                      "allowRemoveBrand",
                      "allowInbox"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/promotion-code/validate": {
      "post": {
        "operationId": "billing-validatePromotionCode",
        "summary": "Validate promotion code and return discount metadata for price preview",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "percent"
                          ]
                        },
                        "code": {
                          "type": "string"
                        },
                        "percentOff": {
                          "type": "number"
                        },
                        "promotionCodeId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "code",
                        "percentOff"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "amount"
                          ]
                        },
                        "code": {
                          "type": "string"
                        },
                        "amountOff": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string",
                          "enum": [
                            "usd",
                            "eur"
                          ]
                        },
                        "promotionCodeId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "code",
                        "amountOff",
                        "currency"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/extra-seats/purchase": {
      "post": {
        "operationId": "billing-purchaseExtraSeats",
        "summary": "Purchase extra member seats",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "workspaceId",
                  "quantity"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "purchasedExtraSeats": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "purchasedExtraSeats"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/extra-seats/release": {
      "post": {
        "operationId": "billing-releaseExtraSeats",
        "summary": "Release extra member seats",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "workspaceId",
                  "quantity"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "purchasedExtraSeats": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "purchasedExtraSeats"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account": {
      "get": {
        "operationId": "account-getAccount",
        "summary": "Get account",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "lastActivityAt": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string",
                          "nullable": true
                        },
                        "email": {
                          "type": "string",
                          "nullable": true,
                          "format": "email"
                        },
                        "emailVerified": {
                          "type": "string",
                          "nullable": true
                        },
                        "image": {
                          "type": "string",
                          "nullable": true
                        },
                        "company": {
                          "type": "string",
                          "nullable": true
                        },
                        "phone": {
                          "type": "string",
                          "nullable": true
                        },
                        "referral": {
                          "type": "string",
                          "nullable": true
                        },
                        "preferredAppAppearance": {
                          "type": "string",
                          "nullable": true
                        },
                        "displayedInAppNotifications": {
                          "type": "object",
                          "nullable": true,
                          "additionalProperties": {
                            "type": "boolean"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "lastActivityAt",
                        "name",
                        "email",
                        "emailVerified",
                        "image",
                        "company",
                        "phone",
                        "referral",
                        "preferredAppAppearance",
                        "displayedInAppNotifications"
                      ]
                    }
                  },
                  "required": [
                    "user"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "account-updateAccount",
        "summary": "Update account",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "image": {
                    "type": "string",
                    "nullable": true
                  },
                  "company": {
                    "type": "string",
                    "nullable": true
                  },
                  "phone": {
                    "type": "string",
                    "nullable": true
                  },
                  "preferredAppAppearance": {
                    "type": "string",
                    "nullable": true
                  },
                  "referral": {
                    "type": "string",
                    "nullable": true
                  },
                  "displayedInAppNotifications": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "lastActivityAt": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string",
                          "nullable": true
                        },
                        "email": {
                          "type": "string",
                          "nullable": true,
                          "format": "email"
                        },
                        "emailVerified": {
                          "type": "string",
                          "nullable": true
                        },
                        "image": {
                          "type": "string",
                          "nullable": true
                        },
                        "company": {
                          "type": "string",
                          "nullable": true
                        },
                        "phone": {
                          "type": "string",
                          "nullable": true
                        },
                        "referral": {
                          "type": "string",
                          "nullable": true
                        },
                        "preferredAppAppearance": {
                          "type": "string",
                          "nullable": true
                        },
                        "displayedInAppNotifications": {
                          "type": "object",
                          "nullable": true,
                          "additionalProperties": {
                            "type": "boolean"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "lastActivityAt",
                        "name",
                        "email",
                        "emailVerified",
                        "image",
                        "company",
                        "phone",
                        "referral",
                        "preferredAppAppearance",
                        "displayedInAppNotifications"
                      ]
                    }
                  },
                  "required": [
                    "user"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/api-tokens": {
      "get": {
        "operationId": "account-getAccountApiTokens",
        "summary": "List api token of a user",
        "tags": [
          "User"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "userApiTokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "token": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "userId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "token",
                          "name",
                          "userId"
                        ]
                      }
                    }
                  },
                  "required": [
                    "userApiTokens"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "account-createApiToken",
        "summary": "Create API token",
        "tags": [
          "User"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apiToken": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "createdAt",
                        "token"
                      ]
                    }
                  },
                  "required": [
                    "apiToken"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/api-tokens/{tokenId}": {
      "delete": {
        "operationId": "account-deleteApiToken",
        "summary": "Delete API token",
        "tags": [
          "User"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "tokenId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apiToken": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "userId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "token",
                        "name",
                        "userId"
                      ]
                    }
                  },
                  "required": [
                    "apiToken"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/notifications": {
      "get": {
        "operationId": "account-getAccountNotifications",
        "summary": "Get account notifications",
        "tags": [
          "Notification"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "userId": {
                      "type": "string"
                    },
                    "preferences": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string",
                            "enum": [
                              "almostReachedChatsLimit",
                              "reachedChatsLimit",
                              "welcomeEmail",
                              "onboardingTips",
                              "paymentConfirmation",
                              "planChanged",
                              "invitationAccepted",
                              "memberRemoved",
                              "memberRoleChanged",
                              "botPublished",
                              "botMilestone",
                              "analyticsDigest",
                              "botErrorAlert"
                            ]
                          },
                          "value": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "field",
                          "value"
                        ]
                      }
                    }
                  },
                  "required": [
                    "userId",
                    "preferences"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "account-updateAccountNotifications",
        "summary": "Update account notifications",
        "tags": [
          "Notification"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "almostReachedChatsLimit": {
                    "type": "boolean"
                  },
                  "reachedChatsLimit": {
                    "type": "boolean"
                  },
                  "onboardingTips": {
                    "type": "boolean"
                  },
                  "paymentConfirmation": {
                    "type": "boolean"
                  },
                  "planChanged": {
                    "type": "boolean"
                  },
                  "invitationAccepted": {
                    "type": "boolean"
                  },
                  "memberRemoved": {
                    "type": "boolean"
                  },
                  "memberRoleChanged": {
                    "type": "boolean"
                  },
                  "botPublished": {
                    "type": "boolean"
                  },
                  "botMilestone": {
                    "type": "boolean"
                  },
                  "analyticsDigest": {
                    "type": "boolean"
                  },
                  "botErrorAlert": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "userId": {
                      "type": "string"
                    },
                    "preferences": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string",
                            "enum": [
                              "almostReachedChatsLimit",
                              "reachedChatsLimit",
                              "welcomeEmail",
                              "onboardingTips",
                              "paymentConfirmation",
                              "planChanged",
                              "invitationAccepted",
                              "memberRemoved",
                              "memberRoleChanged",
                              "botPublished",
                              "botMilestone",
                              "analyticsDigest",
                              "botErrorAlert"
                            ]
                          },
                          "value": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "field",
                          "value"
                        ]
                      }
                    }
                  },
                  "required": [
                    "userId",
                    "preferences"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/notification-deliveries": {
      "get": {
        "operationId": "account-listNotificationDeliveries",
        "summary": "List notification deliveries",
        "tags": [
          "Notification"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "sentAt": {
                            "type": "string"
                          },
                          "notificationType": {
                            "type": "string",
                            "enum": [
                              "almostReachedChatsLimit",
                              "reachedChatsLimit",
                              "welcomeEmail",
                              "onboardingTips",
                              "paymentConfirmation",
                              "planChanged",
                              "invitationAccepted",
                              "memberRemoved",
                              "memberRoleChanged",
                              "botPublished",
                              "botMilestone",
                              "analyticsDigest",
                              "botErrorAlert",
                              "workspacePastDue",
                              "workspaceLimitUnlocked",
                              "workspaceSubscriptionCanceled",
                              "workspaceSubscriptionVoluntaryCanceled",
                              "whatsAppConnectionExpiring"
                            ]
                          },
                          "workspaceId": {
                            "type": "string",
                            "nullable": true
                          },
                          "workspaceName": {
                            "type": "string",
                            "nullable": true
                          },
                          "botId": {
                            "type": "string",
                            "nullable": true
                          },
                          "botName": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata": {
                            "nullable": true
                          }
                        },
                        "required": [
                          "id",
                          "sentAt",
                          "notificationType",
                          "workspaceId",
                          "workspaceName",
                          "botId",
                          "botName"
                        ]
                      }
                    },
                    "nextCursor": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "rows"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/request-email-change": {
      "post": {
        "operationId": "account-requestEmailChange",
        "summary": "Request email change",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "newEmail": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "required": [
                  "newEmail"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "pendingEmail": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message",
                    "pendingEmail",
                    "expiresAt"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/pending-email-change": {
      "get": {
        "operationId": "account-getPendingEmailChange",
        "summary": "Get pending email change request",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hasPendingRequest": {
                      "type": "boolean"
                    },
                    "pendingRequest": {
                      "type": "object",
                      "nullable": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "newEmail": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "newEmail",
                        "createdAt",
                        "expiresAt",
                        "status"
                      ]
                    }
                  },
                  "required": [
                    "hasPendingRequest",
                    "pendingRequest"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/confirm-email-change": {
      "post": {
        "operationId": "account-confirmEmailChange",
        "summary": "Confirm email change",
        "tags": [
          "Account"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "emailVerified": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "emailVerified"
                      ]
                    }
                  },
                  "required": [
                    "message",
                    "user"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/request-password-change": {
      "post": {
        "operationId": "account-requestPasswordChange",
        "summary": "Request password change",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "password": {
                    "type": "string",
                    "minLength": 6
                  },
                  "confirmPassword": {
                    "type": "string"
                  }
                },
                "required": [
                  "password",
                  "confirmPassword"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/pending-password-change": {
      "get": {
        "operationId": "account-getPendingPasswordChange",
        "summary": "Get pending password change request",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hasPendingRequest": {
                      "type": "boolean"
                    },
                    "pendingRequest": {
                      "type": "object",
                      "nullable": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "token": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "token",
                        "createdAt",
                        "expiresAt",
                        "status"
                      ]
                    }
                  },
                  "required": [
                    "hasPendingRequest",
                    "pendingRequest"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/cancel-password-change": {
      "post": {
        "operationId": "account-cancelPasswordChange",
        "summary": "Cancel password change request",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/confirm-password-change": {
      "post": {
        "operationId": "account-confirmPasswordChange",
        "summary": "Confirm password change",
        "tags": [
          "Account"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/credentials": {
      "post": {
        "operationId": "credentials-createCredentials",
        "summary": "Create credentials",
        "tags": [
          "Credentials"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentials": {
                    "allOf": [
                      {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "live": {
                                    "type": "object",
                                    "properties": {
                                      "secretKey": {
                                        "type": "string"
                                      },
                                      "publicKey": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "secretKey",
                                      "publicKey"
                                    ]
                                  },
                                  "test": {
                                    "type": "object",
                                    "properties": {
                                      "secretKey": {
                                        "type": "string"
                                      },
                                      "publicKey": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                },
                                "required": [
                                  "live",
                                  "test"
                                ]
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "stripe"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "systemUserAccessToken": {
                                    "type": "string"
                                  },
                                  "phoneNumberId": {
                                    "type": "string"
                                  },
                                  "wabaId": {
                                    "type": "string"
                                  },
                                  "businessId": {
                                    "type": "string"
                                  },
                                  "appSecret": {
                                    "type": "string",
                                    "pattern": "^[a-f0-9]{32}$"
                                  }
                                },
                                "required": [
                                  "systemUserAccessToken",
                                  "phoneNumberId"
                                ]
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "whatsApp"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "systemUserAccessToken": {
                                    "type": "string"
                                  },
                                  "phoneNumberId": {
                                    "type": "string"
                                  },
                                  "wabaId": {
                                    "type": "string"
                                  },
                                  "displayPhoneNumber": {
                                    "type": "string"
                                  },
                                  "verifiedName": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string"
                                  },
                                  "qualityRating": {
                                    "type": "string"
                                  },
                                  "platformType": {
                                    "type": "string"
                                  },
                                  "tokenExpiresAt": {
                                    "type": "number"
                                  },
                                  "dataAccessExpiresAt": {
                                    "type": "number"
                                  },
                                  "tokenInvalidAt": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "systemUserAccessToken",
                                  "phoneNumberId"
                                ]
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "whatsApp-CloudAPI"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "systemUserAccessToken": {
                                    "type": "string"
                                  },
                                  "phoneNumberId": {
                                    "type": "string"
                                  },
                                  "wabaId": {
                                    "type": "string"
                                  },
                                  "displayPhoneNumber": {
                                    "type": "string"
                                  },
                                  "verifiedName": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string"
                                  },
                                  "qualityRating": {
                                    "type": "string"
                                  },
                                  "platformType": {
                                    "type": "string"
                                  },
                                  "tokenExpiresAt": {
                                    "type": "number"
                                  },
                                  "dataAccessExpiresAt": {
                                    "type": "number"
                                  },
                                  "tokenInvalidAt": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "systemUserAccessToken",
                                  "phoneNumberId"
                                ]
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "whatsApp-QR"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "live": {
                                    "type": "object",
                                    "properties": {
                                      "accessToken": {
                                        "type": "string"
                                      },
                                      "publicKey": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "test": {
                                    "type": "object",
                                    "properties": {
                                      "accessToken": {
                                        "type": "string"
                                      },
                                      "publicKey": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "mercadoPago"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "apiKey": {
                                    "type": "string"
                                  },
                                  "baseUrl": {
                                    "type": "string",
                                    "format": "uri"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "openai"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "apiKey": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "chat-node"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "apiEndpoint": {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  "apiKey": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "dify-ai"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "apiKey": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "mistral"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "apiKey": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "elevenlabs"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "apiKey": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "anthropic"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "apiKey": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "together-ai"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "apiKey": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "open-router"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "baseUrl": {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  "apiKey": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "nocodb"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "apiKey": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "segment"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "apiKey": {
                                    "type": "string"
                                  },
                                  "baseUrl": {
                                    "type": "string",
                                    "format": "uri"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "groq"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "authToken": {
                                    "type": "string"
                                  },
                                  "accountSid": {
                                    "type": "string"
                                  },
                                  "phoneAdminNumber": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "twilio-com"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "clientId": {
                                    "type": "string"
                                  },
                                  "clientSecret": {
                                    "type": "string"
                                  },
                                  "tokenEndpoint": {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  "adminUsername": {
                                    "type": "string"
                                  },
                                  "adminPassword": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "wordpress"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "siteUrl": {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  "consumerKey": {
                                    "type": "string"
                                  },
                                  "consumerSecret": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "woocommerce"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "domain": {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  "apiKey": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "freshdesk"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "clientId": {
                                    "type": "string"
                                  },
                                  "clientSecret": {
                                    "type": "string"
                                  },
                                  "organizationId": {
                                    "type": "string"
                                  },
                                  "domain": {
                                    "type": "string",
                                    "format": "uri"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "zoho-crm"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "calendarId": {
                                    "type": "string"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "googleCalendar"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object",
                                "properties": {
                                  "from": {
                                    "type": "object",
                                    "properties": {
                                      "email": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "host": {
                                    "type": "string"
                                  },
                                  "username": {
                                    "type": "string"
                                  },
                                  "password": {
                                    "type": "string"
                                  },
                                  "isTlsEnabled": {
                                    "type": "boolean"
                                  },
                                  "port": {
                                    "type": "number"
                                  }
                                }
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "send-email"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "data": {
                                "type": "object"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "googleSheets"
                                ]
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "data",
                              "type",
                              "workspaceId",
                              "name"
                            ]
                          }
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          }
                        }
                      }
                    ]
                  }
                },
                "required": [
                  "credentials"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credentialsId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "credentialsId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "credentials-listCredentials",
        "summary": "List workspace credentials",
        "tags": [
          "Credentials"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string",
              "enum": [
                "stripe",
                "mercadoPago",
                "whatsApp",
                "whatsApp-CloudAPI",
                "whatsApp-QR",
                "openai",
                "chat-node",
                "dify-ai",
                "mistral",
                "elevenlabs",
                "anthropic",
                "together-ai",
                "open-router",
                "nocodb",
                "segment",
                "groq",
                "twilio-com",
                "wordpress",
                "woocommerce",
                "freshdesk",
                "zoho-crm",
                "googleCalendar",
                "send-email",
                "googleSheets"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credentials": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "isInvalid": {
                            "type": "boolean"
                          },
                          "botName": {
                            "type": "string",
                            "nullable": true
                          },
                          "botId": {
                            "type": "string",
                            "nullable": true
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "name"
                        ]
                      }
                    }
                  },
                  "required": [
                    "credentials"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/credentials/{credentialsId}": {
      "get": {
        "operationId": "credentials-getCredentials",
        "summary": "Get credentials data",
        "tags": [
          "Credentials"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "credentialsId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "data": {}
                  },
                  "required": [
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "credentials-deleteCredentials",
        "summary": "Delete credentials",
        "tags": [
          "Credentials"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "credentialsId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credentialsId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "credentialsId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "credentials-updateCredentials",
        "summary": "Create credentials",
        "tags": [
          "Credentials"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "credentialsId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentials": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "live": {
                                "type": "object",
                                "properties": {
                                  "secretKey": {
                                    "type": "string"
                                  },
                                  "publicKey": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "secretKey",
                                  "publicKey"
                                ]
                              },
                              "test": {
                                "type": "object",
                                "properties": {
                                  "secretKey": {
                                    "type": "string"
                                  },
                                  "publicKey": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "required": [
                              "live",
                              "test"
                            ]
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "stripe"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "systemUserAccessToken": {
                                "type": "string"
                              },
                              "phoneNumberId": {
                                "type": "string"
                              },
                              "wabaId": {
                                "type": "string"
                              },
                              "businessId": {
                                "type": "string"
                              },
                              "appSecret": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{32}$"
                              }
                            },
                            "required": [
                              "systemUserAccessToken",
                              "phoneNumberId"
                            ]
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "whatsApp"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "systemUserAccessToken": {
                                "type": "string"
                              },
                              "phoneNumberId": {
                                "type": "string"
                              },
                              "wabaId": {
                                "type": "string"
                              },
                              "displayPhoneNumber": {
                                "type": "string"
                              },
                              "verifiedName": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              },
                              "qualityRating": {
                                "type": "string"
                              },
                              "platformType": {
                                "type": "string"
                              },
                              "tokenExpiresAt": {
                                "type": "number"
                              },
                              "dataAccessExpiresAt": {
                                "type": "number"
                              },
                              "tokenInvalidAt": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "systemUserAccessToken",
                              "phoneNumberId"
                            ]
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "whatsApp-CloudAPI"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "systemUserAccessToken": {
                                "type": "string"
                              },
                              "phoneNumberId": {
                                "type": "string"
                              },
                              "wabaId": {
                                "type": "string"
                              },
                              "displayPhoneNumber": {
                                "type": "string"
                              },
                              "verifiedName": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              },
                              "qualityRating": {
                                "type": "string"
                              },
                              "platformType": {
                                "type": "string"
                              },
                              "tokenExpiresAt": {
                                "type": "number"
                              },
                              "dataAccessExpiresAt": {
                                "type": "number"
                              },
                              "tokenInvalidAt": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "systemUserAccessToken",
                              "phoneNumberId"
                            ]
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "whatsApp-QR"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "live": {
                                "type": "object",
                                "properties": {
                                  "accessToken": {
                                    "type": "string"
                                  },
                                  "publicKey": {
                                    "type": "string"
                                  }
                                }
                              },
                              "test": {
                                "type": "object",
                                "properties": {
                                  "accessToken": {
                                    "type": "string"
                                  },
                                  "publicKey": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "mercadoPago"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "apiKey": {
                                "type": "string"
                              },
                              "baseUrl": {
                                "type": "string",
                                "format": "uri"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "openai"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "apiKey": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "chat-node"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "apiEndpoint": {
                                "type": "string",
                                "format": "uri"
                              },
                              "apiKey": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "dify-ai"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "apiKey": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "mistral"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "apiKey": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "elevenlabs"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "apiKey": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "anthropic"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "apiKey": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "together-ai"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "apiKey": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "open-router"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "baseUrl": {
                                "type": "string",
                                "format": "uri"
                              },
                              "apiKey": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "nocodb"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "apiKey": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "segment"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "apiKey": {
                                "type": "string"
                              },
                              "baseUrl": {
                                "type": "string",
                                "format": "uri"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "groq"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "authToken": {
                                "type": "string"
                              },
                              "accountSid": {
                                "type": "string"
                              },
                              "phoneAdminNumber": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "twilio-com"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "clientId": {
                                "type": "string"
                              },
                              "clientSecret": {
                                "type": "string"
                              },
                              "tokenEndpoint": {
                                "type": "string",
                                "format": "uri"
                              },
                              "adminUsername": {
                                "type": "string"
                              },
                              "adminPassword": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "wordpress"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "siteUrl": {
                                "type": "string",
                                "format": "uri"
                              },
                              "consumerKey": {
                                "type": "string"
                              },
                              "consumerSecret": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "woocommerce"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "domain": {
                                "type": "string",
                                "format": "uri"
                              },
                              "apiKey": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "freshdesk"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "clientId": {
                                "type": "string"
                              },
                              "clientSecret": {
                                "type": "string"
                              },
                              "organizationId": {
                                "type": "string"
                              },
                              "domain": {
                                "type": "string",
                                "format": "uri"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "zoho-crm"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "calendarId": {
                                "type": "string"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "googleCalendar"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "from": {
                                "type": "object",
                                "properties": {
                                  "email": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                }
                              },
                              "host": {
                                "type": "string"
                              },
                              "username": {
                                "type": "string"
                              },
                              "password": {
                                "type": "string"
                              },
                              "isTlsEnabled": {
                                "type": "boolean"
                              },
                              "port": {
                                "type": "number"
                              }
                            }
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "send-email"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "googleSheets"
                            ]
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "data",
                          "type",
                          "workspaceId"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "credentials"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credentialsId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "credentialsId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/theme/templates": {
      "get": {
        "operationId": "theme-listThemeTemplates",
        "summary": "List theme templates",
        "tags": [
          "Theme template"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "themeTemplates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "theme": {
                            "$ref": "#/components/schemas/theme"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "theme"
                        ]
                      }
                    }
                  },
                  "required": [
                    "themeTemplates"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/theme/templates/{themeTemplateId}": {
      "put": {
        "operationId": "theme-saveThemeTemplate",
        "summary": "Save theme template",
        "tags": [
          "Theme template"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "themeTemplateId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "theme": {
                    "$ref": "#/components/schemas/theme"
                  }
                },
                "required": [
                  "workspaceId",
                  "name",
                  "theme"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "themeTemplate": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "theme": {
                          "$ref": "#/components/schemas/theme"
                        },
                        "workspaceId": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "theme",
                        "workspaceId",
                        "createdAt",
                        "updatedAt"
                      ]
                    }
                  },
                  "required": [
                    "themeTemplate"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "theme-deleteThemeTemplate",
        "summary": "Delete a theme template",
        "tags": [
          "Theme template"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "themeTemplateId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "themeTemplate": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "theme": {
                          "$ref": "#/components/schemas/theme"
                        },
                        "workspaceId": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "theme",
                        "workspaceId",
                        "createdAt",
                        "updatedAt"
                      ]
                    }
                  },
                  "required": [
                    "themeTemplate"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots/{botId}/collaborators": {
      "get": {
        "operationId": "collaborators-getCollaborators",
        "summary": "Get collaborators",
        "tags": [
          "Collaborators"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collaborators": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "READ",
                              "WRITE",
                              "FULL_ACCESS"
                            ]
                          },
                          "userId": {
                            "type": "string"
                          },
                          "botId": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "user": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string",
                                "nullable": true
                              },
                              "email": {
                                "type": "string",
                                "nullable": true
                              },
                              "image": {
                                "type": "string",
                                "nullable": true
                              }
                            },
                            "required": [
                              "name",
                              "email",
                              "image"
                            ]
                          }
                        },
                        "required": [
                          "type",
                          "userId",
                          "botId",
                          "createdAt",
                          "updatedAt",
                          "user"
                        ]
                      }
                    }
                  },
                  "required": [
                    "collaborators"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots/{botId}/collaborators/{userId}": {
      "patch": {
        "operationId": "collaborators-updateCollaborator",
        "summary": "Update collaborator",
        "tags": [
          "Collaborators"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "userId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "READ",
                      "WRITE",
                      "FULL_ACCESS"
                    ]
                  }
                },
                "required": [
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "collaborators-deleteCollaborator",
        "summary": "Delete collaborator",
        "tags": [
          "Collaborators"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "userId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots/{botId}/invitations": {
      "get": {
        "operationId": "collaborators-listInvitations",
        "summary": "List bot invitations",
        "tags": [
          "Collaborators"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invitations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string",
                            "format": "email"
                          },
                          "botId": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "READ",
                              "WRITE",
                              "FULL_ACCESS"
                            ]
                          }
                        },
                        "required": [
                          "createdAt",
                          "updatedAt",
                          "email",
                          "botId",
                          "type"
                        ]
                      }
                    }
                  },
                  "required": [
                    "invitations"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "collaborators-sendInvitation",
        "summary": "Send bot invitation",
        "tags": [
          "Collaborators"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "READ",
                      "WRITE",
                      "FULL_ACCESS"
                    ]
                  }
                },
                "required": [
                  "email",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bots/{botId}/invitations/{email}": {
      "patch": {
        "operationId": "collaborators-updateInvitation",
        "summary": "Update bot invitation",
        "tags": [
          "Collaborators"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "email",
            "schema": {
              "type": "string",
              "format": "email"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "READ",
                      "WRITE",
                      "FULL_ACCESS"
                    ]
                  }
                },
                "required": [
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "collaborators-deleteInvitation",
        "summary": "Delete bot invitation",
        "tags": [
          "Collaborators"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "email",
            "schema": {
              "type": "string",
              "format": "email"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/members": {
      "get": {
        "operationId": "members-listMembers",
        "summary": "List members in workspace",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)",
            "schema": {
              "type": "string",
              "description": "[Where to find my workspace ID?](https://docs.quick.bot/api/general#how-to-find-my-workspaceid)"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "workspaceId": {
                            "type": "string"
                          },
                          "user": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string",
                                "nullable": true
                              },
                              "email": {
                                "type": "string",
                                "nullable": true
                              },
                              "image": {
                                "type": "string",
                                "nullable": true
                              }
                            },
                            "required": [
                              "name",
                              "email",
                              "image"
                            ]
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "ADMIN",
                              "MEMBER",
                              "GUEST"
                            ]
                          },
                          "userId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "workspaceId",
                          "user",
                          "role",
                          "userId"
                        ]
                      }
                    },
                    "invitations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "ADMIN",
                              "MEMBER",
                              "GUEST"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "updatedAt",
                          "email",
                          "type"
                        ]
                      }
                    },
                    "guestInvitations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "botIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "email",
                          "botIds"
                        ]
                      }
                    },
                    "usedSeats": {
                      "type": "number"
                    },
                    "purchasedExtraSeats": {
                      "type": "number"
                    },
                    "totalSeats": {
                      "type": "number",
                      "nullable": true
                    }
                  },
                  "required": [
                    "members",
                    "invitations",
                    "guestInvitations",
                    "usedSeats",
                    "purchasedExtraSeats",
                    "totalSeats"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/members/{userId}": {
      "patch": {
        "operationId": "members-updateMember",
        "summary": "Update workspace member",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "userId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "ADMIN",
                      "MEMBER",
                      "GUEST"
                    ]
                  }
                },
                "required": [
                  "role"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "member": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "count"
                      ]
                    }
                  },
                  "required": [
                    "member"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "members-deleteMember",
        "summary": "Delete workspace member",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "userId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "member": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "count"
                      ]
                    }
                  },
                  "required": [
                    "member"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/invitations": {
      "post": {
        "operationId": "members-sendInvitation",
        "summary": "Send workspace invitation",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "ADMIN",
                      "MEMBER",
                      "GUEST"
                    ]
                  }
                },
                "required": [
                  "email",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invitation": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "ADMIN",
                            "MEMBER",
                            "GUEST"
                          ]
                        },
                        "workspaceId": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "PENDING",
                            "ACCEPTED",
                            "REJECTED",
                            "EXPIRED"
                          ]
                        },
                        "invitedByUserId": {
                          "type": "string",
                          "nullable": true
                        },
                        "acceptedByUserId": {
                          "type": "string",
                          "nullable": true
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "type",
                        "workspaceId",
                        "status",
                        "invitedByUserId",
                        "acceptedByUserId",
                        "createdAt",
                        "updatedAt"
                      ]
                    }
                  },
                  "required": [
                    "invitation"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/invitations/{invitationId}": {
      "patch": {
        "operationId": "members-updateInvitation",
        "summary": "Update workspace invitation",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "invitationId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "ADMIN",
                      "MEMBER",
                      "GUEST"
                    ]
                  }
                },
                "required": [
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invitation": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "count"
                      ]
                    }
                  },
                  "required": [
                    "invitation"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "members-deleteInvitation",
        "summary": "Delete workspace invitation",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "invitationId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/invitations/{token}": {
      "post": {
        "operationId": "members-acceptInvitation",
        "summary": "Accept workspace invitation",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "workspaceId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message",
                    "workspaceId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "members-getInvitation",
        "summary": "Get workspace invitation",
        "tags": [
          "Workspace"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ]
                    },
                    "invitedEmail": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "workspace",
                    "invitedEmail"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "members-regenerateInvitation",
        "summary": "Regenerate expired workspace invitation",
        "tags": [
          "Workspace"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "newInvitationId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "newInvitationId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/custom-domains": {
      "post": {
        "operationId": "customDomains-createCustomDomain",
        "summary": "Create custom domain",
        "tags": [
          "Custom domains"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "workspaceId",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customDomain": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "createdAt"
                      ]
                    }
                  },
                  "required": [
                    "customDomain"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "customDomains-listCustomDomains",
        "summary": "List custom domains",
        "tags": [
          "Custom domains"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customDomains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "createdAt"
                        ]
                      }
                    }
                  },
                  "required": [
                    "customDomains"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/custom-domains/{name}": {
      "delete": {
        "operationId": "customDomains-deleteCustomDomain",
        "summary": "Delete custom domain",
        "tags": [
          "Custom domains"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/custom-domains/{name}/verify": {
      "get": {
        "operationId": "customDomains-verifyCustomDomain",
        "summary": "Verify domain config",
        "tags": [
          "Custom domains"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "Valid Configuration",
                        "Invalid Configuration",
                        "Domain Not Found",
                        "Pending Verification",
                        "Unknown Error"
                      ]
                    },
                    "domainJson": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "apexName": {
                          "type": "string"
                        },
                        "projectId": {
                          "type": "string"
                        },
                        "redirect": {
                          "type": "string",
                          "nullable": true
                        },
                        "redirectStatusCode": {
                          "type": "number",
                          "nullable": true
                        },
                        "gitBranch": {
                          "type": "string",
                          "nullable": true
                        },
                        "updatedAt": {
                          "type": "number",
                          "nullable": true
                        },
                        "createdAt": {
                          "type": "number",
                          "nullable": true
                        },
                        "verified": {
                          "type": "boolean"
                        },
                        "verification": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "domain": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "domain",
                              "value",
                              "reason"
                            ]
                          }
                        }
                      },
                      "required": [
                        "name",
                        "apexName",
                        "projectId",
                        "redirect",
                        "redirectStatusCode",
                        "gitBranch",
                        "updatedAt",
                        "createdAt",
                        "verified"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "domainJson"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/folders/{folderId}": {
      "get": {
        "operationId": "folders-getFolder",
        "summary": "Get folder",
        "tags": [
          "Folder"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "folderId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "folder": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "parentFolderId": {
                          "type": "string",
                          "nullable": true
                        },
                        "workspaceId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "parentFolderId",
                        "workspaceId"
                      ]
                    }
                  },
                  "required": [
                    "folder"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "folders-updateFolder",
        "summary": "Update a folder",
        "tags": [
          "Folder"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "folderId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "folder": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "parentFolderId": {
                        "type": "string",
                        "nullable": true
                      }
                    }
                  }
                },
                "required": [
                  "workspaceId",
                  "folder"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "folder": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "parentFolderId": {
                          "type": "string",
                          "nullable": true
                        },
                        "workspaceId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "parentFolderId",
                        "workspaceId"
                      ]
                    }
                  },
                  "required": [
                    "folder"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "folders-deleteFolder",
        "summary": "Delete a folder",
        "tags": [
          "Folder"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "folderId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "folder": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "parentFolderId": {
                          "type": "string",
                          "nullable": true
                        },
                        "workspaceId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "parentFolderId",
                        "workspaceId"
                      ]
                    }
                  },
                  "required": [
                    "folder"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/folders": {
      "post": {
        "operationId": "folders-createFolder",
        "summary": "Create a folder",
        "tags": [
          "Folder"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "folderName": {
                    "type": "string",
                    "default": ""
                  },
                  "parentFolderId": {
                    "type": "string"
                  }
                },
                "required": [
                  "workspaceId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "folder": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "parentFolderId": {
                          "type": "string",
                          "nullable": true
                        },
                        "workspaceId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt",
                        "name",
                        "parentFolderId",
                        "workspaceId"
                      ]
                    }
                  },
                  "required": [
                    "folder"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "folders-listFolders",
        "summary": "List folders",
        "tags": [
          "Folder"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "parentFolderId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "folders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "parentFolderId": {
                            "type": "string",
                            "nullable": true
                          },
                          "workspaceId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "updatedAt",
                          "name",
                          "parentFolderId",
                          "workspaceId"
                        ]
                      }
                    }
                  },
                  "required": [
                    "folders"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/inbox/{botId}": {
      "get": {
        "operationId": "inbox-listBotConversations",
        "summary": "List last chat sessions for a bot",
        "tags": [
          "Inbox"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "description": "The bot ID to list sessions for",
            "schema": {
              "type": "string",
              "description": "The bot ID to list sessions for"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "limit",
            "description": "Number of sessions to return",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100,
              "default": 25,
              "description": "Number of sessions to return"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "description": "Number of sessions to skip",
            "schema": {
              "type": "number",
              "minimum": 0,
              "default": 0,
              "description": "Number of sessions to skip"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "variableId",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "variableValue",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "variableIds",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "variableFilters",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "schema": {
              "type": "string",
              "enum": [
                "web",
                "whatsapp"
              ]
            }
          },
          {
            "in": "query",
            "name": "channels",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "in": "query",
            "name": "status",
            "description": "Filter sessions by computed status",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "open",
                "completed",
                "closed"
              ],
              "default": "all",
              "description": "Filter sessions by computed status"
            }
          },
          {
            "in": "query",
            "name": "statuses",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "assignees",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lastActivities",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kinds",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortBy",
            "description": "Sort key: updatedAt | createdAt | expiresAt | variable:<id> (validated server-side)",
            "schema": {
              "type": "string",
              "default": "updatedAt",
              "description": "Sort key: updatedAt | createdAt | expiresAt | variable:<id> (validated server-side)"
            }
          },
          {
            "in": "query",
            "name": "sortDir",
            "description": "Sort direction",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc",
              "description": "Sort direction"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "conversationId": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "isProcessing": {
                            "type": "boolean"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "open",
                              "completed",
                              "closed"
                            ]
                          },
                          "isPreview": {
                            "type": "boolean"
                          },
                          "expiresAt": {
                            "type": "string",
                            "nullable": true
                          },
                          "assigneeUserId": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata": {
                            "type": "object",
                            "properties": {
                              "currentBlockId": {
                                "type": "string"
                              },
                              "channel": {
                                "type": "string",
                                "enum": [
                                  "web",
                                  "whatsapp"
                                ]
                              },
                              "whatsappNumber": {
                                "type": "string"
                              },
                              "contactName": {
                                "type": "string"
                              },
                              "lastEvent": {}
                            },
                            "required": [
                              "channel"
                            ]
                          },
                          "variableValue": {
                            "type": "string",
                            "nullable": true
                          },
                          "variableValues": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string",
                                  "nullable": true
                                }
                              },
                              "required": [
                                "id",
                                "value"
                              ]
                            }
                          }
                        },
                        "required": [
                          "conversationId",
                          "createdAt",
                          "updatedAt",
                          "status",
                          "isPreview",
                          "expiresAt",
                          "assigneeUserId"
                        ]
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "limit": {
                          "type": "number"
                        },
                        "offset": {
                          "type": "number"
                        },
                        "nextOffset": {
                          "type": "number"
                        },
                        "hasMore": {
                          "type": "boolean"
                        },
                        "total": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "limit",
                        "offset",
                        "hasMore",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "conversations",
                    "pagination"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/inbox/{botId}/{conversationId}": {
      "get": {
        "operationId": "inbox-getBotLastConversation",
        "summary": "Get a specific last conversation for a bot",
        "tags": [
          "Inbox"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "botId",
            "description": "The bot ID",
            "schema": {
              "type": "string",
              "description": "The bot ID"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "conversationId",
            "description": "The chat session ID or conversation ID to get the associated chat session",
            "schema": {
              "type": "string",
              "description": "The chat session ID or conversation ID to get the associated chat session"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversation": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "isProcessing": {
                          "type": "boolean"
                        },
                        "metadata": {
                          "type": "object",
                          "properties": {
                            "currentBlockId": {
                              "type": "string"
                            },
                            "channel": {
                              "type": "string",
                              "enum": [
                                "web",
                                "whatsapp",
                                "telegram"
                              ]
                            },
                            "whatsappNumber": {
                              "type": "string"
                            },
                            "contactName": {
                              "type": "string"
                            },
                            "lastMessage": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "channel"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "updatedAt"
                      ]
                    },
                    "theme": {
                      "$ref": "#/components/schemas/theme"
                    },
                    "botName": {
                      "type": "string"
                    },
                    "systemVariables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "nullable": true
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "isSecretVariable": {
                            "type": "boolean"
                          },
                          "isSavedVariable": {
                            "type": "boolean"
                          },
                          "blockType": {
                            "type": "string"
                          },
                          "isEditable": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      }
                    },
                    "userVariables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "nullable": true
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "isSecretVariable": {
                            "type": "boolean"
                          },
                          "isSavedVariable": {
                            "type": "boolean"
                          },
                          "blockType": {
                            "type": "string"
                          },
                          "isEditable": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      }
                    },
                    "assigneeUserId": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "conversation",
                    "assigneeUserId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "Authorization not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient access",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "Authorization": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "group": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "graphCoordinates": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ]
          },
          "blocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/block"
            }
          }
        },
        "required": [
          "id",
          "title",
          "graphCoordinates",
          "blocks"
        ],
        "title": "Group"
      },
      "block": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "text"
                ]
              },
              "content": {
                "type": "object",
                "properties": {
                  "markdown": {
                    "type": "string",
                    "default": ""
                  }
                },
                "default": {}
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "image"
                ]
              },
              "content": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "clickLink": {
                    "type": "object",
                    "properties": {
                      "url": {
                        "type": "string"
                      },
                      "alt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "default": {}
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "video"
                ]
              },
              "content": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "url",
                      "youtube",
                      "vimeo",
                      "tiktok",
                      "gumlet"
                    ]
                  },
                  "height": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {}
                    ]
                  },
                  "aspectRatio": {
                    "type": "string"
                  },
                  "maxWidth": {
                    "type": "string"
                  },
                  "queryParamsStr": {
                    "type": "string"
                  },
                  "areControlsDisplayed": {
                    "type": "boolean"
                  },
                  "isAutoplayEnabled": {
                    "type": "boolean"
                  }
                },
                "default": {}
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "embed"
                ]
              },
              "content": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "height": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {}
                    ]
                  },
                  "waitForEvent": {
                    "type": "object",
                    "properties": {
                      "isEnabled": {
                        "type": "boolean"
                      },
                      "name": {
                        "type": "string"
                      },
                      "saveDataInVariableId": {
                        "type": "string"
                      }
                    }
                  },
                  "initFunction": {
                    "type": "object",
                    "properties": {
                      "args": {
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "content": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "args",
                      "content"
                    ]
                  },
                  "waitForEventFunction": {
                    "type": "object",
                    "properties": {
                      "args": {
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "content": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "args",
                      "content"
                    ]
                  }
                },
                "default": {}
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "audio"
                ]
              },
              "content": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "isAutoplayEnabled": {
                    "type": "boolean"
                  }
                },
                "default": {}
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "file"
                ]
              },
              "content": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "fileName": {
                    "type": "string"
                  },
                  "mimeType": {
                    "type": "string"
                  }
                },
                "default": {}
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "$ref": "#/components/schemas/textInput"
          },
          {
            "$ref": "#/components/schemas/buttonsInput"
          },
          {
            "$ref": "#/components/schemas/email"
          },
          {
            "$ref": "#/components/schemas/numberInput"
          },
          {
            "$ref": "#/components/schemas/url"
          },
          {
            "$ref": "#/components/schemas/phoneNumberInput"
          },
          {
            "$ref": "#/components/schemas/dateInput"
          },
          {
            "$ref": "#/components/schemas/rating"
          },
          {
            "$ref": "#/components/schemas/fileInput"
          },
          {
            "$ref": "#/components/schemas/paymentInput"
          },
          {
            "$ref": "#/components/schemas/mercadoPagoPaymentInput"
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "script"
                ]
              },
              "options": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string"
                  },
                  "isExecutedOnClient": {
                    "type": "boolean"
                  },
                  "shouldExecuteInParentContext": {
                    "type": "boolean"
                  }
                }
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "Condition"
                ]
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "outgoingEdgeId": {
                      "type": "string"
                    },
                    "content": {
                      "type": "object",
                      "properties": {
                        "logicalOperator": {
                          "type": "string",
                          "enum": [
                            "OR",
                            "AND"
                          ]
                        },
                        "comparisons": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "variableId": {
                                "type": "string"
                              },
                              "comparisonOperator": {
                                "type": "string",
                                "enum": [
                                  "Equal to",
                                  "Not equal",
                                  "Greater than",
                                  "Less than",
                                  "Is set",
                                  "Is empty",
                                  "Is not empty",
                                  "Contains",
                                  "Does not contain",
                                  "Starts with",
                                  "Ends with",
                                  "Matches regex",
                                  "Does not match regex"
                                ]
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "id"
                  ]
                }
              }
            },
            "required": [
              "id",
              "type",
              "items"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "Redirect"
                ]
              },
              "options": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "isNewTab": {
                    "type": "boolean"
                  }
                }
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "Variable"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "variableId": {
                        "type": "string"
                      },
                      "isExecutedOnClient": {
                        "type": "boolean"
                      },
                      "expressionToEvaluate": {
                        "type": "string"
                      },
                      "isCode": {
                        "type": "boolean"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "variableId": {
                        "type": "string"
                      },
                      "isExecutedOnClient": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "Empty"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "variableId": {
                        "type": "string"
                      },
                      "isExecutedOnClient": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "Set"
                        ]
                      },
                      "expressionToEvaluate": {
                        "type": "string"
                      },
                      "isCode": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "variableId": {
                        "type": "string"
                      },
                      "isExecutedOnClient": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "Map item with same index"
                        ]
                      },
                      "mapListItemParams": {
                        "type": "object",
                        "properties": {
                          "baseItemVariableId": {
                            "type": "string"
                          },
                          "baseListVariableId": {
                            "type": "string"
                          },
                          "targetListVariableId": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "variableId": {
                        "type": "string"
                      },
                      "isExecutedOnClient": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "Append value(s)"
                        ]
                      },
                      "item": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "variableId": {
                        "type": "string"
                      },
                      "isExecutedOnClient": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "Pop",
                          "Shift"
                        ]
                      },
                      "saveItemInVariableId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "Bot link"
                ]
              },
              "options": {
                "type": "object",
                "properties": {
                  "botId": {
                    "type": "string"
                  },
                  "groupId": {
                    "type": "string"
                  }
                }
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "Wait"
                ]
              },
              "options": {
                "type": "object",
                "properties": {
                  "secondsToWaitFor": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {}
                    ]
                  }
                }
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "Jump"
                ]
              },
              "options": {
                "type": "object",
                "properties": {
                  "groupId": {
                    "type": "string"
                  },
                  "blockId": {
                    "type": "string"
                  }
                }
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "AB test"
                ]
              },
              "items": {
                "type": "array",
                "maxItems": 2,
                "minItems": 2,
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "outgoingEdgeId": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string",
                          "enum": [
                            "a"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "path"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "outgoingEdgeId": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string",
                          "enum": [
                            "b"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "path"
                      ]
                    }
                  ]
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "aPercent": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  }
                }
              }
            },
            "required": [
              "id",
              "type",
              "items"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "openai"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create chat completion"
                        ]
                      },
                      "model": {
                        "type": "string"
                      },
                      "messages": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "system"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "user"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "assistant"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "Dialogue"
                                  ]
                                },
                                "dialogueVariableId": {
                                  "type": "string"
                                },
                                "startsBy": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            }
                          ]
                        }
                      },
                      "tools": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "function"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "parameters": {
                                  "type": "array",
                                  "items": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {}
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "string"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "number"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "boolean"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "enum"
                                            ]
                                          },
                                          "values": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      }
                                    ]
                                  }
                                },
                                "code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        }
                      },
                      "temperature": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 2
                      },
                      "maxTokens": {
                        "type": "number",
                        "minimum": 1,
                        "maximum": 4096
                      },
                      "responseMapping": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "item": {
                              "type": "string",
                              "enum": [
                                "Message content",
                                "Total tokens",
                                "Tool results"
                              ]
                            },
                            "variableId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Ask Assistant"
                        ]
                      },
                      "assistantId": {
                        "type": "string"
                      },
                      "threadVariableId": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      },
                      "functions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "code": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "responseMapping": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "item": {
                              "type": "string",
                              "enum": [
                                "Message",
                                "Thread ID",
                                "Tool results"
                              ]
                            },
                            "variableId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create speech"
                        ]
                      },
                      "model": {
                        "type": "string"
                      },
                      "input": {
                        "type": "string"
                      },
                      "voice": {
                        "type": "string",
                        "enum": [
                          "alloy",
                          "echo",
                          "fable",
                          "onyx",
                          "nova",
                          "shimmer"
                        ]
                      },
                      "saveUrlInVariableId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create transcription"
                        ]
                      },
                      "url": {
                        "type": "string"
                      },
                      "transcriptionVariableId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Generate variables"
                        ]
                      },
                      "model": {
                        "type": "string"
                      },
                      "prompt": {
                        "type": "string"
                      },
                      "variablesToExtract": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "string"
                                  ]
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "number"
                                  ]
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "boolean"
                                  ]
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "enum"
                                  ]
                                },
                                "values": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "cal-com"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "action": {
                        "type": "string",
                        "enum": [
                          "Book event"
                        ]
                      },
                      "baseUrl": {
                        "type": "string"
                      },
                      "link": {
                        "type": "string"
                      },
                      "layout": {
                        "type": "string",
                        "enum": [
                          "Month",
                          "Weekly",
                          "Columns"
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "additionalNotes": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "saveBookedDateInVariableId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "chat-node"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Send Message"
                        ]
                      },
                      "botId": {
                        "type": "string"
                      },
                      "threadId": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      },
                      "responseMapping": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "item": {
                              "type": "string",
                              "enum": [
                                "Message",
                                "Thread ID"
                              ]
                            },
                            "variableId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "qr-code"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "action": {
                        "type": "string",
                        "enum": [
                          "Generate a QR Code"
                        ]
                      },
                      "data": {
                        "type": "string"
                      },
                      "saveUrlInVariableId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "dify-ai"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create Chat Message"
                        ]
                      },
                      "query": {
                        "type": "string"
                      },
                      "conversationVariableId": {
                        "type": "string"
                      },
                      "user": {
                        "type": "string"
                      },
                      "inputs": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "responseMapping": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "item": {
                              "type": "string",
                              "enum": [
                                "Answer",
                                "Conversation ID",
                                "Total Tokens"
                              ]
                            },
                            "variableId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "mistral"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create chat completion"
                        ]
                      },
                      "model": {
                        "type": "string"
                      },
                      "messages": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "system"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "user"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "assistant"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "Dialogue"
                                  ]
                                },
                                "dialogueVariableId": {
                                  "type": "string"
                                },
                                "startsBy": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            }
                          ]
                        }
                      },
                      "tools": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "function"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "parameters": {
                                  "type": "array",
                                  "items": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {}
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "string"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "number"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "boolean"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "enum"
                                            ]
                                          },
                                          "values": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      }
                                    ]
                                  }
                                },
                                "code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        }
                      },
                      "responseMapping": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "item": {
                              "type": "string",
                              "enum": [
                                "Message content"
                              ]
                            },
                            "variableId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Generate variables"
                        ]
                      },
                      "model": {
                        "type": "string"
                      },
                      "prompt": {
                        "type": "string"
                      },
                      "variablesToExtract": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "string"
                                  ]
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "number"
                                  ]
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "boolean"
                                  ]
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "enum"
                                  ]
                                },
                                "values": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "elevenlabs"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Convert text to speech"
                        ]
                      },
                      "text": {
                        "type": "string"
                      },
                      "voiceId": {
                        "type": "string"
                      },
                      "modelId": {
                        "type": "string"
                      },
                      "saveUrlInVariableId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "anthropic"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create Chat Message"
                        ]
                      },
                      "model": {
                        "type": "string",
                        "enum": [
                          "claude-3-5-sonnet-20240620",
                          "claude-3-opus-20240229",
                          "claude-3-sonnet-20240229",
                          "claude-3-haiku-20240307",
                          "claude-2.1",
                          "claude-2.0",
                          "claude-instant-1.2"
                        ]
                      },
                      "messages": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "user"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "assistant"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "Dialogue"
                                  ]
                                },
                                "dialogueVariableId": {
                                  "type": "string"
                                },
                                "startsBy": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            }
                          ]
                        }
                      },
                      "tools": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "function"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "parameters": {
                                  "type": "array",
                                  "items": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {}
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "string"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "number"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "boolean"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "enum"
                                            ]
                                          },
                                          "values": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      }
                                    ]
                                  }
                                },
                                "code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        }
                      },
                      "systemMessage": {
                        "type": "string"
                      },
                      "temperature": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 2
                      },
                      "maxTokens": {
                        "type": "number",
                        "minimum": 1,
                        "maximum": 4096
                      },
                      "responseMapping": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "item": {
                              "type": "string",
                              "enum": [
                                "Message Content"
                              ]
                            },
                            "variableId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Generate variables"
                        ]
                      },
                      "model": {
                        "type": "string",
                        "enum": [
                          "claude-3-5-sonnet-20240620",
                          "claude-3-opus-20240229",
                          "claude-3-sonnet-20240229",
                          "claude-3-haiku-20240307",
                          "claude-2.1",
                          "claude-2.0",
                          "claude-instant-1.2"
                        ]
                      },
                      "prompt": {
                        "type": "string"
                      },
                      "variablesToExtract": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "string"
                                  ]
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "number"
                                  ]
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "boolean"
                                  ]
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "enum"
                                  ]
                                },
                                "values": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "variableId": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "isRequired": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "together-ai"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create chat completion"
                        ]
                      },
                      "model": {
                        "type": "string"
                      },
                      "messages": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "system"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "user"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "assistant"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "Dialogue"
                                  ]
                                },
                                "dialogueVariableId": {
                                  "type": "string"
                                },
                                "startsBy": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            }
                          ]
                        }
                      },
                      "tools": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "function"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "parameters": {
                                  "type": "array",
                                  "items": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {}
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "string"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "number"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "boolean"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "enum"
                                            ]
                                          },
                                          "values": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      }
                                    ]
                                  }
                                },
                                "code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        }
                      },
                      "temperature": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 2
                      },
                      "maxTokens": {
                        "type": "number",
                        "minimum": 1,
                        "maximum": 4096
                      },
                      "responseMapping": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "item": {
                              "type": "string",
                              "enum": [
                                "Message content",
                                "Total tokens",
                                "Tool results"
                              ]
                            },
                            "variableId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "open-router"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create chat completion"
                        ]
                      },
                      "model": {
                        "type": "string"
                      },
                      "messages": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "system"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "user"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "assistant"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "Dialogue"
                                  ]
                                },
                                "dialogueVariableId": {
                                  "type": "string"
                                },
                                "startsBy": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            }
                          ]
                        }
                      },
                      "tools": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "function"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "parameters": {
                                  "type": "array",
                                  "items": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {}
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "string"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "number"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "boolean"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "enum"
                                            ]
                                          },
                                          "values": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      }
                                    ]
                                  }
                                },
                                "code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        }
                      },
                      "temperature": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 2
                      },
                      "maxTokens": {
                        "type": "number",
                        "minimum": 1,
                        "maximum": 4096
                      },
                      "responseMapping": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "item": {
                              "type": "string",
                              "enum": [
                                "Message content",
                                "Total tokens",
                                "Tool results"
                              ]
                            },
                            "variableId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "nocodb"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Search Records"
                        ]
                      },
                      "tableId": {
                        "type": "string"
                      },
                      "viewId": {
                        "type": "string"
                      },
                      "returnType": {
                        "type": "string",
                        "enum": [
                          "All",
                          "First",
                          "Last",
                          "Random"
                        ]
                      },
                      "filter": {
                        "type": "object",
                        "properties": {
                          "comparisons": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "input": {
                                  "type": "string"
                                },
                                "operator": {
                                  "type": "string",
                                  "enum": [
                                    "Equal to",
                                    "Not equal",
                                    "Contains",
                                    "Greater than",
                                    "Less than",
                                    "Is set",
                                    "Is empty",
                                    "Starts with",
                                    "Ends with"
                                  ]
                                },
                                "value": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "joiner": {
                            "type": "string",
                            "enum": [
                              "AND",
                              "OR"
                            ]
                          }
                        },
                        "required": [
                          "comparisons"
                        ]
                      },
                      "responseMapping": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "fieldName": {
                              "type": "string"
                            },
                            "variableId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create Record"
                        ]
                      },
                      "tableId": {
                        "type": "string"
                      },
                      "fields": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Update Existing Record"
                        ]
                      },
                      "tableId": {
                        "type": "string"
                      },
                      "viewId": {
                        "type": "string"
                      },
                      "filter": {
                        "type": "object",
                        "properties": {
                          "comparisons": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "input": {
                                  "type": "string"
                                },
                                "operator": {
                                  "type": "string",
                                  "enum": [
                                    "Equal to",
                                    "Not equal",
                                    "Contains",
                                    "Greater than",
                                    "Less than",
                                    "Is set",
                                    "Is empty",
                                    "Starts with",
                                    "Ends with"
                                  ]
                                },
                                "value": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "joiner": {
                            "type": "string",
                            "enum": [
                              "AND",
                              "OR"
                            ]
                          }
                        },
                        "required": [
                          "comparisons"
                        ]
                      },
                      "updates": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "fieldName": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "segment"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Alias"
                        ]
                      },
                      "userId": {
                        "type": "string"
                      },
                      "previousId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Identify User"
                        ]
                      },
                      "userId": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "traits": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Page"
                        ]
                      },
                      "userId": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      },
                      "properties": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Track"
                        ]
                      },
                      "eventName": {
                        "type": "string"
                      },
                      "userId": {
                        "type": "string"
                      },
                      "properties": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "groq"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create chat completion"
                        ]
                      },
                      "model": {
                        "type": "string"
                      },
                      "messages": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "system"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "user"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "assistant"
                                  ]
                                },
                                "content": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "Dialogue"
                                  ]
                                },
                                "dialogueVariableId": {
                                  "type": "string"
                                },
                                "startsBy": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "role"
                              ]
                            }
                          ]
                        }
                      },
                      "tools": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {}
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "function"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "parameters": {
                                  "type": "array",
                                  "items": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {}
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "string"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "number"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "boolean"
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "enum"
                                            ]
                                          },
                                          "values": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "required": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ]
                                      }
                                    ]
                                  }
                                },
                                "code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        }
                      },
                      "temperature": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 2
                      },
                      "maxTokens": {
                        "type": "number",
                        "minimum": 1,
                        "maximum": 4096
                      },
                      "responseMapping": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "item": {
                              "type": "string",
                              "enum": [
                                "Message content",
                                "Total tokens",
                                "Tool results"
                              ]
                            },
                            "variableId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "twilio-com"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Send Message"
                        ]
                      },
                      "body": {
                        "type": "string"
                      },
                      "to": {
                        "type": "string"
                      },
                      "from": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "wordpress"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Login with WordPress"
                        ]
                      },
                      "email": {
                        "type": "string"
                      },
                      "password": {
                        "type": "string"
                      },
                      "storeUserIdIn": {
                        "type": "string"
                      },
                      "storeAccessTokenIn": {
                        "type": "string"
                      },
                      "storeRefreshTokenIn": {
                        "type": "string"
                      },
                      "storeUsernameIn": {
                        "type": "string"
                      },
                      "storeNicknameIn": {
                        "type": "string"
                      },
                      "storeMessageIn": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Register with WordPress"
                        ]
                      },
                      "email": {
                        "type": "string"
                      },
                      "password": {
                        "type": "string"
                      },
                      "username": {
                        "type": "string"
                      },
                      "firstName": {
                        "type": "string"
                      },
                      "lastName": {
                        "type": "string"
                      },
                      "storeUserIdIn": {
                        "type": "string"
                      },
                      "storeUsernameIn": {
                        "type": "string"
                      },
                      "storeMessageIn": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "woocommerce"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Search Products"
                        ]
                      },
                      "searchTerm": {
                        "type": "string"
                      },
                      "perPage": {
                        "type": "number",
                        "minimum": 0
                      },
                      "outputVariableId": {
                        "type": "string"
                      },
                      "outputDataVariableId": {
                        "type": "string"
                      },
                      "formatType": {
                        "type": "string",
                        "enum": [
                          "list",
                          "detail"
                        ]
                      },
                      "includeLinks": {
                        "type": "boolean"
                      },
                      "includePrices": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Get Product By ID"
                        ]
                      },
                      "productId": {
                        "type": "string"
                      },
                      "outputVariableId": {
                        "type": "string"
                      },
                      "includeLinks": {
                        "type": "boolean"
                      },
                      "includePrices": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "freshdesk"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create Ticket"
                        ]
                      },
                      "subject": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "priority": {
                        "type": "string",
                        "enum": [
                          "Low",
                          "Medium",
                          "High",
                          "Urgent"
                        ]
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "Email",
                          "Portal",
                          "Phone",
                          "Chat",
                          "Mobihelp",
                          "Feedback Widget",
                          "Outbound Email"
                        ]
                      },
                      "type": {
                        "type": "string"
                      },
                      "outputVariableId": {
                        "type": "string"
                      },
                      "includeDetails": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Get Ticket Types"
                        ]
                      },
                      "arrayOutputVariableId": {
                        "type": "string"
                      },
                      "stringOutputVariableId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "zoho-crm"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Test Connection"
                        ]
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Get Organization Info"
                        ]
                      },
                      "storeOrgNameIn": {
                        "type": "string"
                      },
                      "storeOrgIdIn": {
                        "type": "string"
                      },
                      "storeAccessTokenIn": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create Contact"
                        ]
                      },
                      "firstName": {
                        "type": "string"
                      },
                      "lastName": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "company": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "storeContactIdIn": {
                        "type": "string"
                      },
                      "storeMessageIn": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create Lead"
                        ]
                      },
                      "firstName": {
                        "type": "string"
                      },
                      "lastName": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "company": {
                        "type": "string"
                      },
                      "leadSource": {
                        "type": "string"
                      },
                      "industry": {
                        "type": "string"
                      },
                      "storeLeadIdIn": {
                        "type": "string"
                      },
                      "storeMessageIn": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Get Lead by Email"
                        ]
                      },
                      "email": {
                        "type": "string"
                      },
                      "storeFullNameIn": {
                        "type": "string"
                      },
                      "storeLeadStatusIn": {
                        "type": "string"
                      },
                      "storePhoneIn": {
                        "type": "string"
                      },
                      "storeLeadIdIn": {
                        "type": "string"
                      },
                      "storeCrmLinkIn": {
                        "type": "string"
                      },
                      "storeCompanyIn": {
                        "type": "string"
                      },
                      "storeMessageIn": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "googleCalendar"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Create Event"
                        ]
                      },
                      "title": {
                        "type": "string"
                      },
                      "timeZone": {
                        "type": "string"
                      },
                      "startDateTime": {
                        "type": "string"
                      },
                      "duration": {
                        "type": "string",
                        "enum": [
                          "15",
                          "30",
                          "60",
                          "120",
                          "180",
                          "300"
                        ]
                      },
                      "description": {
                        "type": "string"
                      },
                      "location": {
                        "type": "string"
                      },
                      "attendees": {
                        "type": "string"
                      },
                      "outputVariableId": {
                        "type": "string"
                      },
                      "outputEventIdVariableId": {
                        "type": "string"
                      },
                      "outputEventLinkVariableId": {
                        "type": "string"
                      },
                      "outputMeetLinkVariableId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "send-email"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Email"
                        ]
                      },
                      "recipients": {
                        "type": "string"
                      },
                      "subject": {
                        "type": "string"
                      },
                      "body": {
                        "type": "string"
                      },
                      "attachmentsVariableId": {
                        "type": "string"
                      },
                      "replyTo": {
                        "type": "string"
                      },
                      "cc": {
                        "type": "string"
                      },
                      "bcc": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "googleSheets"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Insert Row"
                        ]
                      },
                      "spreadsheetId": {
                        "type": "string"
                      },
                      "sheetId": {
                        "type": "string"
                      },
                      "cellsToInsert": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "column": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Get Row"
                        ]
                      },
                      "spreadsheetId": {
                        "type": "string"
                      },
                      "sheetId": {
                        "type": "string"
                      },
                      "selectRows": {
                        "type": "object",
                        "properties": {
                          "totalRows": {
                            "type": "string",
                            "enum": [
                              "All",
                              "First",
                              "Last",
                              "Random"
                            ]
                          },
                          "comparisons": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "logicalOperator": {
                                  "type": "string",
                                  "enum": [
                                    "AND",
                                    "OR"
                                  ]
                                },
                                "column": {
                                  "type": "string"
                                },
                                "comparisonOperator": {
                                  "type": "string",
                                  "enum": [
                                    "EQUAL",
                                    "NOT_EQUAL",
                                    "CONTAINS",
                                    "NOT_CONTAINS",
                                    "GREATER",
                                    "LESS",
                                    "IS_SET",
                                    "IS_EMPTY"
                                  ]
                                },
                                "value": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      "cellsToExtract": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "column": {
                              "type": "string"
                            },
                            "variableId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "credentialsId": {
                        "type": "string"
                      },
                      "action": {
                        "type": "string",
                        "enum": [
                          "Update Row"
                        ]
                      },
                      "spreadsheetId": {
                        "type": "string"
                      },
                      "sheetId": {
                        "type": "string"
                      },
                      "filter": {
                        "type": "object",
                        "properties": {
                          "comparisons": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "logicalOperator": {
                                  "type": "string",
                                  "enum": [
                                    "AND",
                                    "OR"
                                  ]
                                },
                                "column": {
                                  "type": "string"
                                },
                                "comparisonOperator": {
                                  "type": "string",
                                  "enum": [
                                    "EQUAL",
                                    "NOT_EQUAL",
                                    "CONTAINS",
                                    "NOT_CONTAINS",
                                    "GREATER",
                                    "LESS",
                                    "IS_SET",
                                    "IS_EMPTY"
                                  ]
                                },
                                "value": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      "cellsToUpsert": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "column": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "httpRequest"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "action": {
                        "type": "string",
                        "enum": [
                          "Make HTTP Request"
                        ]
                      },
                      "url": {
                        "type": "string"
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "GET",
                          "POST",
                          "PUT",
                          "PATCH",
                          "DELETE",
                          "HEAD"
                        ]
                      },
                      "body": {
                        "type": "string"
                      },
                      "headers": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "queryParams": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "responseVariableMapping": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "variableId": {
                              "type": "string"
                            },
                            "bodyPath": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "timeout": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "googleAnalytics"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "action": {
                        "type": "string",
                        "enum": [
                          "Track Event"
                        ]
                      },
                      "trackingId": {
                        "type": "string"
                      },
                      "eventAction": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "value": {
                        "type": "number"
                      },
                      "sendTo": {
                        "type": "string"
                      },
                      "debugMode": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "metaPixel"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "action": {
                        "type": "string",
                        "enum": [
                          "Track Event"
                        ]
                      },
                      "pixelId": {
                        "type": "string"
                      },
                      "accessToken": {
                        "type": "string"
                      },
                      "pageId": {
                        "type": "string"
                      },
                      "testEventCode": {
                        "type": "string"
                      },
                      "initializePixel": {
                        "type": "boolean"
                      },
                      "eventType": {
                        "type": "string",
                        "enum": [
                          "Custom",
                          "Lead",
                          "Contact",
                          "CompleteRegistration",
                          "Schedule",
                          "SubmitApplication",
                          "ViewContent",
                          "AddPaymentInfo",
                          "AddToCart",
                          "AddToWishlist",
                          "CustomizeProduct",
                          "Donate",
                          "FindLocation",
                          "InitiateCheckout",
                          "Purchase",
                          "Search",
                          "StartTrial",
                          "Subscribe"
                        ]
                      },
                      "eventName": {
                        "type": "string"
                      },
                      "params": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "outgoingEdgeId": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "human-handoff"
                ]
              },
              "options": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "action": {
                        "type": "string",
                        "enum": [
                          "Human Handoff"
                        ]
                      },
                      "assigneeUserId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "action"
                    ]
                  }
                ]
              }
            },
            "required": [
              "id",
              "type"
            ]
          }
        ],
        "title": "Block"
      },
      "textInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text input"
            ]
          },
          "options": {
            "type": "object",
            "properties": {
              "labels": {
                "type": "object",
                "properties": {
                  "placeholder": {
                    "type": "string"
                  },
                  "button": {
                    "type": "string"
                  }
                }
              },
              "variableId": {
                "type": "string"
              },
              "audioClip": {
                "type": "object",
                "properties": {
                  "isEnabled": {
                    "type": "boolean"
                  },
                  "saveVariableId": {
                    "type": "string"
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "Auto",
                      "Public",
                      "Private"
                    ]
                  }
                }
              },
              "attachments": {
                "type": "object",
                "properties": {
                  "isEnabled": {
                    "type": "boolean"
                  },
                  "saveVariableId": {
                    "type": "string"
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "Auto",
                      "Public",
                      "Private"
                    ]
                  }
                }
              }
            }
          }
        },
        "required": [
          "id",
          "type"
        ],
        "title": "Text"
      },
      "buttonsInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "buttons input"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "outgoingEdgeId": {
                  "type": "string"
                },
                "pictureSrc": {
                  "type": "string"
                },
                "content": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "displayCondition": {
                  "type": "object",
                  "properties": {
                    "isEnabled": {
                      "type": "boolean"
                    },
                    "condition": {
                      "type": "object",
                      "properties": {
                        "logicalOperator": {
                          "type": "string",
                          "enum": [
                            "OR",
                            "AND"
                          ]
                        },
                        "comparisons": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "variableId": {
                                "type": "string"
                              },
                              "comparisonOperator": {
                                "type": "string",
                                "enum": [
                                  "Equal to",
                                  "Not equal",
                                  "Greater than",
                                  "Less than",
                                  "Is set",
                                  "Is empty",
                                  "Is not empty",
                                  "Contains",
                                  "Does not contain",
                                  "Starts with",
                                  "Ends with",
                                  "Matches regex",
                                  "Does not match regex"
                                ]
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              },
              "required": [
                "id",
                "content"
              ]
            }
          },
          "options": {
            "type": "object",
            "properties": {
              "variableId": {
                "type": "string"
              },
              "isMultipleChoice": {
                "type": "boolean"
              },
              "buttonLabel": {
                "type": "string"
              },
              "dynamicVariableId": {
                "type": "string"
              },
              "isSearchable": {
                "type": "boolean"
              },
              "searchInputPlaceholder": {
                "type": "string"
              },
              "otherOption": {
                "type": "boolean"
              },
              "whatsappFlowHeader": {
                "type": "string"
              },
              "whatsappFlowBody": {
                "type": "string"
              },
              "whatsappFlowButtonText": {
                "type": "string"
              },
              "whatsappFlowQuestionLabel": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "id",
          "type",
          "items"
        ],
        "title": "Buttons"
      },
      "email": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "email input"
            ]
          },
          "options": {
            "type": "object",
            "properties": {
              "variableId": {
                "type": "string"
              },
              "labels": {
                "type": "object",
                "properties": {
                  "placeholder": {
                    "type": "string"
                  },
                  "button": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "required": [
          "id",
          "type"
        ],
        "title": "Email"
      },
      "numberInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "number input"
            ]
          },
          "options": {
            "type": "object",
            "properties": {
              "variableId": {
                "type": "string"
              },
              "labels": {
                "type": "object",
                "properties": {
                  "placeholder": {
                    "type": "string"
                  },
                  "button": {
                    "type": "string"
                  }
                }
              },
              "min": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {}
                ]
              },
              "max": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {}
                ]
              },
              "step": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {}
                ]
              }
            }
          }
        },
        "required": [
          "id",
          "type"
        ],
        "title": "Number"
      },
      "url": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "url input"
            ]
          },
          "options": {
            "type": "object",
            "properties": {
              "variableId": {
                "type": "string"
              },
              "labels": {
                "type": "object",
                "properties": {
                  "placeholder": {
                    "type": "string"
                  },
                  "button": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "required": [
          "id",
          "type"
        ],
        "title": "URL"
      },
      "phoneNumberInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "phone number input"
            ]
          },
          "options": {
            "type": "object",
            "properties": {
              "variableId": {
                "type": "string"
              },
              "labels": {
                "type": "object",
                "properties": {
                  "placeholder": {
                    "type": "string"
                  },
                  "button": {
                    "type": "string"
                  }
                }
              },
              "defaultCountryCode": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "id",
          "type"
        ],
        "title": "Phone number"
      },
      "dateInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "date input"
            ]
          },
          "options": {
            "type": "object",
            "properties": {
              "variableId": {
                "type": "string"
              },
              "labels": {
                "type": "object",
                "properties": {
                  "button": {
                    "type": "string"
                  },
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  }
                }
              },
              "hasTime": {
                "type": "boolean"
              },
              "isRange": {
                "type": "boolean"
              },
              "format": {
                "type": "string"
              },
              "min": {
                "type": "string"
              },
              "max": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "id",
          "type"
        ],
        "title": "Date"
      },
      "rating": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "rating input"
            ]
          },
          "options": {
            "type": "object",
            "properties": {
              "variableId": {
                "type": "string"
              },
              "buttonType": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "Icons"
                    ]
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Numbers"
                    ]
                  }
                ]
              },
              "length": {
                "type": "number"
              },
              "startsAt": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {}
                ]
              },
              "labels": {
                "type": "object",
                "properties": {
                  "left": {
                    "type": "string"
                  },
                  "right": {
                    "type": "string"
                  },
                  "button": {
                    "type": "string"
                  }
                }
              },
              "customIcon": {
                "type": "object",
                "properties": {
                  "isEnabled": {
                    "type": "boolean"
                  },
                  "svg": {
                    "type": "string"
                  }
                }
              },
              "isOneClickSubmitEnabled": {
                "type": "boolean"
              },
              "whatsappMessage": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "id",
          "type"
        ],
        "title": "Rating"
      },
      "fileInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "file input"
            ]
          },
          "options": {
            "type": "object",
            "properties": {
              "variableId": {
                "type": "string"
              },
              "isRequired": {
                "type": "boolean"
              },
              "isMultipleAllowed": {
                "type": "boolean"
              },
              "labels": {
                "type": "object",
                "properties": {
                  "placeholder": {
                    "type": "string"
                  },
                  "button": {
                    "type": "string"
                  },
                  "clear": {
                    "type": "string"
                  },
                  "skip": {
                    "type": "string"
                  },
                  "success": {
                    "type": "object",
                    "properties": {
                      "single": {
                        "type": "string"
                      },
                      "multiple": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "visibility": {
                "type": "string",
                "enum": [
                  "Auto",
                  "Public",
                  "Private"
                ]
              }
            }
          }
        },
        "required": [
          "id",
          "type"
        ],
        "title": "File"
      },
      "paymentInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "stripe"
            ]
          },
          "options": {
            "type": "object",
            "properties": {
              "variableId": {
                "type": "string"
              },
              "provider": {
                "type": "string",
                "enum": [
                  "Stripe"
                ]
              },
              "labels": {
                "type": "object",
                "properties": {
                  "button": {
                    "type": "string"
                  },
                  "success": {
                    "type": "string"
                  }
                }
              },
              "additionalInformation": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "phoneNumber": {
                    "type": "string"
                  },
                  "address": {
                    "type": "object",
                    "properties": {
                      "country": {
                        "type": "string"
                      },
                      "line1": {
                        "type": "string"
                      },
                      "line2": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "credentialsId": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "id",
          "type"
        ],
        "title": "Payment"
      },
      "mercadoPagoPaymentInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "mercadopago payment"
            ]
          },
          "options": {
            "type": "object",
            "properties": {
              "variableId": {
                "type": "string"
              },
              "credentialsId": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              },
              "labels": {
                "type": "object",
                "properties": {
                  "button": {
                    "type": "string"
                  },
                  "success": {
                    "type": "string"
                  }
                }
              },
              "additionalInformation": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  }
                }
              },
              "retryMessageContent": {
                "type": "string"
              },
              "pendingMessageContent": {
                "type": "string"
              },
              "loadingMessage": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "id",
          "type"
        ],
        "title": "MercadoPago Payment"
      },
      "error.BAD_REQUEST": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Invalid input data"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "BAD_REQUEST"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            },
            "description": "An array of issues that were responsible for the error",
            "example": []
          }
        },
        "required": [
          "message",
          "code"
        ],
        "title": "Error",
        "description": "The error information",
        "example": {
          "code": "BAD_REQUEST",
          "message": "Invalid input data",
          "issues": []
        }
      },
      "error.UNAUTHORIZED": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Authorization not provided"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "UNAUTHORIZED"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            },
            "description": "An array of issues that were responsible for the error",
            "example": []
          }
        },
        "required": [
          "message",
          "code"
        ],
        "title": "Error",
        "description": "The error information",
        "example": {
          "code": "UNAUTHORIZED",
          "message": "Authorization not provided",
          "issues": []
        }
      },
      "error.FORBIDDEN": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Insufficient access"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "FORBIDDEN"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            },
            "description": "An array of issues that were responsible for the error",
            "example": []
          }
        },
        "required": [
          "message",
          "code"
        ],
        "title": "Error",
        "description": "The error information",
        "example": {
          "code": "FORBIDDEN",
          "message": "Insufficient access",
          "issues": []
        }
      },
      "error.NOT_FOUND": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Not found"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "NOT_FOUND"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            },
            "description": "An array of issues that were responsible for the error",
            "example": []
          }
        },
        "required": [
          "message",
          "code"
        ],
        "title": "Error",
        "description": "The error information",
        "example": {
          "code": "NOT_FOUND",
          "message": "Not found",
          "issues": []
        }
      },
      "error.INTERNAL_SERVER_ERROR": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Internal server error"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "INTERNAL_SERVER_ERROR"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            },
            "description": "An array of issues that were responsible for the error",
            "example": []
          }
        },
        "required": [
          "message",
          "code"
        ],
        "title": "Error",
        "description": "The error information",
        "example": {
          "code": "INTERNAL_SERVER_ERROR",
          "message": "Internal server error",
          "issues": []
        }
      },
      "event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "graphCoordinates": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "start"
            ]
          }
        },
        "required": [
          "id",
          "graphCoordinates",
          "type"
        ],
        "description": "Event"
      },
      "followUpEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "outgoingEdgeId": {
            "type": "string"
          },
          "graphCoordinates": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              }
            },
            "required": [
              "x",
              "y"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "follow-up"
            ]
          },
          "options": {
            "type": "object",
            "properties": {
              "delayValue": {
                "type": "number",
                "minimum": 0
              },
              "delayUnit": {
                "type": "string",
                "enum": [
                  "minutes",
                  "hours",
                  "days"
                ]
              }
            }
          }
        },
        "required": [
          "id",
          "graphCoordinates",
          "type"
        ],
        "description": "Follow-up event: inactivity-triggered flow entry point"
      },
      "theme": {
        "type": "object",
        "properties": {
          "progressBar": {
            "type": "object",
            "properties": {
              "isEnabled": {
                "type": "boolean"
              },
              "color": {
                "type": "string"
              },
              "backgroundColor": {
                "type": "string"
              },
              "placement": {
                "type": "string",
                "enum": [
                  "top",
                  "bottom"
                ]
              },
              "thickness": {
                "type": "number"
              },
              "position": {
                "type": "string",
                "enum": [
                  "fixed",
                  "absolute"
                ]
              }
            }
          },
          "chat": {
            "type": "object",
            "properties": {
              "container": {
                "type": "object",
                "properties": {
                  "maxWidth": {
                    "type": "string"
                  },
                  "maxHeight": {
                    "type": "string"
                  },
                  "font": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "Google"
                                ]
                              },
                              "family": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "Custom"
                                ]
                              },
                              "family": {
                                "type": "string"
                              },
                              "css": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string",
                                "description": "Deprecated, use `css` instead"
                              }
                            },
                            "required": [
                              "type"
                            ]
                          }
                        ]
                      }
                    ]
                  },
                  "backgroundColor": {
                    "type": "string"
                  },
                  "background": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "Color",
                          "Image",
                          "None"
                        ]
                      },
                      "content": {
                        "type": "string"
                      }
                    }
                  },
                  "color": {
                    "type": "string"
                  },
                  "blur": {
                    "type": "number"
                  },
                  "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "shadow": {
                    "type": "string",
                    "enum": [
                      "none",
                      "sm",
                      "md",
                      "lg",
                      "xl",
                      "2xl"
                    ]
                  },
                  "border": {
                    "type": "object",
                    "properties": {
                      "thickness": {
                        "type": "number"
                      },
                      "color": {
                        "type": "string"
                      },
                      "roundness": {
                        "type": "number"
                      },
                      "opacity": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      }
                    }
                  }
                }
              },
              "hostAvatar": {
                "type": "object",
                "properties": {
                  "isEnabled": {
                    "type": "boolean"
                  },
                  "url": {
                    "type": "string"
                  }
                }
              },
              "guestAvatar": {
                "type": "object",
                "properties": {
                  "isEnabled": {
                    "type": "boolean"
                  },
                  "url": {
                    "type": "string"
                  }
                }
              },
              "hostBubbles": {
                "type": "object",
                "properties": {
                  "backgroundColor": {
                    "type": "string"
                  },
                  "background": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "Color",
                          "Image",
                          "None"
                        ]
                      },
                      "content": {
                        "type": "string"
                      }
                    }
                  },
                  "color": {
                    "type": "string"
                  },
                  "blur": {
                    "type": "number"
                  },
                  "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "shadow": {
                    "type": "string",
                    "enum": [
                      "none",
                      "sm",
                      "md",
                      "lg",
                      "xl",
                      "2xl"
                    ]
                  },
                  "border": {
                    "type": "object",
                    "properties": {
                      "thickness": {
                        "type": "number"
                      },
                      "color": {
                        "type": "string"
                      },
                      "roundness": {
                        "type": "number"
                      },
                      "opacity": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      }
                    }
                  }
                }
              },
              "guestBubbles": {
                "type": "object",
                "properties": {
                  "backgroundColor": {
                    "type": "string"
                  },
                  "background": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "Color",
                          "Image",
                          "None"
                        ]
                      },
                      "content": {
                        "type": "string"
                      }
                    }
                  },
                  "color": {
                    "type": "string"
                  },
                  "blur": {
                    "type": "number"
                  },
                  "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "shadow": {
                    "type": "string",
                    "enum": [
                      "none",
                      "sm",
                      "md",
                      "lg",
                      "xl",
                      "2xl"
                    ]
                  },
                  "border": {
                    "type": "object",
                    "properties": {
                      "thickness": {
                        "type": "number"
                      },
                      "color": {
                        "type": "string"
                      },
                      "roundness": {
                        "type": "number"
                      },
                      "opacity": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      }
                    }
                  }
                }
              },
              "buttons": {
                "type": "object",
                "properties": {
                  "backgroundColor": {
                    "type": "string"
                  },
                  "background": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "Color",
                          "Image",
                          "None"
                        ]
                      },
                      "content": {
                        "type": "string"
                      }
                    }
                  },
                  "color": {
                    "type": "string"
                  },
                  "blur": {
                    "type": "number"
                  },
                  "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "shadow": {
                    "type": "string",
                    "enum": [
                      "none",
                      "sm",
                      "md",
                      "lg",
                      "xl",
                      "2xl"
                    ]
                  },
                  "border": {
                    "type": "object",
                    "properties": {
                      "thickness": {
                        "type": "number"
                      },
                      "color": {
                        "type": "string"
                      },
                      "roundness": {
                        "type": "number"
                      },
                      "opacity": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      }
                    }
                  }
                }
              },
              "inputs": {
                "type": "object",
                "properties": {
                  "backgroundColor": {
                    "type": "string"
                  },
                  "background": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "Color",
                          "Image",
                          "None"
                        ]
                      },
                      "content": {
                        "type": "string"
                      }
                    }
                  },
                  "color": {
                    "type": "string"
                  },
                  "blur": {
                    "type": "number"
                  },
                  "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "shadow": {
                    "type": "string",
                    "enum": [
                      "none",
                      "sm",
                      "md",
                      "lg",
                      "xl",
                      "2xl"
                    ]
                  },
                  "border": {
                    "type": "object",
                    "properties": {
                      "thickness": {
                        "type": "number"
                      },
                      "color": {
                        "type": "string"
                      },
                      "roundness": {
                        "type": "number"
                      },
                      "opacity": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      }
                    }
                  },
                  "placeholderColor": {
                    "type": "string"
                  }
                }
              },
              "roundness": {
                "type": "string",
                "enum": [
                  "none",
                  "medium",
                  "large"
                ],
                "description": "Deprecated, use `container.border.roundness` instead"
              }
            }
          },
          "customCss": {
            "type": "string"
          }
        },
        "title": "Theme"
      },
      "settings": {
        "type": "object",
        "properties": {
          "general": {
            "type": "object",
            "properties": {
              "isBrandingEnabled": {
                "type": "boolean"
              },
              "isTypingEmulationEnabled": {
                "type": "boolean"
              },
              "isInputPrefillEnabled": {
                "type": "boolean"
              },
              "isHideQueryParamsEnabled": {
                "type": "boolean"
              },
              "isNewResultOnRefreshEnabled": {
                "type": "boolean"
              },
              "rememberUser": {
                "type": "object",
                "properties": {
                  "isEnabled": {
                    "type": "boolean"
                  },
                  "storage": {
                    "type": "string",
                    "enum": [
                      "session",
                      "local"
                    ]
                  }
                }
              }
            }
          },
          "typingEmulation": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "speed": {
                "type": "number"
              },
              "maxDelay": {
                "type": "number"
              },
              "delayBetweenBubbles": {
                "type": "number",
                "minimum": 0,
                "maximum": 5
              },
              "isDisabledOnFirstMessage": {
                "type": "boolean"
              }
            }
          },
          "metadata": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "imageUrl": {
                "type": "string"
              },
              "favIconUrl": {
                "type": "string"
              },
              "customHeadCode": {
                "type": "string"
              },
              "googleTagManagerId": {
                "type": "string"
              }
            }
          },
          "whatsApp": {
            "type": "object",
            "properties": {
              "isEnabled": {
                "type": "boolean"
              },
              "flowIds": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          },
          "publicShare": {
            "type": "object",
            "properties": {
              "isEnabled": {
                "type": "boolean"
              }
            }
          },
          "security": {
            "type": "object",
            "properties": {
              "allowedOrigins": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        },
        "title": "Settings"
      },
      "bot": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "enum": [
              "6"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/event"
                },
                {
                  "$ref": "#/components/schemas/followUpEvent"
                }
              ],
              "discriminator": {
                "propertyName": "type",
                "mapping": {
                  "start": "#/components/schemas/event",
                  "follow-up": "#/components/schemas/followUpEvent"
                }
              }
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/group"
            }
          },
          "edges": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "from": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "blockId": {
                          "type": "string"
                        },
                        "itemId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "blockId"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "eventId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "eventId"
                      ]
                    }
                  ]
                },
                "to": {
                  "type": "object",
                  "properties": {
                    "groupId": {
                      "type": "string"
                    },
                    "blockId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "groupId"
                  ]
                }
              },
              "required": [
                "id",
                "from",
                "to"
              ]
            }
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "isSystemVariable": {
                  "type": "boolean"
                },
                "isSavedVariable": {
                  "type": "boolean"
                },
                "isSecretVariable": {
                  "type": "boolean"
                },
                "value": {
                  "nullable": true,
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "nullable": true
                      }
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            }
          },
          "theme": {
            "$ref": "#/components/schemas/theme"
          },
          "selectedThemeTemplateId": {
            "type": "string",
            "nullable": true
          },
          "settings": {
            "$ref": "#/components/schemas/settings"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "folderId": {
            "type": "string",
            "nullable": true
          },
          "publicId": {
            "type": "string",
            "nullable": true
          },
          "customDomain": {
            "type": "string",
            "nullable": true
          },
          "workspaceId": {
            "type": "string"
          },
          "isArchived": {
            "type": "boolean"
          },
          "isClosed": {
            "type": "boolean"
          },
          "riskLevel": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "version",
          "id",
          "name",
          "events",
          "groups",
          "edges",
          "variables",
          "theme",
          "selectedThemeTemplateId",
          "settings",
          "createdAt",
          "updatedAt",
          "icon",
          "folderId",
          "publicId",
          "customDomain",
          "workspaceId",
          "isArchived",
          "isClosed",
          "riskLevel"
        ],
        "title": "Bot"
      },
      "publicBot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "version": {
            "type": "string",
            "enum": [
              "6"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "botId": {
            "type": "string"
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/group"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/event"
                },
                {
                  "$ref": "#/components/schemas/followUpEvent"
                }
              ],
              "discriminator": {
                "propertyName": "type",
                "mapping": {
                  "start": "#/components/schemas/event",
                  "follow-up": "#/components/schemas/followUpEvent"
                }
              }
            }
          },
          "edges": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "from": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "blockId": {
                          "type": "string"
                        },
                        "itemId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "blockId"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "eventId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "eventId"
                      ]
                    }
                  ]
                },
                "to": {
                  "type": "object",
                  "properties": {
                    "groupId": {
                      "type": "string"
                    },
                    "blockId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "groupId"
                  ]
                }
              },
              "required": [
                "id",
                "from",
                "to"
              ]
            }
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "isSystemVariable": {
                  "type": "boolean"
                },
                "isSavedVariable": {
                  "type": "boolean"
                },
                "isSecretVariable": {
                  "type": "boolean"
                },
                "value": {
                  "nullable": true,
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "nullable": true
                      }
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            }
          },
          "theme": {
            "$ref": "#/components/schemas/theme"
          },
          "settings": {
            "$ref": "#/components/schemas/settings"
          }
        },
        "required": [
          "id",
          "version",
          "createdAt",
          "updatedAt",
          "botId",
          "groups",
          "events",
          "edges",
          "variables",
          "theme",
          "settings"
        ],
        "title": "Public Bot"
      }
    }
  }
}