{"openapi":"3.0.3","info":{"title":"GoOmni AI","description":"AI-powered project management, quality assurance, and knowledge platform.\n\n**Base URL:** `https://agent.goomni.ai` &nbsp;|&nbsp; **Auth:** `Authorization: Bearer <jwt>`\n","version":"1.0.0","contact":{"name":"GoOmni API Support","url":"https://goomni.ai"},"license":{"name":"Proprietary","url":"https://goomni.ai/terms"}},"servers":[{"url":"https://agent.goomni.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local Development"}],"tags":[{"name":"Knowledge Bases","description":"**AI-powered document stores** under an organization. Upload files, crawl websites,\nor connect Google Drive. Content is chunked, embedded, and indexed for semantic search.\n"},{"name":"Knowledge Base Files","description":"Upload, list, preview, delete, and retry files within a knowledge base"},{"name":"Knowledge Base Search","description":"Semantic search (RAG) across knowledge base content"},{"name":"Files","description":"File upload, download, and processing"},{"name":"Search","description":"Unified search across projects and knowledge bases"},{"name":"Ontology","description":"Entity and relationship extraction (knowledge graph)"}],"security":[{"bearerAuth":[]}],"components":{"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Organization ID (top-level tenant identifier)"},"projectId":{"name":"projectId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Project ID (scoped workspace within an organization)"},"kbId":{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Knowledge Base ID"}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token from NextAuth/Cognito authentication"}},"schemas":{"AnalyticsWebsite":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"domain":{"type":"string","nullable":true},"organizationId":{"type":"string","format":"uuid"},"teamId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"CollectRequest":{"type":"object","required":["type","payload"],"properties":{"type":{"type":"string","enum":["event","identify"],"description":"`event` records a pageview or custom event. `identify` attaches\nsession properties via the session_data pipeline.\n"},"payload":{"type":"object","required":["website"],"properties":{"website":{"type":"string","format":"uuid","description":"Website ID from the analytics console (tracker site key)."},"url":{"type":"string"},"title":{"type":"string"},"referrer":{"type":"string"},"hostname":{"type":"string"},"language":{"type":"string"},"screen":{"type":"string"},"name":{"type":"string","description":"Custom event name (omit for pageviews)."},"specialEventName":{"type":"string"},"tag":{"type":"string","nullable":true},"data":{"type":"object","additionalProperties":true,"description":"Custom event properties."},"session":{"type":"object","additionalProperties":true}}}}},"RecordRequest":{"type":"object","required":["type","payload"],"properties":{"type":{"type":"string","enum":["record"]},"payload":{"type":"object","required":["website","events"],"properties":{"website":{"type":"string","format":"uuid"},"events":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","description":"rrweb recording chunk events."}},"timestamp":{"type":"integer","format":"int64"}}}}},"Heatmap":{"type":"object","properties":{"heatmapId":{"type":"string","format":"uuid"},"websiteId":{"type":"string","format":"uuid"},"urlPath":{"type":"string"},"device":{"type":"string","enum":["desktop","mobile","tablet"]},"status":{"type":"string","enum":["pending","building","ready","failed"]},"windowStart":{"type":"string","format":"date-time"},"windowEnd":{"type":"string","format":"date-time"}}},"ReplaySessionSummary":{"type":"object","properties":{"replaySessionId":{"type":"string"},"websiteId":{"type":"string","format":"uuid"},"sessionId":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"},"durationMs":{"type":"integer"},"eventCount":{"type":"integer"},"errorCount":{"type":"integer"},"rageClickCount":{"type":"integer"},"deadClickCount":{"type":"integer"},"device":{"type":"string"},"browser":{"type":"string"},"country":{"type":"string"},"landingUrl":{"type":"string"},"exitUrl":{"type":"string"},"status":{"type":"string","enum":["recording","finalized","failed",""]},"qualityScore":{"type":"number"},"chunkCount":{"type":"integer"},"playable":{"type":"boolean"}}},"Experiment":{"type":"object","properties":{"experimentId":{"type":"string","format":"uuid"},"websiteId":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","running","paused","completed","archived"]},"hypothesis":{"type":"string"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"weight":{"type":"number"},"isControl":{"type":"boolean"}}}}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"Organization":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","description":"Unique organization identifier"},"name":{"type":"string","example":"Acme Corp"},"slug":{"type":"string","example":"acme-corp","description":"URL-friendly identifier"},"tier":{"type":"string","enum":["startup","growth","enterprise"]},"billingEmail":{"type":"string","format":"email"},"settings":{"type":"object","properties":{"chatModel":{"type":"string"},"chatTemperature":{"type":"number"},"maxMembers":{"type":"integer"},"maxProjects":{"type":"integer"},"maxStorage":{"type":"integer"},"allowPublicKBs":{"type":"boolean"},"customBranding":{"type":"boolean"}}},"googleDriveLinked":{"type":"boolean"},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Project":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","description":"Unique project identifier"},"organizationId":{"type":"string","format":"uuid","description":"Parent organization"},"name":{"type":"string","example":"Q1 2026 Government RFP"},"description":{"type":"string"},"templateId":{"type":"string"},"templateType":{"type":"string","enum":["rfp","migration","qa","blank"]},"knowledgeBaseIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Linked knowledge bases providing context for this project"},"agentConfigs":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"agentType":{"type":"string"},"enabled":{"type":"boolean"},"order":{"type":"integer"},"config":{"type":"object"}}}},"status":{"type":"string","enum":["active","archived","deleted"]},"stats":{"type":"object","properties":{"fileCount":{"type":"integer"},"agentRunCount":{"type":"integer"},"lastActivityAt":{"type":"string","format":"date-time"}}},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"KnowledgeBase":{"type":"object","properties":{"kbId":{"type":"string","format":"uuid","description":"Unique knowledge base identifier"},"organizationId":{"type":"string","format":"uuid","description":"Parent organization"},"name":{"type":"string","example":"Company Training Materials"},"description":{"type":"string"},"type":{"type":"string","enum":["drive_folders","manual_files","integration","website"],"description":"How content is ingested"},"isPublic":{"type":"boolean","description":"Whether KB is publicly searchable"},"publicSlug":{"type":"string"},"fileCount":{"type":"integer"},"totalSizeBytes":{"type":"integer"},"embeddingModel":{"type":"string"},"status":{"type":"string","enum":["active","indexing","error","archived"]},"masterContext":{"type":"string","description":"AI-generated summary of all KB content"},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"KnowledgeBaseCreate":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"Company Policies"},"description":{"type":"string","example":"Internal company policies and procedures"},"isPublic":{"type":"boolean","default":false}}},"FileUpload":{"type":"object","properties":{"fileId":{"type":"string","format":"uuid"},"fileName":{"type":"string"},"fileType":{"type":"string"},"fileSize":{"type":"integer"},"status":{"type":"string","enum":["uploaded","processing","indexed","error"]},"createdAt":{"type":"string","format":"date-time"}}},"SearchRequest":{"type":"object","required":["question"],"properties":{"question":{"type":"string","description":"The search question to ask the knowledge base","example":"What is our refund policy?"},"conversationHistory":{"type":"array","items":{"type":"object"},"description":"Previous conversation messages for context"},"enableWebSearch":{"type":"boolean","default":false},"stream":{"type":"boolean","default":false},"limit":{"type":"integer","minimum":1,"maximum":200,"default":10,"description":"Maximum number of source chunks to return. In non-streaming mode this\nis also the page size unless `perPage` is provided. Capped at 200 per\nrequest; use `page` to retrieve additional results.\n"},"page":{"type":"integer","minimum":1,"default":1,"description":"1-indexed page number for paginating through source results.\nNon-streaming mode only. The total crawl depth (page × perPage) is\ncapped at 1000 sources per query.\n"},"perPage":{"type":"integer","minimum":1,"maximum":200,"description":"Page size for pagination. Defaults to `limit` if not provided.\nNon-streaming mode only.\n"}}},"SearchPagination":{"type":"object","properties":{"page":{"type":"integer","description":"Current 1-indexed page"},"perPage":{"type":"integer","description":"Page size used for this response"},"total":{"type":"integer","description":"Total source chunks retrieved across all pages for this query\n(bounded by the 1000-source crawl cap).\n"},"hasMore":{"type":"boolean","description":"True if additional pages may exist"}}},"SearchResponse":{"type":"object","properties":{"answer":{"type":"string","description":"LLM-generated answer (always reflects the top source set, even when you page through results)"},"sources":{"type":"array","items":{"type":"object"}},"entities":{"type":"array","items":{"type":"object"}},"relationships":{"type":"array","items":{"type":"object"}},"question":{"type":"string"},"kbName":{"type":"string"},"pagination":{"$ref":"#/components/schemas/SearchPagination"}}},"SearchResult":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"chunkId":{"type":"string"},"content":{"type":"string"},"score":{"type":"number","format":"float"},"metadata":{"type":"object","properties":{"fileName":{"type":"string"},"fileId":{"type":"string"},"pageNumber":{"type":"integer"}}}}}},"totalResults":{"type":"integer"}}},"Integration":{"type":"object","properties":{"integrationId":{"type":"string"},"type":{"type":"string","enum":["twilio","hubspot","google-drive"]},"status":{"type":"string","enum":["active","inactive","error"]},"config":{"type":"object"}}},"PublicTestStep":{"type":"object","required":["stepNumber","action","expectedResult"],"properties":{"stepNumber":{"type":"integer"},"action":{"type":"string","description":"Prose instruction (e.g. \"Click the Sign Up button\")"},"expectedResult":{"type":"string","description":"Verification target (e.g. \"User is redirected to /verify-email\")"},"testData":{"type":"string"}}},"PublicTestCase":{"type":"object","required":["id","title"],"properties":{"id":{"type":"string","example":"TC-001"},"title":{"type":"string"},"description":{"type":"string"},"objective":{"type":"string"},"testBasis":{"type":"string","description":"Source requirement (e.g. user story ID)"},"testCondition":{"type":"string"},"designTechnique":{"type":"string","example":"equivalence-partitioning"},"testLevel":{"type":"string","enum":["unit","integration","system","acceptance"],"default":"system"},"testType":{"type":"string","enum":["functional","regression","integration","e2e","accessibility","security","performance","boundary","negative","smoke"],"default":"functional"},"preconditions":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/PublicTestStep"}},"expectedResult":{"type":"string"},"postconditions":{"type":"array","items":{"type":"string"}},"priority":{"type":"string","enum":["critical","high","medium","low"],"default":"medium"},"riskLevel":{"type":"string"},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"requirementRef":{"type":"string"},"gherkin":{"type":"string"},"estimatedDuration":{"type":"string"}}},"PublicConversationTurn":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"testCaseCount":{"type":"integer"}}},"PublicSessionDetail":{"type":"object","properties":{"sessionId":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"requirements":{"type":"string"},"scope":{"type":"string"},"format":{"type":"string"},"maxTestCases":{"type":"integer"},"uploadedFileName":{"type":"string"},"conversation":{"type":"array","items":{"$ref":"#/components/schemas/PublicConversationTurn"}},"testCases":{"type":"array","items":{"$ref":"#/components/schemas/PublicTestCase"}},"summary":{"type":"object"},"events":{"type":"array","items":{"type":"object"}},"totalTestCases":{"type":"integer"},"totalIterations":{"type":"integer"},"totalToolCalls":{"type":"integer"},"turnCount":{"type":"integer"},"latestExecutionId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"PublicStepResult":{"type":"object","properties":{"stepNumber":{"type":"integer"},"action":{"type":"string"},"status":{"type":"string","enum":["passed","failed","error","skipped"]},"durationMs":{"type":"integer"},"screenshotKey":{"type":"string","description":"S3 key of the post-step screenshot (use the parent case's screenshotUrls for signed URL)"},"error":{"type":"string"},"interpretedAction":{"type":"object","description":"The typed browser action Claude derived from the prose step.\nShape varies by action, examples below:\n","example":{"type":"click","selector":"button:has-text('Sign Up')"}}}},"TestCase":{"type":"object","properties":{"id":{"type":"string","example":"TC-001"},"title":{"type":"string","example":"Verify login with valid credentials"},"description":{"type":"string"},"preconditions":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","items":{"type":"object","properties":{"stepNumber":{"type":"integer"},"action":{"type":"string"},"expectedResult":{"type":"string"},"testData":{"type":"string"}}}},"expectedResult":{"type":"string"},"priority":{"type":"string","enum":["critical","high","medium","low"]},"type":{"type":"string","enum":["functional","regression","integration","e2e","accessibility","security","performance","boundary","negative","smoke"]},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"requirementRef":{"type":"string","description":"Source requirement ID for traceability"},"gherkin":{"type":"string","description":"Given/When/Then syntax (when format is gherkin)"},"estimatedDuration":{"type":"string","example":"5min"}}},"Requirement":{"type":"object","properties":{"id":{"type":"string","example":"REQ-001"},"statement":{"type":"string","example":"The system shall authenticate users via username and password"},"category":{"type":"string","enum":["functional","security","performance","accessibility","usability","reliability"]},"subcategory":{"type":"string"},"priority":{"type":"string","enum":["critical","high","medium","low"]},"testability":{"type":"string","enum":["high","medium","low"]},"testabilityNotes":{"type":"string"},"suggestedTestType":{"type":"string"},"acceptanceCriteria":{"type":"array","items":{"type":"string"}},"ambiguities":{"type":"array","items":{"type":"string"}},"dependencies":{"type":"array","items":{"type":"string"}},"source":{"type":"string"}}},"RfpAnalysisRequest":{"type":"object","required":["projectId"],"properties":{"projectId":{"type":"string","description":"Project containing RFP files"},"kbIds":{"type":"array","items":{"type":"string"},"description":"Knowledge base IDs for company context"}}},"RfpSection":{"type":"object","properties":{"sectionId":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"order":{"type":"integer"},"status":{"type":"string","enum":["draft","generated","reviewed","final"]}}},"AgentChainRequest":{"type":"object","required":["projectId","organizationId"],"properties":{"projectId":{"type":"string"},"organizationId":{"type":"string"},"agents":{"type":"array","items":{"type":"string","enum":["analysis","assessment","research","win-themes","writer","qa"]},"description":"Agents to run (defaults to full chain)"},"companyKbIds":{"type":"array","items":{"type":"string"},"description":"Company knowledge base IDs for context"}}},"OpportunityScanRequest":{"type":"object","required":["filterId"],"properties":{"filterId":{"type":"string","description":"Search filter ID defining scan criteria"},"organizationId":{"type":"string"},"projectId":{"type":"string"}}},"Opportunity":{"type":"object","properties":{"opportunityId":{"type":"string"},"title":{"type":"string"},"agency":{"type":"string"},"postedDate":{"type":"string","format":"date"},"dueDate":{"type":"string","format":"date"},"estimatedValue":{"type":"number"},"naicsCode":{"type":"string"},"setAside":{"type":"string"},"sourceUrl":{"type":"string"},"qualificationScore":{"type":"number","format":"float"},"status":{"type":"string","enum":["new","qualified","reviewed","applied","won","lost"]}}},"NormalizedTicket":{"type":"object","properties":{"externalId":{"type":"string","description":"Platform-specific ID (e.g. PROJ-42 for Jira, gid for Asana)"},"platform":{"type":"string","enum":["asana","jira","linear","azure_devops"]},"url":{"type":"string","format":"uri"},"title":{"type":"string"},"description":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string","enum":["critical","high","medium","low"]},"type":{"type":"string"},"assignee":{"type":"string"},"labels":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"parentId":{"type":"string"},"subtaskIds":{"type":"array","items":{"type":"string"}},"storyPoints":{"type":"integer"},"customFields":{"type":"object"}}},"GeneratedTicket":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["feature","bug","task","spike"]},"priority":{"type":"string","enum":["critical","high","medium","low"]},"acceptanceCriteria":{"type":"array","items":{"type":"string"}},"storyPoints":{"type":"integer"},"labels":{"type":"array","items":{"type":"string"}},"relatedTicketIds":{"type":"array","items":{"type":"string"}}}},"TicketSyncResult":{"type":"object","properties":{"integrationId":{"type":"string"},"platform":{"type":"string"},"totalFetched":{"type":"integer"},"newTickets":{"type":"integer"},"updatedTickets":{"type":"integer"},"errors":{"type":"array","items":{"type":"string"}},"syncedAt":{"type":"string","format":"date-time"}}},"VoiceCall":{"type":"object","properties":{"callId":{"type":"string"},"kbId":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"fromNumber":{"type":"string"},"toNumber":{"type":"string"},"status":{"type":"string","enum":["initiated","ringing","in-progress","completed","failed"]},"duration":{"type":"integer","description":"Call duration in seconds"},"transcript":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"OutboundCallRequest":{"type":"object","required":["kbId","phoneNumber"],"properties":{"kbId":{"type":"string","format":"uuid","description":"Knowledge base ID (determines which voice agent handles the call)"},"phoneNumber":{"type":"string","description":"Phone number to call (E.164 format)","example":"+12125551234"},"metadata":{"type":"object","properties":{"contactName":{"type":"string"},"campaignId":{"type":"string"}}}}},"VoiceTool":{"type":"object","properties":{"toolId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["lead-collection","search-faq","hubspot-meeting-booking","hubspot-meeting-availability","retrieve-kb-info","custom"]},"description":{"type":"string"},"config":{"type":"object"},"kbIds":{"type":"array","items":{"type":"string"}}}},"Campaign":{"type":"object","properties":{"campaignId":{"type":"string"},"name":{"type":"string"},"kbId":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","completed"]},"totalContacts":{"type":"integer"},"contactsCalled":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"}}}}},"paths":{"/api/knowledge-bases":{"get":{"tags":["Knowledge Bases"],"summary":"List knowledge bases","description":"Returns all knowledge bases for the authenticated user's organization.","responses":{"200":{"description":"List of knowledge bases","content":{"application/json":{"schema":{"type":"object","properties":{"knowledgeBases":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBase"}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Knowledge Bases"],"summary":"Create knowledge base","description":"Creates a new knowledge base. Files can be uploaded after creation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseCreate"}}}},"responses":{"201":{"description":"Knowledge base created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}}}}},"/api/knowledge-bases/{id}":{"get":{"tags":["Knowledge Bases"],"summary":"Get knowledge base","responses":{"200":{"description":"Knowledge base details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}}}},"patch":{"tags":["Knowledge Bases"],"summary":"Update knowledge base","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"isPublic":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Updated knowledge base"}}},"delete":{"tags":["Knowledge Bases"],"summary":"Delete knowledge base","responses":{"200":{"description":"Knowledge base deleted"}}}},"/api/knowledge-bases/{id}/files":{"get":{"tags":["Knowledge Base Files"],"summary":"List files in knowledge base","responses":{"200":{"description":"List of files","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"$ref":"#/components/schemas/FileUpload"}}}}}}}}},"post":{"tags":["Knowledge Base Files"],"summary":"Upload file to knowledge base","description":"Upload a file to be processed and indexed. Supported formats:\nPDF, DOCX, XLSX, PPTX, HTML, TXT, MD, images (PNG/JPG), and emails.\n\nThe file goes through the processing pipeline:\nExtract → Chunk → Embed → Index\n\nProcessing is asynchronous. Poll the file status or use webhooks.\n","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"File uploaded and processing started","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUpload"}}}}}}},"/api/knowledge-bases/{id}/search":{"post":{"tags":["Knowledge Base Search"],"summary":"Semantic search in knowledge base","description":"Performs semantic (vector) search across all indexed content in the knowledge base.\nUses hybrid search combining dense embeddings with keyword matching.\nResults include relevance scores and source metadata.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResult"}}}}}}},"/api/knowledge-bases/{id}/index":{"post":{"tags":["Knowledge Base Files"],"summary":"Trigger knowledge base indexing","description":"Re-indexes all files in the knowledge base.","responses":{"200":{"description":"Indexing started"}}}},"/api/knowledge-bases/{id}/share":{"get":{"tags":["Knowledge Bases"],"summary":"List shares for knowledge base","responses":{"200":{"description":"List of organizations this KB is shared with"}}},"post":{"tags":["Knowledge Bases"],"summary":"Share knowledge base with organization","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["targetOrgId"],"properties":{"targetOrgId":{"type":"string"},"permission":{"type":"string","enum":["read","write"],"default":"read"}}}}}},"responses":{"200":{"description":"KB shared"}}}},"/api/public/kb/{kbId}":{"get":{"tags":["Knowledge Bases"],"summary":"Get public knowledge base","description":"Retrieve metadata for a public knowledge base (no auth required).","security":[],"responses":{"200":{"description":"Public KB metadata"}}}},"/api/public/kb/{kbId}/search":{"post":{"tags":["Knowledge Base Search"],"summary":"Search public knowledge base","description":"Search a public knowledge base (no auth, rate-limited by IP).","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Search results"}}}},"/api/knowledge-bases/{id}/files/{fileId}/preview":{"get":{"tags":["Files"],"summary":"Get file preview URL","description":"Returns a signed URL or source URL for previewing a file.","responses":{"200":{"description":"Preview URL"}}}},"/api/knowledge-bases/{id}/files/{fileId}/html-proxy":{"get":{"tags":["Files"],"summary":"Get HTML proxy for page preview","description":"Proxies an external web page with injected highlight scripts.\nUsed for iframe-based page preview with search result highlighting.\n","responses":{"200":{"description":"Proxied HTML content"}}}},"/api/files/upload":{"post":{"tags":["Files"],"summary":"Upload file","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"projectId":{"type":"string"},"kbId":{"type":"string"}}}}}},"responses":{"200":{"description":"File uploaded"}}}},"/api/files/{fileId}/download":{"get":{"tags":["Files"],"summary":"Download file","responses":{"200":{"description":"File content"}}}},"/api/files/{fileId}/reindex":{"post":{"tags":["Files"],"summary":"Reindex file","description":"Re-processes and re-indexes a file through the full pipeline.","responses":{"200":{"description":"Reindexing started"}}}},"/api/viewer/convert":{"get":{"tags":["Files"],"summary":"Convert document to HTML","description":"Converts Office documents (DOCX, XLSX) to HTML for viewing.","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string"},"description":"S3 URL of the document"}],"responses":{"200":{"description":"Converted HTML"}}}},"/api/search":{"post":{"tags":["Search"],"summary":"Unified search","description":"Search across projects and knowledge bases.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Search results"}}}},"/api/search/enhanced":{"post":{"tags":["Search"],"summary":"Enhanced search with filters","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"filters":{"type":"object"},"kbIds":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Enhanced search results"}}}},"/api/knowledge-bases/{id}/ontology":{"get":{"tags":["Ontology"],"summary":"Get KB ontology","description":"Returns extracted entities, relationships, and type breakdowns from\nall indexed documents. Entities include people, organizations, concepts,\ndates, and domain-specific terms.\n","responses":{"200":{"description":"Ontology data","content":{"application/json":{"schema":{"type":"object","properties":{"entities":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"frequency":{"type":"integer"}}}},"relationships":{"type":"array","items":{"type":"object"}},"typeBreakdown":{"type":"object"}}}}}}}}},"/api/knowledge-bases/{id}/optimize":{"post":{"tags":["Ontology"],"summary":"Optimize KB with domain ontology","description":"Re-runs ontology tagging with a specific domain or custom ontology.\nImproves entity extraction and search relevance for domain-specific content.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Domain for targeted ontology (e.g., \"healthcare\", \"legal\")"},"customOntology":{"type":"object","description":"Custom ontology definition"}}}}}},"responses":{"200":{"description":"Optimization started"}}}},"/api/document/export-pdf":{"post":{"tags":["Files"],"summary":"Export content to PDF","description":"Generates a PDF from provided content (migration reports, proposals, etc.)","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string"},"title":{"type":"string"},"template":{"type":"string","enum":["migration-report","proposal","generic"]}}}}}},"responses":{"200":{"description":"PDF file"}}}}}}