{"openapi":"3.1.0","info":{"title":"Agate API","description":"Backend API for the Agate platform.\n\n## Modules\n\n- **Fact Checker** — Upload press releases, extract facts with AI, search news articles, analyze coverage and deviations, generate reports.\n- **Radar** — Track real-world events, run multi-source research (web, news, forums, social), generate SITREP documents.\n\n## Async Jobs\n\nLong-running AI operations return a `job_id` (HTTP 202). Poll `GET /api/v1/jobs/{job_id}` until `status` is `completed` or `failed`.","version":"0.1.0"},"paths":{"/api/v1/fact-checker/projects":{"post":{"tags":["fact-checker:projects"],"summary":"Create project","description":"Create a new fact-check project. The project starts at step 1 (upload).","operationId":"create_project_api_v1_fact_checker_projects_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["fact-checker:projects"],"summary":"List projects","description":"List all projects owned by the authenticated user, with pagination and sorting.","operationId":"list_projects_api_v1_fact_checker_projects_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-based)","default":1,"title":"Page"},"description":"Page number (1-based)"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of results per page","default":20,"title":"Per Page"},"description":"Number of results per page"},{"name":"sort","in":"query","required":false,"schema":{"type":"string","description":"Sort field and direction (e.g. 'updated_at:desc', 'name:asc')","default":"updated_at:desc","title":"Sort"},"description":"Sort field and direction (e.g. 'updated_at:desc', 'name:asc')"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}":{"get":{"tags":["fact-checker:projects"],"summary":"Get project","description":"Get full details of a project including facts, articles, and analysis results.","operationId":"get_project_api_v1_fact_checker_projects__project_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["fact-checker:projects"],"summary":"Update project","description":"Update a project's name.","operationId":"update_project_api_v1_fact_checker_projects__project_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["fact-checker:projects"],"summary":"Delete project","description":"Permanently delete a project and all its associated data (facts, articles, reports, S3 files).","operationId":"delete_project_api_v1_fact_checker_projects__project_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/upload-url":{"post":{"tags":["fact-checker:upload"],"summary":"Get presigned upload URL","description":"Generate a presigned S3 URL for the client to upload a press release document.\nSupported formats: PDF, DOCX, TXT. Maximum file size: 20 MB.","operationId":"get_upload_url_api_v1_fact_checker_projects__project_id__upload_url_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadUrlRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/confirm-upload":{"post":{"tags":["fact-checker:upload"],"summary":"Confirm upload and extract text","description":"After uploading the file to S3, call this endpoint to extract text from the document\nand save it as the project's press release. The project advances to step 2 (facts).","operationId":"confirm_upload_api_v1_fact_checker_projects__project_id__confirm_upload_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmUploadRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/paste-text":{"post":{"tags":["fact-checker:upload"],"summary":"Paste press release text","description":"Submit press release text directly instead of uploading a file.\nThe project advances to step 2 (facts).","operationId":"paste_text_api_v1_fact_checker_projects__project_id__paste_text_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasteTextRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasteTextResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/extract-facts":{"post":{"tags":["fact-checker:facts"],"summary":"Extract facts from press release","description":"Start an async job that uses AI to extract verifiable factual claims from the\nproject's press release text. Poll GET /jobs/{job_id} for completion.","operationId":"extract_facts_api_v1_fact_checker_projects__project_id__extract_facts_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractFactsRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__fact_checker__models__job__JobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/facts":{"put":{"tags":["fact-checker:facts"],"summary":"Update confirmed facts","description":"Replace all facts for a project with the provided list. Used after the user\nreviews and edits the AI-extracted facts.","operationId":"update_facts_api_v1_fact_checker_projects__project_id__facts_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/generate-queries":{"post":{"tags":["fact-checker:search"],"summary":"Generate search queries","description":"Start an async job that uses AI to generate an OpenSearch QuerySpec from the\nproject's confirmed facts. Poll GET /jobs/{job_id} for completion.","operationId":"generate_queries_api_v1_fact_checker_projects__project_id__generate_queries_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__fact_checker__models__job__JobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/query-spec":{"put":{"tags":["fact-checker:search"],"summary":"Update query spec","description":"Replace the project's OpenSearch query specification. Used after the user\nreviews and edits the AI-generated queries.","operationId":"update_query_spec_api_v1_fact_checker_projects__project_id__query_spec_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuerySpec"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuerySpecResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/run-search":{"post":{"tags":["fact-checker:search"],"summary":"Run search","description":"Execute the project's QuerySpec against OpenSearch to discover news articles.\nEach call increments the search round. Poll GET /jobs/{job_id} for completion.","operationId":"run_search_api_v1_fact_checker_projects__project_id__run_search_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSearchRequest","default":{}}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/direct-search":{"post":{"tags":["fact-checker:search"],"summary":"Direct search","description":"Run a free-text search query directly against the news corpus,\nbypassing the QuerySpec. Useful for ad-hoc article discovery.","operationId":"direct_search_api_v1_fact_checker_projects__project_id__direct_search_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectSearchRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/search-history":{"get":{"tags":["fact-checker:search"],"summary":"Get search history","description":"Return the history of search rounds for this project, including\nquery text and article counts per round.","operationId":"search_history_api_v1_fact_checker_projects__project_id__search_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/articles":{"get":{"tags":["fact-checker:search"],"summary":"List articles","description":"List all articles discovered for a project, optionally filtered by search round.","operationId":"list_articles_api_v1_fact_checker_projects__project_id__articles_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}},{"name":"search_round","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter articles by search round number","title":"Search Round"},"description":"Filter articles by search round number"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/reset-and-search":{"post":{"tags":["fact-checker:search"],"summary":"Reset articles and re-search","description":"Clear existing articles (optionally keeping analyzed ones) and run a fresh search.\nUseful when the QuerySpec has been significantly changed.","operationId":"reset_and_search_api_v1_fact_checker_projects__project_id__reset_and_search_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetAndSearchRequest","default":{"keep_analyzed":false}}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/articles/{article_id}":{"patch":{"tags":["fact-checker:search"],"summary":"Update article","description":"Mark an article as irrelevant or restore it.","operationId":"update_article_api_v1_fact_checker_projects__project_id__articles__article_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}},{"name":"article_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Article Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateArticleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/selected-articles":{"put":{"tags":["fact-checker:search"],"summary":"Select articles for analysis","description":"Set which articles should be analyzed. Replaces the current selection.","operationId":"select_articles_api_v1_fact_checker_projects__project_id__selected_articles_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectedArticlesUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectedArticlesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/analyze":{"post":{"tags":["fact-checker:analysis"],"summary":"Analyze selected articles","description":"Start an async job that uses AI to analyze each selected article against the\nconfirmed facts. Checks for coverage, deviations, and evidence.\nArticles already analyzed are skipped. Poll GET /jobs/{job_id} for completion.","operationId":"analyze_api_v1_fact_checker_projects__project_id__analyze_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fact-checker/projects/{project_id}/reports":{"post":{"tags":["fact-checker:reports"],"summary":"Generate report","description":"Start an async job to generate a fact-check report (DOCX or PDF).\nThe report includes fact coverage, deviation details, and article analysis.\nPoll GET /jobs/{job_id} for completion.","operationId":"generate_report_api_v1_fact_checker_projects__project_id__reports_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportGenerateRequest","default":{"format":"docx"}}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__fact_checker__models__job__JobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["fact-checker:reports"],"summary":"List reports","description":"List generated reports for a project, with optional format filter.\nEach report includes a presigned download URL (valid for 24 hours).","operationId":"list_reports_api_v1_fact_checker_projects__project_id__reports_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Id"}},{"name":"format","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by format: 'docx' or 'pdf'","title":"Format"},"description":"Filter by format: 'docx' or 'pdf'"},{"name":"latest","in":"query","required":false,"schema":{"type":"boolean","description":"Return only the latest report","default":false,"title":"Latest"},"description":"Return only the latest report"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events":{"post":{"tags":["wisma-radar:events"],"summary":"Create event","description":"Create a new Radar event to track and research.","operationId":"create_event_api_v1_wisma_radar_events_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["wisma-radar:events"],"summary":"List events","description":"List events owned by the authenticated user.\n\nFiltering, sorting, and pagination are performed by the server so the\ndashboard never silently limits a user's dataset to the first page.","operationId":"list_events_api_v1_wisma_radar_events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-based)","default":1,"title":"Page"},"description":"Page number (1-based)"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of results per page","default":50,"title":"Per Page"},"description":"Number of results per page"},{"name":"sort_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/EventSortField","description":"Field to sort by","default":"created_at"},"description":"Field to sort by"},{"name":"order","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortOrder","description":"Sort direction","default":"desc"},"description":"Sort direction"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"Server-side title/summary search","title":"Q"},"description":"Server-side title/summary search"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"description":"Exact status filter","title":"Status"},"description":"Exact status filter"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}":{"get":{"tags":["wisma-radar:events"],"summary":"Get event","description":"Get full details of an event including accumulated facts and research findings.","operationId":"get_event_api_v1_wisma_radar_events__event_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["wisma-radar:events"],"summary":"Update event","description":"Partially update an event's fields (title, summary, severity, status, etc.).","operationId":"update_event_api_v1_wisma_radar_events__event_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["wisma-radar:events"],"summary":"Delete event","description":"Permanently delete an event and all associated findings and SITREPs.","operationId":"delete_event_api_v1_wisma_radar_events__event_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/analysis":{"patch":{"tags":["wisma-radar:events"],"summary":"Edit the exact event-analysis contract","description":"Append a revision, preserve historical outputs, and mark dependents stale.","operationId":"update_event_analysis_api_v1_wisma_radar_events__event_id__analysis_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventAnalysisPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventContractRevisionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/analysis/stale":{"get":{"tags":["wisma-radar:events"],"summary":"Read explicit stale and rerun state","operationId":"get_event_analysis_stale_api_v1_wisma_radar_events__event_id__analysis_stale_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaleStateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/identify":{"post":{"tags":["wisma-radar:research"],"summary":"Identify real event","description":"Trigger an LLM-powered web search to identify candidate real-world events\nmatching a free-text description. Results update the event's title, summary,\nlocation, and date. Poll GET /jobs/{job_id} for completion.","operationId":"identify_event_api_v1_wisma_radar_events__event_id__identify_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdentifyRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__fact_checker__models__job__JobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/research":{"post":{"tags":["wisma-radar:research"],"summary":"Run multi-source research","description":"Trigger multi-source research for an event. Searches across web, Wisma news\ncorpus, forum posts, and social media to collect findings and build up\naccumulated facts. Supports 1-3 rounds of iterative research with follow-up\nqueries targeting gaps. Poll GET /jobs/{job_id} for completion.","operationId":"run_research_api_v1_wisma_radar_events__event_id__research_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResearchRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__fact_checker__models__job__JobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/collections/initial":{"post":{"tags":["wisma-radar:research"],"summary":"Start the initial evidence collection (full backfill)","operationId":"start_initial_collection_api_v1_wisma_radar_events__event_id__collections_initial_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CollectionStartRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/collections/update":{"post":{"tags":["wisma-radar:research"],"summary":"Update Radar — incremental collection since the last cursors","operationId":"start_update_collection_api_v1_wisma_radar_events__event_id__collections_update_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CollectionStartRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/collections/gap-search":{"post":{"tags":["wisma-radar:research"],"summary":"Find more context without advancing monitoring cursors","operationId":"start_gap_search_collection_api_v1_wisma_radar_events__event_id__collections_gap_search_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CollectionStartRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/collections":{"get":{"tags":["wisma-radar:research"],"summary":"List collection runs for an event","operationId":"list_collections_api_v1_wisma_radar_events__event_id__collections_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/collections/{run_id}":{"get":{"tags":["wisma-radar:research"],"summary":"Get a single collection run","operationId":"get_collection_api_v1_wisma_radar_events__event_id__collections__run_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/evidence-sets":{"post":{"tags":["wisma-radar:research"],"summary":"Create an immutable evidence set","description":"Persist include/exclude decisions without starting synthesis.","operationId":"create_evidence_set_api_v1_wisma_radar_events__event_id__evidence_sets_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidenceSetCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidenceSetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["wisma-radar:research"],"summary":"List immutable evidence sets","operationId":"list_evidence_sets_api_v1_wisma_radar_events__event_id__evidence_sets_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidenceSetsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/evidence-syntheses":{"post":{"tags":["wisma-radar:research"],"summary":"Explicitly request evidence synthesis","operationId":"request_evidence_synthesis_api_v1_wisma_radar_events__event_id__evidence_syntheses_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidenceSynthesisRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidenceSynthesisResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["wisma-radar:research"],"summary":"List evidence synthesis identities","operationId":"list_evidence_syntheses_api_v1_wisma_radar_events__event_id__evidence_syntheses_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EvidenceSynthesisResponse"},"title":"Response List Evidence Syntheses Api V1 Wisma Radar Events  Event Id  Evidence Syntheses Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/identify/select":{"post":{"tags":["wisma-radar:research"],"summary":"Confirm one of the identify candidates","description":"Pick one of the candidates previously returned by\n``POST /events/{id}/identify``. Copies the candidate's title, summary,\nlocation, and date onto the event, and records the selected index for\naudit. Returns the updated event.","operationId":"select_identify_candidate_api_v1_wisma_radar_events__event_id__identify_select_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectCandidateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/research/runs":{"get":{"tags":["wisma-radar:research"],"summary":"List research runs for an event","description":"Newest-first list of research runs for an event. Each run carries the\nwindow it queried, per-source counts, and retention deltas (new /\nre-seen / dropped) so the UI can offer a version picker and surface\n``what changed`` between runs.","operationId":"list_research_runs_api_v1_wisma_radar_events__event_id__research_runs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchRunsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/findings/exclude":{"post":{"tags":["wisma-radar:research"],"summary":"Mark findings as unrelated","description":"Hide one or more findings from downstream stages (SITREP, etc.).\nExcluded findings still surface in EventDetail with ``excluded_at`` set\nso the UI can grey them out and let the analyst undo.","operationId":"exclude_findings_api_v1_wisma_radar_events__event_id__findings_exclude_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindingExcludeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindingExclusionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/findings/include":{"post":{"tags":["wisma-radar:research"],"summary":"Re-include previously excluded findings","description":"Reverse a previous exclude. Returns count of rows un-flipped.","operationId":"include_findings_api_v1_wisma_radar_events__event_id__findings_include_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindingIncludeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindingExclusionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/research/find-more":{"post":{"tags":["wisma-radar:research"],"summary":"Run one gap-targeted follow-up wave on existing evidence","description":"Compatibility proxy for the canonical gap-search collection endpoint.","operationId":"find_more_api_v1_wisma_radar_events__event_id__research_find_more_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__fact_checker__models__job__JobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/sitrep-versions":{"post":{"tags":["wisma-radar:sitrep"],"summary":"Create an immutable SITREP version","operationId":"create_sitrep_version_api_v1_wisma_radar_events__event_id__sitrep_versions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitrepVersionCreate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitrepVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["wisma-radar:sitrep"],"summary":"List immutable SITREP versions","operationId":"list_sitrep_versions_api_v1_wisma_radar_events__event_id__sitrep_versions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SitrepVersionSummaryResponse"},"title":"Response List Sitrep Versions Api V1 Wisma Radar Events  Event Id  Sitrep Versions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/sitrep-versions/{version_id}":{"get":{"tags":["wisma-radar:sitrep"],"summary":"Read one immutable SITREP version","operationId":"get_sitrep_version_api_v1_wisma_radar_events__event_id__sitrep_versions__version_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitrepVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/sitrep-versions/{version_id}/retry":{"post":{"tags":["wisma-radar:sitrep"],"summary":"Retry an immutable SITREP version","operationId":"retry_sitrep_version_api_v1_wisma_radar_events__event_id__sitrep_versions__version_id__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitrepVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/sitrep-versions/{version_id}/download":{"get":{"tags":["wisma-radar:sitrep"],"summary":"Download one SITREP version's DOCX","operationId":"download_sitrep_version_api_v1_wisma_radar_events__event_id__sitrep_versions__version_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitrepDownloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/sitrep":{"post":{"tags":["wisma-radar:sitrep"],"summary":"Generate SITREP","description":"Start an async job to generate a Situation Report (SITREP) from the event's\naccumulated research findings. Produces both Markdown content and a DOCX file.\nPoll GET /jobs/{job_id} for completion.","operationId":"generate_sitrep_api_v1_wisma_radar_events__event_id__sitrep_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SitrepGenerateRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__fact_checker__models__job__JobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["wisma-radar:sitrep"],"summary":"Get latest SITREP","description":"Return the latest generated SITREP content for an event.","operationId":"get_latest_sitrep_api_v1_wisma_radar_events__event_id__sitrep_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitrepContentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/events/{event_id}/sitrep/download":{"get":{"tags":["wisma-radar:sitrep"],"summary":"Download SITREP DOCX","description":"Return a presigned URL for downloading the latest SITREP as a DOCX file.","operationId":"download_sitrep_api_v1_wisma_radar_events__event_id__sitrep_download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitrepDownloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/investigations/attempts":{"post":{"tags":["wisma-radar:investigations"],"summary":"Create a private Investigation attempt","operationId":"create_attempt_api_v1_wisma_radar_investigations_attempts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvestigationAttemptCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvestigationAttemptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/wisma-radar/investigations/attempts/{attempt_id}":{"get":{"tags":["wisma-radar:investigations"],"summary":"Read a private Investigation attempt","operationId":"get_attempt_api_v1_wisma_radar_investigations_attempts__attempt_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvestigationAttemptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/investigations/attempts/{attempt_id}/cancel":{"post":{"tags":["wisma-radar:investigations"],"summary":"Cancel a private Investigation attempt","operationId":"cancel_attempt_api_v1_wisma_radar_investigations_attempts__attempt_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvestigationAttemptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/wisma-radar/investigations/attempts/{attempt_id}/confirm":{"post":{"tags":["wisma-radar:investigations"],"summary":"Confirm an Investigation attempt and create its event","operationId":"confirm_attempt_api_v1_wisma_radar_investigations_attempts__attempt_id__confirm_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvestigationConfirmRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/watchlist":{"get":{"tags":["facet:watchlist"],"summary":"List watchlist","description":"Paginated list of user_profiles the caller is watching, newest first.","operationId":"list_watchlist_api_v1_facet_watchlist_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchedUserListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["facet:watchlist"],"summary":"Add to watchlist","description":"Add a user_profile to the caller's watchlist.\n\nReturns 404 if the referenced ``userProfileId`` does not exist in the\nfacet DB. Idempotent: re-adding an already-watched profile returns the\nexisting row (still 201, no duplicate).","operationId":"add_to_watchlist_api_v1_facet_watchlist_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchedUserCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchedUser"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/watchlist/categories":{"get":{"tags":["facet:watchlist"],"summary":"List the caller's watchlist categories","operationId":"list_watchlist_categories_api_v1_facet_watchlist_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistCategoryListResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["facet:watchlist"],"summary":"Create a watchlist category","operationId":"create_watchlist_category_api_v1_facet_watchlist_categories_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistCategoryCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistCategory"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/facet/watchlist/categories/{category_id}":{"patch":{"tags":["facet:watchlist"],"summary":"Rename / recolor a watchlist category","operationId":"update_watchlist_category_api_v1_facet_watchlist_categories__category_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Category Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistCategoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistCategory"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["facet:watchlist"],"summary":"Delete a watchlist category (memberships cascade)","operationId":"delete_watchlist_category_api_v1_facet_watchlist_categories__category_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Category Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/watchlist/categories/{category_id}/members":{"post":{"tags":["facet:watchlist"],"summary":"Assign a watched_user to a category","operationId":"add_category_member_api_v1_facet_watchlist_categories__category_id__members_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Category Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryMembershipCreate"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/watchlist/categories/{category_id}/members/{watched_user_id}":{"delete":{"tags":["facet:watchlist"],"summary":"Remove a watched_user from a category","operationId":"remove_category_member_api_v1_facet_watchlist_categories__category_id__members__watched_user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Category Id"}},{"name":"watched_user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Watched User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/watchlist/users/{watched_user_id}/categories":{"get":{"tags":["facet:watchlist"],"summary":"List the categories a watched_user belongs to","operationId":"list_categories_for_watched_user_api_v1_facet_watchlist_users__watched_user_id__categories_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"watched_user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Watched User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistCategoryListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/watchlist/categories/{category_id}/recent-activity":{"get":{"tags":["facet:watchlist"],"summary":"Recent comments / posts by category members (chronological)","operationId":"category_recent_activity_api_v1_facet_watchlist_categories__category_id__recent_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Category Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"perPage","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Perpage"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryActivityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/watchlist/categories/{category_id}/participated-posts":{"get":{"tags":["facet:watchlist"],"summary":"Distinct posts / threads category members contributed to","operationId":"category_participated_posts_api_v1_facet_watchlist_categories__category_id__participated_posts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Category Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"perPage","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Perpage"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryParticipatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/watchlist/{user_profile_id}":{"delete":{"tags":["facet:watchlist"],"summary":"Remove from watchlist","description":"Remove ``user_profile_id`` from the caller's watchlist.\n\nReturns 404 if the row does not exist on the caller's watchlist — even\nif another user has it watched.","operationId":"remove_from_watchlist_api_v1_facet_watchlist__user_profile_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_profile_id","in":"path","required":true,"schema":{"type":"integer","title":"User Profile Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/social/demographics/{post_id}":{"get":{"tags":["facet:demographics:social"],"summary":"Social post demographics detail","description":"Per-commenter demographics breakdown for one social post.","operationId":"get_social_post_demographics_api_v1_facet_social_demographics__post_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemographicsDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/social/demographics/batch":{"post":{"tags":["facet:demographics:social"],"summary":"Social post demographics batch summaries","description":"Return a ``DemographicsSummary`` per requested ``postId``.\n\nPosts with no matching comments are simply absent from the result.","operationId":"social_demographics_batch_api_v1_facet_social_demographics_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialDemographicsBatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"$ref":"#/components/schemas/DemographicsSummary"},"type":"object","title":"Response Social Demographics Batch Api V1 Facet Social Demographics Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/facet/social/feed":{"post":{"tags":["facet:demographics:social"],"summary":"Paginated social post feed","description":"Return the latest social posts with filters and engagement sort.\n\nDefaults: ``page=1, perPage=30, sortBy=\"recent\"`` — sourced from\n``facet-frontend/src/app/api/social/feed/route.ts``. The TS handler\nalso returned a ``timing`` field; we deliberately drop it.","operationId":"social_feed_api_v1_facet_social_feed_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialFeedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialFeedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/facet/social/posts/{post_id}":{"get":{"tags":["facet:demographics:social"],"summary":"Social post detail with embedded profile","description":"Return one social post + its full embedded profile, or 404.","operationId":"get_social_post_api_v1_facet_social_posts__post_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialPostWithFullProfile"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/social/comments/{post_id}":{"get":{"tags":["facet:demographics:social"],"summary":"All comments on a social post","description":"Return all comments for a post, ordered by created_time ASC.\n\nNo pagination — mirrors the TS handler exactly.","operationId":"get_social_comments_api_v1_facet_social_comments__post_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SocialComment"},"title":"Response Get Social Comments Api V1 Facet Social Comments  Post Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/social/posts/{post_id}/summary":{"post":{"tags":["facet:demographics:social"],"summary":"Haiku-generated summary of a social post + comments","operationId":"summarize_social_post_route_api_v1_facet_social_posts__post_id__summary_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Summarize Social Post Route Api V1 Facet Social Posts  Post Id  Summary Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/social/profiles":{"get":{"tags":["facet:demographics:social"],"summary":"Active social profiles, grouped by platform","description":"Return every ``is_ingesting=true`` profile, grouped by platform.","operationId":"list_social_profiles_api_v1_facet_social_profiles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SocialProfilesGrouped"},"type":"array","title":"Response List Social Profiles Api V1 Facet Social Profiles Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/facet/social/profiles/{profile_id}":{"get":{"tags":["facet:demographics:social"],"summary":"Social profile detail + paginated posts","description":"Return ``{profile, posts, totalPosts}`` — mirrors the TS handler.\n\nDefaults ``page=1, perPage=20`` are taken verbatim from\n``facet-frontend/src/app/api/social/profiles/[profileId]/route.ts``.","operationId":"get_social_profile_api_v1_facet_social_profiles__profile_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"perPage","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Perpage"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialProfileDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/forums/demographics/{thread_id}":{"get":{"tags":["facet:demographics:forums"],"summary":"Forum thread demographics detail","description":"Per-participant demographics breakdown for one forum thread.","operationId":"get_forum_thread_demographics_api_v1_facet_forums_demographics__thread_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemographicsDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/forums/demographics/batch":{"post":{"tags":["facet:demographics:forums"],"summary":"Forum thread demographics batch summaries","description":"Return a ``DemographicsSummary`` per requested ``threadId``.","operationId":"forum_demographics_batch_api_v1_facet_forums_demographics_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForumDemographicsBatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"$ref":"#/components/schemas/DemographicsSummary"},"type":"object","title":"Response Forum Demographics Batch Api V1 Facet Forums Demographics Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/facet/forums/feed":{"post":{"tags":["facet:demographics:forums"],"summary":"Paginated forum thread feed (allowlist-gated)","description":"Return the latest forum threads from the allowlisted forums.\n\nDefaults: ``page=1, perPage=30, sortBy=\"recent\"``. The hardcoded\nFORUM_ALLOWLIST is enforced at the query layer.","operationId":"forum_feed_api_v1_facet_forums_feed_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForumFeedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForumFeedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/facet/forums/sources":{"get":{"tags":["facet:demographics:forums"],"summary":"Sources with nested forums","description":"Return every source with its forums nested under ``forums``.","operationId":"list_forum_sources_api_v1_facet_forums_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SourceWithForums"},"type":"array","title":"Response List Forum Sources Api V1 Facet Forums Sources Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/facet/forums/threads/{thread_id}":{"get":{"tags":["facet:demographics:forums"],"summary":"Forum thread detail","description":"Return one thread + forum + source + postCount. 404 if absent.","operationId":"get_forum_thread_api_v1_facet_forums_threads__thread_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadWithDetails"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/forums/posts/{thread_id}":{"get":{"tags":["facet:demographics:forums"],"summary":"Paginated posts inside a forum thread","description":"Return a thread's posts, paginated. ``sort`` (\"oldest\"|\"newest\") drives\nthe SQL order; ``q`` keyword-filters post content. perPage=50.","operationId":"list_forum_posts_api_v1_facet_forums_posts__thread_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"perPage","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Perpage"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","pattern":"^(oldest|newest)$","default":"oldest","title":"Sort"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Keyword filter over post content","title":"Q"},"description":"Keyword filter over post content"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForumPostsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/forums/threads/{thread_id}/summary":{"post":{"tags":["facet:demographics:forums"],"summary":"Haiku-generated summary of a forum thread discussion","operationId":"summarize_forum_thread_route_api_v1_facet_forums_threads__thread_id__summary_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Summarize Forum Thread Route Api V1 Facet Forums Threads  Thread Id  Summary Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/demographics/aggregate":{"post":{"tags":["facet:demographics:aggregate"],"summary":"Aggregated demographics across social + forum","description":"Merge social + forum demographics into a single detail view.\n\nAccepts two body shapes. ``{query, scope?, filters?}`` runs the\nsearch domain to resolve matching IDs, then aggregates.\n``{socialPostIds, forumThreadIds}`` skips search and aggregates the\nexplicit ID lists. When ``query`` is present and non-empty, query\nmode wins — explicit ID lists are ignored.","operationId":"aggregate_demographics_api_v1_facet_demographics_aggregate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemographicsAggregateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemographicsDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/facet/user-profiles/{profile_id}":{"get":{"tags":["facet:user-profiles"],"summary":"Get a user_profile by id","description":"Return one user_profile or 404 if the id does not exist.","operationId":"get_user_profile_api_v1_facet_user_profiles__profile_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/user-profiles/{profile_id}/posts":{"get":{"tags":["facet:user-profiles"],"summary":"Paginated post / comment history for a user_profile","description":"Paginated post / comment history.\n\nForum profiles yield ``UserPostHistoryForum`` rows (``content``,\n``threadId``, ``threadTitle``), social profiles yield\n``UserPostHistorySocial`` rows (``text``, ``likeCount``, ``postId``,\n...). The JSON array is heterogeneous by ``user_source`` — callers\nare expected to know which shape to expect from their own context,\nsame as the TS handler.","operationId":"get_user_profile_posts_api_v1_facet_user_profiles__profile_id__posts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPostHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/user-profiles/{profile_id}/classification":{"get":{"tags":["facet:user-profiles"],"summary":"Get the manual classification override for a user_profile","description":"Return the override row, or ``null`` when none exists.","operationId":"get_user_profile_classification_api_v1_facet_user_profiles__profile_id__classification_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ManualClassification"},{"type":"null"}],"title":"Response Get User Profile Classification Api V1 Facet User Profiles  Profile Id  Classification Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["facet:user-profiles"],"summary":"Set/replace the manual classification override","operationId":"upsert_user_profile_classification_api_v1_facet_user_profiles__profile_id__classification_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualClassificationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualClassification"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["facet:user-profiles"],"summary":"Remove the manual classification override","operationId":"delete_user_profile_classification_api_v1_facet_user_profiles__profile_id__classification_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/explorer/tables":{"get":{"tags":["facet:explorer"],"summary":"List all allowlisted tables with column + row-count metadata","description":"Column info + approximate row counts for every allowlisted table.\n\nQueries both facet_pool and agate_pool and unions the result.","operationId":"list_tables_api_v1_facet_explorer_tables_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TableInfo"},"type":"array","title":"Response List Tables Api V1 Facet Explorer Tables Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/facet/explorer/data/{table_name}":{"get":{"tags":["facet:explorer"],"summary":"Paginated + sortable + filterable rows from an allowlisted table","description":"Return rows from ``table_name``.\n\nFilter query params use the ``filter_<colname>`` prefix (e.g.\n``?filter_username=alice``). Column names are validated against\n``information_schema`` before being interpolated into the SQL;\nfilter values go through parameter placeholders.","operationId":"get_table_data_api_v1_facet_explorer_data__table_name__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"table_name","in":"path","required":true,"schema":{"type":"string","title":"Table Name"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"perPage","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Perpage"}},{"name":"sortColumn","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sortcolumn"}},{"name":"sortDirection","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sortdirection"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplorerDataResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facet/search":{"post":{"tags":["facet:search"],"summary":"Boolean search across social + forum content","description":"Run a boolean search query against the facet content.\n\nDefaults mirror ``facet-frontend/src/app/api/search/route.ts``:\n``scope=\"all\", page=1, perPage=20`` and empty filters. The\nresponse always includes both ``social`` and ``forums`` buckets\n(empty-but-present when the scope excludes one).","operationId":"run_search_api_v1_facet_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/facet/search/timeseries":{"post":{"tags":["facet:search"],"summary":"Per-bucket match counts over time","description":"Compute a sparse timeseries of matches, bucketed by ``granularity``.\n\nMirrors ``facet-frontend/src/app/api/search/timeseries/route.ts``.\nGap filling is the frontend's responsibility — the backend returns\nonly buckets with at least one hit.","operationId":"run_timeseries_api_v1_facet_search_timeseries_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeseriesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeseriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/narratives/events/{event_id}/assignments":{"get":{"tags":["narratives/assignments"],"summary":"List Latest Assignments","operationId":"list_latest_assignments_api_v1_narratives_events__event_id__assignments_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/assignments/{item_id}":{"patch":{"tags":["narratives/assignments"],"summary":"Reassign or exclude a corpus item","operationId":"patch_assignment_api_v1_narratives_events__event_id__assignments__item_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReassignmentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReassignmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/clusters":{"get":{"tags":["narratives/clusters"],"summary":"List Active Clusters","operationId":"list_active_clusters_api_v1_narratives_events__event_id__clusters_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClustersListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/clusters/{cluster_id}/summary":{"post":{"tags":["narratives/clusters"],"summary":"Summarize Cluster","operationId":"summarize_cluster_api_v1_narratives_events__event_id__clusters__cluster_id__summary_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"cluster_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cluster Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/corpus":{"get":{"tags":["narratives/corpus"],"summary":"List Corpus","operationId":"list_corpus_api_v1_narratives_events__event_id__corpus_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"includeExcluded","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Includeexcluded"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorpusListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/corpus/exclude":{"post":{"tags":["narratives/corpus"],"summary":"Exclude Items","operationId":"exclude_items_api_v1_narratives_events__event_id__corpus_exclude_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExcludeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExcludeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/corpus/include":{"post":{"tags":["narratives/corpus"],"summary":"Include Items","description":"Un-exclude. Returns count of rows affected (reusing ExcludeResponse shape).","operationId":"include_items_api_v1_narratives_events__event_id__corpus_include_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncludeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExcludeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/clusters/{cluster_id}/facet-links":{"get":{"tags":["narratives/facet-links"],"summary":"Get Cluster Facet Links","description":"Return ``{itemId: {threadTitle, threadExternalId, authorExternalId}}``\nfor every corpus item currently assigned to ``cluster_id``.\n\nItems whose parent thread/post cannot be located in Facet are\nomitted from the map.","operationId":"get_cluster_facet_links_api_v1_narratives_events__event_id__clusters__cluster_id__facet_links_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"cluster_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cluster Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacetLinksResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/facet-links":{"get":{"tags":["narratives/facet-links"],"summary":"Get Event Facet Links","description":"Return facet-link metadata for every non-excluded corpus item\nin the event, regardless of cluster. The Posts tab uses this to\nrender thread titles for forum rows and parent-post excerpts for\nsocial-comment rows in its \"Title\" column.\n\nItems whose parent thread/post cannot be located in Facet are\nomitted from the map.","operationId":"get_event_facet_links_api_v1_narratives_events__event_id__facet_links_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacetLinksResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/social-parents":{"get":{"tags":["narratives/facet-links"],"summary":"Get Event Social Parents","description":"Resolve retained social source identifiers to their parent posts.\n\nIdentifiers may be legacy social-comment IDs or parent-post shortcodes\npersisted by the regressed ingestion path.","operationId":"get_event_social_parents_api_v1_narratives_events__event_id__social_parents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"ids","in":"query","required":false,"schema":{"type":"string","default":"","title":"Ids"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Event Social Parents Api V1 Narratives Events  Event Id  Social Parents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/forum-sources":{"get":{"tags":["narratives/facet-links"],"summary":"Get Event Forum Sources","description":"Resolve retained forum thread URLs to their outlet name (sources.name).\n\nPowers the Coverage source-name column for forum evidence, so it shows the\ncanonical outlet from the facet DB instead of a hostname parsed from the\nURL. Threads that cannot be located are omitted from the map.","operationId":"get_event_forum_sources_api_v1_narratives_events__event_id__forum_sources_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"urls","in":"query","required":false,"schema":{"type":"string","default":"","title":"Urls"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Event Forum Sources Api V1 Narratives Events  Event Id  Forum Sources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/jobs/cluster":{"post":{"tags":["narratives/jobs"],"summary":"Post Cluster","operationId":"post_cluster_api_v1_narratives_events__event_id__jobs_cluster_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterJobRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__narratives__models__requests__JobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/jobs/classify":{"post":{"tags":["narratives/jobs"],"summary":"Post Classify","operationId":"post_classify_api_v1_narratives_events__event_id__jobs_classify_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshJobRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__modules__narratives__models__requests__JobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/runs/latest":{"get":{"tags":["narratives/runs"],"summary":"Get Latest","operationId":"get_latest_api_v1_narratives_events__event_id__runs_latest_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NarrativeRun"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/runs":{"get":{"tags":["narratives/runs"],"summary":"List narrative runs for an event (newest first)","operationId":"list_runs_api_v1_narratives_events__event_id__runs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RunSummary"},"title":"Response List Runs Api V1 Narratives Events  Event Id  Runs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/runs/diff":{"get":{"tags":["narratives/runs"],"summary":"Aggregated delta between two runs (from < to)","operationId":"runs_diff_api_v1_narratives_events__event_id__runs_diff_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"from_run","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"From Run"}},{"name":"to_run","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"To Run"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunsDiffResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/runs/{run_id}/cancel":{"post":{"tags":["narratives/runs"],"summary":"Cancel a running narrative run","operationId":"cancel_run_api_v1_narratives_events__event_id__runs__run_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NarrativeRun"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/narratives/events/{event_id}/runs/{run_id}/state":{"get":{"tags":["narratives/runs"],"summary":"Cluster + corpus + assignment state at the end of run","operationId":"run_state_api_v1_narratives_events__event_id__runs__run_id__state_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}":{"get":{"tags":["jobs"],"summary":"Get job status","description":"Poll the status of a background job. Returns the current status, progress message,\nand result data when complete. Async endpoints (extract-facts, run-search, analyze,\ngenerate-report, research, sitrep) all return a job_id to poll here.","operationId":"get_job_api_v1_jobs__job_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["system"],"summary":"Health check","description":"Returns service status, env, and per-pool DB connectivity.\n\nWhen pools are not initialised (e.g. unit tests that skip lifespan),\nreturns the legacy ``{\"status\": \"ok\", \"env\": ...}`` shape.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AnalyzeResponse":{"properties":{"job_id":{"type":"string","format":"uuid","title":"Job Id","description":"Background job ID"},"articles_to_analyze":{"type":"integer","title":"Articles To Analyze","description":"Number of articles that will be analyzed in this run"},"already_analyzed":{"type":"integer","title":"Already Analyzed","description":"Number of articles already analyzed (skipped)"}},"type":"object","required":["job_id","articles_to_analyze","already_analyzed"],"title":"AnalyzeResponse"},"ArticleListResponse":{"properties":{"articles":{"items":{"$ref":"#/components/schemas/ArticleResponse"},"type":"array","title":"Articles","description":"List of discovered articles"},"total":{"type":"integer","title":"Total","description":"Total number of articles"}},"type":"object","required":["articles","total"],"title":"ArticleListResponse"},"ArticleResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Unique article identifier"},"title":{"type":"string","title":"Title","description":"Article headline"},"url":{"type":"string","title":"Url","description":"Source URL of the article"},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snippet","description":"Short excerpt from the article"},"search_round":{"type":"integer","title":"Search Round","description":"Search iteration that discovered this article"},"is_selected":{"type":"boolean","title":"Is Selected","description":"Whether the user selected this article for analysis"},"is_analyzed":{"type":"boolean","title":"Is Analyzed","description":"Whether analysis has been completed for this article"},"is_irrelevant":{"type":"boolean","title":"Is Irrelevant","description":"Whether the user marked this article as irrelevant","default":false}},"type":"object","required":["id","title","url","search_round","is_selected","is_analyzed"],"title":"ArticleResponse"},"Assignment":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"corpusItemId":{"type":"string","format":"uuid","title":"Corpusitemid"},"clusterId":{"type":"string","format":"uuid","title":"Clusterid"},"confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Confidence"},"assignedByRunId":{"type":"string","format":"uuid","title":"Assignedbyrunid"},"assignedAt":{"type":"string","format":"date-time","title":"Assignedat"}},"type":"object","required":["id","corpusItemId","clusterId","assignedByRunId","assignedAt"],"title":"Assignment","description":"Links a CorpusItem to the cluster it was classified into."},"AssignmentsListResponse":{"properties":{"assignments":{"items":{"$ref":"#/components/schemas/Assignment"},"type":"array","title":"Assignments"}},"type":"object","required":["assignments"],"title":"AssignmentsListResponse"},"BooleanGroup":{"properties":{"id":{"type":"string","title":"Id","description":"Unique group identifier","examples":["g1"]},"label":{"type":"string","title":"Label","description":"Human-readable label","examples":["Core search"]},"must":{"items":{"type":"string"},"type":"array","title":"Must","description":"Concept IDs that MUST match (AND logic)"},"should":{"items":{"type":"string"},"type":"array","title":"Should","description":"Concept IDs where at least one SHOULD match (OR logic)"},"must_not":{"items":{"type":"string"},"type":"array","title":"Must Not","description":"Concept IDs that MUST NOT match (exclusion)"}},"type":"object","required":["id","label"],"title":"BooleanGroup"},"CategoryActivityResponse":{"properties":{"items":{"items":{"anyOf":[{"$ref":"#/components/schemas/ForumActivityItem"},{"$ref":"#/components/schemas/SocialActivityItem"}]},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"CategoryActivityResponse","description":"GET /watchlist/categories/{id}/recent-activity."},"CategoryMembershipCreate":{"properties":{"watchedUserId":{"type":"string","format":"uuid","title":"Watcheduserid"}},"type":"object","required":["watchedUserId"],"title":"CategoryMembershipCreate","description":"POST /watchlist/categories/{id}/members body."},"CategoryParticipatedResponse":{"properties":{"items":{"items":{"anyOf":[{"$ref":"#/components/schemas/ParticipatedThread"},{"$ref":"#/components/schemas/ParticipatedSocialPost"}]},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"CategoryParticipatedResponse","description":"GET /watchlist/categories/{id}/participated-posts."},"ChannelMix":{"properties":{"forum_count":{"type":"integer","minimum":0.0,"title":"Forum Count"},"social_count":{"type":"integer","minimum":0.0,"title":"Social Count"},"forum_pct":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Forum Pct"},"social_pct":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Social Pct"}},"additionalProperties":false,"type":"object","required":["forum_count","social_count","forum_pct","social_pct"],"title":"ChannelMix"},"ClusterJobRequest":{"properties":{"windowHours":{"type":"integer","enum":[24,48],"title":"Windowhours","default":48},"anchorAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Anchorat","description":"UTC anchor datetime. If omitted, backend resolves from event_date/created_at."}},"type":"object","title":"ClusterJobRequest","description":"POST /narratives/events/{event_id}/jobs/cluster body."},"ClusterSummaryResponse":{"properties":{"summary":{"type":"string","title":"Summary"}},"type":"object","required":["summary"],"title":"ClusterSummaryResponse"},"ClustersListResponse":{"properties":{"clusters":{"items":{"$ref":"#/components/schemas/NarrativeCluster"},"type":"array","title":"Clusters"}},"type":"object","required":["clusters"],"title":"ClustersListResponse"},"CollectionStartRequest":{"properties":{"sources":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Sources"}},"type":"object","title":"CollectionStartRequest"},"ColumnInfo":{"properties":{"columnName":{"type":"string","title":"Columnname"},"dataType":{"type":"string","title":"Datatype"},"isNullable":{"type":"string","title":"Isnullable"},"columnDefault":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Columndefault"}},"type":"object","required":["columnName","dataType","isNullable"],"title":"ColumnInfo"},"ConceptGroup":{"properties":{"id":{"type":"string","title":"Id","description":"Unique concept identifier","examples":["c1"]},"label":{"type":"string","title":"Label","description":"Human-readable label","examples":["Monetary Policy"]},"terms":{"items":{"$ref":"#/components/schemas/SearchTerm"},"type":"array","title":"Terms","description":"Search terms for this concept"},"proximity_required":{"type":"boolean","title":"Proximity Required","description":"If true, terms must appear near anchor terms","default":false},"anchor_terms":{"items":{"type":"string"},"type":"array","title":"Anchor Terms","description":"Terms that other terms must appear near when proximity is required"}},"type":"object","required":["id","label","terms"],"title":"ConceptGroup"},"ConfirmUploadRequest":{"properties":{"s3_key":{"type":"string","title":"S3 Key","description":"S3 key returned from the upload-url endpoint"}},"type":"object","required":["s3_key"],"title":"ConfirmUploadRequest"},"ConfirmUploadResponse":{"properties":{"press_release_text":{"type":"string","title":"Press Release Text","description":"Extracted plain text from the uploaded document"},"source_filename":{"type":"string","title":"Source Filename","description":"Original filename of the uploaded document"},"character_count":{"type":"integer","title":"Character Count","description":"Number of characters in the extracted text"}},"type":"object","required":["press_release_text","source_filename","character_count"],"title":"ConfirmUploadResponse"},"CorpusItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"eventId":{"type":"string","format":"uuid","title":"Eventid"},"source":{"$ref":"#/components/schemas/SourceKind"},"sourceId":{"type":"string","title":"Sourceid"},"platform":{"type":"string","title":"Platform"},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author"},"text":{"type":"string","title":"Text"},"postedAt":{"type":"string","format":"date-time","title":"Postedat"},"pulledAt":{"type":"string","format":"date-time","title":"Pulledat"},"pulledByRunId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Pulledbyrunid"},"collectionRunId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Collectionrunid"},"excludedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Excludedat"},"excludedReason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Excludedreason"}},"type":"object","required":["id","eventId","source","sourceId","platform","text","postedAt","pulledAt"],"title":"CorpusItem","description":"One comment snapshotted from Facet for clustering.\n\n``source_id`` is stringified because Facet stores forum posts.id as\nSERIAL INT and social_comments.id as BIGSERIAL BIGINT. We carry the\nopaque reference as text to avoid committing to one Python int width."},"CorpusListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CorpusItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"CorpusListResponse"},"CoverageAnalytics":{"properties":{"document_count":{"type":"integer","minimum":0.0,"title":"Document Count"},"raw_count":{"type":"integer","minimum":0.0,"title":"Raw Count"},"documents":{"items":{"$ref":"#/components/schemas/CoverageDocument"},"type":"array","title":"Documents"},"key_documents":{"items":{"type":"string"},"type":"array","title":"Key Documents"},"display_limit":{"type":"integer","minimum":0.0,"title":"Display Limit","default":3},"drivers":{"items":{"$ref":"#/components/schemas/DriverTally"},"type":"array","title":"Drivers"},"frame_slices":{"items":{"$ref":"#/components/schemas/FrameSlice"},"type":"array","title":"Frame Slices"},"show_distribution":{"type":"boolean","title":"Show Distribution"},"taxonomy":{"$ref":"#/components/schemas/CoverageTaxonomy"}},"additionalProperties":false,"type":"object","required":["document_count","raw_count","show_distribution","taxonomy"],"title":"CoverageAnalytics"},"CoverageDocument":{"properties":{"ref":{"type":"string","minLength":1,"title":"Ref"},"canonical_url":{"type":"string","minLength":1,"title":"Canonical Url"},"display_url":{"type":"string","title":"Display Url","default":""},"outlet_label":{"type":"string","title":"Outlet Label","default":""},"source_type":{"type":"string","enum":["web_search","wisma_news"],"title":"Source Type"},"title":{"type":"string","title":"Title","default":""},"excerpt":{"type":"string","title":"Excerpt","default":""},"timestamp":{"type":"string","title":"Timestamp","default":""},"framing_analysis":{"type":"string","title":"Framing Analysis","default":""},"primary_frame":{"type":"string","minLength":1,"title":"Primary Frame"},"driver_tags":{"items":{"type":"string"},"type":"array","title":"Driver Tags"}},"additionalProperties":false,"type":"object","required":["ref","canonical_url","source_type","primary_frame"],"title":"CoverageDocument"},"CoverageTaxonomy":{"properties":{"taxonomy_version":{"type":"string","title":"Taxonomy Version","default":"coverage_taxonomy.v1"},"taxonomy_hash":{"type":"string","minLength":1,"title":"Taxonomy Hash"},"frames":{"items":{"$ref":"#/components/schemas/TaxonomyFrame"},"type":"array","minItems":1,"title":"Frames"},"driver_definitions":{"items":{"$ref":"#/components/schemas/TaxonomyDriver"},"type":"array","title":"Driver Definitions"},"discovery_input_count":{"type":"integer","maximum":40.0,"minimum":0.0,"title":"Discovery Input Count"},"discovery_sample_method":{"type":"string","enum":["all","sha256_url_sample_40"],"title":"Discovery Sample Method"},"classifier_model":{"type":"string","title":"Classifier Model"},"classifier_prompt_hash":{"type":"string","title":"Classifier Prompt Hash"}},"additionalProperties":false,"type":"object","required":["taxonomy_hash","frames","discovery_input_count","discovery_sample_method","classifier_model","classifier_prompt_hash"],"title":"CoverageTaxonomy"},"DemographicsAggregateRequest":{"properties":{"socialPostIds":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Socialpostids"},"forumThreadIds":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Forumthreadids"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"},"filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters"}},"type":"object","title":"DemographicsAggregateRequest","description":"POST /demographics/aggregate body.\n\nTwo shapes are accepted:\n\n1. Explicit IDs — pass ``socialPostIds`` / ``forumThreadIds``\n   directly. Either list may be omitted / empty.\n2. Query mode — pass ``query`` + optional ``scope`` / ``filters``\n   and the service resolves to IDs via the search queries. Mirrors\n   the ``{query, scope, filters}`` shape the TS handler accepts\n   (see facet-frontend/src/app/api/demographics/aggregate/route.ts).\n\nWhen ``query`` is non-empty the service uses query mode and ignores\nthe explicit ID lists. When ``query`` is absent / empty the service\nuses whatever ID lists were supplied (may be empty → empty detail)."},"DemographicsDetail":{"properties":{"uniqueUsers":{"type":"integer","title":"Uniqueusers"},"profiledUsers":{"type":"integer","title":"Profiledusers"},"inauthenticPct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inauthenticpct"},"distributions":{"$ref":"#/components/schemas/DemographicsDistribution"},"users":{"items":{"$ref":"#/components/schemas/UserSummary"},"type":"array","title":"Users"}},"type":"object","required":["uniqueUsers","profiledUsers","distributions","users"],"title":"DemographicsDetail","description":"Full per-thread / per-post breakdown with per-user rows and aggregate distributions."},"DemographicsDistribution":{"properties":{"residencyStatus":{"additionalProperties":{"type":"integer"},"type":"object","title":"Residencystatus"},"gender":{"additionalProperties":{"type":"integer"},"type":"object","title":"Gender"},"race":{"additionalProperties":{"type":"integer"},"type":"object","title":"Race"},"ageBracket":{"additionalProperties":{"type":"integer"},"type":"object","title":"Agebracket"},"lifeStage":{"additionalProperties":{"type":"integer"},"type":"object","title":"Lifestage"},"employmentSector":{"additionalProperties":{"type":"integer"},"type":"object","title":"Employmentsector"},"socioeconomicStatus":{"additionalProperties":{"type":"integer"},"type":"object","title":"Socioeconomicstatus"},"inauthenticityClassification":{"additionalProperties":{"type":"integer"},"type":"object","title":"Inauthenticityclassification"}},"type":"object","title":"DemographicsDistribution","description":"Counts of each demographic dimension across the users surfaced in a detail view."},"DemographicsSummary":{"properties":{"uniqueUsers":{"type":"integer","title":"Uniqueusers"},"profiledUsers":{"type":"integer","title":"Profiledusers"},"inauthenticCount":{"type":"integer","title":"Inauthenticcount"},"suspiciousCount":{"type":"integer","title":"Suspiciouscount"},"likelyInauthenticCount":{"type":"integer","title":"Likelyinauthenticcount"},"inauthenticPct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inauthenticpct"},"watchedUserCount":{"type":"integer","title":"Watchedusercount"}},"type":"object","required":["uniqueUsers","profiledUsers","inauthenticCount","suspiciousCount","likelyInauthenticCount","watchedUserCount"],"title":"DemographicsSummary","description":"Per-thread / per-post summary row for feed cards."},"DirectSearchRequest":{"properties":{"query":{"type":"string","title":"Query","description":"Free-text search query to run against the news corpus","examples":["Singapore MAS interest rate policy 2025"]}},"type":"object","required":["query"],"title":"DirectSearchRequest"},"DriverTally":{"properties":{"driver_id":{"type":"string","minLength":1,"title":"Driver Id"},"label":{"type":"string","title":"Label"},"count":{"type":"integer","minimum":0.0,"title":"Count"},"denominator":{"type":"integer","minimum":0.0,"title":"Denominator"}},"additionalProperties":false,"type":"object","required":["driver_id","label","count","denominator"],"title":"DriverTally"},"EventAnalysisInputV1":{"properties":{"schema_version":{"type":"string","const":"event-analysis-input.v1","title":"Schema Version","default":"event-analysis-input.v1"},"title":{"type":"string","maxLength":500,"minLength":1,"title":"Title"},"summary":{"type":"string","maxLength":20000,"title":"Summary","default":""},"location":{"type":"string","maxLength":500,"title":"Location","default":""},"exact_anchor":{"type":"string","format":"date-time","title":"Exact Anchor"},"before_hours":{"type":"integer","maximum":744.0,"minimum":0.0,"title":"Before Hours","default":24},"after_hours":{"type":"integer","maximum":744.0,"minimum":0.0,"title":"After Hours","default":48},"normalized_keywords":{"items":{"type":"string"},"type":"array","maxItems":100,"title":"Normalized Keywords"},"normalized_exclusions":{"items":{"type":"string"},"type":"array","maxItems":100,"title":"Normalized Exclusions"},"jurisdiction":{"type":"string","maxLength":16,"minLength":2,"title":"Jurisdiction","default":"SG"}},"additionalProperties":false,"type":"object","required":["title","exact_anchor"],"title":"EventAnalysisInputV1","description":"The immutable input that defines one exact Radar event contract."},"EventAnalysisPatch":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Title"},"summary":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}],"title":"Summary"},"location":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Location"},"exact_anchor":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Exact Anchor"},"before_hours":{"anyOf":[{"type":"integer","maximum":744.0,"minimum":0.0},{"type":"null"}],"title":"Before Hours"},"after_hours":{"anyOf":[{"type":"integer","maximum":744.0,"minimum":0.0},{"type":"null"}],"title":"After Hours"},"normalized_keywords":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":100},{"type":"null"}],"title":"Normalized Keywords"},"normalized_exclusions":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":100},{"type":"null"}],"title":"Normalized Exclusions"},"jurisdiction":{"anyOf":[{"type":"string","maxLength":16,"minLength":2},{"type":"null"}],"title":"Jurisdiction"}},"additionalProperties":false,"type":"object","title":"EventAnalysisPatch","description":"Mutable request shape; a service converts it into a new V1 revision."},"EventContractRevisionResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"revision":{"type":"integer","title":"Revision"},"schema_version":{"type":"string","title":"Schema Version"},"contract_hash":{"type":"string","title":"Contract Hash"},"input":{"$ref":"#/components/schemas/EventAnalysisInputV1"},"exact_anchor":{"type":"string","format":"date-time","title":"Exact Anchor"},"before_hours":{"type":"integer","title":"Before Hours"},"after_hours":{"type":"integer","title":"After Hours"},"window_start":{"type":"string","format":"date-time","title":"Window Start"},"window_end":{"type":"string","format":"date-time","title":"Window End"},"jurisdiction":{"type":"string","title":"Jurisdiction"},"precision":{"$ref":"#/components/schemas/EventPrecision"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","event_id","revision","schema_version","contract_hash","input","exact_anchor","before_hours","after_hours","window_start","window_end","jurisdiction","precision","created_by","created_at"],"title":"EventContractRevisionResponse"},"EventCreate":{"properties":{"title":{"type":"string","title":"Title","description":"Short title describing the event","examples":["Singapore Port Explosion"]},"summary":{"type":"string","title":"Summary","description":"Longer narrative summary of the event","default":""},"location":{"type":"string","title":"Location","description":"Geographic location of the event","default":"","examples":["Singapore"]},"event_date":{"type":"string","title":"Event Date","description":"Date the event occurred (free-form text)","default":"","examples":["2025-04-10"]},"confidence":{"type":"string","title":"Confidence","description":"Confidence level in the event's validity","default":"medium","examples":["high","medium","low"]},"severity":{"type":"string","title":"Severity","description":"Assessed severity of the event","default":"medium","examples":["critical","high","medium","low"]},"status":{"type":"string","title":"Status","description":"Event tracking status","default":"active","examples":["active","closed"]}},"type":"object","required":["title"],"title":"EventCreate"},"EventDetail":{"properties":{"title":{"type":"string","title":"Title","description":"Short title describing the event","examples":["Singapore Port Explosion"]},"summary":{"type":"string","title":"Summary","description":"Longer narrative summary of the event","default":""},"location":{"type":"string","title":"Location","description":"Geographic location of the event","default":"","examples":["Singapore"]},"event_date":{"type":"string","title":"Event Date","description":"Date the event occurred (free-form text)","default":"","examples":["2025-04-10"]},"confidence":{"type":"string","title":"Confidence","description":"Confidence level in the event's validity","default":"medium","examples":["high","medium","low"]},"severity":{"type":"string","title":"Severity","description":"Assessed severity of the event","default":"medium","examples":["critical","high","medium","low"]},"status":{"type":"string","title":"Status","description":"Event tracking status","default":"active","examples":["active","closed"]},"id":{"type":"string","format":"uuid","title":"Id","description":"Unique event identifier"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"research_complete":{"type":"boolean","title":"Research Complete","description":"Whether multi-source research has been run","default":false},"finding_count":{"type":"integer","title":"Finding Count","description":"Number of research findings collected","default":0},"event_contract_revision":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Event Contract Revision","description":"Current exact event-analysis revision"},"event_contract_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Contract Hash","description":"Canonical hash for the current event-analysis input"},"exact_anchor_precision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exact Anchor Precision","description":"Exact or legacy anchor precision"},"stale_stages":{"items":{"type":"string"},"type":"array","title":"Stale Stages","description":"Dependent stages requiring explicit reruns"},"next_step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Step","description":"First explicit analyst action required"},"workflow_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow State","description":"Current matching-revision workflow state"},"lifecycle_status":{"type":"string","title":"Lifecycle Status","description":"Persistent-workspace lifecycle: draft | active_uncollected | active | paused | closed","default":"active"},"monitoring_start_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Monitoring Start At","description":"Open-ended coverage start (SGT anchor/precursor)"},"monitoring_end_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Monitoring End At","description":"Coverage end; null while monitoring is active"},"normalized_keywords":{"items":{"type":"string"},"type":"array","title":"Normalized Keywords","description":"Analyst-anchored search keywords from the current contract"},"normalized_exclusions":{"items":{"type":"string"},"type":"array","title":"Normalized Exclusions","description":"Analyst exclusion terms from the current contract"},"accumulated_facts":{"items":{"type":"string"},"type":"array","title":"Accumulated Facts","description":"Curated facts accumulated from research"},"findings":{"items":{"$ref":"#/components/schemas/FindingResponse"},"type":"array","title":"Findings","description":"Research findings from all sources"},"synthesis":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Synthesis","description":"Cross-source synthesis results (corroborated facts, contradictions, sentiment)"},"research_window":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Research Window","description":"Time window used by the last research run: {start, end, lookback_hours, anchor_source}. Dates are ISO-8601 UTC."},"identification_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Identification Query","description":"Free-text description the analyst submitted when identifying the event"},"identification_candidates":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Identification Candidates","description":"Candidate events returned by Claude for the last identify run"},"identification_selected_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Identification Selected Index","description":"0-based index into identification_candidates for the confirmed event, or null if none selected"}},"type":"object","required":["title","id","created_at","updated_at"],"title":"EventDetail"},"EventListResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/EventSummary"},"type":"array","title":"Events","description":"Paginated list of events"},"total":{"type":"integer","title":"Total","description":"Total number of events"},"page":{"type":"integer","minimum":1.0,"title":"Page","default":1},"per_page":{"type":"integer","minimum":1.0,"title":"Per Page","default":50},"total_pages":{"type":"integer","minimum":0.0,"title":"Total Pages","default":0},"has_next":{"type":"boolean","title":"Has Next","default":false},"has_previous":{"type":"boolean","title":"Has Previous","default":false}},"type":"object","required":["events","total"],"title":"EventListResponse"},"EventPrecision":{"type":"string","enum":["exact_v1","offset_aware_exact_unconfirmed","date_only_inferred_midnight","range_or_fuzzy_inferred","created_at_fallback","ambiguous"],"title":"EventPrecision"},"EventSortField":{"type":"string","enum":["created_at","updated_at"],"title":"EventSortField"},"EventSummary":{"properties":{"title":{"type":"string","title":"Title","description":"Short title describing the event","examples":["Singapore Port Explosion"]},"summary":{"type":"string","title":"Summary","description":"Longer narrative summary of the event","default":""},"location":{"type":"string","title":"Location","description":"Geographic location of the event","default":"","examples":["Singapore"]},"event_date":{"type":"string","title":"Event Date","description":"Date the event occurred (free-form text)","default":"","examples":["2025-04-10"]},"confidence":{"type":"string","title":"Confidence","description":"Confidence level in the event's validity","default":"medium","examples":["high","medium","low"]},"severity":{"type":"string","title":"Severity","description":"Assessed severity of the event","default":"medium","examples":["critical","high","medium","low"]},"status":{"type":"string","title":"Status","description":"Event tracking status","default":"active","examples":["active","closed"]},"id":{"type":"string","format":"uuid","title":"Id","description":"Unique event identifier"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"research_complete":{"type":"boolean","title":"Research Complete","description":"Whether multi-source research has been run","default":false},"finding_count":{"type":"integer","title":"Finding Count","description":"Number of research findings collected","default":0},"event_contract_revision":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Event Contract Revision","description":"Current exact event-analysis revision"},"event_contract_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Contract Hash","description":"Canonical hash for the current event-analysis input"},"exact_anchor_precision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exact Anchor Precision","description":"Exact or legacy anchor precision"},"stale_stages":{"items":{"type":"string"},"type":"array","title":"Stale Stages","description":"Dependent stages requiring explicit reruns"},"next_step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Step","description":"First explicit analyst action required"},"workflow_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow State","description":"Current matching-revision workflow state"},"lifecycle_status":{"type":"string","title":"Lifecycle Status","description":"Persistent-workspace lifecycle: draft | active_uncollected | active | paused | closed","default":"active"},"monitoring_start_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Monitoring Start At","description":"Open-ended coverage start (SGT anchor/precursor)"},"monitoring_end_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Monitoring End At","description":"Coverage end; null while monitoring is active"}},"type":"object","required":["title","id","created_at","updated_at"],"title":"EventSummary"},"EventUpdate":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Updated title"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary","description":"Updated summary"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location","description":"Updated location"},"event_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Date","description":"Updated event date"},"confidence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence","description":"Updated confidence level"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity","description":"Updated severity level"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Updated status"},"accumulated_facts":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Accumulated Facts","description":"Manually curated facts about the event"}},"type":"object","title":"EventUpdate"},"EvidenceDecision":{"properties":{"finding_id":{"type":"string","format":"uuid","title":"Finding Id"},"included":{"type":"boolean","title":"Included"},"reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Reason"}},"additionalProperties":false,"type":"object","required":["finding_id","included"],"title":"EvidenceDecision"},"EvidenceMember":{"properties":{"finding_id":{"type":"string","format":"uuid","title":"Finding Id"},"included":{"type":"boolean","title":"Included"},"timestamp_policy":{"$ref":"#/components/schemas/TimestampPolicy"},"membership_hash":{"type":"string","title":"Membership Hash"}},"type":"object","required":["finding_id","included","timestamp_policy","membership_hash"],"title":"EvidenceMember"},"EvidenceSetCreate":{"properties":{"decisions":{"items":{"$ref":"#/components/schemas/EvidenceDecision"},"type":"array","maxItems":10000,"minItems":1,"title":"Decisions"},"idempotency_key":{"type":"string","maxLength":200,"minLength":1,"title":"Idempotency Key"},"if_match":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"If Match"}},"additionalProperties":false,"type":"object","required":["decisions","idempotency_key"],"title":"EvidenceSetCreate"},"EvidenceSetResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"research_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Research Run Id"},"parent_evidence_set_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Evidence Set Id"},"revision":{"type":"integer","title":"Revision"},"set_hash":{"type":"string","title":"Set Hash"},"members":{"items":{"$ref":"#/components/schemas/EvidenceMember"},"type":"array","title":"Members"},"synthesis_state":{"$ref":"#/components/schemas/EvidenceSynthesisState"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","event_id","revision","set_hash","members","synthesis_state","created_by","created_at"],"title":"EvidenceSetResponse"},"EvidenceSetsResponse":{"properties":{"sets":{"items":{"$ref":"#/components/schemas/EvidenceSetResponse"},"type":"array","title":"Sets"}},"type":"object","required":["sets"],"title":"EvidenceSetsResponse"},"EvidenceSynthesisRequest":{"properties":{"evidence_set_id":{"type":"string","format":"uuid","title":"Evidence Set Id"},"idempotency_key":{"type":"string","maxLength":200,"minLength":1,"title":"Idempotency Key"}},"additionalProperties":false,"type":"object","required":["evidence_set_id","idempotency_key"],"title":"EvidenceSynthesisRequest"},"EvidenceSynthesisResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"evidence_set_id":{"type":"string","format":"uuid","title":"Evidence Set Id"},"event_contract_revision":{"type":"integer","title":"Event Contract Revision"},"event_contract_hash":{"type":"string","title":"Event Contract Hash"},"state":{"$ref":"#/components/schemas/EvidenceSynthesisState"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"result_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result Hash"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"requested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Requested At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"job_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Job Id"}},"type":"object","required":["id","event_id","evidence_set_id","event_contract_revision","event_contract_hash","state","created_at"],"title":"EvidenceSynthesisResponse"},"EvidenceSynthesisState":{"type":"string","enum":["not_started","pending","running","completed","failed","superseded"],"title":"EvidenceSynthesisState"},"ExcludeRequest":{"properties":{"itemIds":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Itemids"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["itemIds"],"title":"ExcludeRequest"},"ExcludeResponse":{"properties":{"excluded":{"type":"integer","title":"Excluded"}},"type":"object","required":["excluded"],"title":"ExcludeResponse"},"ExplorerDataResponse":{"properties":{"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"total":{"type":"integer","title":"Total"},"columns":{"items":{"$ref":"#/components/schemas/ColumnInfo"},"type":"array","title":"Columns"}},"type":"object","required":["rows","total","columns"],"title":"ExplorerDataResponse"},"ExtractFactsRequest":{"properties":{"max_facts":{"type":"integer","title":"Max Facts","description":"Maximum number of facts to extract","examples":[20]},"num_facts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Num Facts","description":"Target number of facts (hint for the AI). If omitted, extracts up to max_facts."}},"type":"object","required":["max_facts"],"title":"ExtractFactsRequest"},"FacetLinkEntry":{"properties":{"threadTitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Threadtitle"},"threadExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Threadexternalid"},"authorExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorexternalid"},"parentPostExcerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parentpostexcerpt"},"parentPostId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parentpostid"}},"type":"object","title":"FacetLinkEntry"},"FacetLinksResponse":{"properties":{"links":{"additionalProperties":{"$ref":"#/components/schemas/FacetLinkEntry"},"type":"object","title":"Links"}},"type":"object","required":["links"],"title":"FacetLinksResponse"},"FactItem":{"properties":{"id":{"type":"integer","title":"Id","description":"Fact number (1-based sequential ID)"},"fact":{"type":"string","title":"Fact","description":"The factual claim text","examples":["Revenue grew 15% year-over-year to $2.1B"]}},"type":"object","required":["id","fact"],"title":"FactItem"},"FactsResponse":{"properties":{"facts":{"items":{"$ref":"#/components/schemas/FactItem"},"type":"array","title":"Facts","description":"The saved facts"},"count":{"type":"integer","title":"Count","description":"Number of facts saved"}},"type":"object","required":["facts","count"],"title":"FactsResponse"},"FactsUpdate":{"properties":{"facts":{"items":{"$ref":"#/components/schemas/FactItem"},"type":"array","title":"Facts","description":"Complete list of confirmed facts (replaces existing)"}},"type":"object","required":["facts"],"title":"FactsUpdate"},"FindingExcludeRequest":{"properties":{"finding_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Finding Ids","description":"IDs of findings to mark as unrelated"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Optional free-text rationale"}},"type":"object","required":["finding_ids"],"title":"FindingExcludeRequest"},"FindingExclusionResponse":{"properties":{"affected":{"type":"integer","title":"Affected","description":"Number of findings updated"}},"type":"object","required":["affected"],"title":"FindingExclusionResponse"},"FindingIncludeRequest":{"properties":{"finding_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Finding Ids","description":"IDs of findings to re-include"}},"type":"object","required":["finding_ids"],"title":"FindingIncludeRequest"},"FindingResponse":{"properties":{"text":{"type":"string","title":"Text","description":"Finding content / extracted text"},"source_type":{"type":"string","title":"Source Type","description":"Origin of the finding","examples":["web_search","wisma_news","wisma_forum","wisma_social"]},"source_label":{"type":"string","title":"Source Label","description":"Human-readable source name","examples":["Google Search","Moreover News","HardwareZone Forum"]},"url":{"type":"string","title":"Url","description":"Source URL, if available","default":""},"title":{"type":"string","title":"Title","description":"Title of the source document or article","default":""},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp","description":"Publication or retrieval timestamp"},"ref":{"type":"string","title":"Ref","description":"Citation marker used in the SITREP","default":"","examples":["W1","N2","F3"]},"parent_ref":{"type":"string","title":"Parent Ref","description":"Stable parent-conversation key (forum thread URL / social post id). Empty for standalone findings such as news/web. Transient carrier for parent-level relevance grouping; not persisted.","default":""},"parent_text":{"type":"string","title":"Parent Text","description":"Parent-conversation context (forum thread title / social original-post text) supplied when relevance-filtering child comments. Transient; not persisted.","default":""},"id":{"type":"string","format":"uuid","title":"Id","description":"Unique finding identifier"},"event_id":{"type":"string","format":"uuid","title":"Event Id","description":"Associated event ID"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"first_seen_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"First Seen Run Id","description":"research_runs.id of the run that first introduced this finding"},"last_seen_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Last Seen Run Id","description":"research_runs.id of the most recent run that re-surfaced it"},"first_seen_collection_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"First Seen Collection Run Id","description":"collection_run_.id that first surfaced this finding (persistent-workspace delta)"},"dropped_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dropped At","description":"When the finding stopped being surfaced; NULL while currently active"},"excluded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Excluded At","description":"When the analyst marked this finding as unrelated; downstream stages should skip it"},"excluded_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Excluded Reason","description":"Optional free-text rationale for the exclusion"}},"type":"object","required":["text","source_type","source_label","id","event_id","created_at"],"title":"FindingResponse"},"Forum":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"sourceId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sourceid"}},"type":"object","required":["id","name"],"title":"Forum","description":"Mirrors TS ``Forum``."},"ForumActivityItem":{"properties":{"kind":{"type":"string","const":"forum","title":"Kind","default":"forum"},"id":{"type":"integer","title":"Id"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"threadId":{"type":"integer","title":"Threadid"},"threadTitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Threadtitle"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"}},"type":"object","required":["id","createdAt","threadId"],"title":"ForumActivityItem","description":"One forum post authored by a category member."},"ForumDemographicsBatchRequest":{"properties":{"threadIds":{"items":{"type":"integer"},"type":"array","title":"Threadids"}},"type":"object","required":["threadIds"],"title":"ForumDemographicsBatchRequest","description":"POST /forums/demographics/batch body."},"ForumFeedFilters":{"properties":{"dateFrom":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Datefrom"},"dateTo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dateto"},"sourceIds":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Sourceids"},"forumIds":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Forumids"}},"type":"object","title":"ForumFeedFilters","description":"Optional filter dict nested inside the forum feed request body."},"ForumFeedRequest":{"properties":{"page":{"type":"integer","title":"Page","default":1},"perPage":{"type":"integer","title":"Perpage","default":30},"sortBy":{"type":"string","enum":["recent","engagement"],"title":"Sortby","default":"recent"},"filters":{"$ref":"#/components/schemas/ForumFeedFilters"}},"type":"object","title":"ForumFeedRequest","description":"POST /forums/feed body.\n\nDefaults mirror ``facet-frontend/src/app/api/forums/feed/route.ts``:\n``page=1, perPage=30, sortBy=\"recent\"``. The FORUM_ALLOWLIST is\nalways applied by the query layer — callers cannot bypass it."},"ForumFeedResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/ThreadWithDetails"},"type":"array","title":"Results"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["results","total"],"title":"ForumFeedResponse","description":"POST /forums/feed response."},"ForumPost":{"properties":{"id":{"type":"integer","title":"Id"},"threadId":{"type":"integer","title":"Threadid"},"userId":{"type":"integer","title":"Userid"},"sourceUniquePostId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sourceuniquepostid"},"content":{"type":"string","title":"Content"},"replyingToUserId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Replyingtouserid"},"replyingToContent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replyingtocontent"},"replyingToPostId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Replyingtopostid"},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Imageurl"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"userName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"}},"type":"object","required":["id","threadId","userId","content","createdAt"],"title":"ForumPost","description":"Mirrors TS ``ForumPost`` — a single post inside a thread.\n\n``userName`` is denormalised from ``users.username`` so the frontend\ncan render authors without a follow-up query."},"ForumPostsResponse":{"properties":{"posts":{"items":{"$ref":"#/components/schemas/ForumPost"},"type":"array","title":"Posts"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["posts","total"],"title":"ForumPostsResponse","description":"GET /forums/posts/{threadId} response."},"ForumSearchBucket":{"properties":{"results":{"items":{"$ref":"#/components/schemas/ThreadWithMatchingExcerpt"},"type":"array","title":"Results"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["results","total"],"title":"ForumSearchBucket","description":"Forum sub-section of the search response."},"FrameSlice":{"properties":{"frame_id":{"type":"string","minLength":1,"title":"Frame Id"},"label":{"type":"string","title":"Label"},"count":{"type":"integer","minimum":0.0,"title":"Count"},"pct":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Pct"}},"additionalProperties":false,"type":"object","required":["frame_id","label","count","pct"],"title":"FrameSlice"},"FrozenReference":{"properties":{"ref":{"type":"string","minLength":1,"title":"Ref"},"source_type":{"type":"string","enum":["web_search","wisma_news","wisma_forum","wisma_social"],"title":"Source Type"},"source_label":{"type":"string","title":"Source Label"},"title":{"type":"string","title":"Title","default":""},"url":{"type":"string","title":"Url","default":""},"timestamp":{"type":"string","title":"Timestamp","default":""},"excerpt":{"type":"string","title":"Excerpt","default":""},"parent_url":{"type":"string","title":"Parent Url","default":""},"parent_title":{"type":"string","title":"Parent Title","default":""}},"additionalProperties":false,"type":"object","required":["ref","source_type","source_label"],"title":"FrozenReference"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IdentifyRequest":{"properties":{"description":{"type":"string","title":"Description","description":"Free-text description of an event to identify via LLM web search","examples":["Explosion at Jurong Island petrochemical complex in early April 2025"]}},"type":"object","required":["description"],"title":"IdentifyRequest"},"IncludeRequest":{"properties":{"itemIds":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Itemids"}},"type":"object","required":["itemIds"],"title":"IncludeRequest"},"InvestigationAttemptCreate":{"properties":{"mode":{"$ref":"#/components/schemas/InvestigationMode"},"description":{"type":"string","maxLength":20000,"title":"Description","default":""},"input":{"anyOf":[{"$ref":"#/components/schemas/EventAnalysisInputV1"},{"type":"null"}]},"idempotency_key":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Idempotency Key"},"ttl_hours":{"type":"integer","maximum":24.0,"minimum":1.0,"title":"Ttl Hours","default":24}},"additionalProperties":false,"type":"object","required":["mode"],"title":"InvestigationAttemptCreate"},"InvestigationAttemptResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"mode":{"$ref":"#/components/schemas/InvestigationMode"},"status":{"$ref":"#/components/schemas/InvestigationAttemptStatus"},"description":{"type":"string","title":"Description"},"input":{"anyOf":[{"$ref":"#/components/schemas/EventAnalysisInputV1"},{"type":"null"}]},"candidates":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Candidates"},"job_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Job Id"},"confirmed_event_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Confirmed Event Id"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","mode","status","description","expires_at","created_at","updated_at"],"title":"InvestigationAttemptResponse"},"InvestigationAttemptStatus":{"type":"string","enum":["pending","identifying","ready","confirmed","cancelled","failed","expired","abandoned"],"title":"InvestigationAttemptStatus"},"InvestigationConfirmRequest":{"properties":{"idempotency_key":{"type":"string","maxLength":200,"minLength":1,"title":"Idempotency Key"},"candidate_index":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Candidate Index"},"input":{"anyOf":[{"$ref":"#/components/schemas/EventAnalysisInputV1"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["idempotency_key"],"title":"InvestigationConfirmRequest"},"InvestigationMode":{"type":"string","enum":["identify","manual"],"title":"InvestigationMode"},"JobResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Unique job identifier"},"project_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id","description":"Associated fact-checker project ID, if any"},"event_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Event Id","description":"Associated Radar event ID, if any"},"type":{"type":"string","title":"Type","description":"Job type","examples":["extract_facts","run_search","analyze","generate_report","wr_research","wr_sitrep"]},"status":{"type":"string","title":"Status","description":"Current job status","examples":["pending","running","completed","failed"]},"progress":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress","description":"Human-readable progress message"},"result":{"anyOf":[{},{"type":"null"}],"title":"Result","description":"Job output data on completion"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if the job failed"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"Timestamp when the job finished"}},"type":"object","required":["id","type","status","created_at"],"title":"JobResponse"},"ManualClassification":{"properties":{"userProfileId":{"type":"string","title":"Userprofileid"},"classification":{"type":"string","enum":["authentic","suspicious","likely_inauthentic"],"title":"Classification"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"classifiedBy":{"type":"string","title":"Classifiedby"},"classifiedAt":{"type":"string","format":"date-time","title":"Classifiedat"},"updatedAt":{"type":"string","format":"date-time","title":"Updatedat"}},"type":"object","required":["userProfileId","classification","classifiedBy","classifiedAt","updatedAt"],"title":"ManualClassification","description":"One row of agate.manual_user_classification."},"ManualClassificationRequest":{"properties":{"classification":{"type":"string","enum":["authentic","suspicious","likely_inauthentic"],"title":"Classification"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["classification"],"title":"ManualClassificationRequest","description":"PUT /user-profiles/{id}/classification body."},"MinorRollup":{"properties":{"cluster_count":{"type":"integer","minimum":1.0,"title":"Cluster Count"},"share_pct":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Share Pct"},"assigned_count":{"type":"integer","minimum":0.0,"title":"Assigned Count"}},"additionalProperties":false,"type":"object","required":["cluster_count","share_pct","assigned_count"],"title":"MinorRollup"},"Movement":{"properties":{"label":{"type":"string","enum":["Rising","Falling","Stable","Emerging","Insufficient data"],"title":"Label"},"delta_pp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Delta Pp"}},"additionalProperties":false,"type":"object","required":["label","delta_pp"],"title":"Movement"},"NarrativeAnalytics":{"properties":{"narrative_run_id":{"type":"string","title":"Narrative Run Id"},"window_start":{"type":"string","title":"Window Start"},"window_end":{"type":"string","title":"Window End"},"final_bucket_start":{"type":"string","title":"Final Bucket Start"},"final_bucket_total":{"type":"integer","minimum":0.0,"title":"Final Bucket Total"},"window_total_assigned":{"type":"integer","minimum":0.0,"title":"Window Total Assigned"},"card_population_total":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Card Population Total"},"cards":{"items":{"$ref":"#/components/schemas/NarrativeCard"},"type":"array","maxItems":4,"title":"Cards"},"chart_clusters":{"items":{"$ref":"#/components/schemas/NarrativeChartCluster"},"type":"array","title":"Chart Clusters"},"minor":{"anyOf":[{"$ref":"#/components/schemas/MinorRollup"},{"type":"null"}]},"unclassified_count":{"type":"integer","minimum":0.0,"title":"Unclassified Count"},"unclassified_pct":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Unclassified Pct"},"series":{"items":{"$ref":"#/components/schemas/SeriesBucket"},"type":"array","title":"Series"},"movement_min_n_per_half":{"type":"integer","minimum":1.0,"title":"Movement Min N Per Half","default":5}},"additionalProperties":false,"type":"object","required":["narrative_run_id","window_start","window_end","final_bucket_start","final_bucket_total","window_total_assigned","unclassified_count","unclassified_pct"],"title":"NarrativeAnalytics"},"NarrativeCard":{"properties":{"cluster_id":{"type":"string","minLength":1,"title":"Cluster Id"},"rank":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"Rank"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description"},"color_hex":{"type":"string","title":"Color Hex"},"share_pct":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Share Pct"},"assigned_count":{"type":"integer","minimum":0.0,"title":"Assigned Count"},"channel_mix":{"$ref":"#/components/schemas/ChannelMix"},"movement":{"$ref":"#/components/schemas/Movement"},"representative_quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Quote"},"quote_provenance":{"anyOf":[{"type":"string","const":"cluster_curated"},{"type":"null"}],"title":"Quote Provenance"}},"additionalProperties":false,"type":"object","required":["cluster_id","rank","label","description","color_hex","share_pct","assigned_count","channel_mix","movement"],"title":"NarrativeCard"},"NarrativeChartCluster":{"properties":{"cluster_id":{"type":"string","minLength":1,"title":"Cluster Id"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description","default":""},"color_hex":{"type":"string","title":"Color Hex"}},"additionalProperties":false,"type":"object","required":["cluster_id","label","color_hex"],"title":"NarrativeChartCluster"},"NarrativeCluster":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"eventId":{"type":"string","format":"uuid","title":"Eventid"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description"},"representativeQuotes":{"items":{"type":"string"},"type":"array","title":"Representativequotes"},"colorHex":{"type":"string","title":"Colorhex"},"createdByRunId":{"type":"string","format":"uuid","title":"Createdbyrunid"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"archivedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archivedat"}},"type":"object","required":["id","eventId","label","description","colorHex","createdByRunId","createdAt"],"title":"NarrativeCluster","description":"One stance cluster for an event.\n\ncolor_hex is server-assigned from NARRATIVE_PALETTE (see palette.py);\nthe LLM never chooses colors."},"NarrativeRun":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"eventId":{"type":"string","format":"uuid","title":"Eventid"},"kind":{"$ref":"#/components/schemas/RunKind"},"status":{"$ref":"#/components/schemas/RunStatus"},"windowStart":{"type":"string","format":"date-time","title":"Windowstart"},"windowEnd":{"type":"string","format":"date-time","title":"Windowend"},"corpusItemCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Corpusitemcount"},"clustersBefore":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Clustersbefore"},"clustersSpawned":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Clustersspawned"},"assignmentsMade":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignmentsmade"},"unclassifiedCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unclassifiedcount"},"commentsBehind":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Commentsbehind"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"startedAt":{"type":"string","format":"date-time","title":"Startedat"},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completedat"}},"type":"object","required":["id","eventId","kind","status","windowStart","windowEnd","startedAt"],"title":"NarrativeRun","description":"One row from narrative_runs. Audit log + provenance."},"NoiseExclusion":{"properties":{"phrase":{"type":"string","title":"Phrase","description":"Phrase to exclude from results","examples":["sponsored content"]},"language":{"type":"string","title":"Language","description":"ISO 639-1 language code","default":"en"},"target_field":{"type":"string","title":"Target Field","description":"Which document field to apply exclusion to","default":"content"}},"type":"object","required":["phrase"],"title":"NoiseExclusion"},"ParticipatedSocialPost":{"properties":{"kind":{"type":"string","const":"social","title":"Kind","default":"social"},"id":{"type":"integer","title":"Id"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"lastMemberActivity":{"type":"string","format":"date-time","title":"Lastmemberactivity"},"memberCommentCount":{"type":"integer","title":"Membercommentcount"}},"type":"object","required":["id","lastMemberActivity","memberCommentCount"],"title":"ParticipatedSocialPost","description":"Social post members commented on."},"ParticipatedThread":{"properties":{"kind":{"type":"string","const":"forum","title":"Kind","default":"forum"},"id":{"type":"integer","title":"Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"lastMemberActivity":{"type":"string","format":"date-time","title":"Lastmemberactivity"},"memberPostCount":{"type":"integer","title":"Memberpostcount"}},"type":"object","required":["id","lastMemberActivity","memberPostCount"],"title":"ParticipatedThread","description":"Forum thread members contributed to."},"PasteTextRequest":{"properties":{"text":{"type":"string","title":"Text","description":"Press release text pasted directly by the user"}},"type":"object","required":["text"],"title":"PasteTextRequest"},"PasteTextResponse":{"properties":{"press_release_text":{"type":"string","title":"Press Release Text","description":"The saved press release text"},"character_count":{"type":"integer","title":"Character Count","description":"Number of characters in the text"}},"type":"object","required":["press_release_text","character_count"],"title":"PasteTextResponse"},"ProjectCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Display name for the fact-check project","examples":["Q3 Earnings Press Release"]}},"type":"object","required":["name"],"title":"ProjectCreate"},"ProjectDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Unique project identifier"},"name":{"type":"string","title":"Name","description":"Display name"},"user_id":{"type":"string","title":"User Id","description":"Owner's Clerk user ID"},"status":{"type":"string","title":"Status","description":"Current workflow status"},"current_step":{"type":"integer","title":"Current Step","description":"Current step in the wizard (1-6)"},"press_release_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Press Release Text","description":"Extracted text from the uploaded press release"},"source_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Filename","description":"Original uploaded filename"},"facts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Facts","description":"Extracted factual claims","default":[]},"query_spec":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Query Spec","description":"OpenSearch query specification"},"articles":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Articles","description":"Discovered news articles","default":[]},"selected_article_urls":{"items":{"type":"string"},"type":"array","title":"Selected Article Urls","description":"URLs of articles selected for analysis","default":[]},"analysis_results":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Analysis Results","description":"Per-article analysis results","default":[]},"search_round":{"type":"integer","title":"Search Round","description":"Current search iteration number","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","user_id","status","current_step","created_at","updated_at"],"title":"ProjectDetail"},"ProjectListResponse":{"properties":{"projects":{"items":{"$ref":"#/components/schemas/ProjectSummary"},"type":"array","title":"Projects","description":"Paginated list of projects"},"total":{"type":"integer","title":"Total","description":"Total number of projects matching the query"},"page":{"type":"integer","title":"Page","description":"Current page number (1-based)"},"per_page":{"type":"integer","title":"Per Page","description":"Number of projects per page"}},"type":"object","required":["projects","total","page","per_page"],"title":"ProjectListResponse"},"ProjectSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Unique project identifier"},"name":{"type":"string","title":"Name","description":"Display name"},"status":{"type":"string","title":"Status","description":"Current workflow status","examples":["draft","in_progress","completed"]},"current_step":{"type":"integer","title":"Current Step","description":"Current step in the wizard (1-6)"},"articles_analyzed":{"type":"integer","title":"Articles Analyzed","description":"Number of articles that have been analyzed","default":0},"articles_with_deviations":{"type":"integer","title":"Articles With Deviations","description":"Number of articles containing at least one deviation","default":0},"total_deviations":{"type":"integer","title":"Total Deviations","description":"Total deviation count across all articles","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","status","current_step","created_at","updated_at"],"title":"ProjectSummary"},"ProjectUpdate":{"properties":{"name":{"type":"string","title":"Name","description":"New display name for the project"}},"type":"object","required":["name"],"title":"ProjectUpdate"},"QuerySpec":{"properties":{"topic":{"type":"string","title":"Topic","description":"High-level topic description","examples":["Singapore MAS monetary policy announcement"]},"date_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Start","description":"Start date filter (ISO 8601)","examples":["2025-01-01"]},"date_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date End","description":"End date filter (ISO 8601)","examples":["2025-04-12"]},"concepts":{"items":{"$ref":"#/components/schemas/ConceptGroup"},"type":"array","title":"Concepts","description":"Concept groups defining the search vocabulary"},"groups":{"items":{"$ref":"#/components/schemas/BooleanGroup"},"type":"array","title":"Groups","description":"Boolean groups combining concepts with AND/OR/NOT logic"},"noise_exclusions":{"items":{"$ref":"#/components/schemas/NoiseExclusion"},"type":"array","title":"Noise Exclusions","description":"Phrases to exclude from search results"},"slop":{"type":"integer","title":"Slop","description":"Maximum word distance for proximity queries","default":30},"max_gaps":{"type":"integer","title":"Max Gaps","description":"Maximum gaps for interval queries","default":80},"country_filter":{"type":"string","title":"Country Filter","description":"Country to filter results by","default":"Singapore"}},"type":"object","required":["topic","concepts","groups"],"title":"QuerySpec"},"QuerySpecResponse":{"properties":{"query_spec":{"additionalProperties":true,"type":"object","title":"Query Spec","description":"The saved query specification"},"topic":{"type":"string","title":"Topic","description":"Topic extracted from the query spec"}},"type":"object","required":["query_spec","topic"],"title":"QuerySpecResponse"},"ReassignmentRequest":{"properties":{"clusterId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clusterid"},"exclude":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Exclude"}},"type":"object","title":"ReassignmentRequest","description":"Body for PATCH /events/{event_id}/assignments/{item_id}.\n\ncluster_id: UUID string (move to this cluster), or None (un-assign).\nexclude:    if True, set excluded_at on the corpus item; cluster_id is ignored."},"ReassignmentResponse":{"properties":{"itemId":{"type":"string","title":"Itemid"},"clusterId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clusterid"},"excludedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Excludedat"},"manuallyReassigned":{"type":"boolean","title":"Manuallyreassigned"}},"type":"object","required":["itemId","manuallyReassigned"],"title":"ReassignmentResponse"},"RefreshJobRequest":{"properties":{},"type":"object","title":"RefreshJobRequest","description":"POST /narratives/events/{event_id}/jobs/classify body. No fields — empty body accepted."},"ReportGenerateRequest":{"properties":{"format":{"type":"string","title":"Format","description":"Report output format","default":"docx","examples":["docx","pdf"]}},"type":"object","title":"ReportGenerateRequest"},"ReportListResponse":{"properties":{"reports":{"items":{"$ref":"#/components/schemas/ReportResponse"},"type":"array","title":"Reports","description":"List of generated reports, newest first"}},"type":"object","required":["reports"],"title":"ReportListResponse"},"ReportResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Unique report identifier"},"format":{"type":"string","title":"Format","description":"Report format (docx or pdf)"},"filename":{"type":"string","title":"Filename","description":"Generated filename","examples":["agate-report-Q3-Earnings-2025-04-12.docx"]},"download_url":{"type":"string","title":"Download Url","description":"Presigned S3 URL to download the report (expires in 24h)"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","format","filename","download_url","created_at"],"title":"ReportResponse"},"ResearchRequest":{"properties":{"extra_facts":{"items":{"type":"string"},"type":"array","title":"Extra Facts","description":"Additional facts to guide research queries","default":[]},"max_rounds":{"type":"integer","maximum":3.0,"minimum":1.0,"title":"Max Rounds","description":"Number of research rounds (1-3). More rounds find deeper information but take longer.","default":1},"lookback_hours":{"type":"integer","maximum":720.0,"minimum":1.0,"title":"Lookback Hours","description":"How many hours before the event anchor to start the research window. Default 12h. Max 30 days.","default":12}},"type":"object","title":"ResearchRequest"},"ResearchRunSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"status":{"type":"string","title":"Status","description":"'running' | 'succeeded' | 'failed'"},"window_start":{"type":"string","format":"date-time","title":"Window Start"},"window_end":{"type":"string","format":"date-time","title":"Window End"},"lookback_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Lookback Hours"},"anchor_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anchor Source"},"rounds_requested":{"type":"integer","title":"Rounds Requested"},"rounds_completed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rounds Completed"},"total_findings":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Findings"},"new_findings":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"New Findings"},"re_seen_findings":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Re Seen Findings"},"dropped_findings":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dropped Findings"},"by_source":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"By Source"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","event_id","status","window_start","window_end","rounds_requested","started_at"],"title":"ResearchRunSummary"},"ResearchRunsResponse":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/ResearchRunSummary"},"type":"array","title":"Runs"}},"type":"object","required":["runs"],"title":"ResearchRunsResponse"},"ResetAndSearchRequest":{"properties":{"keep_analyzed":{"type":"boolean","title":"Keep Analyzed","description":"If true, keep articles that have already been analyzed","default":false},"additional_queries":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Additional Queries","description":"Optional extra queries to append to the search"}},"type":"object","title":"ResetAndSearchRequest"},"RunKind":{"type":"string","enum":["initial","refresh"],"title":"RunKind"},"RunSearchRequest":{"properties":{"additional_queries":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Additional Queries","description":"Optional extra queries to append to the generated QuerySpec search"}},"type":"object","title":"RunSearchRequest"},"RunSearchResponse":{"properties":{"job_id":{"type":"string","format":"uuid","title":"Job Id","description":"Background job ID"},"search_round":{"type":"integer","title":"Search Round","description":"Search iteration number for this run"}},"type":"object","required":["job_id","search_round"],"title":"RunSearchResponse"},"RunStateResponse":{"properties":{"runId":{"type":"string","title":"Runid"},"clusters":{"items":{"$ref":"#/components/schemas/NarrativeCluster"},"type":"array","title":"Clusters"},"items":{"items":{"$ref":"#/components/schemas/CorpusItem"},"type":"array","title":"Items"},"assignments":{"items":{"$ref":"#/components/schemas/Assignment"},"type":"array","title":"Assignments"}},"type":"object","required":["runId","clusters","items","assignments"],"title":"RunStateResponse","description":"Clusters + corpus items + assignments as they existed at end of a run."},"RunStatus":{"type":"string","enum":["running","succeeded","failed"],"title":"RunStatus"},"RunSummary":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","title":"Kind"},"status":{"type":"string","title":"Status"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Startedat"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completedat"},"corpusItemCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Corpusitemcount"},"clustersSpawned":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Clustersspawned"},"windowStart":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Windowstart"},"windowEnd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Windowend"}},"type":"object","required":["id","kind","status"],"title":"RunSummary","description":"Lightweight run summary for the run-playback timeline list."},"RunsDiffResponse":{"properties":{"fromRun":{"type":"string","title":"Fromrun"},"toRun":{"type":"string","title":"Torun"},"itemsAdded":{"additionalProperties":true,"type":"object","title":"Itemsadded"},"itemsReclassifiedCount":{"type":"integer","title":"Itemsreclassifiedcount"},"clustersAdded":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Clustersadded"},"clustersArchived":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Clustersarchived"},"clustersRenamed":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Clustersrenamed"},"clusterCountsByLabel":{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object","title":"Clustercountsbylabel"}},"type":"object","required":["fromRun","toRun","itemsAdded","itemsReclassifiedCount","clustersAdded","clustersArchived","clustersRenamed"],"title":"RunsDiffResponse","description":"Aggregated delta between two completed runs."},"SearchFilters":{"properties":{"platforms":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Platforms"},"dateFrom":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Datefrom"},"dateTo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dateto"},"sourceIds":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Sourceids"}},"type":"object","title":"SearchFilters","description":"Optional filter dict nested inside every search request.\n\n``platforms`` applies to the social branch only; ``source_ids``\napplies to the forum branch only; ``date_from`` / ``date_to`` apply\nto both. All fields are optional — omit entirely to skip a filter."},"SearchHistoryEntry":{"properties":{"job_id":{"type":"string","format":"uuid","title":"Job Id","description":"Job ID for this search round"},"query":{"type":"string","title":"Query","description":"OpenSearch query that was executed"},"new_articles_count":{"type":"integer","title":"New Articles Count","description":"Number of new articles found in this round"},"total_articles":{"type":"integer","title":"Total Articles","description":"Cumulative article count after this round"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["job_id","query","new_articles_count","total_articles","created_at"],"title":"SearchHistoryEntry"},"SearchHistoryResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/SearchHistoryEntry"},"type":"array","title":"Entries","description":"Chronological list of search rounds"}},"type":"object","required":["entries"],"title":"SearchHistoryResponse"},"SearchRequest":{"properties":{"query":{"type":"string","title":"Query","default":""},"scope":{"type":"string","enum":["all","social","forums"],"title":"Scope","default":"all"},"filters":{"$ref":"#/components/schemas/SearchFilters"},"page":{"type":"integer","title":"Page","default":1},"perPage":{"type":"integer","title":"Perpage","default":20}},"type":"object","title":"SearchRequest","description":"POST /facet/search body.\n\nDefaults mirror the TS handler: ``scope=\"all\"``, ``page=1``,\n``perPage=20``, empty filters."},"SearchResponse":{"properties":{"social":{"$ref":"#/components/schemas/SocialSearchBucket"},"forums":{"$ref":"#/components/schemas/ForumSearchBucket"}},"type":"object","required":["social","forums"],"title":"SearchResponse","description":"POST /facet/search response body.\n\nMirrors the TS ``SearchResponse`` shape: always returns both\n``social`` and ``forums`` buckets (empty-but-present when the scope\nexcludes that branch). ``timing`` from the TS handler is deliberately\ndropped — it's observability noise that the frontend does not use."},"SearchTerm":{"properties":{"text":{"type":"string","title":"Text","description":"The search term or phrase","examples":["interest rate"]},"language":{"type":"string","title":"Language","description":"ISO 639-1 language code","default":"en"},"is_phrase":{"type":"boolean","title":"Is Phrase","description":"If true, search as an exact phrase","default":false},"is_acronym":{"type":"boolean","title":"Is Acronym","description":"If true, the term is an acronym (case-sensitive matching)","default":false}},"type":"object","required":["text"],"title":"SearchTerm"},"SelectCandidateRequest":{"properties":{"index":{"type":"integer","minimum":0.0,"title":"Index","description":"0-based index into identification_candidates"}},"type":"object","required":["index"],"title":"SelectCandidateRequest"},"SelectedArticlesResponse":{"properties":{"selected_count":{"type":"integer","title":"Selected Count","description":"Number of articles now selected"}},"type":"object","required":["selected_count"],"title":"SelectedArticlesResponse"},"SelectedArticlesUpdate":{"properties":{"selected_article_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Selected Article Ids","description":"IDs of articles to mark as selected for analysis"}},"type":"object","required":["selected_article_ids"],"title":"SelectedArticlesUpdate"},"SeriesBucket":{"properties":{"bucket_start":{"type":"string","title":"Bucket Start"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"},"total":{"type":"integer","minimum":0.0,"title":"Total"}},"additionalProperties":false,"type":"object","required":["bucket_start","counts","total"],"title":"SeriesBucket"},"SitrepContentResponse":{"properties":{"sitrep_id":{"type":"string","title":"Sitrep Id","description":"Unique SITREP identifier"},"content":{"type":"string","title":"Content","description":"Full SITREP content in Markdown format"},"confidence":{"type":"string","title":"Confidence","description":"Overall confidence assessment","examples":["HIGH","MODERATE","LOW"]},"docx_s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docx S3 Key","description":"S3 key for the generated DOCX file"}},"type":"object","required":["sitrep_id","content","confidence"],"title":"SitrepContentResponse"},"SitrepDownloadResponse":{"properties":{"download_url":{"type":"string","title":"Download Url","description":"Presigned S3 URL for downloading the SITREP DOCX (expires in 24h)"},"s3_key":{"type":"string","title":"S3 Key","description":"S3 object key"}},"type":"object","required":["download_url","s3_key"],"title":"SitrepDownloadResponse"},"SitrepGenerateRequest":{"properties":{"classification":{"type":"string","title":"Classification","description":"Classification marking for the SITREP header","default":"UNCLASSIFIED // FOR OFFICIAL USE ONLY","examples":["UNCLASSIFIED // FOR OFFICIAL USE ONLY","CONFIDENTIAL"]}},"type":"object","title":"SitrepGenerateRequest"},"SitrepStructuredData":{"properties":{"schema_version":{"type":"string","const":"sitrep_structured_data.v1","title":"Schema Version","default":"sitrep_structured_data.v1"},"generated_at":{"type":"string","title":"Generated At"},"references":{"items":{"$ref":"#/components/schemas/FrozenReference"},"type":"array","title":"References"},"coverage":{"$ref":"#/components/schemas/CoverageAnalytics"},"narratives":{"anyOf":[{"$ref":"#/components/schemas/NarrativeAnalytics"},{"type":"null"}]},"canonicalizer_version":{"type":"string","title":"Canonicalizer Version","default":"url_canon.v1"}},"additionalProperties":false,"type":"object","required":["generated_at","coverage"],"title":"SitrepStructuredData"},"SitrepVersionCreate":{"properties":{"idempotency_key":{"type":"string","maxLength":200,"minLength":1,"title":"Idempotency Key"},"classification":{"type":"string","maxLength":200,"title":"Classification","default":"UNCLASSIFIED // FOR OFFICIAL USE ONLY"}},"additionalProperties":false,"type":"object","required":["idempotency_key"],"title":"SitrepVersionCreate"},"SitrepVersionResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"version":{"type":"integer","title":"Version"},"state":{"$ref":"#/components/schemas/SitrepVersionState"},"generation_mode":{"type":"string","title":"Generation Mode"},"event_contract_revision":{"type":"integer","title":"Event Contract Revision"},"event_contract_hash":{"type":"string","title":"Event Contract Hash"},"collection_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Collection Run Id"},"narrative_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Narrative Run Id"},"docx_s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docx S3 Key"},"content_checksum":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Checksum"},"structured_data_checksum":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Structured Data Checksum"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"evidence_set_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Evidence Set Id"},"synthesis_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Synthesis Id"},"input_snapshot":{"additionalProperties":true,"type":"object","title":"Input Snapshot"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"structured_data":{"anyOf":[{"$ref":"#/components/schemas/SitrepStructuredData"},{"type":"null"}]},"object_key":{"type":"string","title":"Object Key"}},"type":"object","required":["id","event_id","version","state","generation_mode","event_contract_revision","event_contract_hash","created_at","input_snapshot","object_key"],"title":"SitrepVersionResponse"},"SitrepVersionState":{"type":"string","enum":["pending","running","completed","failed","failed_retryable","superseded"],"title":"SitrepVersionState"},"SitrepVersionSummaryResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"version":{"type":"integer","title":"Version"},"state":{"$ref":"#/components/schemas/SitrepVersionState"},"generation_mode":{"type":"string","title":"Generation Mode"},"event_contract_revision":{"type":"integer","title":"Event Contract Revision"},"event_contract_hash":{"type":"string","title":"Event Contract Hash"},"collection_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Collection Run Id"},"narrative_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Narrative Run Id"},"docx_s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docx S3 Key"},"content_checksum":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Checksum"},"structured_data_checksum":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Structured Data Checksum"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","event_id","version","state","generation_mode","event_contract_revision","event_contract_hash","created_at"],"title":"SitrepVersionSummaryResponse"},"SocialActivityItem":{"properties":{"kind":{"type":"string","const":"social","title":"Kind","default":"social"},"id":{"type":"integer","title":"Id"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"likeCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Likecount"},"replyCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Replycount"},"postId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Postid"},"postText":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posttext"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"}},"type":"object","required":["id","createdAt"],"title":"SocialActivityItem","description":"One social comment authored by a category member."},"SocialComment":{"properties":{"id":{"type":"integer","title":"Id"},"platform":{"type":"string","title":"Platform"},"platformId":{"type":"string","title":"Platformid"},"postId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Postid"},"parentCommentId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parentcommentid"},"authorId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorid"},"authorUsername":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorusername"},"authorFullName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorfullname"},"createdTime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdtime"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"likeCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Likecount"},"replyCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Replycount"},"lastUpdated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Lastupdated"}},"type":"object","required":["id","platform","platformId"],"title":"SocialComment","description":"Mirrors TS ``SocialComment``. Self-references by parentCommentId."},"SocialDemographicsBatchRequest":{"properties":{"postIds":{"items":{"type":"integer"},"type":"array","title":"Postids"}},"type":"object","required":["postIds"],"title":"SocialDemographicsBatchRequest","description":"POST /social/demographics/batch body."},"SocialFeedFilters":{"properties":{"dateFrom":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Datefrom"},"dateTo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dateto"},"platforms":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Platforms"},"profileIds":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Profileids"}},"type":"object","title":"SocialFeedFilters","description":"Optional filter dict nested inside the feed request body."},"SocialFeedRequest":{"properties":{"page":{"type":"integer","title":"Page","default":1},"perPage":{"type":"integer","title":"Perpage","default":30},"sortBy":{"type":"string","enum":["recent","engagement"],"title":"Sortby","default":"recent"},"filters":{"$ref":"#/components/schemas/SocialFeedFilters"}},"type":"object","title":"SocialFeedRequest","description":"POST /social/feed body.\n\nDefaults mirror the TS handler in\n``facet-frontend/src/app/api/social/feed/route.ts``:\n``page=1, perPage=30, sortBy=\"recent\"``."},"SocialFeedResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/SocialPostWithProfile"},"type":"array","title":"Results"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["results","total"],"title":"SocialFeedResponse","description":"POST /social/feed response.\n\n``timing`` from the TS handler is deliberately not re-exposed — it's\nobservability noise the frontend does not use."},"SocialPostWithFullProfile":{"properties":{"id":{"type":"integer","title":"Id"},"platform":{"type":"string","title":"Platform"},"platformId":{"type":"string","title":"Platformid"},"profileId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profileid"},"createdTime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdtime"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"lang":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"},"likeCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Likecount"},"commentCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Commentcount"},"shareCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sharecount"},"viewCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Viewcount"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"lastUpdated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Lastupdated"},"profile":{"anyOf":[{"$ref":"#/components/schemas/SocialProfile"},{"type":"null"}]}},"type":"object","required":["id","platform","platformId"],"title":"SocialPostWithFullProfile","description":"Post detail row: all ``SocialPost`` columns PLUS an embedded\n``SocialProfile`` object.\n\nMirrors the shape returned by the TS ``getPostWithProfile``: a\n``SocialPost & { profile: SocialProfile | null }``."},"SocialPostWithProfile":{"properties":{"id":{"type":"integer","title":"Id"},"platform":{"type":"string","title":"Platform"},"platformId":{"type":"string","title":"Platformid"},"profileId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profileid"},"createdTime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdtime"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"lang":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"},"likeCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Likecount"},"commentCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Commentcount"},"shareCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sharecount"},"viewCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Viewcount"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"lastUpdated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Lastupdated"},"profileUsername":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profileusername"},"profileFullName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profilefullname"},"profileAvatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profileavatarurl"},"profileIsVerified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Profileisverified"}},"type":"object","required":["id","platform","platformId"],"title":"SocialPostWithProfile","description":"Feed / profile-posts row — a post with denormalised profile columns.\n\nMirrors TS ``SocialPostWithProfile`` (= ``SocialPost`` + four\n``profile*`` fields). Used by /social/feed and /social/profiles/{id}."},"SocialProfile":{"properties":{"id":{"type":"integer","title":"Id"},"platform":{"type":"string","title":"Platform"},"platformId":{"type":"string","title":"Platformid"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"fullName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fullname"},"createdTime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdtime"},"avatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatarurl"},"biography":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Biography"},"isVerified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isverified"},"isPrivate":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isprivate"},"followerCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Followercount"},"followingCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Followingcount"},"postCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Postcount"},"externalUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalurl"},"lastUpdated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Lastupdated"}},"type":"object","required":["id","platform","platformId"],"title":"SocialProfile","description":"Full social profile row. Mirrors TS ``SocialProfile``."},"SocialProfileDetailResponse":{"properties":{"profile":{"$ref":"#/components/schemas/SocialProfile"},"posts":{"items":{"$ref":"#/components/schemas/SocialPostWithProfile"},"type":"array","title":"Posts"},"totalPosts":{"type":"integer","title":"Totalposts"}},"type":"object","required":["profile","posts","totalPosts"],"title":"SocialProfileDetailResponse","description":"GET /social/profiles/{profileId} response.\n\nMirrors the TS handler which merges ``getProfile`` and\n``getProfilePosts`` into ``{profile, posts, totalPosts}``. We carry\nover ``totalPosts`` verbatim (not ``total``) so the frontend's field\nname does not change."},"SocialProfileListItem":{"properties":{"id":{"type":"integer","title":"Id"},"username":{"type":"string","title":"Username"},"fullName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fullname"}},"type":"object","required":["id","username"],"title":"SocialProfileListItem","description":"One entry in the grouped-by-platform profiles list."},"SocialProfilesGrouped":{"properties":{"platform":{"type":"string","title":"Platform"},"profiles":{"items":{"$ref":"#/components/schemas/SocialProfileListItem"},"type":"array","title":"Profiles"}},"type":"object","required":["platform","profiles"],"title":"SocialProfilesGrouped","description":"One platform bucket returned by /social/profiles.\n\nThe TS handler returns ``{platform, profiles: [...]}[]`` (an array\nof these). FastAPI serialises ``list[SocialProfilesGrouped]``\nnatively."},"SocialSearchBucket":{"properties":{"results":{"items":{"$ref":"#/components/schemas/SocialPostWithProfile"},"type":"array","title":"Results"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["results","total"],"title":"SocialSearchBucket","description":"Social sub-section of the search response."},"SortOrder":{"type":"string","enum":["asc","desc"],"title":"SortOrder"},"SourceKind":{"type":"string","enum":["forum_post","social_comment"],"title":"SourceKind"},"SourceWithForums":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"forums":{"items":{"$ref":"#/components/schemas/Forum"},"type":"array","title":"Forums"}},"type":"object","required":["id","name","forums"],"title":"SourceWithForums","description":"Mirrors TS ``SourceWithForums`` = ``Source`` + ``forums[]``."},"StaleStage":{"type":"string","enum":["research","evidence","synthesis","narrative","sitrep"],"title":"StaleStage"},"StaleStateResponse":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"event_contract_revision":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Event Contract Revision"},"event_contract_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Contract Hash"},"stale_stages":{"items":{"$ref":"#/components/schemas/StaleStage"},"type":"array","title":"Stale Stages"},"next_step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Step"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["event_id","event_contract_revision","event_contract_hash","stale_stages"],"title":"StaleStateResponse"},"TableInfo":{"properties":{"tableName":{"type":"string","title":"Tablename"},"columns":{"items":{"$ref":"#/components/schemas/ColumnInfo"},"type":"array","title":"Columns"},"approximateRowCount":{"type":"integer","title":"Approximaterowcount"}},"type":"object","required":["tableName","columns","approximateRowCount"],"title":"TableInfo"},"TaxonomyDriver":{"properties":{"driver_id":{"type":"string","minLength":1,"title":"Driver Id"},"label":{"type":"string","title":"Label"},"definition":{"type":"string","title":"Definition"}},"additionalProperties":false,"type":"object","required":["driver_id","label","definition"],"title":"TaxonomyDriver"},"TaxonomyFrame":{"properties":{"frame_id":{"type":"string","minLength":1,"title":"Frame Id"},"label":{"type":"string","title":"Label"},"definition":{"type":"string","title":"Definition"}},"additionalProperties":false,"type":"object","required":["frame_id","label","definition"],"title":"TaxonomyFrame"},"ThreadWithDetails":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"externalUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalurl"},"threadText":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Threadtext"},"lastScrapedPage":{"type":"integer","title":"Lastscrapedpage"},"forumId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Forumid"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"userId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Userid"},"sourceUniqueThreadId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sourceuniquethreadid"},"forumName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Forumname"},"sourceName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sourcename"},"sourceId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sourceid"},"postCount":{"type":"integer","title":"Postcount"}},"type":"object","required":["id","title","lastScrapedPage","postCount"],"title":"ThreadWithDetails","description":"Mirrors TS ``ThreadWithDetails`` = ``Thread`` + denormalised joins.\n\nUsed as both the feed row and the thread-detail response.\n``postCount`` is an aggregate from ``posts``."},"ThreadWithMatchingExcerpt":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"externalUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalurl"},"threadText":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Threadtext"},"lastScrapedPage":{"type":"integer","title":"Lastscrapedpage"},"forumId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Forumid"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"userId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Userid"},"sourceUniqueThreadId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sourceuniquethreadid"},"forumName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Forumname"},"sourceName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sourcename"},"sourceId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sourceid"},"postCount":{"type":"integer","title":"Postcount"},"matchingExcerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matchingexcerpt"}},"type":"object","required":["id","title","lastScrapedPage","postCount"],"title":"ThreadWithMatchingExcerpt","description":"Thread row enriched with a post-body snippet.\n\nExtends :class:`ThreadWithDetails` with the ``matchingExcerpt``\nfield that ``search_forum_threads`` populates from a representative\npost in the thread. ``None`` when the thread matched purely on its\ntitle and no post body was sampled."},"TimeseriesBucket":{"properties":{"period":{"type":"string","title":"Period"},"socialCount":{"type":"integer","title":"Socialcount"},"forumCount":{"type":"integer","title":"Forumcount"},"totalCount":{"type":"integer","title":"Totalcount"}},"type":"object","required":["period","socialCount","forumCount","totalCount"],"title":"TimeseriesBucket","description":"One bucket in the timeseries response.\n\n``period`` is the bucket's ``YYYY-MM-DD`` (or ``YYYY-MM-DDTHH:00``\nfor hourly) start. The TS ``fillGaps`` logic lives client-side —\nthe backend just returns the sparse series and the UI fills holes."},"TimeseriesRequest":{"properties":{"query":{"type":"string","title":"Query","default":""},"scope":{"type":"string","enum":["all","social","forums"],"title":"Scope","default":"all"},"filters":{"$ref":"#/components/schemas/SearchFilters"},"granularity":{"type":"string","enum":["hour","day","week","month"],"title":"Granularity","default":"day"}},"type":"object","title":"TimeseriesRequest","description":"POST /facet/search/timeseries body."},"TimeseriesResponse":{"properties":{"buckets":{"items":{"$ref":"#/components/schemas/TimeseriesBucket"},"type":"array","title":"Buckets"},"granularity":{"type":"string","enum":["hour","day","week","month"],"title":"Granularity"}},"type":"object","required":["buckets","granularity"],"title":"TimeseriesResponse","description":"POST /facet/search/timeseries response body."},"TimestampPolicy":{"type":"string","enum":["known","unknown_timestamp_quarantined","supplemental_unknown_timestamp"],"title":"TimestampPolicy"},"UpdateArticleRequest":{"properties":{"is_irrelevant":{"type":"boolean","title":"Is Irrelevant","description":"Set to true to mark the article as irrelevant"}},"type":"object","required":["is_irrelevant"],"title":"UpdateArticleRequest"},"UploadUrlRequest":{"properties":{"filename":{"type":"string","title":"Filename","description":"Name of the file to upload","examples":["press-release.pdf"]},"content_type":{"type":"string","title":"Content Type","description":"MIME type of the file","examples":["application/pdf"]}},"type":"object","required":["filename","content_type"],"title":"UploadUrlRequest"},"UploadUrlResponse":{"properties":{"upload_url":{"type":"string","title":"Upload Url","description":"Presigned S3 URL for uploading the file via PUT"},"s3_key":{"type":"string","title":"S3 Key","description":"S3 object key where the file will be stored"},"expires_in":{"type":"integer","title":"Expires In","description":"URL expiry time in seconds"},"max_size":{"type":"integer","title":"Max Size","description":"Maximum allowed file size in bytes"}},"type":"object","required":["upload_url","s3_key","expires_in","max_size"],"title":"UploadUrlResponse"},"UserPostHistoryForum":{"properties":{"id":{"type":"integer","title":"Id"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"threadId":{"type":"integer","title":"Threadid"},"threadTitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Threadtitle"}},"type":"object","required":["id","threadId"],"title":"UserPostHistoryForum","description":"One forum post row from ``getUserProfilePostHistory`` when user_source='forum'."},"UserPostHistoryResponse":{"properties":{"posts":{"items":{"anyOf":[{"$ref":"#/components/schemas/UserPostHistoryForum"},{"$ref":"#/components/schemas/UserPostHistorySocial"}]},"type":"array","title":"Posts"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["posts","total"],"title":"UserPostHistoryResponse","description":"GET /user-profiles/{id}/posts response."},"UserPostHistorySocial":{"properties":{"id":{"type":"integer","title":"Id"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"createdTime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdtime"},"likeCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Likecount"},"replyCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Replycount"},"postId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Postid"},"postText":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posttext"}},"type":"object","required":["id"],"title":"UserPostHistorySocial","description":"One social comment row from ``getUserProfilePostHistory`` when user_source!='forum'."},"UserProfile":{"properties":{"id":{"type":"integer","title":"Id"},"userSource":{"type":"string","title":"Usersource"},"platform":{"type":"string","title":"Platform"},"username":{"type":"string","title":"Username"},"residencyStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Residencystatus"},"residencyExplanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Residencyexplanation"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"genderExplanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Genderexplanation"},"race":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Race"},"raceExplanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raceexplanation"},"ageBracket":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agebracket"},"ageExplanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ageexplanation"},"lifeStage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifestage"},"lifeStageExplanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifestageexplanation"},"likelyProfession":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Likelyprofession"},"professionExplanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Professionexplanation"},"employmentSector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employmentsector"},"employmentSectorExplanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employmentsectorexplanation"},"socioeconomicStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Socioeconomicstatus"},"socioeconomicExplanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Socioeconomicexplanation"},"inauthenticityScore":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Inauthenticityscore"},"inauthenticityClassification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inauthenticityclassification"},"hasCopypasta":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hascopypasta"},"flagLowFollowers":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Flaglowfollowers"},"flagLowFriends":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Flaglowfriends"},"flagSuspiciousRatio":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Flagsuspiciousratio"},"flagNoPosts":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Flagnoposts"},"flagNewAccount":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Flagnewaccount"},"flagNoBio":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Flagnobio"},"flagNotVerified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Flagnotverified"},"keywords":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Keywords"},"representativeQuotes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Representativequotes"},"commentCountAtProfiling":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Commentcountatprofiling"},"profiledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Profiledat"}},"type":"object","required":["id","userSource","platform","username"],"title":"UserProfile","description":"One row from facet's ``user_profiles`` table."},"UserSummary":{"properties":{"userId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Userid"},"userProfileId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Userprofileid"},"username":{"type":"string","title":"Username"},"postCount":{"type":"integer","title":"Postcount"},"inauthenticityScore":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Inauthenticityscore"},"inauthenticityClassification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inauthenticityclassification"},"manuallyVerified":{"type":"boolean","title":"Manuallyverified","default":false},"residencyStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Residencystatus"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"race":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Race"},"ageBracket":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agebracket"},"lifeStage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifestage"},"employmentSector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employmentsector"},"socioeconomicStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Socioeconomicstatus"},"isWatched":{"type":"boolean","title":"Iswatched","default":false}},"type":"object","required":["username","postCount"],"title":"UserSummary","description":"One row in a ``DemographicsDetail.users`` list.\n\n``is_watched`` is scoped to the **current authenticated user** — see\n``demographics_service.py`` for the rationale."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WatchedUser":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"watched_users.id (agate DB)"},"userProfileId":{"type":"integer","title":"Userprofileid","description":"Reference into facet user_profiles.id"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional free-text note"},"addedAt":{"type":"string","format":"date-time","title":"Addedat"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","description":"NULL if the profile is missing in facet DB"},"userSource":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usersource"},"platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"},"inauthenticityClassification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inauthenticityclassification"},"manuallyVerified":{"type":"boolean","title":"Manuallyverified","default":false},"residencyStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Residencystatus"}},"type":"object","required":["id","userProfileId","addedAt"],"title":"WatchedUser","description":"A row on a user's watchlist, merged across the two pools.\n\nJSON field names MUST match the existing `WatchedUser` TS interface in\nfacet-frontend so the frontend does not have to change in Plan 1.4:\n`id, userProfileId, notes, addedAt, username, userSource, platform,\ninauthenticityClassification, residencyStatus`.\n\n`username`, `userSource`, `platform`, `inauthenticityClassification`,\n`residencyStatus` come from facet's `user_profiles`. If the referenced\nprofile no longer exists in facet DB (hard-deleted) we still return the\nwatched_users row with those fields as ``None`` — callers should not\nsilently drop rows."},"WatchedUserCreate":{"properties":{"userProfileId":{"type":"integer","title":"Userprofileid","description":"facet user_profiles.id to add to the caller's watchlist"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional free-text note"}},"type":"object","required":["userProfileId"],"title":"WatchedUserCreate","description":"POST /watchlist body."},"WatchedUserListResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/WatchedUser"},"type":"array","title":"Users"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["users","total"],"title":"WatchedUserListResponse","description":"GET /watchlist response."},"WatchlistCategory":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"memberCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Membercount"}},"type":"object","required":["id","name","createdAt"],"title":"WatchlistCategory","description":"One row of agate.watchlist_category, optionally with member_count."},"WatchlistCategoryCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"}},"type":"object","required":["name"],"title":"WatchlistCategoryCreate","description":"POST /watchlist/categories body."},"WatchlistCategoryListResponse":{"properties":{"categories":{"items":{"$ref":"#/components/schemas/WatchlistCategory"},"type":"array","title":"Categories"}},"type":"object","required":["categories"],"title":"WatchlistCategoryListResponse","description":"GET /watchlist/categories response."},"WatchlistCategoryUpdate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"}},"type":"object","required":["name"],"title":"WatchlistCategoryUpdate","description":"PATCH /watchlist/categories/{id} body."},"app__modules__fact_checker__models__job__JobCreated":{"properties":{"job_id":{"type":"string","format":"uuid","title":"Job Id","description":"ID of the newly created background job. Poll GET /jobs/{job_id} for status."}},"type":"object","required":["job_id"],"title":"JobCreated"},"app__modules__narratives__models__requests__JobCreated":{"properties":{"jobId":{"type":"string","title":"Jobid"},"runId":{"type":"string","title":"Runid"}},"type":"object","required":["jobId","runId"],"title":"JobCreated","description":"Echo-response from any POST /jobs/*."}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}