{
    "swagger": "2.0",
    "basePath": "/",
    "paths": {
        "/api/add_chunk": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Adds a new chunk to the document",
                "operationId": "post_add_chunk",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/AddChunkModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/agent_webhook": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Generate webhook URL for the agent",
                "operationId": "get_agent_webhook",
                "parameters": [
                    {
                        "description": "ID of the agent",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/answer": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Provide a response based on the question and retriever",
                "operationId": "post_answer_resource",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/AnswerModel"
                        }
                    }
                ],
                "tags": [
                    "answer"
                ]
            }
        },
        "/api/assistant/stream": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Chat with the platform assistant, which can read the user's registrations",
                "operationId": "post_assistant_stream",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/AssistantStreamModel"
                        }
                    }
                ],
                "tags": [
                    "assistant"
                ]
            }
        },
        "/api/assistant/widget/stream": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Stream endpoint for the DocsGPT widget; identity comes from passthrough.assistant_token",
                "operationId": "post_assistant_widget_stream",
                "tags": [
                    "assistant"
                ]
            }
        },
        "/api/assistant/widget_token": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Short-lived token that lets the DocsGPT widget act for the signed-in user",
                "operationId": "get_assistant_widget_token",
                "tags": [
                    "assistant"
                ]
            }
        },
        "/api/available_tools": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get available tools for a user",
                "operationId": "get_available_tools",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/combine": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Redirects /api/combine to /api/sources for backward compatibility",
                "operationId": "get_redirect_to_sources",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/complete_registration": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Completes a registration draft, making it final and irreversible",
                "operationId": "post_complete_registration",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/CompleteRegistrationModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/connectors/auth": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get connector OAuth authorization URL",
                "operationId": "get_connector_auth",
                "parameters": [
                    {
                        "description": "Connector provider (e.g., google_drive)",
                        "name": "provider",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/connectors/callback": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "summary": "Handle OAuth callback for external connectors",
                "description": "Handle OAuth callback for external connectors",
                "operationId": "get_connectors_callback",
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/connectors/callback-status": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "summary": "Return HTML page with connector authentication status",
                "description": "Return HTML page with connector authentication status",
                "operationId": "get_connector_callback_status",
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/connectors/delete": {
            "delete": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Delete a connector source",
                "operationId": "delete_delete_connector_source",
                "parameters": [
                    {
                        "description": "The source ID to delete",
                        "name": "source_id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/connectors/disconnect": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Disconnect a connector session",
                "operationId": "post_connector_disconnect",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/ConnectorDisconnectModel"
                        }
                    }
                ],
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/connectors/files": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "List files from a connector provider (supports pagination)",
                "operationId": "post_connector_files",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/ConnectorFilesModel"
                        }
                    }
                ],
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/connectors/refresh": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Refresh connector access token",
                "operationId": "post_connector_refresh",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/ConnectorRefreshModel"
                        }
                    }
                ],
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/connectors/sources": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get connector sources",
                "operationId": "get_connector_sources",
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/connectors/sync": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Sync connector source to check for modifications",
                "operationId": "post_connector_sync",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/ConnectorSyncModel"
                        }
                    }
                ],
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/connectors/task_status": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get connector task status",
                "operationId": "get_connector_task_status",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/ConnectorTaskStatusModel"
                        }
                    }
                ],
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/connectors/upload": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Uploads connector source for vectorization",
                "operationId": "post_upload_connector",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/ConnectorUploadModel"
                        }
                    }
                ],
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/connectors/validate-session": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Validate connector session token and return user info",
                "operationId": "post_connector_validate_session",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/ConnectorValidateSessionModel"
                        }
                    }
                ],
                "tags": [
                    "connectors"
                ]
            }
        },
        "/api/create_agent": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Create a new agent",
                "operationId": "post_create_agent",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/CreateAgentModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/create_draft": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Creates a new registration draft",
                "operationId": "post_create_draft",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/DraftModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/create_prompt": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Create a new prompt",
                "operationId": "post_create_prompt",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/CreatePromptModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/create_tool": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Create a new tool",
                "operationId": "post_create_tool",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/CreateToolModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/delete_agent": {
            "delete": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Delete an agent by ID",
                "operationId": "delete_delete_agent",
                "parameters": [
                    {
                        "description": "ID of the agent",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/delete_all_conversations": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Deletes all conversations for a specific user",
                "operationId": "get_delete_all_conversations",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/delete_by_ids": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Deletes documents from the vector store by IDs",
                "operationId": "get_delete_by_ids",
                "parameters": [
                    {
                        "description": "Comma-separated list of IDs",
                        "name": "path",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/delete_chunk": {
            "delete": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Deletes a specific chunk from the document.",
                "operationId": "delete_delete_chunk",
                "parameters": [
                    {
                        "description": "The document ID",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    },
                    {
                        "description": "The ID of the chunk to delete",
                        "name": "chunk_id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/delete_conversation": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Deletes a conversation by ID",
                "operationId": "post_delete_conversation",
                "parameters": [
                    {
                        "description": "The ID of the conversation to delete",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/delete_draft": {
            "delete": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Deletes a registration draft and its associated data",
                "operationId": "delete_delete_draft",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/DeleteDraftModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/delete_old": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Deletes old indexes and associated files",
                "operationId": "get_delete_old_indexes",
                "parameters": [
                    {
                        "description": "The source ID to delete",
                        "name": "source_id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/delete_prompt": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Delete a prompt by ID",
                "operationId": "post_delete_prompt",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/DeletePromptModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/delete_tool": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Delete a tool by ID",
                "operationId": "post_delete_tool",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/DeleteToolModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/directory_structure": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get the directory structure for a document",
                "operationId": "get_directory_structure",
                "parameters": [
                    {
                        "description": "The document ID",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/docs_check": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Check if document exists",
                "operationId": "post_check_docs",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/CheckDocsModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/download_attachment/{attachment_id}": {
            "parameters": [
                {
                    "name": "attachment_id",
                    "in": "path",
                    "required": true,
                    "type": "string"
                }
            ],
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Download an attachment file",
                "operationId": "get_download_attachment",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/download_certificate/{certificate_filename}": {
            "parameters": [
                {
                    "name": "certificate_filename",
                    "in": "path",
                    "required": true,
                    "type": "string"
                }
            ],
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Download a certificate PDF",
                "operationId": "get_download_certificate",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/draft_evaluation": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Generates (or retries) the AI evaluation of a saved draft in the background",
                "operationId": "post_draft_evaluation",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/DraftEvaluationModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/edit-contract": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Edit an existing contract using AI (queues a job, poll /api/eval-job-status)",
                "operationId": "post_edit_contract",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/EditContractModel"
                        }
                    }
                ],
                "tags": [
                    "eval"
                ]
            }
        },
        "/api/eval-job-status": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Status of a gen-evaluation / gen-contract / edit-contract job",
                "operationId": "get_eval_job_status",
                "parameters": [
                    {
                        "description": "Task ID returned when the job was queued",
                        "name": "task_id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "eval"
                ]
            }
        },
        "/api/feedback": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Submit feedback for a conversation",
                "operationId": "post_submit_feedback",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/FeedbackModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/folders": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Create a new folder",
                "operationId": "post_folders_resource",
                "tags": [
                    "user"
                ]
            },
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get user folders, optionally filtered by parent",
                "operationId": "get_folders_resource",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/folders/{folder_id}": {
            "parameters": [
                {
                    "name": "folder_id",
                    "in": "path",
                    "required": true,
                    "type": "string"
                }
            ],
            "put": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Rename a folder",
                "operationId": "put_folder_resource",
                "tags": [
                    "user"
                ]
            },
            "delete": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Delete a folder",
                "operationId": "delete_folder_resource",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/gen-contract": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Generate a contract (queues a job, poll /api/eval-job-status)",
                "operationId": "post_gen_contract",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/GenContractModel"
                        }
                    }
                ],
                "tags": [
                    "eval"
                ]
            }
        },
        "/api/gen-evaluation": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Evaluate IP (queues a job, poll /api/eval-job-status)",
                "operationId": "post_gen_evaluation",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/GenEvaluationModel"
                        }
                    }
                ],
                "tags": [
                    "eval"
                ]
            }
        },
        "/api/get_agent": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get agent by ID",
                "operationId": "get_get_agent",
                "parameters": [
                    {
                        "description": "Agent ID",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_agents": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Retrieve agents for the user",
                "operationId": "get_get_agents",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_attachments": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get user attachments with pagination and search",
                "operationId": "get_get_attachments",
                "parameters": [
                    {
                        "description": "Page number (default: 1)",
                        "name": "page",
                        "type": "string",
                        "in": "query"
                    },
                    {
                        "description": "Items per page (default: 24, max: 100)",
                        "name": "per_page",
                        "type": "string",
                        "in": "query"
                    },
                    {
                        "description": "Search query for filename or type",
                        "name": "search",
                        "type": "string",
                        "in": "query"
                    },
                    {
                        "description": "Sort field (date, name, type)",
                        "name": "sort",
                        "type": "string",
                        "in": "query"
                    },
                    {
                        "description": "Sort order (asc, desc, default: desc)",
                        "name": "order",
                        "type": "string",
                        "in": "query"
                    },
                    {
                        "description": "Filter by folder ID (omit or 'root' for root level)",
                        "name": "folder_id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_chunks": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Retrieves chunks from a document, optionally filtered by file path and search term",
                "operationId": "get_get_chunks",
                "parameters": [
                    {
                        "description": "The document ID",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    },
                    {
                        "description": "Page number for pagination",
                        "name": "page",
                        "type": "string",
                        "in": "query"
                    },
                    {
                        "description": "Number of chunks per page",
                        "name": "per_page",
                        "type": "string",
                        "in": "query"
                    },
                    {
                        "description": "Optional: Filter chunks by relative file path",
                        "name": "path",
                        "type": "string",
                        "in": "query"
                    },
                    {
                        "description": "Optional: Search term to filter chunks by title or content",
                        "name": "search",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_conversations": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Retrieve a list of the latest 30 conversations (excluding API key conversations)",
                "operationId": "get_get_conversations",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_draft": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Gets a draft by ID",
                "operationId": "get_get_draft",
                "parameters": [
                    {
                        "description": "The ID of the draft to retrieve",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_drafts": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Gets all drafts for the current user",
                "operationId": "get_get_drafts",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_feedback_analytics": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get feedback analytics data",
                "operationId": "post_get_feedback_analytics",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/GetFeedbackAnalyticsModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_message_analytics": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get message analytics based on filter option",
                "operationId": "post_get_message_analytics",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/GetMessageAnalyticsModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_prompts": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get all prompts for the user",
                "operationId": "get_get_prompts",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_single_conversation": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Retrieve a single conversation by ID",
                "operationId": "get_get_single_conversation",
                "parameters": [
                    {
                        "description": "The conversation ID",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_single_prompt": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get a single prompt by ID",
                "operationId": "get_get_single_prompt",
                "parameters": [
                    {
                        "description": "ID of the prompt",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_token_analytics": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get token analytics data",
                "operationId": "post_get_token_analytics",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/GetTokenAnalyticsModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_tools": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get tools created by a user",
                "operationId": "get_get_tools",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/get_user_logs": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get user logs with pagination",
                "operationId": "post_get_user_logs",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/GetUserLogsModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/google-drive/disconnect": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "summary": "Disconnect and revoke Google Drive session",
                "operationId": "post_google_drive_disconnect",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/GoogleDriveDisconnectModel"
                        }
                    }
                ],
                "tags": [
                    "google_drive"
                ]
            }
        },
        "/api/google-drive/download-files": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "summary": "Download files from Google Drive and store them as attachments",
                "operationId": "post_google_drive_download",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/GoogleDriveDownloadModel"
                        }
                    }
                ],
                "tags": [
                    "google_drive"
                ]
            }
        },
        "/api/google-drive/list-files": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "summary": "List files from Google Drive for selection",
                "operationId": "post_google_drive_list_files",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/GoogleDriveListModel"
                        }
                    }
                ],
                "tags": [
                    "google_drive"
                ]
            }
        },
        "/api/google-drive/list-folder-files": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "summary": "Get all files from specified folders recursively",
                "operationId": "post_google_drive_list_folder_files",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/GoogleDriveListFolderFilesModel"
                        }
                    }
                ],
                "tags": [
                    "google_drive"
                ]
            }
        },
        "/api/images/{image_path}": {
            "parameters": [
                {
                    "name": "image_path",
                    "in": "path",
                    "required": true,
                    "type": "string"
                }
            ],
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Serve an image from storage",
                "operationId": "get_serve_image",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/manage_source_files": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Add files, remove files, or remove directories from an existing source",
                "operationId": "post_manage_source_files",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/ManageSourceFilesModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/manage_sync": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Manage sync frequency for sources",
                "operationId": "post_manage_sync",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/ManageSyncModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/move_files": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Move files and/or folders to a folder",
                "operationId": "post_move_files_resource",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/organization/certificate-config": {
            "put": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Update organization certificate configuration",
                "operationId": "put_organization_certificate_config",
                "tags": [
                    "user"
                ]
            },
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get organization certificate configuration",
                "operationId": "get_organization_certificate_config",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/pin_agent": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Pin or unpin an agent",
                "operationId": "post_pin_agent",
                "parameters": [
                    {
                        "description": "ID of the agent",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/pinned_agents": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get pinned agents for the user",
                "operationId": "get_pinned_agents",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/remote": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Uploads remote source for vectorization",
                "operationId": "post_upload_remote",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/RemoteUploadModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/remove_shared_agent": {
            "delete": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Remove a shared agent from the current user's shared list",
                "operationId": "delete_remove_shared_agent",
                "parameters": [
                    {
                        "description": "ID of the shared agent",
                        "name": "id",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/share": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Share a conversation",
                "operationId": "post_share_conversation",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/ShareConversationModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/share_agent": {
            "put": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Share or unshare an agent",
                "operationId": "put_share_agent",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/ShareAgentModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/shared_agent": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get a shared agent by token or ID",
                "operationId": "get_shared_agent",
                "parameters": [
                    {
                        "description": "Shared token of the agent",
                        "name": "token",
                        "type": "string",
                        "in": "query"
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/shared_agents": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get shared agents explicitly shared with the user",
                "operationId": "get_shared_agents",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/shared_conversation/{identifier}": {
            "parameters": [
                {
                    "name": "identifier",
                    "in": "path",
                    "required": true,
                    "type": "string"
                }
            ],
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get publicly shared conversations by identifier",
                "operationId": "get_get_publicly_shared_conversations",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/sources": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Provide JSON file with combined available indexes",
                "operationId": "get_combined_json",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/sources/paginated": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get document with pagination, sorting and filtering",
                "operationId": "get_paginated_sources",
                "tags": [
                    "user"
                ]
            }
        },
        "/api/store_attachment": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Stores a single attachment without vectorization or training. Supports user or API key authentication.",
                "operationId": "post_store_attachment",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/AttachmentModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/task_status": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Get celery job status",
                "operationId": "get_task_status",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/TaskStatusModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/tts": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Synthesize audio speech from text",
                "operationId": "post_text_to_speech",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/TextToSpeechModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/update_agent/{agent_id}": {
            "parameters": [
                {
                    "name": "agent_id",
                    "in": "path",
                    "required": true,
                    "type": "string"
                }
            ],
            "put": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Update an existing agent",
                "operationId": "put_update_agent",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/UpdateAgentModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/update_chunk": {
            "put": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Updates an existing chunk in the document.",
                "operationId": "put_update_chunk",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/UpdateChunkModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/update_conversation_name": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Updates the name of a conversation",
                "operationId": "post_update_conversation_name",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/UpdateConversationModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/update_draft": {
            "put": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Updates an existing registration draft",
                "operationId": "put_update_draft",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/UpdateDraftModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/update_prompt": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Update an existing prompt",
                "operationId": "post_update_prompt",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/UpdatePromptModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/update_tool": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Update a tool by ID",
                "operationId": "post_update_tool",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/UpdateToolModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/update_tool_actions": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Update the actions of a tool",
                "operationId": "post_update_tool_actions",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/UpdateToolActionsModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/update_tool_config": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Update the configuration of a tool",
                "operationId": "post_update_tool_config",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/UpdateToolConfigModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/update_tool_status": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Update the status of a tool",
                "operationId": "post_update_tool_status",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/UpdateToolStatusModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/upload": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Uploads a file to be vectorized and indexed",
                "operationId": "post_upload_file",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/UploadModel"
                        }
                    }
                ],
                "tags": [
                    "user"
                ]
            }
        },
        "/api/webhooks/agents/{webhook_token}": {
            "parameters": [
                {
                    "name": "webhook_token",
                    "in": "path",
                    "required": true,
                    "type": "string"
                }
            ],
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Webhook listener for agent events (POST). Expects JSON payload, which is used to trigger processing.",
                "operationId": "post_agent_webhook_listener",
                "tags": [
                    "user"
                ]
            },
            "get": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Webhook listener for agent events (GET). Uses URL query parameters as payload to trigger processing.",
                "operationId": "get_agent_webhook_listener",
                "tags": [
                    "user"
                ]
            }
        },
        "/stream": {
            "post": {
                "responses": {
                    "200": {
                        "description": "Success"
                    }
                },
                "description": "Stream a response based on the question and retriever",
                "operationId": "post_stream_resource",
                "parameters": [
                    {
                        "name": "payload",
                        "required": true,
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/StreamModel"
                        }
                    }
                ],
                "tags": [
                    "answer"
                ]
            }
        }
    },
    "info": {
        "title": "DocsGPT API",
        "version": "1.0",
        "description": "API for DocsGPT"
    },
    "produces": [
        "application/json"
    ],
    "consumes": [
        "application/json"
    ],
    "tags": [
        {
            "name": "default",
            "description": "Default namespace"
        },
        {
            "name": "answer",
            "description": "Answer related operations"
        },
        {
            "name": "eval",
            "description": "Evaluation related operations"
        },
        {
            "name": "user",
            "description": "User related operations"
        },
        {
            "name": "google_drive",
            "description": "Google Drive operations"
        },
        {
            "name": "connectors",
            "description": "Connector operations"
        },
        {
            "name": "assistant",
            "description": "Platform assistant"
        }
    ],
    "definitions": {
        "StreamModel": {
            "required": [
                "question"
            ],
            "properties": {
                "question": {
                    "type": "string",
                    "description": "Question to be asked"
                },
                "history": {
                    "type": "array",
                    "description": "Conversation history (only for new conversations)",
                    "items": {
                        "type": "string"
                    }
                },
                "conversation_id": {
                    "type": "string",
                    "description": "Existing conversation ID (loads history)"
                },
                "prompt_id": {
                    "type": "string",
                    "description": "Prompt ID",
                    "default": "default"
                },
                "chunks": {
                    "type": "integer",
                    "description": "Number of chunks",
                    "default": 2
                },
                "token_limit": {
                    "type": "integer",
                    "description": "Token limit"
                },
                "retriever": {
                    "type": "string",
                    "description": "Retriever type"
                },
                "api_key": {
                    "type": "string",
                    "description": "API key"
                },
                "active_docs": {
                    "type": "string",
                    "description": "Active documents"
                },
                "isNoneDoc": {
                    "type": "boolean",
                    "description": "Flag indicating if no document is used"
                },
                "index": {
                    "type": "integer",
                    "description": "Index of the query to update"
                },
                "save_conversation": {
                    "type": "boolean",
                    "description": "Whether to save the conversation",
                    "default": true
                },
                "attachments": {
                    "type": "array",
                    "description": "List of attachment IDs",
                    "items": {
                        "type": "string"
                    }
                }
            },
            "type": "object"
        },
        "AnswerModel": {
            "required": [
                "question"
            ],
            "properties": {
                "question": {
                    "type": "string",
                    "description": "Question to be asked"
                },
                "history": {
                    "type": "array",
                    "description": "Conversation history (only for new conversations)",
                    "items": {
                        "type": "string"
                    }
                },
                "conversation_id": {
                    "type": "string",
                    "description": "Existing conversation ID (loads history)"
                },
                "prompt_id": {
                    "type": "string",
                    "description": "Prompt ID",
                    "default": "default"
                },
                "chunks": {
                    "type": "integer",
                    "description": "Number of chunks",
                    "default": 2
                },
                "token_limit": {
                    "type": "integer",
                    "description": "Token limit"
                },
                "retriever": {
                    "type": "string",
                    "description": "Retriever type"
                },
                "api_key": {
                    "type": "string",
                    "description": "API key"
                },
                "active_docs": {
                    "type": "string",
                    "description": "Active documents"
                },
                "isNoneDoc": {
                    "type": "boolean",
                    "description": "Flag indicating if no document is used"
                },
                "save_conversation": {
                    "type": "boolean",
                    "description": "Whether to save the conversation",
                    "default": true
                }
            },
            "type": "object"
        },
        "GenEvaluationModel": {
            "required": [
                "attachments"
            ],
            "properties": {
                "question": {
                    "type": "string",
                    "description": "The question to answer"
                },
                "history": {
                    "type": "array",
                    "description": "Conversation history",
                    "items": {
                        "type": "string"
                    }
                },
                "conversation_id": {
                    "type": "string",
                    "description": "Conversation ID"
                },
                "prompt_id": {
                    "type": "string",
                    "description": "Prompt ID",
                    "default": "default"
                },
                "chunks": {
                    "type": "integer",
                    "description": "Number of chunks",
                    "default": 2
                },
                "token_limit": {
                    "type": "integer",
                    "description": "Token limit"
                },
                "retriever": {
                    "type": "string",
                    "description": "Retriever type"
                },
                "api_key": {
                    "type": "string",
                    "description": "API key"
                },
                "active_docs": {
                    "type": "string",
                    "description": "Active documents"
                },
                "isNoneDoc": {
                    "type": "boolean",
                    "description": "Flag indicating if no document is used"
                },
                "attachments": {
                    "type": "array",
                    "description": "List of attachment IDs",
                    "items": {
                        "type": "string"
                    }
                }
            },
            "type": "object"
        },
        "GenContractModel": {
            "properties": {
                "question": {
                    "type": "string",
                    "description": "The question to answer"
                },
                "history": {
                    "type": "array",
                    "description": "Conversation history",
                    "items": {
                        "type": "string"
                    }
                },
                "conversation_id": {
                    "type": "string",
                    "description": "Conversation ID"
                },
                "prompt_id": {
                    "type": "string",
                    "description": "Prompt ID",
                    "default": "default"
                },
                "chunks": {
                    "type": "integer",
                    "description": "Number of chunks",
                    "default": 2
                },
                "token_limit": {
                    "type": "integer",
                    "description": "Token limit"
                },
                "retriever": {
                    "type": "string",
                    "description": "Retriever type"
                },
                "api_key": {
                    "type": "string",
                    "description": "API key"
                },
                "active_docs": {
                    "type": "string",
                    "description": "Active documents"
                },
                "isNoneDoc": {
                    "type": "boolean",
                    "description": "Flag indicating if no document is used"
                },
                "attachments": {
                    "type": "array",
                    "description": "List of attachment IDs",
                    "items": {
                        "type": "string"
                    }
                },
                "registrationType": {
                    "type": "string",
                    "description": "Type of registration for the contract"
                },
                "notes": {
                    "type": "string",
                    "description": "Additional user notes for contract generation"
                },
                "companyName": {
                    "type": "string",
                    "description": "Company name for the contract"
                },
                "companyAddress": {
                    "type": "string",
                    "description": "Company address for the contract"
                }
            },
            "type": "object"
        },
        "EditContractModel": {
            "required": [
                "comments",
                "contract"
            ],
            "properties": {
                "contract": {
                    "type": "string",
                    "description": "Existing contract text to be updated"
                },
                "comments": {
                    "type": "string",
                    "description": "User comments describing requested changes"
                },
                "history": {
                    "type": "string",
                    "description": "Conversation history for context"
                },
                "conversation_id": {
                    "type": "string",
                    "description": "Conversation ID"
                },
                "token_limit": {
                    "type": "integer",
                    "description": "Token limit"
                },
                "retriever": {
                    "type": "string",
                    "description": "Retriever type"
                }
            },
            "type": "object"
        },
        "UpdateConversationModel": {
            "required": [
                "id",
                "name"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Conversation ID"
                },
                "name": {
                    "type": "string",
                    "description": "New name of the conversation"
                }
            },
            "type": "object"
        },
        "FeedbackModel": {
            "required": [
                "conversation_id",
                "feedback",
                "question_index"
            ],
            "properties": {
                "feedback": {
                    "type": "string",
                    "description": "User feedback"
                },
                "conversation_id": {
                    "type": "string",
                    "description": "id of the particular conversation"
                },
                "question_index": {
                    "type": "integer",
                    "description": "The question number in that particular conversation"
                },
                "comments": {
                    "type": "string",
                    "description": "Additional comments"
                }
            },
            "type": "object"
        },
        "UploadModel": {
            "required": [
                "file",
                "name",
                "user"
            ],
            "properties": {
                "user": {
                    "type": "string",
                    "description": "User ID"
                },
                "name": {
                    "type": "string",
                    "description": "Job name"
                },
                "file": {
                    "type": "object",
                    "description": "File(s) to upload"
                }
            },
            "type": "object"
        },
        "ManageSourceFilesModel": {
            "required": [
                "operation",
                "source_id"
            ],
            "properties": {
                "source_id": {
                    "type": "string",
                    "description": "Source ID to modify"
                },
                "operation": {
                    "type": "string",
                    "description": "Operation: 'add', 'remove', or 'remove_directory'"
                },
                "file_paths": {
                    "type": "array",
                    "description": "File paths to remove (for remove operation)",
                    "items": {
                        "type": "string"
                    }
                },
                "directory_path": {
                    "type": "string",
                    "description": "Directory path to remove (for remove_directory operation)"
                },
                "file": {
                    "type": "object",
                    "description": "Files to add (for add operation)"
                },
                "parent_dir": {
                    "type": "string",
                    "description": "Parent directory path relative to source root"
                }
            },
            "type": "object"
        },
        "RemoteUploadModel": {
            "required": [
                "data",
                "name",
                "source",
                "user"
            ],
            "properties": {
                "user": {
                    "type": "string",
                    "description": "User ID"
                },
                "source": {
                    "type": "string",
                    "description": "Source of the data"
                },
                "name": {
                    "type": "string",
                    "description": "Job name"
                },
                "data": {
                    "type": "string",
                    "description": "Data to process"
                },
                "repo_url": {
                    "type": "string",
                    "description": "GitHub repository URL"
                }
            },
            "type": "object"
        },
        "TaskStatusModel": {
            "required": [
                "task_id"
            ],
            "properties": {
                "task_id": {
                    "type": "string",
                    "description": "Task ID"
                }
            },
            "type": "object"
        },
        "CheckDocsModel": {
            "required": [
                "docs"
            ],
            "properties": {
                "docs": {
                    "type": "string",
                    "description": "Document name"
                }
            },
            "type": "object"
        },
        "CreatePromptModel": {
            "required": [
                "content",
                "name"
            ],
            "properties": {
                "content": {
                    "type": "string",
                    "description": "Content of the prompt"
                },
                "name": {
                    "type": "string",
                    "description": "Name of the prompt"
                }
            },
            "type": "object"
        },
        "DeletePromptModel": {
            "required": [
                "id"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Prompt ID to delete"
                }
            },
            "type": "object"
        },
        "UpdatePromptModel": {
            "required": [
                "content",
                "id",
                "name"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Prompt ID to update"
                },
                "name": {
                    "type": "string",
                    "description": "New name of the prompt"
                },
                "content": {
                    "type": "string",
                    "description": "New content of the prompt"
                }
            },
            "type": "object"
        },
        "CreateAgentModel": {
            "required": [
                "agent_type",
                "chunks",
                "description",
                "name",
                "prompt_id",
                "retriever",
                "status"
            ],
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Name of the agent"
                },
                "description": {
                    "type": "string",
                    "description": "Description of the agent"
                },
                "image": {
                    "type": "object",
                    "description": "Image file upload"
                },
                "source": {
                    "type": "string",
                    "description": "Source ID (legacy single source)"
                },
                "sources": {
                    "type": "array",
                    "description": "List of source identifiers for multiple sources",
                    "items": {
                        "type": "string"
                    }
                },
                "chunks": {
                    "type": "integer",
                    "description": "Chunks count"
                },
                "retriever": {
                    "type": "string",
                    "description": "Retriever ID"
                },
                "prompt_id": {
                    "type": "string",
                    "description": "Prompt ID"
                },
                "tools": {
                    "type": "array",
                    "description": "List of tool identifiers",
                    "items": {
                        "type": "string"
                    }
                },
                "agent_type": {
                    "type": "string",
                    "description": "Type of the agent"
                },
                "status": {
                    "type": "string",
                    "description": "Status of the agent (draft or published)"
                },
                "json_schema": {
                    "type": "object",
                    "description": "JSON schema for enforcing structured output format"
                }
            },
            "type": "object"
        },
        "UpdateAgentModel": {
            "required": [
                "agent_type",
                "chunks",
                "description",
                "name",
                "prompt_id",
                "retriever",
                "status"
            ],
            "properties": {
                "name": {
                    "type": "string",
                    "description": "New name of the agent"
                },
                "description": {
                    "type": "string",
                    "description": "New description of the agent"
                },
                "image": {
                    "type": "string",
                    "description": "New image URL or identifier"
                },
                "source": {
                    "type": "string",
                    "description": "Source ID (legacy single source)"
                },
                "sources": {
                    "type": "array",
                    "description": "List of source identifiers for multiple sources",
                    "items": {
                        "type": "string"
                    }
                },
                "chunks": {
                    "type": "integer",
                    "description": "Chunks count"
                },
                "retriever": {
                    "type": "string",
                    "description": "Retriever ID"
                },
                "prompt_id": {
                    "type": "string",
                    "description": "Prompt ID"
                },
                "tools": {
                    "type": "array",
                    "description": "List of tool identifiers",
                    "items": {
                        "type": "string"
                    }
                },
                "agent_type": {
                    "type": "string",
                    "description": "Type of the agent"
                },
                "status": {
                    "type": "string",
                    "description": "Status of the agent (draft or published)"
                },
                "json_schema": {
                    "type": "object",
                    "description": "JSON schema for enforcing structured output format"
                }
            },
            "type": "object"
        },
        "ShareAgentModel": {
            "required": [
                "id",
                "shared"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "ID of the agent"
                },
                "shared": {
                    "type": "boolean",
                    "description": "Share or unshare the agent"
                },
                "userName": {
                    "type": "string",
                    "description": "Name of the user"
                },
                "userImage": {
                    "type": "string",
                    "description": "Image URL of the user"
                }
            },
            "type": "object"
        },
        "ShareConversationModel": {
            "required": [
                "conversation_id"
            ],
            "properties": {
                "conversation_id": {
                    "type": "string",
                    "description": "Conversation ID"
                },
                "user": {
                    "type": "string",
                    "description": "User ID (optional)"
                },
                "prompt_id": {
                    "type": "string",
                    "description": "Prompt ID (optional)"
                },
                "chunks": {
                    "type": "integer",
                    "description": "Chunks count (optional)"
                }
            },
            "type": "object"
        },
        "GetMessageAnalyticsModel": {
            "properties": {
                "api_key_id": {
                    "type": "string",
                    "description": "API Key ID"
                },
                "filter": {
                    "type": "string",
                    "description": "Filter option for analytics",
                    "default": "agent",
                    "example": "agent",
                    "enum": [
                        "agent",
                        "user"
                    ]
                },
                "filter_option": {
                    "type": "string",
                    "description": "Filter option for analytics",
                    "default": "last_30_days",
                    "example": "last_hour",
                    "enum": [
                        "last_hour",
                        "last_24_hour",
                        "last_7_days",
                        "last_15_days",
                        "last_30_days"
                    ]
                }
            },
            "type": "object"
        },
        "GetTokenAnalyticsModel": {
            "properties": {
                "api_key_id": {
                    "type": "string",
                    "description": "API Key ID"
                },
                "filter": {
                    "type": "string",
                    "description": "Filter option for analytics",
                    "default": "agent",
                    "example": "agent",
                    "enum": [
                        "agent",
                        "user"
                    ]
                },
                "filter_option": {
                    "type": "string",
                    "description": "Filter option for analytics",
                    "default": "last_30_days",
                    "example": "last_hour",
                    "enum": [
                        "last_hour",
                        "last_24_hour",
                        "last_7_days",
                        "last_15_days",
                        "last_30_days"
                    ]
                }
            },
            "type": "object"
        },
        "GetFeedbackAnalyticsModel": {
            "properties": {
                "api_key_id": {
                    "type": "string",
                    "description": "API Key ID"
                },
                "filter": {
                    "type": "string",
                    "description": "Filter option for analytics",
                    "default": "agent",
                    "example": "agent",
                    "enum": [
                        "agent",
                        "user"
                    ]
                },
                "filter_option": {
                    "type": "string",
                    "description": "Filter option for analytics",
                    "default": "last_30_days",
                    "example": "last_hour",
                    "enum": [
                        "last_hour",
                        "last_24_hour",
                        "last_7_days",
                        "last_15_days",
                        "last_30_days"
                    ]
                }
            },
            "type": "object"
        },
        "GetUserLogsModel": {
            "properties": {
                "page": {
                    "type": "integer",
                    "description": "Page number for pagination",
                    "default": 1
                },
                "api_key_id": {
                    "type": "string",
                    "description": "API Key ID"
                },
                "page_size": {
                    "type": "integer",
                    "description": "Number of logs per page",
                    "default": 10
                }
            },
            "type": "object"
        },
        "ManageSyncModel": {
            "required": [
                "source_id",
                "sync_frequency"
            ],
            "properties": {
                "source_id": {
                    "type": "string",
                    "description": "Source ID"
                },
                "sync_frequency": {
                    "type": "string",
                    "description": "Sync frequency (never, daily, weekly, monthly)"
                }
            },
            "type": "object"
        },
        "TextToSpeechModel": {
            "required": [
                "text"
            ],
            "properties": {
                "text": {
                    "type": "string",
                    "description": "Text to be synthesized as audio"
                }
            },
            "type": "object"
        },
        "CreateToolModel": {
            "required": [
                "actions",
                "config",
                "description",
                "displayName",
                "name",
                "status"
            ],
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Name of the tool"
                },
                "displayName": {
                    "type": "string",
                    "description": "Display name for the tool"
                },
                "description": {
                    "type": "string",
                    "description": "Tool description"
                },
                "config": {
                    "type": "object",
                    "description": "Configuration of the tool"
                },
                "customName": {
                    "type": "string",
                    "description": "Custom name for the tool"
                },
                "actions": {
                    "type": "array",
                    "description": "Actions the tool can perform",
                    "items": {
                        "type": "object"
                    }
                },
                "status": {
                    "type": "boolean",
                    "description": "Status of the tool"
                }
            },
            "type": "object"
        },
        "UpdateToolModel": {
            "required": [
                "id"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Tool ID"
                },
                "name": {
                    "type": "string",
                    "description": "Name of the tool"
                },
                "displayName": {
                    "type": "string",
                    "description": "Display name for the tool"
                },
                "customName": {
                    "type": "string",
                    "description": "Custom name for the tool"
                },
                "description": {
                    "type": "string",
                    "description": "Tool description"
                },
                "config": {
                    "type": "object",
                    "description": "Configuration of the tool"
                },
                "actions": {
                    "type": "array",
                    "description": "Actions the tool can perform",
                    "items": {
                        "type": "object"
                    }
                },
                "status": {
                    "type": "boolean",
                    "description": "Status of the tool"
                }
            },
            "type": "object"
        },
        "UpdateToolConfigModel": {
            "required": [
                "config",
                "id"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Tool ID"
                },
                "config": {
                    "type": "object",
                    "description": "Configuration of the tool"
                }
            },
            "type": "object"
        },
        "UpdateToolActionsModel": {
            "required": [
                "actions",
                "id"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Tool ID"
                },
                "actions": {
                    "type": "array",
                    "description": "Actions the tool can perform",
                    "items": {
                        "type": "object"
                    }
                }
            },
            "type": "object"
        },
        "UpdateToolStatusModel": {
            "required": [
                "id",
                "status"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Tool ID"
                },
                "status": {
                    "type": "boolean",
                    "description": "Status of the tool"
                }
            },
            "type": "object"
        },
        "DeleteToolModel": {
            "required": [
                "id"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Tool ID"
                }
            },
            "type": "object"
        },
        "AddChunkModel": {
            "required": [
                "id",
                "text"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Document ID"
                },
                "text": {
                    "type": "string",
                    "description": "Text of the chunk"
                },
                "metadata": {
                    "type": "object",
                    "description": "Metadata associated with the chunk"
                }
            },
            "type": "object"
        },
        "UpdateChunkModel": {
            "required": [
                "chunk_id",
                "id"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Document ID"
                },
                "chunk_id": {
                    "type": "string",
                    "description": "Chunk ID to update"
                },
                "text": {
                    "type": "string",
                    "description": "New text of the chunk"
                },
                "metadata": {
                    "type": "object",
                    "description": "Updated metadata associated with the chunk"
                }
            },
            "type": "object"
        },
        "AttachmentModel": {
            "required": [
                "file"
            ],
            "properties": {
                "file": {
                    "type": "object",
                    "description": "File to upload"
                },
                "api_key": {
                    "type": "string",
                    "description": "API key (optional)"
                }
            },
            "type": "object"
        },
        "DraftEvaluationModel": {
            "required": [
                "draft_id"
            ],
            "properties": {
                "draft_id": {
                    "type": "string",
                    "description": "Draft ID to evaluate"
                }
            },
            "type": "object"
        },
        "DraftModel": {
            "required": [
                "name"
            ],
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Draft name"
                },
                "attachmentIds": {
                    "type": "array",
                    "description": "List of attachment IDs",
                    "items": {
                        "type": "string"
                    }
                },
                "evaluation": {
                    "type": "object",
                    "description": "Evaluation data"
                },
                "contract": {
                    "type": "string",
                    "description": "Generated contract text"
                },
                "companyName": {
                    "type": "string",
                    "description": "Company name"
                },
                "companyAddress": {
                    "type": "string",
                    "description": "Company address"
                },
                "registrationType": {
                    "type": "string",
                    "description": "Registration type (license_partnership, services_agreement, project_passport)"
                },
                "comment": {
                    "type": "string",
                    "description": "Project description comment (for project_passport)"
                }
            },
            "type": "object"
        },
        "UpdateDraftModel": {
            "required": [
                "draft_id"
            ],
            "properties": {
                "draft_id": {
                    "type": "string",
                    "description": "Draft ID to update"
                },
                "name": {
                    "type": "string",
                    "description": "Updated draft name"
                },
                "attachmentIds": {
                    "type": "array",
                    "description": "Updated list of attachment IDs",
                    "items": {
                        "type": "string"
                    }
                },
                "evaluation": {
                    "type": "object",
                    "description": "Updated evaluation data"
                },
                "contract": {
                    "type": "string",
                    "description": "Updated contract text"
                }
            },
            "type": "object"
        },
        "CompleteRegistrationModel": {
            "required": [
                "draft_id"
            ],
            "properties": {
                "draft_id": {
                    "type": "string",
                    "description": "Draft ID to complete"
                }
            },
            "type": "object"
        },
        "DeleteDraftModel": {
            "required": [
                "draft_id"
            ],
            "properties": {
                "draft_id": {
                    "type": "string",
                    "description": "Draft ID to delete"
                }
            },
            "type": "object"
        },
        "GoogleDriveDownloadModel": {
            "required": [
                "file_ids",
                "session_token"
            ],
            "properties": {
                "session_token": {
                    "type": "string",
                    "description": "Google OAuth session token"
                },
                "file_ids": {
                    "type": "array",
                    "description": "List of Google Drive file IDs",
                    "items": {
                        "type": "string"
                    }
                },
                "api_key": {
                    "type": "string",
                    "description": "API key (optional)"
                }
            },
            "type": "object"
        },
        "GoogleDriveListModel": {
            "required": [
                "session_token"
            ],
            "properties": {
                "session_token": {
                    "type": "string",
                    "description": "Google OAuth session token"
                },
                "folder_id": {
                    "type": "string",
                    "description": "Folder ID to browse (optional)"
                },
                "page_token": {
                    "type": "string",
                    "description": "Page token for pagination"
                },
                "limit": {
                    "type": "integer",
                    "description": "Number of files to return (default 50)"
                }
            },
            "type": "object"
        },
        "GoogleDriveListFolderFilesModel": {
            "required": [
                "folder_ids",
                "session_token"
            ],
            "properties": {
                "session_token": {
                    "type": "string",
                    "description": "Google OAuth session token"
                },
                "folder_ids": {
                    "type": "array",
                    "description": "List of folder IDs to get files from",
                    "items": {
                        "type": "string"
                    }
                }
            },
            "type": "object"
        },
        "GoogleDriveDisconnectModel": {
            "required": [
                "session_token"
            ],
            "properties": {
                "session_token": {
                    "type": "string",
                    "description": "Google OAuth session token"
                }
            },
            "type": "object"
        },
        "ConnectorUploadModel": {
            "required": [
                "data",
                "name",
                "source",
                "user"
            ],
            "properties": {
                "user": {
                    "type": "string",
                    "description": "User ID"
                },
                "source": {
                    "type": "string",
                    "description": "Source type (google_drive, github, etc.)"
                },
                "name": {
                    "type": "string",
                    "description": "Job name"
                },
                "data": {
                    "type": "string",
                    "description": "Configuration data"
                },
                "repo_url": {
                    "type": "string",
                    "description": "GitHub repository URL"
                }
            },
            "type": "object"
        },
        "ConnectorTaskStatusModel": {
            "required": [
                "task_id"
            ],
            "properties": {
                "task_id": {
                    "type": "string",
                    "description": "Task ID"
                }
            },
            "type": "object"
        },
        "ConnectorRefreshModel": {
            "required": [
                "provider",
                "refresh_token"
            ],
            "properties": {
                "provider": {
                    "type": "string"
                },
                "refresh_token": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "ConnectorFilesModel": {
            "required": [
                "provider",
                "session_token"
            ],
            "properties": {
                "provider": {
                    "type": "string"
                },
                "session_token": {
                    "type": "string"
                },
                "folder_id": {
                    "type": "string"
                },
                "limit": {
                    "type": "integer"
                },
                "page_token": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "ConnectorValidateSessionModel": {
            "required": [
                "provider",
                "session_token"
            ],
            "properties": {
                "provider": {
                    "type": "string"
                },
                "session_token": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "ConnectorDisconnectModel": {
            "required": [
                "provider"
            ],
            "properties": {
                "provider": {
                    "type": "string"
                },
                "session_token": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "ConnectorSyncModel": {
            "required": [
                "session_token",
                "source_id"
            ],
            "properties": {
                "source_id": {
                    "type": "string",
                    "description": "Source ID to sync"
                },
                "session_token": {
                    "type": "string",
                    "description": "Authentication token"
                }
            },
            "type": "object"
        },
        "AssistantStreamModel": {
            "required": [
                "question"
            ],
            "properties": {
                "question": {
                    "type": "string",
                    "description": "The user's message"
                },
                "history": {
                    "type": "object",
                    "description": "Earlier turns: [{prompt, response}]"
                },
                "registration_id": {
                    "type": "string",
                    "description": "Registration the user is looking at, if any"
                }
            },
            "type": "object"
        }
    },
    "responses": {
        "ParseError": {
            "description": "When a mask can't be parsed"
        },
        "MaskError": {
            "description": "When any error occurs on mask"
        }
    }
}
