Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

77.9 KB
Raw Blame
{
  "swagger": "2.0",
  "info": {
    "description": "Smyth API Machine Endpoints",
    "version": "1.0.0",
    "title": "Smyth API M2M",
    "basePath": "/_sysapi/v1",
    "license": {
      "name": "MIT License",
      "url": "https://opensource.org/licenses/MIT"
    }
  },
  "basePath": "/_sysapi/v1",
  "schemes": ["https", "http"],
  "produces": ["application/json"],
  "consumes": ["application/json"],
  "securityDefinitions": {
    "Bearer": {
      "description": "For accessing the protected API resources, you must have received a valid token after registering or logging in. This JWT token must then be used for all protected resources by passing it in via the 'Authorization' header.\n\nA JWT token is generated by the API by either registering via /users or logging in via /users/login. The following format must be in the 'Authorization' header :\n\n Token: xxxxxx.yyyyyyy.zzzzzz\n",
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  },

  "paths": {
    "/ai-agent/{agentId}": {
      "get": {
        "tags": ["Agents"],
        "summary": "Get agent",
        "description": "Get agent",
        "operationId": "getAgent",
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "Agent id",
            "required": true,
            "type": "string"
          },
          {
            "name": "include",
            "in": "query",
            "description": "extended data",
            "required": false,
            "type": "array"
          }
        ],
        "produces": ["application/json"],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/ai-agent": {
      "get": {
        "tags": ["Agents"],
        "summary": "Get agent by domain name",
        "description": "Get agent by Domain name",
        "operationId": "getAgentByDomain",
        "parameters": [
          {
            "name": "domainName",
            "in": "query",
            "description": "domain name linked to agent",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "produces": ["application/json"],

        "security": [
          {
            "Bearer": []
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/Agent"
            }
          }
        }
      }
    },

    "/ai-agent/teams/{teamId}": {
      "get": {
        "tags": ["Agents"],
        "summary": "Get team agents",
        "description": "Get all agents that belong to a specific team. Returns only agents directly owned by the team (no subteam agents).",
        "operationId": "getTeamAgents",
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "Team ID",
            "required": true,
            "type": "string"
          },
          {
            "name": "deployedOnly",
            "in": "query",
            "description": "If true, returns only agents that have at least one deployment",
            "required": false,
            "type": "boolean",
            "default": false
          },
          {
            "name": "includeData",
            "in": "query",
            "description": "If true, returns agent data",
            "required": false,
            "type": "boolean",
            "default": false
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number for pagination",
            "required": false,
            "type": "integer",
            "minimum": 1
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of items per page",
            "required": false,
            "type": "integer",
            "minimum": 1
          }
        ],
        "produces": ["application/json"],
        "responses": {
          "200": {
            "description": "List of agents belonging to the team",
            "schema": {
              "type": "object",
              "properties": {
                "agents": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "deployed": {
                        "type": "boolean",
                        "description": "Indicates if the agent has any deployments"
                      },
                      "domain": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "verified": {
                            "type": "boolean"
                          },
                          "lastStatus": {
                            "type": "string"
                          }
                        }
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                },
                "total": {
                  "type": "integer",
                  "description": "Total number of agents matching the query"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "schema": {
              "$ref": "#/definitions/GenericErrorModel"
            }
          },
          "404": {
            "description": "Team not found",
            "schema": {
              "$ref": "#/definitions/GenericErrorModel"
            }
          }
        }
      }
    },

    "/ai-agent/{agentId}/settings": {
      "get": {
        "tags": ["Agent Settings"],
        "summary": "Get settings",
        "description": "Get settings",
        "operationId": "getAgentSettings",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "Agent id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/ai-agent/{agentId}/deployments": {
      "get": {
        "tags": ["Agent Deployments"],
        "summary": "Get agent deployments",
        "description": "Get agent deployments",
        "operationId": "getAgentDeployments",
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "Agent id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": ["application/json"],

        "responses": {
          "200": {
            "description": "agent deployments",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },
    "/ai-agent/{agentId}/deployments/{majorVersion}/{minorVersion}": {
      "get": {
        "tags": ["Agent Deployments"],
        "summary": "Get agent deployments by version",
        "description": "Get agent deployments by version",
        "operationId": "getAgentDeploymentsByVersion",
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "Agent id",
            "required": true,
            "type": "string"
          },
          {
            "name": "majorVersion",
            "in": "path",
            "description": "Major version",
            "required": true,
            "type": "string"
          },
          {
            "name": "minorVersion",
            "in": "path",
            "description": "Minor version",
            "required": true,
            "type": "string"
          }
        ],
        "produces": ["application/json"],

        "responses": {
          "200": {
            "description": "agent deployments",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/ai-agent/deployments/{deploymentId}": {
      "get": {
        "tags": ["Agent Deployments"],
        "summary": "Get agent deployment",
        "description": "Get agent deployment",
        "operationId": "getAgentDeployment",
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "deploymentId",
            "in": "path",
            "description": "Deployment id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": ["application/json"],

        "responses": {
          "200": {
            "description": "agent deployment",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/ai-agent/{agentId}/states": {
      "get": {
        "tags": ["Agent States"],
        "summary": "Get agent states",
        "description": "get agent states",
        "operationId": "getAgentStates",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "Agent id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "put": {
        "tags": ["Agent States"],
        "summary": "Create/Update agent state",
        "description": "create agent state",
        "operationId": "createAgentState",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "Agent id",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Object containing agent state data",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/ai-agent/{agentId}/states/{key}": {
      "get": {
        "tags": ["Agent States"],
        "summary": "Get agent state",
        "description": "get agent state by key name",
        "operationId": "getAgentState",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "Agent id",
            "required": true,
            "type": "string"
          },
          {
            "name": "key",
            "in": "path",
            "description": "Key name",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "delete": {
        "tags": ["Agent States"],
        "summary": "Delete agent state",
        "description": "Delete agent state by key name",
        "operationId": "deleteAgentState",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "Agent id",
            "required": true,
            "type": "string"
          },
          {
            "name": "key",
            "in": "path",
            "description": "Key name",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/ai-agent/{agentId}/logs/calls": {
      "post": {
        "tags": ["Agent Logs"],
        "summary": "Create agent call log",
        "description": "Create agent call log",
        "operationId": "createAgentCallLog",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        },

        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "description": "Agent id",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Object containing settings data",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "sourceId": {
                  "type": "string"
                },
                "componentId": {
                  "type": "string"
                },
                "input": {
                  "type": "object"
                },
                "output": {
                  "type": "object"
                },
                "inputTimestamp": {
                  "type": "string"
                },
                "outputTimestamp": {
                  "type": "string"
                },
                "domain": {
                  "type": "string"
                },
                "result": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "inputTokens": {
                  "type": "number"
                },
                "outputTokens": {
                  "type": "number"
                },
                "sourceName": {
                  "type": "string"
                },
                "componentName": {
                  "type": "string"
                },
                "sessionID": {
                  "type": "string"
                },
                "workflowID": {
                  "type": "string"
                },
                "processID": {
                  "type": "string"
                },
                "tags": {
                  "type": "string"
                }
              }
            }
          }
        ]
      }
    },

    "/ai-agent/logs/calls/{callId}": {
      "put": {
        "tags": ["Agent Logs"],
        "summary": "Update agent call log",
        "description": "Update agent call log",
        "operationId": "updateAgentCallLog",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        },

        "parameters": [
          {
            "name": "callId",
            "in": "path",
            "description": "Call id",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Object containing settings data",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "sourceId": {
                  "type": "string"
                },
                "componentId": {
                  "type": "string"
                },
                "domain": {
                  "type": "string"
                },
                "input": {
                  "type": "object"
                },
                "output": {
                  "type": "object"
                },
                "inputTimestamp": {
                  "type": "string"
                },
                "outputTimestamp": {
                  "type": "string"
                },
                "result": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "inputTokens": {
                  "type": "number"
                },
                "outputTokens": {
                  "type": "number"
                },
                "sourceName": {
                  "type": "string"
                },
                "componentName": {
                  "type": "string"
                },
                "sessionID": {
                  "type": "string"
                },
                "workflowID": {
                  "type": "string"
                },
                "processID": {
                  "type": "string"
                },
                "tags": {
                  "type": "string"
                }
              }
            }
          }
        ]
      }
    },

    "/chats": {
      "post": {
        "tags": ["Chats"],
        "summary": "Create conversation",
        "description": "Create conversation",
        "operationId": "createConversation",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "Object containing conversation data",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "conversation": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string",
                      "default": ""
                    },
                    "summary": {
                      "type": "string",
                      "default": ""
                    },
                    "teamId": {
                      "type": "string"
                    },
                    "ownerId": {
                      "type": "number",
                      "default": null
                    },
                    "aiAgentId": {
                      "type": "string"
                    },
                    "chunkSize": {
                      "type": "number",
                      "default": null
                    },
                    "lastChunkID": {
                      "type": "string",
                      "default": null
                    }
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },

      "get": {
        "tags": ["Chats"],
        "summary": "Get all conversations",
        "description": "Get all conversations",
        "operationId": "getConversations",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "description": "Agent ID",
            "required": false,
            "type": "string"
          },
          {
            "name": "ownerId",
            "in": "query",
            "description": "Owner ID",
            "required": false,
            "type": "number"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "schema": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "conversationId": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "summary": {
                    "type": "string"
                  },
                  "teamId": {
                    "type": "string"
                  },
                  "ownerId": {
                    "type": "number"
                  },
                  "aiAgentId": {
                    "type": "string"
                  },
                  "chunkSize": {
                    "type": "number"
                  },
                  "lastChunkID": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },

    "/chats/{conversationId}": {
      "get": {
        "tags": ["Chats"],
        "summary": "Get conversation by ID",
        "description": "Get conversation by ID",
        "operationId": "getConversationById",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "description": "Conversation ID",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "conversationId": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "teamId": {
                  "type": "string"
                },
                "ownerId": {
                  "type": "number"
                },
                "aiAgentId": {
                  "type": "string"
                },
                "chunkSize": {
                  "type": "number"
                },
                "lastChunkID": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Chats"],
        "summary": "Update conversation",
        "description": "Update conversation",
        "operationId": "updateConversation",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "description": "Conversation ID",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Object containing conversation data",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "conversation": {
                  "type": "object",
                  "properties": {
                    "aiAgentId": {
                      "type": "string",
                      "default": null
                    },
                    "ownerId": {
                      "type": "number",
                      "default": null
                    },
                    "chunkSize": {
                      "type": "number",
                      "default": null
                    },
                    "lastChunkID": {
                      "type": "string",
                      "default": null
                    },
                    "label": {
                      "type": "string",
                      "default": null
                    },
                    "summary": {
                      "type": "string",
                      "default": null
                    }
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "delete": {
        "tags": ["Chats"],
        "summary": "Delete conversation",
        "description": "Delete conversation",
        "operationId": "deleteConversation",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "description": "Conversation ID",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/teams": {
      "get": {
        "tags": ["Teams"],
        "summary": "Get all teams",
        "description": "Get all teams",
        "operationId": "getTeams",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number",
            "required": false,
            "type": "integer"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of results per page",
            "required": false,
            "type": "integer"
          }
        ],

        "responses": {
          "200": {
            "description": "teams",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/teams/{teamId}": {
      "get": {
        "tags": ["Teams"],
        "summary": "Get a team",
        "description": "Get a team",
        "operationId": "getTeamById",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "Team id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "team",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/teams/{teamId}/settings": {
      "get": {
        "tags": ["Team Settings"],
        "summary": "Get team settings",
        "description": "Get team settings",
        "operationId": "getTeamSettings",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "Team id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "Team settings",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "put": {
        "tags": ["Team Settings"],
        "summary": "Create/Update team settings",
        "description": "Update team settings",
        "operationId": "updateTeamSettings",
        "produces": ["application/json"],

        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "Team id",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Object containing settings data",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SettingsRequest"
            }
          }
        ],
        "security": [
          {
            "Bearer": []
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/teams/{teamId}/settings/{settingKey}": {
      "get": {
        "tags": ["Team Settings"],
        "summary": "Get team setting",
        "description": "Get team setting",
        "operationId": "getTeamSetting",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "Team id",
            "required": true,
            "type": "string"
          },
          {
            "name": "settingKey",
            "in": "path",
            "description": "Setting key",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "Team setting",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "delete": {
        "tags": ["Team Settings"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "summary": "Delete team setting",
        "description": "Delete team setting",
        "operationId": "deleteTeamSetting",
        "produces": ["application/json"],

        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "Team id",
            "required": true,
            "type": "string"
          },
          {
            "name": "settingKey",
            "in": "path",
            "description": "Setting key",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/vectors/namespaces/search": {
      "get": {
        "tags": ["Vectors"],
        "summary": "Query Namespace",
        "description": "Run similarity search on a namespace.",
        "operationId": "runSimilaritySearch",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "description": "Query",
            "required": true,
            "type": "string"
          },
          {
            "name": "raw",
            "in": "query",
            "description": "Include metadata",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "topK",
            "in": "query",
            "description": "Number of results",
            "required": true,
            "type": "integer"
          },
          {
            "name": "namespaceId",
            "in": "query",
            "description": "Namespace Id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/vectors/namespaces": {
      "get": {
        "tags": ["Vectors"],
        "summary": "Get all namespaces",
        "description": "Get all namespaces",
        "operationId": "getNamespaces",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "teamId",
            "in": "query",
            "description": "Team id",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Namespaces",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },

      "post": {
        "tags": ["Vectors"],
        "summary": "Create namespace",
        "description": "Create namespace",
        "operationId": "createNamespace",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "Namespace data",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "teamId": {
                  "type": "string"
                },
                "useCustomVectorStorage": {
                  "type": "boolean"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Namespace created",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/vectors/namespaces/{namespaceId}": {
      "get": {
        "tags": ["Vectors"],
        "summary": "Get Namespace",
        "description": "Get Namespace",
        "operationId": "getNamespace",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "namespaceId",
            "in": "path",
            "description": "Namespace Id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "Namespace ownership",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },

      "delete": {
        "tags": ["Vectors"],
        "summary": "Delete namespace",
        "description": "Delete namespace",
        "operationId": "deleteNamespace",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "namespaceId",
            "in": "path",
            "description": "Namespace Id",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Namespace deleted",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/vectors/datasources": {
      "get": {
        "tags": ["Vectors"],
        "summary": "Get all datasources",
        "description": "Get all datasources",
        "operationId": "getDatasources",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "namespaceId",
            "in": "query",
            "description": "Namespace Id",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Datasources",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },

      "post": {
        "tags": ["Vectors"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "summary": "Add datasource",
        "description": "Add vector datasource",
        "operationId": "addDatasource",
        "produces": ["application/json"],
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "Datasource data. for 'type' field, please refer to 'DatasourceType' model at the bottom of the page",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "teamId": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": ["SITEMAP", "PDF", "WORD", "WEBPAGE"]
                },
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "namespaceId": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "400": {
            "description": "Invalid request data",
            "schema": {
              "$ref": "#/definitions/GenericErrorModel"
            }
          }
        }
      }
    },
    "/vectors/datasources/text": {
      "post": {
        "tags": ["Vectors"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "summary": "Add datasource text",
        "description": "Add vector datasource text",
        "operationId": "addDatasourceText",
        "produces": ["application/json"],
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "Datasource data. for 'type' field, please refer to 'DatasourceType' model at the bottom of the page",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "namespaceId": {
                  "type": "string"
                },
                "teamId": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "400": {
            "description": "Invalid request data",
            "schema": {
              "$ref": "#/definitions/GenericErrorModel"
            }
          }
        }
      }
    },

    "/vectors/datasources/{datasourceId}": {
      "get": {
        "tags": ["Vectors"],
        "summary": "Get datasource",
        "description": "Get datasource",
        "operationId": "getDatasource",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "datasourceId",
            "in": "path",
            "description": "Datasource id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "Datasource data",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "400": {
            "description": "Invalid request data",
            "schema": {
              "$ref": "#/definitions/GenericErrorModel"
            }
          }
        }
      },
      "delete": {
        "tags": ["Vectors"],
        "summary": "Delete datasource",
        "description": "Delete datasource",
        "operationId": "deleteDatasource",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "datasourceId",
            "in": "path",
            "description": "Datasource id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "Datasource data",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "400": {
            "description": "Invalid request data",
            "schema": {
              "$ref": "#/definitions/GenericErrorModel"
            }
          }
        }
      }
    },

    "/domains": {
      "get": {
        "tags": ["Domains"],
        "summary": "Get all domains",
        "description": "Get all domains [M2M allowed]",
        "operationId": "getDomains",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "verified",
            "in": "query",
            "description": "Domain Status",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "name",
            "in": "query",
            "description": "Domain name",
            "required": false,
            "type": "string"
          },
          {
            "name": "aiAgentId",
            "in": "query",
            "description": "Attached agent id",
            "required": false,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "400": {
            "description": "Invalid request",
            "schema": {
              "$ref": "#/definitions/GenericErrorModel"
            }
          }
        }
      }
    },

    "/domain/query": {
      "post": {
        "tags": ["Domains"],
        "summary": "Query Domain by name",
        "description": "Query Domain by name [M2M allowed]",
        "operationId": "queryDomain",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "Object containing domain data",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Domain"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "400": {
            "description": "Invalid domain data",
            "schema": {
              "$ref": "#/definitions/GenericErrorModel"
            }
          },
          "404": {
            "description": "Domain not found",
            "schema": {
              "$ref": "#/definitions/GenericErrorModel"
            }
          }
        }
      }
    },

    "/embodiments": {
      "get": {
        "tags": ["Embodiments"],
        "summary": "Get all embodiments by agent id",
        "description": "Get all embodiments by agent id",
        "operationId": "getEmbodiments",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "aiAgentId",
            "in": "query",
            "description": "Agent Id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "embodiments": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },

    "/subscriptions/teams": {
      "post": {
        "tags": ["Subscriptions"],
        "summary": "Create a subscription for a team.",
        "description": "Create a subscription for a team. If the team already has a subs, it will delete the current and replace it with the new one",
        "operationId": "createTeamSubs",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "Object containing job data",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "teamId": {
                  "type": "string"
                },

                "stripeSubsId": {
                  "type": "string"
                },

                "planName": {
                  "type": "string"
                },

                "planPrice": {
                  "type": "number"
                },

                "stripeProductId": {
                  "type": "string"
                },

                "stripePriceId": {
                  "type": "string"
                },

                "planLimits": {
                  "type": "object",
                  "schema": {
                    "properties": {
                      "prodAiAgents": {
                        "type": "number"
                      },
                      "devAiAgents": {
                        "type": "number"
                      },
                      "teamMembers": {
                        "type": "number"
                      }
                    }
                  }
                },

                "featureFlags": {
                  "type": "object",
                  "schema": {
                    "properties": {
                      "embodimentsEnabled": {
                        "type": "boolean"
                      },
                      "agentAuthSidebarEnabled": {
                        "type": "boolean"
                      },
                      "domainRegistrationEnabled": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            },

            "examples": {
              "application/json": {
                "teamId": "clnew8cjb000p234m02kvf8r6q",
                "stripeSubsId": "sub_1",
                "planName": "Free",
                "planPrice": 0,
                "stripeProductId": "prod_1",
                "stripePriceId": "price_1",
                "planLimits": {
                  "prodAiAgents": 50,
                  "devAiAgents": 100,
                  "teamMembers": 5
                },
                "featureFlags": {
                  "embodimentsEnabled": true,
                  "agentAuthSidebarEnabled": true,
                  "domainRegistrationEnabled": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid job data",
            "schema": {
              "$ref": "#/definitions/GenericErrorModel"
            }
          }
        }
      }
    },

    "/subscriptions/teams/{teamId}": {
      "put": {
        "tags": ["Subscriptions"],
        "summary": "Edit team subscription",
        "description": "Edit team subscriptionm",
        "operationId": "editTeamSubs",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "team id",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Object containing job data",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "stripeSubsId": {
                  "type": "string"
                },

                "properties": {
                  "type": "object",
                  "schema": {
                    "properties": {
                      "tasks": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "400": {
            "description": "Invalid job data",
            "schema": {
              "$ref": "#/definitions/GenericErrorModel"
            }
          }
        }
      },

      "get": {
        "tags": ["Subscriptions"],
        "summary": "Get team subscription by team id",
        "description": "Get team subscription",
        "operationId": "getTeamSubs",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "team id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "embodiments": {
                  "type": "object"
                }
              }
            }
          }
        }
      },

      "delete": {
        "tags": ["Subscriptions"],
        "summary": "delete team subscription",
        "description": "delete team subscription",
        "operationId": "deleteTeamSubs",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "team id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/subscriptions/teams/{teamId}/plan/{planId}": {
      "post": {
        "tags": ["Subscriptions"],
        "summary": "Create a team subscription linked to an exising plan",
        "description": "Change team subscription plan to an existing plan",
        "operationId": "changeTeamSubsPlan",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "team id",
            "required": true,
            "type": "string"
          },
          {
            "name": "planId",
            "in": "path",
            "description": "plan id",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Object containing job data",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "stripeSubsId": {
                  "type": "string"
                },
                "properties": {
                  "type": "object",
                  "schema": {
                    "properties": {
                      "tasks": {
                        "type": "number"
                      }
                    }
                  }
                },

                "endAt": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "embodiments": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },

    "/plans": {
      "post": {
        "tags": ["Plans"],
        "summary": "Create a plan",
        "description": "Create a plan",
        "operationId": "createPlan",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "Object containing job data",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "planName": {
                  "type": "string"
                },

                "planPrice": {
                  "type": "number"
                },

                "stripeProductId": {
                  "type": "string"
                },

                "stripePriceId": {
                  "type": "string"
                },

                "planLimits": {
                  "type": "object",
                  "schema": {
                    "properties": {
                      "prodAiAgents": {
                        "type": "number"
                      },
                      "devAiAgents": {
                        "type": "number"
                      },
                      "teamMembers": {
                        "type": "number"
                      }
                    }
                  }
                },

                "featureFlags": {
                  "type": "object",
                  "schema": {
                    "properties": {
                      "embodimentsEnabled": {
                        "type": "boolean"
                      },
                      "agentAuthSidebarEnabled": {
                        "type": "boolean"
                      },
                      "domainRegistrationEnabled": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "embodiments": {
                  "type": "object"
                }
              }
            }
          }
        }
      },

      "get": {
        "tags": ["Plans"],
        "summary": "Get all plans",
        "description": "Get all plans",
        "operationId": "getPlans",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number",
            "required": false,
            "type": "integer"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of results per page",
            "required": false,
            "type": "integer"
          }
        ],

        "responses": {
          "200": {
            "description": "plans",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/plans/{id}": {
      "put": {
        "tags": ["Plans"],
        "summary": "Edit a plan",
        "description": "Edit a plan",
        "operationId": "editPlan",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "plan id",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Object containing job data",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "planName": {
                  "type": "string"
                },

                "planPrice": {
                  "type": "number"
                },

                "stripeProductId": {
                  "type": "string"
                },

                "stripePriceId": {
                  "type": "string"
                },

                "planLimits": {
                  "type": "object",
                  "schema": {
                    "properties": {
                      "prodAiAgents": {
                        "type": "number"
                      },
                      "devAiAgents": {
                        "type": "number"
                      },
                      "teamMembers": {
                        "type": "number"
                      }
                    }
                  }
                },

                "featureFlags": {
                  "type": "object",
                  "schema": {
                    "properties": {
                      "embodimentsEnabled": {
                        "type": "boolean"
                      },
                      "agentAuthSidebarEnabled": {
                        "type": "boolean"
                      },
                      "domainRegistrationEnabled": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "embodiments": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },

    "/app-config/settings": {
      "get": {
        "tags": ["App Config"],
        "summary": "Get all settings",
        "description": "Get all settings",
        "operationId": "getSettings",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "responses": {
          "200": {
            "description": "settings",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },

      "put": {
        "tags": ["App Config"],
        "summary": "Create a setting",
        "description": "Create a setting",
        "operationId": "createSetting",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "Object containing setting data",
            "required": true,
            "schema": {
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "setting",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },
    "/app-config/settings/{key}": {
      "get": {
        "tags": ["App Config"],
        "summary": "Get a setting",
        "description": "Get a setting",
        "operationId": "getSetting",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "key",
            "in": "path",
            "description": "Setting key",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "setting",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "delete": {
        "tags": ["App Config"],
        "summary": "Delete a setting",
        "description": "Delete a setting",
        "operationId": "deleteSetting",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "key",
            "in": "path",
            "description": "Setting key",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "setting",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/app-config/components": {
      "get": {
        "tags": ["App Config"],
        "summary": "Get all components",
        "description": "Get all components",
        "operationId": "getComponents",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "responses": {
          "200": {
            "description": "components",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "post": {
        "tags": ["App Config"],
        "summary": "Create a component",
        "description": "Create a component",
        "operationId": "createComponent",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "Object containing component data",
            "required": true,
            "schema": {
              "properties": {
                "name": {
                  "type": "string"
                },
                "data": {
                  "type": "string"
                },
                "collectionId": {
                  "type": "string"
                },

                "order": {
                  "type": "number"
                },
                "visible": {
                  "type": "boolean"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "component",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/app-config/components/{componentId}": {
      "get": {
        "tags": ["App Config"],
        "summary": "Get a component",
        "description": "Get a component",
        "operationId": "getComponent",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "componentId",
            "in": "path",
            "description": "Component id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "component",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "put": {
        "tags": ["App Config"],
        "summary": "Update a component",
        "description": "Update a component",
        "operationId": "updateComponent",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "componentId",
            "in": "path",
            "description": "Component id",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Object containing component data",
            "required": true,
            "schema": {
              "properties": {
                "name": {
                  "type": "string"
                },
                "data": {
                  "type": "string"
                },
                "collectionId": {
                  "type": "string"
                },
                "order": {
                  "type": "number"
                },
                "visible": {
                  "type": "boolean"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "component",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "delete": {
        "tags": ["App Config"],
        "summary": "Delete a component",
        "description": "Delete a component",
        "operationId": "deleteComponent",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "componentId",
            "in": "path",
            "description": "Component id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "component",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/app-config/collections": {
      "get": {
        "tags": ["App Config"],
        "summary": "Get all collections",
        "description": "Get all collections",
        "operationId": "getCollections",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "responses": {
          "200": {
            "description": "collections",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "post": {
        "tags": ["App Config"],
        "summary": "Create a collection",
        "description": "Create a collection",
        "operationId": "createCollection",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "body",
            "in": "body",
            "description": "Object containing collection data",
            "required": true,
            "schema": {
              "properties": {
                "name": {
                  "type": "string"
                },
                "icon": {
                  "type": "string"
                },
                "order": {
                  "type": "number"
                },
                "visible": {
                  "type": "boolean"
                },
                "color": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "collection",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/app-config/collections/{collectionId}": {
      "get": {
        "tags": ["App Config"],
        "summary": "Get a collection",
        "description": "Get a collection",
        "operationId": "getCollection",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "description": "Collection id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "collection",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "put": {
        "tags": ["App Config"],
        "summary": "Update a collection",
        "description": "Update a collection",
        "operationId": "updateCollection",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "description": "Collection id",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Object containing collection data",
            "required": true,
            "schema": {
              "properties": {
                "name": {
                  "type": "string"
                },
                "icon": {
                  "type": "string"
                },
                "order": {
                  "type": "number"
                },
                "visible": {
                  "type": "boolean"
                },
                "color": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "collection",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },
      "delete": {
        "tags": ["App Config"],
        "summary": "Delete a collection",
        "description": "Delete a collection",
        "operationId": "deleteCollection",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "description": "Collection id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "collection",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/app-config/collections/{collectionId}/components": {
      "get": {
        "tags": ["App Config"],
        "summary": "Get all components in a collection",
        "description": "Get all components in a collection",
        "operationId": "getCollectionComponents",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "description": "Collection id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "components",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },

    "/user/{userId}/settings": {
      "get": {
        "tags": ["User"],
        "summary": "Get settings",
        "description": "Get settings",
        "operationId": "getSettings",
        "produces": ["application/json"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "description": "User id",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },

      "put": {
        "tags": ["User"],
        "summary": "Create/Update settings",
        "description": "Update settings",
        "operationId": "updateSettings",
        "produces": ["application/json"],
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "description": "User id",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "description": "Object containing settings data",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SettingsRequest"
            }
          }
        ],
        "security": [
          {
            "Bearer": []
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    },
    "/user/{userId}/settings/{settingKey}": {
      "delete": {
        "tags": ["User"],
        "security": [
          {
            "Bearer": []
          }
        ],

        "summary": "Delete setting",
        "description": "Delete setting",
        "operationId": "deleteSetting",
        "produces": ["application/json"],

        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "description": "User id",
            "required": true,
            "type": "string"
          },
          {
            "name": "settingKey",
            "in": "path",
            "description": "Setting key",
            "required": true,
            "type": "string"
          }
        ],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      },

      "get": {
        "tags": ["User"],
        "summary": "Get setting",
        "description": "Get setting",
        "operationId": "getSetting",
        "security": [
          {
            "Bearer": []
          }
        ],

        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "description": "User id",
            "required": true,
            "type": "string"
          },
          {
            "name": "settingKey",
            "in": "path",
            "description": "Setting key",
            "required": true,
            "type": "string"
          }
        ],
        "produces": ["application/json"],

        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          }
        }
      }
    }
  },

  "definitions": {
    "GenericErrorModel": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer"
        },
        "message": {
          "type": "string"
        }
      },
      "required": ["errors"]
    },
    "Domain": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      }
    },
    "Endpoint": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        },
        "method": {
          "type": "string"
        },
        "domainName": {
          "type": "string"
        }
      }
    },
    "SettingsRequest": {
      "type": "object",
      "properties": {
        "settingKey": {
          "type": "string"
        },
        "settingValue": {
          "type": "string"
        }
      }
    },
    "AgentSettingsRequest": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "DomainEndpointData": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        },
        "data": {
          "type": "object",
          "properties": {
            "method": {
              "type": "string",
              "enum": ["GET", "POST", "PUT", "DELETE"]
            },
            "componentId": {
              "type": "string"
            }
          }
        },
        "agentId": {
          "type": "string"
        },
        "domainName": {
          "type": "string"
        }
      }
    },
    "ResponseMessage": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    },

    "DatasourceType": {
      "type": "string",
      "enum": ["PDF", "WORD", "SITEMAP", "WEBPAGE"]
    },

    "Agent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      }
    },

    "AgentRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "data": {
          "type": "object"
        }
      }
    }
  }
}