Ctrl K
ComunidadGuías…

vite/openapi.json

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
{
  "openapi": "3.1.0",
  "info": {
    "title": "Corpus Service",
    "version": "v1"
  },
  "paths": {
    "/api/v1/health/": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Health Check",
        "operationId": "health_check_api_v1_health__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/health/db": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Db Check",
        "operationId": "db_check_api_v1_health_db_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/stripe": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Stripe Webhook",
        "description": "Receive webhook events from Stripe payment platform.\n\nNo authentication required - webhook signature validated internally.",
        "operationId": "stripe_webhook_api_v1_webhooks_stripe_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object",
                  "title": "Response Stripe Webhook Api V1 Webhooks Stripe Post"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/plans": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Get Plans",
        "description": "Get all available subscription plans.\n\nReturns pricing, limits, and features for each tier.\nPrices are fetched from Stripe and cached for 1 hour.\nThis endpoint is public (no auth required) for pricing pages.",
        "operationId": "get_plans_api_v1_billing_plans_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlansResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/protected": {
      "get": {
        "tags": [
          "protected"
        ],
        "summary": "Protected Route",
        "description": "Example protected route that requires authentication.",
        "operationId": "protected_route_api_v1_auth_protected_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProtectedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/profile": {
      "get": {
        "tags": [
          "protected"
        ],
        "summary": "Get Profile",
        "description": "Get current user profile.",
        "operationId": "get_profile_api_v1_auth_profile_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/": {
      "post": {
        "tags": [
          "workspaces"
        ],
        "summary": "Create Workspace",
        "description": "Create a new workspace.",
        "operationId": "create_workspace_api_v1_workspaces__post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "workspaces"
        ],
        "summary": "Get Workspaces",
        "description": "Get all workspaces.",
        "operationId": "get_workspaces_api_v1_workspaces__get",
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceResponse"
                  },
                  "title": "Response Get Workspaces Api V1 Workspaces  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}": {
      "get": {
        "tags": [
          "workspaces"
        ],
        "summary": "Get Workspace",
        "description": "Get a workspace by ID.",
        "operationId": "get_workspace_api_v1_workspaces__workspaceId__get",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspaceid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "workspaces"
        ],
        "summary": "Update Workspace",
        "description": "Update a workspace.",
        "operationId": "update_workspace_api_v1_workspaces__workspaceId__put",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspaceid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "workspaces"
        ],
        "summary": "Delete Workspace",
        "description": "Soft delete a workspace.",
        "operationId": "delete_workspace_api_v1_workspaces__workspaceId__delete",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspaceid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/supported-extensions": {
      "get": {
        "tags": [
          "documents"
        ],
        "summary": "Get Supported File Extensions",
        "description": "Get all supported file extensions for document uploads.",
        "operationId": "get_supported_file_extensions_api_v1_documents_supported_extensions_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportedExtensionsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/": {
      "get": {
        "tags": [
          "documents"
        ],
        "summary": "List Documents",
        "description": "List all documents with optional filters and pagination.",
        "operationId": "list_documents_api_v1_documents__get",
        "parameters": [
          {
            "name": "contentType",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by content type",
              "title": "Contenttype"
            },
            "description": "Filter by content type"
          },
          {
            "name": "extractionStatus",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by extraction status",
              "title": "Extractionstatus"
            },
            "description": "Filter by extraction status"
          },
          {
            "name": "createdAfter",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by created after (ISO format)",
              "title": "Createdafter"
            },
            "description": "Filter by created after (ISO format)"
          },
          {
            "name": "createdBefore",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by created before (ISO format)",
              "title": "Createdbefore"
            },
            "description": "Filter by created before (ISO format)"
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of documents to skip",
              "default": 0,
              "title": "Skip"
            },
            "description": "Number of documents to skip"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Maximum number of documents to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum number of documents to return"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "documents"
        ],
        "summary": "Upload Standalone Document",
        "description": "Upload a document without associating it with any matrix.",
        "operationId": "upload_standalone_document_api_v1_documents__post",
        "parameters": [
          {
            "name": "useAgenticChunking",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Whether to use AI-powered chunking",
              "default": false,
              "title": "Useagenticchunking"
            },
            "description": "Whether to use AI-powered chunking"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_standalone_document_api_v1_documents__post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/search": {
      "get": {
        "tags": [
          "documents"
        ],
        "summary": "Search Documents",
        "description": "Search documents with optional query and filters.",
        "operationId": "search_documents_api_v1_documents_search_get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search query to match against document filename",
              "title": "Q"
            },
            "description": "Search query to match against document filename"
          },
          {
            "name": "contentType",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by content type",
              "title": "Contenttype"
            },
            "description": "Filter by content type"
          },
          {
            "name": "extractionStatus",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by extraction status",
              "title": "Extractionstatus"
            },
            "description": "Filter by extraction status"
          },
          {
            "name": "createdAfter",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by created after (ISO format)",
              "title": "Createdafter"
            },
            "description": "Filter by created after (ISO format)"
          },
          {
            "name": "createdBefore",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by created before (ISO format)",
              "title": "Createdbefore"
            },
            "description": "Filter by created before (ISO format)"
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of documents to skip",
              "default": 0,
              "title": "Skip"
            },
            "description": "Number of documents to skip"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Maximum number of documents to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum number of documents to return"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/search/hybrid": {
      "get": {
        "tags": [
          "documents"
        ],
        "summary": "Hybrid Search Documents",
        "description": "Hybrid document search combining filename, BM25 content, and semantic vector search.",
        "operationId": "hybrid_search_documents_api_v1_documents_search_hybrid_get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Search query (filename + content + semantic)",
              "title": "Q"
            },
            "description": "Search query (filename + content + semantic)"
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of results to skip",
              "default": 0,
              "title": "Skip"
            },
            "description": "Number of results to skip"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Maximum results to return",
              "default": 20,
              "title": "Limit"
            },
            "description": "Maximum results to return"
          },
          {
            "name": "snippetsPerDoc",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 10,
              "minimum": 1,
              "description": "Max snippets per document",
              "default": 3,
              "title": "Snippetsperdoc"
            },
            "description": "Max snippets per document"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HybridDocumentSearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/documents/": {
      "post": {
        "tags": [
          "documents"
        ],
        "summary": "Upload Document",
        "operationId": "upload_document_api_v1_matrices__matrixId__documents__post",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "entitySetId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Entity set ID to add document to",
              "title": "Entitysetid"
            },
            "description": "Entity set ID to add document to"
          },
          {
            "name": "useAgenticChunking",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Whether to use AI-powered chunking",
              "default": false,
              "title": "Useagenticchunking"
            },
            "description": "Whether to use AI-powered chunking"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_document_api_v1_matrices__matrixId__documents__post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "documents",
          "workflow-agent"
        ],
        "summary": "Get Documents By Matrix",
        "description": "Get all documents for a specific matrix through entity set membership.",
        "operationId": "get_documents_by_matrix",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MatrixDocumentResponse"
                  },
                  "title": "Response Get Documents By Matrix"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/documents/from-urls/": {
      "post": {
        "tags": [
          "documents"
        ],
        "summary": "Upload Documents From Urls",
        "description": "Upload multiple documents from URLs to a matrix.",
        "operationId": "upload_documents_from_urls_api_v1_matrices__matrixId__documents_from_urls__post",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "entitySetId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Entity set ID to add documents to",
              "title": "Entitysetid"
            },
            "description": "Entity set ID to add documents to"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUrlUploadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUrlUploadResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{documentId}": {
      "get": {
        "tags": [
          "documents",
          "workflow-agent"
        ],
        "summary": "Get Document",
        "operationId": "get_document",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "documents"
        ],
        "summary": "Delete Document",
        "operationId": "delete_document_api_v1_documents__documentId__delete",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{documentId}/content": {
      "get": {
        "tags": [
          "documents"
        ],
        "summary": "Get Document Content",
        "description": "Get extracted content for a document (for chunking agent).",
        "operationId": "get_document_content_api_v1_documents__documentId__content_get",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/documents/{documentId}": {
      "delete": {
        "tags": [
          "documents"
        ],
        "summary": "Remove Document From Matrix",
        "description": "Remove a document from a specific matrix (removes from entity set).",
        "operationId": "remove_document_from_matrix_api_v1_matrices__matrixId__documents__documentId__delete",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/documents/{documentId}/associate": {
      "post": {
        "tags": [
          "documents"
        ],
        "summary": "Associate Existing Document With Matrix",
        "description": "Associate an existing document with a matrix by adding it to a specific entity set.",
        "operationId": "associate_existing_document_with_matrix_api_v1_matrices__matrixId__documents__documentId__associate_post",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "entitySetId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Target entity set ID to add the document to.",
              "title": "Entitysetid"
            },
            "description": "Target entity set ID to add the document to."
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentLabelUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{documentId}/highlighted/{matrixCellId}": {
      "get": {
        "tags": [
          "documents"
        ],
        "summary": "Get Highlighted Document For Cell",
        "description": "Get a document with citations from a matrix cell highlighted.",
        "operationId": "get_highlighted_document_for_cell_api_v1_documents__documentId__highlighted__matrixCellId__get",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "matrixCellId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixcellid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/questions/": {
      "post": {
        "tags": [
          "questions"
        ],
        "summary": "Create Question",
        "operationId": "create_question_api_v1_matrices__matrixId__questions__post",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "entitySetId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Question entity set ID to add question to",
              "title": "Entitysetid"
            },
            "description": "Question entity set ID to add question to"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "questions",
          "workflow-agent"
        ],
        "summary": "Get Questions By Matrix",
        "description": "Get all questions for a specific matrix.",
        "operationId": "get_questions_by_matrix",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QuestionResponse"
                  },
                  "title": "Response Get Questions By Matrix"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/questions/{questionId}": {
      "get": {
        "tags": [
          "questions",
          "workflow-agent"
        ],
        "summary": "Get Question",
        "operationId": "get_question",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "questions"
        ],
        "summary": "Update Question",
        "operationId": "update_question_api_v1_questions__questionId__patch",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "questions"
        ],
        "summary": "Delete Question",
        "operationId": "delete_question_api_v1_questions__questionId__delete",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/questions/{questionId}/label": {
      "patch": {
        "tags": [
          "questions"
        ],
        "summary": "Update Question Label",
        "description": "Update only the label of a question. This operation does not trigger reprocessing.",
        "operationId": "update_question_label_api_v1_questions__questionId__label_patch",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionLabelUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/questions-with-options/": {
      "post": {
        "tags": [
          "questions"
        ],
        "summary": "Create Question With Options",
        "description": "Create a question with options transactionally (for SINGLE_SELECT questions).",
        "operationId": "create_question_with_options_api_v1_matrices__matrixId__questions_with_options__post",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "entitySetId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Question entity set ID to add question to",
              "title": "Entitysetid"
            },
            "description": "Question entity set ID to add question to"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionWithOptionsCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/questions/{questionId}": {
      "patch": {
        "tags": [
          "questions"
        ],
        "summary": "Update Question With Options",
        "description": "Update a question with options and automatically reprocess affected cells.",
        "operationId": "update_question_with_options_api_v1_matrices__matrixId__questions__questionId__patch",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionWithOptionsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/questions/{questionId}/option-sets/": {
      "post": {
        "tags": [
          "questions"
        ],
        "summary": "Create Question Option Set",
        "description": "Create an option set for a question.",
        "operationId": "create_question_option_set_api_v1_questions__questionId__option_sets__post",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionOptionSetCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionOptionSetResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "questions"
        ],
        "summary": "Get Question Option Set",
        "description": "Get option set for a question.",
        "operationId": "get_question_option_set_api_v1_questions__questionId__option_sets__get",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionOptionSetResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "questions"
        ],
        "summary": "Update Question Option Set",
        "description": "Update option set for a question.",
        "operationId": "update_question_option_set_api_v1_questions__questionId__option_sets__put",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionOptionSetUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionOptionSetResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "questions"
        ],
        "summary": "Delete Question Option Set",
        "description": "Delete option set for a question.",
        "operationId": "delete_question_option_set_api_v1_questions__questionId__option_sets__delete",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/questions/{questionId}/options/": {
      "post": {
        "tags": [
          "questions"
        ],
        "summary": "Add Option To Question",
        "description": "Add a single option to a question's option set.",
        "operationId": "add_option_to_question_api_v1_questions__questionId__options__post",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionOptionCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionOptionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "questions"
        ],
        "summary": "Get Question Options",
        "description": "Get all options for a question.",
        "operationId": "get_question_options_api_v1_questions__questionId__options__get",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QuestionOptionResponse"
                  },
                  "title": "Response Get Question Options Api V1 Questions  Questionid  Options  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/questions/{questionId}/template-validation": {
      "get": {
        "tags": [
          "questions"
        ],
        "summary": "Validate Question Template Variables",
        "description": "Validate template variables for a question.",
        "operationId": "validate_question_template_variables_api_v1_questions__questionId__template_validation_get",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateValidationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/questions/{questionId}/duplicate": {
      "post": {
        "tags": [
          "questions"
        ],
        "summary": "Duplicate Question",
        "description": "Duplicate a question within the same matrix, including its options.",
        "operationId": "duplicate_question_api_v1_questions__questionId__duplicate_post",
        "parameters": [
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/question-types/": {
      "get": {
        "tags": [
          "question-types",
          "workflow_agent"
        ],
        "summary": "Get Question Types",
        "description": "Get all available question types.",
        "operationId": "get_question_types",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QuestionTypeResponse"
                  },
                  "title": "Response Get Question Types"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/question-types/{questionTypeId}": {
      "get": {
        "tags": [
          "question-types"
        ],
        "summary": "Get Question Type",
        "description": "Get a specific question type by ID.",
        "operationId": "get_question_type_api_v1_question_types__questionTypeId__get",
        "parameters": [
          {
            "name": "questionTypeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questiontypeid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionTypeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/": {
      "post": {
        "tags": [
          "matrices"
        ],
        "summary": "Create Matrix",
        "operationId": "create_matrix_api_v1_matrices__post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatrixCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "matrices"
        ],
        "summary": "List Matrices",
        "operationId": "list_matrices_api_v1_matrices__get",
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MatrixListResponse"
                  },
                  "title": "Response List Matrices Api V1 Matrices  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/matrices/": {
      "get": {
        "tags": [
          "matrices",
          "workflow-agent"
        ],
        "summary": "Get Matrices By Workspace",
        "description": "Get all matrices for a specific workspace.",
        "operationId": "get_matrices_by_workspace",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspaceid"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MatrixListResponse"
                  },
                  "title": "Response Get Matrices By Workspace"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}": {
      "get": {
        "tags": [
          "matrices",
          "workflow-agent"
        ],
        "summary": "Get Matrix",
        "operationId": "get_matrix",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "matrices"
        ],
        "summary": "Update Matrix",
        "operationId": "update_matrix_api_v1_matrices__matrixId__patch",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatrixUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "matrices"
        ],
        "summary": "Delete Matrix",
        "operationId": "delete_matrix_api_v1_matrices__matrixId__delete",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/entity-sets": {
      "get": {
        "tags": [
          "matrices",
          "workflow-agent"
        ],
        "summary": "Get Matrix Entity Sets",
        "description": "Get all entity sets for a matrix with their members.\n\nThis endpoint provides complete entity set information needed by the frontend to:\n1. Determine matrix dimensionality\n2. Construct entity_set_filters for tile batch queries\n3. Map entity IDs (document/question IDs) to entity set member IDs",
        "operationId": "get_matrix_entity_sets",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixEntitySetsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/stats": {
      "get": {
        "tags": [
          "matrices"
        ],
        "summary": "Get Matrix Stats",
        "description": "Get cell statistics for a matrix (count by status).",
        "operationId": "get_matrix_stats_api_v1_matrices__matrixId__stats_get",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixStatsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrix-cells/{cellId}": {
      "get": {
        "tags": [
          "matrices"
        ],
        "summary": "Get Matrix Cell",
        "operationId": "get_matrix_cell_api_v1_matrix_cells__cellId__get",
        "parameters": [
          {
            "name": "cellId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cellid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixCellResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "matrices"
        ],
        "summary": "Update Matrix Cell",
        "operationId": "update_matrix_cell_api_v1_matrix_cells__cellId__patch",
        "parameters": [
          {
            "name": "cellId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cellid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatrixCellUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixCellResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/cells": {
      "get": {
        "tags": [
          "matrices"
        ],
        "summary": "Get Matrix Cells",
        "description": "Get matrix cells with optional filtering by document_id or question_id.",
        "operationId": "get_matrix_cells_api_v1_matrices__matrixId__cells_get",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "documentId",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Documentid"
            }
          },
          {
            "name": "questionId",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MatrixCellResponse"
                  },
                  "title": "Response Get Matrix Cells Api V1 Matrices  Matrixid  Cells Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrix-cells/{cellId}/answers/current": {
      "get": {
        "tags": [
          "matrices"
        ],
        "summary": "Get Current Matrix Cell Answer",
        "description": "Get the current answer for a matrix cell.",
        "operationId": "get_current_matrix_cell_answer_api_v1_matrix_cells__cellId__answers_current_get",
        "parameters": [
          {
            "name": "cellId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Cellid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/MatrixCellAnswerResponse"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Get Current Matrix Cell Answer Api V1 Matrix Cells  Cellid  Answers Current Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/entity-sets/{entitySetId}/documents/{documentId}/cells/with-answers": {
      "get": {
        "tags": [
          "matrices",
          "workflow-agent"
        ],
        "summary": "Get Matrix Cells With Current Answers By Document",
        "description": "Get all matrix cells with their current answers for a specific document (entity-ref based).",
        "operationId": "get_matrix_cells_by_document",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "entitySetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Entitysetid"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MatrixCellWithAnswerResponse"
                  },
                  "title": "Response Get Matrix Cells By Document"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/entity-sets/{entitySetId}/questions/{questionId}/cells/with-answers": {
      "get": {
        "tags": [
          "matrices",
          "workflow-agent"
        ],
        "summary": "Get Matrix Cells With Current Answers By Question",
        "description": "Get all matrix cells with their current answers for a specific question (entity-ref based).",
        "operationId": "get_matrix_cells_by_question",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "entitySetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Entitysetid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Questionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MatrixCellWithAnswerResponse"
                  },
                  "title": "Response Get Matrix Cells By Question"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/cells/batch": {
      "post": {
        "tags": [
          "matrices",
          "workflow-agent"
        ],
        "summary": "Get Matrix Cells Batch",
        "description": "Batch fetch matrix cells using entity_set_filters (entity-ref based).\n\nFrontend provides entity_set_filters to specify which entities to fetch cells for.\nFinds all cells that reference any of the specified entities (role-agnostic).\n\nExample: POST /matrices/1/cells/batch\nBody: {\n    \"entitySetFilters\": [\n        {\"entitySetId\": 1, \"entityIds\": [10, 11, 12]},\n        {\"entitySetId\": 2, \"entityIds\": [20, 21, 22]}\n    ]\n}\nReturns all cells that reference any of those entities in any role.",
        "operationId": "get_matrix_cells_batch",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatrixCellsBatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MatrixCellWithAnswerResponse"
                  },
                  "title": "Response Get Matrix Cells Batch"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/reprocess": {
      "post": {
        "tags": [
          "matrices"
        ],
        "summary": "Reprocess Matrix Cells",
        "description": "Reprocess matrix cells based on the specified criteria.",
        "operationId": "reprocess_matrix_cells_api_v1_matrices__matrixId__reprocess_post",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatrixReprocessRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixCellReprocessResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/soft-delete": {
      "post": {
        "tags": [
          "matrices"
        ],
        "summary": "Soft Delete Matrix Entities",
        "description": "Soft delete matrix entities (documents, questions, or matrices) and their related cells.",
        "operationId": "soft_delete_matrix_entities_api_v1_matrices__matrixId__soft_delete_post",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatrixSoftDeleteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixSoftDeleteResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/duplicate": {
      "post": {
        "tags": [
          "matrices"
        ],
        "summary": "Duplicate Matrix",
        "description": "Duplicate a matrix with specified duplication type (documents only, questions only, or full matrix).",
        "operationId": "duplicate_matrix_api_v1_matrices__matrixId__duplicate_post",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatrixDuplicateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixDuplicateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/template-variables": {
      "get": {
        "tags": [
          "matrices"
        ],
        "summary": "Get Matrix Template Variables",
        "description": "Get template variables for a matrix (used for duplication form).",
        "operationId": "get_matrix_template_variables_api_v1_matrices__matrixId__template_variables_get",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MatrixTemplateVariableResponse"
                  },
                  "title": "Response Get Matrix Template Variables Api V1 Matrices  Matrixid  Template Variables Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/structure": {
      "get": {
        "tags": [
          "matrices",
          "workflow-agent"
        ],
        "summary": "Get Matrix Structure",
        "description": "Get matrix structure metadata for understanding cell data.\n\nProvides information about:\n- Matrix type and dimensionality\n- Entity sets (what entities are on each axis)\n- Entity roles (DOCUMENT, LEFT, RIGHT, QUESTION)\n- System placeholders (@{{LEFT}}, @{{RIGHT}})\n- Cell structure (what data each cell contains)\n\nThis helps workflow agents understand how to interpret matrix data\nwhen generating documents from cell data.",
        "operationId": "get_matrix_structure",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixStructureResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/entity-sets/{entitySetId}/members/{memberId}/label": {
      "patch": {
        "tags": [
          "entity-sets"
        ],
        "summary": "Update Entity Set Member Label",
        "description": "Update the label of an entity set member.\n\nLabels are per-matrix context - the same entity (document/question) can have\ndifferent labels in different entity sets/matrices.",
        "operationId": "update_entity_set_member_label_api_v1_entity_sets__entitySetId__members__memberId__label_patch",
        "parameters": [
          {
            "name": "entitySetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Entitysetid"
            }
          },
          {
            "name": "memberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Memberid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EntitySetMemberLabelUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitySetMemberResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/template-variables/": {
      "post": {
        "tags": [
          "matrix-template-variables"
        ],
        "summary": "Create Template Variable",
        "description": "Create a new template variable for a matrix.",
        "operationId": "create_template_variable_api_v1_matrices__matrixId__template_variables__post",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatrixTemplateVariableCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixTemplateVariableResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "matrix-template-variables",
          "workflow-agent"
        ],
        "summary": "Get Matrix Template Variables",
        "description": "Get all template variables for a matrix.",
        "operationId": "get_template_variables",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MatrixTemplateVariableResponse"
                  },
                  "title": "Response Get Template Variables"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/matrices/{matrixId}/template-variables/with-usage": {
      "get": {
        "tags": [
          "matrix-template-variables"
        ],
        "summary": "Get Template Variables With Usage",
        "description": "Get template variables with usage count for a matrix.",
        "operationId": "get_template_variables_with_usage_api_v1_matrices__matrixId__template_variables_with_usage_get",
        "parameters": [
          {
            "name": "matrixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Matrixid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateVariableUsageResponse"
                  },
                  "title": "Response Get Template Variables With Usage Api V1 Matrices  Matrixid  Template Variables With Usage Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/template-variables/{variableId}": {
      "get": {
        "tags": [
          "matrix-template-variables"
        ],
        "summary": "Get Template Variable",
        "description": "Get a specific template variable by ID.",
        "operationId": "get_template_variable_api_v1_template_variables__variableId__get",
        "parameters": [
          {
            "name": "variableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Variableid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixTemplateVariableResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "matrix-template-variables"
        ],
        "summary": "Update Template Variable",
        "description": "Update a template variable and reprocess affected questions.",
        "operationId": "update_template_variable_api_v1_template_variables__variableId__patch",
        "parameters": [
          {
            "name": "variableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Variableid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatrixTemplateVariableUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatrixTemplateVariableResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "matrix-template-variables"
        ],
        "summary": "Delete Template Variable",
        "description": "Delete a template variable (only if not in use).",
        "operationId": "delete_template_variable_api_v1_template_variables__variableId__delete",
        "parameters": [
          {
            "name": "variableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Variableid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/template-variables/{variableId}/affected-questions": {
      "get": {
        "tags": [
          "matrix-template-variables"
        ],
        "summary": "Get Affected Questions",
        "description": "Get list of question IDs that would be affected by changes to this template variable.",
        "operationId": "get_affected_questions_api_v1_template_variables__variableId__affected_questions_get",
        "parameters": [
          {
            "name": "variableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Variableid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "title": "Response Get Affected Questions Api V1 Template Variables  Variableid  Affected Questions Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/queue/process-pending": {
      "post": {
        "tags": [
          "qa"
        ],
        "summary": "Queue Pending Cells",
        "description": "Queue matrix cells in PENDING state for processing.\n\nIf matrix_id is provided in the request, only queues cells for that specific matrix.\nOtherwise, queues all pending cells across all matrices.",
        "operationId": "queue_pending_cells_api_v1_queue_process_pending_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueuePendingCellsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueuePendingCellsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/qa-jobs/{qaJobId}/answer": {
      "post": {
        "tags": [
          "qa"
        ],
        "summary": "Upload Agent Qa Answer",
        "description": "Upload answer from agent QA container.\n\nThis endpoint is called by agent QA containers running in K8s jobs.\nThe agent POSTs its answer directly after processing completes.",
        "operationId": "upload_agent_qa_answer_api_v1_qa_jobs__qaJobId__answer_post",
        "parameters": [
          {
            "name": "qaJobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Qajobid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentQAAnswerSetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentQAAnswerUploadResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/extraction/queue-pending": {
      "post": {
        "tags": [
          "document-extraction"
        ],
        "summary": "Queue Pending Documents",
        "description": "Queue all pending documents for extraction processing.",
        "operationId": "queue_pending_documents_api_v1_extraction_queue_pending_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  },
                  "title": "Response Queue Pending Documents Api V1 Extraction Queue Pending Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/extraction/retry-failed": {
      "post": {
        "tags": [
          "document-extraction"
        ],
        "summary": "Retry Failed Extractions",
        "description": "Retry failed extraction jobs by restarting Temporal workflows.",
        "operationId": "retry_failed_extractions_api_v1_extraction_retry_failed_post",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  },
                  "title": "Response Retry Failed Extractions Api V1 Extraction Retry Failed Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/extraction/jobs/{jobId}": {
      "get": {
        "tags": [
          "document-extraction"
        ],
        "summary": "Get Extraction Job",
        "description": "Get extraction job details.",
        "operationId": "get_extraction_job_api_v1_extraction_jobs__jobId__get",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Jobid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{documentId}/extraction-status": {
      "get": {
        "tags": [
          "document-extraction"
        ],
        "summary": "Get Document Extraction Status",
        "description": "Get extraction status for a document.",
        "operationId": "get_document_extraction_status_api_v1_documents__documentId__extraction_status_get",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{documentId}/chunks": {
      "get": {
        "tags": [
          "chunks",
          "workflow-agent"
        ],
        "summary": "List Document Chunks",
        "description": "Get chunk metadata for a document (without content).\n\nReturns a list of all chunk IDs and metadata for the document,\nallowing agents to discover available chunks before reading specific ones.",
        "operationId": "list_document_chunks",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChunkListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "chunks"
        ],
        "summary": "Upload Document Chunks",
        "description": "Upload chunks from chunking agent container.\n\nThis endpoint is called by chunking agent containers running in K8s jobs.\nThe agent POSTs chunks after processing completes.",
        "operationId": "upload_document_chunks_api_v1_documents__documentId__chunks_post",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChunksUploadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChunksUploadResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{documentId}/chunks/{chunkId}": {
      "get": {
        "tags": [
          "chunks",
          "workflow-agent"
        ],
        "summary": "Read Document Chunk",
        "description": "Read the full content of a specific chunk.\n\nAgents should use list_document_chunks first to discover available chunks,\nthen read specific chunks as needed for answering questions.",
        "operationId": "read_document_chunk",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "chunkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Chunkid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChunkResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{documentId}/chunks/search": {
      "get": {
        "tags": [
          "chunks",
          "workflow-agent"
        ],
        "summary": "Search Document Chunks",
        "description": "Search chunks by metadata filters (section, page, etc.).\n\nUseful for agents to narrow down relevant chunks before reading content.",
        "operationId": "search_document_chunks",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Documentid"
            }
          },
          {
            "name": "section",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by section title",
              "title": "Section"
            },
            "description": "Filter by section title"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by page number",
              "title": "Page"
            },
            "description": "Filter by page number"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChunkListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chunks/search": {
      "get": {
        "tags": [
          "chunks",
          "workflow-agent"
        ],
        "summary": "Hybrid Search Chunks",
        "description": "Hybrid search across chunks using BM25 + vector search.\n\nCombines keyword matching (BM25) with semantic similarity (vector embeddings)\nusing Reciprocal Rank Fusion to rank results. Searches across all documents\nthe user has access to within their company.\n\nReturns chunks with relevance scores, ordered by combined ranking.",
        "operationId": "hybrid_search_chunks",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Search query text",
              "title": "Query"
            },
            "description": "Search query text"
          },
          {
            "name": "document_ids",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by document IDs",
              "title": "Document Ids"
            },
            "description": "Filter by document IDs"
          },
          {
            "name": "matrix_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by matrix ID",
              "title": "Matrix Id"
            },
            "description": "Filter by matrix ID"
          },
          {
            "name": "entity_set_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by entity set ID",
              "title": "Entity Set Id"
            },
            "description": "Filter by entity set ID"
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of results to skip",
              "default": 0,
              "title": "Skip"
            },
            "description": "Number of results to skip"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Maximum results to return",
              "default": 10,
              "title": "Limit"
            },
            "description": "Maximum results to return"
          },
          {
            "name": "use_vector",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Enable vector search (default: true)",
              "default": true,
              "title": "Use Vector"
            },
            "description": "Enable vector search (default: true)"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChunkSearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/providers/": {
      "get": {
        "tags": [
          "ai-models-admin"
        ],
        "summary": "Get Ai Providers",
        "description": "Get all AI providers, optionally filtered to enabled only.",
        "operationId": "get_ai_providers_api_v1_admin_providers__get",
        "parameters": [
          {
            "name": "enabled_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Enabled Only"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AIProviderResponse"
                  },
                  "title": "Response Get Ai Providers Api V1 Admin Providers  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/providers/{providerId}": {
      "get": {
        "tags": [
          "ai-models-admin"
        ],
        "summary": "Get Ai Provider",
        "description": "Get an AI provider by ID.",
        "operationId": "get_ai_provider_api_v1_admin_providers__providerId__get",
        "parameters": [
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Providerid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIProviderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/models/": {
      "get": {
        "tags": [
          "ai-models-admin"
        ],
        "summary": "Get Ai Models",
        "description": "Get all AI models, optionally filtered by enabled status.",
        "operationId": "get_ai_models_api_v1_admin_models__get",
        "parameters": [
          {
            "name": "enabledOnly",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Enabledonly"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AIModelResponse"
                  },
                  "title": "Response Get Ai Models Api V1 Admin Models  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/providers/{providerId}/models/": {
      "get": {
        "tags": [
          "ai-models-admin"
        ],
        "summary": "Get Models By Provider",
        "description": "Get AI models for a specific provider, optionally filtered by enabled status.",
        "operationId": "get_models_by_provider_api_v1_admin_providers__providerId__models__get",
        "parameters": [
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Providerid"
            }
          },
          {
            "name": "enabledOnly",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Enabledonly"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AIModelResponse"
                  },
                  "title": "Response Get Models By Provider Api V1 Admin Providers  Providerid  Models  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/models/{modelId}": {
      "get": {
        "tags": [
          "ai-models-admin"
        ],
        "summary": "Get Ai Model",
        "description": "Get an AI model by ID with provider information.",
        "operationId": "get_ai_model_api_v1_admin_models__modelId__get",
        "parameters": [
          {
            "name": "modelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Modelid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AIModelResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/ai/providers": {
      "get": {
        "tags": [
          "ai-selection"
        ],
        "summary": "Get Available Providers",
        "description": "Get all enabled AI providers for frontend selection menus.",
        "operationId": "get_available_providers_api_v1_ai_providers_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AIProviderResponse"
                  },
                  "title": "Response Get Available Providers Api V1 Ai Providers Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/ai/models": {
      "get": {
        "tags": [
          "ai-selection"
        ],
        "summary": "Get Available Models",
        "description": "Get all enabled AI models with provider info for frontend selection menus.",
        "operationId": "get_available_models_api_v1_ai_models_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AIModelResponse"
                  },
                  "title": "Response Get Available Models Api V1 Ai Models Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/ai/providers/{providerId}/models": {
      "get": {
        "tags": [
          "ai-selection"
        ],
        "summary": "Get Models For Provider",
        "description": "Get all enabled AI models for a specific provider for frontend selection menus.",
        "operationId": "get_models_for_provider_api_v1_ai_providers__providerId__models_get",
        "parameters": [
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Providerid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AIModelResponse"
                  },
                  "title": "Response Get Models For Provider Api V1 Ai Providers  Providerid  Models Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows": {
      "post": {
        "tags": [
          "workflows"
        ],
        "summary": "Create Workflow",
        "description": "Create a new workflow.",
        "operationId": "create_workflow_api_v1_workflows_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/workflows": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "List Workflows",
        "description": "List all workflows for a workspace.",
        "operationId": "list_workflows_api_v1_workspaces__workspaceId__workflows_get",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspaceid"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkflowResponse"
                  },
                  "title": "Response List Workflows Api V1 Workspaces  Workspaceid  Workflows Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "Get Workflow",
        "description": "Get a workflow by ID.",
        "operationId": "get_workflow_api_v1_workflows__workflowId__get",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "workflows"
        ],
        "summary": "Update Workflow",
        "description": "Update a workflow.",
        "operationId": "update_workflow_api_v1_workflows__workflowId__patch",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "workflows"
        ],
        "summary": "Delete Workflow",
        "description": "Delete a workflow (soft delete).",
        "operationId": "delete_workflow_api_v1_workflows__workflowId__delete",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/execute": {
      "post": {
        "tags": [
          "workflows"
        ],
        "summary": "Execute Workflow",
        "description": "Execute a workflow.\n\nCreates an execution record and starts a Temporal workflow that will:\n1. Create a service account\n2. Launch a gVisor-sandboxed K8s pod with Claude Agent\n3. Monitor execution\n4. Extract generated files\n5. Clean up resources",
        "operationId": "execute_workflow_api_v1_workflows__workflowId__execute_post",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecutionTriggerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionStartedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/executions": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "List Executions",
        "description": "List all executions for a workflow.",
        "operationId": "list_executions_api_v1_workflows__workflowId__executions_get",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExecutionResponse"
                  },
                  "title": "Response List Executions Api V1 Workflows  Workflowid  Executions Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/executions/{executionId}": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "Get Execution",
        "description": "Get workflow execution status and results.",
        "operationId": "get_execution_api_v1_workflows__workflowId__executions__executionId__get",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "executionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Executionid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/executions/{executionId}/files": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "List Execution Files",
        "description": "List files generated by an execution.",
        "operationId": "list_execution_files_api_v1_workflows__workflowId__executions__executionId__files_get",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "executionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Executionid"
            }
          },
          {
            "name": "file_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "File Type"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExecutionFileResponse"
                  },
                  "title": "Response List Execution Files Api V1 Workflows  Workflowid  Executions  Executionid  Files Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "execution-uploads"
        ],
        "summary": "Upload Execution File",
        "description": "Upload an execution output file directly to storage.\n\nCalled by workflow agent to upload files after completion.",
        "operationId": "upload_execution_file_api_v1_workflows__workflowId__executions__executionId__files_post",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "executionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Executionid"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_execution_file_api_v1_workflows__workflowId__executions__executionId__files_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadFileResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/executions/{executionId}/files/{fileId}/download": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "Download Execution File",
        "description": "Download an execution file.",
        "operationId": "download_execution_file_api_v1_workflows__workflowId__executions__executionId__files__fileId__download_get",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "executionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Executionid"
            }
          },
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Fileid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/input-files": {
      "post": {
        "tags": [
          "workflows"
        ],
        "summary": "Upload Input File",
        "description": "Upload an input file (template, data file) for a workflow.",
        "operationId": "upload_input_file_api_v1_workflows__workflowId__input_files_post",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_input_file_api_v1_workflows__workflowId__input_files_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InputFileResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "List Input Files",
        "description": "List all input files for a workflow.",
        "operationId": "list_input_files_api_v1_workflows__workflowId__input_files_get",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InputFileResponse"
                  },
                  "title": "Response List Input Files Api V1 Workflows  Workflowid  Input Files Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/input-files/{fileId}/download": {
      "get": {
        "tags": [
          "workflows"
        ],
        "summary": "Download Input File",
        "description": "Download an input file.",
        "operationId": "download_input_file_api_v1_workflows__workflowId__input_files__fileId__download_get",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Fileid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/input-files/{fileId}": {
      "delete": {
        "tags": [
          "workflows"
        ],
        "summary": "Delete Input File",
        "description": "Delete an input file.",
        "operationId": "delete_input_file_api_v1_workflows__workflowId__input_files__fileId__delete",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Fileid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/executions/{executionId}/upload-urls": {
      "post": {
        "tags": [
          "execution-uploads"
        ],
        "summary": "Generate Upload Urls",
        "description": "Generate presigned upload URLs for execution output files.\n\nCalled by workflow agent after completing to get URLs for uploading files + manifest.",
        "operationId": "generate_upload_urls_api_v1_workflows__workflowId__executions__executionId__upload_urls_post",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "executionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Executionid"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateUploadUrlsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateUploadUrlsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows/{workflowId}/executions/{executionId}/manifest": {
      "post": {
        "tags": [
          "execution-uploads"
        ],
        "summary": "Upload Execution Manifest",
        "description": "Upload execution manifest JSON to storage.\n\nCalled by workflow agent after uploading all files.",
        "operationId": "upload_execution_manifest_api_v1_workflows__workflowId__executions__executionId__manifest_post",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflowid"
            }
          },
          {
            "name": "executionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Executionid"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadManifestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadManifestResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/conversations/": {
      "post": {
        "tags": [
          "agents"
        ],
        "summary": "Create Conversation",
        "description": "Create a new conversation.",
        "operationId": "create_conversation_api_v1_agents_conversations__post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "agents"
        ],
        "summary": "Get Active Conversations",
        "description": "Get all active conversations.",
        "operationId": "get_active_conversations_api_v1_agents_conversations__get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConversationResponse"
                  },
                  "title": "Response Get Active Conversations Api V1 Agents Conversations  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/conversations/{conversationId}": {
      "get": {
        "tags": [
          "agents"
        ],
        "summary": "Get Conversation",
        "description": "Get a conversation by ID.",
        "operationId": "get_conversation_api_v1_agents_conversations__conversationId__get",
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Conversationid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "agents"
        ],
        "summary": "Update Conversation",
        "description": "Update a conversation.",
        "operationId": "update_conversation_api_v1_agents_conversations__conversationId__patch",
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Conversationid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "agents"
        ],
        "summary": "Delete Conversation",
        "description": "Delete (deactivate) a conversation.",
        "operationId": "delete_conversation_api_v1_agents_conversations__conversationId__delete",
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Conversationid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/conversations/{conversationId}/messages/": {
      "get": {
        "tags": [
          "agents"
        ],
        "summary": "Get Conversation Messages",
        "description": "Get all messages for a conversation.",
        "operationId": "get_conversation_messages_api_v1_agents_conversations__conversationId__messages__get",
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Conversationid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MessageResponse"
                  },
                  "title": "Response Get Conversation Messages Api V1 Agents Conversations  Conversationid  Messages  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "agents"
        ],
        "summary": "Send Message To Agent",
        "description": "Send a message to the agent and get the response(s).",
        "operationId": "send_message_to_agent_api_v1_agents_conversations__conversationId__messages__post",
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Conversationid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MessageResponse"
                  },
                  "title": "Response Send Message To Agent Api V1 Agents Conversations  Conversationid  Messages  Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/conversations/{conversationId}/messages/manual/": {
      "post": {
        "tags": [
          "agents"
        ],
        "summary": "Add Manual Message",
        "description": "Manually add a message to a conversation (for testing/debugging).",
        "operationId": "add_manual_message_api_v1_agents_conversations__conversationId__messages_manual__post",
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Conversationid"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/tools/": {
      "get": {
        "tags": [
          "agents"
        ],
        "summary": "Get Available Tools",
        "description": "Get all available tools.",
        "operationId": "get_available_tools_api_v1_agents_tools__get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ToolDefinition"
                  },
                  "title": "Response Get Available Tools Api V1 Agents Tools  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/tools/openai-format/": {
      "get": {
        "tags": [
          "agents"
        ],
        "summary": "Get Tools Openai Format",
        "description": "Get tools in OpenAI function calling format.",
        "operationId": "get_tools_openai_format_api_v1_agents_tools_openai_format__get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents/tools/execute/": {
      "post": {
        "tags": [
          "agents"
        ],
        "summary": "Execute Tool",
        "description": "Execute a tool with the given parameters (for testing).",
        "operationId": "execute_tool_api_v1_agents_tools_execute__post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolExecutionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolExecutionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/status": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Get Subscription Status",
        "description": "Get current subscription status for the company.\n\nReturns subscription tier, status, and access information.\nIf no subscription exists, creates a FREE tier subscription.",
        "operationId": "get_subscription_status_api_v1_billing_status_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/usage": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Get Usage Stats",
        "description": "Get detailed usage statistics for the company.\n\nReturns current usage counts, limits, and percentages for all 4 quota types.\nIf no subscription exists, creates a FREE tier subscription.",
        "operationId": "get_usage_stats_api_v1_billing_usage_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageStatsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/quota/cell-operations": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Check Cell Operation Quota",
        "description": "Check current cell operation quota status.\n\nReturns detailed quota information for cell operations metric.\nRaises 429 if quota exceeded.",
        "operationId": "check_cell_operation_quota_api_v1_billing_quota_cell_operations_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotaStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/checkout": {
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Create Checkout Session",
        "description": "Create a Stripe checkout session or update existing subscription.\n\n- No subscription / FREE tier \u2192 Checkout session for new subscription\n- Paid tier \u2192 Update existing subscription (no new checkout)",
        "operationId": "create_checkout_session_api_v1_billing_checkout_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutSessionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/portal": {
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Create Portal Session",
        "description": "Create a Stripe customer portal session.\n\nAllows customers to manage payment methods, view invoices, cancel subscription.",
        "operationId": "create_portal_session_api_v1_billing_portal_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortalSessionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalSessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/upgrade": {
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Upgrade Tier",
        "description": "Upgrade subscription tier.\n\nOnly admin users can upgrade tiers.",
        "operationId": "upgrade_tier_api_v1_billing_upgrade_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeTierRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeTierResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/cancel": {
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Cancel Subscription",
        "description": "Cancel subscription.\n\nOnly admin users can cancel subscription.\nAccess continues until end of current billing period.",
        "operationId": "cancel_subscription_api_v1_billing_cancel_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelSubscriptionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AIModelResponse": {
        "properties": {
          "providerId": {
            "type": "integer",
            "title": "Providerid"
          },
          "modelName": {
            "type": "string",
            "title": "Modelname"
          },
          "displayName": {
            "type": "string",
            "title": "Displayname"
          },
          "defaultTemperature": {
            "type": "number",
            "title": "Defaulttemperature",
            "default": 0.7
          },
          "defaultMaxTokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Defaultmaxtokens"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          },
          "provider": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AIProviderResponse"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "providerId",
          "modelName",
          "displayName",
          "id",
          "createdAt",
          "updatedAt"
        ],
        "title": "AIModelResponse"
      },
      "AIProviderResponse": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "displayName": {
            "type": "string",
            "title": "Displayname"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          }
        },
        "type": "object",
        "required": [
          "name",
          "displayName",
          "id",
          "createdAt",
          "updatedAt"
        ],
        "title": "AIProviderResponse"
      },
      "AgentQAAnswerSetRequest": {
        "properties": {
          "matrix_cell_id": {
            "type": "integer",
            "title": "Matrix Cell Id",
            "description": "Matrix cell ID being answered"
          },
          "question_type_id": {
            "type": "integer",
            "title": "Question Type Id",
            "description": "Question type ID"
          },
          "answer_found": {
            "type": "boolean",
            "title": "Answer Found",
            "description": "Whether any answer was found in the documents"
          },
          "answers": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TextAnswerData"
                },
                {
                  "$ref": "#/components/schemas/DateAnswerData"
                },
                {
                  "$ref": "#/components/schemas/CurrencyAnswerData"
                },
                {
                  "$ref": "#/components/schemas/SelectAnswerData"
                }
              ]
            },
            "type": "array",
            "title": "Answers",
            "description": "List of answers found (TextAnswerData, DateAnswerData, CurrencyAnswerData, or SelectAnswerData)"
          }
        },
        "type": "object",
        "required": [
          "matrix_cell_id",
          "question_type_id",
          "answer_found"
        ],
        "title": "AgentQAAnswerSetRequest",
        "description": "Request body for agent QA answer upload.\n\nThis schema reuses the existing domain models (TextAnswerData, DateAnswerData, etc.)\ndefined in packages.qa.models.domain.answer_data.\n\nThe agent container receives these parameters from the workflow and includes them\nin the upload request."
      },
      "AgentQAAnswerUploadResponse": {
        "properties": {
          "qa_job_id": {
            "type": "integer",
            "title": "Qa Job Id"
          },
          "matrix_cell_id": {
            "type": "integer",
            "title": "Matrix Cell Id"
          },
          "answer_count": {
            "type": "integer",
            "title": "Answer Count"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "default": "Answer uploaded successfully"
          }
        },
        "type": "object",
        "required": [
          "qa_job_id",
          "matrix_cell_id",
          "answer_count"
        ],
        "title": "AgentQAAnswerUploadResponse",
        "description": "Response after successfully uploading agent QA answer."
      },
      "AnswerWithCitations": {
        "properties": {
          "answerData": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TextAnswerDataResponse"
              },
              {
                "$ref": "#/components/schemas/DateAnswerDataResponse"
              },
              {
                "$ref": "#/components/schemas/CurrencyAnswerDataResponse"
              },
              {
                "$ref": "#/components/schemas/SelectAnswerDataResponse"
              }
            ],
            "title": "Answerdata"
          },
          "citations": {
            "items": {
              "$ref": "#/components/schemas/CitationMinimalResponse"
            },
            "type": "array",
            "title": "Citations",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "answerData"
        ],
        "title": "AnswerWithCitations",
        "description": "Wrapper that combines answer data with its citations."
      },
      "Body_upload_document_api_v1_matrices__matrixId__documents__post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_document_api_v1_matrices__matrixId__documents__post"
      },
      "Body_upload_execution_file_api_v1_workflows__workflowId__executions__executionId__files_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_execution_file_api_v1_workflows__workflowId__executions__executionId__files_post"
      },
      "Body_upload_input_file_api_v1_workflows__workflowId__input_files_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_input_file_api_v1_workflows__workflowId__input_files_post"
      },
      "Body_upload_standalone_document_api_v1_documents__post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_standalone_document_api_v1_documents__post"
      },
      "BulkUrlUploadRequest": {
        "properties": {
          "urls": {
            "items": {
              "type": "string",
              "maxLength": 2083,
              "minLength": 1,
              "format": "uri"
            },
            "type": "array",
            "title": "Urls"
          }
        },
        "type": "object",
        "required": [
          "urls"
        ],
        "title": "BulkUrlUploadRequest"
      },
      "BulkUrlUploadResponse": {
        "properties": {
          "documents": {
            "items": {
              "$ref": "#/components/schemas/DocumentResponse"
            },
            "type": "array",
            "title": "Documents"
          },
          "errors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Errors"
          }
        },
        "type": "object",
        "required": [
          "documents",
          "errors"
        ],
        "title": "BulkUrlUploadResponse"
      },
      "CancelSubscriptionResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "cancelled_at": {
            "type": "string",
            "format": "date-time",
            "title": "Cancelled At"
          },
          "access_until": {
            "type": "string",
            "format": "date-time",
            "title": "Access Until",
            "description": "Date until which company retains access"
          }
        },
        "type": "object",
        "required": [
          "success",
          "message",
          "cancelled_at",
          "access_until"
        ],
        "title": "CancelSubscriptionResponse",
        "description": "Response after subscription cancellation."
      },
      "ChatCompletionMessageToolCall": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "function": {
            "$ref": "#/components/schemas/Function"
          },
          "type": {
            "type": "string",
            "const": "function",
            "title": "Type"
          }
        },
        "type": "object",
        "required": [
          "id",
          "function",
          "type"
        ],
        "title": "ChatCompletionMessageToolCall",
        "description": "Represents a tool call in a chat completion message."
      },
      "CheckoutSessionRequest": {
        "properties": {
          "tier": {
            "$ref": "#/components/schemas/SubscriptionTier"
          },
          "success_url": {
            "type": "string",
            "maxLength": 2083,
            "minLength": 1,
            "format": "uri",
            "title": "Success Url"
          },
          "cancel_url": {
            "type": "string",
            "maxLength": 2083,
            "minLength": 1,
            "format": "uri",
            "title": "Cancel Url"
          },
          "billing_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Email"
          },
          "trial_period_days": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 90.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Period Days",
            "description": "Number of trial days (1-90). If not provided, no trial period."
          }
        },
        "type": "object",
        "required": [
          "tier",
          "success_url",
          "cancel_url"
        ],
        "title": "CheckoutSessionRequest",
        "description": "Request to create a checkout session."
      },
      "CheckoutSessionResponse": {
        "properties": {
          "checkout_url": {
            "type": "string",
            "title": "Checkout Url",
            "description": "Stripe checkout session URL"
          }
        },
        "type": "object",
        "required": [
          "checkout_url"
        ],
        "title": "CheckoutSessionResponse",
        "description": "Response with checkout URL."
      },
      "ChunkListResponse": {
        "properties": {
          "document_id": {
            "type": "integer",
            "title": "Document Id",
            "description": "Document ID"
          },
          "total_chunks": {
            "type": "integer",
            "title": "Total Chunks",
            "description": "Total number of chunks"
          },
          "chunks": {
            "items": {
              "$ref": "#/components/schemas/ChunkMetadataResponse"
            },
            "type": "array",
            "title": "Chunks",
            "description": "List of chunk metadata"
          }
        },
        "type": "object",
        "required": [
          "document_id",
          "total_chunks",
          "chunks"
        ],
        "title": "ChunkListResponse",
        "description": "Response for list of chunks with manifest."
      },
      "ChunkMetadataResponse": {
        "properties": {
          "chunk_id": {
            "type": "string",
            "title": "Chunk Id",
            "description": "Unique chunk identifier"
          },
          "section": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Section",
            "description": "Section title if available"
          },
          "page_range": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Range",
            "description": "Page range (e.g., '1-3')"
          },
          "page_start": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Start",
            "description": "Starting page number"
          },
          "page_end": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page End",
            "description": "Ending page number"
          },
          "char_start": {
            "type": "integer",
            "title": "Char Start",
            "description": "Character position in original document"
          },
          "char_end": {
            "type": "integer",
            "title": "Char End",
            "description": "Character end position in original document"
          },
          "overlap_prev": {
            "type": "boolean",
            "title": "Overlap Prev",
            "description": "Has overlap with previous chunk",
            "default": false
          },
          "overlap_next": {
            "type": "boolean",
            "title": "Overlap Next",
            "description": "Has overlap with next chunk",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "chunk_id",
          "char_start",
          "char_end"
        ],
        "title": "ChunkMetadataResponse",
        "description": "Metadata for a single chunk without content."
      },
      "ChunkResponse": {
        "properties": {
          "chunk_id": {
            "type": "string",
            "title": "Chunk Id",
            "description": "Unique chunk identifier"
          },
          "document_id": {
            "type": "integer",
            "title": "Document Id",
            "description": "Parent document ID"
          },
          "content": {
            "type": "string",
            "title": "Content",
            "description": "Chunk text content"
          },
          "metadata": {
            "$ref": "#/components/schemas/ChunkMetadataResponse",
            "description": "Chunk metadata"
          }
        },
        "type": "object",
        "required": [
          "chunk_id",
          "document_id",
          "content",
          "metadata"
        ],
        "title": "ChunkResponse",
        "description": "Full chunk response with content."
      },
      "ChunkSearchHitResponse": {
        "properties": {
          "chunk_id": {
            "type": "string",
            "title": "Chunk Id",
            "description": "Unique chunk identifier"
          },
          "document_id": {
            "type": "integer",
            "title": "Document Id",
            "description": "Parent document ID"
          },
          "content": {
            "type": "string",
            "title": "Content",
            "description": "Chunk text content"
          },
          "score": {
            "type": "number",
            "title": "Score",
            "description": "Relevance score from hybrid search"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata",
            "description": "Chunk metadata"
          }
        },
        "type": "object",
        "required": [
          "chunk_id",
          "document_id",
          "content",
          "score",
          "metadata"
        ],
        "title": "ChunkSearchHitResponse",
        "description": "Single chunk search result with score."
      },
      "ChunkSearchResponse": {
        "properties": {
          "query": {
            "type": "string",
            "title": "Query",
            "description": "Search query text"
          },
          "total_count": {
            "type": "integer",
            "title": "Total Count",
            "description": "Total number of results found"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "description": "Whether more results are available"
          },
          "chunks": {
            "items": {
              "$ref": "#/components/schemas/ChunkSearchHitResponse"
            },
            "type": "array",
            "title": "Chunks",
            "description": "Search results"
          }
        },
        "type": "object",
        "required": [
          "query",
          "total_count",
          "has_more",
          "chunks"
        ],
        "title": "ChunkSearchResponse",
        "description": "Response for hybrid chunk search."
      },
      "ChunkUploadItem": {
        "properties": {
          "chunk_id": {
            "type": "string",
            "title": "Chunk Id",
            "description": "Unique chunk identifier"
          },
          "content": {
            "type": "string",
            "title": "Content",
            "description": "Chunk text content"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata",
            "description": "Chunk metadata"
          }
        },
        "type": "object",
        "required": [
          "chunk_id",
          "content",
          "metadata"
        ],
        "title": "ChunkUploadItem",
        "description": "Single chunk data for upload from chunking agent."
      },
      "ChunksUploadRequest": {
        "properties": {
          "document_id": {
            "type": "integer",
            "title": "Document Id",
            "description": "Document ID"
          },
          "company_id": {
            "type": "integer",
            "title": "Company Id",
            "description": "Company ID"
          },
          "chunks": {
            "items": {
              "$ref": "#/components/schemas/ChunkUploadItem"
            },
            "type": "array",
            "title": "Chunks",
            "description": "List of chunks to upload"
          }
        },
        "type": "object",
        "required": [
          "document_id",
          "company_id",
          "chunks"
        ],
        "title": "ChunksUploadRequest",
        "description": "Request body for uploading chunks from chunking agent."
      },
      "ChunksUploadResponse": {
        "properties": {
          "document_id": {
            "type": "integer",
            "title": "Document Id",
            "description": "Document ID"
          },
          "chunk_count": {
            "type": "integer",
            "title": "Chunk Count",
            "description": "Number of chunks uploaded"
          },
          "s3_prefix": {
            "type": "string",
            "title": "S3 Prefix",
            "description": "S3 prefix where chunks are stored"
          }
        },
        "type": "object",
        "required": [
          "document_id",
          "chunk_count",
          "s3_prefix"
        ],
        "title": "ChunksUploadResponse",
        "description": "Response for chunk upload."
      },
      "CitationMinimalResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "citationOrder": {
            "type": "integer",
            "title": "Citationorder"
          },
          "documentId": {
            "type": "integer",
            "title": "Documentid"
          },
          "quoteText": {
            "type": "string",
            "title": "Quotetext"
          }
        },
        "type": "object",
        "required": [
          "id",
          "citationOrder",
          "documentId",
          "quoteText"
        ],
        "title": "CitationMinimalResponse",
        "description": "Minimal citation response with just ID and order for frontend hyperlinks."
      },
      "CitationReference": {
        "properties": {
          "citation_number": {
            "type": "integer",
            "title": "Citation Number"
          },
          "quote_text": {
            "type": "string",
            "title": "Quote Text"
          },
          "document_id": {
            "type": "integer",
            "title": "Document Id"
          }
        },
        "type": "object",
        "required": [
          "citation_number",
          "quote_text",
          "document_id"
        ],
        "title": "CitationReference",
        "description": "Model for inline citation references in answer text."
      },
      "ConversationCreate": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "extraData": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extradata"
          },
          "aiModelId": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Aimodelid"
          }
        },
        "type": "object",
        "title": "ConversationCreate"
      },
      "ConversationResponse": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "extraData": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extradata"
          },
          "aiModelId": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Aimodelid"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "isActive": {
            "type": "boolean",
            "title": "Isactive",
            "default": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Createdat"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updatedat"
          }
        },
        "type": "object",
        "required": [
          "id",
          "createdAt",
          "updatedAt"
        ],
        "title": "ConversationResponse"
      },
      "ConversationUpdate": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "extraData": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extradata"
          },
          "aiModelId": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Aimodelid"
          },
          "isActive": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Isactive"
          }
        },
        "type": "object",
        "title": "ConversationUpdate"
      },
      "CurrencyAnswerData": {
        "properties": {
          "type": {
            "type": "string",
            "title": "Type",
            "default": "currency"
          },
          "value": {
            "type": "string",
            "title": "Value"
          },
          "amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "confidence": {
            "type": "number",
            "title": "Confidence",
            "default": 1.0
          },
          "citations": {
            "items": {
              "$ref": "#/components/schemas/CitationReference"
            },
            "type": "array",
            "title": "Citations",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "value"
        ],
        "title": "CurrencyAnswerData",
        "description": "Domain model for CURRENCY question type."
      },
      "CurrencyAnswerDataResponse": {
        "properties": {
          "type": {
            "type": "string",
            "title": "Type",
            "default": "currency"
          },
          "value": {
            "type": "string",
            "title": "Value"
          },
          "amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "confidence": {
            "type": "number",
            "title": "Confidence",
            "default": 1.0
          }
        },
        "type": "object",
        "required": [
          "value"
        ],
        "title": "CurrencyAnswerDataResponse",
        "description": "Answer data for CURRENCY question type."
      },
      "DateAnswerData": {
        "properties": {
          "type": {
            "type": "string",
            "title": "Type",
            "default": "date"
          },
          "value": {
            "type": "string",
            "title": "Value"
          },
          "parsed_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parsed Date"
          },
          "confidence": {
            "type": "number",
            "title": "Confidence",
            "default": 1.0
          },
          "citations": {
            "items": {
              "$ref": "#/components/schemas/CitationReference"
            },
            "type": "array",
            "title": "Citations",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "value"
        ],
        "title": "DateAnswerData",
        "description": "Domain model for DATE question type."
      },
      "DateAnswerDataResponse": {
        "properties": {
          "type": {
            "type": "string",
            "title": "Type",
            "default": "date"
          },
          "value": {
            "type": "string",
            "title": "Value"
          },
          "parsedDate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parseddate"