{"openapi":"3.1.0","info":{"title":"LiquidCortex API","description":"Intelligent AI workforce platform with 44 specialized AI employees, SENTINEL Shield T&S, and Adaptive Interface Protocol™","version":"8.0.0"},"paths":{"/health/":{"get":{"tags":["Health"],"summary":"Health Check","description":"Basic health check","operationId":"health_check_health__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Check Health  Get"}}}}}}},"/health/ready":{"get":{"tags":["Health"],"summary":"Readiness Check","description":"Readiness check - are all dependencies available?","operationId":"readiness_check_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Readiness Check Health Ready Get"}}}}}}},"/health/metrics":{"get":{"tags":["Health"],"summary":"System Metrics","description":"System resource metrics","operationId":"system_metrics_health_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response System Metrics Health Metrics Get"}}}}}}},"/api/llm/complete":{"post":{"tags":["LLM"],"summary":"Complete","description":"Send completion request to LLM\n\nSupports:\n- All providers (OpenAI, Anthropic, DeepSeek, Together.ai, Ollama)\n- Tier-based routing or explicit model selection\n- Response caching\n- Cost tracking","operationId":"complete_api_llm_complete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/llm/route":{"post":{"tags":["LLM"],"summary":"Intelligent Route","description":"Intelligent routing with automatic tier selection\n\nAnalyzes task complexity and routes to optimal model tier\nfor 90% cost savings while maintaining quality","operationId":"intelligent_route_api_llm_route_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntelligentRoutingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntelligentRoutingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/llm/statistics":{"get":{"tags":["LLM"],"summary":"Get Statistics","description":"Get LLM usage statistics\n\nReturns:\n- Total cost, tokens, requests\n- Cost by provider, tier, user\n- Cache hit rate\n- Provider availability","operationId":"get_statistics_api_llm_statistics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Statistics Api Llm Statistics Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/llm/tiers":{"get":{"tags":["LLM"],"summary":"List Tiers","description":"List all available model tiers with pricing","operationId":"list_tiers_api_llm_tiers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Tiers Api Llm Tiers Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/llm/providers":{"get":{"tags":["LLM"],"summary":"List Providers","description":"List available LLM providers and their status","operationId":"list_providers_api_llm_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Providers Api Llm Providers Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/llm/cache":{"delete":{"tags":["LLM"],"summary":"Clear Cache","description":"Clear response cache","operationId":"clear_cache_api_llm_cache_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Clear Cache Api Llm Cache Delete"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/employees/":{"get":{"tags":["Employees"],"summary":"List all employees","description":"Get a complete list of all 26 AI employees across all phases and departments","operationId":"list_all_employees_api_employees__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/EmployeeInfoResponse"},"type":"array","title":"Response List All Employees Api Employees  Get"}}}}}}},"/api/employees/summary":{"get":{"tags":["Employees"],"summary":"Get registry summary","description":"Get high-level summary of employee registry including counts by phase and department","operationId":"get_registry_summary_api_employees_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrySummaryResponse"}}}}}}},"/api/employees/ids":{"get":{"tags":["Employees"],"summary":"List employee IDs","description":"Get list of all employee IDs for quick reference","operationId":"list_employee_ids_api_employees_ids_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response List Employee Ids Api Employees Ids Get"}}}}}}},"/api/employees/phases/{phase}":{"get":{"tags":["Employees"],"summary":"List employees by phase","description":"Get all employees in a specific deployment phase (phase_1, phase_2, or phase_3)","operationId":"list_employees_by_phase_api_employees_phases__phase__get","parameters":[{"name":"phase","in":"path","required":true,"schema":{"type":"string","title":"Phase"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeInfoResponse"},"title":"Response List Employees By Phase Api Employees Phases  Phase  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/employees/departments/{department}":{"get":{"tags":["Employees"],"summary":"List employees by department","description":"Get all employees in a specific department (engineering, operations, security, etc.)","operationId":"list_employees_by_department_api_employees_departments__department__get","parameters":[{"name":"department","in":"path","required":true,"schema":{"type":"string","title":"Department"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeInfoResponse"},"title":"Response List Employees By Department Api Employees Departments  Department  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/employees/search":{"post":{"tags":["Employees"],"summary":"Search employees","description":"Search employees by specialization or capability keyword","operationId":"search_employees_api_employees_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeSearchQuery"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/EmployeeInfoResponse"},"type":"array","title":"Response Search Employees Api Employees Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/employees/{employee_id}":{"get":{"tags":["Employees"],"summary":"Get employee details","description":"Get detailed information about a specific employee by ID","operationId":"get_employee_api_employees__employee_id__get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeInfoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/employees/{employee_id}/execute":{"post":{"tags":["Employees"],"summary":"Execute employee method","description":"Execute a method on a specific employee with provided parameters","operationId":"execute_employee_method_api_employees__employee_id__execute_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeExecuteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeExecuteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/employees/{employee_id}/methods":{"get":{"tags":["Employees"],"summary":"List employee methods","description":"Get list of available methods for a specific employee","operationId":"list_employee_methods_api_employees__employee_id__methods_get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"title":"Response List Employee Methods Api Employees  Employee Id  Methods Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/employees/{employee_id}/schema":{"get":{"tags":["Employees"],"summary":"Get employee method schemas","description":"Get parameter schemas for all methods of an employee, including types and defaults","operationId":"get_employee_schema_api_employees__employee_id__schema_get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeMethodsSchemaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/employees/{employee_id}/methods/{method_name}/schema":{"get":{"tags":["Employees"],"summary":"Get specific method schema","description":"Get parameter schema for a specific method of an employee","operationId":"get_method_schema_api_employees__employee_id__methods__method_name__schema_get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}},{"name":"method_name","in":"path","required":true,"schema":{"type":"string","title":"Method Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/methodologies/":{"get":{"tags":["Methodologies"],"summary":"List Methodologies","description":"List all methodologies with implementation status","operationId":"list_methodologies_api_methodologies__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Methodologies Api Methodologies  Get"}}}}}}},"/api/methodologies/{methodology_id}":{"get":{"tags":["Methodologies"],"summary":"Get Methodology","description":"Get methodology details by ID","operationId":"get_methodology_api_methodologies__methodology_id__get","parameters":[{"name":"methodology_id","in":"path","required":true,"schema":{"type":"integer","title":"Methodology Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Methodology Api Methodologies  Methodology Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/methodologies/{methodology_id}/execute":{"post":{"tags":["Methodologies"],"summary":"Execute Methodology","description":"Execute a methodology (returns metadata and input echo for unimplemented ones)","operationId":"execute_methodology_api_methodologies__methodology_id__execute_post","parameters":[{"name":"methodology_id","in":"path","required":true,"schema":{"type":"integer","title":"Methodology Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Input Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Execute Methodology Api Methodologies  Methodology Id  Execute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/costs":{"get":{"tags":["Analytics"],"summary":"Get Costs","description":"Get cost analytics for the authenticated user from analytics.llm_usage.","operationId":"get_costs_api_analytics_costs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Costs Api Analytics Costs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/usage":{"get":{"tags":["Analytics"],"summary":"Get Usage","description":"Get usage statistics for the authenticated user.\n\nEvery field is now measured. This handler previously returned the literals\n`total_requests: 15234`, `total_tokens: 4567890`, `cache_hit_rate: 0.32`,\n`avg_latency_ms: 850` to every caller without touching the database.","operationId":"get_usage_api_analytics_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Usage Api Analytics Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/performance":{"get":{"tags":["Analytics"],"summary":"Get Performance","description":"Get performance metrics for the authenticated user.\n\nThis handler previously returned a FABRICATED SLA to every caller with no\ndatabase access at all: `success_rate: 0.98`, `avg_quality_score: 0.87`,\n`p50/p95/p99 = 750/1500/2300`. Those are the kind of numbers a customer\nquotes back to you in a contract dispute.\n\nLatency percentiles and the quality average are now computed from\n`analytics.llm_usage`. `success_rate` stays null: the table records no\nsuccess/failure outcome (`finish_reason` is a free-text provider string,\nnot an outcome flag — database/init/05_analytics_schema.sql:40), so there\nis nothing to compute it from. Null means \"not measured\", and the UI must\nrender it as such rather than substituting a default.","operationId":"get_performance_api_analytics_performance_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Performance Api Analytics Performance Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cache/stats":{"get":{"tags":["Cache"],"summary":"Get Cache Stats","description":"Get current cache performance statistics\n\nReturns:\n    Cache statistics including hit rates, savings, and performance metrics","operationId":"get_cache_stats_api_cache_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Cache Stats Api Cache Stats Get"}}}}}}},"/api/cache/clear":{"post":{"tags":["Cache"],"summary":"Clear Cache","description":"Clear cache entries\n\nArgs:\n    pattern: Optional pattern to match keys (default: clear all)\n\nReturns:\n    Confirmation of cache cleared","operationId":"clear_cache_api_cache_clear_post","parameters":[{"name":"pattern","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pattern"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Clear Cache Api Cache Clear Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cache/performance":{"get":{"tags":["Cache"],"summary":"Get Cache Performance","description":"Get detailed cache performance metrics over time\n\nArgs:\n    start_date: Start date (ISO format, default: 7 days ago)\n    end_date: End date (ISO format, default: now)\n\nReturns:\n    Detailed cache performance analytics","operationId":"get_cache_performance_api_cache_performance_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Cache Performance Api Cache Performance Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cache/similarity-threshold":{"get":{"tags":["Cache"],"summary":"Get Similarity Threshold","description":"Get current semantic similarity threshold","operationId":"get_similarity_threshold_api_cache_similarity_threshold_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Similarity Threshold Api Cache Similarity Threshold Get"}}}}}},"post":{"tags":["Cache"],"summary":"Update Similarity Threshold","description":"Update semantic similarity threshold\n\nArgs:\n    threshold: New threshold (0.80-0.99 recommended, 0.92 default)\n\nReturns:\n    Confirmation of update","operationId":"update_similarity_threshold_api_cache_similarity_threshold_post","parameters":[{"name":"threshold","in":"query","required":true,"schema":{"type":"number","title":"Threshold"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Similarity Threshold Api Cache Similarity Threshold Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboards/cost-analytics":{"get":{"tags":["Dashboards"],"summary":"Cost Analytics Dashboard","description":"Interactive cost analytics dashboard\n\n**Features:**\n- Cost trends over time\n- Model cost comparison\n- Employee cost breakdown\n- Cache vs API call analysis\n- Hour-of-day patterns\n- Day-of-week trends\n\n**Usage:**\n- Drag dimensions/measures to rows/columns\n- Click charts to filter\n- Export to PNG/CSV","operationId":"cost_analytics_dashboard_api_dashboards_cost_analytics_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Number of days to analyze","default":30,"title":"Days"},"description":"Number of days to analyze"},{"name":"theme","in":"query","required":false,"schema":{"type":"string","description":"Dashboard theme (light/dark)","default":"light","title":"Theme"},"description":"Dashboard theme (light/dark)"}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboards/employee-performance":{"get":{"tags":["Dashboards"],"summary":"Employee Performance Dashboard","description":"Interactive employee performance dashboard\n\n**Metrics:**\n- Total requests per employee\n- Cost per employee\n- Cache hit rates\n- Average confidence scores\n- Model diversity\n- Task type distribution\n- Efficiency scores\n\n**26 AI Employees Tracked:**\n- Phase 1: CodeWeaver, Atlas, Madison, Guardian, Aria\n- Phase 2: Maxwell, Nova, Bastion, Forge, Prudence\n- Phase 3: Sterling, Hunter, Pulse, Canvas, Scribe\n- Phase 4: Sage, Catalyst, Sentinel, Oracle, Advocate\n- Additional: Maestro, Echo, Juno, Scout, Quinn, Finn","operationId":"employee_performance_dashboard_api_dashboards_employee_performance_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Number of days to analyze","default":30,"title":"Days"},"description":"Number of days to analyze"},{"name":"theme","in":"query","required":false,"schema":{"type":"string","description":"Dashboard theme (light/dark)","default":"light","title":"Theme"},"description":"Dashboard theme (light/dark)"}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboards/model-comparison":{"get":{"tags":["Dashboards"],"summary":"Model Comparison Dashboard","description":"Interactive model performance comparison dashboard\n\n**Compare Models:**\n- DeepSeek-V3 (ultra-low cost)\n- Claude 3.5 Sonnet (high quality)\n- GPT-4o (premium)\n- Llama 3.2 (local/free)\n\n**Metrics:**\n- Cost per 1M tokens\n- Average latency (P50, P95)\n- Success rate\n- Confidence scores\n- Total spend\n- Request volume\n- Cost efficiency score","operationId":"model_comparison_dashboard_api_dashboards_model_comparison_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Number of days to analyze","default":30,"title":"Days"},"description":"Number of days to analyze"},{"name":"theme","in":"query","required":false,"schema":{"type":"string","description":"Dashboard theme (light/dark)","default":"light","title":"Theme"},"description":"Dashboard theme (light/dark)"}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboards/cache-performance":{"get":{"tags":["Dashboards"],"summary":"Cache Performance Dashboard","description":"Interactive cache performance dashboard\n\n**Semantic Cache Analytics:**\n- Exact hit rate (Redis L1 cache)\n- Semantic hit rate (pgvector L2 cache)\n- Total hit rate trend\n- Cost savings from cache\n- Latency improvement\n- Hourly/daily patterns\n- Cache efficiency score\n\n**Two-Tier Caching:**\n- L1: Redis exact match (<1ms)\n- L2: pgvector semantic similarity (10-50ms)","operationId":"cache_performance_dashboard_api_dashboards_cache_performance_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Number of days to analyze","default":30,"title":"Days"},"description":"Number of days to analyze"},{"name":"theme","in":"query","required":false,"schema":{"type":"string","description":"Dashboard theme (light/dark)","default":"light","title":"Theme"},"description":"Dashboard theme (light/dark)"}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboards/daily-trends":{"get":{"tags":["Dashboards"],"summary":"Daily Trends Dashboard","description":"Interactive daily trends dashboard\n\n**Aggregated Daily Metrics:**\n- Total daily costs\n- Request volume trends\n- Token consumption\n- Cache hit rates\n- Latency percentiles (P50, P95)\n- Day-of-week patterns\n- Weekend vs weekday comparison\n- Growth rates","operationId":"daily_trends_dashboard_api_dashboards_daily_trends_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Number of days to analyze","default":30,"title":"Days"},"description":"Number of days to analyze"},{"name":"theme","in":"query","required":false,"schema":{"type":"string","description":"Dashboard theme (light/dark)","default":"light","title":"Theme"},"description":"Dashboard theme (light/dark)"}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboards/top-cached-queries":{"get":{"tags":["Dashboards"],"summary":"Top Cached Queries Dashboard","description":"Interactive top cached queries dashboard\n\n**Most Valuable Cache Entries:**\n- Queries with highest hit counts\n- Total savings per query\n- Query text and length\n- Model used\n- Original cost\n- Days since creation\n- Average hits per day\n\n**Use Case:**\n- Identify most repeated queries\n- Optimize common patterns\n- Understand user behavior","operationId":"top_cached_queries_dashboard_api_dashboards_top_cached_queries_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":10,"description":"Number of queries to show","default":100,"title":"Limit"},"description":"Number of queries to show"},{"name":"theme","in":"query","required":false,"schema":{"type":"string","description":"Dashboard theme (light/dark)","default":"light","title":"Theme"},"description":"Dashboard theme (light/dark)"}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboards/":{"get":{"tags":["Dashboards"],"summary":"Dashboard Index","description":"PyGWalker Dashboard Index\nLists all available interactive dashboards","operationId":"dashboard_index_api_dashboards__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api/v1/fleet/employees":{"get":{"tags":["Fleet"],"summary":"List Employees","description":"List all available AI employees for rent","operationId":"list_employees_api_v1_fleet_employees_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"object","title":"Response List Employees Api V1 Fleet Employees Get"}}}}}}},"/api/v1/fleet/rentals":{"get":{"tags":["Fleet"],"summary":"List Rentals","description":"List the caller's active employee rentals.\n\nReturns [] until rentals are persisted and tenant-scoped. This endpoint\npreviously returned three hardcoded \"active\" rentals billing $1,597/mo\nthat no customer had ever incurred, on an unauthenticated route. Showing\na customer fabricated charges as their own is worse than showing nothing.","operationId":"list_rentals_api_v1_fleet_rentals_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Rentals Api V1 Fleet Rentals Get"}}}}}}},"/api/v1/fleet/agents":{"get":{"tags":["Fleet"],"summary":"List Agents","description":"List the caller's custom agents.\n\nReturns [] until custom agents are persisted and tenant-scoped. This\nendpoint previously returned two fabricated agents with invented\ninteraction counts, ratings, and \"12 paying subscribers\".","operationId":"list_agents_api_v1_fleet_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Agents Api V1 Fleet Agents Get"}}}}}},"post":{"tags":["Fleet"],"summary":"Create Agent","description":"Create a custom agent (demo)","operationId":"create_agent_api_v1_fleet_agents_post","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","title":"Name"}},{"name":"description","in":"query","required":true,"schema":{"type":"string","title":"Description"}},{"name":"base_employee_type","in":"query","required":false,"schema":{"type":"string","title":"Base Employee Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Agent Api V1 Fleet Agents Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fleet/marketplace":{"get":{"tags":["Fleet"],"summary":"List Marketplace","description":"Browse marketplace listings.\n\nReturns [] until listings are persisted. This endpoint previously\nreturned five fabricated listings with invented creators, subscriber\ncounts, and ratings - products a customer could try to buy.","operationId":"list_marketplace_api_v1_fleet_marketplace_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Marketplace Api V1 Fleet Marketplace Get"}}}}}}},"/api/v1/fleet/employees/{employee_type}/rent":{"post":{"tags":["Fleet"],"summary":"Rent Employee","description":"Rent an AI employee (demo - returns success message)","operationId":"rent_employee_api_v1_fleet_employees__employee_type__rent_post","parameters":[{"name":"employee_type","in":"path","required":true,"schema":{"type":"string","title":"Employee Type"}},{"name":"tier","in":"query","required":false,"schema":{"type":"string","default":"MEDIUM","title":"Tier"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rent Employee Api V1 Fleet Employees  Employee Type  Rent Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fleet/rentals/{rental_id}/interact":{"post":{"tags":["Fleet"],"summary":"Interact With Rental","description":"Interact with a rented employee - REAL AI INTERACTION","operationId":"interact_with_rental_api_v1_fleet_rentals__rental_id__interact_post","parameters":[{"name":"rental_id","in":"path","required":true,"schema":{"type":"string","title":"Rental Id"}},{"name":"message","in":"query","required":true,"schema":{"type":"string","title":"Message"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Interact With Rental Api V1 Fleet Rentals  Rental Id  Interact Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fleet/marketplace/publish":{"post":{"tags":["Fleet"],"summary":"Publish To Marketplace","description":"Publish agent to marketplace (demo)","operationId":"publish_to_marketplace_api_v1_fleet_marketplace_publish_post","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"price","in":"query","required":true,"schema":{"type":"number","title":"Price"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Publish To Marketplace Api V1 Fleet Marketplace Publish Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/content-pipeline/pipelines":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Content Pipeline"],"summary":"Register Pipeline","description":"Register (or replace) a customer's pipeline definition.","operationId":"register_pipeline_api_v1_forum_content_pipeline_pipelines_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentPipeline"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentPipeline"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/content-pipeline/pipelines/{pipeline_id}":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Content Pipeline"],"summary":"Get Pipeline","operationId":"get_pipeline_api_v1_forum_content_pipeline_pipelines__pipeline_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","title":"Pipeline Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentPipeline"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/content-pipeline/artifacts":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Content Pipeline"],"summary":"Add Artifact","operationId":"add_artifact_api_v1_forum_content_pipeline_artifacts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentArtifact"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentArtifact"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/content-pipeline/artifacts/{artifact_id}/move":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Content Pipeline"],"summary":"Move Artifact","operationId":"move_artifact_api_v1_forum_content_pipeline_artifacts__artifact_id__move_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Artifact Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveArtifactRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentArtifact"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/content-pipeline/pipelines/{pipeline_id}/view":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Content Pipeline"],"summary":"Get Pipeline View","description":"Renderable flow-chart payload — nodes + edges + bottlenecks.","operationId":"get_pipeline_view_api_v1_forum_content_pipeline_pipelines__pipeline_id__view_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","title":"Pipeline Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/content-pipeline/pipelines/{pipeline_id}/stuck":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Content Pipeline"],"summary":"Get Stuck Artifacts","operationId":"get_stuck_artifacts_api_v1_forum_content_pipeline_pipelines__pipeline_id__stuck_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","title":"Pipeline Id"}},{"name":"stuck_after_hours","in":"query","required":false,"schema":{"type":"number","default":72.0,"title":"Stuck After Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StuckArtifactsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/draft/status":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Draft mode"],"summary":"Draft Status","description":"Flag state + pillar catalogue. Not gated: the UI needs it to decide\nwhether to render the Draft surface at all.","operationId":"draft_status_api_v1_forum_draft_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/draft/profiles":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Draft mode"],"summary":"List Profiles","operationId":"list_profiles_api_v1_forum_draft_profiles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Draft mode"],"summary":"Create Profile","description":"Create a strategy profile. If no voice_guide is supplied, one is\nextracted by the LLM from the intake + writing samples. A model failure\nis a 502 with the real cause — never a templated guide.","operationId":"create_profile_api_v1_forum_draft_profiles_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/draft/profiles/{profile_id}":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Draft mode"],"summary":"Get Profile","operationId":"get_profile_api_v1_forum_draft_profiles__profile_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Draft mode"],"summary":"Delete Profile","operationId":"delete_profile_api_v1_forum_draft_profiles__profile_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Profile Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/draft/profiles/{profile_id}/activate":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Draft mode"],"summary":"Activate Profile","operationId":"activate_profile_api_v1_forum_draft_profiles__profile_id__activate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/draft/generate":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Draft mode"],"summary":"Generate Drafts","description":"Write one draft per pillar from the profile, gate each on the\nbanned-phrase list + slop detector, and (optionally) score them all in\nthe existing A/B simulation.\n\n``publishable`` on each draft = passed the voice gate AND (when scored)\nsimulation confidence met the tenant's publishable_confidence_threshold.\nUnscored drafts are never marked publishable.","operationId":"generate_drafts_api_v1_forum_draft_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__empires__forum__draft_routes__GenerateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/listen/status":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Listen"],"summary":"Listen Status","description":"Flag state + which sources this deployment can read. Not gated: the\nUI needs it to decide whether to render the Listen surface at all.","operationId":"listen_status_api_v1_forum_listen_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/listen/find":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Listen"],"summary":"Find Conversations","description":"Ranked public threads for the tenant's keywords. See listen_service for\nthe scoring arithmetic; the response repeats it in ``methodology``.\nCounted against the tenant's daily \"find\" allowance BEFORE any fetch.","operationId":"find_conversations_api_v1_forum_listen_find_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/listen/draft-reply":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Listen"],"summary":"Draft Reply","description":"Draft ONE reply to ONE thread, in the customer's voice, gated. Nothing is\nposted; the response tells the customer how to post it themselves.\n\nVoice: ``voice_guide`` inline, else the tenant's Draft-mode profile by\n``profile_id`` (tenant-filtered), else a plain first-person default.\n\nFair use: over the daily soft cap the draft still runs, on the SMALL\ntier; over the hard ceiling (3x) or the tier's daily dollar ceiling it\nis refused with 429. Spend is recorded only after a successful draft.","operationId":"draft_reply_api_v1_forum_listen_draft_reply_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftReplyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/listen/publish/status":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Listen"],"summary":"Publish Status","description":"Whether this tenant can publish to Reddit (own account connected via\nNango). Never posts; never fakes a connection.","operationId":"publish_status_api_v1_forum_listen_publish_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/listen/publish":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Listen"],"summary":"Publish Reply","description":"Queue ONE reply for human approval. Returns 202 with the approval id.\nThe reply is posted to Reddit from the customer's connected account only\nwhen a human approves it in the inbox; deny/expiry posts nothing. The\nrequester's email rides in the execute params so the executor can meter\nthe post (5 NCU) after it succeeds.","operationId":"publish_reply_api_v1_forum_listen_publish_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/listen/profile":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Listen"],"summary":"Get Listen Profile","description":"Saved Listen settings from the tenant's active strategy profile.\n``has_profile`` false with defaults when the tenant has no active profile.","operationId":"get_listen_profile_api_v1_forum_listen_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Listen"],"summary":"Put Listen Profile","description":"Save Listen settings under intake[\"listen\"] on the active profile.\nCreates a minimal active profile when the tenant has none. Other intake\nkeys are preserved verbatim.","operationId":"put_listen_profile_api_v1_forum_listen_profile_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListenProfileBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/listen/today":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Listen"],"summary":"Listen Today","description":"The finder, run with the saved keywords over the last 24 hours.\n\n409 when nothing is saved yet; 429 (with ``fair_use``) when the tier's\nfind allowance is used up. Otherwise the POST /listen/find shape plus\n``fair_use`` and ``profile``.","operationId":"listen_today_api_v1_forum_listen_today_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/predict":{"post":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Predict Virality","description":"Predict content virality using Echo's Cortex Forum (P1.4 async job).\n\nCreates a prediction record in `processing` state and submits the\nheavy 10K-twin simulation to the persistent background-job queue.\nReturns 202 with poll_url/stream_url. Client polls `GET /api/v1/jobs/{id}`\nfor the final `{virality_score, predicted_views, insights, ...}` payload.","operationId":"predict_virality_api_v1_forum_predict_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/predictions":{"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"List Predictions","description":"List user's predictions","operationId":"list_predictions_api_v1_forum_predictions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/predictions/{prediction_id}":{"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Get Prediction","description":"Get prediction details","operationId":"get_prediction_api_v1_forum_predictions__prediction_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prediction_id","in":"path","required":true,"schema":{"type":"string","title":"Prediction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/ab-test":{"post":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Create Ab Test","description":"Create A/B test with multiple content variants.\n\nTest up to 5 variants simultaneously. Each variant gets simulated\nindependently against a freshly generated digital-twin population.\nBody is a JSON ``ABTestRequest`` (variants, platform, target_demographics,\npopulation_size).","operationId":"create_ab_test_api_v1_forum_ab_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ABTestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/platforms":{"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"List Platforms","description":"List supported platforms","operationId":"list_platforms_api_v1_forum_platforms_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/forum/settings":{"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Get Forum Settings","description":"Return the user's Forum settings from ``UserEntitlement.feature_flags``.\n\nIf no entitlement row exists yet, sensible defaults are returned so\nthe frontend settings page always has a usable shape.","operationId":"get_forum_settings_api_v1_forum_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Update Forum Settings","description":"Upsert the user's Forum settings into ``UserEntitlement.feature_flags``.\n\nFrontend settings page uses POST (not PUT). Emits a ``settings_updated``\nevent on success.","operationId":"update_forum_settings_api_v1_forum_settings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForumSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/activity":{"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Get Forum Activity","description":"Empire-scoped Forum activity feed.\n\nReturns EmpireEvent rows in newest-first order, optionally filtered\nby ``event_type``. Backs the ``/dashboard/forum/activity`` UI.\n\nNOTE-TO-AGENT-A: get_empire_activity() lives in shared/events.py and\nfilters by Empire enum string value (\"forum\"). It does NOT filter by\nempire_id (UUID) today. When the EmpireEvent table is extended with\nempire_id, plumb ctx.empire_id through get_empire_activity().","operationId":"get_forum_activity_api_v1_forum_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/benchmark/refresh":{"post":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Refresh Benchmark","description":"Run the Cortex Forum accuracy backtest on-demand.\n\nCompares the user's (and all) PlatformPerformance rows to their\nContentPrediction counterparts and returns a BenchmarkReport. If the\nnewly computed ``publishable_confidence`` crosses the user's\n``publishable_confidence_threshold`` (stored in Forum settings) from\nbelow, a ``benchmark_threshold_reached`` event is emitted.\n\nNote: threshold-crossing detection is best-effort — if the previous\nbenchmark value isn't available, the event is only emitted when\n``publishable_confidence >= threshold``.\n\nNOTE-TO-AGENT-A: ForumBenchmark.run_backtest currently aggregates\nPlatformPerformance/ContentPrediction WITHOUT empire_id filter. RLS\nvia migration 62 should naturally scope its queries by binding\napp.empire_id from the session. If RLS isn't enforced for the\nbenchmark service role, ForumBenchmark will need an explicit\nempire_id kwarg.","operationId":"refresh_benchmark_api_v1_forum_benchmark_refresh_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"min_samples","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Min Samples"}},{"name":"platform_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/audiences":{"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"List Audiences","description":"List the authenticated user's saved audience templates.","operationId":"list_audiences_api_v1_forum_audiences_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Create Audience","description":"Create a new saved audience template for the authenticated user.","operationId":"create_audience_api_v1_forum_audiences_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceSimulationCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/audiences/{audience_id}":{"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Get Audience","description":"Fetch a single audience template owned by the authenticated user.","operationId":"get_audience_api_v1_forum_audiences__audience_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"audience_id","in":"path","required":true,"schema":{"type":"string","title":"Audience Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Update Audience","description":"Partial update of an audience template owned by the authenticated user.","operationId":"update_audience_api_v1_forum_audiences__audience_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"audience_id","in":"path","required":true,"schema":{"type":"string","title":"Audience Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceSimulationUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Delete Audience","description":"Delete an audience template owned by the authenticated user.","operationId":"delete_audience_api_v1_forum_audiences__audience_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"audience_id","in":"path","required":true,"schema":{"type":"string","title":"Audience Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/predictions/{prediction_id}/performance":{"post":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Submit Performance Data","description":"Submit actual post-publish metrics for a prediction.","operationId":"submit_performance_data_api_v1_forum_predictions__prediction_id__performance_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prediction_id","in":"path","required":true,"schema":{"type":"string","title":"Prediction Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerformanceDataRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Get Performance Data","description":"Get actual performance data for a prediction.","operationId":"get_performance_data_api_v1_forum_predictions__prediction_id__performance_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prediction_id","in":"path","required":true,"schema":{"type":"string","title":"Prediction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/webhook/performance":{"post":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Receive Performance Webhook","description":"Webhook receiver for platform performance data.\n\nNo JWT — webhooks come from external platforms. Tenant context is\nresolved from the referenced prediction's empire_id so the new\nPlatformPerformance row inherits the correct tenant.","operationId":"receive_performance_webhook_api_v1_forum_webhook_performance_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformWebhookPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/predictions/{prediction_id}/genome":{"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Get Prediction Genome","description":"Return the Content Genome Map for a completed prediction.\n\nDecomposes the prediction's content into structural DNA:\nhook_type, narrative_arc, cta_placement, emotional_trajectory,\nand information_density. All analysis is heuristic (no LLM).","operationId":"get_prediction_genome_api_v1_forum_predictions__prediction_id__genome_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prediction_id","in":"path","required":true,"schema":{"type":"string","title":"Prediction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/cross-platform-analysis":{"post":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Analyze Cross Platform","description":"Run prediction across all 3 platforms and recommend the best fit.\n\nReturns per-platform virality scores, content analysis, and\nplatform-specific reformatting suggestions. Useful for creators\ndeciding where to publish first.","operationId":"analyze_cross_platform_api_v1_forum_cross_platform_analysis_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/benchmark/cohort":{"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Cohort Benchmark","description":"Show how a creator's predictions compare to similar-sized accounts.\n\nSince we do not have real cohort data yet, returns estimated cohort\nstatistics with the prediction's percentile position. All cohort\ndata is marked as ``cohort_data_source: \"estimated\"``.\n\nParameters\n----------\nplatform:\n    Target platform (tiktok, instagram, youtube).\nfollower_range:\n    Creator's follower bracket (e.g. \"1k-10k\", \"10k-50k\", \"50k-100k\").\nniche:\n    Content niche (e.g. \"tech\", \"fitness\", \"beauty\", \"finance\").\nvirality_score:\n    Optional virality score to position in the cohort distribution.\n    If not provided, uses the user's latest prediction score.","operationId":"cohort_benchmark_api_v1_forum_benchmark_cohort_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"platform","in":"query","required":false,"schema":{"type":"string","default":"tiktok","title":"Platform"}},{"name":"follower_range","in":"query","required":false,"schema":{"type":"string","default":"1k-10k","title":"Follower Range"}},{"name":"niche","in":"query","required":false,"schema":{"type":"string","default":"tech","title":"Niche"}},{"name":"virality_score","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Virality Score"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/inbox":{"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Get Inbox Feed","description":"Unified social comment feed.\n\nAggregates comments from TikTok, Instagram, and YouTube.\nFilterable by platform, sentiment (positive/neutral/negative),\nand status (unread/read/replied/hidden).\nReturns comments sorted by priority (questions first, then\nhighest engagement, then most recent).","operationId":"get_inbox_feed_api_v1_forum_inbox_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"}},{"name":"sentiment","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/inbox/stats":{"get":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Get Inbox Stats","description":"Inbox statistics: unread count, sentiment breakdown, platform breakdown.","operationId":"get_inbox_stats_api_v1_forum_inbox_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/inbox/{comment_id}/reply":{"post":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Reply To Comment","description":"Reply to a specific comment. In production this sends the reply\nvia the platform's API through Nango OAuth. Currently stubbed.","operationId":"reply_to_comment_api_v1_forum_inbox__comment_id__reply_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"string","title":"Comment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxReplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/inbox/{comment_id}/suggest-reply":{"post":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Suggest Reply","description":"AI-generate a reply suggestion for a comment.\nUses heuristic templates based on sentiment and question detection.\nNo LLM calls are made.","operationId":"suggest_reply_api_v1_forum_inbox__comment_id__suggest_reply_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"string","title":"Comment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/inbox/batch":{"post":{"tags":["Cortex Forum","Cortex Forum"],"summary":"Inbox Batch Action","description":"Apply a batch action to multiple comments.\nSupported: mark-read, mark-unread, hide, delete.","operationId":"inbox_batch_action_api_v1_forum_inbox_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxBatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/simulations/{sim_id}/twins":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - GodsEye"],"summary":"List Simulation Twins","description":"Paginated list of twin summaries for a live simulation.\n\nReturns lightweight rows — for full per-twin state hit\n/simulations/{sim_id}/twins/{twin_id}.","operationId":"list_simulation_twins_api_v1_forum_simulations__sim_id__twins_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sim_id","in":"path","required":true,"schema":{"type":"string","title":"Sim Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwinListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/simulations/{sim_id}/twins/{twin_id}":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - GodsEye"],"summary":"Get Simulation Twin","description":"Full state for a single twin within a simulation.","operationId":"get_simulation_twin_api_v1_forum_simulations__sim_id__twins__twin_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sim_id","in":"path","required":true,"schema":{"type":"string","title":"Sim Id"}},{"name":"twin_id","in":"path","required":true,"schema":{"type":"string","title":"Twin Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwinDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/simulations/{sim_id}/twins/{twin_id}/decisions":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - GodsEye"],"summary":"Get Simulation Twin Decisions","description":"Engagement-decision history for a single twin.\n\nSource: twin.last_engagement_by_content. Engagements are stamped on\nevery call to decide_content_engagement that includes a content_id.\nPhase-12 scope keeps this in-process; persistence is a follow-up.","operationId":"get_simulation_twin_decisions_api_v1_forum_simulations__sim_id__twins__twin_id__decisions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sim_id","in":"path","required":true,"schema":{"type":"string","title":"Sim Id"}},{"name":"twin_id","in":"path","required":true,"schema":{"type":"string","title":"Twin Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwinDecisionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/simulations/{sim_id}/state":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - GodsEye"],"summary":"Get Simulation State","description":"Sim-level snapshot — round, totals, injections, social-graph stats.","operationId":"get_simulation_state_api_v1_forum_simulations__sim_id__state_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sim_id","in":"path","required":true,"schema":{"type":"string","title":"Sim Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationStateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/simulations/{sim_id}/inject":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - GodsEye"],"summary":"Inject Simulation Variable","description":"Mid-run variable injection.\n\nAccepts pricing | messaging | audience_target | viral_seed. The\nPydantic Literal type rejects unsupported variable names with a 422\nautomatically. Returns the swap record so the client can confirm\n`previous_value` and `injected_at_round`.","operationId":"inject_simulation_variable_api_v1_forum_simulations__sim_id__inject_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sim_id","in":"path","required":true,"schema":{"type":"string","title":"Sim Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InjectVariableRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InjectVariableResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/simulations/{sim_id}/social-graph/summary":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - GodsEye"],"summary":"Get Social Graph Summary","description":"Social-graph stats for the God's-eye-view UI.\n\n404 if the simulation didn't enable the social layer (config flag\nenable_social_layer=False) — this is a configuration state, not a\nserver error.","operationId":"get_social_graph_summary_api_v1_forum_simulations__sim_id__social_graph_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sim_id","in":"path","required":true,"schema":{"type":"string","title":"Sim Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialGraphStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/simulations/{sim_id}/report":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - GodsEye"],"summary":"Get Simulation Report","description":"Emergent-pattern report for a live simulation.\n\nSurfaces top influencers, viral cascades, dead spots, niche clusters,\nand opinion polarization metrics. All heuristic — zero LLM calls,\ndeterministic given the simulation's seeded state. The response is\ndisplay-ready: each section carries a display_priority, chart_hint,\nand severity_tier so the Forum dashboard can render it directly.\n\n404 if the simulation isn't in the live registry. Empty population\nreturns a 200 with a low-signal executive_summary and confidence=0.0\nrather than 404 — this preserves a useful debugging surface for\ncallers who hit the endpoint mid-setup.","operationId":"get_simulation_report_api_v1_forum_simulations__sim_id__report_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sim_id","in":"path","required":true,"schema":{"type":"string","title":"Sim Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmergentPatternReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/seed/prime":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Seed Priming"],"summary":"Prime World From Seed","description":"Prime a live simulation's twin population from a real-world seed.\n\nBody shape: ``{ seed: SeedInput, population_id: str,\npriming_strength?: float }``.\n\nReturns ``WorldPrimingResult`` containing extracted topics,\nper-twin awareness deltas, needs added, and a per-segment count\nsummary suitable for \"before vs after\" heatmap rendering.\n\n404 if ``population_id`` is not registered. The simulation must\nhave already generated its ``digital_twins`` list -- this\nendpoint mutates that list in place.","operationId":"prime_world_from_seed_api_v1_forum_seed_prime_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrimePopulationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorldPrimingResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/multiplatform/compare":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - Multi-Platform"],"summary":"Multiplatform Compare","description":"Compare predicted engagement across multiple platforms in parallel.\n\nBody shape: see ``MultiPlatformCompareRequest``. Defaults to all five\nplatforms when ``platforms`` is omitted.\n\nReturns a ``MultiPlatformReport`` with one ``PlatformEngagementProfile``\nper platform - designed for direct dashboard rendering (one row per\nplatform, columns = engagement metrics, color-coded by\n``relative_performance``).","operationId":"multiplatform_compare_api_v1_forum_multiplatform_compare_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiPlatformCompareRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiPlatformReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/forum/simulations/{sim_id}/stream":{"get":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - GodsEye"],"summary":"SSE tail of per-decision action stream for a running simulation","description":"Server-Sent Events stream of decision-level events for `sim_id`.\n\nEmits one SSE message per JSONL line written by the simulator. Event\ntypes are: `sim_started`, `twin_engaged`, `cascade_started`,\n`dead_spot_detected`, `sim_completed`.\n\nThe stream ends when the server writes `sim_completed`, when the\nclient disconnects, or after `max_idle_seconds` of silence (timeout\nguard against a sim that crashed without a `sim_completed` marker).\n\nAuth: standard JWT via `get_current_user`. Tenant-scoped — the\nunderlying JSONL file is looked up under `ctx.empire_id` only, so a\nforeign empire's `sim_id` returns 404.","operationId":"stream_simulation_actions_api_v1_forum_simulations__sim_id__stream_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sim_id","in":"path","required":true,"schema":{"type":"string","title":"Sim Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/simulations/{sim_id}/persist":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - GodsEye"],"summary":"Persist Simulation Population","description":"Snapshot the live simulation's twin population.\n\nThe snapshot is scoped to the caller's empire (`ctx.empire_id`) and\naddressable via the returned `snapshot_id` for subsequent restores.\nDefault config persists EVERY twin (importance_threshold=0.0) so\nA/B variant runs see the full population, not just heavy hitters.\n\n404 if the sim_id isn't in the live registry.","operationId":"persist_simulation_population_api_v1_forum_simulations__sim_id__persist_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sim_id","in":"path","required":true,"schema":{"type":"string","title":"Sim Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PersistSimulationRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersistSimulationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/simulations/persist/{snapshot_id}/restore":{"post":{"tags":["Cortex Forum","Cortex Forum","Cortex Forum - GodsEye"],"summary":"Restore Simulation Population","description":"Hydrate a persisted snapshot into a NEW simulation.\n\nCross-empire isolation: if the snapshot_id was created under a\ndifferent empire than ctx.empire_id, returns 404 (NOT 403 — we\ndon't disclose that the snapshot exists under another tenancy).\nEventStream-level filter ALSO equality-checks empire_id, so an\nattacker can't read another tenant's snapshot even by bypassing\nthe in-process index.","operationId":"restore_simulation_population_api_v1_forum_simulations_persist__snapshot_id__restore_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string","title":"Snapshot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreSimulationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/sales-enablement/battlecards/generate":{"post":{"tags":["RevOps","REVOPS","REVOPS-SalesEnablement"],"summary":"Generate Battlecard","description":"Generate a deterministic battlecard for a competitor.\n\nHeuristic, no LLM. Same competitor + product_facts always produces the\nsame advantages/objections/landmines (UUID + timestamp aside).\n\nThe battlecard is filed under the CALLER'S tenant, resolved from the JWT.","operationId":"generate_battlecard_api_v1_revops_sales_enablement_battlecards_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateBattlecardRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Battlecard"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/sales-enablement/battlecards":{"get":{"tags":["RevOps","REVOPS","REVOPS-SalesEnablement"],"summary":"List Battlecards","description":"Paginated listing of the CALLER'S battlecards.\n\nThere is no tenant/empire parameter by design — the scope is whatever the\nverified token says it is, so this endpoint cannot be pointed at another\ntenant's data.","operationId":"list_battlecards_api_v1_revops_sales_enablement_battlecards_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BattlecardListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/sales-enablement/demo-scripts/generate":{"post":{"tags":["RevOps","REVOPS","REVOPS-SalesEnablement"],"summary":"Generate Demo Script","description":"Generate a demo script for a persona + scenario.\n\nSynthetic-mode by default (no LLM). LLM enrichment is opt-in via the\nservice layer — not exposed at the route level so we don't leak LLM\nconfig into the public API.","operationId":"generate_demo_script_api_v1_revops_sales_enablement_demo_scripts_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateDemoScriptRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoScript"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/sales-enablement/demo-scripts/{script_id}":{"get":{"tags":["RevOps","REVOPS","REVOPS-SalesEnablement"],"summary":"Get Demo Script","description":"Fetch one of the caller's demo scripts by id.\n\nA script owned by another tenant 404s identically to an id that was never\nissued — the response must not confirm that someone else's id is real.","operationId":"get_demo_script_api_v1_revops_sales_enablement_demo_scripts__script_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"script_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Script Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoScript"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/api/v1/revops/proposals/rfps/qualify":{"post":{"tags":["RevOps","REVOPS","REVOPS — Proposal Creation"],"summary":"Qualify Rfp","description":"Score an RFP for fit and produce a pursue/qualify/decline recommendation.\n\nPure deterministic scoring — no LLM. Use ``recommended_action`` as the\nrouting signal.","operationId":"qualify_rfp_api_v1_revops_api_v1_revops_proposals_rfps_qualify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RFPQualifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RFPQualification"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/api/v1/revops/proposals/roi/model":{"post":{"tags":["RevOps","REVOPS","REVOPS — Proposal Creation"],"summary":"Build Roi Model","description":"Build a 3-year customer ROI model with NPV, payback, IRR, and sensitivity.\n\nPure-math — no LLM. Outputs are reproducible from the inputs.","operationId":"build_roi_model_api_v1_revops_api_v1_revops_proposals_roi_model_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ROIModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ROIModel"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/api/v1/revops/proposals/generate":{"post":{"tags":["RevOps","REVOPS","REVOPS — Proposal Creation"],"summary":"Generate Proposal","description":"Generate a structured proposal from qualification + ROI + customer context.\n\nSynthetic-mode default: LLM is opt-in and routed through structured_execution\nwhen wired by the platform. The route itself does not call any LLM.\n\nThe qualification/ROI in the body are client-supplied; whatever owner they\nclaim is ignored and the proposal is filed under the caller's own tenant.","operationId":"generate_proposal_api_v1_revops_api_v1_revops_proposals_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalGenerateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Proposal"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/api/v1/revops/proposals/{proposal_id}":{"get":{"tags":["RevOps","REVOPS","REVOPS — Proposal Creation"],"summary":"Get Proposal","description":"Fetch one of the caller's proposals by id.\n\n404 (not 403) for another tenant's proposal: a 403 would confirm the id\nexists, which is itself a disclosure.","operationId":"get_proposal_api_v1_revops_api_v1_revops_proposals__proposal_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Proposal"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/api/v1/revops/conversations/analyze":{"post":{"tags":["RevOps","REVOPS","RevOps - Conversation Insights"],"summary":"Analyze Conversation","description":"Run heuristic analysis on a customer call transcript.","operationId":"analyze_conversation_api_v1_revops_api_v1_revops_conversations_analyze_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallTranscript"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationInsightsReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/api/v1/revops/conversations/objections/patterns":{"get":{"tags":["RevOps","REVOPS","RevOps - Conversation Insights"],"summary":"Objection Patterns","description":"Cross-call objection-frequency aggregate.","operationId":"objection_patterns_api_v1_revops_api_v1_revops_conversations_objections_patterns_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Objection Patterns Api V1 Revops Api V1 Revops Conversations Objections Patterns Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/api/v1/revops/conversations/{report_id}":{"get":{"tags":["RevOps","REVOPS","RevOps - Conversation Insights"],"summary":"Get Report","description":"Fetch a previously generated report by id.","operationId":"get_report_api_v1_revops_api_v1_revops_conversations__report_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationInsightsReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/api/v1/revops/pricing/recommend":{"post":{"tags":["RevOps","REVOPS","REVOPS — Negotiation & Pricing"],"summary":"Recommend Pricing","description":"Heuristic pricing recommendation given a deal context.","operationId":"recommend_pricing_api_v1_revops_api_v1_revops_pricing_recommend_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingRecommendRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingRecommendation"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/api/v1/revops/pricing/objection-handlers":{"get":{"tags":["RevOps","REVOPS","REVOPS — Negotiation & Pricing"],"summary":"List Objection Handlers","description":"List all 7 objection handlers (price, timing, authority, need, trust, competition, feature_gap).","operationId":"list_objection_handlers_api_v1_revops_api_v1_revops_pricing_objection_handlers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ObjectionHandler"},"type":"array","title":"Response List Objection Handlers Api V1 Revops Api V1 Revops Pricing Objection Handlers Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/api/v1/revops/pricing/objection-handlers/{category}":{"get":{"tags":["RevOps","REVOPS","REVOPS — Negotiation & Pricing"],"summary":"Get Objection Handler","description":"Fetch a single objection handler. 404 if unknown category.","operationId":"get_objection_handler_api_v1_revops_api_v1_revops_pricing_objection_handlers__category__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category","in":"path","required":true,"schema":{"type":"string","title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectionHandler"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/api/v1/revops/pricing/multi-year/structure":{"post":{"tags":["RevOps","REVOPS","REVOPS — Negotiation & Pricing"],"summary":"Structure Multi Year","description":"Structure a multi-year deal with commit discount and ramp schedule.","operationId":"structure_multi_year_api_v1_revops_api_v1_revops_pricing_multi_year_structure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiYearStructureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiYearDeal"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/organizations":{"get":{"tags":["RevOps","REVOPS"],"summary":"List Organizations","description":"List the authenticated user's RevOps organizations.\n\nEvery org-scoped RevOps endpoint takes ``org_id`` and resolves it through\n``_verify_org_access``, which does ``uuid.UUID(str(org_id))`` and 404s on\nanything malformed. The dashboard was calling these with a literal\n``org_id=default``, which is not a UUID - so every RevOps request 404'd,\nthe frontend's ``r.ok ? r.json() : null`` collapsed to null, and the page\nfell through to its MOCK_* constants. The fabricated pipeline was not an\nedge case; it was the only reachable outcome, because there was no way\nfor a client to discover its own org id. This endpoint closes that gap.\n\nScoped to ``current_user`` - never accepts a caller-supplied user or org.","operationId":"list_organizations_api_v1_revops_organizations_get","security":[{"HTTPBearer":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["RevOps","REVOPS"],"summary":"Create Organization","description":"Create REVOPS organization","operationId":"create_organization_api_v1_revops_organizations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_name","in":"query","required":true,"schema":{"type":"string","title":"Company Name"}},{"name":"industry","in":"query","required":true,"schema":{"type":"string","title":"Industry"}},{"name":"annual_revenue","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Annual Revenue"}},{"name":"employee_count","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Count"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/organizations/current":{"get":{"tags":["RevOps","REVOPS"],"summary":"Get Current Organization","description":"Resolve (and bootstrap on first use) the caller's RevOps org.\n\nNothing in the product ever called ``POST /organizations`` - the frontend\nhas zero references to it - so no user has ever had a RevOps org row. Even\nwith a correct ``org_id``, every org-scoped endpoint would 404. This is the\nmissing bootstrap: it returns the caller's org, creating one on first\naccess so a signed-in user has a valid ``org_id`` to scope requests with.\n\nIdempotent. Scoped to ``current_user``; a caller can never name another\nuser's org. Kept as a GET because it is the frontend's first call on load\nand must not require a separate provisioning step.","operationId":"get_current_organization_api_v1_revops_organizations_current_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/crm/connections":{"get":{"tags":["RevOps","REVOPS"],"summary":"List Crm Connections","description":"List this org's CRM connections and their real sync state.\n\nThe CRM page fetched this route and it did not exist — only\n``POST /crm/connect`` and ``POST /crm/sync`` did. So the page 404'd on\nevery load and fell through to a hardcoded ``MOCK_INTEGRATIONS`` list that\nshowed HubSpot and Salesforce as \"connected\" with invented deal counts.\nWith the mock removed the page had nothing to read, so it is added here.\n\nOwnership is enforced by ``require_org_access`` before the handler runs,\nwhich 404s on a foreign or malformed ``org_id``.\n\n``sync_status`` is returned verbatim from the row. It is NOT defaulted to\n\"connected\" — the frontend previously did ``?? 'connected'``, so a broken\nor never-synced integration rendered as healthy and syncing. An absent\nstatus is null here and shown as unknown.","operationId":"list_crm_connections_api_v1_revops_crm_connections_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/crm/connect":{"post":{"tags":["RevOps","REVOPS"],"summary":"Connect Crm","description":"Connect CRM system (Salesforce, HubSpot, Pipedrive)\n\nPowered by: Maestro (Operations Manager) for integration orchestration","operationId":"connect_crm_api_v1_revops_crm_connect_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"crm_provider","in":"query","required":true,"schema":{"type":"string","title":"Crm Provider"}},{"name":"sync_frequency","in":"query","required":false,"schema":{"type":"integer","default":15,"title":"Sync Frequency"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Credentials"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/crm/sync":{"post":{"tags":["RevOps","REVOPS"],"summary":"Sync Crm Data","description":"Manually trigger CRM sync\n\nPowered by: Maestro for data synchronization","operationId":"sync_crm_data_api_v1_revops_crm_sync_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/deals":{"get":{"tags":["RevOps","REVOPS"],"summary":"List Deals","description":"List all deals with optional filters","operationId":"list_deals_api_v1_revops_deals_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"stage","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"}},{"name":"min_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Amount"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["RevOps","REVOPS"],"summary":"Create Deal","description":"Create new deal","operationId":"create_deal_api_v1_revops_deals_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"deal_name","in":"query","required":true,"schema":{"type":"string","title":"Deal Name"}},{"name":"amount","in":"query","required":true,"schema":{"type":"number","title":"Amount"}},{"name":"stage","in":"query","required":true,"schema":{"type":"string","title":"Stage"}},{"name":"close_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Close Date"}},{"name":"account_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"}},{"name":"probability","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Probability"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/deals/{deal_id}/stage":{"patch":{"tags":["RevOps","REVOPS"],"summary":"Update Deal Stage","description":"Update a Deal's stage (called by the kanban drag-drop UI).\n\n- Validates the new stage against VALID_DEAL_STAGES.\n- Updates deal.stage (and lets SQLAlchemy's onupdate bump updated_at).\n- Also stamps last_activity_at so stale-deal detection sees the move.\n- Emits a ``deal_stage_changed`` event via the shared event bus.","operationId":"update_deal_stage_api_v1_revops_deals__deal_id__stage_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","title":"Deal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDealStageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/deals/{deal_id}/predict":{"get":{"tags":["RevOps","REVOPS"],"summary":"Predict Deal Outcome","description":"Get AI prediction for deal outcome\n\nPowered by: Finn (Financial Analyst) + Scout (Market Research)","operationId":"predict_deal_outcome_api_v1_revops_deals__deal_id__predict_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","title":"Deal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/forecast":{"post":{"tags":["RevOps","REVOPS"],"summary":"Generate Forecast","description":"Generate revenue forecast for period\n\nPowered by: Finn (Financial Analyst) - Monte Carlo forecasting\n\nREVOPS-ROLLUP: pass ``?group_by=rep`` to additively break the forecast\ndown per deal owner (deals.owner). Response shape is unchanged when the\nparam is omitted.","operationId":"generate_forecast_api_v1_revops_forecast_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"period","in":"query","required":true,"schema":{"type":"string","title":"Period"}},{"name":"group_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group By"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/pipeline/health":{"get":{"tags":["RevOps","REVOPS"],"summary":"Get Pipeline Health","description":"Get pipeline health metrics\n\nPowered by: Maestro (Operations Manager)\n\nREVOPS-ROLLUP: pass ``?group_by=rep`` to additively break pipeline-health\nmetrics down per deal owner (deals.owner). Per-rep totals reconcile to the\norg totals. Response shape is unchanged when the param is omitted.","operationId":"get_pipeline_health_api_v1_revops_pipeline_health_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"group_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group By"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/insights":{"get":{"tags":["RevOps","REVOPS"],"summary":"Get Ai Insights","description":"Get AI-generated insights\n\nPowered by: Scout, Finn, and Ops","operationId":"get_ai_insights_api_v1_revops_insights_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"priority","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/insights/generate":{"post":{"tags":["RevOps","REVOPS"],"summary":"Generate Insights","description":"Generate fresh AI insights\n\nPowered by: Scout (opportunities), Finn (risks), Maestro (optimization)","operationId":"generate_insights_api_v1_revops_insights_generate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/dashboard":{"get":{"tags":["RevOps","REVOPS"],"summary":"Get Dashboard","description":"Get REVOPS dashboard data","operationId":"get_dashboard_api_v1_revops_dashboard_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/deals/{deal_id}":{"get":{"tags":["RevOps","REVOPS"],"summary":"Get Deal Detail","description":"Get full deal detail: Deal row + last 20 activities + inline AI prediction.\n\nThe frontend detail page (`/dashboard/revops/deals/[id]`) fetches this\nin a single call. The AI prediction is merged into the response so the\npage doesn't have to make a second round trip.","operationId":"get_deal_detail_api_v1_revops_deals__deal_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","title":"Deal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/team":{"get":{"tags":["RevOps","REVOPS"],"summary":"Get Team Scorecard","description":"Per-rep scorecard with attainment vs quota.\n\nAggregates pipeline/won/count/avg-probability per rep, joins quotas to\ncompute attainment_pct, then returns a sorted list of scorecards plus\na team totals row. Handles empty-quota case by returning null quota\nfields rather than crashing.\n\nArgs:\n    org_id: RevOps organization id\n    timeframe: 'quarterly' | 'annual' | 'trailing_90d'","operationId":"get_team_scorecard_api_v1_revops_team_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"timeframe","in":"query","required":false,"schema":{"type":"string","default":"quarterly","title":"Timeframe"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/activity":{"get":{"tags":["RevOps","REVOPS"],"summary":"Get Revops Activity","description":"RevOps empire-wide activity feed.\n\nReturns cross-user events scoped to the 'revops' empire from the\nunified empire_events log. Backs the dashboard activity page.","operationId":"get_revops_activity_api_v1_revops_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/settings":{"get":{"tags":["RevOps","REVOPS"],"summary":"Get Revops Settings","description":"Get the current user's RevOps settings.\n\nReads from UserEntitlement.feature_flags on the revops vertical row.\nReturns sensible defaults if no entitlement row exists for this user.","operationId":"get_revops_settings_api_v1_revops_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["RevOps","REVOPS"],"summary":"Update Revops Settings","description":"Upsert the current user's RevOps settings into UserEntitlement.feature_flags.\n\nCreates an entitlement row if none exists (as a free/default row), so\nusers can configure preferences before they've activated a paid tier.\nEmits a settings_updated event on success.","operationId":"update_revops_settings_api_v1_revops_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevOpsSettings"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/deals/detect-stale":{"post":{"tags":["RevOps","REVOPS"],"summary":"Detect Stale Deals","description":"Admin trigger: scan for stale deals and emit deal_slipped events.\n\nMVP endpoint — production will also call ``_detect_stale_deals`` from\nthe scheduled action runner. Returns the list of stale deals flagged.","operationId":"detect_stale_deals_api_v1_revops_deals_detect_stale_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"threshold_days","in":"query","required":false,"schema":{"type":"integer","default":14,"title":"Threshold Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/leakage-scan":{"post":{"tags":["RevOps","REVOPS"],"summary":"Run Leakage Scan","description":"Scan all deals in an organization for systematic revenue leakage.\n\nDetects: unauthorized discounts, below-floor pricing, missing\nauto-renewal clauses, and missed expansion opportunities.\n\nAll analysis is heuristic. Results marked ``data_source: \"heuristic\"``.\n\nPowered by: Finn (Financial Analyst) + Maestro (Operations)","operationId":"run_leakage_scan_api_v1_revops_leakage_scan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeakageScanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/deals/{deal_id}/replay":{"post":{"tags":["RevOps","REVOPS"],"summary":"Deal Replay Endpoint","description":"Run counterfactual \"what-if\" analysis on a closed deal.\n\nSimulates alternative scenarios (earlier discount, earlier champion\nengagement, faster follow-up, etc.) and estimates how the outcome\nmight have changed.\n\nOnly available for closed deals (won or lost).\nResults marked ``data_source: \"estimated\"``.\n\nPowered by: Scout (Market Research) + Finn (Financial Analyst)","operationId":"deal_replay_endpoint_api_v1_revops_deals__deal_id__replay_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","title":"Deal Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DealReplayRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/deals/{deal_id}/contacts":{"get":{"tags":["RevOps","REVOPS"],"summary":"List Deal Contacts","description":"List all contacts for a deal (primary first, then by role).","operationId":"list_deal_contacts_api_v1_revops_deals__deal_id__contacts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","title":"Deal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["RevOps","REVOPS"],"summary":"Create Deal Contact","description":"Create a new contact on a deal.\n\nIf ``is_primary=True``, any existing primary on this deal is demoted\ninside the same transaction BEFORE insert — the partial unique index\nis backup enforcement.","operationId":"create_deal_contact_api_v1_revops_deals__deal_id__contacts_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","title":"Deal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealContactCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/deals/{deal_id}/contacts/{contact_id}":{"put":{"tags":["RevOps","REVOPS"],"summary":"Update Deal Contact","description":"Update a deal contact. Enforces the single-primary invariant.","operationId":"update_deal_contact_api_v1_revops_deals__deal_id__contacts__contact_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","title":"Deal Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealContactUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["RevOps","REVOPS"],"summary":"Delete Deal Contact","description":"Delete a deal contact. If it was the primary, Deal.contact_name\nis updated to the next-highest-role contact or NULL if no contacts\nremain.","operationId":"delete_deal_contact_api_v1_revops_deals__deal_id__contacts__contact_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","title":"Deal Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/pipeline/stages":{"get":{"tags":["RevOps","REVOPS"],"summary":"List Pipeline Stages","description":"List pipeline stages for an organization, ordered by stage_order.","operationId":"list_pipeline_stages_api_v1_revops_pipeline_stages_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["RevOps","REVOPS"],"summary":"Create Pipeline Stage","description":"Create a new pipeline stage.","operationId":"create_pipeline_stage_api_v1_revops_pipeline_stages_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineStageCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/pipeline/stages/{stage_id}":{"put":{"tags":["RevOps","REVOPS"],"summary":"Update Pipeline Stage","description":"Update an existing pipeline stage.","operationId":"update_pipeline_stage_api_v1_revops_pipeline_stages__stage_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"stage_id","in":"path","required":true,"schema":{"type":"string","title":"Stage Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineStageUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["RevOps","REVOPS"],"summary":"Delete Pipeline Stage","description":"Delete a pipeline stage.","operationId":"delete_pipeline_stage_api_v1_revops_pipeline_stages__stage_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"stage_id","in":"path","required":true,"schema":{"type":"string","title":"Stage Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/forecasts":{"get":{"tags":["RevOps","REVOPS"],"summary":"List Forecasts","description":"List saved revenue forecasts for an organization, newest first.","operationId":"list_forecasts_api_v1_revops_forecasts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/forecasts/{forecast_id}":{"get":{"tags":["RevOps","REVOPS"],"summary":"Get Forecast","description":"Get a specific saved forecast by ID.","operationId":"get_forecast_api_v1_revops_forecasts__forecast_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"forecast_id","in":"path","required":true,"schema":{"type":"string","title":"Forecast Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/analytics/compute":{"post":{"tags":["RevOps","REVOPS"],"summary":"Compute Analytics","description":"Compute revenue analytics from deal data for the specified period\nand persist to the RevenueAnalytics table.\n\nPowered by: Finn (Financial Analyst) + Maestro (Operations)","operationId":"compute_analytics_api_v1_revops_analytics_compute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsComputeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/analytics":{"get":{"tags":["RevOps","REVOPS"],"summary":"List Analytics","description":"List computed revenue analytics for an organization, newest first.","operationId":"list_analytics_api_v1_revops_analytics_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/deals/{deal_id}/enrich":{"post":{"tags":["RevOps","REVOPS"],"summary":"Enrich Deal","description":"Enrich a deal's account with firmographic, technographic, and intent data.\n\nPulls the deal's account_name, runs it through the data enrichment\nservice, attaches the result to the deal's ai_recommendations, and\nemits a deal_enriched event.\n\nReturns the enrichment result including enrichment_score (0-1).","operationId":"enrich_deal_api_v1_revops_deals__deal_id__enrich_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","title":"Deal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/agents/status":{"get":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Agents Status","description":"Flag state for the UI; the only endpoint that answers when the flag is off.","operationId":"agents_status_api_v1_revops_agents_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Agents Status Api V1 Revops Agents Status Get"}}}}}}},"/api/v1/revops/agents/consent":{"post":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Record Consent","operationId":"record_consent_api_v1_revops_agents_consent_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Record Consent Api V1 Revops Agents Consent Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/agents/consent/{email}":{"get":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Get Consent","operationId":"get_consent_api_v1_revops_agents_consent__email__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Consent Api V1 Revops Agents Consent  Email  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/agents/consent/{email}/withdraw":{"post":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Withdraw Consent","operationId":"withdraw_consent_api_v1_revops_agents_consent__email__withdraw_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Withdraw Consent Api V1 Revops Agents Consent  Email  Withdraw Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/agents/suppressions":{"get":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"List Suppressions","operationId":"list_suppressions_api_v1_revops_agents_suppressions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Suppressions Api V1 Revops Agents Suppressions Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Add Suppression","operationId":"add_suppression_api_v1_revops_agents_suppressions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Add Suppression Api V1 Revops Agents Suppressions Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/agents/send/evaluate":{"post":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Evaluate Only","operationId":"evaluate_only_api_v1_revops_agents_send_evaluate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Evaluate Only Api V1 Revops Agents Send Evaluate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/agents/send":{"post":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Send","operationId":"send_api_v1_revops_agents_send_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Send Api V1 Revops Agents Send Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/agents/send/log":{"get":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Send Log","operationId":"send_log_api_v1_revops_agents_send_log_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Send Log Api V1 Revops Agents Send Log Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/agents/dedupe/scan":{"post":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Dedupe Scan","operationId":"dedupe_scan_api_v1_revops_agents_dedupe_scan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DedupeScanIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Dedupe Scan Api V1 Revops Agents Dedupe Scan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/agents/dedupe/proposals/{proposal_id}/apply":{"post":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Dedupe Apply","operationId":"dedupe_apply_api_v1_revops_agents_dedupe_proposals__proposal_id__apply_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyMergeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Dedupe Apply Api V1 Revops Agents Dedupe Proposals  Proposal Id  Apply Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/agents/dedupe/events/{event_id}/unmerge":{"post":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Dedupe Unmerge","operationId":"dedupe_unmerge_api_v1_revops_agents_dedupe_events__event_id__unmerge_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Dedupe Unmerge Api V1 Revops Agents Dedupe Events  Event Id  Unmerge Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/agents/dedupe/events":{"get":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Dedupe Events","operationId":"dedupe_events_api_v1_revops_agents_dedupe_events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Dedupe Events Api V1 Revops Agents Dedupe Events Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/revops/agents/tiers":{"post":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Tiers","operationId":"tiers_api_v1_revops_agents_tiers_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TiersIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Tiers Api V1 Revops Agents Tiers Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/revops/agents/tiers/calibrate":{"post":{"tags":["RevOps CRM Agents","RevOps CRM Agents"],"summary":"Tiers Calibrate","operationId":"tiers_calibrate_api_v1_revops_agents_tiers_calibrate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalibrateIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Tiers Calibrate Api V1 Revops Agents Tiers Calibrate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/retainiq/organizations/current":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"Get Current Organization","description":"Resolve (and bootstrap on first use) the caller's RetainIQ org.\n\nThe dashboard was sending a hardcoded ``org_id=org_demo``, which is not a\nUUID, so ``_verify_org_access`` 404'd every request and the pages fell\nthrough to their MOCK_* constants. Nothing ever called\n``POST /organizations``, so no user had an org row to reference either.\nThis returns the caller's org, creating one on first access.\n\nIdempotent. Scoped to ``current_user``. Mirrors the RevOps bootstrap.","operationId":"get_current_organization_api_v1_retainiq_organizations_current_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/retainiq/organizations":{"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Create Organization","description":"Create RETAINIQ organization","operationId":"create_organization_api_v1_retainiq_organizations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_name","in":"query","required":true,"schema":{"type":"string","title":"Company Name"}},{"name":"industry","in":"query","required":true,"schema":{"type":"string","title":"Industry"}},{"name":"customer_count","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Customer Count"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/customers":{"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Add Customer","description":"Add customer account to monitor","operationId":"add_customer_api_v1_retainiq_customers_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"account_name","in":"query","required":true,"schema":{"type":"string","title":"Account Name"}},{"name":"primary_contact_email","in":"query","required":true,"schema":{"type":"string","title":"Primary Contact Email"}},{"name":"tier","in":"query","required":false,"schema":{"type":"string","default":"standard","title":"Tier"}},{"name":"mrr","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mrr"}},{"name":"contract_start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contract Start Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"List Customers","description":"List customers with optional filters","operationId":"list_customers_api_v1_retainiq_customers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"churn_risk","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Churn Risk"}},{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/customers/{customer_id}/health/calculate":{"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Calculate Health Score","description":"Calculate customer health score\n\nPowered by: Juno (engagement) + Finn (financial) + Ops (operational)","operationId":"calculate_health_score_api_v1_retainiq_customers__customer_id__health_calculate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/customers/{customer_id}/churn/predict":{"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Predict Churn","description":"Predict churn probability for customer\n\nPowered by: Finn (risk analysis) + Juno (engagement patterns)","operationId":"predict_churn_api_v1_retainiq_customers__customer_id__churn_predict_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/customers/{customer_id}/engagements":{"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Log Engagement","description":"Log customer engagement activity","operationId":"log_engagement_api_v1_retainiq_customers__customer_id__engagements_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"engagement_type","in":"query","required":true,"schema":{"type":"string","title":"Engagement Type"}},{"name":"positive_signal","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Positive Signal"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Metadata"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/playbooks":{"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Create Playbook","description":"Create automated retention playbook.\n\nPowered by: Ops (workflow automation) + Juno (content strategy).\n\nRequest body (JSON) — see CreatePlaybookRequest:\n    org_id, playbook_name, trigger_condition, trigger_threshold,\n    actions, priority (optional, default 50).\n\nReturns: the created RetentionPlaybook row.\n\nNOTE: This endpoint previously accepted org_id/playbook_name/\ntrigger_condition as query params. It now takes a single JSON body.\nFrontend playbook builder wizard must be updated to match.","operationId":"create_playbook_api_v1_retainiq_playbooks_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlaybookRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"List Playbooks","description":"List retention playbooks","operationId":"list_playbooks_api_v1_retainiq_playbooks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/playbooks/{playbook_id}/execute":{"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Execute Playbook","description":"Execute retention playbook for customer (P1.4 async job).\n\nValidates playbook + customer, creates PlaybookExecution record, then\nsubmits action dispatch to the background-job queue. Returns 202 with\npoll_url/stream_url. Previously used an unused `BackgroundTasks` param\n(commented-out at line 422 per P1.4 audit) — now wired through the\npersistent job queue instead.","operationId":"execute_playbook_api_v1_retainiq_playbooks__playbook_id__execute_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"customer_id","in":"query","required":true,"schema":{"type":"string","title":"Customer Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/upsell-opportunities":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"Get Upsell Opportunities","description":"Get AI-identified upsell opportunities\n\nPowered by: Finn (revenue opportunities) + Juno (customer readiness)","operationId":"get_upsell_opportunities_api_v1_retainiq_upsell_opportunities_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"min_confidence","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"default":70.0,"title":"Min Confidence"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/action-outbox":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"Get Action Outbox","description":"List durable outbox rows for dispatched playbook actions (DAY1 gap §5).\n\nEvery day-0 action a playbook executor dispatches is persisted to\n``retention_action_outbox`` with an honest status:\n  - 'stubbed' : composed but NOT delivered (is_stub handler)\n  - 'sent'    : a real handler succeeded\n  - 'failed'  : the action failed (``error`` populated)\n\nScope by ``tenant_id`` (RetainIQOrganization.id); optionally narrow to a\nsingle ``execution_id`` and/or ``status``.","operationId":"get_action_outbox_api_v1_retainiq_action_outbox_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"query","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"execution_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/customers/{customer_id}/upsell/identify":{"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Identify Upsell","description":"Identify upsell opportunities for customer\n\nPowered by: Finn (financial opportunity) + Juno (readiness assessment)","operationId":"identify_upsell_api_v1_retainiq_customers__customer_id__upsell_identify_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/dashboard":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"Get Dashboard","description":"Get RETAINIQ dashboard data","operationId":"get_dashboard_api_v1_retainiq_dashboard_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/customers/{customer_id}":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"Get Customer Detail","description":"Return full customer profile for the detail page.\n\nParams:\n    customer_id — UUID of the CustomerAccount row.\n\nReturns: dict with keys:\n    customer            — full CustomerAccount serialization\n    engagements         — most recent 20 CustomerEngagement rows\n    executions          — most recent 10 PlaybookExecution rows\n    feedback            — most recent 10 CustomerFeedback rows\n    latest_prediction   — most recent ChurnPrediction (or None)\n\n404 if customer not found.","operationId":"get_customer_detail_api_v1_retainiq_customers__customer_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/playbooks/{playbook_id}":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"Get Playbook","description":"Return a single RetentionPlaybook row by id.\n\n404 if not found.","operationId":"get_playbook_api_v1_retainiq_playbooks__playbook_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["RetainIQ","RETAINIQ"],"summary":"Update Playbook","description":"Update an existing retention playbook.\n\nAccepts the same JSON body as POST /playbooks (CreatePlaybookRequest).\nupdated_at is handled by SQLAlchemy. Emits a ``playbook_updated`` event.\n\n404 if playbook not found.","operationId":"update_playbook_api_v1_retainiq_playbooks__playbook_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlaybookRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/executions/{execution_id}":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"Get Execution Detail","description":"Return a single PlaybookExecution + all linked ScheduledAction rows,\nordered by step_index.\n\nReturns: dict with keys:\n    execution — PlaybookExecution serialization\n    actions   — list of ScheduledAction rows (id, step_index, action_type,\n                status, run_at, started_at, completed_at, attempts,\n                is_stub, last_error, result)\n\n404 if execution not found.","operationId":"get_execution_detail_api_v1_retainiq_executions__execution_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"execution_id","in":"path","required":true,"schema":{"type":"string","title":"Execution Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/playbooks/executions":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"List Playbook Executions","description":"List PlaybookExecution records for the given organization.\n\nQuery params:\n    org_id  — UUID of the RetainIQ organization\n    status  — optional filter (in_progress, completed, failed)\n    limit   — 1-200, default 50\n\nReturns: list of execution dicts, newest first.","operationId":"list_playbook_executions_api_v1_retainiq_playbooks_executions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: in_progress, completed, failed","title":"Status"},"description":"Filter by status: in_progress, completed, failed"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/scheduled":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"List Scheduled Actions","description":"List ScheduledAction rows for the given organization.\n\nDefaults to pending actions ordered by run_at ascending (soonest first).\n\nQuery params:\n    org_id  — UUID of the RetainIQ organization\n    status  — default 'pending'\n    limit   — 1-200, default 50\n\nReturns: list of scheduled action dicts.","operationId":"list_scheduled_actions_api_v1_retainiq_scheduled_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","description":"Filter by status: pending, running, completed, failed, cancelled","default":"pending","title":"Status"},"description":"Filter by status: pending, running, completed, failed, cancelled"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/settings":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"Get Retainiq Settings","description":"Return per-user RetainIQ settings.\n\nReads from ``UserEntitlement.feature_flags`` on the retainiq vertical row.\nIf no entitlement row exists, returns sensible defaults matching the\nfrontend settings page shape.","operationId":"get_retainiq_settings_api_v1_retainiq_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Update Retainiq Settings","description":"Upsert per-user RetainIQ settings into ``UserEntitlement.feature_flags``\non the retainiq vertical row. Emits ``settings_updated`` event.\n\nReturns the updated settings dict.","operationId":"update_retainiq_settings_api_v1_retainiq_settings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetainIQSettings"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/retainiq/scheduler/state":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"Get Scheduler State","description":"Introspect the RetainIQ playbook scheduler.\n\nReturns the live poll interval, batch size, and whether the\nbackground task is currently running. Used by the operator\ndashboard to confirm the scheduler came up cleanly after deploy.","operationId":"get_scheduler_state_api_v1_retainiq_scheduler_state_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/retainiq/activity":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"Get Retainiq Activity","description":"Return the RetainIQ empire-scoped activity feed.\n\nQuery params:\n    event_type — optional filter (e.g. 'playbook_completed')\n    limit      — 1-500, default 100\n    offset     — default 0\n\nReturns: list of EmpireEvent.to_dict() entries, newest first.","operationId":"get_retainiq_activity_api_v1_retainiq_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/customers/{customer_id}/expansion-triggers":{"get":{"tags":["RetainIQ","RETAINIQ"],"summary":"Get Expansion Triggers","description":"Detect expansion revenue triggers for a customer.\n\nAnalyses usage ceilings, team growth, champion promotions,\nfeature breadth, and support ticket decline to identify\naccounts ready for expansion. All scoring is heuristic-based.\n\nPowered by: Finn (revenue opportunity) + Juno (readiness signals)","operationId":"get_expansion_triggers_api_v1_retainiq_customers__customer_id__expansion_triggers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/customers/{customer_id}/autopsy":{"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Churn Autopsy","description":"Perform a post-churn autopsy analysis.\n\nAnalyses the timeline of events leading to churn, identifies missed\nsignals, computes the intervention window, and pattern-matches\nsimilar at-risk accounts. All analysis is heuristic-based.\n\nPowered by: Finn (financial impact) + Juno (engagement patterns) + Ops (process gaps)","operationId":"churn_autopsy_api_v1_retainiq_customers__customer_id__autopsy_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/customers/{customer_id}/simulate":{"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Simulate Health","description":"Digital twin health simulation: project customer health forward\nassuming no intervention.\n\nReturns projected health scores at day 30, 60, and the requested\nhorizon with confidence intervals and churn probabilities.\nAll projections are heuristic extrapolations.\n\nPowered by: Finn (financial decay) + Juno (engagement trends)","operationId":"simulate_health_api_v1_retainiq_customers__customer_id__simulate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/retainiq/customers/{customer_id}/enrich":{"post":{"tags":["RetainIQ","RETAINIQ"],"summary":"Enrich Customer","description":"Enrich a customer account with firmographic, technographic, and intent data.\n\nPulls the customer's account_name, runs it through the data enrichment\nservice, and returns the enrichment result.  Emits a customer_enriched\nevent.\n\nReturns the enrichment result including enrichment_score (0-1).","operationId":"enrich_customer_api_v1_retainiq_customers__customer_id__enrich_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/voice/jobs":{"get":{"tags":["Cortex Voice","Cortex Voice"],"summary":"List Voice Jobs","description":"List the current user's voice jobs in this empire.","operationId":"list_voice_jobs_api_v1_voice_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceJobListResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Cortex Voice","Cortex Voice"],"summary":"Create Voice Job","description":"Create a dubbing job. Returns immediately with status='pending'.\n\nClient polls GET /jobs/{id} for status transitions. Real worker enqueue\nis gated on engine integration (see VOICE-WORKER-ENQUEUE anchor).","operationId":"create_voice_job_api_v1_voice_jobs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVoiceJobRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/voice/jobs/{job_id}":{"get":{"tags":["Cortex Voice","Cortex Voice"],"summary":"Get Voice Job","description":"Get one job. 404 (not 403) on cross-tenant access — don't leak existence.","operationId":"get_voice_job_api_v1_voice_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/VoiceJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/voice/voices/clone":{"post":{"tags":["Cortex Voice","Cortex Voice"],"summary":"Create Voice Clone","description":"Enroll a voice clone. embedding_path stays NULL until the engine runs.","operationId":"create_voice_clone_api_v1_voice_voices_clone_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVoiceCloneRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceCloneResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/voice/voices":{"get":{"tags":["Cortex Voice","Cortex Voice"],"summary":"List Voice Clones","operationId":"list_voice_clones_api_v1_voice_voices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceCloneListResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/voice/voices/{clone_id}":{"delete":{"tags":["Cortex Voice","Cortex Voice"],"summary":"Delete Voice Clone","operationId":"delete_voice_clone_api_v1_voice_voices__clone_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"clone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Clone Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/voice/usage":{"get":{"tags":["Cortex Voice","Cortex Voice"],"summary":"Get Voice Usage","description":"Current billing period's metered minutes.\n\nv1: returns 0 if no row exists yet (rather than 404) — the absence of a\nusage row is semantically 'zero usage', not 'not found'.","operationId":"get_voice_usage_api_v1_voice_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceUsageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/forum/summary":{"get":{"tags":["Admin — Verticals"],"summary":"Forum Operator Summary","description":"Operator-level Forum health snapshot.\n\nReturns:\n    - population metrics: ContentSimulationBridge usage over the\n      last hour + stats on the last 20 predictions\n    - recent benchmark status (most recent benchmark_threshold_reached\n      event, if any)\n    - methodology credits (#185 / #186 / #187)\n    - known gaps panel","operationId":"forum_operator_summary_api_admin_forum_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Forum Operator Summary Api Admin Forum Summary Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/revops/summary":{"get":{"tags":["Admin — Verticals"],"summary":"Revops Operator Summary","description":"Operator-level RevOps health snapshot.\n\nReturns:\n    - router health: last request timestamp (last revops event, as\n      a lightweight proxy for router activity)\n    - ML model status: REVOPS_ML_SCORING_ENABLED env + artifact\n      existence on disk\n    - CRM integrations: HubSpot + Salesforce client file existence\n    - methodology chain #213 → #216 → #199","operationId":"revops_operator_summary_api_admin_revops_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Revops Operator Summary Api Admin Revops Summary Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/retainiq/summary":{"get":{"tags":["Admin — Verticals"],"summary":"Retainiq Operator Summary","description":"Operator-level RetainIQ health snapshot.\n\nReturns:\n    - executor state: scheduler running + task_done flag\n    - action handler registry: list of registered types + stubs flagged\n    - SMTP config check (env presence)\n    - Cox survival model: env flag + artifact existence","operationId":"retainiq_operator_summary_api_admin_retainiq_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Retainiq Operator Summary Api Admin Retainiq Summary Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/entitlements/me":{"get":{"tags":["Entitlements"],"summary":"List My Entitlements","description":"Return the authenticated user's entitlement map.\n\nResponse shape:\n    {\n        \"user_id\": \"...\",\n        \"verticals\": {\n            \"ai_employees\": {status, tier, has_access, trial_expires_at, upgrade_url},\n            \"shield\":       {...},\n            \"forum\":        {...},\n            \"revops\":       {...},\n            \"retainiq\":     {...},\n        },\n        \"has_any_paid\": bool,\n        \"has_any_trial\": bool\n    }\n\nLocked verticals have ``status='locked'`` and ``upgrade_url`` populated\nso the sidebar can render them with a grayed-out \"Upgrade\" badge.","operationId":"list_my_entitlements_api_v1_entitlements_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List My Entitlements Api V1 Entitlements Me Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/entitlements/me/{vertical}":{"get":{"tags":["Entitlements"],"summary":"Check Vertical Access","description":"Quick check: does the current user have access to a specific vertical?\n\nUsed by route-protection middleware on per-vertical dashboard layouts.","operationId":"check_vertical_access_api_v1_entitlements_me__vertical__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"vertical","in":"path","required":true,"schema":{"type":"string","title":"Vertical"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Check Vertical Access Api V1 Entitlements Me  Vertical  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/entitlements/me/{vertical}/trial":{"post":{"tags":["Entitlements"],"summary":"Start Trial","description":"Start a free trial on a vertical. Defaults to 7 days.\n\nPhase 5a MVP: any authenticated user can start one trial per vertical.\nPhase 5b will add eligibility checks (e.g., has the user already\ncompleted a trial for this vertical? are they in good standing on\ntheir primary subscription?).","operationId":"start_trial_api_v1_entitlements_me__vertical__trial_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"vertical","in":"path","required":true,"schema":{"type":"string","title":"Vertical"}},{"name":"trial_days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Trial Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Start Trial Api V1 Entitlements Me  Vertical  Trial Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/autonomous/settings":{"get":{"tags":["Autonomous Mode"],"summary":"Get Autonomous Settings","description":"Return this empire's Autonomous Mode settings + whether the tier qualifies.","operationId":"get_autonomous_settings_api_v1_autonomous_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["Autonomous Mode"],"summary":"Set Autonomous Settings","description":"Enable/disable Autonomous Mode. Enabling is tier-gated (Manager+) and\nrequires a positive per-night NCU budget cap.","operationId":"set_autonomous_settings_api_v1_autonomous_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomousSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/autonomous/approvals":{"get":{"tags":["Autonomous Mode"],"summary":"List Pending Approvals","description":"Tasks the autonomous loop parked for this empire's human approval.","operationId":"list_pending_approvals_api_v1_autonomous_approvals_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/autonomous/approvals/{approval_id}/resolve":{"post":{"tags":["Autonomous Mode"],"summary":"Resolve Approval","description":"Approve or reject a parked task. Empire-scoped — you can only resolve your\nown empire's queue. Approving lets the NEXT run execute the task.","operationId":"resolve_approval_api_v1_autonomous_approvals__approval_id__resolve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"integer","title":"Approval Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveApprovalRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/autonomous/activity":{"get":{"tags":["Autonomous Mode"],"summary":"Recent Activity","description":"Recent executed-task results for this empire (the 'what happened' feed).","operationId":"recent_activity_api_v1_autonomous_activity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/invoices/":{"get":{"tags":["Billing","Invoices"],"summary":"List Invoices","description":"List the authenticated user's invoices.\n\n**MVP note**: invoices are synthesized from active entitlements.\nSee module docstring. When real Stripe integration lands, this\nendpoint's public contract does not change.","operationId":"list_invoices_api_v1_billing_invoices__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: paid | pending | failed | refunded","title":"Status"},"description":"Filter by status: paid | pending | failed | refunded"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/invoices/{invoice_id}":{"get":{"tags":["Billing","Invoices"],"summary":"Get Invoice","description":"Return a single invoice with line items.\n\nMVP: resolves against the synthesized invoice list. Only invoices\nowned by the current user are visible — 404 otherwise.","operationId":"get_invoice_api_v1_billing_invoices__invoice_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/invoices/{invoice_id}/pdf":{"get":{"tags":["Billing","Invoices"],"summary":"Download Invoice Pdf","description":"Stub endpoint. PDF generation is Phase 5b work.\n\nReturns 501 Not Implemented. The frontend already renders this as a\ndisabled \"Download PDF (stub)\" button.","operationId":"download_invoice_pdf_api_v1_billing_invoices__invoice_id__pdf_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Download Invoice Pdf Api V1 Billing Invoices  Invoice Id  Pdf Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/":{"get":{"tags":["Notifications"],"summary":"List Notifications","description":"Return the user's notifications feed.\n\nResponse shape:\n    {\n        \"notifications\": [event.to_dict(), ...],\n        \"unread_count\": int,\n        \"total_count\": int  # number returned in this page\n    }","operationId":"list_notifications_api_v1_notifications__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"empire","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by empire: forum|revops|retainiq|shield|billing|system","title":"Empire"},"description":"Filter by empire: forum|revops|retainiq|shield|billing|system"},{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by severity: info|warning|critical","title":"Severity"},"description":"Filter by severity: info|warning|critical"},{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only return unread notifications","default":false,"title":"Unread Only"},"description":"Only return unread notifications"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Notifications Api V1 Notifications  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/unread-count":{"get":{"tags":["Notifications"],"summary":"Unread Count","description":"Quick unread count for the navbar notification badge.\n\nResponse shape:\n    {\"unread_count\": int}","operationId":"unread_count_api_v1_notifications_unread_count_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"integer"},"type":"object","title":"Response Unread Count Api V1 Notifications Unread Count Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/notifications/{event_id}/read":{"post":{"tags":["Notifications"],"summary":"Mark Read","description":"Mark a single notification as read. 404 if it doesn't exist or is\nnot owned by the current user (or is already read).","operationId":"mark_read_api_v1_notifications__event_id__read_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Mark Read Api V1 Notifications  Event Id  Read Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/mark-all-read":{"post":{"tags":["Notifications"],"summary":"Mark All Read","description":"Bulk mark-all-read. If ``empire`` is provided, only notifications\nfrom that empire are affected.\n\nResponse shape:\n    {\"count_marked\": int}","operationId":"mark_all_read_api_v1_notifications_mark_all_read_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"empire","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optionally scope mark-all to a single empire","title":"Empire"},"description":"Optionally scope mark-all to a single empire"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"Response Mark All Read Api V1 Notifications Mark All Read Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/usage/me":{"get":{"tags":["Usage"],"summary":"My Usage","description":"Return the authenticated user's per-vertical usage for the current\nbilling period.\n\nVerticals the user does not have an active entitlement on are set\nto ``None`` in the response so the frontend can hide or gray them\nout without needing a separate entitlements fetch.\n\nShape:\n    {\n      \"period_start\": \"...\",\n      \"period_end\":   \"...\",\n      \"ai_employees\": {\"ncu_used\": int|null, \"ncu_limit\": int|null} | null,\n      \"shield\":       {\"events_processed\": ..., \"events_limit\": ...} | null,\n      \"forum\":        {\"predictions_used\": int, \"predictions_limit\": int} | null,\n      \"revops\":       {\"deals_scored\": int, \"deals_limit\": int} | null,\n      \"retainiq\":     {\"customers_monitored\": int, \"playbooks_run\": int, \"customers_limit\": int} | null\n    }","operationId":"my_usage_api_v1_usage_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response My Usage Api V1 Usage Me Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/jobs/{job_id}":{"get":{"tags":["Jobs"],"summary":"Get Job","operationId":"get_job_api_v1_jobs__job_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","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"}}}}}}},"/api/v1/jobs":{"get":{"tags":["Jobs"],"summary":"List My Jobs","operationId":"list_my_jobs_api_v1_jobs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/cancel":{"post":{"tags":["Jobs"],"summary":"Cancel","operationId":"cancel_api_v1_jobs__job_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","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"}}}}}}},"/api/v1/jobs/{job_id}/stream":{"get":{"tags":["Jobs"],"summary":"Stream","operationId":"stream_api_v1_jobs__job_id__stream_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forum/predict-free":{"post":{"tags":["Cortex Forum — Free"],"summary":"Free-tier virality prediction (no auth, 3 requests / IP / day)","description":"Run a single free-tier virality prediction.\n\nFlow:\n    1. Extract + hash client IP.\n    2. Check daily quota; return 429 with reset-at if exceeded.\n    3. Run ``ContentSimulationBridge.predict_virality`` (no LLM calls).\n    4. Build response envelope + signals.\n    5. Stamp rate-limit headers on the way out.\n    6. Emit observability event (fire-and-forget).","operationId":"predict_virality_free_api_v1_forum_predict_free_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreePredictRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreePredictResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/approvals":{"get":{"tags":["Approvals"],"summary":"List Approvals","description":"List pending approvals visible to the current user's org.","operationId":"list_approvals_api_v1_approvals_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"vertical","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vertical key","title":"Vertical"},"description":"Filter by vertical key"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalSummary"},"title":"Response List Approvals Api V1 Approvals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/approvals/stream":{"get":{"tags":["Approvals"],"summary":"Stream Approvals","description":"SSE feed — one event per pending_added / pending_resolved / pending_expired.","operationId":"stream_approvals_api_v1_approvals_stream_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/approvals/{approval_id}":{"get":{"tags":["Approvals"],"summary":"Get Approval","description":"Full detail for one approval. 404 (not 403) on cross-org access to avoid ID enumeration.","operationId":"get_approval_api_v1_approvals__approval_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/approvals/{approval_id}/decide":{"post":{"tags":["Approvals"],"summary":"Decide Approval","description":"Approve or reject a pending request. Records the decision in the audit trail.","operationId":"decide_approval_api_v1_approvals__approval_id__decide_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/memory/cross_employee":{"get":{"tags":["Cross-Employee Memory"],"summary":"Cross Employee Memory","description":"Query shared workflow memories within one empire/vertical.\n\nSECURITY: the caller must be authenticated AND entitled to the requested\nvertical. Previously this endpoint was unauthenticated and trusted a\ncaller-supplied ``empire`` string, letting anyone read any vertical's\nshared memory pool (cross-tenant IDOR). We now require a valid JWT and\nverify the user holds an active entitlement for ``empire`` before querying.","operationId":"cross_employee_memory_api_v1_memory_cross_employee_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"empire","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Empire/vertical scope, e.g. 'revops'","title":"Empire"},"description":"Empire/vertical scope, e.g. 'revops'"},{"name":"topic","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Task type / topic to recall","title":"Topic"},"description":"Task type / topic to recall"},{"name":"requesting_employee_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Employee ID making the query","title":"Requesting Employee Id"},"description":"Employee ID making the query"},{"name":"min_confidence","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.0,"description":"Minimum impact_score","default":0.8,"title":"Min Confidence"},"description":"Minimum impact_score"},{"name":"top_k","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Max results","default":5,"title":"Top K"},"description":"Max results"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cross Employee Memory Api V1 Memory Cross Employee Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cortex-memory/status":{"get":{"tags":["Cortex Memory"],"summary":"Cortex Memory Status","description":"Report which memory tiers are live for this deployment.\n\nAuthenticated because it describes infrastructure wiring. It returns NO\ntenant data — only which stores are active, stubbed, or unknown — so it is\nsafe for any signed-in user and is the honest precondition for reading\nanything else: a tier that is `not_recording` will always return zero\nitems, and the UI must say that rather than implying an empty account.","operationId":"cortex_memory_status_api_v1_cortex_memory_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Cortex Memory Status Api V1 Cortex Memory Status Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/cortex-memory/usage":{"get":{"tags":["Cortex Memory"],"summary":"Cortex Memory Usage","description":"Query usage and tier limits for the caller's project.\n\nReads the ops log persisted since 430a65f. Before that commit every\nMemoryEvent was emitted and discarded, so there is no usage history prior\nto it — this reports from when recording started, not from account\ncreation.\n\n`measured: false` means the count could not be read (no pool, or the query\nfailed). That is NOT zero, and a client must not render it as zero: one\nsays \"you have used none of your allowance\", the other says \"we do not\nknow\". Only one of those is a claim we can make.","operationId":"cortex_memory_usage_api_v1_cortex_memory_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Cortex Memory Usage Api V1 Cortex Memory Usage Get"}}}}}}},"/api/v1/cortex-memory/recent":{"get":{"tags":["Cortex Memory"],"summary":"Cortex Memory Recent","description":"Return recent memory content for the caller's project only.\n\nScope resolution is identical to `/brief` and `/ingest` — deliberately.\nAn earlier revision of this endpoint read the first-party tenant\n`empire_id` from TenantContext while the write endpoints used the derived\nproject id, which meant a developer could POST trajectories all day and\nthen open the console to an empty page. Read and write MUST resolve scope\nthe same way or the product silently lies about what it stored.\n\n`empire_id` is never taken from a query param, body, or header; see\ndependencies/memory_project.py for why that is load-bearing.","operationId":"cortex_memory_recent_api_v1_cortex_memory_recent_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cortex Memory Recent Api V1 Cortex Memory Recent Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cortex-memory/brief":{"post":{"tags":["Cortex Memory"],"summary":"Cortex Memory Brief","description":"Retrieve what memory holds that is relevant to this task.\n\nCall before your agent acts and pass the result into its prompt.","operationId":"cortex_memory_brief_api_v1_cortex_memory_brief_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Cortex Memory Brief Api V1 Cortex Memory Brief Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cortex-memory/ingest":{"post":{"tags":["Cortex Memory"],"summary":"Cortex Memory Ingest","description":"Record what your agent did, so future briefs can draw on it.\n\nSend this on EVERY exit path — success, partial and failure. Failures are\nthe highest-value input: they are what the reasoning bank distils lessons\nfrom. Dropping them is the most common way teams make memory useless.","operationId":"cortex_memory_ingest_api_v1_cortex_memory_ingest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Cortex Memory Ingest Api V1 Cortex Memory Ingest Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/.well-known/agent.json":{"get":{"tags":["A2A Protocol"],"summary":"Well Known Agent","operationId":"well_known_agent__well_known_agent_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/a2a/agents/{employee_id}/card.json":{"get":{"tags":["A2A Protocol"],"summary":"Agent Card","operationId":"agent_card_a2a_agents__employee_id__card_json_get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/a2a/agents/{employee_id}/tasks":{"post":{"tags":["A2A Protocol"],"summary":"Submit Task","operationId":"submit_task_a2a_agents__employee_id__tasks_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/a2a/agents/{employee_id}/tasks/{task_id}":{"get":{"tags":["A2A Protocol"],"summary":"Get Task","operationId":"get_task_a2a_agents__employee_id__tasks__task_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/a2a/agents/{employee_id}/tasks/{task_id}/stream":{"get":{"tags":["A2A Protocol"],"summary":"Stream Task","operationId":"stream_task_a2a_agents__employee_id__tasks__task_id__stream_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/extract":{"post":{"tags":["Documents","documents"],"summary":"Extract Document","description":"Extract text, tables, and structure from document using PaddleOCR-VL\n\n**Supports:**\n- PDFs (multi-page)\n- Images (PNG, JPG, JPEG)\n- 109 languages\n\n**Cost:** ~$0.001 per page\n\n**Example:**\n```bash\ncurl -X POST \"http://localhost:8000/api/documents/extract\"       -F \"file=@invoice.pdf\"       -F \"extract_tables=true\"\n```","operationId":"extract_document_api_documents_extract_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"extract_tables","in":"query","required":false,"schema":{"type":"boolean","description":"Extract tables","default":true,"title":"Extract Tables"},"description":"Extract tables"},{"name":"extract_layout","in":"query","required":false,"schema":{"type":"boolean","description":"Preserve layout","default":true,"title":"Extract Layout"},"description":"Preserve layout"},{"name":"languages","in":"query","required":false,"schema":{"type":"string","description":"Comma-separated language codes","default":"en","title":"Languages"},"description":"Comma-separated language codes"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_document_api_documents_extract_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/search":{"post":{"tags":["Documents","documents"],"summary":"Search Documents","description":"Search indexed documents using ColPali visual retrieval\n\n**Requires:** Documents must be indexed first (use /index endpoint)\n\n**Cost:** ~$0.0001 per query\n\n**Example:**\n```bash\ncurl -X POST \"http://localhost:8000/api/documents/search\"       -H \"Content-Type: application/json\"       -d '{\"query\": \"revenue trends Q3\", \"top_k\": 10}'\n```","operationId":"search_documents_api_documents_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/documents/index":{"post":{"tags":["Documents","documents"],"summary":"Index Document","description":"Index document for visual retrieval using ColPali\n\n**One-time operation** - Index documents once, search many times\n\n**Cost:** ~$0.0002 per page\n\n**Example:**\n```bash\ncurl -X POST \"http://localhost:8000/api/documents/index\"       -F \"file=@financial_report.pdf\"       -F 'metadata={\"category\":\"financial\",\"year\":\"2024\"}'\n```","operationId":"index_document_api_documents_index_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"metadata","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON metadata string","title":"Metadata"},"description":"JSON metadata string"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_index_document_api_documents_index_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/analyze":{"post":{"tags":["Documents","documents"],"summary":"Analyze Documents","description":"Analyze document using full pipeline (ColPali → PaddleOCR → LLM)\n\n**Best for:** Complex analysis requiring understanding of document content\n\n**Pipeline:**\n1. ColPali finds relevant pages (fast)\n2. PaddleOCR extracts structured data (accurate)\n3. LLM analyzes and answers query (intelligent)\n\n**Cost:** ~$0.001-$0.01 per query (99% cheaper than naive approach)\n\n**Example:**\n```bash\ncurl -X POST \"http://localhost:8000/api/documents/analyze\"       -F \"file=@annual_report.pdf\"       -F \"query=Summarize key financial metrics and identify risks\"       -F \"max_pages=50\"\n```","operationId":"analyze_documents_api_documents_analyze_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","description":"Analysis query","title":"Query"},"description":"Analysis query"},{"name":"max_pages","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max pages to analyze","default":50,"title":"Max Pages"},"description":"Max pages to analyze"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analyze_documents_api_documents_analyze_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/cost-estimate":{"post":{"tags":["Documents","documents"],"summary":"Estimate Cost","description":"Estimate cost before processing\n\n**Task Types:**\n- `search` - Visual retrieval (~$0.0002/page)\n- `extract` - OCR extraction (~$0.001/page)\n- `analyze` - Full pipeline (~$0.001-$0.01/page)\n- `index` - One-time indexing (~$0.0002/page)\n\n**Example:**\n```bash\ncurl -X POST \"http://localhost:8000/api/documents/cost-estimate\"       -H \"Content-Type: application/json\"       -d '{\"task_type\": \"analyze\", \"num_pages\": 1000}'\n```","operationId":"estimate_cost_api_documents_cost_estimate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostEstimateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostEstimateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/documents/health":{"get":{"tags":["Documents","documents"],"summary":"Health Check","description":"Health check for document processing services\n\n**Returns:**\n- Status of PaddleOCR provider\n- Status of ColPali service\n- Available features","operationId":"health_check_api_documents_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/files/generate":{"post":{"tags":["Files","Files"],"summary":"Generate File","description":"Generate a real .xlsx/.pptx/.docx and register it as a downloadable,\ntenant-scoped artifact. Returns an ``output_file_id`` usable with\nGET /api/files/{id}/download.","operationId":"generate_file_api_files_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__files_router__GenerateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Generate File Api Files Generate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/files":{"get":{"tags":["Files","Files"],"summary":"List Files","description":"List the caller's files (uploads + generated artifacts), newest first.\n\nThe delivery surface: without this, a generated artifact has an id that\nnothing can enumerate, so a customer could never actually find their file.\nEmpire-scoped — a caller only ever sees their own tenant's rows.","operationId":"list_files_api_files_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Files Api Files Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/files/upload":{"post":{"tags":["Files","Files"],"summary":"Upload File","description":"Upload a PDF: validate -> store in tenant-scoped Storage -> register row.","operationId":"upload_file_api_files_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_api_files_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Upload File Api Files Upload Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/files/{file_id}/download":{"get":{"tags":["Files","Files"],"summary":"Download File","description":"Return a short-lived presigned GET URL for a tenant-owned file.","operationId":"download_file_api_files__file_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Download File Api Files  File Id  Download Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/files/output":{"post":{"tags":["Files","Files"],"summary":"Store Output Artifact","description":"OUTPUT seam — register employee-produced BYTES as a derived, downloadable\n``platform.files`` row.\n\nThis is the hand-back side of the pipeline that was missing: the upload flow\nis one-way (upload -> process -> summary string). Today's day-1 employee\n(Scribe) returns TEXT, which /process auto-registers; when an employee emits\nreal bytes (a rendered PDF, an .xlsx, a .png), the caller POSTs them here and\ngets an ``output_file_id`` its result can reference and later download via\nGET /{id}/download. Accepts ANY mime — nothing here is PDF/Scribe-specific.\n\nTHE REMAINING SEAM: an actual employee still has to *emit* bytes and call\nthis endpoint (or route through /process). This wires the store->register->\ndownload path; it does not itself make Scribe render a PDF.","operationId":"store_output_artifact_api_files_output_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_store_output_artifact_api_files_output_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Store Output Artifact Api Files Output Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/files/{file_id}/process":{"post":{"tags":["Files","Files"],"summary":"Process File","description":"Fetch bytes -> extract text -> Scribe summary. The day-1 answer flow.","operationId":"process_file_api_files__file_id__process_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Process File Api Files  File Id  Process Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/trial/config":{"get":{"tags":["Trial"],"summary":"Get Trial Config","description":"Get trial configuration (public)","operationId":"get_trial_config_api_trial_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Trial Config Api Trial Config Get"}}}}}}},"/api/trial/signup":{"post":{"tags":["Trial"],"summary":"Signup Trial","description":"Sign up for a free 7-day trial.\n\n- No credit card required\n- 5,000 Neural Credits\n- Full Manager tier access\n- All 44 employees unlocked","operationId":"signup_trial_api_trial_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialSignupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialSignupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/trial/status/{email}":{"get":{"tags":["Trial"],"summary":"Get Trial Status","description":"Get trial status for an email","operationId":"get_trial_status_api_trial_status__email__get","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/trial/use-credits/{email}":{"post":{"tags":["Trial"],"summary":"Use Credits","description":"Deduct credits from a trial.\nUsed internally when trial user makes requests.","operationId":"use_credits_api_trial_use_credits__email__post","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}},{"name":"amount","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Amount"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Use Credits Api Trial Use Credits  Email  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/trial/stats":{"get":{"tags":["Trial"],"summary":"Get Trial Stats","description":"Get trial statistics (admin endpoint)","operationId":"get_trial_stats_api_trial_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Trial Stats Api Trial Stats Get"}}}}}}},"/api/subscription/tiers":{"get":{"tags":["Subscription"],"summary":"Get Available Tiers","description":"Get all available subscription tiers","operationId":"get_available_tiers_api_subscription_tiers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Available Tiers Api Subscription Tiers Get"}}}}}}},"/api/subscription/status/{email}":{"get":{"tags":["Subscription"],"summary":"Get Subscription Status","description":"Get current subscription status","operationId":"get_subscription_status_api_subscription_status__email__get","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Subscription Status Api Subscription Status  Email  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/subscription/upgrade":{"post":{"tags":["Subscription"],"summary":"Upgrade Or Downgrade Plan","description":"Upgrade or downgrade subscription plan.\n\n- Upgrades are prorated (you pay the difference for remaining days)\n- Unused credits carry over for 30 days\n- Downgrades take effect at next billing cycle","operationId":"upgrade_or_downgrade_plan_api_subscription_upgrade_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__subscription_router__UpgradeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__subscription_router__UpgradeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/subscription/credits/purchase":{"post":{"tags":["Subscription"],"summary":"Purchase Credits","description":"Purchase additional Neural Credits","operationId":"purchase_credits_api_subscription_credits_purchase_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__subscription_router__CreditPurchaseRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Purchase Credits Api Subscription Credits Purchase Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/subscription/credits/use":{"post":{"tags":["Subscription"],"summary":"Use Credits","description":"Deduct credits and check for notification thresholds.\nCalled internally when user performs operations.","operationId":"use_credits_api_subscription_credits_use_post","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","title":"Email"}},{"name":"amount","in":"query","required":true,"schema":{"type":"integer","title":"Amount"}},{"name":"operation","in":"query","required":false,"schema":{"type":"string","default":"chat","title":"Operation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Use Credits Api Subscription Credits Use Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/subscription/credits/usage/{email}":{"get":{"tags":["Subscription"],"summary":"Get Credit Usage","description":"Get credit usage history","operationId":"get_credit_usage_api_subscription_credits_usage__email__get","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Credit Usage Api Subscription Credits Usage  Email  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/subscription/notifications/settings":{"post":{"tags":["Subscription"],"summary":"Update Notification Settings","description":"Update credit notification preferences","operationId":"update_notification_settings_api_subscription_notifications_settings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettings"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Update Notification Settings Api Subscription Notifications Settings Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/subscription/notifications/settings/{email}":{"get":{"tags":["Subscription"],"summary":"Get Notification Settings","description":"Get current notification settings","operationId":"get_notification_settings_api_subscription_notifications_settings__email__get","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Notification Settings Api Subscription Notifications Settings  Email  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/subscription/byok/setup":{"post":{"tags":["Subscription"],"summary":"Setup Byok","description":"Configure BYOK (Bring Your Own Keys) for Agency tier.\nAllows users to use their own API keys for LLM providers.","operationId":"setup_byok_api_subscription_byok_setup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BYOKSetupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Setup Byok Api Subscription Byok Setup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/subscription/byok/configured":{"get":{"tags":["Subscription"],"summary":"Get Byok Configured","description":"# === T2-BYOK-STORAGE ===\nGet BYOK configuration status for the authenticated user. Replaces the\nlegacy ``GET /byok/status/{email}`` endpoint (which was unauthenticated\nand trivially enumerable by email).","operationId":"get_byok_configured_api_subscription_byok_configured_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Byok Configured Api Subscription Byok Configured Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/subscription/byok/{provider}":{"delete":{"tags":["Subscription"],"summary":"Remove Byok Provider","description":"Remove a BYOK provider configuration","operationId":"remove_byok_provider_api_subscription_byok__provider__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove Byok Provider Api Subscription Byok  Provider  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/subscription/admin/stats":{"get":{"tags":["Subscription"],"summary":"Get Subscription Stats","description":"Get subscription statistics (admin endpoint)","operationId":"get_subscription_stats_api_subscription_admin_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Subscription Stats Api Subscription Admin Stats Get"}}}}}}},"/api/oauth/init":{"post":{"tags":["OAuth"],"summary":"Create Oauth Init Ticket","description":"Mint a single-use ticket binding an OAuth flow to the CALLER's email.","operationId":"create_oauth_init_ticket_api_oauth_init_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthInitRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthInitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/oauth/google/login":{"get":{"tags":["OAuth"],"summary":"Google Login","description":"Initiate Google OAuth login.\nRedirects user to Google's consent screen.","operationId":"google_login_api_oauth_google_login_get","parameters":[{"name":"redirect_uri","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"}},{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"}},{"name":"trial","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trial"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/microsoft/login":{"get":{"tags":["OAuth"],"summary":"Microsoft Login","description":"Initiate Microsoft OAuth login.\nRedirects user to Microsoft's consent screen.","operationId":"microsoft_login_api_oauth_microsoft_login_get","parameters":[{"name":"redirect_uri","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"}},{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"}},{"name":"trial","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trial"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/google/callback":{"get":{"tags":["OAuth"],"summary":"Google Callback","description":"Handle Google OAuth callback","operationId":"google_callback_api_oauth_google_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/microsoft/callback":{"get":{"tags":["OAuth"],"summary":"Microsoft Callback","description":"Handle Microsoft OAuth callback","operationId":"microsoft_callback_api_oauth_microsoft_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/me":{"get":{"tags":["OAuth"],"summary":"Get Current User","description":"Get current user from JWT token","operationId":"get_current_user_api_oauth_me_get","parameters":[{"name":"Authorization","in":"query","required":true,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/logout":{"post":{"tags":["OAuth"],"summary":"Logout","description":"Logout endpoint (client should clear token)","operationId":"logout_api_oauth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/oauth/verify":{"get":{"tags":["OAuth"],"summary":"Verify Token","description":"Verify if a JWT token is valid","operationId":"verify_token_api_oauth_verify_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/slack/authorize":{"get":{"tags":["OAuth"],"summary":"Slack Authorize","description":"Initiate Slack OAuth flow.\nRedirects user to Slack's consent screen.\n\nThis is for INTEGRATION (connecting Slack to an existing account),\nnot for login/signup. The account is taken from the verified ticket — a\ncaller-supplied email is no longer accepted (see _redeem_oauth_ticket).","operationId":"slack_authorize_api_oauth_slack_authorize_get","parameters":[{"name":"ticket","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Single-use ticket from POST /api/oauth/init","title":"Ticket"},"description":"Single-use ticket from POST /api/oauth/init"},{"name":"redirect_uri","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/slack/callback":{"get":{"tags":["OAuth"],"summary":"Slack Callback","description":"Handle Slack OAuth callback","operationId":"slack_callback_api_oauth_slack_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/slack/status/{email}":{"get":{"tags":["OAuth"],"summary":"Get Slack Status","description":"Check if a user has Slack connected.\n\nArgs:\n    email: User's email address\n\nReturns:\n    SlackConnectionStatus with connection details","operationId":"get_slack_status_api_oauth_slack_status__email__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackConnectionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/slack/{email}":{"delete":{"tags":["OAuth"],"summary":"Disconnect Slack","description":"Disconnect Slack integration for a user.\n\nArgs:\n    email: User's email address\n\nReturns:\n    SlackDisconnectResponse with success status","operationId":"disconnect_slack_api_oauth_slack__email__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackDisconnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/config":{"get":{"tags":["OAuth"],"summary":"Get Oauth Config","description":"Get OAuth configuration (public - doesn't expose secrets)","operationId":"get_oauth_config_api_oauth_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/oauth/google/authorize":{"get":{"tags":["OAuth"],"summary":"Google Calendar Authorize","description":"Initiate Google Calendar OAuth flow.\nRedirects user to Google's consent screen with calendar scopes.\n\nArgs:\n    ticket: Single-use ticket from POST /api/oauth/init; the account is\n        taken from it, so a caller-supplied email is no longer accepted.\n    redirect_uri: Optional custom redirect after OAuth completes","operationId":"google_calendar_authorize_api_oauth_google_authorize_get","parameters":[{"name":"ticket","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Single-use ticket from POST /api/oauth/init","title":"Ticket"},"description":"Single-use ticket from POST /api/oauth/init"},{"name":"redirect_uri","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/google/calendar/callback":{"get":{"tags":["OAuth"],"summary":"Google Calendar Callback","description":"Handle Google Calendar OAuth callback.\nExchanges authorization code for access/refresh tokens and stores them encrypted.","operationId":"google_calendar_callback_api_oauth_google_calendar_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/google/status/{email}":{"get":{"tags":["OAuth"],"summary":"Google Calendar Status","description":"Check if user has Google Calendar connected.\n\nArgs:\n    email: User's email address\n\nReturns:\n    Connection status and metadata","operationId":"google_calendar_status_api_oauth_google_status__email__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCalendarStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/google/{email}":{"delete":{"tags":["OAuth"],"summary":"Google Calendar Disconnect","description":"Disconnect Google Calendar for a user.\nRevokes tokens and removes stored credentials.\n\nArgs:\n    email: User's email address\n\nReturns:\n    Success status","operationId":"google_calendar_disconnect_api_oauth_google__email__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/google/calendars/{email}":{"get":{"tags":["OAuth"],"summary":"List Google Calendars","description":"List user's Google Calendars.\nTests the connection by fetching calendar list.\n\nArgs:\n    email: User's email address\n\nReturns:\n    List of user's calendars","operationId":"list_google_calendars_api_oauth_google_calendars__email__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleCalendarListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/microsoft/authorize":{"get":{"tags":["OAuth"],"summary":"Microsoft Authorize","description":"Initiate Microsoft OAuth flow for Outlook access.\nRedirects user to Microsoft's consent screen with mail and calendar scopes.\n\nArgs:\n    ticket: Single-use ticket from POST /api/oauth/init; the account is\n        taken from it, so a caller-supplied email is no longer accepted.\n    redirect_uri: Optional custom redirect after OAuth completes","operationId":"microsoft_authorize_api_oauth_microsoft_authorize_get","parameters":[{"name":"ticket","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Single-use ticket from POST /api/oauth/init","title":"Ticket"},"description":"Single-use ticket from POST /api/oauth/init"},{"name":"redirect_uri","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/microsoft/outlook/callback":{"get":{"tags":["OAuth"],"summary":"Microsoft Outlook Callback","description":"Handle Microsoft Outlook OAuth callback (mail + calendar integration flow).\n\n=== P0-MS-CALLBACK === Distinct from the LOGIN callback at /microsoft/callback.\nInitiated by /microsoft/authorize (requires email). State MUST contain `email`\nbound to the user this Outlook connection will be stored against. Login flow\nstate has NO email and MUST NOT reach this handler.\n\nExchanges authorization code for access/refresh tokens and stores them encrypted\nin the `microsoft_tokens` namespace keyed by email_hash.","operationId":"microsoft_outlook_callback_api_oauth_microsoft_outlook_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/microsoft/status/{email}":{"get":{"tags":["OAuth"],"summary":"Microsoft Status","description":"Check if user has Microsoft Outlook connected.\n\nArgs:\n    email: User's email address\n\nReturns:\n    Connection status and metadata","operationId":"microsoft_status_api_oauth_microsoft_status__email__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicrosoftOutlookStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/microsoft/{email}":{"delete":{"tags":["OAuth"],"summary":"Microsoft Disconnect","description":"Disconnect Microsoft Outlook for a user.\nRemoves stored credentials.\n\nArgs:\n    email: User's email address\n\nReturns:\n    Success status","operationId":"microsoft_disconnect_api_oauth_microsoft__email__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/microsoft/mail/{email}":{"get":{"tags":["OAuth"],"summary":"List Outlook Mail","description":"List user's recent Outlook emails.\n\nArgs:\n    email: User's email address\n    limit: Number of emails to fetch (1-50)\n    folder: Mail folder (inbox, sentitems, drafts, etc.)\n\nReturns:\n    List of recent emails","operationId":"list_outlook_mail_api_oauth_microsoft_mail__email__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Number of emails to fetch","default":10,"title":"Limit"},"description":"Number of emails to fetch"},{"name":"folder","in":"query","required":false,"schema":{"type":"string","description":"Mail folder to fetch from","default":"inbox","title":"Folder"},"description":"Mail folder to fetch from"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutlookMailListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/oauth/microsoft/calendar/{email}":{"get":{"tags":["OAuth"],"summary":"List Outlook Calendar","description":"List user's upcoming Outlook calendar events.\n\nArgs:\n    email: User's email address\n    days: Number of days to look ahead (1-30)\n\nReturns:\n    List of calendar events","operationId":"list_outlook_calendar_api_oauth_microsoft_calendar__email__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"description":"Number of days to fetch events for","default":7,"title":"Days"},"description":"Number of days to fetch events for"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutlookCalendarListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/switch-empire":{"post":{"tags":["Authentication"],"summary":"Switch Empire","description":"Switch the active empire on the user's session.\n\n1. Decodes current JWT (401 if missing/invalid).\n2. Verifies DB membership for the requested empire_id (403 if not a member).\n3. Mints a new JWT with empire_id / organization_id / vertical / empire_role\n   set to the new active empire.\n4. Sets the lc_session cookie + returns the token in the body.\n\nReturns 503 if the multi-tenancy DB tables are unavailable — switch-empire\nis the one auth flow that cannot gracefully fall back, since the whole\npoint is to assert \"user CAN access this empire\".","operationId":"switch_empire_api_auth_switch_empire_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchEmpireRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchEmpireResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/register":{"post":{"tags":["Authentication"],"summary":"Register","description":"Register a new user with email and password","operationId":"register_api_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"tags":["Authentication"],"summary":"Login","description":"Login with email and password","operationId":"login_api_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/forgot-password":{"post":{"tags":["Authentication"],"summary":"Forgot Password","description":"Request a password reset email","operationId":"forgot_password_api_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/reset-password":{"post":{"tags":["Authentication"],"summary":"Reset Password","description":"Reset password using token","operationId":"reset_password_api_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/verify-email":{"post":{"tags":["Authentication"],"summary":"Verify Email","description":"Verify email address using token","operationId":"verify_email_api_auth_verify_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/resend-verification":{"post":{"tags":["Authentication"],"summary":"Resend Verification","description":"Resend email verification token","operationId":"resend_verification_api_auth_resend_verification_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"tags":["Authentication"],"summary":"Get Current User","description":"Get current authenticated user's profile.\n\nAccepts the JWT from EITHER:\n  - the HttpOnly session cookie (lc_session), OR\n  - the Authorization: Bearer header (legacy / SDK clients).","operationId":"get_current_user_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}}}},"/api/auth/logout":{"post":{"tags":["Authentication"],"summary":"Logout","description":"Logout current session — clears the HttpOnly session cookie.","operationId":"logout_api_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}}}}},"/api/auth/switch-acting-employee":{"post":{"tags":["Authentication"],"summary":"Switch Acting Employee","description":"Mint a new JWT with (or without) an `acting_employee_id` claim.\n\nAuth flow:\n  1. Decode caller's current JWT (cookie OR Bearer header).\n  2. Per-user rate limit (10 / rolling hour).\n  3. Authority check — if `employee_id` is non-null:\n     a. Employee must exist in `EmployeeRegistry`.\n     b. User must have an `owner` or `admin` empire membership\n        in at least one empire (DB-authoritative; no claim trust).\n  4. Mint new JWT preserving original `exp` (copy-not-reset) and\n     carrying forward existing tenancy claims.\n  5. Emit audit event (`auth.impersonation.start` on set,\n     `.end` on revert).\n  6. Set lc_session cookie and return token + expiry.","operationId":"switch_acting_employee_api_auth_switch_acting_employee_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchActingEmployeeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchActingEmployeeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/status":{"get":{"tags":["Meetings","Avatar","voice","meetings"],"summary":"Get Voice Status","description":"Get Neural Voice Engine status.\n\nReturns system availability and provider status.","operationId":"get_voice_status_api_voice_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceStatusResponse"}}}}}},"post":{"tags":["Voice AI"],"summary":"Call Status","description":"Twilio status callback. Receives updates when a call ends or fails.\nLogs to Decision Trace for analytics.","operationId":"call_status_api_voice_status_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_call_status_api_voice_status_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/employees":{"get":{"tags":["Meetings","Avatar","voice","meetings"],"summary":"List Voice Employees","description":"List all employees with voice configurations.","operationId":"list_voice_employees_api_voice_employees_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/voice/employees/{employee_id}":{"get":{"tags":["Meetings","Avatar","voice","meetings"],"summary":"Get Employee Voice Info","description":"Get voice configuration for a specific employee.","operationId":"get_employee_voice_info_api_voice_employees__employee_id__get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeVoiceInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/costs":{"get":{"tags":["Meetings","Avatar","voice","meetings"],"summary":"Get Voice Costs","description":"Get TTS provider costs for transparency.","operationId":"get_voice_costs_api_voice_costs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/voice/usage":{"get":{"tags":["Meetings","Avatar","voice","meetings"],"summary":"Get Voice Usage","description":"Get Neural Voice Engine usage summary.","operationId":"get_voice_usage_api_voice_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/voice/live-ticket":{"post":{"tags":["Meetings","Avatar","voice","meetings"],"summary":"Create Meeting Ticket","description":"Mint a single-use ticket binding a live meeting to the caller.","operationId":"create_meeting_ticket_api_voice_live_ticket_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeetingTicketRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeetingTicketResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/voice/calls/analyze":{"post":{"tags":["Meetings","Avatar","voice","meetings"],"summary":"Analyze Call","description":"Analyze a call transcript for conversation intelligence.\n\nCortex Call Intelligence(TM) — heuristic NLP analysis of sales and\nsupport call transcripts.  Returns talk-time ratio, objection\ndetection, sentiment trajectory, deal risk score, and coaching\nrecommendations.  No external APIs or LLM calls required.\n\nRequest body:\n    transcript: list of {speaker, text, timestamp?}\n    known_competitors: optional list of competitor names to scan for\n    deal_stage: optional current deal stage for context\n    deal_id: optional deal ID to link analysis to a deal","operationId":"analyze_call_api_voice_calls_analyze_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallTranscriptRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/calls/{call_id}/analyze":{"post":{"tags":["Meetings","Avatar","voice","meetings"],"summary":"Analyze Saved Call","description":"Analyze a previously recorded call by its session ID.\n\nLooks up the call from the VoiceSessionManager's ended-session\nhistory.  If the session is still active or not found, returns\na 404.","operationId":"analyze_saved_call_api_voice_calls__call_id__analyze_post","parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/calls/{deal_id}/analysis":{"get":{"tags":["Meetings","Avatar","voice","meetings"],"summary":"Get Call Analysis","description":"Retrieve a previously computed call analysis by deal ID.","operationId":"get_call_analysis_api_voice_calls__deal_id__analysis_get","parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","title":"Deal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/health":{"get":{"tags":["Meetings","Avatar","voice","meetings"],"summary":"Voice Health","description":"Health check for voice/meeting subsystem.","operationId":"voice_health_api_voice_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/a2ui/compose":{"post":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Compose A2Ui Response","description":"Compose an A2UI response for an employee.\n\nUses intent detection to automatically select appropriate components.\n\nArgs:\n    request: Compose request with employee_id, query, and data\n\nReturns:\n    A2UI JSON payload ready for frontend rendering","operationId":"compose_a2ui_response_api_a2ui_compose_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComposeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Compose A2Ui Response Api A2Ui Compose Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/a2ui/compose/dashboard":{"post":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Compose Dashboard","description":"Compose a dashboard A2UI response.\n\nSpecialized endpoint for KPI/metrics dashboards.","operationId":"compose_dashboard_api_a2ui_compose_dashboard_post","parameters":[{"name":"employee_id","in":"query","required":true,"schema":{"type":"string","title":"Employee Id"}},{"name":"title","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/a2ui/compose/table":{"post":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Compose Table","description":"Compose a data table A2UI response.","operationId":"compose_table_api_a2ui_compose_table_post","parameters":[{"name":"employee_id","in":"query","required":true,"schema":{"type":"string","title":"Employee Id"}},{"name":"title","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/a2ui/compose/chart":{"post":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Compose Chart","description":"Compose a chart A2UI response.","operationId":"compose_chart_api_a2ui_compose_chart_post","parameters":[{"name":"employee_id","in":"query","required":true,"schema":{"type":"string","title":"Employee Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/a2ui/intent":{"post":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Detect User Intent","description":"Detect intent from user query.\n\nUsed to determine which A2UI components to use.","operationId":"detect_user_intent_api_a2ui_intent_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__a2ui_router__IntentDetectionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/a2ui/catalogs":{"get":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"List Catalogs","description":"List all available component catalogs.","operationId":"list_catalogs_api_a2ui_catalogs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CatalogInfo"},"type":"array","title":"Response List Catalogs Api A2Ui Catalogs Get"}}}}}}},"/api/a2ui/catalogs/{catalog_name}":{"get":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Get Catalog","description":"Get details of a specific catalog.","operationId":"get_catalog_api_a2ui_catalogs__catalog_name__get","parameters":[{"name":"catalog_name","in":"path","required":true,"schema":{"type":"string","title":"Catalog Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Catalog Api A2Ui Catalogs  Catalog Name  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/a2ui/catalogs/{catalog_name}/components":{"get":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Get Catalog Components","description":"Get all components in a catalog.","operationId":"get_catalog_components_api_a2ui_catalogs__catalog_name__components_get","parameters":[{"name":"catalog_name","in":"path","required":true,"schema":{"type":"string","title":"Catalog Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Catalog Components Api A2Ui Catalogs  Catalog Name  Components Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/a2ui/employees":{"get":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"List Employees With A2Ui","description":"List all employees with A2UI support.","operationId":"list_employees_with_a2ui_api_a2ui_employees_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response List Employees With A2Ui Api A2Ui Employees Get"}}}}}}},"/api/a2ui/employees/{employee_id}/catalogs":{"get":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Get Employee Catalog Info","description":"Get A2UI catalog information for an employee.","operationId":"get_employee_catalog_info_api_a2ui_employees__employee_id__catalogs_get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeCatalogInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/a2ui/employees/{employee_id}/components":{"get":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Get Employee Components","description":"Get all available A2UI components for an employee.","operationId":"get_employee_components_api_a2ui_employees__employee_id__components_get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Employee Components Api A2Ui Employees  Employee Id  Components Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/a2ui/employees/by-catalog/{catalog_name}":{"get":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Get Employees Using Catalog","description":"Get all employees that use a specific catalog.","operationId":"get_employees_using_catalog_api_a2ui_employees_by_catalog__catalog_name__get","parameters":[{"name":"catalog_name","in":"path","required":true,"schema":{"type":"string","title":"Catalog Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"title":"Response Get Employees Using Catalog Api A2Ui Employees By Catalog  Catalog Name  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/a2ui/components/{component_type}":{"get":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Get Component Schema","description":"Get the schema for a specific component type.\n\nUseful for frontend validation and documentation.","operationId":"get_component_schema_api_a2ui_components__component_type__get","parameters":[{"name":"component_type","in":"path","required":true,"schema":{"type":"string","title":"Component Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Component Schema Api A2Ui Components  Component Type  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/a2ui/health":{"get":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"A2Ui Health","description":"Health check for A2UI subsystem.","operationId":"a2ui_health_api_a2ui_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/a2ui/demo/{employee_id}":{"get":{"tags":["A2UI","Adaptive Interface Protocol","A2UI","Adaptive Interface Protocol"],"summary":"Demo A2Ui Response","description":"Generate a demo A2UI response for testing.\n\nUseful for frontend development and integration testing.","operationId":"demo_a2ui_response_api_a2ui_demo__employee_id__get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","description":"Response type: dashboard, table, chart","default":"dashboard","title":"Type"},"description":"Response type: dashboard, table, chart"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Demo A2Ui Response Api A2Ui Demo  Employee Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilotkit/info":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Info","description":"Get CopilotKit endpoint information\n\nReturns capabilities, available agents, and supported providers.","operationId":"get_info_copilotkit_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Info Copilotkit Info Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/health":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Health Check","description":"CopilotKit health check","operationId":"health_check_copilotkit_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Check Copilotkit Health Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/agents":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Agents","description":"Get all available AI Employee agents\n\nReturns agents formatted for CopilotKit frontend registration.","operationId":"get_agents_copilotkit_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Get Agents Copilotkit Agents Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/agents/{employee_id}":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Agent","description":"Get specific agent by employee ID\n\nArgs:\n    employee_id: Employee identifier (e.g., 'aria', 'sterling')","operationId":"get_agent_copilotkit_agents__employee_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Agent Copilotkit Agents  Employee Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilotkit/agents/category/{category}":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Agents By Category","description":"Get agents by category\n\nCategories: core, technical, business, advanced, specialists, growth, governance, professional","operationId":"get_agents_by_category_copilotkit_agents_category__category__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category","in":"path","required":true,"schema":{"type":"string","title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Agents By Category Copilotkit Agents Category  Category  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilotkit/chat":{"post":{"tags":["CopilotKit","CopilotKit"],"summary":"Chat","description":"Streaming chat endpoint for CopilotKit\n\nImplements AG-UI protocol for frontend streaming.\nReturns Server-Sent Events (SSE) stream.","operationId":"chat_copilotkit_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__copilotkit_router__ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/chat/sync":{"post":{"tags":["CopilotKit","CopilotKit"],"summary":"Chat Sync","description":"Non-streaming chat endpoint\n\nFor clients that don't support SSE.","operationId":"chat_sync_copilotkit_chat_sync_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__copilotkit_router__ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Chat Sync Copilotkit Chat Sync Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/actions":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Actions","description":"Get all available actions across all agents","operationId":"get_actions_copilotkit_actions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Get Actions Copilotkit Actions Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/actions/hitl":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Hitl Actions","description":"Get all actions requiring Human-in-the-Loop approval","operationId":"get_hitl_actions_copilotkit_actions_hitl_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Get Hitl Actions Copilotkit Actions Hitl Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/hitl/pending":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Pending Approvals","description":"Get pending approval requests\n\nArgs:\n    employee_id: Optional filter by employee","operationId":"get_pending_approvals_copilotkit_hitl_pending_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Pending Approvals Copilotkit Hitl Pending Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilotkit/hitl/approve":{"post":{"tags":["CopilotKit","CopilotKit"],"summary":"Approve Request","description":"Approve a pending HITL request.\n\nThe approver is the authenticated caller, never a body field.","operationId":"approve_request_copilotkit_hitl_approve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Approve Request Copilotkit Hitl Approve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/hitl/reject":{"post":{"tags":["CopilotKit","CopilotKit"],"summary":"Reject Request","description":"Reject a pending HITL request.\n\nThe rejector is the authenticated caller, never a body field.","operationId":"reject_request_copilotkit_hitl_reject_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Reject Request Copilotkit Hitl Reject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/hitl/stats":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Hitl Stats","description":"Get HITL approval statistics","operationId":"get_hitl_stats_copilotkit_hitl_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Hitl Stats Copilotkit Hitl Stats Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/threads/{thread_id}":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Thread","description":"Get thread conversation history","operationId":"get_thread_copilotkit_threads__thread_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Thread Copilotkit Threads  Thread Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["CopilotKit","CopilotKit"],"summary":"Clear Thread","description":"Clear thread conversation history","operationId":"clear_thread_copilotkit_threads__thread_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Clear Thread Copilotkit Threads  Thread Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilotkit/providers":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Providers","description":"Get available LLM providers\n\nReturns configured providers with availability status.","operationId":"get_providers_copilotkit_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Get Providers Copilotkit Providers Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/ui/components":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Ui Components","description":"Get available generative UI components\n\nComponents for frontend rendering of agent outputs.","operationId":"get_ui_components_copilotkit_ui_components_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Get Ui Components Copilotkit Ui Components Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/copilotkit/scenarios":{"get":{"tags":["CopilotKit","CopilotKit"],"summary":"Get Scenarios","description":"Get available CopilotKit usage scenarios\n\nReturns documented scenarios for each employee.","operationId":"get_scenarios_copilotkit_scenarios_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Get Scenarios Copilotkit Scenarios Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/login":{"post":{"tags":["Admin","Admin"],"summary":"Admin Login","description":"Authenticate admin and return JWT token + set HttpOnly cookie.","operationId":"admin_login_api_admin_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/logout":{"post":{"tags":["Admin","Admin"],"summary":"Admin Logout","description":"Logout admin — clears HttpOnly cookie.","operationId":"admin_logout_api_admin_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/me":{"get":{"tags":["Admin","Admin"],"summary":"Get Current Admin Info","description":"Get current admin's info.","operationId":"get_current_admin_info_api_admin_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/users":{"get":{"tags":["Admin","Admin"],"summary":"List Admin Users","description":"List all admin users.","operationId":"list_admin_users_api_admin_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AdminUserResponse"},"type":"array","title":"Response List Admin Users Api Admin Users Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Admin","Admin"],"summary":"Create Admin User","description":"Create a new admin user.","operationId":"create_admin_user_api_admin_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/users/{user_id}":{"put":{"tags":["Admin","Admin"],"summary":"Update Admin User","description":"Update an admin user.","operationId":"update_admin_user_api_admin_users__user_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Admin","Admin"],"summary":"Delete Admin User","description":"Delete an admin user.","operationId":"delete_admin_user_api_admin_users__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/customers/set-tier":{"post":{"tags":["Admin","Admin"],"summary":"Set Customer Tier","description":"Set a CUSTOMER account's subscription tier in the auth store (Redis).\n\nDistinct from /users/* (which manage ADMIN accounts). This updates the\ncustomer record auth_store reads on login, so their next token carries the\nnew tier. For provisioning test accounts + manual tier changes without a\nStripe checkout. Tiers: starter | manager | agency.","operationId":"set_customer_tier_api_admin_customers_set_tier_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/roles":{"get":{"tags":["Admin","Admin"],"summary":"Get Roles","description":"Get available roles and their permissions.","operationId":"get_roles_api_admin_roles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/permissions":{"get":{"tags":["Admin","Admin"],"summary":"Get Permissions","description":"Get all available permissions grouped by category.","operationId":"get_permissions_api_admin_permissions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/agents":{"get":{"tags":["Admin","Admin"],"summary":"List Agents","description":"List all AI employees with their status.","operationId":"list_agents_api_admin_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/agents/{agent_id}":{"get":{"tags":["Admin","Admin"],"summary":"Get Agent","description":"Get detailed agent configuration.","operationId":"get_agent_api_admin_agents__agent_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Admin","Admin"],"summary":"Update Agent","description":"Update agent configuration.","operationId":"update_agent_api_admin_agents__agent_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/{agent_id}/stats":{"get":{"tags":["Admin","Admin"],"summary":"Get Agent Stats","description":"Get agent performance statistics.","operationId":"get_agent_stats_api_admin_agents__agent_id__stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|week|month|all)$","default":"today","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/models":{"get":{"tags":["Admin","Admin"],"summary":"List Llm Models","description":"Return the live LLM model registry from the orchestrator, grouped by provider.\n\nThe frontend admin model picker calls this on mount to populate the dropdown\nwith the exact set of models the backend will accept. This is the single\nsource of truth — `web/src/lib/models.ts` is only used as an offline fallback.","operationId":"list_llm_models_api_admin_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/agents/{agent_id}/chat":{"post":{"tags":["Admin","Admin"],"summary":"Chat With Agent","description":"Chat with an AI employee for testing.","operationId":"chat_with_agent_api_admin_agents__agent_id__chat_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__admin__models__ChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tasks":{"get":{"tags":["Admin","Admin"],"summary":"List Tasks","description":"List tasks with optional filtering.","operationId":"list_tasks_api_admin_tasks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Admin","Admin"],"summary":"Create Task","description":"Create a new task.","operationId":"create_task_api_admin_tasks_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tasks/{task_id}/priority":{"put":{"tags":["Admin","Admin"],"summary":"Update Task Priority","description":"Update task priority.","operationId":"update_task_priority_api_admin_tasks__task_id__priority_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"priority","in":"query","required":true,"schema":{"type":"integer","maximum":10,"minimum":1,"title":"Priority"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tasks/{task_id}/cancel":{"post":{"tags":["Admin","Admin"],"summary":"Cancel Task","description":"Cancel a task.","operationId":"cancel_task_api_admin_tasks__task_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/hitl":{"get":{"tags":["Admin","Admin"],"summary":"List Hitl Approvals","description":"List HITL approval requests.","operationId":"list_hitl_approvals_api_admin_hitl_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/hitl/{approval_id}":{"get":{"tags":["Admin","Admin"],"summary":"Get Hitl Approval","description":"Get HITL approval details.","operationId":"get_hitl_approval_api_admin_hitl__approval_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/hitl/{approval_id}/review":{"post":{"tags":["Admin","Admin"],"summary":"Review Hitl Approval","description":"Review (approve/reject/edit) a HITL request.","operationId":"review_hitl_approval_api_admin_hitl__approval_id__review_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HITLReviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/traces":{"get":{"tags":["Admin","Admin"],"summary":"List Traces","description":"List execution traces.","operationId":"list_traces_api_admin_traces_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/traces/{trace_id}":{"get":{"tags":["Admin","Admin"],"summary":"Get Trace","description":"Get detailed trace with all spans.","operationId":"get_trace_api_admin_traces__trace_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"trace_id","in":"path","required":true,"schema":{"type":"string","title":"Trace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/monitoring/overview":{"get":{"tags":["Admin","Admin"],"summary":"Get Dashboard Overview","description":"Get mission control dashboard overview with REAL data.","operationId":"get_dashboard_overview_api_admin_monitoring_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/monitoring/usage":{"get":{"tags":["Admin","Admin"],"summary":"Get Usage Metrics","description":"Get usage metrics with REAL data.","operationId":"get_usage_metrics_api_admin_monitoring_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|week|month)$","default":"today","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/monitoring/costs":{"get":{"tags":["Admin","Admin"],"summary":"Get Cost Metrics","description":"Get cost metrics with REAL data (restricted to users with costs permission).","operationId":"get_cost_metrics_api_admin_monitoring_costs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|week|month)$","default":"month","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/monitoring":{"get":{"tags":["Admin","Admin"],"summary":"Get Monitoring Data","description":"Get comprehensive monitoring data with REAL metrics.","operationId":"get_monitoring_data_api_admin_monitoring_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","pattern":"^(24h|7d|30d)$","default":"7d","title":"Range"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/monitoring/activity":{"get":{"tags":["Admin","Admin"],"summary":"Get Activity Stream","description":"Get recent activity log with REAL data.","operationId":"get_activity_stream_api_admin_monitoring_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/monitoring/agent-activity":{"get":{"tags":["Admin","Admin"],"summary":"Get Agent Activity Feed","description":"Get real-time agent activity feed for dashboard.","operationId":"get_agent_activity_feed_api_admin_monitoring_agent_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/monitoring/activity/stream":{"get":{"tags":["Admin","Admin"],"summary":"Stream Activity","description":"Server-Sent Events stream for real-time activity.","operationId":"stream_activity_api_admin_monitoring_activity_stream_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/settings":{"get":{"tags":["Admin","Admin"],"summary":"Get Settings","description":"Get system settings.","operationId":"get_settings_api_admin_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["Admin","Admin"],"summary":"Update Settings","description":"Update system settings.","operationId":"update_settings_api_admin_settings_put","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Settings"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/analytics/raw":{"get":{"tags":["Admin","Admin"],"summary":"Get Raw Analytics","description":"Get raw analytics data for GraphicWalker exploration.","operationId":"get_raw_analytics_api_admin_analytics_raw_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","pattern":"^(24h|7d|30d)$","default":"7d","title":"Range"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/analytics/visualizations":{"get":{"tags":["Admin","Admin"],"summary":"Get Saved Visualizations","description":"Get saved visualizations for the current admin.","operationId":"get_saved_visualizations_api_admin_analytics_visualizations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Admin","Admin"],"summary":"Save Visualization","description":"Save a new visualization configuration.","operationId":"save_visualization_api_admin_analytics_visualizations_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/analytics/visualizations/{viz_id}":{"delete":{"tags":["Admin","Admin"],"summary":"Delete Visualization Endpoint","description":"Delete a saved visualization.","operationId":"delete_visualization_endpoint_api_admin_analytics_visualizations__viz_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"viz_id","in":"path","required":true,"schema":{"type":"string","title":"Viz Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/health":{"get":{"tags":["Admin","Admin"],"summary":"Admin Health","description":"Admin API health check.","operationId":"admin_health_api_admin_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/distill":{"post":{"tags":["Admin","Admin"],"summary":"Trigger Distillation","description":"Trigger GEMS-style experience distillation across all employee/task pairs.\n\nScans all stored trajectories, groups by (employee_id, task_type), and\ndistills canonical patterns from groups with >= min_count high-quality\ntrajectories. Patterns are optionally persisted to the pgvector episodic\nmemory store for cross-agent retrieval.\n\nReturns a summary of patterns created.","operationId":"trigger_distillation_api_admin_distill_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"min_count","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Minimum trajectories to distill","default":5,"title":"Min Count"},"description":"Minimum trajectories to distill"},{"name":"persist","in":"query","required":false,"schema":{"type":"boolean","description":"Persist patterns to episodic memory","default":true,"title":"Persist"},"description":"Persist patterns to episodic memory"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/cua-benchmark":{"post":{"tags":["Admin","Admin"],"summary":"Run Cua Benchmark","description":"Trigger a CUA benchmark run and return results.\n\nWhen ``real=True`` (default) the benchmark sends each scenario's\nscreenshot to the specified model for coordinate prediction.  If\nthe model or its dependencies are unavailable the run falls back\nto synthetic mode automatically.\n\nWhen ``real=False`` the benchmark uses deterministic noise offsets\n(dry-run mode) -- useful for verifying the harness itself.","operationId":"run_cua_benchmark_api_admin_cua_benchmark_post","parameters":[{"name":"model","in":"query","required":false,"schema":{"type":"string","description":"CUA model to benchmark (lux, fara, gelato, qwen3-vl)","default":"lux","title":"Model"},"description":"CUA model to benchmark (lux, fara, gelato, qwen3-vl)"},{"name":"real","in":"query","required":false,"schema":{"type":"boolean","description":"Use real model predictions (False = synthetic dry-run)","default":true,"title":"Real"},"description":"Use real model predictions (False = synthetic dry-run)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/e2e-test/specs":{"get":{"tags":["Admin","Admin"],"summary":"List E2E Specs","description":"List available E2E test spec files.","operationId":"list_e2e_specs_api_admin_e2e_test_specs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/e2e-test":{"post":{"tags":["Admin","Admin"],"summary":"Run E2E Tests","description":"Run Playwright E2E tests and return results.\n\nBody JSON:\n  - spec (str, optional): specific spec file name (e.g. \"forum\")\n  - headed (bool, optional): run in headed mode (default false)\n\nReturns JSON reporter output with pass/fail per test.","operationId":"run_e2e_tests_api_admin_e2e_test_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/e2e-test/results/{run_id}":{"get":{"tags":["Admin","Admin"],"summary":"Get E2E Results","description":"Get results from a previous test run.","operationId":"get_e2e_results_api_admin_e2e_test_results__run_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","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/admin/e2e-test/history":{"get":{"tags":["Admin","Admin"],"summary":"Get E2E History","description":"Get the last 10 E2E test run summaries.","operationId":"get_e2e_history_api_admin_e2e_test_history_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/cua-benchmark/models":{"get":{"tags":["Admin","Admin"],"summary":"List Cua Models","description":"List available CUA benchmark models.","operationId":"list_cua_models_api_admin_cua_benchmark_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/pytest/files":{"get":{"tags":["Admin","Admin"],"summary":"List Pytest Files","description":"List available pytest integration test files.","operationId":"list_pytest_files_api_admin_pytest_files_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/pytest":{"post":{"tags":["Admin","Admin"],"summary":"Run Pytest","description":"Run pytest integration tests.\n\nBody JSON:\n  - test_file (str, optional): specific test file name (e.g. \"entitlements\")\n  - marker (str, optional): pytest marker to filter (e.g. \"integration\")\n  - scope (str, optional): \"integration\" (default) or \"root\"","operationId":"run_pytest_api_admin_pytest_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/qa-scenarios/categories":{"get":{"tags":["Admin","Admin"],"summary":"List Qa Categories","description":"List QA scenario categories.","operationId":"list_qa_categories_api_admin_qa_scenarios_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/qa-scenarios":{"post":{"tags":["Admin","Admin"],"summary":"Run Qa Scenarios","description":"Run QA YAML scenario structural validation.\n\nBody JSON:\n  - category (str, optional): specific category name (e.g. \"security\", \"hr\", \"universal\")\n\nValidates:\n  - YAML parse success\n  - Required fields present per scenario\n  - Employee IDs reference valid registry entries\n  - Assertions and steps well-formed\n\nDoes NOT execute LLM calls -- structural validation only.","operationId":"run_qa_scenarios_api_admin_qa_scenarios_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/safety-test":{"post":{"tags":["Admin","Admin"],"summary":"Run Safety Tests","description":"Run adversarial safety scenario structural validation.\n\nBody JSON:\n  - category (str, optional): filter by category (e.g. \"prompt_injection\", \"credential_leakage\")\n\nValidates scenario structure, employee references, expected_behavior values.\nDoes NOT execute LLM calls.","operationId":"run_safety_tests_api_admin_safety_test_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/golden-test":{"post":{"tags":["Admin","Admin"],"summary":"Run Golden Tests","description":"Run golden dataset regression tests against AI employees.\n\nLoads curated input/output pairs from the golden YAML file and\nvalidates that mock employee responses satisfy keyword, forbidden-phrase,\ntone, and structural checks.\n\nReturns a summary with pass/fail counts and any violations.","operationId":"run_golden_tests_api_admin_golden_test_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/twin-simulation":{"post":{"tags":["Admin","Admin"],"summary":"Run Twin Simulation","description":"Run Digital Twin population simulation across all LiquidCortex verticals.\n\nGenerates a diverse population of digital consumers using Methodology #186\n(DigitalTwinConsumer) with Big Five personality traits, consumer behavior,\nand engagement patterns. Each twin is routed to relevant verticals based\non their industry, company size, and needs.\n\nReturns population-level engagement, conversion, and revenue statistics.\nNo LLM calls. No real user data.","operationId":"run_twin_simulation_api_admin_twin_simulation_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"population_size","in":"query","required":false,"schema":{"type":"integer","maximum":50000,"minimum":100,"description":"Number of digital twins to simulate","default":1000,"title":"Population Size"},"description":"Number of digital twins to simulate"},{"name":"seed","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Random seed for reproducibility","default":42,"title":"Seed"},"description":"Random seed for reproducibility"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/support/verification/request":{"post":{"tags":["Support"],"summary":"Request Verification","description":"Generate + email a 6-digit out-of-band verification code.\n\nAdmin-gated. Returns the request_id the admin uses to verify the code\nthe user reads back. The code itself is NEVER returned to the admin.","operationId":"request_verification_api_v1_support_verification_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/support/verification/verify":{"post":{"tags":["Support"],"summary":"Verify Code","description":"Validate a code the user read back to the support agent.\n\nSingle-use: the record is deleted on the FIRST attempt regardless of\noutcome. Constant-time comparison via ``hmac.compare_digest``.","operationId":"verify_code_api_v1_support_verification_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/support/chat":{"post":{"tags":["Support Chat"],"summary":"Visitor Chat","description":"Visitor-mode support chat. No auth.\n\nThreads via client-minted session_id with 10-min TTL. Emits\nauth.session.create on first message. Rate-limited per session and\nper IP.","operationId":"visitor_chat_api_v1_support_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitorChatBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/support/chat-authenticated":{"post":{"tags":["Support Chat"],"summary":"Authenticated Chat","description":"Authenticated-mode support chat. Requires a valid JWT.","operationId":"authenticated_chat_api_v1_support_chat_authenticated_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthedChatBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/me/export":{"post":{"tags":["GDPR DSR"],"summary":"Export User Data","description":"Article 20 data portability — JSON archive of user-owned data.\n\nIncludes: user record, empire memberships (where user is a member),\nempire events emitted for the user, support_chat conversations.\nExcludes: data from other empires' members, OTHER empires' events.\n\nRate-limited 1/24h per user. JSON only in v1 (CSV deferred — see\nNOT_COVERED_DATA_STORES rationale; CSV of nested membership/event\ndata is structurally awkward).","operationId":"export_user_data_api_v1_me_export_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportFormat"}}}}}}},"/api/v1/me/delete-account":{"post":{"tags":["GDPR DSR"],"summary":"Delete Account","description":"Article 17 right to erasure — hard delete + audit anonymization.\n\nSteps:\n    1. Re-authenticate (password must match stored hash).\n    2. Refuse with 409 if the user is the sole owner of any empire.\n    3. Delete + anonymize across known data stores (see\n       DELETION_COVERAGE constant).\n    4. Emit auth.session.revoke with reason=user_initiated_deletion.\n    5. Clear the session cookie + return 204 No Content.","operationId":"delete_account_api_v1_me_delete_account_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/osgym/run-task":{"post":{"tags":["OSGym","Computer Use","osgym"],"summary":"Run Task","description":"Run a custom task with an employee in OSGym.\n\nExample:\n    POST /api/osgym/run-task\n    {\n        \"employee_id\": \"maxwell\",\n        \"task\": \"Open Chrome and search for AI news\",\n        \"max_steps\": 30\n    }","operationId":"run_task_api_osgym_run_task_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunTaskRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/osgym/run-scenario":{"post":{"tags":["OSGym","Computer Use","osgym"],"summary":"Run Scenario","description":"Run a predefined test scenario.\n\nExample:\n    POST /api/osgym/run-scenario\n    {\n        \"employee_id\": \"maxwell\",\n        \"scenario_id\": \"osgym_browser_001\"\n    }","operationId":"run_scenario_api_osgym_run_scenario_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__osgym_router__RunScenarioRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/osgym/scenarios":{"get":{"tags":["OSGym","Computer Use","osgym"],"summary":"List Scenarios","description":"List available test scenarios.\n\nQuery params:\n- employee_id: Filter by applicable employee\n- category: Filter by category (browser, office, terminal, etc.)\n- difficulty: Filter by difficulty (easy, medium, hard, expert)","operationId":"list_scenarios_api_osgym_scenarios_get","parameters":[{"name":"employee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"difficulty","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Difficulty"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/osgym/scenarios/stats":{"get":{"tags":["OSGym","Computer Use","osgym"],"summary":"Get Scenario Stats","description":"Get statistics about available test scenarios.","operationId":"get_scenario_stats_api_osgym_scenarios_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/osgym/batch-test":{"post":{"tags":["OSGym","Computer Use","osgym"],"summary":"Batch Test","description":"Run all applicable scenarios for an employee in background.\n\nReturns immediately with a test_id to check progress.","operationId":"batch_test_api_osgym_batch_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchTestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/osgym/batch-test/{test_id}":{"get":{"tags":["OSGym","Computer Use","osgym"],"summary":"Get Batch Test Status","description":"Get status of a batch test run.","operationId":"get_batch_test_status_api_osgym_batch_test__test_id__get","parameters":[{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/osgym/health":{"get":{"tags":["OSGym","Computer Use","osgym"],"summary":"Health Check","description":"Check OSGym worker health.","operationId":"health_check_api_osgym_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/qa/sessions":{"get":{"tags":["QA Testing","qa"],"summary":"List Sessions","description":"List all active QA sessions.","operationId":"list_sessions_api_qa_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["QA Testing","qa"],"summary":"Create Session","description":"Create a new QA test session for multi-turn testing.\n\nReturns session_id for subsequent message calls.","operationId":"create_session_api_qa_sessions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qa/sessions/{session_id}/message":{"post":{"tags":["QA Testing","qa"],"summary":"Send Message","description":"Send a message in an existing session.\n\nMaintains conversation history for multi-turn testing.","operationId":"send_message_api_qa_sessions__session_id__message_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__qa_router__SendMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qa/sessions/{session_id}":{"get":{"tags":["QA Testing","qa"],"summary":"Get Session","description":"Get session details and transcript.","operationId":"get_session_api_qa_sessions__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["QA Testing","qa"],"summary":"Delete Session","description":"Delete a session and clean up resources.","operationId":"delete_session_api_qa_sessions__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qa/scenarios":{"get":{"tags":["QA Testing","qa"],"summary":"List Scenarios","description":"List available test scenarios with optional filtering.","operationId":"list_scenarios_api_qa_scenarios_get","parameters":[{"name":"department","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"}},{"name":"employee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qa/scenarios/{scenario_id}":{"get":{"tags":["QA Testing","qa"],"summary":"Get Scenario","description":"Get details of a specific scenario.","operationId":"get_scenario_api_qa_scenarios__scenario_id__get","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qa/scenarios/stats":{"get":{"tags":["QA Testing","qa"],"summary":"Get Scenario Stats","description":"Get statistics about available scenarios.","operationId":"get_scenario_stats_api_qa_scenarios_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/qa/run-scenario":{"post":{"tags":["QA Testing","qa"],"summary":"Run Scenario","description":"Run a single scenario against an employee.\n\nReturns full result with transcript and assertions.","operationId":"run_scenario_api_qa_run_scenario_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__qa_router__RunScenarioRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qa/run-batch":{"post":{"tags":["QA Testing","qa"],"summary":"Run Batch","description":"Run batch tests in background.\n\nReturns batch_id for checking progress.","operationId":"run_batch_api_qa_run_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunBatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qa/batch/{batch_id}":{"get":{"tags":["QA Testing","qa"],"summary":"Get Batch Status","description":"Get status of a batch test run.","operationId":"get_batch_status_api_qa_batch__batch_id__get","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qa/batch":{"get":{"tags":["QA Testing","qa"],"summary":"List Batches","description":"List all batch test runs.","operationId":"list_batches_api_qa_batch_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/qa/coverage":{"get":{"tags":["QA Testing","qa"],"summary":"Get Coverage","description":"Get test coverage statistics for all departments and employees.","operationId":"get_coverage_api_qa_coverage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/qa/coverage/{department}":{"get":{"tags":["QA Testing","qa"],"summary":"Get Department Coverage","description":"Get detailed coverage for a specific department.","operationId":"get_department_coverage_api_qa_coverage__department__get","parameters":[{"name":"department","in":"path","required":true,"schema":{"type":"string","title":"Department"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qa/report":{"get":{"tags":["QA Testing","qa"],"summary":"Generate Report","description":"Generate QA report from batch results.\n\nArgs:\n    format: Output format (json, summary)\n    batch_id: Specific batch to report on","operationId":"generate_report_api_qa_report_get","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"json","title":"Format"}},{"name":"batch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qa/quick-test/{employee_id}":{"post":{"tags":["QA Testing","qa"],"summary":"Quick Test","description":"Quick single-message test without session management.\n\nUseful for one-off testing.","operationId":"quick_test_api_qa_quick_test__employee_id__post","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}},{"name":"message","in":"query","required":true,"schema":{"type":"string","title":"Message"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/qa/employees":{"get":{"tags":["QA Testing","qa"],"summary":"List Employees","description":"List all employees with their departments.","operationId":"list_employees_api_qa_employees_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/contact/":{"post":{"tags":["Contact"],"summary":"Submit Contact Form","description":"Submit a contact form.\n\nThis endpoint accepts contact form submissions from the frontend\nand sends email notifications to the team.","operationId":"submit_contact_form_api_contact__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactFormRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactFormResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contact/health":{"get":{"tags":["Contact"],"summary":"Contact Health","description":"Check if contact form endpoint is healthy","operationId":"contact_health_api_contact_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/skills/learn":{"post":{"tags":["Skill Pool"],"summary":"Learn a skill from an interaction","description":"Extract and store a skill pattern from a customer interaction. The skill is abstracted to remove all customer-specific data before storage.","operationId":"learn_skill_api_skills_learn_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LearnSkillRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__skill_pool_router__SkillResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/search":{"get":{"tags":["Skill Pool"],"summary":"Search for applicable skills","description":"Find skills that are relevant to a given task context. Skills are ranked by relevance and confidence score.","operationId":"search_skills_api_skills_search_get","parameters":[{"name":"task_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Type of task to match","title":"Task Type"},"description":"Type of task to match"},{"name":"tools","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of tools","title":"Tools"},"description":"Comma-separated list of tools"},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SkillCategoryEnum"},{"type":"null"}],"description":"Filter by skill category","title":"Category"},"description":"Filter by skill category"},{"name":"employee_id","in":"query","required":false,"schema":{"type":"string","description":"ID of the employee searching","default":"default","title":"Employee Id"},"description":"ID of the employee searching"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Maximum number of skills to return","default":5,"title":"Limit"},"description":"Maximum number of skills to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/src__api__routers__skill_pool_router__SkillResponse"},"title":"Response Search Skills Api Skills Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/apply":{"post":{"tags":["Skill Pool"],"summary":"Apply a skill to a context","description":"Apply a learned skill to a new customer context. Returns the adapted template and tracking information.","operationId":"apply_skill_api_skills_apply_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplySkillRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplySkillResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/{application_id}/outcome":{"post":{"tags":["Skill Pool"],"summary":"Record skill application outcome","description":"Record the outcome of applying a skill. This feedback loop improves skill maturity and accuracy over time.","operationId":"record_outcome_api_skills__application_id__outcome_post","parameters":[{"name":"application_id","in":"path","required":true,"schema":{"type":"string","title":"Application Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordOutcomeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Record Outcome Api Skills  Application Id  Outcome Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/analytics":{"get":{"tags":["Skill Pool"],"summary":"Get skill pool analytics","description":"Get comprehensive analytics about the global skill pool including totals, category distribution, maturity levels, and top performers.","operationId":"get_analytics_api_skills_analytics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillAnalyticsResponse"}}}}}}},"/api/skills/{skill_id}":{"get":{"tags":["Skill Pool"],"summary":"Get a specific skill","description":"Retrieve detailed information about a specific skill by ID.","operationId":"get_skill_api_skills__skill_id__get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__skill_pool_router__SkillResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/":{"get":{"tags":["Skill Pool"],"summary":"List all skills","description":"Get a list of all skills in the global pool with optional filtering.","operationId":"list_skills_api_skills__get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SkillCategoryEnum"},{"type":"null"}],"description":"Filter by category","title":"Category"},"description":"Filter by category"},{"name":"maturity","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SkillMaturityEnum"},{"type":"null"}],"description":"Filter by maturity level","title":"Maturity"},"description":"Filter by maturity level"},{"name":"min_confidence","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"description":"Minimum confidence score","title":"Min Confidence"},"description":"Minimum confidence score"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Maximum number of skills to return","default":50,"title":"Limit"},"description":"Maximum number of skills to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of skills to skip","default":0,"title":"Offset"},"description":"Number of skills to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/src__api__routers__skill_pool_router__SkillResponse"},"title":"Response List Skills Api Skills  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/stats":{"get":{"tags":["Dashboard"],"summary":"Get Dashboard Stats","description":"Get dashboard statistics.\n\nReturns real-time stats combining:\n- User-specific activity tracking\n- LLM orchestrator cost data (when available)","operationId":"get_dashboard_stats_api_dashboard_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardStats"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/dashboard/activity":{"get":{"tags":["Dashboard"],"summary":"Get Dashboard Activity","description":"Get recent activity feed.\n\nReturns the latest activities from user's AI employees,\nwith fallback to demo data for new users.","operationId":"get_dashboard_activity_api_dashboard_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/usage":{"get":{"tags":["Dashboard"],"summary":"Get Dashboard Usage","description":"Get usage analytics in the format expected by the frontend.\n\nArgs:\n    time_range: Time range (7d, 30d, 90d) - also accepts 'range' as alias","operationId":"get_dashboard_usage_api_dashboard_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"time_range","in":"query","required":false,"schema":{"type":"string","default":"30d","title":"Time Range"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageData"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/activity/record":{"post":{"tags":["Dashboard"],"summary":"Record Activity","description":"Record a new activity.\n\nCalled internally when employees complete tasks.","operationId":"record_activity_api_dashboard_activity_record_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"query","required":true,"schema":{"type":"string","title":"Employee Id"}},{"name":"description","in":"query","required":true,"schema":{"type":"string","title":"Description"}},{"name":"activity_type","in":"query","required":false,"schema":{"type":"string","default":"chat","title":"Activity Type"}},{"name":"credits","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Credits"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Record Activity Api Dashboard Activity Record Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/employees/status":{"get":{"tags":["Dashboard"],"summary":"Get Employee Status","description":"Get status of all employees.\n\nReturns active/idle/offline status based on recent activity.","operationId":"get_employee_status_api_dashboard_employees_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeStatusResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/dashboard/summary":{"get":{"tags":["Dashboard"],"summary":"Get Dashboard Summary","description":"Get complete dashboard summary.\n\nCombines stats, activity, and usage in a single call.","operationId":"get_dashboard_summary_api_dashboard_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Dashboard Summary Api Dashboard Summary Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/chat/session":{"post":{"tags":["Chat"],"summary":"Create Chat Session","description":"Create a new chat session with an AI employee\n\nReturns session details including a unique session_id for tracking the conversation.\nNow persists to PostgreSQL database with fallback to in-memory storage.","operationId":"create_chat_session_api_chat_session_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/message":{"post":{"tags":["Chat"],"summary":"Send Message","description":"Send a message to an AI employee and receive a response\n\nSupports:\n- Streaming responses via Server-Sent Events (SSE) when stream=True\n- Non-streaming responses when stream=False\n- Automatic session creation if session_id not provided\n- Credit enforcement and tier-based access control","operationId":"send_message_api_chat_message_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/history/{session_id}":{"get":{"tags":["Chat"],"summary":"Get Chat History","description":"Get chat history for a session (scoped to the authenticated owner).\n\nSECURITY: 404 unless the session belongs to the caller — was returning any\nsession's messages by id with no ownership check.","operationId":"get_chat_history_api_chat_history__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/sessions":{"get":{"tags":["Chat"],"summary":"List Sessions","description":"List the authenticated user's chat sessions.\n\nSECURITY: always scoped to the caller's user_id (derived from the JWT). The\nuser_id was previously an optional query filter — omitting it listed every\nuser's sessions.","operationId":"list_sessions_api_chat_sessions_get","parameters":[{"name":"employee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"active","title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Sessions Api Chat Sessions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/session/{session_id}":{"delete":{"tags":["Chat"],"summary":"Delete Session","description":"Delete a chat session and its messages (scoped to the authenticated owner).\n\nSECURITY: 404 unless the session belongs to the caller — was deleting any\nsession by id with no ownership check.","operationId":"delete_session_api_chat_session__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Session Api Chat Session  Session Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/session/{session_id}/archive":{"post":{"tags":["Chat"],"summary":"Archive Session","description":"Archive a chat session (scoped to the authenticated owner).\n\nSECURITY: 404 unless the session belongs to the caller.","operationId":"archive_session_api_chat_session__session_id__archive_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Archive Session Api Chat Session  Session Id  Archive Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/credits/{email}":{"get":{"tags":["Chat"],"summary":"Check Credits","description":"Check credit status for a user\n\nReturns current balance, usage percentage, and any warnings.\nCall this before sending messages to ensure user has credits.","operationId":"check_credits_api_chat_credits__email__get","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/credits/{email}/employee-access/{employee_id}":{"get":{"tags":["Chat"],"summary":"Check Employee Access","description":"Check if user's tier allows access to a specific employee\n\nStarter tier: Atlas, Scribe, Aria only\nManager/Agency tier: All 44 employees","operationId":"check_employee_access_api_chat_credits__email__employee_access__employee_id__get","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}},{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Check Employee Access Api Chat Credits  Email  Employee Access  Employee Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/credits/{email}/usage-history":{"get":{"tags":["Chat"],"summary":"Get Usage History","description":"Get credit usage history for a user\n\nReturns recent operations with credit costs.","operationId":"get_usage_history_api_chat_credits__email__usage_history_get","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Usage History Api Chat Credits  Email  Usage History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/conversations":{"get":{"tags":["Chat"],"summary":"List Conversations","description":"List all conversations for the authenticated user.\n\nSECURITY: user_id is derived from the JWT (require_user_id), not a query\nparam — an unauthenticated caller is 401'd and cannot list another user's\nconversations by forging ?user_id=. Cross-user visibility is not a feature.\nRetrieves conversations from PostgreSQL with filtering and pagination.","operationId":"list_conversations_api_chat_conversations_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: all, active, archived","default":"all","title":"Status"},"description":"Filter by status: all, active, archived"},{"name":"employee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by employee ID","title":"Employee Id"},"description":"Filter by employee ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max conversations to return","default":50,"title":"Limit"},"description":"Max conversations to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Pagination offset","default":0,"title":"Offset"},"description":"Pagination offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/conversations/{conversation_id}":{"get":{"tags":["Chat"],"summary":"Get Conversation Detail","description":"Get a single conversation with all its messages.\n\nSECURITY: scoped to the authenticated owner (require_user_id). Previously\ntook no user_id and fetched by conversation_id alone — any UUID returned\nanother user's full conversation + messages (cross-tenant IDOR).","operationId":"get_conversation_detail_api_chat_conversations__conversation_id__get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"message_limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max messages to return","default":100,"title":"Message Limit"},"description":"Max messages to return"},{"name":"message_offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Message pagination offset","default":0,"title":"Message Offset"},"description":"Message pagination offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Chat"],"summary":"Delete Conversation Endpoint","description":"Delete a conversation (soft-delete).\n\nMarks the conversation as deleted but retains data for potential recovery.\nVerifies user ownership before deletion.","operationId":"delete_conversation_endpoint_api_chat_conversations__conversation_id__delete","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Conversation Endpoint Api Chat Conversations  Conversation Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Chat"],"summary":"Update Conversation Endpoint","description":"Update conversation metadata (title, summary).\n\nVerifies user ownership before updating.","operationId":"update_conversation_endpoint_api_chat_conversations__conversation_id__patch","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Conversation Endpoint Api Chat Conversations  Conversation Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/conversations/{conversation_id}/archive":{"post":{"tags":["Chat"],"summary":"Archive Conversation Endpoint","description":"Archive a conversation.\n\nMarks the conversation as archived. Archived conversations can be restored.\nVerifies user ownership before archiving.","operationId":"archive_conversation_endpoint_api_chat_conversations__conversation_id__archive_post","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Archive Conversation Endpoint Api Chat Conversations  Conversation Id  Archive Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/checkout/create":{"post":{"tags":["Billing"],"summary":"Create Checkout Session","description":"Create a Stripe Checkout session for subscription.\n\nReturns a URL to redirect the user to Stripe's hosted checkout page.\nAfter payment, Stripe redirects to success_url or cancel_url.\n\nP0-BILLING-AUTH: requires JWT. The email in the request body MUST\nmatch the JWT subject (or the caller must be an admin). Prevents an\nunauthenticated attacker from minting Stripe customers under\nemails they don't own.","operationId":"create_checkout_session_api_billing_checkout_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/checkout/v2":{"post":{"tags":["Billing"],"summary":"Create Checkout V2","description":"V7.7.5 toggle-aware checkout.\n\nResolves (product, tier, cadence) -> Stripe Price ID, then creates a\n7-day-trial Checkout Session. Legacy `/checkout/create` endpoint is\npreserved for back-compat with existing call sites.\n\nP0-BILLING-AUTH: requires JWT + email match (or admin). The Pydantic\nschema already enforces product/tier/cadence presence (no need for\nexplicit 400 — schema validation returns 422 on missing product).","operationId":"create_checkout_v2_api_billing_checkout_v2_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutV2Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/checkout/credits":{"post":{"tags":["Billing"],"summary":"Create Credit Purchase Session","description":"Create a checkout session for one-time credit purchase.\n\nP0-BILLING-AUTH: requires JWT + email match (or admin).","operationId":"create_credit_purchase_session_api_billing_checkout_credits_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__billing_router__CreditPurchaseRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/portal":{"post":{"tags":["Billing"],"summary":"Create Customer Portal","description":"Create a Stripe Customer Portal session.\n\nAllows customers to manage their subscription, update payment method,\nview invoices, and cancel subscription.\n\nP0-BILLING-AUTH: requires JWT + email match (or admin). Without this,\nanyone who knew a customer's email could mint a portal link and view\ntheir full billing history.","operationId":"create_customer_portal_api_billing_portal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Create Customer Portal Api Billing Portal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/subscription/{email}":{"get":{"tags":["Billing"],"summary":"Get Subscription Status","description":"Get current subscription status for a user.\n\nP0-BILLING-AUTH: PRIVACY-CRITICAL. Pre-fix anyone could enumerate any\ncustomer's tier by requesting /subscription/<email>. Now requires the\nJWT subject to own the email (or be an admin).","operationId":"get_subscription_status_api_billing_subscription__email__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Subscription Status Api Billing Subscription  Email  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/webhook":{"post":{"tags":["Billing"],"summary":"Stripe Webhook","description":"Handle Stripe webhooks.\n\nProcesses events like:\n- checkout.session.completed - Payment successful\n- customer.subscription.created - New subscription\n- customer.subscription.updated - Plan change\n- customer.subscription.deleted - Cancelled\n- customer.subscription.trial_will_end - 3-day pre-trial-end notification (V7.7.3)\n- invoice.paid - Recurring payment successful\n- invoice.payment_failed - Payment failed","operationId":"stripe_webhook_api_billing_webhook_post","parameters":[{"name":"Stripe-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/admin/stats":{"get":{"tags":["Billing"],"summary":"Get Billing Stats","description":"Get billing statistics (admin endpoint).\n\nP0-BILLING-AUTH: previously unauthenticated despite the /admin/ path.\nNow requires an admin JWT (is_admin / role=='admin' / 'admin' in roles).","operationId":"get_billing_stats_api_billing_admin_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Billing Stats Api Billing Admin Stats Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/pricing/tiers":{"get":{"tags":["Pricing","Pricing"],"summary":"Get All Pricing","description":"Get all pricing tiers with Neural Credit information\n\nReturns:\n    Complete pricing information for STARTER, MANAGER, and AGENCY tiers","operationId":"get_all_pricing_api_v1_pricing_tiers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllPricingResponse"}}}}}}},"/api/v1/pricing/tiers/{tier}":{"get":{"tags":["Pricing","Pricing"],"summary":"Get Tier Details","description":"Get details for a specific pricing tier","operationId":"get_tier_details_api_v1_pricing_tiers__tier__get","parameters":[{"name":"tier","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PricingTier"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingTierResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/pricing/compare":{"get":{"tags":["Pricing","Pricing"],"summary":"Compare Tiers","description":"Compare all pricing tiers side by side","operationId":"compare_tiers_api_v1_pricing_compare_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/pricing/credits/exchange-rates":{"get":{"tags":["Pricing","Pricing"],"summary":"Get Credit Exchange Rates","description":"Get Neural Credit exchange rates for all actions\n\nThis shows how many credits each action costs.","operationId":"get_credit_exchange_rates_api_v1_pricing_credits_exchange_rates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/pricing/capabilities/{tier}":{"get":{"tags":["Pricing","Pricing"],"summary":"Get Tier Capabilities","description":"Get hard-gated capabilities for a tier\n\nThis is used by the security middleware to enforce tier restrictions.","operationId":"get_tier_capabilities_api_v1_pricing_capabilities__tier__get","parameters":[{"name":"tier","in":"path","required":true,"schema":{"type":"string","title":"Tier"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/pricing/employees/{tier}":{"get":{"tags":["Pricing","Pricing"],"summary":"Get Tier Employees","description":"Get which employees are available for a tier","operationId":"get_tier_employees_api_v1_pricing_employees__tier__get","parameters":[{"name":"tier","in":"path","required":true,"schema":{"type":"string","title":"Tier"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/pricing/keys/generate":{"post":{"tags":["Pricing","Pricing"],"summary":"Generate Api Key Endpoint","description":"Generate a new API key for a tier","operationId":"generate_api_key_endpoint_api_v1_pricing_keys_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__pricing_router__APIKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/pricing/usage":{"get":{"tags":["Pricing","Pricing"],"summary":"Get Usage","description":"Get current credit usage for an API key","operationId":"get_usage_api_v1_pricing_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/pricing/upgrade/calculate":{"post":{"tags":["Pricing","Pricing"],"summary":"Calculate Upgrade","description":"Calculate upgrade cost and benefits","operationId":"calculate_upgrade_api_v1_pricing_upgrade_calculate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__pricing_router__UpgradeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__pricing_router__UpgradeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/pricing/roi-calculator":{"get":{"tags":["Pricing","Pricing"],"summary":"Roi Calculator","description":"Calculate ROI of AI employees vs doing tasks manually","operationId":"roi_calculator_api_v1_pricing_roi_calculator_get","parameters":[{"name":"tasks_per_day","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Tasks Per Day"}},{"name":"hours_saved_weekly","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Hours Saved Weekly"}},{"name":"hourly_rate","in":"query","required":false,"schema":{"type":"number","default":50.0,"title":"Hourly Rate"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/pricing/verticals":{"get":{"tags":["Pricing","Pricing"],"summary":"Get All Vertical Pricing","description":"Public pricing endpoint — returns pricing for all 11 LiquidCortex verticals.\n\nGroups results by pricing model: subscription, addon, enterprise_license, gainshare.","operationId":"get_all_vertical_pricing_api_v1_pricing_verticals_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/pricing/verticals/{vertical}":{"get":{"tags":["Pricing","Pricing"],"summary":"Get Vertical Price","description":"Get pricing for a specific vertical.","operationId":"get_vertical_price_api_v1_pricing_verticals__vertical__get","parameters":[{"name":"vertical","in":"path","required":true,"schema":{"type":"string","title":"Vertical"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/pricing/verticals/{vertical}/estimate":{"post":{"tags":["Pricing","Pricing"],"summary":"Estimate Vertical Cost","description":"Estimate monthly cost based on projected usage.\n\nFor gain-share verticals, provide ``value_created`` in the request body.\nFor subscription verticals, returns tier pricing summary.","operationId":"estimate_vertical_cost_api_v1_pricing_verticals__vertical__estimate_post","parameters":[{"name":"vertical","in":"path","required":true,"schema":{"type":"string","title":"Vertical"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/GainShareEstimateRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/blog/posts":{"get":{"tags":["Blog"],"summary":"List Posts","description":"List all blog posts with pagination.\n\nSupports filtering by category and featured status.","operationId":"list_posts_api_blog_posts_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Items per page","default":10,"title":"Per Page"},"description":"Items per page"},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category","title":"Category"},"description":"Filter by category"},{"name":"featured","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by featured status","title":"Featured"},"description":"Filter by featured status"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/blog/posts/{identifier}":{"get":{"tags":["Blog"],"summary":"Get Post","description":"Get a single blog post by slug or ID.\n\nThe identifier can be either the post slug (e.g., \"built-to-refuse\")\nor the post ID.","operationId":"get_post_api_blog_posts__identifier__get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPost"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/blog/posts/{slug}/related":{"get":{"tags":["Blog"],"summary":"Get Related","description":"Get related posts for a given blog post.\n\nReturns posts from the same category or with shared tags.","operationId":"get_related_api_blog_posts__slug__related_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"description":"Number of related posts to return","default":3,"title":"Limit"},"description":"Number of related posts to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BlogPostSummary"},"title":"Response Get Related Api Blog Posts  Slug  Related Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/blog/categories":{"get":{"tags":["Blog"],"summary":"List Categories","description":"List all unique blog categories.","operationId":"list_categories_api_blog_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response List Categories Api Blog Categories Get"}}}}}}},"/api/blog/tags":{"get":{"tags":["Blog"],"summary":"List Tags","description":"List all unique blog tags.","operationId":"list_tags_api_blog_tags_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response List Tags Api Blog Tags Get"}}}}}}},"/api/knowledge/documents":{"post":{"tags":["Knowledge Base","Knowledge Base"],"summary":"Upload Document","description":"Upload a document to the knowledge base\n\n**Supported formats:** PDF, DOCX, TXT, MD\n**Max size:** 10MB\n\nThe document will be processed asynchronously:\n1. Text extraction\n2. Chunking into ~800 token segments\n3. Embedding generation via OpenAI\n4. Storage in pgvector for semantic search\n\n**Returns:** Document ID and initial status (pending/processing)\n\n**Example:**\n```bash\ncurl -X POST \"http://localhost:8000/api/knowledge/documents\" \\\n  -F \"file=@product_docs.pdf\" \\\n  -H \"X-User-ID: user123\"\n```","operationId":"upload_document_api_knowledge_documents_post","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_api_knowledge_documents_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Knowledge Base","Knowledge Base"],"summary":"List Documents","description":"List documents in the knowledge base\n\n**Query parameters:**\n- status: Filter by processing status (pending, processing, completed, failed)\n- limit: Number of results per page (default 50)\n- offset: Pagination offset\n\n**Example:**\n```bash\ncurl \"http://localhost:8000/api/knowledge/documents?status=completed&limit=10\" \\\n  -H \"X-User-ID: user123\"\n```","operationId":"list_documents_api_knowledge_documents_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Results per page","default":50,"title":"Limit"},"description":"Results per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Pagination offset","default":0,"title":"Offset"},"description":"Pagination offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/knowledge/documents/{document_id}":{"get":{"tags":["Knowledge Base","Knowledge Base"],"summary":"Get Document","description":"Get details of a specific document\n\nReturns document metadata including processing status, chunk count, and token count.","operationId":"get_document_api_knowledge_documents__document_id__get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Knowledge Base","Knowledge Base"],"summary":"Delete Document","description":"Delete a document and all its chunks\n\n**Warning:** This action is irreversible. The document and all associated\nembeddings will be permanently deleted.\n\n**Example:**\n```bash\ncurl -X DELETE \"http://localhost:8000/api/knowledge/documents/abc123\" \\\n  -H \"X-User-ID: user123\"\n```","operationId":"delete_document_api_knowledge_documents__document_id__delete","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/knowledge/query":{"post":{"tags":["Knowledge Base","Knowledge Base"],"summary":"Semantic Search","description":"Perform semantic search across the knowledge base\n\nUses cosine similarity with pgvector to find the most relevant chunks\nbased on the query's semantic meaning.\n\n**Parameters:**\n- query: The search query (will be embedded and compared)\n- top_k: Number of results to return (default 5)\n- similarity_threshold: Minimum similarity score 0-1 (default 0.7)\n\n**Example:**\n```bash\ncurl -X POST \"http://localhost:8000/api/knowledge/query\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-User-ID: user123\" \\\n  -d '{\"query\": \"How do I reset my password?\", \"top_k\": 5}'\n```","operationId":"semantic_search_api_knowledge_query_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/knowledge/context":{"post":{"tags":["Knowledge Base","Knowledge Base"],"summary":"Get Rag Context","description":"Get RAG context for chat injection\n\nThis endpoint is optimized for the chat system. It returns formatted context\nthat can be directly injected into the system prompt.\n\n**Use case:** Before sending a user message to an AI employee, call this endpoint\nto get relevant knowledge base context. Then inject the context into the system prompt.\n\n**Example:**\n```bash\ncurl -X POST \"http://localhost:8000/api/knowledge/context\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-User-ID: user123\" \\\n  -d '{\"query\": \"What are the pricing tiers?\", \"top_k\": 3}'\n```\n\n**Response format:**\n```json\n{\n  \"context\": \"RELEVANT CONTEXT FROM KNOWLEDGE BASE:\\n\\n[1] From: product_docs.pdf\\nPricing starts at $29/mo for Starter tier...\",\n  \"chunks_used\": 3,\n  \"sources\": [{\"document_id\": \"...\", \"document_name\": \"product_docs.pdf\", \"chunk_index\": 5}]\n}\n```","operationId":"get_rag_context_api_knowledge_context_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/knowledge/stats":{"get":{"tags":["Knowledge Base","Knowledge Base"],"summary":"Get Stats","description":"Get knowledge base statistics\n\nReturns aggregate statistics about the user's knowledge base including\ndocument counts, chunk counts, token usage, and storage.\n\n**Example:**\n```bash\ncurl \"http://localhost:8000/api/knowledge/stats\" \\\n  -H \"X-User-ID: user123\"\n```","operationId":"get_stats_api_knowledge_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsResponse"}}}}}}},"/api/knowledge/health":{"get":{"tags":["Knowledge Base","Knowledge Base"],"summary":"Health Check","description":"Health check for knowledge base service\n\nReturns status of the knowledge base service and its dependencies.","operationId":"health_check_api_knowledge_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/keys":{"get":{"tags":["API Keys"],"summary":"List Api Keys","description":"List all API keys for the authenticated user.\n\nKeys are returned with masked values (prefix only).","operationId":"list_api_keys_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyListResponse"}}}}}},"post":{"tags":["API Keys"],"summary":"Create Api Key","description":"Create a new API key.\n\nIMPORTANT: The full key is only returned once. Store it securely.","operationId":"create_api_key_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/keys/{key_id}":{"get":{"tags":["API Keys"],"summary":"Get Api Key","description":"Get details of a specific API key.","operationId":"get_api_key_api_keys__key_id__get","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__api_keys_router__APIKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["API Keys"],"summary":"Revoke Api Key","description":"Revoke an API key.\n\nRevoked keys cannot be used for authentication.","operationId":"revoke_api_key_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams":{"get":{"tags":["Teams"],"summary":"List Teams","description":"List all teams the user is a member of.","operationId":"list_teams_api_teams_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamListResponse"}}}}}},"post":{"tags":["Teams"],"summary":"Create Team","description":"Create a new team.\n\nThe authenticated user becomes the team owner.","operationId":"create_team_api_teams_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTeamRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/{team_id}":{"get":{"tags":["Teams"],"summary":"Get Team","description":"Get detailed team information including members.","operationId":"get_team_api_teams__team_id__get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Teams"],"summary":"Update Team","description":"Update team settings.\n\nOnly team owner or admins can update.","operationId":"update_team_api_teams__team_id__patch","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Teams"],"summary":"Delete Team","description":"Delete a team.\n\nOnly the team owner can delete the team.","operationId":"delete_team_api_teams__team_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/{team_id}/invite":{"post":{"tags":["Teams"],"summary":"Invite Member","description":"Invite a user to join the team by email.\n\nOnly team owner or admins can invite.","operationId":"invite_member_api_teams__team_id__invite_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteMemberRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationSentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/{team_id}/invitations":{"get":{"tags":["Teams"],"summary":"List Invitations","description":"List pending invitations for a team.","operationId":"list_invitations_api_teams__team_id__invitations_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InvitationResponse"},"title":"Response List Invitations Api Teams  Team Id  Invitations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/join/{token}":{"post":{"tags":["Teams"],"summary":"Join Team","description":"Accept a team invitation and join the team.","operationId":"join_team_api_teams_join__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinTeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/{team_id}/members/{member_id}":{"patch":{"tags":["Teams"],"summary":"Update Member Role","description":"Update a team member's role.\n\nOnly team owner can change roles.","operationId":"update_member_role_api_teams__team_id__members__member_id__patch","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Teams"],"summary":"Remove Member","description":"Remove a member from the team.\n\nOwner and admins can remove members. Members can remove themselves.","operationId":"remove_member_api_teams__team_id__members__member_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows":{"post":{"tags":["Workflows"],"summary":"Create Workflow","description":"Create a new workflow\n\nCreates a workflow with the specified trigger type and steps.\nWorkflows start in 'draft' status and must be activated to run.","operationId":"create_workflow_api_workflows_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__workflow_router__CreateWorkflowRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__workflow_router__WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Workflows"],"summary":"List Workflows","description":"List workflows for a user\n\nOptionally filter by status and trigger type.","operationId":"list_workflows_api_workflows_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/WorkflowStatus"},{"type":"null"}],"title":"Status"}},{"name":"trigger_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/TriggerType"},{"type":"null"}],"title":"Trigger Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__workflow_router__WorkflowListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/stats":{"get":{"tags":["Workflows"],"summary":"Get Workflow Stats","description":"Get workflow statistics for a user\n\nReturns aggregated stats across all user's workflows.","operationId":"get_workflow_stats_api_workflows_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowStatsResponse"}}}}}}},"/api/workflows/templates":{"get":{"tags":["Workflows"],"summary":"List Workflow Templates","description":"List available workflow templates\n\nTemplates provide pre-configured workflows that users can customize.","operationId":"list_workflow_templates_api_workflows_templates_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"featured_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Featured Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowTemplateResponse"},"title":"Response List Workflow Templates Api Workflows Templates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/{workflow_id}":{"get":{"tags":["Workflows"],"summary":"Get Workflow","description":"Get workflow details by ID\n\nReturns complete workflow configuration including all steps.","operationId":"get_workflow_api_workflows__workflow_id__get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__workflow_router__WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Workflows"],"summary":"Update Workflow","description":"Update an existing workflow\n\nOnly provided fields will be updated.","operationId":"update_workflow_api_workflows__workflow_id__put","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkflowRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__workflow_router__WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Workflows"],"summary":"Delete Workflow","description":"Delete a workflow\n\nArchives the workflow and all associated runs.","operationId":"delete_workflow_api_workflows__workflow_id__delete","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Workflow Api Workflows  Workflow Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/{workflow_id}/activate":{"post":{"tags":["Workflows"],"summary":"Activate Workflow","description":"Activate a workflow\n\nMakes the workflow available for execution.","operationId":"activate_workflow_api_workflows__workflow_id__activate_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__workflow_router__WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/{workflow_id}/deactivate":{"post":{"tags":["Workflows"],"summary":"Deactivate Workflow","description":"Deactivate a workflow\n\nPauses the workflow from being executed.","operationId":"deactivate_workflow_api_workflows__workflow_id__deactivate_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__workflow_router__WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/{workflow_id}/run":{"post":{"tags":["Workflows"],"summary":"Run Workflow","description":"Manually trigger a workflow run\n\nStarts executing the workflow in the background and returns immediately.\nPoll the run status endpoint to track progress.","operationId":"run_workflow_api_workflows__workflow_id__run_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunWorkflowRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/{workflow_id}/runs":{"get":{"tags":["Workflows"],"summary":"Get Workflow Runs","description":"Get execution history for a workflow\n\nReturns all runs for the specified workflow, optionally filtered by status.","operationId":"get_workflow_runs_api_workflows__workflow_id__runs_get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RunStatus"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/runs/{run_id}":{"get":{"tags":["Workflows"],"summary":"Get Workflow Run","description":"Get details for a specific workflow run\n\nReturns complete run information including step results.","operationId":"get_workflow_run_api_workflows_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/runs/{run_id}/steps":{"get":{"tags":["Workflows"],"summary":"Get Workflow Run Steps","description":"Get detailed step execution data for a workflow run\n\nReturns individual step execution information for debugging.","operationId":"get_workflow_run_steps_api_workflows_runs__run_id__steps_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Workflow Run Steps Api Workflows Runs  Run Id  Steps Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/runs/{run_id}/cancel":{"post":{"tags":["Workflows"],"summary":"Cancel Workflow Run","description":"Cancel a running workflow\n\nOnly works for runs in 'pending' or 'running' status.","operationId":"cancel_workflow_run_api_workflows_runs__run_id__cancel_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Cancel Workflow Run Api Workflows Runs  Run Id  Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows/webhook/{webhook_path}":{"post":{"tags":["Workflows"],"summary":"Workflow Webhook","description":"Handle incoming webhooks for workflow triggers\n\nFinds workflows configured with this webhook path and triggers them.","operationId":"workflow_webhook_api_workflows_webhook__webhook_path__post","parameters":[{"name":"webhook_path","in":"path","required":true,"schema":{"type":"string","title":"Webhook Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Workflow Webhook Api Workflows Webhook  Webhook Path  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user-skills":{"post":{"tags":["User Custom Skills"],"summary":"Create custom skill","description":"Create a new custom skill for your AI employees. Skills can be triggered by keyword patterns and assigned to specific employees.","operationId":"create_skill_api_user_skills_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSkillRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__user_skills_router__SkillResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["User Custom Skills"],"summary":"List user's custom skills","description":"Get all custom skills for the authenticated user with optional filtering.","operationId":"list_skills_api_user_skills_get","parameters":[{"name":"skill_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SkillType"},{"type":"null"}],"title":"Skill Type"}},{"name":"enabled","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},{"name":"employee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user-skills/stats":{"get":{"tags":["User Custom Skills"],"summary":"Get skill statistics","description":"Get aggregated statistics about your custom skills.","operationId":"get_skill_stats_api_user_skills_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillStatsResponse"}}}}}}},"/api/user-skills/match":{"get":{"tags":["User Custom Skills"],"summary":"Find matching skills","description":"Find skills that match a given message for a specific employee.","operationId":"find_matching_skills_api_user_skills_match_get","parameters":[{"name":"employee_id","in":"query","required":true,"schema":{"type":"string","title":"Employee Id"}},{"name":"message","in":"query","required":true,"schema":{"type":"string","title":"Message"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MatchingSkillResponse"},"title":"Response Find Matching Skills Api User Skills Match Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user-skills/{skill_id}":{"get":{"tags":["User Custom Skills"],"summary":"Get skill details","description":"Get detailed information about a specific skill.","operationId":"get_skill_api_user_skills__skill_id__get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__user_skills_router__SkillResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["User Custom Skills"],"summary":"Update skill","description":"Update an existing custom skill.","operationId":"update_skill_api_user_skills__skill_id__put","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSkillRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__user_skills_router__SkillResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["User Custom Skills"],"summary":"Delete skill","description":"Permanently delete a custom skill.","operationId":"delete_skill_api_user_skills__skill_id__delete","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Skill Api User Skills  Skill Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user-skills/{skill_id}/toggle":{"post":{"tags":["User Custom Skills"],"summary":"Toggle skill enabled status","description":"Enable or disable a skill.","operationId":"toggle_skill_api_user_skills__skill_id__toggle_post","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__user_skills_router__SkillResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user-skills/{skill_id}/execute":{"post":{"tags":["User Custom Skills"],"summary":"Record skill execution","description":"Record when a skill is executed (internal use).","operationId":"record_skill_execution_api_user_skills__skill_id__execute_post","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}},{"name":"employee_id","in":"query","required":true,"schema":{"type":"string","title":"Employee Id"}},{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},{"name":"triggered_by","in":"query","required":false,"schema":{"type":"string","default":"pattern_match","title":"Triggered By"}},{"name":"trigger_pattern","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Pattern"}},{"name":"input_message","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Message"}},{"name":"success","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Success"}},{"name":"error_message","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},{"name":"execution_time_ms","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Execution Time Ms"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Record Skill Execution Api User Skills  Skill Id  Execute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user-skills/{skill_id}/executions":{"get":{"tags":["User Custom Skills"],"summary":"Get skill execution history","description":"Get execution history for a specific skill.","operationId":"get_skill_executions_api_user_skills__skill_id__executions_get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Skill Executions Api User Skills  Skill Id  Executions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/unified":{"post":{"tags":["Webhooks"],"summary":"Unified Webhook","description":"Main webhook endpoint for Unified.to callbacks.\n\nHandles integration connection lifecycle events:\n- connection.created: User connected a new integration\n- connection.updated: Connection status or permissions changed\n- connection.deleted: User disconnected the integration\n\nReturns 200 OK quickly to acknowledge receipt, processes in background.","operationId":"unified_webhook_api_webhooks_unified_post","parameters":[{"name":"X-Unified-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Unified-Signature"}},{"name":"X-Unified-Webhook-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Unified-Webhook-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/unified/health":{"get":{"tags":["Webhooks"],"summary":"Webhook Health","description":"Health check endpoint for Unified.to webhook configuration.\n\nReturns configuration status and database connectivity.","operationId":"webhook_health_api_webhooks_unified_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/webhooks/unified/connections/{user_id}":{"get":{"tags":["Webhooks"],"summary":"List User Connections","description":"List all active integrations for a user.\n\nReturns connection details including integration name, type, and status.","operationId":"list_user_connections_api_webhooks_unified_connections__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/unified/connections/{connection_id}":{"delete":{"tags":["Webhooks"],"summary":"Disconnect Integration","description":"Manually disconnect an integration.\n\nThis marks the connection as revoked locally.\nThe actual disconnection in Unified.to should be done via their API.","operationId":"disconnect_integration_api_webhooks_unified_connections__connection_id__delete","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}},{"name":"user_id","in":"query","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations/connections":{"get":{"tags":["Integrations"],"summary":"List Connections","description":"List all connected integrations for the current user.\n\nReturns integration connection status for display in the UI.\nFetches connections from both Nango and local database.","operationId":"list_connections_api_integrations_connections_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionsListResponse"}}}}}}},"/api/integrations/{integration_id}/connect":{"post":{"tags":["Integrations"],"summary":"Connect Integration","description":"Initiate OAuth flow to connect an integration.\n\nReturns the Nango authorization URL for the user to complete OAuth.\n\nThe frontend should redirect the user to this URL or open it in a popup.\nAfter OAuth, Nango will redirect to our callback endpoint.","operationId":"connect_integration_api_integrations__integration_id__connect_post","parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","title":"Integration Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations/{integration_id}/disconnect":{"post":{"tags":["Integrations"],"summary":"Disconnect Integration","description":"Disconnect an integration.\n\nRevokes the connection both in Nango and locally.","operationId":"disconnect_integration_api_integrations__integration_id__disconnect_post","parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","title":"Integration Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations/callback":{"get":{"tags":["Integrations"],"summary":"Oauth Callback","description":"Handle OAuth callback from Nango.\n\nNango redirects here after OAuth completion with connection details.\nThis endpoint stores the connection locally and returns success/failure.\n\nSECURITY: the row was written with `connection_id` bound to BOTH the\nuser_id and connection_id columns, and there was no auth — so an anonymous\n`GET /api/integrations/callback?providerConfigKey=slack&connectionId=<victim_user_id>`\ninserted a connection owned by the victim (it appears in their\n`GET /connections`) and, because the upsert sets `status='active',\nrevoked_at=NULL`, silently RE-ENABLED an integration the victim had\nrevoked. The owner is now the authenticated caller.","operationId":"oauth_callback_api_integrations_callback_get","parameters":[{"name":"providerConfigKey","in":"query","required":false,"schema":{"type":"string","title":"Providerconfigkey"}},{"name":"connectionId","in":"query","required":false,"schema":{"type":"string","title":"Connectionid"}},{"name":"publicKey","in":"query","required":false,"schema":{"type":"string","title":"Publickey"}},{"name":"error","in":"query","required":false,"schema":{"type":"string","title":"Error"}},{"name":"errorDescription","in":"query","required":false,"schema":{"type":"string","title":"Errordescription"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations/available":{"get":{"tags":["Integrations"],"summary":"List Available Integrations","description":"List all available integrations that users can connect.\n\nReturns metadata about each integration for display in the UI.","operationId":"list_available_integrations_api_integrations_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/integrations/status":{"get":{"tags":["Integrations"],"summary":"Integrations Status","description":"Get integration service status.\n\nReturns configuration status and connectivity.","operationId":"integrations_status_api_integrations_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/integrations/workflow/providers":{"get":{"tags":["Integration Workflow","Integration Workflow"],"summary":"List Providers","description":"List all available integration providers.\n\nReturns pre-configured providers with OAuth settings.","operationId":"list_providers_api_integrations_workflow_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProviderInfo"},"type":"array","title":"Response List Providers Api Integrations Workflow Providers Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/integrations/workflow/start":{"post":{"tags":["Integration Workflow","Integration Workflow"],"summary":"Start Workflow","description":"Start a new integration workflow.\n\nCreates a new workflow and returns the initial A2UI.","operationId":"start_workflow_api_integrations_workflow_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartWorkflowRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__integration_workflow_router__WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/integrations/workflow/list":{"get":{"tags":["Integration Workflow","Integration Workflow"],"summary":"List Workflows","description":"List all active workflows.\n\nReturns summary information for each workflow.","operationId":"list_workflows_api_integrations_workflow_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WorkflowListItem"},"type":"array","title":"Response List Workflows Api Integrations Workflow List Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/integrations/workflow/{workflow_id}":{"get":{"tags":["Integration Workflow","Integration Workflow"],"summary":"Get Workflow","description":"Get current workflow state and A2UI.\n\nReturns the workflow state with A2UI components for the current step.","operationId":"get_workflow_api_integrations_workflow__workflow_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__integration_workflow_router__WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Integration Workflow","Integration Workflow"],"summary":"Cancel Workflow","description":"Cancel and delete a workflow.\n\nRemoves the workflow from active list.","operationId":"cancel_workflow_api_integrations_workflow__workflow_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations/workflow/{workflow_id}/action":{"post":{"tags":["Integration Workflow","Integration Workflow"],"summary":"Submit Action","description":"Submit a human action to the workflow.\n\nProcesses the action and returns updated A2UI.","operationId":"submit_action_api_integrations_workflow__workflow_id__action_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowActionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__integration_workflow_router__WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations/workflow/{workflow_id}/screenshot/{filename}":{"get":{"tags":["Integration Workflow","Integration Workflow"],"summary":"Get Screenshot","description":"Get a screenshot from a workflow.\n\nReturns the screenshot image file.","operationId":"get_screenshot_api_integrations_workflow__workflow_id__screenshot__filename__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/enrichment/company":{"post":{"tags":["Enrichment","Enrichment"],"summary":"Enrich Company Endpoint","description":"Enrich a company with firmographic, technographic, and intent data.\n\nReturns an EnrichmentResult with enrichment_score indicating data\ncompleteness (0-1).  All heuristic results are marked with\ndata_source: \"estimated\".","operationId":"enrich_company_endpoint_api_v1_enrichment_company_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyEnrichmentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Enrich Company Endpoint Api V1 Enrichment Company Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/enrichment/contact":{"post":{"tags":["Enrichment","Enrichment"],"summary":"Enrich Contact Endpoint","description":"Enrich a contact with seniority, department, and company data.\n\nInfers seniority and department from email patterns.  All results\nare marked with data_source: \"estimated\".","operationId":"enrich_contact_endpoint_api_v1_enrichment_contact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactEnrichmentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Enrich Contact Endpoint Api V1 Enrichment Contact Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/enrichment/intent":{"post":{"tags":["Enrichment","Enrichment"],"summary":"Detect Intent Endpoint","description":"Detect buying intent signals for a company.\n\nReturns a list of IntentSignal objects with type, strength (0-1),\nand source.  All heuristic results are marked with\nsource: \"estimated\".","operationId":"detect_intent_endpoint_api_v1_enrichment_intent_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__enrichment_router__IntentDetectionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Detect Intent Endpoint Api V1 Enrichment Intent Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integration-requests":{"get":{"tags":["Integration Requests","Integration Requests"],"summary":"List Requests","description":"List all integration requests.\n\nReturns requests for the current user (or all for now).","operationId":"list_requests_api_integration_requests_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/IntegrationRequestListItem"},"type":"array","title":"Response List Requests Api Integration Requests Get"}}}}}},"post":{"tags":["Integration Requests","Integration Requests"],"summary":"Create Request","description":"Submit a new integration request.\n\nCustomers use this to request integrations they need.","operationId":"create_request_api_integration_requests_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationRequestCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integration-requests/{request_id}":{"get":{"tags":["Integration Requests","Integration Requests"],"summary":"Get Request","description":"Get details of a specific request.","operationId":"get_request_api_integration_requests__request_id__get","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integration-requests/admin/queue":{"get":{"tags":["Integration Requests","Integration Requests"],"summary":"Get Admin Queue","description":"Get all pending/in-review requests for admin queue.\n\nAdmin-only endpoint to view and manage customer requests.","operationId":"get_admin_queue_api_integration_requests_admin_queue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/IntegrationRequestResponse"},"type":"array","title":"Response Get Admin Queue Api Integration Requests Admin Queue Get"}}}}}}},"/api/integration-requests/admin/{request_id}/status":{"patch":{"tags":["Integration Requests","Integration Requests"],"summary":"Update Request Status","description":"Update the status of a request.\n\nAdmin-only endpoint to change request status.","operationId":"update_request_status_api_integration_requests_admin__request_id__status_patch","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}},{"name":"status","in":"query","required":true,"schema":{"$ref":"#/components/schemas/RequestStatus"}},{"name":"admin_notes","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Notes"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integration-requests/admin/{request_id}":{"delete":{"tags":["Integration Requests","Integration Requests"],"summary":"Delete Request","description":"Delete a request.\n\nAdmin-only endpoint to remove requests.","operationId":"delete_request_api_integration_requests_admin__request_id__delete","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/merge/link-token":{"post":{"tags":["Merge","merge"],"summary":"Create Link Token","description":"Start a Merge Link session for the authenticated tenant.","operationId":"create_link_token_api_v1_merge_link_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/merge/exchange":{"post":{"tags":["Merge","merge"],"summary":"Exchange","description":"Exchange the widget's public_token for the account token; store it.","operationId":"exchange_api_v1_merge_exchange_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/merge/status":{"get":{"tags":["Merge","merge"],"summary":"Status","description":"Whether this tenant has an ATS linked (never returns the token).","operationId":"status_api_v1_merge_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/gateway/telegram/webhook":{"post":{"tags":["Gateway"],"summary":"Telegram Webhook","description":"Telegram Bot API webhook endpoint.\nVerifies signature, parses update, processes in background.","operationId":"telegram_webhook_api_gateway_telegram_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/gateway/slack/webhook":{"post":{"tags":["Gateway"],"summary":"Slack Webhook","description":"Slack Events API webhook endpoint.\nHandles URL verification challenges and event subscriptions.","operationId":"slack_webhook_api_gateway_slack_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/gateway/discord/webhook":{"post":{"tags":["Gateway"],"summary":"Discord Webhook","description":"Discord Interactions endpoint.\nHandles PING verification and application commands / messages.","operationId":"discord_webhook_api_gateway_discord_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/gateway/twilio/webhook":{"post":{"tags":["Gateway"],"summary":"Twilio Webhook","description":"Twilio SMS and WhatsApp inbound webhook.\nParses form-encoded body and processes in background.\nReturns TwiML empty response.","operationId":"twilio_webhook_api_gateway_twilio_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/gateway/status":{"get":{"tags":["Gateway"],"summary":"Gateway Status","description":"Gateway health check and connected platform status.","operationId":"gateway_status_api_gateway_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayStatusResponse"}}}}}}},"/api/gateway/pair":{"post":{"tags":["Gateway"],"summary":"Pair Account","description":"Link a platform user to a LiquidCortex account using a pairing code.\nCalled from the web app when the user enters their code.","operationId":"pair_account_api_gateway_pair_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/gateway/pair/{pairing_code}":{"get":{"tags":["Gateway"],"summary":"Check Pairing Status","description":"Check if a pairing code has been used and the account is linked.","operationId":"check_pairing_status_api_gateway_pair__pairing_code__get","parameters":[{"name":"pairing_code","in":"path","required":true,"schema":{"type":"string","title":"Pairing Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mcp/servers":{"post":{"tags":["MCP"],"summary":"Register Mcp Server","description":"Register an external MCP server (Streamable HTTP).\n\nThe server must be accessible from the cloud (e.g., via ngrok or Cloudflare Tunnel).","operationId":"register_mcp_server_api_mcp_servers_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterMCPServerRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPServerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mcp/servers/{server_id}":{"delete":{"tags":["MCP"],"summary":"Remove Mcp Server","description":"Remove a registered MCP server.","operationId":"remove_mcp_server_api_mcp_servers__server_id__delete","parameters":[{"name":"server_id","in":"path","required":true,"schema":{"type":"string","title":"Server Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mcp/tools":{"get":{"tags":["MCP"],"summary":"List Tools","description":"List all available tools for the authenticated user.\n\nAggregates tools from:\n- Bridge connection (local filesystem tools)\n- External MCP servers (Streamable HTTP)","operationId":"list_tools_api_mcp_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/MCPToolResponse"},"type":"array","title":"Response List Tools Api Mcp Tools Get"}}}}}}},"/api/mcp/tools/call":{"post":{"tags":["MCP"],"summary":"Call Tool","description":"Manually call a tool (for testing/debugging).\n\nRoutes to bridge or MCP server based on tool availability.","operationId":"call_tool_api_mcp_tools_call_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolCallRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mcp/status":{"get":{"tags":["MCP"],"summary":"Get Mcp Status","description":"Get MCP connection status for the authenticated user.\n\nShows bridge connection status, MCP server status, and total available tools.","operationId":"get_mcp_status_api_mcp_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPStatusResponse"}}}}}}},"/api/mcp/cortex/health":{"get":{"tags":["Cortex MCP"],"summary":"Health","description":"Railway health probe. No auth required.","operationId":"health_api_mcp_cortex_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Api Mcp Cortex Health Get"}}}}}}},"/api/mcp/cortex/tools/list":{"get":{"tags":["Cortex MCP"],"summary":"Tools List","description":"MCP-spec tool catalog.","operationId":"tools_list_api_mcp_cortex_tools_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Tools List Api Mcp Cortex Tools List Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/mcp/cortex/tools":{"post":{"tags":["Cortex MCP"],"summary":"Tools Call","description":"JSON-RPC 2.0 entry point. Method must be `tools/call`.\n\nThe standard MCP HTTP transport sends the JSON-RPC envelope via POST\nwith `Content-Type: application/json`. Per JSON-RPC spec, response.id\nMUST echo request.id when known; if the request itself is unparseable,\nid is null.","operationId":"tools_call_api_mcp_cortex_tools_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/shield/enable":{"post":{"tags":["Shield T&S","shield-provisioning"],"summary":"Enable Shield","description":"Provision Shield for the caller's empire. Idempotent.\n\nTHIS ROUTE WAS MISSING. Every authenticated Shield request that found no\ntenant returned 404 \"Shield is not enabled for this empire. Call\n/shield/enable first.\" (see `get_current_tenant` above) — and that endpoint\ndid not exist. `TenantManager.provision_for_empire()` had no caller\nanywhere in `src/`, so there was NO code path that could create a Shield\ntenant: the product was unreachable for every customer, and the error\nmessage pointed at a door that was never built.\n\nEmpire and name come from the verified TenantContext, never from the\nrequest body — otherwise a caller could provision (and then operate) a\ntenant for someone else's empire.\n\nIdempotent by way of `provision_for_empire`, which returns the existing\ntenant rather than re-creating, so a double-click cannot mint two tenants.","operationId":"enable_shield_api_shield_enable_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Enable Shield Api Shield Enable Post"}}}}}}},"/api/shield/health":{"get":{"tags":["Shield T&S","shield-health"],"summary":"Health Check","description":"Public health-check endpoint. No authentication required.","operationId":"health_check_api_shield_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Check Api Shield Health Get"}}}}}}},"/api/shield/stats":{"get":{"tags":["Shield T&S","shield-health"],"summary":"Get Tenant Stats","description":"Return usage statistics for the authenticated tenant.","operationId":"get_tenant_stats_api_shield_stats_get","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShieldStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/evaluate":{"post":{"tags":["Shield T&S","shield-evaluate"],"summary":"Evaluate Event","description":"Synchronous real-time evaluation of an event against the tenant's active rules.\n\nThis is the critical hot-path for Trust & Safety decisions.\n\nFlow:\n    1. Check tenant quota\n    2. Assign synthetic event id (Event has no client-supplied id field per\n       src/shield/models.py:232 — synthesised here for tracing/audit).\n    3. Load active rules\n    4. Evaluate each rule against the event\n    5. Collect matching rules\n    6. Determine final verdict (most severe action wins)\n    7. Apply side-effects (labels, etc.)\n    8. Store event + verdict\n    9. Queue webhook delivery if configured\n    10. Increment usage counter\n    11. Return verdict\n\nRaises:\n    HTTPException 429: Tenant has exceeded their plan quota.","operationId":"evaluate_event_api_shield_evaluate_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerdictResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/track":{"post":{"tags":["Shield T&S","shield-evaluate"],"summary":"Track Event","description":"Ingest an event for analytics and later investigation (INGEST-ONLY).\n\nThis does NOT moderate the event and does NOT produce a verdict — no\nbackground worker evaluates tracked events yet. Do not poll for a verdict:\nfor a moderation decision use POST /evaluate (synchronous). The event_id is\nfor correlating this row in investigation/analytics, not for polling a\nresult that never arrives.\n\nReturns:\n    202 Accepted with the assigned event_id (ingest-only, no verdict).","operationId":"track_event_api_shield_track_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Track Event Api Shield Track Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/evaluate/batch":{"post":{"tags":["Shield T&S","shield-evaluate"],"summary":"Evaluate Batch","description":"Evaluate a batch of events (max 100) in a single request.\n\nEach event is evaluated independently. Results are returned in the same\norder as the input list.\n\nRaises:\n    HTTPException 400: Batch exceeds 100 events.\n    HTTPException 429: Tenant quota exceeded.","operationId":"evaluate_batch_api_shield_evaluate_batch_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Event"},"title":"Events"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VerdictResponse"},"title":"Response Evaluate Batch Api Shield Evaluate Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/rules":{"get":{"tags":["Shield T&S","shield-rules"],"summary":"List Rules","description":"List all rules belonging to the authenticated tenant.","operationId":"list_rules_api_shield_rules_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RuleCategory"},{"type":"null"}],"description":"Filter by rule category","title":"Category"},"description":"Filter by rule category"},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by active status","title":"Is Active"},"description":"Filter by active status"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Rule"},"title":"Response List Rules Api Shield Rules Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Shield T&S","shield-rules"],"summary":"Create Rule","description":"Create a new rule from a RuleCreate payload.\n\nThe SML content is validated before the rule is persisted. If the SML\nis invalid the endpoint returns 422 with validation details.","operationId":"create_rule_api_shield_rules_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/rules/{rule_id}":{"get":{"tags":["Shield T&S","shield-rules"],"summary":"Get Rule","description":"Retrieve a specific rule by ID.","operationId":"get_rule_api_shield_rules__rule_id__get","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","description":"Rule UUID","title":"Rule Id"},"description":"Rule UUID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Shield T&S","shield-rules"],"summary":"Update Rule","description":"Update a rule. Creates a new version linked to the parent rule_id.\n\nThe previous version is deactivated; the new version inherits its\ncategory, entity type, and tenant association.","operationId":"update_rule_api_shield_rules__rule_id__put","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","description":"Rule UUID","title":"Rule Id"},"description":"Rule UUID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Shield T&S","shield-rules"],"summary":"Delete Rule","description":"Soft-delete a rule (sets is_active=False).","operationId":"delete_rule_api_shield_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","description":"Rule UUID","title":"Rule Id"},"description":"Rule UUID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/rules/{rule_id}/toggle":{"post":{"tags":["Shield T&S","shield-rules"],"summary":"Toggle Rule","description":"Toggle a rule's active state (enable/disable).","operationId":"toggle_rule_api_shield_rules__rule_id__toggle_post","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","description":"Rule UUID","title":"Rule Id"},"description":"Rule UUID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/rules/generate":{"post":{"tags":["Shield T&S","shield-rules"],"summary":"Generate Rule From Nl","description":"Generate a rule from a natural-language description using AI.\n\nReturns a preview of the generated SML + parsed rule metadata without\nsaving it. Use /rules/generate/deploy to generate and save in one step.","operationId":"generate_rule_from_nl_api_shield_rules_generate_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleFromNaturalLanguage"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Generate Rule From Nl Api Shield Rules Generate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/rules/generate/deploy":{"post":{"tags":["Shield T&S","shield-rules"],"summary":"Generate And Deploy Rule","description":"Generate a rule from natural language and immediately deploy it.\n\nThe generated SML is validated before saving. Returns the persisted Rule.\n\nRaises:\n    HTTPException 422: Generated SML failed validation.","operationId":"generate_and_deploy_rule_api_shield_rules_generate_deploy_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleFromNaturalLanguage"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/rules/validate":{"post":{"tags":["Shield T&S","shield-rules"],"summary":"Validate Sml","description":"Validate an SML content string without saving.\n\nExpects: {\"sml_content\": \"<SML string>\"}\nReturns: {\"valid\": bool, \"issues\": [...]}","operationId":"validate_sml_api_shield_rules_validate_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Validate Sml Api Shield Rules Validate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/rules/{rule_id}/dry-run":{"post":{"tags":["Shield T&S","shield-rules"],"summary":"Dry Run Rule","description":"Test a single rule against a sample event without persisting anything.\n\nReturns the match result including whether the rule would have matched,\nthe confidence score, and which conditions triggered.","operationId":"dry_run_rule_api_shield_rules__rule_id__dry_run_post","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","description":"Rule UUID","title":"Rule Id"},"description":"Rule UUID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Dry Run Rule Api Shield Rules  Rule Id  Dry Run Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/templates":{"get":{"tags":["Shield T&S","shield-templates"],"summary":"List Rule Templates","description":"List all available rule templates.\n\nPremium-only templates are filtered out for tenants on the Starter plan.","operationId":"list_rule_templates_api_shield_templates_get","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Rule Templates Api Shield Templates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/templates/starter-pack":{"get":{"tags":["Shield T&S","shield-templates"],"summary":"Get Starter Templates","description":"Get the recommended starter pack of templates for new tenants.","operationId":"get_starter_templates_api_shield_templates_starter_pack_get","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Starter Templates Api Shield Templates Starter Pack Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/templates/{name}":{"get":{"tags":["Shield T&S","shield-templates"],"summary":"Get Rule Template","description":"Get a specific rule template by name.","operationId":"get_rule_template_api_shield_templates__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","description":"Template name","title":"Name"},"description":"Template name"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Rule Template Api Shield Templates  Name  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/templates/{name}/deploy":{"post":{"tags":["Shield T&S","shield-templates"],"summary":"Deploy Template","description":"Deploy a rule template as a new tenant rule.\n\nCopies the template SML and metadata into the tenant's rule set.","operationId":"deploy_template_api_shield_templates__name__deploy_post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","description":"Template name","title":"Name"},"description":"Template name"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/labels":{"get":{"tags":["Shield T&S","shield-labels"],"summary":"List Labels","description":"List labels for the authenticated tenant, with optional filters.","operationId":"list_labels_api_shield_labels_get","parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/EntityType"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity ID","title":"Entity Id"},"description":"Filter by entity ID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Label"},"title":"Response List Labels Api Shield Labels Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Shield T&S","shield-labels"],"summary":"Create Label","description":"Manually add a label to an entity.","operationId":"create_label_api_shield_labels_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Label"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/labels/{label_id}":{"delete":{"tags":["Shield T&S","shield-labels"],"summary":"Delete Label","description":"Remove a label.","operationId":"delete_label_api_shield_labels__label_id__delete","parameters":[{"name":"label_id","in":"path","required":true,"schema":{"type":"string","description":"Label UUID","title":"Label Id"},"description":"Label UUID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/entities/{entity_type}/{entity_id}":{"get":{"tags":["Shield T&S","shield-entities"],"summary":"Get Entity Profile","description":"Get the full entity profile including labels, event history, and risk score.","operationId":"get_entity_profile_api_shield_entities__entity_type___entity_id__get","parameters":[{"name":"entity_type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/EntityType","description":"Entity type (user, ip, content, device)"},"description":"Entity type (user, ip, content, device)"},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","description":"Entity identifier","title":"Entity Id"},"description":"Entity identifier"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityProfile"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/entities":{"get":{"tags":["Shield T&S","shield-entities"],"summary":"List Entities","description":"List entities with optional filters for type, risk score, and labels.","operationId":"list_entities_api_shield_entities_get","parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/EntityType"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"},{"name":"min_risk_score","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"description":"Minimum risk score","title":"Min Risk Score"},"description":"Minimum risk score"},{"name":"has_label","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by label name","title":"Has Label"},"description":"Filter by label name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Results per page","default":50,"title":"Limit"},"description":"Results per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Pagination offset","default":0,"title":"Offset"},"description":"Pagination offset"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntityProfile"},"title":"Response List Entities Api Shield Entities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/entities/bulk-label":{"post":{"tags":["Shield T&S","shield-entities"],"summary":"Bulk Label Entities","description":"Bulk-add a label to a list of entities.\n\nExpects: {\"label\": str, \"entity_type\": str, \"entity_ids\": [str, ...], \"reason\": str?}","operationId":"bulk_label_entities_api_shield_entities_bulk_label_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Bulk Label Entities Api Shield Entities Bulk Label Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/webhooks":{"get":{"tags":["Shield T&S","shield-webhooks"],"summary":"Get Webhooks","description":"Get the tenant's webhook configuration.","operationId":"get_webhooks_api_shield_webhooks_get","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/WebhookConfig"},{"type":"null"}],"title":"Response Get Webhooks Api Shield Webhooks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Shield T&S","shield-webhooks"],"summary":"Update Webhooks","description":"Create or update the tenant's webhook configuration.","operationId":"update_webhooks_api_shield_webhooks_put","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookConfig"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/webhooks/test":{"post":{"tags":["Shield T&S","shield-webhooks"],"summary":"Test Webhook","description":"Send a test payload to the tenant's configured webhook URL.\n\nReturns the delivery result including HTTP status and latency.","operationId":"test_webhook_api_shield_webhooks_test_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Webhook Api Shield Webhooks Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/webhooks/logs":{"get":{"tags":["Shield T&S","shield-webhooks"],"summary":"Get Webhook Logs","description":"Get recent webhook delivery attempts for the tenant.","operationId":"get_webhook_logs_api_shield_webhooks_logs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Webhook Logs Api Shield Webhooks Logs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/investigate":{"post":{"tags":["Shield T&S","shield-investigation"],"summary":"Investigate","description":"Search events and verdicts using flexible query criteria.\n\nSupports filtering by entity, time range, action, rule, and free-text\nsearch across event payloads.","operationId":"investigate_api_shield_investigate_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvestigationQuery"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Investigate Api Shield Investigate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/investigate/timeline/{entity_type}/{entity_id}":{"get":{"tags":["Shield T&S","shield-investigation"],"summary":"Get Entity Timeline","description":"Get the full event timeline for a specific entity.\n\nReturns events and their associated verdicts in reverse chronological\norder, along with the entity's current risk score and active labels.","operationId":"get_entity_timeline_api_shield_investigate_timeline__entity_type___entity_id__get","parameters":[{"name":"entity_type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/EntityType","description":"Entity type"},"description":"Entity type"},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","description":"Entity identifier","title":"Entity Id"},"description":"Entity identifier"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Entity Timeline Api Shield Investigate Timeline  Entity Type   Entity Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/investigate/top-rules":{"get":{"tags":["Shield T&S","shield-investigation"],"summary":"Get Top Rules","description":"Get the top-firing rules within a time period.\n\nReturns rule IDs, names, and match counts, ordered by frequency.","operationId":"get_top_rules_api_shield_investigate_top_rules_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(24h|7d|30d)$","description":"Time period","default":"7d","title":"Period"},"description":"Time period"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Top Rules Api Shield Investigate Top Rules Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/investigate/top-entities":{"get":{"tags":["Shield T&S","shield-investigation"],"summary":"Get Top Entities","description":"Get the highest-risk entities across the tenant's data.\n\nReturns entity profiles sorted by risk score descending.","operationId":"get_top_entities_api_shield_investigate_top_entities_get","parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/EntityType"},{"type":"null"}],"title":"Entity Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Top Entities Api Shield Investigate Top Entities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/reports/generate":{"post":{"tags":["Shield T&S","shield-compliance"],"summary":"Generate Report","description":"Generate a compliance report (DSA / OSA) for a date range.\n\nExpects: {\n    \"report_type\": \"dsa\" | \"osa\",\n    \"start_date\": \"YYYY-MM-DD\",\n    \"end_date\": \"YYYY-MM-DD\"\n}","operationId":"generate_report_api_shield_reports_generate_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/reports":{"get":{"tags":["Shield T&S","shield-compliance"],"summary":"List Reports","description":"List previously generated compliance reports.","operationId":"list_reports_api_shield_reports_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ComplianceReport"},"title":"Response List Reports Api Shield Reports Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/reports/{report_id}":{"get":{"tags":["Shield T&S","shield-compliance"],"summary":"Get Report","description":"Retrieve a specific compliance report.","operationId":"get_report_api_shield_reports__report_id__get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","description":"Report UUID","title":"Report Id"},"description":"Report UUID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/reports/{report_id}/download":{"get":{"tags":["Shield T&S","shield-compliance"],"summary":"Download Report","description":"Download a compliance report as JSON or PDF.\n\nFor PDF, returns a pre-signed download URL. For JSON, returns the\nfull report payload inline.","operationId":"download_report_api_shield_reports__report_id__download_get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","description":"Report UUID","title":"Report Id"},"description":"Report UUID"},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(json|pdf)$","description":"Download format","default":"json","title":"Format"},"description":"Download format"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Download Report Api Shield Reports  Report Id  Download Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/tenants":{"get":{"tags":["Shield T&S","shield-admin"],"summary":"List Tenants","description":"Admin-only: list all tenants.","operationId":"list_tenants_api_shield_tenants_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Tenants Api Shield Tenants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Shield T&S","shield-admin"],"summary":"Create Tenant","description":"Admin-only: create a new tenant and generate an API key.","operationId":"create_tenant_api_shield_tenants_post","parameters":[{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Tenant Api Shield Tenants Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/tenants/{tenant_id}":{"get":{"tags":["Shield T&S","shield-admin"],"summary":"Get Tenant","description":"Admin-only: get tenant details.","operationId":"get_tenant_api_shield_tenants__tenant_id__get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","description":"Tenant UUID","title":"Tenant Id"},"description":"Tenant UUID"},{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Tenant Api Shield Tenants  Tenant Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Shield T&S","shield-admin"],"summary":"Update Tenant","description":"Admin-only: update tenant details (plan, name, settings).","operationId":"update_tenant_api_shield_tenants__tenant_id__put","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","description":"Tenant UUID","title":"Tenant Id"},"description":"Tenant UUID"},{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Tenant Api Shield Tenants  Tenant Id  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Shield T&S","shield-admin"],"summary":"Cancel Tenant","description":"Admin-only: cancel (soft-delete) a tenant account.\n\nSets tenant status to cancelled. Data is retained for the compliance\nretention period before hard deletion.","operationId":"cancel_tenant_api_shield_tenants__tenant_id__delete","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","description":"Tenant UUID","title":"Tenant Id"},"description":"Tenant UUID"},{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/tenants/{tenant_id}/rotate-key":{"post":{"tags":["Shield T&S","shield-admin"],"summary":"Rotate Tenant Key","description":"Admin-only: rotate a tenant's API key.\n\nReturns the new key. The old key is immediately invalidated.","operationId":"rotate_tenant_key_api_shield_tenants__tenant_id__rotate_key_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","description":"Tenant UUID","title":"Tenant Id"},"description":"Tenant UUID"},{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rotate Tenant Key Api Shield Tenants  Tenant Id  Rotate Key Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/tenants/{tenant_id}/suspend":{"post":{"tags":["Shield T&S","shield-admin"],"summary":"Suspend Tenant","description":"Admin-only: suspend a tenant. All API calls will return 403.","operationId":"suspend_tenant_api_shield_tenants__tenant_id__suspend_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","description":"Tenant UUID","title":"Tenant Id"},"description":"Tenant UUID"},{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Suspend Tenant Api Shield Tenants  Tenant Id  Suspend Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/trust-score":{"post":{"tags":["Shield T&S","shield-trust"],"summary":"Trust Score Endpoint","description":"Single-number trust assessment aggregating document, behavioral,\ntransaction, and reputation dimensions.\n\nReturns: score 0-100, risk_level, contributing_factors.\nAll scoring is heuristic-based with no external ML dependencies.","operationId":"trust_score_endpoint_api_shield_trust_score_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustScoreRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trust Score Endpoint Api Shield Trust Score Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/behavioral-drift":{"post":{"tags":["Shield T&S","shield-trust"],"summary":"Behavioral Drift Endpoint","description":"Continuous session authentication via behavioral drift scoring.\n\nTakes session events and baseline patterns, returns a drift score\n(0-1) with per-dimension breakdown.\nAll scoring is heuristic-based with no external ML dependencies.","operationId":"behavioral_drift_endpoint_api_shield_behavioral_drift_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BehavioralDriftRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Behavioral Drift Endpoint Api Shield Behavioral Drift Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/synthetic-check":{"post":{"tags":["Shield T&S","shield-trust"],"summary":"Synthetic Check Endpoint","description":"Synthetic identity fingerprinting.\n\nAnalyses document forensics, identity cross-references, and device\nfingerprint clustering to detect fabricated identities.\nReturns an authenticity score (0-100) and per-signal breakdown.\nAll scoring is heuristic-based with no external ML dependencies.","operationId":"synthetic_check_endpoint_api_shield_synthetic_check_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyntheticCheckRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Synthetic Check Endpoint Api Shield Synthetic Check Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/review-queue":{"post":{"tags":["Shield T&S","shield-review"],"summary":"Enqueue Review Item","description":"Manually enqueue content for moderator review (status='pending').","operationId":"enqueue_review_item_api_shield_review_queue_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewEnqueue"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewQueueItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Shield T&S","shield-review"],"summary":"List Review Queue","description":"List review-queue items for the tenant, optionally filtered by status.","operationId":"list_review_queue_api_shield_review_queue_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ReviewStatus"},{"type":"null"}],"description":"Filter by lifecycle state.","title":"Status"},"description":"Filter by lifecycle state."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReviewQueueItem"},"title":"Response List Review Queue Api Shield Review Queue Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/review-queue/{item_id}/claim":{"post":{"tags":["Shield T&S","shield-review"],"summary":"Claim Review Item","description":"Claim a 'pending' item for a moderator (transition to 'claimed').","operationId":"claim_review_item_api_shield_review_queue__item_id__claim_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","description":"Review-queue item UUID","title":"Item Id"},"description":"Review-queue item UUID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewClaim"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewQueueItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/review-queue/{item_id}/decide":{"post":{"tags":["Shield T&S","shield-review"],"summary":"Decide Review Item","description":"Decide a 'claimed' item — uphold or overturn (transition to 'decided').\n\nApplies the corresponding moderation effect (labels the content entity when\nthe item carries an event_id). Routed through the shield HITL gate as a\npolicy control point: it auto-approves a normal moderator decision and\nescalates to human approval only when the gate's blocklist/threshold trips.","operationId":"decide_review_item_api_shield_review_queue__item_id__decide_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","description":"Review-queue item UUID","title":"Item Id"},"description":"Review-queue item UUID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewDecide"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewQueueItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/review-queue/{item_id}/appeal":{"post":{"tags":["Shield T&S","shield-review"],"summary":"Appeal Review Item","description":"Submit an appeal on a 'decided' item (transition to 'appealed').","operationId":"appeal_review_item_api_shield_review_queue__item_id__appeal_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","description":"Review-queue item UUID","title":"Item Id"},"description":"Review-queue item UUID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewAppeal"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewQueueItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/review-queue/{item_id}/resolve":{"post":{"tags":["Shield T&S","shield-review"],"summary":"Resolve Review Appeal","description":"Resolve an 'appealed' item with a final decision (transition to\n'resolved'). The final decision may flip the original; the corresponding\neffect is re-applied. HITL-gated like /decide.","operationId":"resolve_review_appeal_api_shield_review_queue__item_id__resolve_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","description":"Review-queue item UUID","title":"Item Id"},"description":"Review-queue item UUID"},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewResolve"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewQueueItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/billing/plans":{"get":{"tags":["Shield Billing"],"summary":"List Shield plans","description":"Return all available Shield T&S plans with pricing and feature details.","operationId":"get_plans_api_shield_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/shield/billing/subscription":{"get":{"tags":["Shield Billing"],"summary":"Get current Shield subscription","description":"Get the current tenant's Shield subscription details.\n\nBILLING-HONESTY FIX. This handler previously queried ``billing.subscriptions``\nfor ``plan_id, plan_name, events_used, events_limit, rules_used, rules_limit,\ncurrent_period_start, current_period_end`` and filtered on ``tenant_id``.\nNONE of those nine identifiers exist on that table\n(database/init/08_subscriptions_schema.sql:41-86, which has ``tier``,\n``credits_total``, ``credits_used`` and is keyed by ``user_id``/``email_hash``).\nEvery call therefore raised UndefinedColumnError, was swallowed, and the\nhandler returned a stub claiming plan \"No Plan\" / status \"none\" / 0 events —\ntelling a paying Shield Pro tenant they had no subscription at all.\n\n``billing.subscriptions`` is also the WRONG TABLE and cannot be made to work:\nit has no tenant_id and no join path to a Shield tenant; its ``tier`` enum\n('trial','starter','manager','agency') is the AI-Employee plan ladder, not\nthe Shield one; and ``credits_*`` meters LLM credits, not the moderation\nEVENTS Shield bills on. Mapping credits onto events would invent a quota.\n\nThe real source is ``shield.tenants`` — the same row the ingest quota check\nmeters against — which is already loaded and authenticated on every request.","operationId":"get_subscription_api_shield_billing_subscription_get","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/billing/subscribe":{"post":{"tags":["Shield Billing"],"summary":"Subscribe to a Shield plan","description":"Create a new Shield subscription for the tenant.","operationId":"subscribe_api_shield_billing_subscribe_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/billing/upgrade":{"post":{"tags":["Shield Billing"],"summary":"Upgrade Shield plan","description":"Upgrade (or downgrade) the tenant's Shield plan.","operationId":"upgrade_plan_api_shield_billing_upgrade_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__shield_billing_router__UpgradeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/billing/cancel":{"post":{"tags":["Shield Billing"],"summary":"Cancel Shield subscription","description":"Cancel the tenant's Shield subscription.","operationId":"cancel_subscription_api_shield_billing_cancel_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/billing/invoices":{"get":{"tags":["Shield Billing"],"summary":"List Shield invoices","description":"List invoices for the tenant's Shield subscription.","operationId":"list_invoices_api_shield_billing_invoices_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":12,"title":"Limit"}},{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/billing/usage":{"get":{"tags":["Shield Billing"],"summary":"Detailed Shield usage breakdown","description":"Get detailed usage breakdown: events by day, overage charges.\n\nBILLING-HONESTY FIX. This handler previously aggregated\n``analytics.llm_usage`` filtering on ``tenant_id`` and counting\n``flagged``/``blocked``. That table has none of those three columns\n(database/init/05_analytics_schema.sql:10+), so the query always raised and\nthe handler returned 30 days of zeroed usage together with a HARDCODED\n``events_limit`` of 5,000,000 — the Shield Pro allowance — shown to every\ntenant regardless of the plan they actually pay for.\n\nReal sources: ``shield.events`` (tenant-scoped, partitioned on\n``received_at``) for volume, and ``shield.verdicts.action`` for the\nflagged/blocked split. The allowance comes from the authenticated tenant's\nown ``monthly_event_limit``.\n\nA successful query returning no rows is a REAL zero and is served as such.\nA query that FAILS yields 503 — never a synthesised usage series.","operationId":"get_usage_api_shield_billing_usage_get","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/billing/portal":{"post":{"tags":["Shield Billing"],"summary":"Create Stripe customer portal session","description":"Create a Stripe Customer Portal session URL for self-service billing management.","operationId":"create_portal_session_api_shield_billing_portal_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/reload/reload/{tenant_id}":{"post":{"tags":["Shield Reload"],"summary":"Force-reload rules for a tenant","description":"Force reload of all SML rules for the specified tenant.\n\nThis invalidates any cached rule state and notifies connected\nEventProcessors to re-read rules on their next evaluation cycle.","operationId":"reload_tenant_api_shield_reload_reload__tenant_id__post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/reload/reload":{"post":{"tags":["Shield Reload"],"summary":"Force-reload rules for all tenants","description":"Force reload of SML rules for every tenant with a deployed rule directory.","operationId":"reload_all_api_shield_reload_reload_post","parameters":[{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/reload/deployed/{tenant_id}":{"get":{"tags":["Shield Reload"],"summary":"List deployed rule files for a tenant","description":"Return the list of ``.sml`` files currently on disk for the tenant.","operationId":"get_deployed_rules_api_shield_reload_deployed__tenant_id__get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployedRulesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/reload/deploy/{tenant_id}":{"post":{"tags":["Shield Reload"],"summary":"Deploy rules to disk and trigger reload","description":"Write SML rule files to the tenant's directory and trigger a hot-reload.\n\nEach rule in the request body is written as ``{name}.sml``. A\n``main.sml`` entrypoint is auto-generated that imports all active rules.\nInactive rules are removed from disk if they exist.","operationId":"deploy_rules_api_shield_reload_deploy__tenant_id__post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/reload/watcher/status":{"get":{"tags":["Shield Reload"],"summary":"File-watcher status","description":"Return the current state of the background file watcher.","operationId":"watcher_status_api_shield_reload_watcher_status_get","parameters":[{"name":"X-Shield-Admin-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatcherStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/udfs":{"get":{"tags":["Shield UDFs"],"summary":"List UDFs","description":"List all custom UDFs for the authenticated tenant.","operationId":"list_udfs_api_shield_udfs_get","parameters":[{"name":"X-Shield-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UDFDefinition"},"title":"Response List Udfs Api Shield Udfs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Shield UDFs"],"summary":"Upload UDF","description":"Upload a new custom UDF. The source code is security-scanned before storage.","operationId":"upload_udf_api_shield_udfs_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UDFUpload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UDFDefinition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/udfs/{udf_id}":{"get":{"tags":["Shield UDFs"],"summary":"Get UDF","description":"Retrieve details for a specific UDF.","operationId":"get_udf_api_shield_udfs__udf_id__get","parameters":[{"name":"udf_id","in":"path","required":true,"schema":{"type":"string","title":"Udf Id"}},{"name":"X-Shield-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UDFDefinition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Shield UDFs"],"summary":"Update UDF","description":"Update an existing UDF, creating a new version. The new code is security-scanned.","operationId":"update_udf_api_shield_udfs__udf_id__put","parameters":[{"name":"udf_id","in":"path","required":true,"schema":{"type":"string","title":"Udf Id"}},{"name":"X-Shield-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UDFUpload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UDFDefinition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Shield UDFs"],"summary":"Delete UDF","description":"Soft-delete (deactivate) a UDF. The code is retained for audit purposes.","operationId":"delete_udf_api_shield_udfs__udf_id__delete","parameters":[{"name":"udf_id","in":"path","required":true,"schema":{"type":"string","title":"Udf Id"}},{"name":"X-Shield-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/udfs/test":{"post":{"tags":["Shield UDFs"],"summary":"Test UDF","description":"Test a UDF in the sandbox without saving it. Runs a security scan and then executes against the provided test inputs.","operationId":"test_udf_api_shield_udfs_test_post","parameters":[{"name":"X-Shield-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UDFTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UDFTestResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/udfs/{udf_id}/deploy":{"post":{"tags":["Shield UDFs"],"summary":"Deploy UDF","description":"Activate a UDF so it can be referenced in SML rules.","operationId":"deploy_udf_api_shield_udfs__udf_id__deploy_post","parameters":[{"name":"udf_id","in":"path","required":true,"schema":{"type":"string","title":"Udf Id"}},{"name":"X-Shield-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UDFDefinition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/udfs/{udf_id}/undeploy":{"post":{"tags":["Shield UDFs"],"summary":"Undeploy UDF","description":"Deactivate a UDF without deleting it. It will no longer be available in SML rules.","operationId":"undeploy_udf_api_shield_udfs__udf_id__undeploy_post","parameters":[{"name":"udf_id","in":"path","required":true,"schema":{"type":"string","title":"Udf Id"}},{"name":"X-Shield-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UDFDefinition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shield/udfs/{udf_id}/versions":{"get":{"tags":["Shield UDFs"],"summary":"UDF Version History","description":"Retrieve the full version history for a UDF (oldest to newest).","operationId":"get_udf_versions_api_shield_udfs__udf_id__versions_get","parameters":[{"name":"udf_id","in":"path","required":true,"schema":{"type":"string","title":"Udf Id"}},{"name":"X-Shield-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Shield-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UDFDefinition"},"title":"Response Get Udf Versions Api Shield Udfs  Udf Id  Versions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/control/status":{"get":{"tags":["Control Center"],"summary":"Get Fleet Status","description":"Get all employees with their current control status.","operationId":"get_fleet_status_api_control_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FleetStatusResponse"}}}}}}},"/api/control/employees/{employee_id}/pause":{"post":{"tags":["Control Center"],"summary":"Pause Employee","description":"Pause an employee — sets paused flag and cancels running tasks.","operationId":"pause_employee_api_control_employees__employee_id__pause_post","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PauseResumeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/control/employees/{employee_id}/resume":{"post":{"tags":["Control Center"],"summary":"Resume Employee","description":"Resume a paused employee.","operationId":"resume_employee_api_control_employees__employee_id__resume_post","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PauseResumeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/control/emergency-stop":{"post":{"tags":["Control Center"],"summary":"Emergency Stop","description":"STOP ALL employees immediately, cancel all running tasks.","operationId":"emergency_stop_api_control_emergency_stop_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmergencyStopResponse"}}}}}}},"/api/control/emergency-stop/lift":{"post":{"tags":["Control Center"],"summary":"Lift Emergency Stop","description":"Lift the emergency stop — resets all employees to active.","operationId":"lift_emergency_stop_api_control_emergency_stop_lift_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Lift Emergency Stop Api Control Emergency Stop Lift Post"}}}}}}},"/api/control/activity-feed":{"get":{"tags":["Control Center"],"summary":"Get Activity Feed","description":"Get recent actions across all employees.","operationId":"get_activity_feed_api_control_activity_feed_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActionEntry"},"title":"Response Get Activity Feed Api Control Activity Feed Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/control/activity-feed/stream":{"get":{"tags":["Control Center"],"summary":"Stream Activity Feed","description":"SSE endpoint — streams new activity entries in real-time.\n    Clients connect and receive `data: {json}\n\n` messages.","operationId":"stream_activity_feed_api_control_activity_feed_stream_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/performance/reviews":{"get":{"tags":["Performance Reviews"],"summary":"Get All Reviews","description":"Get performance reviews for all employees.","operationId":"get_all_reviews_api_performance_reviews_get","parameters":[{"name":"department","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by department","title":"Department"},"description":"Filter by department"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sort field","default":"tasks_completed","title":"Sort By"},"description":"Sort field"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sort order: asc or desc","default":"desc","title":"Order"},"description":"Sort order: asc or desc"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmployeePerformance"},"title":"Response Get All Reviews Api Performance Reviews Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/performance/reviews/{employee_id}":{"get":{"tags":["Performance Reviews"],"summary":"Get Employee Review","description":"Get detailed performance review for a single employee.","operationId":"get_employee_review_api_performance_reviews__employee_id__get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetailedPerformance"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/performance/leaderboard":{"get":{"tags":["Performance Reviews"],"summary":"Get Leaderboard","description":"Get top 10 employees by tasks completed, NCU efficiency, and success rate.","operationId":"get_leaderboard_api_performance_leaderboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaderboardResponse"}}}}}}},"/api/performance/department-summary":{"get":{"tags":["Performance Reviews"],"summary":"Get Department Summary","description":"Get aggregated metrics by department.","operationId":"get_department_summary_api_performance_department_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentSummaryResponse"}}}}}}},"/api/budgets":{"get":{"tags":["Employee Budgets"],"summary":"List all employee budgets","description":"Get all employee NCU budgets for the caller's empire.","operationId":"list_budgets_api_budgets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Employee Budgets"],"summary":"Allocate budget to employee","description":"Allocate an NCU budget to an employee. Creates or replaces existing budget.","operationId":"allocate_budget_api_budgets_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocateBudgetRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/budgets/summary":{"get":{"tags":["Employee Budgets"],"summary":"Org-wide budget utilization","description":"Get aggregated budget utilization across the caller's own employees.","operationId":"budget_summary_api_budgets_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/budgets/{employee_id}":{"get":{"tags":["Employee Budgets"],"summary":"Get employee budget","description":"Get a specific employee's NCU budget.","operationId":"get_budget_api_budgets__employee_id__get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Employee Budgets"],"summary":"Update employee budget","description":"Update an existing employee's budget allocation.","operationId":"update_budget_api_budgets__employee_id__put","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBudgetRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/budgets/{employee_id}/pause":{"post":{"tags":["Employee Budgets"],"summary":"Pause employee spending","description":"Pause an employee's NCU spending. All operations will be blocked.","operationId":"pause_employee_api_budgets__employee_id__pause_post","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/budgets/{employee_id}/resume":{"post":{"tags":["Employee Budgets"],"summary":"Resume employee spending","description":"Resume a paused employee's NCU spending.","operationId":"resume_employee_api_budgets__employee_id__resume_post","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/budgets/{employee_id}/transactions":{"get":{"tags":["Employee Budgets"],"summary":"Get spending history","description":"Get NCU transaction history for an employee.","operationId":"get_transactions_api_budgets__employee_id__transactions_get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/budgets/reset":{"post":{"tags":["Employee Budgets"],"summary":"Reset all budgets for new period","description":"Reset all employee budgets to full allocation for a new period.","operationId":"reset_all_budgets_api_budgets_reset_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/audit/decisions":{"get":{"tags":["Audit Trail"],"summary":"List Decisions","description":"Paginated list of AI decisions with plain-English summaries.\nReturns forensic audit data for every action taken by AI employees.","operationId":"list_decisions_api_audit_decisions_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":20,"title":"Per Page"},"description":"Items per page"},{"name":"employee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by employee ID","title":"Employee Id"},"description":"Filter by employee ID"},{"name":"decision_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by decision type","title":"Decision Type"},"description":"Filter by decision type"},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (ISO format)","title":"Date From"},"description":"Start date (ISO format)"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (ISO format)","title":"Date To"},"description":"End date (ISO format)"},{"name":"min_confidence","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"description":"Minimum confidence","title":"Min Confidence"},"description":"Minimum confidence"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDecisions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audit/decisions/{audit_id}":{"get":{"tags":["Audit Trail"],"summary":"Get Decision Detail","description":"Full decision detail with JSONB drill-down, methodology used,\nconfidence explanation, and complete forensic trail.","operationId":"get_decision_detail_api_audit_decisions__audit_id__get","parameters":[{"name":"audit_id","in":"path","required":true,"schema":{"type":"string","title":"Audit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audit/employees/{employee_id}/summary":{"get":{"tags":["Audit Trail"],"summary":"Get Employee Audit Summary","description":"Per-employee audit statistics: total decisions, approval rate,\naverage confidence, average risk score, compliance rate.","operationId":"get_employee_audit_summary_api_audit_employees__employee_id__summary_get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeAuditSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audit/compliance":{"get":{"tags":["Audit Trail"],"summary":"Get Compliance Dashboard","description":"Compliance dashboard data: overall rates, per-employee breakdown,\ntrend over the last 4 weeks.","operationId":"get_compliance_dashboard_api_audit_compliance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceDashboard"}}}}}}},"/api/audit/timeline":{"get":{"tags":["Audit Trail"],"summary":"Get Decision Timeline","description":"Chronological timeline of decisions grouped by hour.\nDefault: last 24 hours.","operationId":"get_decision_timeline_api_audit_timeline_get","parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":168,"minimum":1,"description":"Hours to look back","default":24,"title":"Hours"},"description":"Hours to look back"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__audit_router__TimelineResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/manager/plan":{"post":{"tags":["Cortex Manager"],"summary":"Decompose a goal into tasks","description":"Submit a high-level goal.  The Cortex Manager uses an LLM to decompose it\ninto discrete tasks, assigns each to the best-fit employee, and returns an\nexecution plan with estimated NCU cost.\n\nSECURITY: the plan is tagged with the caller's empire so only they can\nlater read or execute it.","operationId":"create_plan_api_manager_plan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/manager/execute":{"post":{"tags":["Cortex Manager"],"summary":"Execute a plan or goal","description":"Execute a previously created plan (by plan_id), or supply a goal to\ncreate a plan and execute it in a single call.\n\nSECURITY: an existing plan_id must belong to the caller's empire — 404\notherwise, so a foreign plan is indistinguishable from a missing one.","operationId":"execute_plan_api_manager_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/manager/executions":{"get":{"tags":["Cortex Manager"],"summary":"List recent executions","description":"Return the caller's recent execution reports, most recent first.\n\nSECURITY: scoped to the caller's empire — was returning every tenant's.","operationId":"list_executions_api_manager_executions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/manager/executions/{execution_id}":{"get":{"tags":["Cortex Manager"],"summary":"Get execution or plan status","description":"Retrieve the current status of an execution (report) or plan by ID.\n\nSECURITY: scoped to the caller's empire — a foreign or untagged id returns\nthe same 404 as a missing one (was returning any tenant's goals + outputs).","operationId":"get_execution_status_api_manager_executions__execution_id__get","parameters":[{"name":"execution_id","in":"path","required":true,"schema":{"type":"string","title":"Execution Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/manager/assign":{"post":{"tags":["Cortex Manager"],"summary":"Assign a task to an employee","description":"Manually dispatch a single task to a specific employee.  The employee\nprocesses the task via the LLM and returns the result.","operationId":"assign_task_api_manager_assign_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/manager/employees/recommend":{"get":{"tags":["Cortex Manager"],"summary":"Recommend the best employee for a task","description":"Given a task description (and optionally required skills), return the\nbest-matching employee based on specialization overlap scoring.","operationId":"recommend_employee_api_manager_employees_recommend_get","parameters":[{"name":"task","in":"query","required":true,"schema":{"type":"string","minLength":3,"maxLength":2000,"description":"Task description","title":"Task"},"description":"Task description"},{"name":"skills","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of required skills","title":"Skills"},"description":"Comma-separated list of required skills"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeRecommendation"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/manager/plans":{"get":{"tags":["Cortex Manager"],"summary":"List recent plans","description":"Return the caller's recent execution plans, most recent first.\n\nSECURITY: scoped to the caller's empire — was returning every tenant's\nplans and goals.","operationId":"list_plans_api_manager_plans_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/training/config":{"get":{"tags":["Call Training","Call Training"],"summary":"Get Training Config","description":"Return available scenario types, verticals, and difficulty levels.\n\nUse this to populate the scenario selector on the frontend.","operationId":"get_training_config_api_v1_training_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Training Config Api V1 Training Config Get"}}}}}}},"/api/v1/training/scenarios/generate":{"post":{"tags":["Call Training","Call Training"],"summary":"Generate Training Scenario","description":"Generate a training scenario.\n\nCombines SnowGlobe-style scenario generation with a DigitalTwin\npersonality profile calibrated to the requested difficulty level.","operationId":"generate_training_scenario_api_v1_training_scenarios_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateScenarioRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Generate Training Scenario Api V1 Training Scenarios Generate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/training/sessions/start":{"post":{"tags":["Call Training","Call Training"],"summary":"Start Training Session","description":"Start a training session for a previously generated scenario.\n\nThe twin will send an opening message. Use the session_id to\nexchange messages and eventually end the session.","operationId":"start_training_session_api_v1_training_sessions_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Start Training Session Api V1 Training Sessions Start Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/training/sessions/{session_id}/start-with-scenario":{"post":{"tags":["Call Training","Call Training"],"summary":"Start Session With Scenario","description":"Generate a scenario and start a session in one call.\n\nThe session_id path parameter is ignored (a new one is assigned).\nThis is a convenience endpoint for the frontend.","operationId":"start_session_with_scenario_api_v1_training_sessions__session_id__start_with_scenario_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateScenarioRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Start Session With Scenario Api V1 Training Sessions  Session Id  Start With Scenario Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/training/sessions/{session_id}/message":{"post":{"tags":["Call Training","Call Training"],"summary":"Send Training Message","description":"Send a message during a training session.\n\nReturns the twin's personality-driven response.","operationId":"send_training_message_api_v1_training_sessions__session_id__message_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__training_router__SendMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send Training Message Api V1 Training Sessions  Session Id  Message Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/training/sessions/{session_id}/end":{"post":{"tags":["Call Training","Call Training"],"summary":"End Training Session","description":"End a training session and return the full scorecard.\n\nReturns conversation intelligence analysis, objective evaluation,\ncomposite score (0-100), coaching recommendations, and\npersonality insights explaining how the twin's traits affected\nthe conversation.","operationId":"end_training_session_api_v1_training_sessions__session_id__end_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response End Training Session Api V1 Training Sessions  Session Id  End Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/training/history":{"get":{"tags":["Call Training","Call Training"],"summary":"Get Training History","description":"Get recent training session results.","operationId":"get_training_history_api_v1_training_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Training History Api V1 Training History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/training/leaderboard":{"get":{"tags":["Call Training","Call Training"],"summary":"Get Training Leaderboard","description":"Get training leaderboard -- scores sorted by performance.\n\nTracks improvement over time across scenario types and difficulties.","operationId":"get_training_leaderboard_api_v1_training_leaderboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Training Leaderboard Api V1 Training Leaderboard Get"}}}}}}},"/api/v1/orchestration/handoff-graph/{task_id}":{"get":{"tags":["Orchestration","Orchestration"],"summary":"Get the handoff graph for a task","description":"Return the collaboration handoff graph for a specific task or plan.\n\nThe graph shows which employees participated, what each contributed,\nthe handoff chain, and the critical path.","operationId":"get_handoff_graph_api_v1_orchestration_handoff_graph__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffGraphResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/orchestration/handoff-graphs":{"get":{"tags":["Orchestration","Orchestration"],"summary":"List recent handoff graphs","description":"Return recent handoff graphs, newest first.","operationId":"list_handoff_graphs_api_v1_orchestration_handoff_graphs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/orchestration/memory-mesh/propagate":{"post":{"tags":["Orchestration","Orchestration"],"summary":"Propagate an insight to related employees","description":"Share an insight from one employee with related employees.\n\nThe system determines recipients based on department affinity and\nimpact score:\n- Same department: always shared\n- Related departments: shared if impact >= 0.3\n- Cross-cutting: shared only if impact >= 0.7","operationId":"propagate_insight_api_v1_orchestration_memory_mesh_propagate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PropagateInsightRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PropagateInsightResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/orchestration/memory-mesh/insights/{employee_id}":{"get":{"tags":["Orchestration","Orchestration"],"summary":"Get insights shared with an employee","description":"Return insights for an employee.\n\n``direction=received`` returns insights shared with this employee.\n``direction=sent`` returns insights originated by this employee.","operationId":"get_employee_insights_api_v1_orchestration_memory_mesh_insights__employee_id__get","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string","pattern":"^(received|sent)$","default":"received","title":"Direction"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/orchestration/memory-mesh/stats":{"get":{"tags":["Orchestration","Orchestration"],"summary":"Memory mesh statistics","description":"Return summary statistics for the cross-employee memory mesh.","operationId":"get_mesh_stats_api_v1_orchestration_memory_mesh_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeshStatsResponse"}}}}}}},"/api/v1/orchestration/disagreement":{"post":{"tags":["Orchestration","Orchestration"],"summary":"Run an adversarial debate between two employees","description":"Start an adversarial debate between two employees on a given question.\n\nEach employee argues from their domain perspective across multiple\nrounds. The output includes initial positions, round-by-round\narguments, points of agreement/disagreement, and a final synthesis.","operationId":"run_disagreement_api_v1_orchestration_disagreement_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisagreementRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisagreementResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/orchestration/disagreement/{debate_id}":{"get":{"tags":["Orchestration","Orchestration"],"summary":"Retrieve a past debate","description":"Return a previously executed debate by its ID.","operationId":"get_debate_api_v1_orchestration_disagreement__debate_id__get","parameters":[{"name":"debate_id","in":"path","required":true,"schema":{"type":"string","title":"Debate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisagreementResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/orchestration/disagreements":{"get":{"tags":["Orchestration","Orchestration"],"summary":"List recent debates","description":"Return recent adversarial debates, newest first.","operationId":"list_debates_api_v1_orchestration_disagreements_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/incoming":{"post":{"tags":["Voice AI"],"summary":"Incoming Call","description":"Twilio webhook hit when an inbound call arrives.\nReturns TwiML that greets the caller and begins listening.","operationId":"incoming_call_api_voice_incoming_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_incoming_call_api_voice_incoming_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/conversation":{"post":{"tags":["Voice AI"],"summary":"Conversation Turn","description":"Called by Twilio after each speech recognition result.\nGenerates an AI response and continues the conversation.","operationId":"conversation_turn_api_voice_conversation_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_conversation_turn_api_voice_conversation_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/book-appointment":{"post":{"tags":["Voice AI"],"summary":"Book Appointment","description":"Book an appointment during or after a call.\nChecks availability (mock), records booking, sends SMS confirmation.","operationId":"book_appointment_api_voice_book_appointment_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/calls":{"get":{"tags":["Voice AI"],"summary":"List Calls","description":"Return the most recent calls with metadata.","operationId":"list_calls_api_voice_calls_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/calls/{call_sid}":{"get":{"tags":["Voice AI"],"summary":"Get Call","description":"Return full detail for a single call including conversation transcript.","operationId":"get_call_api_voice_calls__call_sid__get","parameters":[{"name":"call_sid","in":"path","required":true,"schema":{"type":"string","title":"Call Sid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/availability":{"get":{"tags":["Voice AI"],"summary":"Check Availability","description":"Return available appointment slots for a given date (mock).","operationId":"check_availability_api_voice_availability_get","parameters":[{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice-live/ticket":{"post":{"tags":["Voice Live"],"summary":"Create Voice Ticket","description":"Mint a single-use ticket binding a voice session to the caller.","operationId":"create_voice_ticket_api_voice_live_ticket_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTicketRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTicketResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/journeys/":{"post":{"tags":["journeys"],"summary":"Start Journey","description":"Start a new journey.","operationId":"start_journey_api_journeys__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartJourneyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journey"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["journeys"],"summary":"List Journeys","description":"List journeys, optionally filtered by type and/or state.","operationId":"list_journeys_api_journeys__get","parameters":[{"name":"journey_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/JourneyType"},{"type":"null"}],"description":"Filter by journey type","title":"Journey Type"},"description":"Filter by journey type"},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/JourneyState"},{"type":"null"}],"description":"Filter by journey state","title":"State"},"description":"Filter by journey state"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Journey"},"title":"Response List Journeys Api Journeys  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/journeys/{journey_id}":{"get":{"tags":["journeys"],"summary":"Get Journey","description":"Fetch a single journey by ID.","operationId":"get_journey_api_journeys__journey_id__get","parameters":[{"name":"journey_id","in":"path","required":true,"schema":{"type":"string","title":"Journey Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journey"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/journeys/{journey_id}/advance":{"post":{"tags":["journeys"],"summary":"Advance Journey","description":"Advance a journey into a new state.","operationId":"advance_journey_api_journeys__journey_id__advance_post","parameters":[{"name":"journey_id","in":"path","required":true,"schema":{"type":"string","title":"Journey Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceStateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journey"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/journeys/{journey_id}/cancel":{"post":{"tags":["journeys"],"summary":"Cancel Journey","description":"Cancel an in-flight journey.","operationId":"cancel_journey_api_journeys__journey_id__cancel_post","parameters":[{"name":"journey_id","in":"path","required":true,"schema":{"type":"string","title":"Journey Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelJourneyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journey"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intent/score":{"post":{"tags":["Intent Tracking","Intent Tracking"],"summary":"Score Visitor","description":"Score a visitor's buying intent from page visit history.\n\nAccepts a list of page visit events for a single visitor and returns\na 0-100 intent score with breakdown of contributing signals.\n\nAuthenticated: the scored profile is filed under the caller's tenant so\nthat /hot-visitors can be scoped on read. An unattributed write would be\nunreadable by anyone, so ingest must identify its owner.","operationId":"score_visitor_api_v1_intent_score_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitorIntentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitorIntentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/intent/hot-visitors":{"get":{"tags":["Intent Tracking","Intent Tracking"],"summary":"Get Hot Visitors","description":"List visitors with intent_score above the threshold.\n\nDefault threshold is 70 (ready_to_buy). These visitors should be\nprioritized for sales outreach.\n\nScoped to the authenticated caller's tenant. This endpoint previously\niterated the whole process-global profile store and returned every\ntenant's prospects to any unauthenticated caller.","operationId":"get_hot_visitors_api_v1_intent_hot_visitors_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"threshold","in":"query","required":false,"schema":{"type":"number","default":70.0,"title":"Threshold"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HotVisitorsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intent/event":{"post":{"tags":["Intent Tracking","Intent Tracking"],"summary":"Ingest Single Event","description":"Ingest a single page visit event.\n\nLightweight endpoint for the tracking pixel to call on each page view.\nEvents accumulate per visitor_id. Call /score to get the full profile.\n\nAuthenticated, and filed under the caller's tenant — see require_tenant_key.","operationId":"ingest_single_event_api_v1_intent_event_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"visitor_id","in":"query","required":true,"schema":{"type":"string","title":"Visitor Id"}},{"name":"url","in":"query","required":true,"schema":{"type":"string","title":"Url"}},{"name":"page_type","in":"query","required":true,"schema":{"type":"string","title":"Page Type"}},{"name":"duration_seconds","in":"query","required":false,"schema":{"type":"number","default":0.0,"title":"Duration Seconds"}},{"name":"referrer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referrer"}},{"name":"company_domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intent/visitor/{visitor_id}":{"get":{"tags":["Intent Tracking","Intent Tracking"],"summary":"Get Visitor Profile","description":"Retrieve the cached intent profile for a specific visitor.\n\nScoped to the caller's tenant: a visitor id belonging to another tenant is\na 404 here, not a disclosure.","operationId":"get_visitor_profile_api_v1_intent_visitor__visitor_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"visitor_id","in":"path","required":true,"schema":{"type":"string","title":"Visitor Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/VisitorIntentResponse"},{"type":"null"}],"title":"Response Get Visitor Profile Api V1 Intent Visitor  Visitor Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/email-coach/score":{"post":{"tags":["Email Coach"],"summary":"Score Email Endpoint","description":"Score an email draft with coaching recommendations.\n\nReturns per-dimension scores (0-1) and actionable feedback for:\n- Subject line effectiveness\n- Opening line strength\n- Value proposition clarity\n- Call-to-action specificity\n- Email length optimization\n- Tone appropriateness\n- Spam risk assessment\n\nPrioritized recommendations are sorted by biggest improvement opportunity.","operationId":"score_email_endpoint_api_v1_email_coach_score_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailScoreRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/email-coach/types":{"get":{"tags":["Email Coach"],"summary":"List Email Types","description":"List supported email types with their optimal configurations.","operationId":"list_email_types_api_v1_email_coach_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Email Types Api V1 Email Coach Types Get"}}}}}}},"/api/v1/weft/status":{"get":{"tags":["Weft Orchestration","Weft Orchestration"],"summary":"Check Weft integration status","description":"Return whether the Weft runtime is configured and reachable.","operationId":"get_weft_status_api_v1_weft_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WeftStatusResponse"}}}}}}},"/api/v1/weft/workflows":{"post":{"tags":["Weft Orchestration","Weft Orchestration"],"summary":"Create a new Weft workflow","description":"Create a new Weft workflow from a goal + employee selection.\n\nIf ``employees`` is omitted, the adapter uses the CortexManager's\nemployee selection logic to pick the best-fit employees for the goal.","operationId":"create_workflow_api_v1_weft_workflows_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__weft_router__CreateWorkflowRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__weft_router__WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Weft Orchestration","Weft Orchestration"],"summary":"List Weft workflows","description":"Return recent workflows, most recent first.","operationId":"list_workflows_api_v1_weft_workflows_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__weft_router__WorkflowListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/weft/workflows/{workflow_id}":{"get":{"tags":["Weft Orchestration","Weft Orchestration"],"summary":"Get workflow details","description":"Get workflow status and details by ID.","operationId":"get_workflow_api_v1_weft_workflows__workflow_id__get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__weft_router__WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/weft/workflows/{workflow_id}/execute":{"post":{"tags":["Weft Orchestration","Weft Orchestration"],"summary":"Submit workflow to Weft runtime","description":"Submit a previously created workflow to the Weft runtime for execution.\n\nRequires WEFT_API_URL to be configured.  If Weft is unavailable, returns\na 503 with a message suggesting to use the standard /api/manager/execute\nendpoint instead.","operationId":"execute_workflow_api_v1_weft_workflows__workflow_id__execute_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__weft_router__WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/weft/workflows/{workflow_id}/graph":{"get":{"tags":["Weft Orchestration","Weft Orchestration"],"summary":"Get workflow graph representation","description":"Get the visual graph representation of the workflow.\n\nParses the .weft program to extract nodes and edges for frontend\nrendering (e.g., React Flow, D3).","operationId":"get_workflow_graph_api_v1_weft_workflows__workflow_id__graph_get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowGraphResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/weft/employees/{employee_id}/execute":{"post":{"tags":["Weft Orchestration","Weft Orchestration"],"summary":"Execute a task on an employee (called by Weft)","description":"Called BY Weft HTTP nodes to dispatch tasks to LiquidCortex employees.\n\nThis is the bridge between the Weft runtime and the existing employee\nexecution pipeline.  The employee processes the task through the normal\nLLM orchestrator, methodologies, and memory systems.","operationId":"execute_employee_task_api_v1_weft_employees__employee_id__execute_post","parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeTaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates":{"get":{"tags":["Workflow Templates","Workflow Templates"],"summary":"List Templates","description":"List available workflow templates with optional filters.","operationId":"list_templates_api_v1_templates_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category (sales, finance, marketing, hr, legal, operations, customer_success, engineering)","title":"Category"},"description":"Filter by category (sales, finance, marketing, hr, legal, operations, customer_success, engineering)"},{"name":"vertical","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vertical (revops, retainiq, forum, shield, general)","title":"Vertical"},"description":"Filter by vertical (revops, retainiq, forum, shield, general)"},{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by tier accessibility (starter, manager, agency)","title":"Tier"},"description":"Filter by tier accessibility (starter, manager, agency)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/{template_id}":{"get":{"tags":["Workflow Templates","Workflow Templates"],"summary":"Get Template","description":"Get a single template by ID, including its Weft program source.","operationId":"get_template_api_v1_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/{template_id}/activate":{"post":{"tags":["Workflow Templates","Workflow Templates"],"summary":"Activate Template","description":"Activate a workflow template.\n\nCreates a WeftWorkflow from the template and submits it.\nIf Weft runtime is unavailable, returns the workflow in 'created' status\nfor client-side execution or manual review.","operationId":"activate_template_api_v1_templates__template_id__activate_post","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/custom-employees/catalog":{"get":{"tags":["Custom Employee Builder","Custom Employee Builder"],"summary":"Get builder catalog","description":"Return the full catalog of available capabilities, methodologies,\ndepartments, personality dimensions, and integrations for building\na custom employee.\n\nPublic: surfaces builder previews on marketing pages and upgrade\nprompts without requiring an Agency JWT.","operationId":"get_builder_catalog_api_v1_custom_employees_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/custom-employees/validate":{"post":{"tags":["Custom Employee Builder","Custom Employee Builder"],"summary":"Validate employee configuration","description":"Validate a custom employee configuration without creating it.\nReturns validation errors and warnings.\n\nAgency-tier only.","operationId":"validate_custom_employee_api_v1_custom_employees_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomEmployeeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/custom-employees":{"get":{"tags":["Custom Employee Builder","Custom Employee Builder"],"summary":"List custom employees","description":"List all custom employees created by the current user. Agency-tier only.","operationId":"list_custom_employees_api_v1_custom_employees_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Custom Employee Builder","Custom Employee Builder"],"summary":"Create custom employee","description":"Create a new custom AI employee from the given configuration.\n\nTier gating (enforced here): Agency-tier only.\nStarter / Manager tiers receive HTTP 403 with an upgrade prompt.","operationId":"create_custom_employee_api_v1_custom_employees_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomEmployeeRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/custom-employees/{employee_id}":{"get":{"tags":["Custom Employee Builder","Custom Employee Builder"],"summary":"Get custom employee","description":"Get details of a specific custom employee. Agency-tier only.","operationId":"get_custom_employee_api_v1_custom_employees__employee_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Custom Employee Builder","Custom Employee Builder"],"summary":"Update custom employee","description":"Update fields on an existing custom employee. Agency-tier only.","operationId":"update_custom_employee_api_v1_custom_employees__employee_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomEmployeeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Custom Employee Builder","Custom Employee Builder"],"summary":"Delete custom employee","description":"Delete a custom employee. Agency-tier only.","operationId":"delete_custom_employee_api_v1_custom_employees__employee_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/custom-employees/{employee_id}/test":{"post":{"tags":["Custom Employee Builder","Custom Employee Builder"],"summary":"Test custom employee","description":"Send a test message to a custom employee and get a response.\nUses the same LLM execution pipeline as built-in employees.\n\nAgency-tier only.","operationId":"test_custom_employee_api_v1_custom_employees__employee_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"employee_id","in":"path","required":true,"schema":{"type":"string","title":"Employee Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCustomEmployeeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/certification/courses":{"get":{"tags":["Certification & Training"],"summary":"List Courses","description":"List all available certification courses.\nReturns course summaries with module outlines (no full content).","operationId":"list_courses_api_v1_certification_courses_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseListResponse"}}}}}}},"/api/v1/certification/courses/{course_id}":{"get":{"tags":["Certification & Training"],"summary":"Get Course","description":"Get full course details including all module content.","operationId":"get_course_api_v1_certification_courses__course_id__get","parameters":[{"name":"course_id","in":"path","required":true,"schema":{"type":"string","title":"Course Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/certification/enroll":{"post":{"tags":["Certification & Training"],"summary":"Enroll","description":"Enroll a user in a certification course.\nIdempotent -- re-enrolling returns existing progress.","operationId":"enroll_api_v1_certification_enroll_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/certification/progress":{"get":{"tags":["Certification & Training"],"summary":"Get Progress","description":"Get a user's progress in a certification course.","operationId":"get_progress_api_v1_certification_progress_get","parameters":[{"name":"course_id","in":"query","required":true,"schema":{"type":"string","description":"Course ID","title":"Course Id"},"description":"Course ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/certification/modules/{module_id}/complete":{"post":{"tags":["Certification & Training"],"summary":"Complete Module","description":"Complete a module.  For quiz modules, include answers in the request body.\nReturns score and pass/fail for quizzes.  Returns certificate_id if this\ncompletes the entire course.","operationId":"complete_module_api_v1_certification_modules__module_id__complete_post","parameters":[{"name":"module_id","in":"path","required":true,"schema":{"type":"string","title":"Module Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleCompleteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/certification/certificate/{cert_id}":{"get":{"tags":["Certification & Training"],"summary":"Get Certificate","description":"Get certificate details by certificate ID.","operationId":"get_certificate_api_v1_certification_certificate__cert_id__get","parameters":[{"name":"cert_id","in":"path","required":true,"schema":{"type":"string","title":"Cert Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/certification/verify/{cert_id}":{"get":{"tags":["Certification & Training"],"summary":"Verify Certificate","description":"Public verification endpoint.  Anyone can verify a certificate\nusing the certificate ID (e.g., from a LinkedIn badge or resume).\nReturns validity status and certification details.","operationId":"verify_certificate_api_v1_certification_verify__cert_id__get","parameters":[{"name":"cert_id","in":"path","required":true,"schema":{"type":"string","title":"Cert Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/certification/consulting/request":{"post":{"tags":["Certification & Training"],"summary":"Request Consulting","description":"Submit a consulting engagement request.\nStores the request for follow-up by the sales team.","operationId":"request_consulting_api_v1_certification_consulting_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsultingRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/benchmark":{"post":{"tags":["Benchmark","admin","benchmark"],"summary":"Run Benchmark","description":"Run the full benchmark suite (or specific verticals).\n\nAvailable verticals:\n- forum\n- drug_interactions\n- citation_verification\n- denied_party_screening\n- health_scoring\n- procurement_scanning\n- tax_recovery\n\nReturns a full report with metrics, timings, and honest disclaimers.\nNo LLM calls are made -- all benchmarks use heuristic engines.","operationId":"run_benchmark_api_v1_admin_benchmark_post","parameters":[{"name":"verticals","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific verticals to benchmark. Omit to run all.","title":"Verticals"},"description":"Specific verticals to benchmark. Omit to run all."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/benchmark/info":{"get":{"tags":["Benchmark","admin","benchmark"],"summary":"Benchmark Info","description":"List available benchmark verticals and methodologies.","operationId":"benchmark_info_api_v1_admin_benchmark_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/governance/audit-trail/{execution_id}":{"get":{"tags":["AI Governance"],"summary":"Get audit trail for a workflow execution","description":"Export full decision audit trail for a specific workflow execution.\nReturns every decision made by AI employees during the execution,\nincluding methodology used, confidence, risk score, and data accessed.","operationId":"get_audit_trail_api_v1_governance_audit_trail__execution_id__get","parameters":[{"name":"execution_id","in":"path","required":true,"schema":{"type":"string","title":"Execution Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditTrailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/governance/compliance-report":{"post":{"tags":["AI Governance"],"summary":"Generate compliance report","description":"Generate a compliance report for the specified time period.\nIncludes compliance score, methodology distribution, risk events,\nand actionable recommendations.\n\nCompliance scores are self-assessed heuristics, not independently audited.","operationId":"generate_report_api_v1_governance_compliance_report_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceReportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/governance/risk-dashboard":{"get":{"tags":["AI Governance"],"summary":"Risk dashboard overview","description":"Aggregated risk dashboard data for governance teams.\nIncludes compliance score, risk distribution, recent risk events,\nhuman approval rate, and top-risk employees.\n\nAll metrics are self-assessed. Not independently audited.","operationId":"risk_dashboard_api_v1_governance_risk_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskDashboardResponse"}}}}}}},"/api/v1/governance/methodology-usage":{"get":{"tags":["AI Governance"],"summary":"Methodology usage report","description":"Report on which reasoning methodologies are used across all\nAI employee decisions. Useful for governance review of AI\ndecision-making patterns.","operationId":"methodology_usage_report_api_v1_governance_methodology_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodologyUsageResponse"}}}}}}},"/api/v1/governance/export":{"post":{"tags":["AI Governance"],"summary":"Export compliance data","description":"Export compliance audit data in JSON or CSV format.\nSupports filtering by time period and employee.","operationId":"export_compliance_data_api_v1_governance_export_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/governance/ai-act/classify/{operation}":{"get":{"tags":["AI Governance"],"summary":"Classify operation under EU AI Act","description":"Classify a specific operation against EU AI Act risk categories.\nReturns risk level, applicable articles, obligations, and recommendations.\n\nThis is a self-assessed classification, not a legal determination.","operationId":"classify_operation_api_v1_governance_ai_act_classify__operation__get","parameters":[{"name":"operation","in":"path","required":true,"schema":{"type":"string","title":"Operation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIActClassificationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/governance/ai-act/employees":{"get":{"tags":["AI Governance"],"summary":"EU AI Act risk map for all employees","description":"Return EU AI Act risk classifications for all AI employees.\nShows which employees operate in which risk categories based on\ntheir typical operation types.","operationId":"ai_act_employee_map_api_v1_governance_ai_act_employees_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/governance/entries":{"get":{"tags":["AI Governance"],"summary":"List audit entries with filters","description":"List governance audit entries with optional filtering.\nReturns most recent entries first.","operationId":"list_entries_api_v1_governance_entries_get","parameters":[{"name":"employee_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id"}},{"name":"period_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Start"}},{"name":"period_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period End"}},{"name":"vertical","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/governance/stats":{"get":{"tags":["AI Governance"],"summary":"Governance engine statistics","description":"Return governance engine operational statistics.","operationId":"governance_stats_api_v1_governance_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/onboarding":{"post":{"tags":["Onboarding","onboarding"],"summary":"Complete Onboarding","description":"Record that a user completed the onboarding wizard.\n\nCalled by the frontend when the user clicks \"Start Free Trial\"\non Step 4 of the onboarding flow.","operationId":"complete_onboarding_api_v1_onboarding_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingCompleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Complete Onboarding Api V1 Onboarding Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/email":{"post":{"tags":["Onboarding","onboarding"],"summary":"Send Onboarding Email","description":"Send a single onboarding email to a user.\n\nUseful for manual triggers or testing individual templates.","operationId":"send_onboarding_email_api_v1_onboarding_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Send Onboarding Email Api V1 Onboarding Email Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/sequence":{"post":{"tags":["Onboarding","onboarding"],"summary":"Schedule Onboarding Sequence","description":"Schedule the full 5-email onboarding drip sequence for a user.\n\nSends the Day-0 email immediately and returns the full schedule\nwith computed send dates.","operationId":"schedule_onboarding_sequence_api_v1_onboarding_sequence_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleSequenceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Schedule Onboarding Sequence Api V1 Onboarding Sequence Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/schedule":{"get":{"tags":["Onboarding","onboarding"],"summary":"Preview Schedule","description":"Preview the email schedule for a given signup date.\n\nQuery params:\n    signup_date: ISO-8601 datetime string (defaults to now).\n\nReturns the 5 emails with their computed send_at timestamps.","operationId":"preview_schedule_api_v1_onboarding_schedule_get","parameters":[{"name":"signup_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signup Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview Schedule Api V1 Onboarding Schedule Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/analytics":{"get":{"tags":["Onboarding","onboarding"],"summary":"Onboarding Analytics","description":"Track onboarding funnel: step completion, drop-off, time-to-value.\n\nReturns aggregate counts of each funnel event plus the\nemail send log from the OnboardingEmailService.","operationId":"onboarding_analytics_api_v1_onboarding_analytics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Onboarding Analytics Api V1 Onboarding Analytics Get"}}}}}}},"/api/observability/events":{"post":{"tags":["Observability Events"],"summary":"Ingest Events","description":"Accept a batch of events from the frontend.\n\nUnauthenticated by design — anonymous visitor events (signup funnel)\nfire before any token exists. Rate-limited by the global middleware.\n\nEach event flows through `capture()` which enqueues asynchronously;\nthe background flusher batches Postgres writes. We don't block on the\nDB here — return 202 Accepted immediately.","operationId":"ingest_events_api_observability_events_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventBatchIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/observability/events/funnel":{"get":{"tags":["Observability Events"],"summary":"Funnel","description":"Conversion rate from `from_event` to `to_event` within `window_hours`.\n\nA user counts as converted if their `to_event` fires within the window\nAFTER their first `from_event` in the same window.","operationId":"funnel_api_observability_events_funnel_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from_event","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":255,"title":"From Event"}},{"name":"to_event","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":255,"title":"To Event"}},{"name":"window_hours","in":"query","required":false,"schema":{"type":"integer","maximum":720,"minimum":1,"default":24,"title":"Window Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/observability/events/timeline":{"get":{"tags":["Observability Events"],"summary":"Timeline","description":"Daily count of `event` over the last `days` days.","operationId":"timeline_api_observability_events_timeline_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":255,"title":"Event"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":180,"minimum":1,"default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__routers__observability_events_router__TimelineResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/observability/events/count":{"get":{"tags":["Observability Events"],"summary":"Count","description":"Total count of all rows for `event` (no time filter).","operationId":"count_api_observability_events_count_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":255,"title":"Event"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/observability/errors":{"post":{"tags":["Observability"],"summary":"Capture a frontend error (no auth required)","operationId":"post_manual_error_api_observability_errors_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualErrorRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Observability"],"summary":"List error groups (admin only)","operationId":"list_errors_api_observability_errors_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(unresolved|investigating|resolved|ignored)$"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/observability/errors/{error_hash}":{"get":{"tags":["Observability"],"summary":"Get error detail by hash (admin only)","operationId":"get_error_detail_api_observability_errors__error_hash__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"error_hash","in":"path","required":true,"schema":{"type":"string","title":"Error Hash"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/observability/errors/{error_hash}/resolve":{"patch":{"tags":["Observability"],"summary":"Mark an error group as resolved (admin only)","operationId":"resolve_error_api_observability_errors__error_hash__resolve_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"error_hash","in":"path","required":true,"schema":{"type":"string","title":"Error Hash"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/observability/alerts":{"get":{"tags":["Observability"],"summary":"List alert rules (admin only)","operationId":"list_alert_rules_api_observability_alerts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"empire_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Empire Id"}},{"name":"enabled_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Enabled Only"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRulesListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Observability"],"summary":"Create alert rule (admin only)","operationId":"create_alert_rule_api_observability_alerts_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/observability/alerts/{rule_id}":{"patch":{"tags":["Observability"],"summary":"Update alert rule (admin only)","operationId":"update_alert_rule_api_observability_alerts__rule_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Observability"],"summary":"Delete alert rule (admin only)","operationId":"delete_alert_rule_api_observability_alerts__rule_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/observability/alerts/{rule_id}/test":{"post":{"tags":["Observability"],"summary":"Fire a test alert immediately (admin only)","operationId":"test_alert_rule_api_observability_alerts__rule_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/observability/alerts/{rule_id}/history":{"get":{"tags":["Observability"],"summary":"Recent firings of a rule (admin only)","operationId":"get_alert_history_api_observability_alerts__rule_id__history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","description":"Root endpoint","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/cortex-memory":{"get":{"tags":["Health"],"summary":"Health Cortex Memory","description":"Cortex Memory wiring health probe.\n\nTriggers (and reports) lazy-init of the CentralExecutive singleton. Safe\nto call repeatedly — first call may take longer (Postgres pool open),\nsubsequent calls return the cached snapshot.\n\nResponse:\n    - status: \"ok\" if the singleton is reachable, else \"degraded\"\n    - stores_active: list of stores wired to real substrate\n    - stores_stub: list of stores using Null* fallbacks (incl. Phase 5 stubs)\n    - embedding_client: \"openai\" or \"none\"\n    - error: optional last initialization error message","operationId":"health_cortex_memory_health_cortex_memory_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"ABTestRequest":{"properties":{"variants":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Variants"},"platform":{"type":"string","title":"Platform","default":"tiktok"},"target_demographics":{"additionalProperties":true,"type":"object","title":"Target Demographics"},"population_size":{"type":"integer","maximum":10000.0,"minimum":100.0,"title":"Population Size","default":1000}},"type":"object","title":"ABTestRequest","description":"Request body for POST /ab-test."},"AIActClassificationResponse":{"properties":{"risk_level":{"type":"string","title":"Risk Level"},"article_reference":{"type":"string","title":"Article Reference"},"annex_reference":{"type":"string","title":"Annex Reference"},"description":{"type":"string","title":"Description"},"obligations":{"items":{"type":"string"},"type":"array","title":"Obligations"},"requires_conformity_assessment":{"type":"boolean","title":"Requires Conformity Assessment"},"requires_transparency_notice":{"type":"boolean","title":"Requires Transparency Notice"},"requires_human_oversight":{"type":"boolean","title":"Requires Human Oversight"},"recommendations":{"items":{"type":"string"},"type":"array","title":"Recommendations"},"disclaimer":{"type":"string","title":"Disclaimer"}},"type":"object","required":["risk_level","article_reference","annex_reference","description","obligations","requires_conformity_assessment","requires_transparency_notice","requires_human_oversight","recommendations","disclaimer"],"title":"AIActClassificationResponse"},"APIKeyCreatedResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"key":{"type":"string","title":"Key"},"key_prefix":{"type":"string","title":"Key Prefix"},"key_type":{"type":"string","title":"Key Type"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"created_at":{"type":"string","title":"Created At"},"warning":{"type":"string","title":"Warning","default":"Store this key securely. It will not be shown again."}},"type":"object","required":["id","name","key","key_prefix","key_type","permissions","created_at"],"title":"APIKeyCreatedResponse","description":"Response when a new key is created (includes full key ONCE)"},"APIKeyListResponse":{"properties":{"keys":{"items":{"$ref":"#/components/schemas/src__api__routers__api_keys_router__APIKeyResponse"},"type":"array","title":"Keys"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["keys","total"],"title":"APIKeyListResponse","description":"List of API keys"},"APIKeyRequest":{"properties":{"email":{"type":"string","title":"Email"},"tier":{"$ref":"#/components/schemas/PricingTier","default":"starter"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["email"],"title":"APIKeyRequest"},"ActionEntry":{"properties":{"id":{"type":"string","title":"Id"},"employee_id":{"type":"string","title":"Employee Id"},"action":{"type":"string","title":"Action"},"timestamp":{"type":"string","title":"Timestamp"},"ncu_cost":{"type":"number","title":"Ncu Cost"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","employee_id","action","timestamp","ncu_cost","status"],"title":"ActionEntry"},"ActivateRequest":{"properties":{"inputs":{"additionalProperties":true,"type":"object","title":"Inputs","default":{}}},"type":"object","title":"ActivateRequest"},"ActivateResponse":{"properties":{"template_id":{"type":"string","title":"Template Id"},"workflow_id":{"type":"string","title":"Workflow Id"},"status":{"type":"string","title":"Status"},"weft_program":{"type":"string","title":"Weft Program"},"employees_involved":{"items":{"type":"string"},"type":"array","title":"Employees Involved"},"estimated_ncu":{"type":"integer","title":"Estimated Ncu"}},"type":"object","required":["template_id","workflow_id","status","weft_program","employees_involved","estimated_ncu"],"title":"ActivateResponse"},"ActivityItem":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"employee_id":{"type":"string","title":"Employee Id"},"employee_name":{"type":"string","title":"Employee Name"},"description":{"type":"string","title":"Description"},"timestamp":{"type":"string","title":"Timestamp"},"credits_used":{"type":"integer","title":"Credits Used"}},"type":"object","required":["id","type","employee_id","employee_name","description","timestamp","credits_used"],"title":"ActivityItem","description":"Activity feed item"},"ActivityResponse":{"properties":{"activities":{"items":{"$ref":"#/components/schemas/ActivityItem"},"type":"array","title":"Activities"}},"type":"object","required":["activities"],"title":"ActivityResponse","description":"Activity feed response"},"AdminLoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"AdminLoginRequest"},"AdminLoginResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In"},"admin":{"$ref":"#/components/schemas/AdminUserResponse"}},"type":"object","required":["access_token","expires_in","admin"],"title":"AdminLoginResponse"},"AdminRole":{"type":"string","enum":["superadmin","admin","operator","viewer","tester"],"title":"AdminRole"},"AdminUserCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"first_name":{"type":"string","maxLength":100,"minLength":1,"title":"First Name"},"last_name":{"type":"string","maxLength":100,"minLength":1,"title":"Last Name"},"role":{"$ref":"#/components/schemas/AdminRole","default":"viewer"},"custom_permissions":{"items":{"type":"string"},"type":"array","title":"Custom Permissions"},"is_active":{"type":"boolean","title":"Is Active","default":true},"password":{"type":"string","minLength":8,"title":"Password"}},"type":"object","required":["email","first_name","last_name","password"],"title":"AdminUserCreate"},"AdminUserResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"role":{"$ref":"#/components/schemas/AdminRole"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_login":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login"}},"type":"object","required":["id","email","first_name","last_name","role","permissions","is_active","created_at","last_login"],"title":"AdminUserResponse"},"AdminUserUpdate":{"properties":{"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"role":{"anyOf":[{"$ref":"#/components/schemas/AdminRole"},{"type":"null"}]},"custom_permissions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Custom Permissions"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"AdminUserUpdate"},"AdvanceStateRequest":{"properties":{"new_state":{"$ref":"#/components/schemas/JourneyState","description":"Target state to transition into"},"actor":{"type":"string","title":"Actor","description":"Actor performing the state transition"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional notes for the audit trail"}},"type":"object","required":["new_state","actor"],"title":"AdvanceStateRequest"},"AgentConfigUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature"},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"tools_enabled":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tools Enabled"},"knowledge_access":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Knowledge Access"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"shadow_mode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Shadow Mode"}},"type":"object","title":"AgentConfigUpdate"},"AlertHistoryItem":{"properties":{"id":{"type":"string","title":"Id"},"rule_id":{"type":"string","title":"Rule Id"},"fired_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fired At"},"matched_condition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Matched Condition"},"delivery_status":{"type":"string","title":"Delivery Status"},"delivery_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Response"}},"type":"object","required":["id","rule_id","delivery_status"],"title":"AlertHistoryItem"},"AlertHistoryResponse":{"properties":{"rule_id":{"type":"string","title":"Rule Id"},"history":{"items":{"$ref":"#/components/schemas/AlertHistoryItem"},"type":"array","title":"History"}},"type":"object","required":["rule_id","history"],"title":"AlertHistoryResponse"},"AlertRuleCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"rule_type":{"type":"string","title":"Rule Type"},"condition":{"additionalProperties":true,"type":"object","title":"Condition"},"destination":{"type":"string","title":"Destination"},"destination_config":{"additionalProperties":true,"type":"object","title":"Destination Config"},"empire_id":{"type":"string","title":"Empire Id","description":"UUID of the owning empire"},"cooldown_minutes":{"type":"integer","maximum":43200.0,"minimum":0.0,"title":"Cooldown Minutes","default":60},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["name","rule_type","condition","destination","destination_config","empire_id"],"title":"AlertRuleCreate"},"AlertRuleResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"rule_type":{"type":"string","title":"Rule Type"},"condition":{"additionalProperties":true,"type":"object","title":"Condition"},"destination":{"type":"string","title":"Destination"},"destination_config":{"additionalProperties":true,"type":"object","title":"Destination Config"},"enabled":{"type":"boolean","title":"Enabled"},"cooldown_minutes":{"type":"integer","title":"Cooldown Minutes"},"last_triggered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Triggered At"},"empire_id":{"type":"string","title":"Empire Id"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","name","rule_type","condition","destination","destination_config","enabled","cooldown_minutes","empire_id"],"title":"AlertRuleResponse"},"AlertRuleUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"condition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Condition"},"destination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination"},"destination_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Destination Config"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"cooldown_minutes":{"anyOf":[{"type":"integer","maximum":43200.0,"minimum":0.0},{"type":"null"}],"title":"Cooldown Minutes"}},"type":"object","title":"AlertRuleUpdate"},"AlertRulesListResponse":{"properties":{"rules":{"items":{"$ref":"#/components/schemas/AlertRuleResponse"},"type":"array","title":"Rules"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["rules","total"],"title":"AlertRulesListResponse"},"AlertTestResponse":{"properties":{"rule_id":{"type":"string","title":"Rule Id"},"matched":{"type":"boolean","title":"Matched"},"dispatched":{"type":"boolean","title":"Dispatched"},"delivery_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Status"},"delivery_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Response"}},"type":"object","required":["rule_id","matched","dispatched"],"title":"AlertTestResponse"},"AllPricingResponse":{"properties":{"tiers":{"items":{"$ref":"#/components/schemas/PricingTierResponse"},"type":"array","title":"Tiers"},"currency":{"type":"string","title":"Currency","default":"USD"},"credit_exchange_rates":{"additionalProperties":{"type":"integer"},"type":"object","title":"Credit Exchange Rates"},"last_updated":{"type":"string","title":"Last Updated"}},"type":"object","required":["tiers","credit_exchange_rates","last_updated"],"title":"AllPricingResponse"},"AllocateBudgetRequest":{"properties":{"employee_id":{"type":"string","title":"Employee Id","description":"Employee identifier (e.g., 'atlas')"},"employee_name":{"type":"string","title":"Employee Name","description":"Employee display name (e.g., 'Atlas')"},"ncu_amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Ncu Amount","description":"NCU budget to allocate per period"},"period":{"type":"string","title":"Period","description":"Budget period: daily, weekly, or monthly","default":"weekly"}},"type":"object","required":["employee_id","employee_name","ncu_amount"],"title":"AllocateBudgetRequest"},"AnalyticsComputeRequest":{"properties":{"org_id":{"type":"string","title":"Org Id"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"}},"type":"object","required":["org_id","period_start","period_end"],"title":"AnalyticsComputeRequest","description":"Request body to compute revenue analytics for a period."},"AnalyzeResponse":{"properties":{"query":{"type":"string","title":"Query"},"pages_retrieved":{"type":"integer","title":"Pages Retrieved"},"pages_extracted":{"type":"integer","title":"Pages Extracted"},"analysis":{"type":"string","title":"Analysis"},"cost_breakdown":{"additionalProperties":{"type":"number"},"type":"object","title":"Cost Breakdown"},"savings_vs_naive":{"additionalProperties":true,"type":"object","title":"Savings Vs Naive"}},"type":"object","required":["query","pages_retrieved","pages_extracted","analysis","cost_breakdown","savings_vs_naive"],"title":"AnalyzeResponse","description":"Response from document analysis"},"ApplyMergeIn":{"properties":{"approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By"}},"type":"object","title":"ApplyMergeIn"},"ApplySkillRequest":{"properties":{"skill_id":{"type":"string","title":"Skill Id","description":"ID of the skill to apply"},"employee_id":{"type":"string","title":"Employee Id","description":"ID of the employee applying the skill"},"customer_id":{"type":"string","title":"Customer Id","description":"ID of the customer (will be anonymized)"},"context":{"additionalProperties":true,"type":"object","title":"Context","description":"Context for skill application"}},"type":"object","required":["skill_id","employee_id","customer_id","context"],"title":"ApplySkillRequest","description":"Request to apply a skill to a new context","example":{"context":{"task_type":"meeting_scheduling","timezone":"PST"},"customer_id":"customer_67890","employee_id":"aria_002","skill_id":"abc123def456"}},"ApplySkillResponse":{"properties":{"skill_id":{"type":"string","title":"Skill Id"},"application_id":{"type":"string","title":"Application Id"},"template":{"type":"string","title":"Template"},"pattern":{"additionalProperties":true,"type":"object","title":"Pattern"},"preconditions":{"items":{"type":"string"},"type":"array","title":"Preconditions"},"success_criteria":{"items":{"type":"string"},"type":"array","title":"Success Criteria"},"confidence":{"type":"number","title":"Confidence"}},"type":"object","required":["skill_id","application_id","template","pattern","preconditions","success_criteria","confidence"],"title":"ApplySkillResponse","description":"Response from applying a skill","example":{"application_id":"app789xyz","confidence":0.85,"pattern":{"task_type":"meeting_scheduling"},"preconditions":["Verify context matches pattern"],"skill_id":"abc123def456","success_criteria":["Task completed successfully"],"template":"Approach: Propose 3 time options..."}},"AppointmentRequest":{"properties":{"call_sid":{"type":"string","title":"Call Sid"},"caller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Name"},"caller_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Phone"},"preferred_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Date"},"preferred_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Time"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["call_sid"],"title":"AppointmentRequest"},"AppointmentResponse":{"properties":{"appointment_id":{"type":"string","title":"Appointment Id"},"status":{"type":"string","title":"Status"},"slot":{"$ref":"#/components/schemas/AppointmentSlot"},"sms_sent":{"type":"boolean","title":"Sms Sent"},"message":{"type":"string","title":"Message"}},"type":"object","required":["appointment_id","status","slot","sms_sent","message"],"title":"AppointmentResponse"},"AppointmentSlot":{"properties":{"date":{"type":"string","title":"Date"},"time":{"type":"string","title":"Time"},"available":{"type":"boolean","title":"Available","default":true}},"type":"object","required":["date","time"],"title":"AppointmentSlot"},"ApprovalDetail":{"properties":{"approval_id":{"type":"string","title":"Approval Id"},"vertical":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"},"severity":{"type":"string","title":"Severity"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"requester_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requester Id"},"created_at":{"type":"string","title":"Created At"},"expires_at":{"type":"string","title":"Expires At"},"status":{"type":"string","title":"Status"},"context":{"additionalProperties":true,"type":"object","title":"Context"},"approver":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approver"},"decided_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decided At"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"execution":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Execution"}},"type":"object","required":["approval_id","severity","created_at","expires_at","status"],"title":"ApprovalDetail","description":"Full record — adds the raw action context dict."},"ApprovalRequest":{"properties":{"request_id":{"type":"string","title":"Request Id","description":"Approval request ID"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional approval notes"}},"type":"object","required":["request_id"],"title":"ApprovalRequest","description":"HITL approval request.\n\nThere is deliberately no `approver_id`. Who approved an action is the one\nfact an approval gate exists to record, so it comes from the verified JWT\nand can never be supplied by the caller."},"ApprovalSummary":{"properties":{"approval_id":{"type":"string","title":"Approval Id"},"vertical":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"},"severity":{"type":"string","title":"Severity"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"requester_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requester Id"},"created_at":{"type":"string","title":"Created At"},"expires_at":{"type":"string","title":"Expires At"},"status":{"type":"string","title":"Status"}},"type":"object","required":["approval_id","severity","created_at","expires_at","status"],"title":"ApprovalSummary","description":"Compact list row — enough to render the inbox card."},"AssignRequest":{"properties":{"employee_id":{"type":"string","maxLength":64,"minLength":1,"title":"Employee Id"},"task_description":{"type":"string","maxLength":4000,"minLength":3,"title":"Task Description"}},"type":"object","required":["employee_id","task_description"],"title":"AssignRequest","description":"Manually assign a single task to a specific employee."},"AssignResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"},"employee_id":{"type":"string","title":"Employee Id"},"status":{"type":"string","title":"Status"},"result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["task_id","employee_id","status"],"title":"AssignResponse"},"AudienceSimulationCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"demographics":{"additionalProperties":true,"type":"object","title":"Demographics"},"platform":{"type":"string","maxLength":50,"title":"Platform","default":"tiktok"},"twin_count":{"type":"integer","maximum":100000.0,"minimum":1.0,"title":"Twin Count","default":1000},"is_template":{"type":"boolean","title":"Is Template","default":true}},"type":"object","required":["name"],"title":"AudienceSimulationCreate","description":"Request body for creating a saved audience template."},"AudienceSimulationUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"demographics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Demographics"},"platform":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Platform"},"twin_count":{"anyOf":[{"type":"integer","maximum":100000.0,"minimum":1.0},{"type":"null"}],"title":"Twin Count"},"is_template":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Template"}},"type":"object","title":"AudienceSimulationUpdate","description":"Partial update for an existing audience template."},"AuditEntryResponse":{"properties":{"id":{"type":"string","title":"Id"},"timestamp":{"type":"string","title":"Timestamp"},"employee_id":{"type":"string","title":"Employee Id"},"employee_name":{"type":"string","title":"Employee Name"},"decision":{"type":"string","title":"Decision"},"reasoning_methodology":{"type":"string","title":"Reasoning Methodology"},"input_data_summary":{"type":"string","title":"Input Data Summary"},"output_summary":{"type":"string","title":"Output Summary"},"confidence":{"type":"number","title":"Confidence"},"human_approved":{"type":"boolean","title":"Human Approved"},"data_accessed":{"items":{"type":"string"},"type":"array","title":"Data Accessed"},"execution_id":{"type":"string","title":"Execution Id"},"risk_score":{"type":"number","title":"Risk Score"},"processing_time_ms":{"type":"integer","title":"Processing Time Ms"},"tokens_used":{"type":"integer","title":"Tokens Used"},"compliance_flags":{"items":{"type":"string"},"type":"array","title":"Compliance Flags"}},"type":"object","required":["id","timestamp","employee_id","employee_name","decision","reasoning_methodology","input_data_summary","output_summary","confidence","human_approved","data_accessed","execution_id","risk_score","processing_time_ms","tokens_used","compliance_flags"],"title":"AuditEntryResponse"},"AuditTrailResponse":{"properties":{"execution_id":{"type":"string","title":"Execution Id"},"total_decisions":{"type":"integer","title":"Total Decisions"},"entries":{"items":{"$ref":"#/components/schemas/AuditEntryResponse"},"type":"array","title":"Entries"},"exported_at":{"type":"string","title":"Exported At"},"disclaimer":{"type":"string","title":"Disclaimer"}},"type":"object","required":["execution_id","total_decisions","entries","exported_at","disclaimer"],"title":"AuditTrailResponse"},"AuthResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"},"user":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User"}},"type":"object","required":["success","message"],"title":"AuthResponse","description":"Authentication response"},"AuthedChatBody":{"properties":{"message":{"type":"string","minLength":1,"title":"Message"},"conversation_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Conversation Id"}},"type":"object","required":["message"],"title":"AuthedChatBody"},"AutonomousSettingsRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"budget_ncu":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Budget Ncu"},"autonomy_mode":{"type":"string","title":"Autonomy Mode","default":"co_pilot"},"report_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Email"}},"type":"object","required":["enabled"],"title":"AutonomousSettingsRequest"},"BYOKSetupRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"provider":{"type":"string","title":"Provider"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["email","provider","api_key"],"title":"BYOKSetupRequest","description":"BYOK configuration request"},"BatchTestRequest":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"difficulty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Difficulty"}},"type":"object","required":["employee_id"],"title":"BatchTestRequest","description":"Request to run batch tests."},"Battlecard":{"properties":{"battlecard_id":{"type":"string","format":"uuid","title":"Battlecard Id"},"tenant_id":{"type":"string","minLength":1,"title":"Tenant Id"},"competitor":{"$ref":"#/components/schemas/CompetitorProfile"},"our_advantages":{"items":{"type":"string"},"type":"array","title":"Our Advantages"},"common_objections":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Common Objections"},"landmines_to_avoid":{"items":{"type":"string"},"type":"array","title":"Landmines To Avoid"},"proof_points":{"items":{"type":"string"},"type":"array","title":"Proof Points"},"display_priority":{"type":"integer","enum":[1,2,3],"title":"Display Priority","default":1},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"notable"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["tenant_id","competitor","our_advantages","common_objections","landmines_to_avoid","proof_points"],"title":"Battlecard","description":"Deterministic battlecard. Every field is heuristically derivable."},"BattlecardListResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/Battlecard"},"type":"array","title":"Items"}},"type":"object","required":["tenant_id","page","page_size","count","items"],"title":"BattlecardListResponse","description":"Paginated battlecard list. ``tenant_id`` echoes the scope the server\nresolved from the caller's token — it is never what the caller asked for."},"BehavioralDriftRequest":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"entity_type":{"type":"string","title":"Entity Type","default":"user"},"session_events":{"items":{"$ref":"#/components/schemas/SessionEvent"},"type":"array","title":"Session Events"},"baseline":{"$ref":"#/components/schemas/SessionBaseline"},"current_geo_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Geo Region"},"login_hour_utc":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Login Hour Utc"},"typing_speed_cpm":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Typing Speed Cpm"},"context":{"additionalProperties":true,"type":"object","title":"Context"}},"type":"object","required":["entity_id"],"title":"BehavioralDriftRequest","description":"Request body for the behavioral-drift endpoint."},"BehavioralSignals":{"properties":{"session_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Session Duration Seconds"},"pages_visited":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages Visited"},"typical_session_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Typical Session Duration Seconds"},"typical_pages_visited":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Typical Pages Visited"},"login_hour_utc":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Login Hour Utc"},"typical_login_hours":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Typical Login Hours"},"geo_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geo Region"},"typical_geo_regions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Typical Geo Regions"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"known_user_agents":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Known User Agents"}},"type":"object","title":"BehavioralSignals","description":"Session-level behavioral signals."},"BlogAuthor":{"properties":{"name":{"type":"string","title":"Name"},"avatar":{"type":"string","title":"Avatar"},"role":{"type":"string","title":"Role"}},"type":"object","required":["name","avatar","role"],"title":"BlogAuthor","description":"Blog post author information"},"BlogListResponse":{"properties":{"posts":{"items":{"$ref":"#/components/schemas/BlogPostSummary"},"type":"array","title":"Posts"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["posts","total","page","per_page","has_more"],"title":"BlogListResponse","description":"Response for blog list endpoint"},"BlogPost":{"properties":{"id":{"type":"string","title":"Id"},"slug":{"type":"string","title":"Slug"},"title":{"type":"string","title":"Title"},"excerpt":{"type":"string","title":"Excerpt"},"content":{"type":"string","title":"Content"},"author":{"$ref":"#/components/schemas/BlogAuthor"},"published_at":{"type":"string","title":"Published At"},"read_time":{"type":"string","title":"Read Time"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"category":{"type":"string","title":"Category"},"featured_image":{"type":"string","title":"Featured Image"},"featured":{"type":"boolean","title":"Featured","default":false}},"type":"object","required":["id","slug","title","excerpt","content","author","published_at","read_time","tags","category","featured_image"],"title":"BlogPost","description":"Blog post data structure"},"BlogPostSummary":{"properties":{"id":{"type":"string","title":"Id"},"slug":{"type":"string","title":"Slug"},"title":{"type":"string","title":"Title"},"excerpt":{"type":"string","title":"Excerpt"},"author":{"$ref":"#/components/schemas/BlogAuthor"},"published_at":{"type":"string","title":"Published At"},"read_time":{"type":"string","title":"Read Time"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"category":{"type":"string","title":"Category"},"featured_image":{"type":"string","title":"Featured Image"},"featured":{"type":"boolean","title":"Featured","default":false}},"type":"object","required":["id","slug","title","excerpt","author","published_at","read_time","tags","category","featured_image"],"title":"BlogPostSummary","description":"Blog post summary for listing"},"Body_analyze_documents_api_documents_analyze_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"Document to analyze"}},"type":"object","required":["file"],"title":"Body_analyze_documents_api_documents_analyze_post"},"Body_call_status_api_voice_status_post":{"properties":{"CallSid":{"type":"string","title":"Callsid","default":""},"CallStatus":{"type":"string","title":"Callstatus","default":""},"CallDuration":{"type":"string","title":"Callduration","default":"0"},"From":{"type":"string","title":"From","default":""},"To":{"type":"string","title":"To","default":""}},"type":"object","title":"Body_call_status_api_voice_status_post"},"Body_conversation_turn_api_voice_conversation_post":{"properties":{"CallSid":{"type":"string","title":"Callsid","default":""},"SpeechResult":{"type":"string","title":"Speechresult","default":""},"Confidence":{"type":"string","title":"Confidence","default":"0"}},"type":"object","title":"Body_conversation_turn_api_voice_conversation_post"},"Body_extract_document_api_documents_extract_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"Document file (PDF, PNG, JPG)"}},"type":"object","required":["file"],"title":"Body_extract_document_api_documents_extract_post"},"Body_incoming_call_api_voice_incoming_post":{"properties":{"CallSid":{"type":"string","title":"Callsid","default":""},"From":{"type":"string","title":"From","default":""},"To":{"type":"string","title":"To","default":""},"CallStatus":{"type":"string","title":"Callstatus","default":""}},"type":"object","title":"Body_incoming_call_api_voice_incoming_post"},"Body_index_document_api_documents_index_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"Document to index (PDF or image)"}},"type":"object","required":["file"],"title":"Body_index_document_api_documents_index_post"},"Body_store_output_artifact_api_files_output_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"Employee-produced artifact (any mime)"}},"type":"object","required":["file"],"title":"Body_store_output_artifact_api_files_output_post"},"Body_upload_document_api_knowledge_documents_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"Document file (PDF, DOCX, TXT, MD)"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"Deprecated and IGNORED - the owner is taken from the access token","deprecated":true},"metadata":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata","description":"JSON metadata string"}},"type":"object","required":["file"],"title":"Body_upload_document_api_knowledge_documents_post"},"Body_upload_file_api_files_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"PDF file (<= 20 MB)"}},"type":"object","required":["file"],"title":"Body_upload_file_api_files_upload_post"},"BriefRequest":{"properties":{"task_id":{"type":"string","maxLength":200,"minLength":1,"title":"Task Id"},"task_type":{"type":"string","maxLength":200,"minLength":1,"title":"Task Type"},"agent_id":{"type":"string","maxLength":200,"minLength":1,"title":"Agent Id","description":"Your identifier for the agent making the request."},"description":{"type":"string","maxLength":10000,"minLength":1,"title":"Description"},"context":{"additionalProperties":true,"type":"object","title":"Context"},"trust_level":{"type":"string","title":"Trust Level","description":"'untrusted' if this task's input came from an untrusted source (e.g. scraped web content). Lessons distilled from untrusted tasks are down-weighted at retrieval time.","default":"trusted"}},"additionalProperties":false,"type":"object","required":["task_id","task_type","agent_id","description"],"title":"BriefRequest","description":"Pre-task retrieval input. Deliberately has no empire_id field."},"CalibrateIn":{"properties":{"history":{"items":{"$ref":"#/components/schemas/HistoryPoint"},"type":"array","title":"History"},"max_score":{"type":"number","title":"Max Score","default":1.0}},"type":"object","required":["history"],"title":"CalibrateIn"},"CallTranscript":{"properties":{"transcript_id":{"type":"string","format":"uuid","title":"Transcript Id"},"deal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal Id"},"customer_id":{"type":"string","title":"Customer Id"},"speakers":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Speakers"},"utterances":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Utterances"},"duration_seconds":{"type":"integer","title":"Duration Seconds"},"recorded_at":{"type":"string","format":"date-time","title":"Recorded At"}},"type":"object","required":["customer_id","speakers","utterances","duration_seconds"],"title":"CallTranscript","description":"A customer call transcript ready for analysis."},"CallTranscriptRequest":{"properties":{"transcript":{"items":{"$ref":"#/components/schemas/TranscriptTurn"},"type":"array","title":"Transcript"},"known_competitors":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Known Competitors"},"deal_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal Stage"},"deal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal Id"}},"type":"object","required":["transcript"],"title":"CallTranscriptRequest","description":"Request body for call transcript analysis."},"CallbackResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"integration_id":{"type":"string","title":"Integration Id"},"connection_id":{"type":"string","title":"Connection Id"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","integration_id","connection_id","message"],"title":"CallbackResponse","description":"Response for OAuth callback"},"CancelJourneyRequest":{"properties":{"actor":{"type":"string","title":"Actor","description":"Actor cancelling the journey"},"reason":{"type":"string","title":"Reason","description":"Reason for cancellation"}},"type":"object","required":["actor","reason"],"title":"CancelJourneyRequest"},"CancelRequest":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Cancellation reason"},"cancel_immediately":{"type":"boolean","title":"Cancel Immediately","description":"Cancel now vs end of period","default":false}},"type":"object","title":"CancelRequest"},"CatalogInfo":{"properties":{"name":{"type":"string","title":"Name"},"version":{"type":"string","title":"Version"},"description":{"type":"string","title":"Description"},"component_count":{"type":"integer","title":"Component Count"},"components":{"items":{"type":"string"},"type":"array","title":"Components"}},"type":"object","required":["name","version","description","component_count","components"],"title":"CatalogInfo","description":"Information about a component catalog."},"ChatHistoryMessage":{"properties":{"id":{"type":"string","title":"Id"},"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"},"employee_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id"},"model_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Used"},"tokens_input":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens Input"},"tokens_output":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens Output"},"cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Usd"},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency Ms"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","role","content","employee_id","model_used","tokens_input","tokens_output","cost_usd","latency_ms","created_at"],"title":"ChatHistoryMessage","description":"Message in chat history"},"ChatHistoryResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"employee_id":{"type":"string","title":"Employee Id"},"employee_name":{"type":"string","title":"Employee Name"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"messages":{"items":{"$ref":"#/components/schemas/ChatHistoryMessage"},"type":"array","title":"Messages"},"message_count":{"type":"integer","title":"Message Count"},"created_at":{"type":"string","title":"Created At"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message At"}},"type":"object","required":["session_id","employee_id","employee_name","title","messages","message_count","created_at","last_message_at"],"title":"ChatHistoryResponse","description":"Response with chat history"},"ChatMessageRequest":{"properties":{"employee_id":{"type":"string","title":"Employee Id","description":"ID of the AI employee to chat with"},"messages":{"items":{"$ref":"#/components/schemas/src__api__routers__chat_router__ChatMessage"},"type":"array","title":"Messages","description":"Conversation history"},"stream":{"type":"boolean","title":"Stream","description":"Enable streaming response","default":true},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Existing session ID"},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","default":0.7},"max_tokens":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Tokens"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email","description":"User email for credit tracking"}},"type":"object","required":["employee_id","messages"],"title":"ChatMessageRequest","description":"Request to send a chat message"},"ChatResponse":{"properties":{"response":{"type":"string","title":"Response"},"sources":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sources"},"handoff_to_email":{"type":"boolean","title":"Handoff To Email","default":false},"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["response","session_id"],"title":"ChatResponse","description":"Common response shape for both surfaces."},"ChatSessionRequest":{"properties":{"employee_id":{"type":"string","title":"Employee Id","description":"ID of the AI employee"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Optional session title"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Initial context"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID for session"}},"type":"object","required":["employee_id"],"title":"ChatSessionRequest","description":"Request to create a new chat session"},"ChatSessionResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"employee_id":{"type":"string","title":"Employee Id"},"employee_name":{"type":"string","title":"Employee Name"},"employee_role":{"type":"string","title":"Employee Role"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"created_at":{"type":"string","title":"Created At"},"status":{"type":"string","title":"Status"}},"type":"object","required":["session_id","employee_id","employee_name","employee_role","title","created_at","status"],"title":"ChatSessionResponse","description":"Response with session details"},"ChunkResult":{"properties":{"chunk_id":{"type":"string","title":"Chunk Id"},"document_id":{"type":"string","title":"Document Id"},"document_name":{"type":"string","title":"Document Name"},"content":{"type":"string","title":"Content"},"chunk_index":{"type":"integer","title":"Chunk Index"},"similarity":{"type":"number","title":"Similarity"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","default":{}}},"type":"object","required":["chunk_id","document_id","document_name","content","chunk_index","similarity"],"title":"ChunkResult","description":"Single chunk result from search"},"CompanyEnrichmentRequest":{"properties":{"company_name":{"type":"string","maxLength":500,"minLength":1,"title":"Company Name","description":"Company name to enrich"},"domain":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Domain","description":"Company domain (e.g. acme.io)"}},"type":"object","required":["company_name"],"title":"CompanyEnrichmentRequest"},"CompetitorProfile":{"properties":{"competitor_id":{"type":"string","title":"Competitor Id"},"name":{"type":"string","title":"Name"},"strengths":{"items":{"type":"string"},"type":"array","title":"Strengths"},"weaknesses":{"items":{"type":"string"},"type":"array","title":"Weaknesses"},"pricing_tier":{"type":"string","enum":["below","parity","premium"],"title":"Pricing Tier","default":"parity"},"win_rate_against":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Win Rate Against","default":0.5}},"type":"object","required":["competitor_id","name"],"title":"CompetitorProfile","description":"Structured competitor record. Source of truth for battlecard generation."},"CompletionRequest":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/MessageModel"},"type":"array","title":"Messages"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","default":0.7},"max_tokens":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Tokens"},"top_p":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Top P","default":1.0},"stream":{"type":"boolean","title":"Stream","default":false}},"type":"object","required":["messages"],"title":"CompletionRequest"},"CompletionResponse":{"properties":{"content":{"type":"string","title":"Content"},"model":{"type":"string","title":"Model"},"provider":{"type":"string","title":"Provider"},"tier":{"type":"string","title":"Tier"},"usage":{"additionalProperties":{"type":"integer"},"type":"object","title":"Usage"},"cost":{"type":"number","title":"Cost"},"latency_ms":{"type":"number","title":"Latency Ms"},"cached":{"type":"boolean","title":"Cached"},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finish Reason"},"timestamp":{"type":"string","title":"Timestamp"}},"type":"object","required":["content","model","provider","tier","usage","cost","latency_ms","cached","finish_reason","timestamp"],"title":"CompletionResponse"},"ComplianceDashboard":{"properties":{"overall_compliance_rate":{"type":"number","title":"Overall Compliance Rate"},"overall_validation_rate":{"type":"number","title":"Overall Validation Rate"},"total_decisions":{"type":"integer","title":"Total Decisions"},"decisions_last_7d":{"type":"integer","title":"Decisions Last 7D"},"avg_risk_score":{"type":"number","title":"Avg Risk Score"},"by_employee":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"By Employee"},"trend":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Trend"}},"type":"object","required":["overall_compliance_rate","overall_validation_rate","total_decisions","decisions_last_7d","avg_risk_score","by_employee","trend"],"title":"ComplianceDashboard"},"ComplianceReport":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"report_type":{"type":"string","title":"Report Type"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"summary":{"additionalProperties":true,"type":"object","title":"Summary"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["id","tenant_id","report_type","period_start","period_end"],"title":"ComplianceReport","description":"A generated compliance report for a tenant."},"ComplianceReportRequest":{"properties":{"period_start":{"type":"string","title":"Period Start","description":"ISO datetime for report period start"},"period_end":{"type":"string","title":"Period End","description":"ISO datetime for report period end"},"vertical":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical","description":"Compliance vertical filter (e.g. finance, hr)"},"format":{"type":"string","title":"Format","description":"Export format: json or csv","default":"json"}},"type":"object","required":["period_start","period_end"],"title":"ComplianceReportRequest"},"ComplianceReportResponse":{"properties":{"report_id":{"type":"string","title":"Report Id"},"generated_at":{"type":"string","title":"Generated At"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"},"vertical":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"},"total_decisions":{"type":"integer","title":"Total Decisions"},"human_approved_count":{"type":"integer","title":"Human Approved Count"},"auto_approved_count":{"type":"integer","title":"Auto Approved Count"},"methodology_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Methodology Distribution"},"risk_events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Risk Events"},"data_access_summary":{"additionalProperties":{"type":"integer"},"type":"object","title":"Data Access Summary"},"compliance_score":{"type":"number","title":"Compliance Score"},"recommendations":{"items":{"type":"string"},"type":"array","title":"Recommendations"},"disclaimer":{"type":"string","title":"Disclaimer"}},"type":"object","required":["report_id","generated_at","period_start","period_end","vertical","total_decisions","human_approved_count","auto_approved_count","methodology_distribution","risk_events","data_access_summary","compliance_score","recommendations","disclaimer"],"title":"ComplianceReportResponse"},"ComposeRequest":{"properties":{"employee_id":{"type":"string","title":"Employee Id","description":"AI employee ID"},"query":{"type":"string","title":"Query","description":"User's query/prompt"},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Data to visualize"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Additional context"}},"type":"object","required":["employee_id","query","data"],"title":"ComposeRequest","description":"Request to compose an A2UI response."},"ConnectRequest":{"properties":{"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},"type":"object","title":"ConnectRequest","description":"Request to initiate OAuth connection"},"ConnectResponse":{"properties":{"auth_url":{"type":"string","title":"Auth Url"},"message":{"type":"string","title":"Message"}},"type":"object","required":["auth_url","message"],"title":"ConnectResponse","description":"Response for OAuth initiation"},"ConnectionResponse":{"properties":{"id":{"type":"string","title":"Id"},"integration_id":{"type":"string","title":"Integration Id"},"provider":{"type":"string","title":"Provider"},"integration_type":{"type":"string","title":"Integration Type"},"status":{"type":"string","title":"Status"},"connected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected At"},"workspace_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Name"}},"type":"object","required":["id","integration_id","provider","integration_type","status"],"title":"ConnectionResponse","description":"User integration connection"},"ConnectionsListResponse":{"properties":{"connections":{"items":{"$ref":"#/components/schemas/ConnectionResponse"},"type":"array","title":"Connections"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["connections","total"],"title":"ConnectionsListResponse","description":"List of user connections"},"Connotation":{"type":"string","enum":["positive","negative","neutral"],"title":"Connotation","description":"Sentiment direction of a label."},"ConsentBasis":{"type":"string","enum":["express","implied_purchase","implied_inquiry","conspicuous_publication","b2b_relationship","none"],"title":"ConsentBasis"},"ConsentIn":{"properties":{"email":{"type":"string","title":"Email"},"basis":{"$ref":"#/components/schemas/ConsentBasis"},"obtained_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Obtained At"},"source":{"type":"string","title":"Source","default":""},"evidence":{"type":"string","title":"Evidence","default":""}},"type":"object","required":["email","basis"],"title":"ConsentIn"},"ConsultingRequestBody":{"properties":{"company_name":{"type":"string","maxLength":200,"minLength":1,"title":"Company Name"},"contact_name":{"type":"string","maxLength":100,"minLength":1,"title":"Contact Name"},"contact_email":{"type":"string","maxLength":200,"minLength":5,"title":"Contact Email"},"engagement_type":{"type":"string","title":"Engagement Type","description":"team_training | custom_employee | safety_audit | workflow_design"},"team_size":{"type":"integer","maximum":10000.0,"minimum":1.0,"title":"Team Size"},"description":{"type":"string","maxLength":5000,"minLength":10,"title":"Description"},"budget_range":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Budget Range"}},"type":"object","required":["company_name","contact_name","contact_email","engagement_type","team_size","description"],"title":"ConsultingRequestBody"},"ContactEnrichmentRequest":{"properties":{"email":{"type":"string","maxLength":500,"minLength":3,"title":"Email","description":"Contact email address"},"name":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Name","description":"Contact full name"}},"type":"object","required":["email"],"title":"ContactEnrichmentRequest"},"ContactFormRequest":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"subject":{"type":"string","title":"Subject","default":"general"},"message":{"type":"string","title":"Message"}},"type":"object","required":["name","email","message"],"title":"ContactFormRequest","description":"Contact form submission data"},"ContactFormResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"reference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Id"}},"type":"object","required":["success","message"],"title":"ContactFormResponse","description":"Contact form response"},"ContentArtifact":{"properties":{"artifact_id":{"type":"string","format":"uuid","title":"Artifact Id"},"pipeline_id":{"type":"string","title":"Pipeline Id"},"title":{"type":"string","title":"Title"},"current_stage_id":{"type":"string","title":"Current Stage Id"},"history":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"History"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"target_publish_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Target Publish At"},"status":{"type":"string","enum":["in_progress","blocked","stuck","published","archived"],"title":"Status","default":"in_progress"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["pipeline_id","title","current_stage_id"],"title":"ContentArtifact","description":"A unit of content (post, video, carousel, etc.) flowing through stages.\n\nhistory: ordered list of {stage_id, entered_at, exited_at, exited_by}.\nAppend-only; the most recent entry is \"open\" (no exited_at) iff status\nis in_progress / blocked / stuck."},"ContentPipeline":{"properties":{"pipeline_id":{"type":"string","title":"Pipeline Id"},"empire_id":{"type":"string","title":"Empire Id"},"creator_id":{"type":"string","title":"Creator Id"},"name":{"type":"string","title":"Name"},"stages":{"items":{"$ref":"#/components/schemas/PipelineStage"},"type":"array","title":"Stages"},"transitions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Transitions"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["pipeline_id","empire_id","creator_id","name","stages"],"title":"ContentPipeline","description":"A customer's full pipeline definition (stages + valid transitions).\n\ntransitions: list of {from: stage_id, to: stage_id, condition: str|None}.\nStored as dicts (not a typed model) so customers can attach arbitrary\nbranching rules without us re-deploying the schema."},"ContextRequest":{"properties":{"query":{"type":"string","minLength":1,"title":"Query","description":"User's message/query"},"top_k":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Top K","description":"Number of context chunks","default":3},"similarity_threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Similarity Threshold","default":0.75}},"type":"object","required":["query"],"title":"ContextRequest","description":"Request for RAG context retrieval"},"ContextResponse":{"properties":{"context":{"type":"string","title":"Context"},"chunks_used":{"type":"integer","title":"Chunks Used"},"sources":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Sources"}},"type":"object","required":["context","chunks_used","sources"],"title":"ContextResponse","description":"RAG context for injection into chat"},"ConversationDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"employee_id":{"type":"string","title":"Employee Id"},"employee_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Name"},"employee_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Role"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"status":{"type":"string","title":"Status"},"message_count":{"type":"integer","title":"Message Count"},"total_credits_used":{"type":"integer","title":"Total Credits Used"},"total_tokens_used":{"type":"integer","title":"Total Tokens Used"},"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"messages":{"items":{"$ref":"#/components/schemas/ChatHistoryMessage"},"type":"array","title":"Messages"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message At"}},"type":"object","required":["id","user_id","employee_id","employee_name","employee_role","title","summary","status","message_count","total_credits_used","total_tokens_used","total_cost_usd","messages","created_at","updated_at","last_message_at"],"title":"ConversationDetailResponse","description":"Full conversation with messages"},"ConversationIn":{"properties":{"url":{"type":"string","maxLength":2000,"minLength":8,"title":"Url"},"title":{"type":"string","maxLength":600,"minLength":1,"title":"Title"},"excerpt":{"type":"string","maxLength":4000,"title":"Excerpt","default":""},"community":{"type":"string","maxLength":200,"title":"Community","default":""},"source":{"type":"string","maxLength":40,"title":"Source","default":"reddit"}},"type":"object","required":["url","title"],"title":"ConversationIn"},"ConversationInsightsReport":{"properties":{"report_id":{"type":"string","format":"uuid","title":"Report Id"},"transcript":{"$ref":"#/components/schemas/CallTranscript"},"objections":{"items":{"$ref":"#/components/schemas/ObjectionEvent"},"type":"array","title":"Objections"},"deal_signals":{"items":{"$ref":"#/components/schemas/DealSignal"},"type":"array","title":"Deal Signals"},"buyer_intent_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Buyer Intent Score"},"sentiment_trajectory":{"items":{"type":"number"},"type":"array","title":"Sentiment Trajectory"},"talk_ratio_rep_to_buyer":{"type":"number","title":"Talk Ratio Rep To Buyer"},"rep_questions_asked":{"type":"integer","title":"Rep Questions Asked"},"next_best_action":{"type":"string","title":"Next Best Action"},"display_priority":{"type":"integer","enum":[1,2,3],"title":"Display Priority","default":1},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"notable"},"chart_hint":{"type":"string","const":"sparkline","title":"Chart Hint","default":"sparkline"}},"type":"object","required":["transcript","objections","deal_signals","buyer_intent_score","sentiment_trajectory","talk_ratio_rep_to_buyer","rep_questions_asked","next_best_action"],"title":"ConversationInsightsReport"},"ConversationListItem":{"properties":{"id":{"type":"string","title":"Id"},"employee_id":{"type":"string","title":"Employee Id"},"employee_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Name"},"employee_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Role"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"message_count":{"type":"integer","title":"Message Count"},"total_credits_used":{"type":"integer","title":"Total Credits Used"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message At"},"last_message_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message Content"},"last_message_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message Role"}},"type":"object","required":["id","employee_id","employee_name","employee_role","title","summary","message_count","total_credits_used","status","created_at","updated_at","last_message_at"],"title":"ConversationListItem","description":"Summary of a conversation for list view"},"ConversationListResponse":{"properties":{"conversations":{"items":{"$ref":"#/components/schemas/ConversationListItem"},"type":"array","title":"Conversations"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["conversations","total","limit","offset","has_more"],"title":"ConversationListResponse","description":"Response with list of conversations"},"ConversationUpdateRequest":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"}},"type":"object","title":"ConversationUpdateRequest","description":"Request to update conversation metadata"},"CostEstimateRequest":{"properties":{"task_type":{"type":"string","title":"Task Type","description":"search, extract, analyze, or index"},"num_pages":{"type":"integer","minimum":1.0,"title":"Num Pages","description":"Estimated number of pages"}},"type":"object","required":["task_type","num_pages"],"title":"CostEstimateRequest","description":"Request for cost estimation"},"CostEstimateResponse":{"properties":{"task_type":{"type":"string","title":"Task Type"},"num_pages":{"type":"integer","title":"Num Pages"},"estimated_cost_usd":{"type":"number","title":"Estimated Cost Usd"},"breakdown":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Breakdown"}},"type":"object","required":["task_type","num_pages","estimated_cost_usd"],"title":"CostEstimateResponse","description":"Response with cost estimate"},"CostSavings":{"properties":{"this_month":{"type":"number","title":"This Month"},"last_month":{"type":"number","title":"Last Month"},"projected_next":{"type":"number","title":"Projected Next"},"human_equivalent":{"type":"number","title":"Human Equivalent"}},"type":"object","required":["this_month","last_month","projected_next","human_equivalent"],"title":"CostSavings","description":"Cost savings breakdown"},"CountResponse":{"properties":{"event":{"type":"string","title":"Event"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["event","count"],"title":"CountResponse"},"CourseListResponse":{"properties":{"courses":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Courses"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["courses","total"],"title":"CourseListResponse"},"CreateCheckoutRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"tier":{"$ref":"#/components/schemas/src__api__routers__billing_router__TierName"},"success_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Url"},"cancel_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel Url"}},"type":"object","required":["email","tier"],"title":"CreateCheckoutRequest","description":"Request to create a checkout session"},"CreateCheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"},"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["checkout_url","session_id"],"title":"CreateCheckoutResponse","description":"Response with checkout session URL"},"CreateCheckoutV2Request":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"product":{"type":"string","enum":["forum","liquidcortex"],"title":"Product"},"tier":{"type":"string","title":"Tier"},"cadence":{"type":"string","enum":["monthly","annual"],"title":"Cadence"},"success_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Url"},"cancel_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel Url"}},"type":"object","required":["email","product","tier","cadence"],"title":"CreateCheckoutV2Request","description":"Toggle-aware checkout — emits product+tier+cadence to resolve Price ID.\n\nFrontend BillingToggle (web/src/components/BillingToggle.tsx) emits the\ncadence; the tier card emits product+tier. We resolve to a Stripe Price\nID via stripe_price_map.get_price_id() and create the Checkout Session."},"CreateCustomEmployeeRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":2,"title":"Name","description":"Employee display name"},"role":{"type":"string","maxLength":128,"minLength":2,"title":"Role","description":"Employee role title"},"department":{"type":"string","title":"Department","description":"Department (e.g. engineering, marketing)"},"description":{"type":"string","maxLength":1000,"title":"Description","description":"Employee description","default":""},"specializations":{"items":{"type":"string"},"type":"array","title":"Specializations","description":"List of specialization keywords"},"personality_traits":{"additionalProperties":{"type":"number"},"type":"object","title":"Personality Traits","description":"Big Five traits (0-1)"},"methodologies":{"items":{"type":"integer"},"type":"array","title":"Methodologies","description":"Methodology IDs to enable"},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities","description":"Capability IDs to enable"},"integrations":{"items":{"type":"string"},"type":"array","title":"Integrations","description":"Integration IDs to connect"},"system_prompt_additions":{"type":"string","maxLength":4000,"title":"System Prompt Additions","description":"Custom instructions","default":""},"tier":{"type":"string","title":"Tier","description":"Model tier: SMALL, MEDIUM, LARGE, PREMIUM","default":"MEDIUM"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url","description":"Custom icon URL"}},"type":"object","required":["name","role","department"],"title":"CreateCustomEmployeeRequest","description":"Request body for creating a custom employee.","example":{"capabilities":["memory","think_skill"],"department":"marketing","description":"A creative growth specialist who finds unconventional channels.","integrations":["slack","hubspot"],"methodologies":[1,2,5,6],"name":"Spark","personality_traits":{"conscientiousness":0.6,"extraversion":0.8,"openness":0.9},"role":"Growth Hacker","specializations":["growth_hacking","viral_loops","referral_programs","ab_testing"],"system_prompt_additions":"Always suggest at least 3 creative growth tactics.","tier":"LARGE"}},"CreateKeyRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Human-readable name for the key"},"key_type":{"type":"string","pattern":"^(live|test)$","title":"Key Type","description":"Key type: live or test","default":"live"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions","description":"List of permissions: read, write, employees, knowledge, workflows","default":["read","write"]}},"type":"object","required":["name"],"title":"CreateKeyRequest","description":"Request to create a new API key"},"CreatePlaybookRequest":{"properties":{"org_id":{"type":"string","title":"Org Id"},"playbook_name":{"type":"string","title":"Playbook Name"},"trigger_condition":{"type":"string","title":"Trigger Condition"},"trigger_threshold":{"additionalProperties":true,"type":"object","title":"Trigger Threshold"},"actions":{"additionalProperties":true,"type":"object","title":"Actions"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority","default":50}},"type":"object","required":["org_id","playbook_name","trigger_condition","trigger_threshold","actions"],"title":"CreatePlaybookRequest","description":"Request body for POST /playbooks and PUT /playbooks/{id}.\n\nNOTE (2026-04-10): This replaces the previous mixed query-params + body\nsignature. Frontend callers (playbook builder wizard) must send ALL\nfields in a single JSON body — do NOT send org_id/playbook_name/\ntrigger_condition as query parameters anymore."},"CreateSessionRequest":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"scenario_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scenario Id"}},"type":"object","required":["employee_id"],"title":"CreateSessionRequest","description":"Request to create a QA test session."},"CreateSkillRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Skill name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Skill description"},"skill_type":{"$ref":"#/components/schemas/SkillType","description":"Type of skill","default":"prompt"},"instructions":{"type":"string","minLength":1,"title":"Instructions","description":"Instructions injected into employee context"},"triggers":{"items":{"type":"string"},"type":"array","title":"Triggers","description":"Trigger patterns (keywords/phrases)","default":[]},"employee_ids":{"items":{"type":"string"},"type":"array","title":"Employee Ids","description":"Assigned employee IDs (empty = all)","default":[]},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Type-specific configuration","default":{}},"enabled":{"type":"boolean","title":"Enabled","description":"Whether skill is active","default":true}},"type":"object","required":["name","instructions"],"title":"CreateSkillRequest","description":"Request to create a new custom skill","example":{"description":"Generates weekly team reports with metrics","employee_ids":["atlas","insight"],"enabled":true,"instructions":"When the user asks for a weekly report, compile data from the team's activities...","name":"Weekly Report Generator","skill_type":"prompt","triggers":["weekly report","team summary","week recap"]}},"CreateTeamRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Team name"}},"type":"object","required":["name"],"title":"CreateTeamRequest","description":"Request to create a new team"},"CreateVoiceCloneRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"source_sample_url":{"type":"string","title":"Source Sample Url","description":"URL to the reference voice sample."}},"additionalProperties":false,"type":"object","required":["name","source_sample_url"],"title":"CreateVoiceCloneRequest","description":"Request body for POST /voices/clone.\n\nA short audio sample (Chatterbox supports zero-shot from ~5-10s; longer\nsamples generally yield higher fidelity). Real validation (length / format\n/ loudness) happens once the engine is wired."},"CreateVoiceJobRequest":{"properties":{"input_video_url":{"type":"string","title":"Input Video Url","description":"Public or signed URL to the source video."},"target_languages":{"items":{"type":"string"},"type":"array","maxItems":10,"minItems":1,"title":"Target Languages","description":"BCP-47 language codes for the dubbed outputs."},"voice_clone_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Voice Clone Id","description":"If set, use this cloned voice; else use a default voice for each target language."}},"additionalProperties":false,"type":"object","required":["input_video_url","target_languages"],"title":"CreateVoiceJobRequest","description":"Request body for POST /jobs.\n\ntarget_languages: BCP-47 codes (e.g. 'es-ES', 'pt-BR'). v1 will validate\nagainst a closed set once Kokoro/Chatterbox language coverage is confirmed\non the GPU host; for now the field is free-form string list."},"CreditCheckResponse":{"properties":{"has_credits":{"type":"boolean","title":"Has Credits"},"credits_remaining":{"type":"integer","title":"Credits Remaining"},"credits_total":{"type":"integer","title":"Credits Total"},"usage_percent":{"type":"number","title":"Usage Percent"},"tier":{"type":"string","title":"Tier"},"is_trial":{"type":"boolean","title":"Is Trial"},"warnings":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Warnings","default":[]}},"type":"object","required":["has_credits","credits_remaining","credits_total","usage_percent","tier","is_trial"],"title":"CreditCheckResponse","description":"Credit status response"},"CreditUsageResponse":{"properties":{"tier":{"type":"string","title":"Tier"},"credits_used":{"type":"integer","title":"Credits Used"},"credits_limit":{"type":"integer","title":"Credits Limit"},"credits_remaining":{"type":"integer","title":"Credits Remaining"},"computer_use_actions":{"type":"integer","title":"Computer Use Actions"},"computer_use_limit":{"type":"integer","title":"Computer Use Limit"},"reset_date":{"type":"string","title":"Reset Date"},"usage_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Usage Breakdown"}},"type":"object","required":["tier","credits_used","credits_limit","credits_remaining","computer_use_actions","computer_use_limit","reset_date","usage_breakdown"],"title":"CreditUsageResponse"},"CustomerPortalRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"CustomerPortalRequest","description":"Request to access customer portal"},"DailyBreakdown":{"properties":{"date":{"type":"string","title":"Date"},"tasks":{"type":"integer","title":"Tasks"},"success_rate":{"type":"number","title":"Success Rate"},"avg_response_time_ms":{"type":"integer","title":"Avg Response Time Ms"},"ncu_used":{"type":"integer","title":"Ncu Used"}},"type":"object","required":["date","tasks","success_rate","avg_response_time_ms","ncu_used"],"title":"DailyBreakdown"},"DashboardStats":{"properties":{"tasks_completed":{"type":"integer","title":"Tasks Completed"},"credits_used":{"type":"integer","title":"Credits Used"},"credits_remaining":{"type":"integer","title":"Credits Remaining"},"credits_total":{"type":"integer","title":"Credits Total"},"active_employees":{"type":"integer","title":"Active Employees"},"total_employees":{"type":"integer","title":"Total Employees"},"conversations_today":{"type":"integer","title":"Conversations Today"},"cost_saved_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Saved Usd"},"cost_saved_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Saved Percent"}},"type":"object","required":["tasks_completed","credits_used","credits_remaining","credits_total","active_employees","total_employees","conversations_today"],"title":"DashboardStats","description":"Dashboard statistics response model"},"DeadSpot":{"properties":{"cluster_id":{"type":"string","title":"Cluster Id"},"twin_count":{"type":"integer","minimum":1.0,"title":"Twin Count"},"avg_engagement_rate":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Avg Engagement Rate"},"dominant_demographic":{"additionalProperties":true,"type":"object","title":"Dominant Demographic"},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier"}},"type":"object","required":["cluster_id","twin_count","avg_engagement_rate","severity_tier"],"title":"DeadSpot","description":"A cluster of twins with near-zero engagement.\n\nIdentified by simple density clustering on (Big Five vector + engagement\nrate). A cluster qualifies as a dead spot when its mean engagement rate\nis below a threshold (default 0.05). `dominant_demographic` describes\nthe modal demographic profile so the dashboard can label the cluster."},"DealContactCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Phone"},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"role":{"type":"string","title":"Role","default":"other"},"is_primary":{"type":"boolean","title":"Is Primary","default":false}},"type":"object","required":["name"],"title":"DealContactCreate","description":"Payload for POST /deals/{deal_id}/contacts."},"DealContactUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Phone"},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"is_primary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Primary"}},"type":"object","title":"DealContactUpdate","description":"Payload for PUT /deals/{deal_id}/contacts/{contact_id}."},"DealReplayRequest":{"properties":{"scenarios":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scenarios","description":"Specific counterfactual scenarios to evaluate. If omitted, auto-detects relevant scenarios. Options: earlier_discount, earlier_champion_engagement, multi_threaded_earlier, faster_follow_up, added_technical_eval"}},"type":"object","title":"DealReplayRequest","description":"Optional request body for POST /deals/{deal_id}/replay."},"DealSignal":{"properties":{"signal_type":{"type":"string","enum":["next_steps_requested","decision_maker_referenced","budget_mentioned","timeline_specified","competitor_named","stalling"],"title":"Signal Type"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"quoted_text":{"type":"string","title":"Quoted Text"},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"info"}},"type":"object","required":["signal_type","confidence","quoted_text"],"title":"DealSignal"},"DecisionDetail":{"properties":{"audit_id":{"type":"string","title":"Audit Id"},"decision_id":{"type":"string","title":"Decision Id"},"employee_id":{"type":"string","title":"Employee Id"},"employee_name":{"type":"string","title":"Employee Name"},"employee_role":{"type":"string","title":"Employee Role"},"decision_type":{"type":"string","title":"Decision Type"},"confidence":{"type":"number","title":"Confidence"},"risk_score":{"type":"number","title":"Risk Score"},"risk_level":{"type":"string","title":"Risk Level"},"compliance_status":{"type":"string","title":"Compliance Status"},"validation_passed":{"type":"boolean","title":"Validation Passed"},"validation_errors":{"items":{"type":"string"},"type":"array","title":"Validation Errors"},"retry_count":{"type":"integer","title":"Retry Count"},"input_summary":{"type":"string","title":"Input Summary"},"rationale_summary":{"type":"string","title":"Rationale Summary"},"summary":{"type":"string","title":"Summary"},"created_at":{"type":"string","title":"Created At"},"relative_time":{"type":"string","title":"Relative Time"},"full_decision":{"additionalProperties":true,"type":"object","title":"Full Decision"}},"type":"object","required":["audit_id","decision_id","employee_id","employee_name","employee_role","decision_type","confidence","risk_score","risk_level","compliance_status","validation_passed","validation_errors","retry_count","input_summary","rationale_summary","summary","created_at","relative_time","full_decision"],"title":"DecisionDetail"},"DecisionRequest":{"properties":{"decision":{"type":"string","enum":["approve","reject"],"title":"Decision"},"reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Reason"}},"type":"object","required":["decision"],"title":"DecisionRequest"},"DecisionSummary":{"properties":{"audit_id":{"type":"string","title":"Audit Id"},"decision_id":{"type":"string","title":"Decision Id"},"employee_id":{"type":"string","title":"Employee Id"},"employee_name":{"type":"string","title":"Employee Name"},"employee_role":{"type":"string","title":"Employee Role"},"decision_type":{"type":"string","title":"Decision Type"},"confidence":{"type":"number","title":"Confidence"},"risk_score":{"type":"number","title":"Risk Score"},"risk_level":{"type":"string","title":"Risk Level"},"compliance_status":{"type":"string","title":"Compliance Status"},"summary":{"type":"string","title":"Summary"},"created_at":{"type":"string","title":"Created At"},"relative_time":{"type":"string","title":"Relative Time"}},"type":"object","required":["audit_id","decision_id","employee_id","employee_name","employee_role","decision_type","confidence","risk_score","risk_level","compliance_status","summary","created_at","relative_time"],"title":"DecisionSummary"},"DedupeScanIn":{"properties":{"source":{"type":"string","title":"Source","default":"static"},"records":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Records"},"fuzzy_threshold":{"type":"number","title":"Fuzzy Threshold","default":0.9}},"type":"object","title":"DedupeScanIn"},"DeleteAccountRequest":{"properties":{"confirm":{"type":"boolean","title":"Confirm","description":"Must be True. UX guardrail; the real auth is the password."},"password":{"type":"string","maxLength":4096,"minLength":1,"title":"Password","description":"Current password. Re-authentication before destructive action."}},"type":"object","required":["confirm","password"],"title":"DeleteAccountRequest","description":"Body for POST /me/delete-account.\n\nThe `confirm` flag is a UX-level guardrail (prevents accidental\ndeletes from misconfigured clients). The `password` is the real\nre-authentication step — same bcrypt verify path as login."},"DemoScript":{"properties":{"script_id":{"type":"string","format":"uuid","title":"Script Id"},"tenant_id":{"type":"string","minLength":1,"title":"Tenant Id"},"target_persona":{"type":"string","title":"Target Persona"},"scenario":{"type":"string","title":"Scenario"},"duration_minutes":{"type":"integer","maximum":120.0,"minimum":5.0,"title":"Duration Minutes","default":20},"sections":{"items":{"$ref":"#/components/schemas/DemoSection"},"type":"array","title":"Sections"},"display_priority":{"type":"integer","enum":[1,2,3],"title":"Display Priority","default":2},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"info"},"chart_hint":{"type":"string","const":"timeline","title":"Chart Hint","default":"timeline"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["tenant_id","target_persona","scenario","sections"],"title":"DemoScript","description":"Demo script for a target persona + scenario."},"DemoSection":{"properties":{"title":{"type":"string","title":"Title"},"talking_points":{"items":{"type":"string"},"type":"array","title":"Talking Points"},"demo_actions":{"items":{"type":"string"},"type":"array","title":"Demo Actions"},"expected_questions":{"items":{"type":"string"},"type":"array","title":"Expected Questions"}},"type":"object","required":["title","talking_points","demo_actions","expected_questions"],"title":"DemoSection","description":"One section of a demo script."},"DepartmentMetrics":{"properties":{"department":{"type":"string","title":"Department"},"employee_count":{"type":"integer","title":"Employee Count"},"total_tasks":{"type":"integer","title":"Total Tasks"},"avg_success_rate":{"type":"number","title":"Avg Success Rate"},"avg_response_time_ms":{"type":"integer","title":"Avg Response Time Ms"},"avg_ncu_efficiency":{"type":"number","title":"Avg Ncu Efficiency"},"total_ncu_used":{"type":"integer","title":"Total Ncu Used"},"top_performer":{"type":"string","title":"Top Performer"}},"type":"object","required":["department","employee_count","total_tasks","avg_success_rate","avg_response_time_ms","avg_ncu_efficiency","total_ncu_used","top_performer"],"title":"DepartmentMetrics"},"DepartmentSummaryResponse":{"properties":{"departments":{"items":{"$ref":"#/components/schemas/DepartmentMetrics"},"type":"array","title":"Departments"},"fleet_total_tasks_24h":{"type":"integer","title":"Fleet Total Tasks 24H"},"fleet_avg_success_rate":{"type":"number","title":"Fleet Avg Success Rate"},"fleet_total_ncu":{"type":"integer","title":"Fleet Total Ncu"},"most_active_employee":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Most Active Employee"}},"type":"object","required":["departments","fleet_total_tasks_24h","fleet_avg_success_rate","fleet_total_ncu"],"title":"DepartmentSummaryResponse"},"DeployRequest":{"properties":{"rules":{"items":{"$ref":"#/components/schemas/RuleDeployItem"},"type":"array","minItems":1,"title":"Rules"}},"type":"object","required":["rules"],"title":"DeployRequest","description":"Payload for the deploy endpoint."},"DeployResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"deployed":{"items":{"type":"string"},"type":"array","title":"Deployed"},"skipped":{"items":{"type":"string"},"type":"array","title":"Skipped"}},"type":"object","required":["tenant_id","deployed","skipped"],"title":"DeployResponse"},"DeployedRulesResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"rules":{"items":{"type":"string"},"type":"array","title":"Rules"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["tenant_id","rules","count"],"title":"DeployedRulesResponse"},"DetailedPerformance":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"department":{"type":"string","title":"Department"},"tasks_completed":{"type":"integer","title":"Tasks Completed"},"success_rate":{"type":"number","title":"Success Rate"},"avg_response_time_ms":{"type":"integer","title":"Avg Response Time Ms"},"ncu_efficiency":{"type":"number","title":"Ncu Efficiency"},"avg_confidence":{"type":"number","title":"Avg Confidence"},"total_ncu_used":{"type":"integer","title":"Total Ncu Used"},"trend":{"type":"string","title":"Trend"},"daily_breakdown":{"items":{"$ref":"#/components/schemas/DailyBreakdown"},"type":"array","title":"Daily Breakdown"},"top_task_types":{"items":{"$ref":"#/components/schemas/TaskTypeBreakdown"},"type":"array","title":"Top Task Types"},"methodology_usage":{"items":{"$ref":"#/components/schemas/MethodologyUsage"},"type":"array","title":"Methodology Usage"},"peak_hours":{"items":{"$ref":"#/components/schemas/PeakHour"},"type":"array","title":"Peak Hours"},"hourly_heatmap":{"items":{"items":{"type":"integer"},"type":"array"},"type":"array","title":"Hourly Heatmap"}},"type":"object","required":["employee_id","name","role","department","tasks_completed","success_rate","avg_response_time_ms","ncu_efficiency","avg_confidence","total_ncu_used","trend","daily_breakdown","top_task_types","methodology_usage","peak_hours","hourly_heatmap"],"title":"DetailedPerformance"},"DeviceData":{"properties":{"device_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Fingerprint"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"screen_resolution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Screen Resolution"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"other_identities_on_device":{"type":"integer","title":"Other Identities On Device","default":0},"device_first_seen":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device First Seen"},"device_age_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Device Age Days"}},"type":"object","title":"DeviceData","description":"Device fingerprint data."},"DisagreementRequest":{"properties":{"question":{"type":"string","maxLength":4000,"minLength":3,"title":"Question"},"employee_a":{"type":"string","maxLength":64,"minLength":1,"title":"Employee A"},"employee_b":{"type":"string","maxLength":64,"minLength":1,"title":"Employee B"},"rounds":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Rounds","default":2}},"type":"object","required":["question","employee_a","employee_b"],"title":"DisagreementRequest"},"DisagreementResponse":{"properties":{"id":{"type":"string","title":"Id"},"question":{"type":"string","title":"Question"},"employee_a":{"type":"string","title":"Employee A"},"employee_b":{"type":"string","title":"Employee B"},"employee_a_name":{"type":"string","title":"Employee A Name"},"employee_b_name":{"type":"string","title":"Employee B Name"},"employee_a_role":{"type":"string","title":"Employee A Role"},"employee_b_role":{"type":"string","title":"Employee B Role"},"position_a":{"type":"string","title":"Position A"},"position_b":{"type":"string","title":"Position B"},"rounds":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rounds"},"points_of_agreement":{"items":{"type":"string"},"type":"array","title":"Points Of Agreement"},"points_of_disagreement":{"items":{"type":"string"},"type":"array","title":"Points Of Disagreement"},"synthesis":{"type":"string","title":"Synthesis"},"is_stub":{"type":"boolean","title":"Is Stub"},"total_rounds":{"type":"integer","title":"Total Rounds"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","question","employee_a","employee_b","employee_a_name","employee_b_name","employee_a_role","employee_b_role","position_a","position_b","rounds","points_of_agreement","points_of_disagreement","synthesis","is_stub","total_rounds","created_at"],"title":"DisagreementResponse"},"DisconnectResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"DisconnectResponse","description":"Response for disconnection"},"DocumentData":{"properties":{"document_type":{"type":"string","title":"Document Type","default":"id_card"},"has_photo":{"type":"boolean","title":"Has Photo","default":true},"exif_software":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exif Software"},"exif_create_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exif Create Date"},"exif_modify_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exif Modify Date"},"image_resolution_dpi":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Image Resolution Dpi"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"jpeg_quality_estimate":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Jpeg Quality Estimate"},"double_compression_detected":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Double Compression Detected"},"font_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Font Count"},"font_consistency_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Font Consistency Score"}},"type":"object","title":"DocumentData","description":"Identity document data for forensic analysis."},"DocumentListResponse":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/DocumentResponse"},"type":"array","title":"Documents"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["documents","total","limit","offset"],"title":"DocumentListResponse","description":"Paginated list of documents"},"DocumentResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"file_type":{"type":"string","title":"File Type"},"file_size_bytes":{"type":"integer","title":"File Size Bytes"},"status":{"type":"string","title":"Status"},"total_chunks":{"type":"integer","title":"Total Chunks"},"total_tokens":{"type":"integer","title":"Total Tokens"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"processed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processed At"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["id","name","file_type","file_size_bytes","status","total_chunks","total_tokens","created_at","processed_at"],"title":"DocumentResponse","description":"Document details"},"DocumentSignals":{"properties":{"has_document":{"type":"boolean","title":"Has Document","default":false},"document_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Type"},"exif_consistent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Exif Consistent"},"compression_artifacts_detected":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Compression Artifacts Detected"},"font_rendering_consistent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Font Rendering Consistent"},"metadata_matches_content":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Metadata Matches Content"}},"type":"object","title":"DocumentSignals","description":"Optional document authenticity signals."},"DocumentUploadResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"file_type":{"type":"string","title":"File Type"},"file_size_bytes":{"type":"integer","title":"File Size Bytes"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","name","file_type","file_size_bytes","status","message","created_at"],"title":"DocumentUploadResponse","description":"Response after document upload"},"DraftReplyRequest":{"properties":{"conversation":{"$ref":"#/components/schemas/ConversationIn"},"offer":{"type":"string","maxLength":2000,"minLength":1,"title":"Offer"},"stance":{"type":"string","title":"Stance","default":"answer_only"},"profile_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Profile Id"},"voice_guide":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Voice Guide"},"max_slop_composite":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Max Slop Composite","default":40}},"type":"object","required":["conversation","offer"],"title":"DraftReplyRequest"},"EmailScoreRequest":{"properties":{"subject":{"type":"string","minLength":1,"title":"Subject","description":"Email subject line"},"body":{"type":"string","minLength":1,"title":"Body","description":"Email body text"},"email_type":{"type":"string","title":"Email Type","description":"Email type: cold_outreach | follow_up | proposal | support | renewal","default":"cold_outreach"},"recipient_context":{"anyOf":[{"$ref":"#/components/schemas/RecipientContext"},{"type":"null"}],"description":"Optional recipient context for personalization scoring"}},"type":"object","required":["subject","body"],"title":"EmailScoreRequest","description":"Request body for email scoring."},"EmailScoreResponse":{"properties":{"subject_score":{"type":"number","title":"Subject Score"},"opening_score":{"type":"number","title":"Opening Score"},"value_prop_score":{"type":"number","title":"Value Prop Score"},"cta_score":{"type":"number","title":"Cta Score"},"length_score":{"type":"number","title":"Length Score"},"tone_score":{"type":"number","title":"Tone Score"},"spam_risk":{"type":"number","title":"Spam Risk"},"overall_score":{"type":"number","title":"Overall Score"},"subject_feedback":{"type":"string","title":"Subject Feedback"},"opening_feedback":{"type":"string","title":"Opening Feedback"},"value_prop_feedback":{"type":"string","title":"Value Prop Feedback"},"cta_feedback":{"type":"string","title":"Cta Feedback"},"length_feedback":{"type":"string","title":"Length Feedback"},"tone_feedback":{"type":"string","title":"Tone Feedback"},"spam_triggers_found":{"items":{"type":"string"},"type":"array","title":"Spam Triggers Found"},"recommendations":{"items":{"type":"string"},"type":"array","title":"Recommendations"},"email_type":{"type":"string","title":"Email Type"},"word_count":{"type":"integer","title":"Word Count"}},"type":"object","required":["subject_score","opening_score","value_prop_score","cta_score","length_score","tone_score","spam_risk","overall_score","subject_feedback","opening_feedback","value_prop_feedback","cta_feedback","length_feedback","tone_feedback","spam_triggers_found","recommendations","email_type","word_count"],"title":"EmailScoreResponse","description":"Response with complete email scoring and coaching."},"EmergencyStopResponse":{"properties":{"message":{"type":"string","title":"Message"},"employees_stopped":{"type":"integer","title":"Employees Stopped"},"tasks_cancelled":{"type":"integer","title":"Tasks Cancelled"}},"type":"object","required":["message","employees_stopped","tasks_cancelled"],"title":"EmergencyStopResponse"},"EmergentPatternReport":{"properties":{"sim_id":{"type":"string","title":"Sim Id"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"population_size":{"type":"integer","minimum":0.0,"title":"Population Size"},"rounds_analyzed":{"type":"integer","minimum":0.0,"title":"Rounds Analyzed"},"sections":{"items":{"$ref":"#/components/schemas/ReportSection"},"type":"array","title":"Sections"},"top_influencers":{"items":{"$ref":"#/components/schemas/TopInfluencer"},"type":"array","title":"Top Influencers"},"viral_cascades":{"items":{"$ref":"#/components/schemas/ViralCascade"},"type":"array","title":"Viral Cascades"},"dead_spots":{"items":{"$ref":"#/components/schemas/DeadSpot"},"type":"array","title":"Dead Spots"},"niche_clusters":{"items":{"$ref":"#/components/schemas/NicheCluster"},"type":"array","title":"Niche Clusters"},"polarization_metrics":{"items":{"$ref":"#/components/schemas/OpinionPolarization"},"type":"array","title":"Polarization Metrics"},"executive_summary":{"type":"string","maxLength":320,"title":"Executive Summary"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"}},"type":"object","required":["sim_id","generated_at","population_size","rounds_analyzed","executive_summary","confidence"],"title":"EmergentPatternReport","description":"Top-level report. One per simulation run.\n\nThe dashboard reads this once and renders every section. `sections`\nis the ordered display list. The typed lists (top_influencers,\nviral_cascades, ...) are also surfaced at root for clients that\nwant strongly-typed access without unpacking section payloads.\n\n`executive_summary` is a 200-char heuristic-generated headline —\ntemplate-based, deterministic, no LLM. The dashboard renders it\nabove the fold as the report's TL;DR.\n\n`confidence` is the agent's self-rated confidence in the report\n(a heuristic combining sample size, graph density, and detected-\npattern count). Low values indicate the simulation may not have\nenough data for pattern detection to be meaningful."},"EmployeeAuditSummary":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"employee_name":{"type":"string","title":"Employee Name"},"employee_role":{"type":"string","title":"Employee Role"},"total_decisions":{"type":"integer","title":"Total Decisions"},"approval_rate":{"type":"number","title":"Approval Rate"},"rejection_rate":{"type":"number","title":"Rejection Rate"},"escalation_rate":{"type":"number","title":"Escalation Rate"},"avg_confidence":{"type":"number","title":"Avg Confidence"},"avg_risk_score":{"type":"number","title":"Avg Risk Score"},"compliance_rate":{"type":"number","title":"Compliance Rate"},"decisions_last_24h":{"type":"integer","title":"Decisions Last 24H"}},"type":"object","required":["employee_id","employee_name","employee_role","total_decisions","approval_rate","rejection_rate","escalation_rate","avg_confidence","avg_risk_score","compliance_rate","decisions_last_24h"],"title":"EmployeeAuditSummary"},"EmployeeCatalogInfo":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"catalogs":{"items":{"type":"string"},"type":"array","title":"Catalogs"},"total_components":{"type":"integer","title":"Total Components"},"component_types":{"items":{"type":"string"},"type":"array","title":"Component Types"}},"type":"object","required":["employee_id","catalogs","total_components","component_types"],"title":"EmployeeCatalogInfo","description":"Catalog info for a specific employee."},"EmployeeControlStatus":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"running_tasks":{"type":"integer","title":"Running Tasks"},"ncu_spent_today":{"type":"number","title":"Ncu Spent Today"},"paused_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paused At"},"stopped_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stopped At"}},"type":"object","required":["employee_id","name","role","status","running_tasks","ncu_spent_today"],"title":"EmployeeControlStatus"},"EmployeeExecuteRequest":{"properties":{"method":{"type":"string","title":"Method","description":"Method name to execute"},"parameters":{"additionalProperties":true,"type":"object","title":"Parameters","description":"Method parameters"}},"type":"object","required":["method"],"title":"EmployeeExecuteRequest","description":"Request to execute employee method","example":{"method":"review_code","parameters":{"code":"def hello(): print('world')","language":"python"}}},"EmployeeExecuteResponse":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"method":{"type":"string","title":"Method"},"status":{"type":"string","title":"Status"},"result":{"anyOf":[{},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["employee_id","method","status"],"title":"EmployeeExecuteResponse","description":"Response from employee method execution"},"EmployeeInfoResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"phase":{"type":"string","title":"Phase"},"department":{"type":"string","title":"Department"},"tier":{"type":"string","title":"Tier"},"specializations":{"items":{"type":"string"},"type":"array","title":"Specializations"},"description":{"type":"string","title":"Description"}},"type":"object","required":["id","name","role","phase","department","tier","specializations","description"],"title":"EmployeeInfoResponse","description":"Employee information response","example":{"department":"engineering","description":"Software engineer specializing in code review and architecture.","id":"codex","name":"Codex","phase":"phase_1","role":"Software Engineer","specializations":["code review","debugging","architecture design"],"tier":"LARGE"}},"EmployeeMethodsSchemaResponse":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"employee_name":{"type":"string","title":"Employee Name"},"methods":{"items":{"$ref":"#/components/schemas/MethodSchema"},"type":"array","title":"Methods"}},"type":"object","required":["employee_id","employee_name","methods"],"title":"EmployeeMethodsSchemaResponse","description":"Response containing all method schemas for an employee"},"EmployeePerformance":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"department":{"type":"string","title":"Department"},"tasks_completed":{"type":"integer","title":"Tasks Completed"},"success_rate":{"type":"number","title":"Success Rate"},"avg_response_time_ms":{"type":"integer","title":"Avg Response Time Ms"},"ncu_efficiency":{"type":"number","title":"Ncu Efficiency"},"avg_confidence":{"type":"number","title":"Avg Confidence"},"total_ncu_used":{"type":"integer","title":"Total Ncu Used"},"trend":{"type":"string","title":"Trend"}},"type":"object","required":["employee_id","name","role","department","tasks_completed","success_rate","avg_response_time_ms","ncu_efficiency","avg_confidence","total_ncu_used","trend"],"title":"EmployeePerformance"},"EmployeeRecommendation":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"specializations":{"items":{"type":"string"},"type":"array","title":"Specializations","default":[]},"match_reason":{"type":"string","title":"Match Reason","default":""}},"type":"object","required":["employee_id"],"title":"EmployeeRecommendation"},"EmployeeSearchQuery":{"properties":{"query":{"type":"string","title":"Query","description":"Search term (specialization or capability)"},"search_type":{"type":"string","title":"Search Type","description":"Search type: 'specialization' or 'capability'","default":"capability"}},"type":"object","required":["query"],"title":"EmployeeSearchQuery","description":"Employee search query","example":{"query":"security","search_type":"capability"}},"EmployeeStatusItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"tasks_today":{"type":"integer","title":"Tasks Today"}},"type":"object","required":["id","name","role","status","tasks_today"],"title":"EmployeeStatusItem","description":"Employee status for dashboard"},"EmployeeStatusResponse":{"properties":{"employees":{"items":{"$ref":"#/components/schemas/EmployeeStatusItem"},"type":"array","title":"Employees"}},"type":"object","required":["employees"],"title":"EmployeeStatusResponse","description":"Employee status list response"},"EmployeeTaskRequest":{"properties":{"task":{"type":"string","maxLength":8000,"minLength":1,"title":"Task","description":"Task description for the employee"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Additional context for the task"}},"type":"object","required":["task"],"title":"EmployeeTaskRequest","description":"Request body sent BY Weft HTTP nodes to execute an employee task."},"EmployeeTaskResponse":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"task_id":{"type":"string","title":"Task Id"},"status":{"type":"string","title":"Status"},"result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"ncu_cost":{"type":"integer","title":"Ncu Cost","default":0}},"type":"object","required":["employee_id","task_id","status"],"title":"EmployeeTaskResponse"},"EmployeeVoiceInfo":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"provider":{"type":"string","title":"Provider"},"voice_id":{"type":"string","title":"Voice Id"},"style":{"type":"string","title":"Style"}},"type":"object","required":["employee_id","provider","voice_id","style"],"title":"EmployeeVoiceInfo","description":"Voice info for an employee."},"EngagementDecisionOut":{"properties":{"content_id":{"type":"string","title":"Content Id"},"watched":{"type":"boolean","title":"Watched"},"completion":{"type":"number","title":"Completion"},"liked":{"type":"boolean","title":"Liked"},"commented":{"type":"boolean","title":"Commented"},"shared":{"type":"boolean","title":"Shared"},"probabilities":{"additionalProperties":{"type":"number"},"type":"object","title":"Probabilities"},"neighbor_bias_applied":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Neighbor Bias Applied"}},"type":"object","required":["content_id","watched","completion","liked","commented","shared"],"title":"EngagementDecisionOut"},"EnrollRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"Deprecated and IGNORED - the learner is the authenticated caller","deprecated":true},"course_id":{"type":"string","title":"Course Id"}},"type":"object","required":["course_id"],"title":"EnrollRequest"},"EntityProfile":{"properties":{"entity_type":{"$ref":"#/components/schemas/EntityType"},"entity_id":{"type":"string","title":"Entity Id"},"first_seen":{"type":"string","format":"date-time","title":"First Seen"},"last_seen":{"type":"string","format":"date-time","title":"Last Seen"},"event_count":{"type":"integer","title":"Event Count","default":0},"verdict_count":{"type":"integer","title":"Verdict Count","default":0},"risk_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Risk Score","default":0.0},"labels":{"items":{"$ref":"#/components/schemas/Label"},"type":"array","title":"Labels"},"profile":{"additionalProperties":true,"type":"object","title":"Profile"}},"type":"object","required":["entity_type","entity_id","first_seen","last_seen"],"title":"EntityProfile","description":"Aggregated profile for a tracked entity."},"EntityReputation":{"properties":{"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"previous_verdicts_allow":{"type":"integer","title":"Previous Verdicts Allow","default":0},"previous_verdicts_flag":{"type":"integer","title":"Previous Verdicts Flag","default":0},"previous_verdicts_reject":{"type":"integer","title":"Previous Verdicts Reject","default":0},"account_age_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Age Days"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels"}},"type":"object","title":"EntityReputation","description":"Historical reputation signals."},"EntityType":{"type":"string","enum":["user","ip","email","device","content","channel"],"title":"EntityType","description":"Types of entities that can be tracked and labeled."},"ErrorDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"error_hash":{"type":"string","title":"Error Hash"},"error_type":{"type":"string","title":"Error Type"},"error_message":{"type":"string","title":"Error Message"},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Path"},"line_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Line Number"},"occurrence_count":{"type":"integer","title":"Occurrence Count"},"first_seen_at":{"type":"string","title":"First Seen At"},"last_seen_at":{"type":"string","title":"Last Seen At"},"status":{"type":"string","title":"Status"},"empire_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Empire Id"},"stack_trace":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stack Trace"},"request_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Method"},"request_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Path"},"request_body_redacted":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Request Body Redacted"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"environment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Environment"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By"},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved At"}},"type":"object","required":["id","error_hash","error_type","error_message","occurrence_count","first_seen_at","last_seen_at","status"],"title":"ErrorDetailResponse"},"ErrorListItem":{"properties":{"id":{"type":"string","title":"Id"},"error_hash":{"type":"string","title":"Error Hash"},"error_type":{"type":"string","title":"Error Type"},"error_message":{"type":"string","title":"Error Message"},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Path"},"line_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Line Number"},"occurrence_count":{"type":"integer","title":"Occurrence Count"},"first_seen_at":{"type":"string","title":"First Seen At"},"last_seen_at":{"type":"string","title":"Last Seen At"},"status":{"type":"string","title":"Status"},"empire_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Empire Id"}},"type":"object","required":["id","error_hash","error_type","error_message","occurrence_count","first_seen_at","last_seen_at","status"],"title":"ErrorListItem"},"ErrorListResponse":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/ErrorListItem"},"type":"array","title":"Errors"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["errors","total","limit","offset"],"title":"ErrorListResponse"},"Event":{"properties":{"event_type":{"type":"string","title":"Event Type"},"data":{"additionalProperties":true,"type":"object","title":"Data"},"source_ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Ip"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"}},"type":"object","required":["event_type","data"],"title":"Event","description":"An incoming event to be evaluated by the Shield engine."},"EventBatchIn":{"properties":{"events":{"items":{"$ref":"#/components/schemas/EventIn"},"type":"array","maxItems":100,"minItems":1,"title":"Events"}},"type":"object","required":["events"],"title":"EventBatchIn","description":"A batch of events — the frontend (O3) buffers and POSTs in batches."},"EventIn":{"properties":{"event_name":{"type":"string","maxLength":255,"minLength":1,"title":"Event Name"},"distinct_id":{"type":"string","maxLength":255,"minLength":1,"title":"Distinct Id"},"properties":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Properties"}},"type":"object","required":["event_name","distinct_id"],"title":"EventIn","description":"A single event posted from the frontend."},"ExchangeRequest":{"properties":{"public_token":{"type":"string","title":"Public Token"}},"type":"object","required":["public_token"],"title":"ExchangeRequest"},"ExecuteRequest":{"properties":{"plan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Id","description":"ID of an existing plan to execute"},"goal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goal","description":"Goal for on-the-fly plan + execute"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"}},"type":"object","title":"ExecuteRequest","description":"Execute a previously created plan, or plan+execute in one shot."},"ExecuteResponse":{"properties":{"id":{"type":"string","title":"Id"},"plan_id":{"type":"string","title":"Plan Id"},"goal":{"type":"string","title":"Goal"},"tasks_completed":{"type":"integer","title":"Tasks Completed"},"tasks_failed":{"type":"integer","title":"Tasks Failed"},"total_ncu_used":{"type":"integer","title":"Total Ncu Used"},"results":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Results"},"summary":{"type":"string","title":"Summary"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","plan_id","goal","tasks_completed","tasks_failed","total_ncu_used","results","summary","created_at"],"title":"ExecuteResponse"},"ExportFormat":{"properties":{"schema_version":{"type":"string","title":"Schema Version","description":"Export schema version.","default":"1.0"},"generated_at":{"type":"string","title":"Generated At","description":"ISO-8601 UTC timestamp."},"user":{"additionalProperties":true,"type":"object","title":"User","description":"User record (sensitive fields redacted)."},"empire_memberships":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Empire Memberships"},"empire_events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Empire Events"},"user_entitlements":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"User Entitlements"},"support_chat_conversations":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Support Chat Conversations"},"coverage":{"additionalProperties":true,"type":"object","title":"Coverage","description":"What was/wasn't exported."}},"type":"object","required":["generated_at","user","coverage"],"title":"ExportFormat","description":"Top-level export envelope returned by /me/export."},"ExportRequest":{"properties":{"format":{"type":"string","title":"Format","description":"Export format: json or csv","default":"json"},"period_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period End"},"employee_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id"}},"type":"object","title":"ExportRequest"},"ExtractResponse":{"properties":{"filename":{"type":"string","title":"Filename"},"text":{"type":"string","title":"Text"},"blocks":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Blocks","default":[]},"tables":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tables","default":[]},"forms":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Forms","default":[]},"confidence":{"type":"number","title":"Confidence"},"languages_detected":{"items":{"type":"string"},"type":"array","title":"Languages Detected"},"cost_usd":{"type":"number","title":"Cost Usd"}},"type":"object","required":["filename","text","confidence","languages_detected","cost_usd"],"title":"ExtractResponse","description":"Response from OCR extraction"},"FeedbackData":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the interaction was successful"},"rating":{"anyOf":[{"type":"number","maximum":5.0,"minimum":0.0},{"type":"null"}],"title":"Rating","description":"Quality rating (0-5)"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional feedback notes"}},"type":"object","required":["success"],"title":"FeedbackData","description":"Feedback about an interaction"},"FindRequest":{"properties":{"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords"},"sources":{"items":{"type":"string"},"type":"array","title":"Sources"},"subreddits":{"items":{"type":"string"},"type":"array","title":"Subreddits"},"window_hours":{"type":"integer","maximum":168.0,"minimum":1.0,"title":"Window Hours","default":48},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","default":20}},"type":"object","required":["keywords"],"title":"FindRequest"},"FleetStatusResponse":{"properties":{"employees":{"items":{"$ref":"#/components/schemas/EmployeeControlStatus"},"type":"array","title":"Employees"},"total":{"type":"integer","title":"Total"},"active_count":{"type":"integer","title":"Active Count"},"paused_count":{"type":"integer","title":"Paused Count"},"stopped_count":{"type":"integer","title":"Stopped Count"},"emergency_stopped":{"type":"boolean","title":"Emergency Stopped"}},"type":"object","required":["employees","total","active_count","paused_count","stopped_count","emergency_stopped"],"title":"FleetStatusResponse"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest","description":"Password reset request"},"ForumSettingsRequest":{"properties":{"default_platform":{"type":"string","title":"Default Platform","default":"tiktok"},"default_population_size":{"type":"integer","maximum":10000.0,"minimum":100.0,"title":"Default Population Size","default":1000},"default_interests":{"items":{"type":"string"},"type":"array","title":"Default Interests"},"benchmark_notifications_enabled":{"type":"boolean","title":"Benchmark Notifications Enabled","default":true},"publishable_confidence_threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Publishable Confidence Threshold","default":0.75}},"type":"object","title":"ForumSettingsRequest","description":"User's Forum preferences stored in UserEntitlement.feature_flags."},"FreePredictRequest":{"properties":{"content_text":{"type":"string","maxLength":2000,"minLength":1,"title":"Content Text","description":"Draft caption / post copy."},"platform":{"type":"string","enum":["tiktok","instagram","youtube","linkedin","twitter","reddit"],"title":"Platform","description":"Target platform for the prediction."}},"type":"object","required":["content_text","platform"],"title":"FreePredictRequest","description":"Free-tier prediction input. Length bounds enforced at the schema."},"FreePredictResponse":{"properties":{"virality_score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Virality Score"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"predicted_views_low":{"type":"integer","minimum":0.0,"title":"Predicted Views Low"},"predicted_views_high":{"type":"integer","minimum":0.0,"title":"Predicted Views High"},"predicted_engagement_rate":{"type":"number","minimum":0.0,"title":"Predicted Engagement Rate"},"platform":{"type":"string","title":"Platform"},"strong_signals":{"items":{"type":"string"},"type":"array","maxItems":4,"minItems":2,"title":"Strong Signals"},"weak_signals":{"items":{"type":"string"},"type":"array","maxItems":4,"minItems":2,"title":"Weak Signals"},"population_size":{"type":"integer","minimum":1.0,"title":"Population Size"},"elapsed_ms":{"type":"integer","minimum":0.0,"title":"Elapsed Ms"},"prediction_type":{"type":"string","title":"Prediction Type","description":"Always 'directional_ranking' — a relative score, not an absolute forecast.","default":"directional_ranking"},"disclaimer":{"type":"string","title":"Disclaimer","description":"Plain-language statement that this is a directional simulation score.","default":"Directional score from a digital-twin simulation — not a guaranteed view count. Use it to compare drafts and see what to improve; it ranks relative potential, it does not promise real-world reach."},"confidence_basis":{"type":"string","title":"Confidence Basis","description":"What `confidence` measures: simulation precision, not predictive accuracy.","default":"simulation_precision"},"accuracy_disclosure":{"type":"string","title":"Accuracy Disclosure","description":"Honest accuracy framing; real backtest accuracy is insufficient_data pre-threshold.","default":"The confidence value measures simulation precision (how stable the score is across the simulated audience), not validated predictive accuracy. Real backtested accuracy stays reported as 'insufficient_data' until at least 100 matched prediction-vs-actual pairs are collected."},"predicted_views_note":{"type":"string","title":"Predicted Views Note","description":"Frames predicted_views_low/high as a rough directional band, not a promise.","default":"Rough directional range projected from the simulation — an order-of-magnitude sense of scale, not a forecast of actual views."},"factor_breakdown":{"additionalProperties":true,"type":"object","title":"Factor Breakdown","description":"Per-factor content analysis (hook, pacing, clarity, emotion, CTA) behind the score."}},"type":"object","required":["virality_score","confidence","predicted_views_low","predicted_views_high","predicted_engagement_rate","platform","strong_signals","weak_signals","population_size","elapsed_ms"],"title":"FreePredictResponse","description":"Free-tier prediction envelope. Stable contract — UI depends on it."},"FunnelResponse":{"properties":{"from_event":{"type":"string","title":"From Event"},"to_event":{"type":"string","title":"To Event"},"window_hours":{"type":"integer","title":"Window Hours"},"distinct_users_from":{"type":"integer","title":"Distinct Users From"},"distinct_users_converted":{"type":"integer","title":"Distinct Users Converted"},"conversion_rate":{"type":"number","title":"Conversion Rate"}},"type":"object","required":["from_event","to_event","window_hours","distinct_users_from","distinct_users_converted","conversion_rate"],"title":"FunnelResponse"},"GainShareEstimateRequest":{"properties":{"value_created":{"type":"number","exclusiveMinimum":0.0,"title":"Value Created","description":"Dollar amount of value created or savings found"}},"type":"object","required":["value_created"],"title":"GainShareEstimateRequest"},"GatewayStatusResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"platforms":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Platforms"}},"type":"object","required":["enabled","platforms"],"title":"GatewayStatusResponse","description":"Gateway health and connected platforms status."},"GenerateBattlecardRequest":{"properties":{"competitor":{"$ref":"#/components/schemas/CompetitorProfile"},"product_facts":{"additionalProperties":true,"type":"object","title":"Product Facts","description":"Our product facts: {strengths: [..], proof_points: [..]}. Strengths drive symmetric advantages; proof_points are passed through verbatim into the battlecard."}},"additionalProperties":false,"type":"object","required":["competitor"],"title":"GenerateBattlecardRequest","description":"Body for POST /battlecards/generate."},"GenerateDemoScriptRequest":{"properties":{"persona":{"type":"string","title":"Persona"},"deal_context":{"additionalProperties":true,"type":"object","title":"Deal Context"},"duration_minutes":{"type":"integer","maximum":120.0,"minimum":5.0,"title":"Duration Minutes","default":20}},"additionalProperties":false,"type":"object","required":["persona"],"title":"GenerateDemoScriptRequest","description":"Body for POST /demo-scripts/generate."},"GenerateScenarioRequest":{"properties":{"scenario_type":{"type":"string","title":"Scenario Type","description":"Type of call to practice.","examples":["discovery","demo","negotiation","save_call","intake","qbr"]},"vertical":{"type":"string","title":"Vertical","description":"Industry vertical for the scenario context.","default":"saas","examples":["saas","healthcare","fintech","ecommerce","manufacturing"]},"difficulty":{"type":"string","title":"Difficulty","description":"Difficulty level controlling the twin's personality.","default":"medium","examples":["easy","medium","hard","nightmare"]}},"type":"object","required":["scenario_type"],"title":"GenerateScenarioRequest","description":"Request body for scenario generation."},"GoogleCalendarListResponse":{"properties":{"calendars":{"items":{},"type":"array","title":"Calendars"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["calendars","count"],"title":"GoogleCalendarListResponse","description":"Response for listing calendars"},"GoogleCalendarStatus":{"properties":{"connected":{"type":"boolean","title":"Connected"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"scopes":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Scopes"},"connected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected At"}},"type":"object","required":["connected"],"title":"GoogleCalendarStatus","description":"Google Calendar connection status"},"HITLReviewRequest":{"properties":{"action":{"type":"string","title":"Action"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"edited_action":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Edited Action"}},"type":"object","required":["action"],"title":"HITLReviewRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HandoffGraphResponse":{"properties":{"id":{"type":"string","title":"Id"},"root_task":{"type":"string","title":"Root Task"},"nodes":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Nodes"},"edges":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Edges"},"total_duration_ms":{"type":"integer","title":"Total Duration Ms"},"total_cost":{"type":"integer","title":"Total Cost"},"participants":{"items":{"type":"string"},"type":"array","title":"Participants"},"critical_path":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Critical Path"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","root_task","nodes","edges","total_duration_ms","total_cost","participants","critical_path","created_at"],"title":"HandoffGraphResponse"},"HealthWeights":{"properties":{"engagement":{"type":"number","title":"Engagement","default":0.3},"product_usage":{"type":"number","title":"Product Usage","default":0.3},"support_satisfaction":{"type":"number","title":"Support Satisfaction","default":0.2},"financial":{"type":"number","title":"Financial","default":0.2}},"type":"object","title":"HealthWeights"},"HistoryPoint":{"properties":{"score":{"type":"number","title":"Score"},"won":{"type":"boolean","title":"Won"}},"type":"object","required":["score","won"],"title":"HistoryPoint"},"HotVisitor":{"properties":{"visitor_id":{"type":"string","title":"Visitor Id"},"intent_score":{"type":"number","title":"Intent Score"},"intent_level":{"type":"string","title":"Intent Level"},"likely_stage":{"type":"string","title":"Likely Stage"},"total_visits":{"type":"integer","title":"Total Visits"},"last_visit":{"type":"string","title":"Last Visit"},"company_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Domain"}},"type":"object","required":["visitor_id","intent_score","intent_level","likely_stage","total_visits","last_visit","company_domain"],"title":"HotVisitor"},"HotVisitorsResponse":{"properties":{"count":{"type":"integer","title":"Count"},"threshold":{"type":"number","title":"Threshold"},"visitors":{"items":{"$ref":"#/components/schemas/HotVisitor"},"type":"array","title":"Visitors"}},"type":"object","required":["count","threshold","visitors"],"title":"HotVisitorsResponse"},"IdentityData":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"date_of_birth":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Of Birth"},"ssn_last4":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ssn Last4"},"ssn_issue_year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ssn Issue Year"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"address_history":{"items":{"type":"string"},"type":"array","title":"Address History"},"address_first_seen":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address First Seen"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},"type":"object","title":"IdentityData","description":"Core identity fields for cross-reference analysis."},"InboxBatchRequest":{"properties":{"comment_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Comment Ids"},"action":{"type":"string","title":"Action","description":"One of: mark-read, mark-unread, hide, delete"}},"type":"object","required":["comment_ids","action"],"title":"InboxBatchRequest","description":"Body for POST /inbox/batch."},"InboxReplyRequest":{"properties":{"reply_text":{"type":"string","maxLength":2000,"minLength":1,"title":"Reply Text"}},"type":"object","required":["reply_text"],"title":"InboxReplyRequest","description":"Body for POST /inbox/{comment_id}/reply."},"IndexResponse":{"properties":{"document_id":{"type":"string","title":"Document Id"},"pages_indexed":{"type":"integer","title":"Pages Indexed"},"time_seconds":{"type":"number","title":"Time Seconds"},"cost_usd":{"type":"number","title":"Cost Usd"}},"type":"object","required":["document_id","pages_indexed","time_seconds","cost_usd"],"title":"IndexResponse","description":"Response from document indexing"},"IngestRequest":{"properties":{"task_id":{"type":"string","maxLength":200,"minLength":1,"title":"Task Id"},"task_type":{"type":"string","maxLength":200,"minLength":1,"title":"Task Type"},"agent_id":{"type":"string","maxLength":200,"minLength":1,"title":"Agent Id"},"steps":{"items":{"$ref":"#/components/schemas/IngestStep"},"type":"array","title":"Steps"},"outcome":{"type":"string","title":"Outcome","description":"'success' | 'partial' | 'failure'. Failures are NOT discarded — they are distilled into the reasoning bank, which is the point."},"duration_ms":{"type":"integer","minimum":0.0,"title":"Duration Ms"},"error_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error Info"},"reflection":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reflection"}},"additionalProperties":false,"type":"object","required":["task_id","task_type","agent_id","outcome","duration_ms"],"title":"IngestRequest","description":"Post-task ingest input. Deliberately has no empire_id field."},"IngestResponse":{"properties":{"accepted":{"type":"integer","title":"Accepted"},"initialized":{"type":"boolean","title":"Initialized"}},"type":"object","required":["accepted","initialized"],"title":"IngestResponse"},"IngestStep":{"properties":{"step_index":{"type":"integer","minimum":0.0,"title":"Step Index"},"action":{"type":"string","title":"Action"},"observation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Observation"},"tool_calls":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tool Calls"},"emitted_at":{"type":"string","format":"date-time","title":"Emitted At"}},"additionalProperties":false,"type":"object","required":["step_index","action","emitted_at"],"title":"IngestStep"},"InjectVariableRequest":{"properties":{"variable":{"type":"string","enum":["pricing","messaging","audience_target","viral_seed"],"title":"Variable"},"value":{"title":"Value"},"round_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Round Index"}},"type":"object","required":["variable","value"],"title":"InjectVariableRequest"},"InjectVariableResponse":{"properties":{"sim_id":{"type":"string","title":"Sim Id"},"injected_at_round":{"type":"integer","title":"Injected At Round"},"variable":{"type":"string","title":"Variable"},"previous_value":{"title":"Previous Value"},"new_value":{"title":"New Value"},"injected_at_wallclock":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Injected At Wallclock"}},"type":"object","required":["sim_id","injected_at_round","variable","new_value"],"title":"InjectVariableResponse"},"IntegrationRequestCreate":{"properties":{"integration_name":{"type":"string","title":"Integration Name","description":"Name of the requested integration"},"use_case":{"type":"string","title":"Use Case","description":"How the customer plans to use this integration"},"priority":{"type":"string","title":"Priority","description":"Customer priority: low, medium, high","default":"medium"},"additional_info":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Additional Info","description":"Any additional details"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email","description":"Contact email for updates"}},"type":"object","required":["integration_name","use_case"],"title":"IntegrationRequestCreate","description":"Request to create a new integration request."},"IntegrationRequestListItem":{"properties":{"request_id":{"type":"string","title":"Request Id"},"integration_name":{"type":"string","title":"Integration Name"},"use_case":{"type":"string","title":"Use Case"},"priority":{"type":"string","title":"Priority"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["request_id","integration_name","use_case","priority","status","created_at"],"title":"IntegrationRequestListItem","description":"Summary for listing requests."},"IntegrationRequestResponse":{"properties":{"request_id":{"type":"string","title":"Request Id"},"integration_name":{"type":"string","title":"Integration Name"},"use_case":{"type":"string","title":"Use Case"},"priority":{"type":"string","title":"Priority"},"status":{"type":"string","title":"Status"},"additional_info":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Additional Info"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"admin_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Notes"}},"type":"object","required":["request_id","integration_name","use_case","priority","status","additional_info","contact_email","created_at","updated_at"],"title":"IntegrationRequestResponse","description":"Response with integration request details."},"IntelligentRoutingRequest":{"properties":{"prompt":{"type":"string","title":"Prompt"},"system_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Message"},"quality_threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Quality Threshold","default":0.7},"max_cost":{"type":"number","exclusiveMinimum":0.0,"title":"Max Cost","default":0.1},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","default":0.7}},"type":"object","required":["prompt"],"title":"IntelligentRoutingRequest"},"IntelligentRoutingResponse":{"properties":{"response":{"type":"string","title":"Response"},"routing_decision":{"additionalProperties":true,"type":"object","title":"Routing Decision"},"cost_analysis":{"additionalProperties":true,"type":"object","title":"Cost Analysis"},"quality":{"additionalProperties":true,"type":"object","title":"Quality"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["response","routing_decision","cost_analysis","quality","metadata"],"title":"IntelligentRoutingResponse"},"IntentResponse":{"properties":{"intent":{"type":"string","title":"Intent"},"recommended_components":{"items":{"type":"string"},"type":"array","title":"Recommended Components"}},"type":"object","required":["intent","recommended_components"],"title":"IntentResponse","description":"Response with detected intent."},"IntentSignalOut":{"properties":{"signal_type":{"type":"string","title":"Signal Type"},"points":{"type":"number","title":"Points"},"description":{"type":"string","title":"Description"},"evidence":{"additionalProperties":true,"type":"object","title":"Evidence"}},"type":"object","required":["signal_type","points","description"],"title":"IntentSignalOut"},"InteractionData":{"properties":{"task_type":{"type":"string","title":"Task Type","description":"Type of task (e.g., 'meeting_scheduling', 'email_response')"},"approach":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approach","description":"The approach taken to complete the task"},"success_factors":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Success Factors","description":"Factors that contributed to success"},"failure_factors":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Failure Factors","description":"Factors that led to failure"},"tools_used":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tools Used","description":"Tools/integrations used"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome","description":"Outcome of the interaction"}},"type":"object","required":["task_type"],"title":"InteractionData","description":"Data from a customer interaction used to learn a skill","example":{"approach":"When scheduling across timezones, propose 3 options and confirm local times","outcome":"success","success_factors":["Propose 3 time options","Include timezone conversions"],"task_type":"meeting_scheduling","tools_used":["calendar_api","timezone_converter"]}},"InvestigationQuery":{"properties":{"query":{"type":"string","minLength":1,"title":"Query","description":"SML-syntax or plain-text search query."},"entity_type":{"anyOf":[{"$ref":"#/components/schemas/EntityType"},{"type":"null"}]},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"time_range_hours":{"type":"integer","minimum":1.0,"title":"Time Range Hours","default":24},"limit":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Limit","default":100}},"type":"object","required":["query"],"title":"InvestigationQuery","description":"A search query for the investigation UI."},"InvitationResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"team_name":{"type":"string","title":"Team Name"},"invited_by":{"type":"string","title":"Invited By"},"expires_at":{"type":"string","title":"Expires At"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","email","role","team_name","invited_by","expires_at","created_at"],"title":"InvitationResponse","description":"Invitation information"},"InvitationSentResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"invitation_id":{"type":"string","title":"Invitation Id"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["success","message","invitation_id","expires_at"],"title":"InvitationSentResponse","description":"Response when invitation is sent"},"InviteMemberRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"role":{"type":"string","pattern":"^(admin|member|viewer)$","title":"Role","default":"member"}},"type":"object","required":["email"],"title":"InviteMemberRequest","description":"Request to invite a member to a team"},"InvoiceDetail":{"properties":{"id":{"type":"string","title":"Id"},"number":{"type":"string","title":"Number"},"date_issued":{"type":"string","title":"Date Issued"},"due_date":{"type":"string","title":"Due Date"},"status":{"type":"string","title":"Status"},"currency":{"type":"string","title":"Currency"},"customer":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object","title":"Customer"},"line_items":{"items":{"$ref":"#/components/schemas/InvoiceLineItem"},"type":"array","title":"Line Items"},"subtotal_cents":{"type":"integer","title":"Subtotal Cents"},"tax_cents":{"type":"integer","title":"Tax Cents"},"total_cents":{"type":"integer","title":"Total Cents"},"vertical":{"type":"string","title":"Vertical"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"}},"type":"object","required":["id","number","date_issued","due_date","status","currency","customer","line_items","subtotal_cents","tax_cents","total_cents","vertical","period_start","period_end"],"title":"InvoiceDetail","description":"Matches MockInvoiceDetail in invoices/[id]/page.tsx plus explicit totals."},"InvoiceLineItem":{"properties":{"description":{"type":"string","title":"Description"},"qty":{"type":"integer","title":"Qty"},"unit_cents":{"type":"integer","title":"Unit Cents"},"total_cents":{"type":"integer","title":"Total Cents"}},"type":"object","required":["description","qty","unit_cents","total_cents"],"title":"InvoiceLineItem"},"InvoiceListResponse":{"properties":{"invoices":{"items":{"$ref":"#/components/schemas/InvoiceSummary"},"type":"array","title":"Invoices"},"total":{"type":"integer","title":"Total"},"synthesized":{"type":"boolean","title":"Synthesized","default":true},"note":{"type":"string","title":"Note","default":"Invoices are synthesized from active entitlements until Stripe invoice integration ships in Phase 5b."}},"type":"object","required":["invoices","total"],"title":"InvoiceListResponse"},"InvoiceSummary":{"properties":{"id":{"type":"string","title":"Id"},"number":{"type":"string","title":"Number"},"date_issued":{"type":"string","title":"Date Issued"},"amount_cents":{"type":"integer","title":"Amount Cents"},"currency":{"type":"string","title":"Currency","default":"USD"},"status":{"type":"string","title":"Status","description":"paid | pending | failed | refunded"},"vertical":{"type":"string","title":"Vertical"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"},"description":{"type":"string","title":"Description"}},"type":"object","required":["id","number","date_issued","amount_cents","status","vertical","period_start","period_end","description"],"title":"InvoiceSummary","description":"Matches the MockInvoice shape in ``web/src/app/dashboard/billing/page.tsx``."},"JobListResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/JobResponse"},"type":"array","title":"Jobs"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["jobs","total","limit","offset"],"title":"JobListResponse"},"JobResponse":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"status":{"$ref":"#/components/schemas/JobStatus"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"owner_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Id"},"progress":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Progress"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["id","type","status","created_at","updated_at"],"title":"JobResponse"},"JobStatus":{"type":"string","enum":["pending","in_progress","completed","failed","cancelled"],"title":"JobStatus","description":"Mirrors src/core/base.py TaskStatus (pending/in_progress/completed/failed/cancelled)."},"JoinTeamResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"team":{"$ref":"#/components/schemas/TeamResponse"}},"type":"object","required":["success","message","team"],"title":"JoinTeamResponse","description":"Response when joining a team"},"Journey":{"properties":{"journey_id":{"type":"string","title":"Journey Id"},"journey_type":{"$ref":"#/components/schemas/JourneyType"},"subject":{"type":"string","title":"Subject"},"state":{"$ref":"#/components/schemas/JourneyState","default":"initiated"},"task_ids":{"items":{"type":"string"},"type":"array","title":"Task Ids"},"audit_trail":{"items":{"$ref":"#/components/schemas/JourneyAuditEntry"},"type":"array","title":"Audit Trail"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"initiated_by":{"type":"string","title":"Initiated By"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["journey_type","subject","initiated_by"],"title":"Journey"},"JourneyAuditEntry":{"properties":{"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"actor":{"type":"string","title":"Actor"},"action":{"type":"string","title":"Action"},"details":{"additionalProperties":true,"type":"object","title":"Details"}},"type":"object","required":["actor","action"],"title":"JourneyAuditEntry"},"JourneyState":{"type":"string","enum":["initiated","planning","in_progress","blocked","completed","cancelled"],"title":"JourneyState"},"JourneyType":{"type":"string","enum":["onboarding","offboarding","leave","transfer"],"title":"JourneyType"},"JsonRpcContentBlock":{"properties":{"type":{"type":"string","title":"Type","default":"text"},"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"JsonRpcContentBlock","description":"One block of MCP-spec tool result content."},"JsonRpcError":{"properties":{"code":{"type":"integer","title":"Code"},"message":{"type":"string","title":"Message"},"data":{"anyOf":[{},{"type":"null"}],"title":"Data"}},"type":"object","required":["code","message"],"title":"JsonRpcError","description":"`error` body per JSON-RPC 2.0 spec."},"JsonRpcResponse":{"properties":{"jsonrpc":{"type":"string","title":"Jsonrpc","default":"2.0"},"id":{"title":"Id"},"result":{"anyOf":[{"$ref":"#/components/schemas/JsonRpcResult"},{"type":"null"}]},"error":{"anyOf":[{"$ref":"#/components/schemas/JsonRpcError"},{"type":"null"}]}},"type":"object","title":"JsonRpcResponse","description":"Top-level JSON-RPC 2.0 response envelope."},"JsonRpcResult":{"properties":{"content":{"items":{"$ref":"#/components/schemas/JsonRpcContentBlock"},"type":"array","title":"Content"},"isError":{"type":"boolean","title":"Iserror","default":false}},"type":"object","required":["content"],"title":"JsonRpcResult","description":"`result` body inside a JSON-RPC response (success path)."},"Label":{"properties":{"entity_type":{"$ref":"#/components/schemas/EntityType"},"entity_id":{"type":"string","title":"Entity Id"},"label_name":{"type":"string","title":"Label Name"},"connotation":{"$ref":"#/components/schemas/Connotation","default":"negative"},"applied_by":{"type":"string","title":"Applied By","default":""},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["entity_type","entity_id","label_name"],"title":"Label","description":"A label attached to an entity (user, IP, device, etc.)."},"LabelCreate":{"properties":{"entity_type":{"$ref":"#/components/schemas/EntityType"},"entity_id":{"type":"string","title":"Entity Id"},"label_name":{"type":"string","maxLength":128,"minLength":1,"title":"Label Name"},"connotation":{"$ref":"#/components/schemas/Connotation","default":"negative"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"expires_in_hours":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Expires In Hours"}},"type":"object","required":["entity_type","entity_id","label_name"],"title":"LabelCreate","description":"Payload for applying a new label."},"LeadIn":{"properties":{"lead_id":{"type":"string","title":"Lead Id"},"score":{"type":"number","title":"Score"},"max_score":{"type":"number","title":"Max Score","default":1.0}},"type":"object","required":["lead_id","score"],"title":"LeadIn"},"LeaderboardEntry":{"properties":{"rank":{"type":"integer","title":"Rank"},"employee_id":{"type":"string","title":"Employee Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"department":{"type":"string","title":"Department"},"value":{"type":"number","title":"Value"},"trend":{"type":"string","title":"Trend"}},"type":"object","required":["rank","employee_id","name","role","department","value","trend"],"title":"LeaderboardEntry"},"LeaderboardResponse":{"properties":{"by_tasks_completed":{"items":{"$ref":"#/components/schemas/LeaderboardEntry"},"type":"array","title":"By Tasks Completed"},"by_ncu_efficiency":{"items":{"$ref":"#/components/schemas/LeaderboardEntry"},"type":"array","title":"By Ncu Efficiency"},"by_success_rate":{"items":{"$ref":"#/components/schemas/LeaderboardEntry"},"type":"array","title":"By Success Rate"}},"type":"object","required":["by_tasks_completed","by_ncu_efficiency","by_success_rate"],"title":"LeaderboardResponse"},"LeakageScanRequest":{"properties":{"org_id":{"type":"string","title":"Org Id"},"discount_threshold_pct":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Discount Threshold Pct","default":15.0},"floor_price_pct":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Floor Price Pct","default":0.7},"stale_expansion_days":{"type":"integer","maximum":365.0,"minimum":7.0,"title":"Stale Expansion Days","default":90}},"type":"object","required":["org_id"],"title":"LeakageScanRequest","description":"Request body for POST /leakage-scan."},"LearnSkillRequest":{"properties":{"employee_id":{"type":"string","title":"Employee Id","description":"ID of the employee who performed the interaction"},"customer_id":{"type":"string","title":"Customer Id","description":"ID of the customer (will be anonymized)"},"interaction":{"$ref":"#/components/schemas/InteractionData","description":"The interaction data to learn from"},"feedback":{"anyOf":[{"$ref":"#/components/schemas/FeedbackData"},{"type":"null"}],"description":"Optional feedback about the interaction"}},"type":"object","required":["employee_id","customer_id","interaction"],"title":"LearnSkillRequest","description":"Request to learn a skill from an interaction","example":{"customer_id":"customer_12345","employee_id":"atlas_001","feedback":{"rating":4.5,"success":true},"interaction":{"approach":"Propose 3 time options with timezone conversions","outcome":"success","success_factors":["Multiple options","Clear timezone info"],"task_type":"meeting_scheduling","tools_used":["calendar_api"]}}},"LinkTokenRequest":{"properties":{"organization_name":{"type":"string","title":"Organization Name","default":"LiquidCortex customer"},"email":{"type":"string","title":"Email","default":""}},"type":"object","title":"LinkTokenRequest"},"ListenProfileBody":{"properties":{"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords"},"sources":{"items":{"type":"string"},"type":"array","title":"Sources"},"subreddits":{"items":{"type":"string"},"type":"array","title":"Subreddits"},"window_hours":{"type":"integer","maximum":168.0,"minimum":1.0,"title":"Window Hours","default":48},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","default":20}},"type":"object","required":["keywords"],"title":"ListenProfileBody","description":"Same field validators as POST /listen/find (inherited), plus the\nkeyword x subreddit fan-out cap. ``limit`` is inherited but not saved."},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"remember_me":{"type":"boolean","title":"Remember Me","default":false}},"type":"object","required":["email","password"],"title":"LoginRequest","description":"User login request"},"MCPServerResponse":{"properties":{"server_id":{"type":"string","title":"Server Id"},"server_url":{"type":"string","title":"Server Url"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"tools_count":{"type":"integer","title":"Tools Count"},"is_connected":{"type":"boolean","title":"Is Connected"}},"type":"object","required":["server_id","server_url","name","tools_count","is_connected"],"title":"MCPServerResponse","description":"Response for a registered MCP server."},"MCPStatusResponse":{"properties":{"mcp_enabled":{"type":"boolean","title":"Mcp Enabled"},"bridge_connected":{"type":"boolean","title":"Bridge Connected"},"bridge_workspace":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bridge Workspace"},"bridge_tools_count":{"type":"integer","title":"Bridge Tools Count"},"mcp_servers":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Mcp Servers"},"total_tools":{"type":"integer","title":"Total Tools"}},"type":"object","required":["mcp_enabled","bridge_connected","bridge_workspace","bridge_tools_count","mcp_servers","total_tools"],"title":"MCPStatusResponse","description":"Overall MCP connection status."},"MCPToolCallRequest":{"properties":{"tool_name":{"type":"string","title":"Tool Name","description":"Name of the tool to call"},"arguments":{"additionalProperties":true,"type":"object","title":"Arguments","description":"Tool arguments"},"server_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Server Id","description":"Specific MCP server (if not bridge)"}},"type":"object","required":["tool_name"],"title":"MCPToolCallRequest","description":"Request to manually call a tool."},"MCPToolResponse":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"source":{"type":"string","title":"Source"},"server_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Server Id"}},"type":"object","required":["name","description","source"],"title":"MCPToolResponse","description":"Response for a single tool."},"ManualErrorRequest":{"properties":{"error_type":{"type":"string","maxLength":255,"title":"Error Type","description":"JS error class, e.g. 'TypeError'"},"error_message":{"type":"string","maxLength":4096,"title":"Error Message"},"stack_trace":{"anyOf":[{"type":"string","maxLength":16384},{"type":"null"}],"title":"Stack Trace"},"request_path":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Request Path"},"user_agent":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"User Agent"},"extra_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Context"}},"type":"object","required":["error_type","error_message"],"title":"ManualErrorRequest","description":"Frontend-submitted error payload.\n\nAll fields except `error_type` and `error_message` are optional. The\nfrontend should send as much context as it can; sparse payloads still\nproduce a deduped row."},"MatchingSkillResponse":{"properties":{"skill_id":{"type":"string","title":"Skill Id"},"skill_name":{"type":"string","title":"Skill Name"},"instructions":{"type":"string","title":"Instructions"},"matched_trigger":{"type":"string","title":"Matched Trigger"}},"type":"object","required":["skill_id","skill_name","instructions","matched_trigger"],"title":"MatchingSkillResponse","description":"Response for skill matching"},"MeetingTicketRequest":{"properties":{"employee_id":{"type":"string","title":"Employee Id"}},"type":"object","required":["employee_id"],"title":"MeetingTicketRequest","description":"Request to mint a live-meeting ticket for one employee."},"MeetingTicketResponse":{"properties":{"ticket":{"type":"string","title":"Ticket"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["ticket","expires_in"],"title":"MeetingTicketResponse","description":"Short-lived single-use ticket for the /live/{employee_id} handshake."},"MeshStatsResponse":{"properties":{"total_insights":{"type":"integer","title":"Total Insights"},"unique_sources":{"type":"integer","title":"Unique Sources"},"unique_recipients":{"type":"integer","title":"Unique Recipients"},"avg_impact_score":{"type":"number","title":"Avg Impact Score"},"inbox_sizes":{"additionalProperties":{"type":"integer"},"type":"object","title":"Inbox Sizes"}},"type":"object","required":["total_insights","unique_sources","unique_recipients","avg_impact_score","inbox_sizes"],"title":"MeshStatsResponse"},"MessageModel":{"properties":{"role":{"type":"string","enum":["system","user","assistant"],"title":"Role"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"MessageModel"},"MethodParameterSchema":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"required":{"type":"boolean","title":"Required"},"default":{"anyOf":[{},{"type":"null"}],"title":"Default"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name","type","required"],"title":"MethodParameterSchema","description":"Parameter schema for a method"},"MethodSchema":{"properties":{"method_name":{"type":"string","title":"Method Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"parameters":{"items":{"$ref":"#/components/schemas/MethodParameterSchema"},"type":"array","title":"Parameters"},"returns":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Returns"}},"type":"object","required":["method_name","parameters"],"title":"MethodSchema","description":"Complete method schema including parameters"},"MethodologyUsage":{"properties":{"methodology":{"type":"string","title":"Methodology"},"count":{"type":"integer","title":"Count"},"percentage":{"type":"number","title":"Percentage"}},"type":"object","required":["methodology","count","percentage"],"title":"MethodologyUsage"},"MethodologyUsageResponse":{"properties":{"usage":{"additionalProperties":{"type":"integer"},"type":"object","title":"Usage"},"total_entries":{"type":"integer","title":"Total Entries"}},"type":"object","required":["usage","total_entries"],"title":"MethodologyUsageResponse"},"MicrosoftOutlookStatus":{"properties":{"connected":{"type":"boolean","title":"Connected"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"scopes":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Scopes"},"connected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected At"}},"type":"object","required":["connected"],"title":"MicrosoftOutlookStatus","description":"Microsoft Outlook connection status"},"ModuleCompleteRequest":{"properties":{"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"Deprecated and IGNORED - the learner is the authenticated caller","deprecated":true},"answers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Answers"}},"type":"object","title":"ModuleCompleteRequest"},"MoveArtifactRequest":{"properties":{"to_stage_id":{"type":"string","title":"To Stage Id"},"exited_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exited By"}},"type":"object","required":["to_stage_id"],"title":"MoveArtifactRequest"},"MultiPlatformCompareRequest":{"properties":{"content":{"additionalProperties":true,"type":"object","title":"Content","description":"Content payload — same shape DigitalTwinConsumer.decide_content_engagement consumes (topics, hook_strength, quality_score, duration_seconds, format, trending, ...)."},"platforms":{"anyOf":[{"items":{"type":"string","enum":["tiktok","instagram_reels","youtube_shorts","x","linkedin"]},"type":"array"},{"type":"null"}],"title":"Platforms","description":"Subset of platforms; defaults to all five when omitted."},"population_size":{"type":"integer","maximum":10000.0,"minimum":100.0,"title":"Population Size","default":1000},"target_demographics":{"additionalProperties":true,"type":"object","title":"Target Demographics"},"sample_per_platform":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":10.0},{"type":"null"}],"title":"Sample Per Platform","description":"Cap on twins-per-platform. None = use full population for every platform (ideal for parallel fan-out)."},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed","description":"Optional deterministic seed for reproducible simulations."}},"type":"object","title":"MultiPlatformCompareRequest","description":"POST /api/v1/forum/multiplatform/compare body."},"MultiPlatformReport":{"properties":{"content_id":{"type":"string","title":"Content Id"},"content_summary":{"type":"string","title":"Content Summary"},"population_size":{"type":"integer","minimum":0.0,"title":"Population Size"},"platforms":{"items":{"$ref":"#/components/schemas/PlatformEngagementProfile"},"type":"array","title":"Platforms"},"winner_platform":{"type":"string","title":"Winner Platform"},"spread_factor":{"type":"number","minimum":1.0,"title":"Spread Factor","description":"Max viral_score / min viral_score across platforms. 1.0 means content performs identically everywhere; high values indicate platform-specific content."},"cross_platform_recommendation":{"type":"string","title":"Cross Platform Recommendation"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"base_persona_summary":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Base Persona Summary","description":"Mean of 6 trans-relevant fields over the base twin sample."}},"type":"object","required":["content_id","content_summary","population_size","platforms","winner_platform","spread_factor","cross_platform_recommendation"],"title":"MultiPlatformReport","description":"Comparative report across all simulated platforms."},"MultiYearDeal":{"properties":{"deal_id":{"type":"string","format":"uuid","title":"Deal Id"},"term_years":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Term Years"},"annual_values":{"items":{"type":"number"},"type":"array","title":"Annual Values"},"total_contract_value_usd":{"type":"number","title":"Total Contract Value Usd"},"discount_pct":{"type":"number","title":"Discount Pct"},"early_termination_clause":{"type":"string","title":"Early Termination Clause"},"expansion_credits_usd":{"type":"number","title":"Expansion Credits Usd"},"display_priority":{"type":"integer","enum":[1,2,3],"title":"Display Priority","default":1},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"info"},"chart_hint":{"type":"string","const":"bar","title":"Chart Hint","default":"bar"}},"type":"object","required":["term_years","annual_values","total_contract_value_usd","discount_pct","early_termination_clause","expansion_credits_usd"],"title":"MultiYearDeal","description":"Output of ``structure_multi_year``."},"MultiYearStructureRequest":{"properties":{"base_annual_value":{"type":"number","exclusiveMinimum":0.0,"title":"Base Annual Value"},"term_years":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Term Years"},"ramp_pattern":{"type":"string","enum":["flat","growing","back_loaded"],"title":"Ramp Pattern","default":"growing"}},"type":"object","required":["base_annual_value","term_years"],"title":"MultiYearStructureRequest"},"NicheCluster":{"properties":{"cluster_id":{"type":"string","title":"Cluster Id"},"primary_topic":{"type":"string","title":"Primary Topic"},"twin_count":{"type":"integer","minimum":1.0,"title":"Twin Count"},"avg_internal_density":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Avg Internal Density"}},"type":"object","required":["cluster_id","primary_topic","twin_count","avg_internal_density"],"title":"NicheCluster","description":"A topic-coherent sub-community.\n\nBuilt from twins sharing >=2 niche affinities. `avg_internal_density`\nis the mean number of social links between cluster members divided by\nthe maximum possible — a value in [0, 1] where 1.0 means every member\nis linked to every other member."},"NotificationPreferences":{"properties":{"email_on_critical":{"type":"boolean","title":"Email On Critical","default":true},"email_on_playbook_completed":{"type":"boolean","title":"Email On Playbook Completed","default":false},"slack_enabled":{"type":"boolean","title":"Slack Enabled","default":false}},"type":"object","title":"NotificationPreferences"},"NotificationSettings":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"notify_at_80":{"type":"boolean","title":"Notify At 80","default":true},"notify_at_95":{"type":"boolean","title":"Notify At 95","default":true},"notify_on_exhausted":{"type":"boolean","title":"Notify On Exhausted","default":true},"email_notifications":{"type":"boolean","title":"Email Notifications","default":true},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"}},"type":"object","required":["email"],"title":"NotificationSettings","description":"Credit notification settings"},"OAuthInitRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"}},"type":"object","required":["provider"],"title":"OAuthInitRequest","description":"Request to mint an OAuth-initiation ticket."},"OAuthInitResponse":{"properties":{"ticket":{"type":"string","title":"Ticket"},"expires_in":{"type":"integer","title":"Expires In"},"authorize_url":{"type":"string","title":"Authorize Url"}},"type":"object","required":["ticket","expires_in","authorize_url"],"title":"OAuthInitResponse","description":"Short-lived single-use ticket for the /authorize navigation."},"ObjectionEvent":{"properties":{"utterance_index":{"type":"integer","title":"Utterance Index"},"speaker_id":{"type":"string","title":"Speaker Id"},"objection_category":{"type":"string","enum":["price","timing","authority","need","trust","competition","feature_gap"],"title":"Objection Category"},"quoted_text":{"type":"string","title":"Quoted Text"},"rep_response_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rep Response Index"},"handled_well":{"type":"string","enum":["yes","no","partial","unknown"],"title":"Handled Well","default":"unknown"},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"notable"}},"type":"object","required":["utterance_index","speaker_id","objection_category","quoted_text"],"title":"ObjectionEvent"},"ObjectionHandler":{"properties":{"objection_category":{"type":"string","enum":["price","timing","authority","need","trust","competition","feature_gap"],"title":"Objection Category"},"rep_response":{"type":"string","title":"Rep Response"},"follow_up_questions":{"items":{"type":"string"},"type":"array","title":"Follow Up Questions"},"proof_points_to_share":{"items":{"type":"string"},"type":"array","title":"Proof Points To Share"},"landmines_to_avoid":{"items":{"type":"string"},"type":"array","title":"Landmines To Avoid"},"display_priority":{"type":"integer","enum":[1,2,3],"title":"Display Priority","default":2},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"notable"}},"type":"object","required":["objection_category","rep_response","follow_up_questions","proof_points_to_share","landmines_to_avoid"],"title":"ObjectionHandler","description":"Scripted response for a single objection_category."},"OnboardingCompleteRequest":{"properties":{"bottleneck":{"type":"string","title":"Bottleneck","description":"Which bottleneck the user selected (support, content, deals, compliance)"},"matched_employee":{"type":"string","title":"Matched Employee","description":"Employee ID auto-matched to the bottleneck","default":"atlas"},"tried_demo":{"type":"boolean","title":"Tried Demo","description":"Whether the user interacted with the embedded demo chat","default":false}},"type":"object","required":["bottleneck"],"title":"OnboardingCompleteRequest","description":"Payload from the frontend onboarding wizard (Step 4 CTA)."},"OpinionPolarization":{"properties":{"metric":{"type":"string","enum":["watch_completion","share_propensity","comment_likelihood"],"title":"Metric"},"bimodality_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Bimodality Score"},"mode_1_size":{"type":"integer","minimum":0.0,"title":"Mode 1 Size"},"mode_2_size":{"type":"integer","minimum":0.0,"title":"Mode 2 Size"}},"type":"object","required":["metric","bimodality_score","mode_1_size","mode_2_size"],"title":"OpinionPolarization","description":"Bimodality of an engagement-trait distribution.\n\n`bimodality_score` is computed via the Sarle bimodality coefficient\napproximation:\n    b = (skew^2 + 1) / (kurt + 3*((n-1)^2 / ((n-2)*(n-3))))\nClamped to [0, 1]; 0 = unimodal Gaussian-like, 1 = fully bimodal.\n\n`mode_1_size` and `mode_2_size` are the counts of twins on each side\nof the trait's median when bimodality_score > 0.55 (the standard\ninterpretation cutoff). When unimodal, mode_2_size is 0."},"OutlookCalendarListResponse":{"properties":{"events":{"items":{},"type":"array","title":"Events"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["events","count"],"title":"OutlookCalendarListResponse","description":"Response for listing calendar events"},"OutlookMailListResponse":{"properties":{"emails":{"items":{},"type":"array","title":"Emails"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["emails","count"],"title":"OutlookMailListResponse","description":"Response for listing emails"},"PageVisitInput":{"properties":{"url":{"type":"string","title":"Url"},"page_type":{"type":"string","title":"Page Type","description":"pricing | product | docs | blog | case_study | careers | about | contact | demo | platform | developers"},"timestamp":{"type":"string","title":"Timestamp","description":"ISO-8601 timestamp"},"duration_seconds":{"type":"number","minimum":0.0,"title":"Duration Seconds","description":"Time spent on page in seconds"},"referrer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referrer"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["url","page_type","timestamp","duration_seconds"],"title":"PageVisitInput","description":"Single page visit from the tracking pixel."},"PaginatedDecisions":{"properties":{"decisions":{"items":{"$ref":"#/components/schemas/DecisionSummary"},"type":"array","title":"Decisions"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"total_pages":{"type":"integer","title":"Total Pages"}},"type":"object","required":["decisions","total","page","per_page","total_pages"],"title":"PaginatedDecisions"},"PairRequest":{"properties":{"code":{"type":"string","maxLength":6,"minLength":6,"title":"Code","description":"6-char pairing code"},"user_id":{"type":"string","title":"User Id","description":"LiquidCortex user ID"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"LiquidCortex email"}},"type":"object","required":["code","user_id"],"title":"PairRequest","description":"Request to link a platform user to a LiquidCortex account."},"PauseResumeResponse":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"tasks_cancelled":{"type":"integer","title":"Tasks Cancelled","default":0}},"type":"object","required":["employee_id","status","message"],"title":"PauseResumeResponse"},"PeakHour":{"properties":{"hour":{"type":"integer","title":"Hour"},"tasks":{"type":"integer","title":"Tasks"}},"type":"object","required":["hour","tasks"],"title":"PeakHour"},"PerformanceDataRequest":{"properties":{"actual_views":{"type":"integer","minimum":0.0,"title":"Actual Views"},"actual_engagement_rate":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Actual Engagement Rate"},"actual_shares":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Actual Shares"},"posted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted At"}},"type":"object","required":["actual_views"],"title":"PerformanceDataRequest","description":"Submit actual post-publish metrics for a prediction."},"PersistSimulationRequest":{"properties":{"importance_threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Importance Threshold","default":0.0},"max_snapshots":{"type":"integer","maximum":50000.0,"minimum":1.0,"title":"Max Snapshots","default":10000}},"type":"object","title":"PersistSimulationRequest","description":"Optional knobs for the persist endpoint.\n\nDefaults are tuned for the \"save my audience\" user moment:\nimportance_threshold=0.0 (persist EVERY twin so A/B variants run\nagainst the full population, not just heavy hitters). Callers can\nraise the threshold if they want only the top influencers preserved."},"PersistSimulationResponse":{"properties":{"snapshot_id":{"type":"string","title":"Snapshot Id"},"twin_count":{"type":"integer","title":"Twin Count"},"persisted_at":{"type":"string","format":"date-time","title":"Persisted At"},"sim_id":{"type":"string","title":"Sim Id"}},"type":"object","required":["snapshot_id","twin_count","persisted_at","sim_id"],"title":"PersistSimulationResponse"},"PipelineEdge":{"properties":{"from_stage":{"type":"string","title":"From Stage"},"to_stage":{"type":"string","title":"To Stage"},"flow_volume_7d":{"type":"integer","minimum":0.0,"title":"Flow Volume 7D"},"median_transit_hours":{"type":"number","title":"Median Transit Hours","default":0.0}},"type":"object","required":["from_stage","to_stage","flow_volume_7d"],"title":"PipelineEdge","description":"One transition as it appears on the rendered flow-chart.\n\nflow_volume_7d: artifacts that moved across this edge in the last 7d\n(line thickness encoding). median_transit_hours: typical time from\nentering `from_stage` to entering `to_stage`."},"PipelineNode":{"properties":{"stage_id":{"type":"string","title":"Stage Id"},"label":{"type":"string","title":"Label"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"tool_type":{"$ref":"#/components/schemas/PipelineToolType"},"role_assigned":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Assigned"},"wip_count":{"type":"integer","minimum":0.0,"title":"Wip Count"},"is_bottleneck":{"type":"boolean","title":"Is Bottleneck","default":false},"avg_dwell_hours":{"type":"number","title":"Avg Dwell Hours","default":0.0},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"info"}},"type":"object","required":["stage_id","label","tool_type","wip_count"],"title":"PipelineNode","description":"One stage as it appears on the rendered flow-chart."},"PipelineStage":{"properties":{"stage_id":{"type":"string","title":"Stage Id"},"name":{"type":"string","title":"Name"},"sequence_index":{"type":"integer","minimum":0.0,"title":"Sequence Index"},"tool_type":{"$ref":"#/components/schemas/PipelineToolType"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"role_assigned":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Assigned"},"avg_dwell_hours":{"type":"number","title":"Avg Dwell Hours","default":24.0},"sla_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sla Hours"}},"type":"object","required":["stage_id","name","sequence_index","tool_type"],"title":"PipelineStage","description":"One node in a customer's pipeline definition.\n\nsla_hours: customer's own promise. If an artifact dwells past\nsla_hours * 1.5, the derived view marks the stage as a bottleneck."},"PipelineStageCreate":{"properties":{"org_id":{"type":"string","title":"Org Id"},"stage_name":{"type":"string","maxLength":100,"title":"Stage Name"},"stage_order":{"type":"integer","title":"Stage Order"},"default_probability":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Default Probability","default":50},"is_closed_won":{"type":"boolean","title":"Is Closed Won","default":false},"is_closed_lost":{"type":"boolean","title":"Is Closed Lost","default":false}},"type":"object","required":["org_id","stage_name","stage_order"],"title":"PipelineStageCreate","description":"Request body to create a pipeline stage."},"PipelineStageUpdate":{"properties":{"stage_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Stage Name"},"stage_order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stage Order"},"default_probability":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Default Probability"},"is_closed_won":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Closed Won"},"is_closed_lost":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Closed Lost"}},"type":"object","title":"PipelineStageUpdate","description":"Request body to update a pipeline stage."},"PipelineToolType":{"type":"string","enum":["ingestion","ideation","production_text","production_visual","production_video","production_audio","scheduling","distribution","audience_response","analytics"],"title":"PipelineToolType","description":"Coarse classification of what a stage's tool DOES.\n\nMirrors the functional bands in Charlie Hills's diagram (intake →\nideate → produce → schedule → distribute → respond → measure).\nCustomers tag each stage so the dashboard can group / icon-render\nconsistently across heterogenous tool stacks."},"PipelineView":{"properties":{"pipeline_id":{"type":"string","title":"Pipeline Id"},"nodes":{"items":{"$ref":"#/components/schemas/PipelineNode"},"type":"array","title":"Nodes"},"edges":{"items":{"$ref":"#/components/schemas/PipelineEdge"},"type":"array","title":"Edges"},"overall_throughput_7d":{"type":"integer","minimum":0.0,"title":"Overall Throughput 7D"},"bottlenecks":{"items":{"type":"string"},"type":"array","title":"Bottlenecks"},"recommendations":{"items":{"type":"string"},"type":"array","title":"Recommendations"},"chart_hint":{"type":"string","const":"flow_chart","title":"Chart Hint","default":"flow_chart"},"accent_color":{"type":"string","title":"Accent Color","default":"#EC4899"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["pipeline_id","nodes","edges","overall_throughput_7d"],"title":"PipelineView","description":"Renderable dashboard payload — shaped for a flow-chart UI.\n\nchart_hint pins the renderer. accent_color matches the Forum\nvertical accent (#EC4899). Bottlenecks are surfaced both\nper-node (is_bottleneck flag) and as a top-3 list with templated\nrecommendations strings."},"PlanRequest":{"properties":{"goal":{"type":"string","maxLength":4000,"minLength":3,"title":"Goal","description":"High-level goal to decompose"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Optional context (e.g. constraints, preferences)"}},"type":"object","required":["goal"],"title":"PlanRequest","description":"Submit a high-level goal for decomposition into tasks."},"PlanResponse":{"properties":{"id":{"type":"string","title":"Id"},"goal":{"type":"string","title":"Goal"},"tasks":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tasks"},"total_estimated_ncu":{"type":"integer","title":"Total Estimated Ncu"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","goal","tasks","total_estimated_ncu","created_at"],"title":"PlanResponse"},"PlatformEngagementProfile":{"properties":{"platform":{"type":"string","title":"Platform"},"accent_color":{"type":"string","title":"Accent Color"},"sample_size":{"type":"integer","minimum":0.0,"title":"Sample Size"},"metrics":{"additionalProperties":{"type":"number"},"type":"object","title":"Metrics"},"relative_performance":{"type":"string","enum":["best","average","worst"],"title":"Relative Performance","default":"average"},"persona_divergence_score":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Persona Divergence Score","description":"Mean L1 distance over 6 transformed twin fields, normalized to [0,1]."},"persona_transform_multipliers":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Persona Transform Multipliers","description":"The 6 multipliers applied to twin fields on this platform. None = identity / not applied."},"persona_transform_rationale":{"anyOf":[{"type":"string","maxLength":600},{"type":"null"}],"title":"Persona Transform Rationale","description":"Free-form justification for this platform's persona shift."}},"type":"object","required":["platform","accent_color","sample_size","metrics"],"title":"PlatformEngagementProfile","description":"Aggregated engagement metrics for one platform's twin sample."},"PlatformWebhookPayload":{"properties":{"prediction_id":{"type":"string","title":"Prediction Id"},"platform":{"type":"string","title":"Platform"},"actual_views":{"type":"integer","minimum":0.0,"title":"Actual Views"},"actual_engagement_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Actual Engagement Rate"},"actual_shares":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Actual Shares"},"posted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted At"},"webhook_source":{"type":"string","title":"Webhook Source","default":"manual"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},"type":"object","required":["prediction_id","platform","actual_views"],"title":"PlatformWebhookPayload","description":"Generic webhook payload from platform integrations."},"PortalRequest":{"properties":{"return_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return Url","description":"URL to redirect after portal session"}},"type":"object","title":"PortalRequest"},"PredictRequest":{"properties":{"content_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Url"},"content_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Text"},"platform":{"type":"string","title":"Platform","default":"tiktok"},"target_demographics":{"additionalProperties":true,"type":"object","title":"Target Demographics"},"population_size":{"type":"integer","maximum":10000.0,"minimum":100.0,"title":"Population Size","default":1000},"hook_strength":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Hook Strength","default":0.5},"quality_score":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Quality Score","default":0.5},"duration_seconds":{"anyOf":[{"type":"integer","maximum":600.0,"minimum":1.0},{"type":"null"}],"title":"Duration Seconds","default":15},"refine_iterations":{"type":"integer","maximum":3.0,"minimum":0.0,"title":"Refine Iterations","default":0},"include_robustness":{"type":"boolean","title":"Include Robustness","default":false}},"type":"object","title":"PredictRequest","description":"Request body for POST /predict.\n\nPhase 4.2 fix: empire routes previously used FastAPI scalar params,\nwhich forced query-string encoding. The frontend wizard sends JSON\nbody, so this Pydantic model aligns backend to the wire format the\nfrontend already uses."},"PricingContext":{"properties":{"deal_id":{"type":"string","title":"Deal Id"},"customer_size":{"type":"string","enum":["smb","mid_market","enterprise"],"title":"Customer Size"},"competitive_pressure":{"type":"string","enum":["none","soft","hard"],"title":"Competitive Pressure"},"deal_complexity":{"type":"string","enum":["standard","custom","transformational"],"title":"Deal Complexity"},"customer_budget_signal":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Customer Budget Signal","description":"If provided, anchor recommended price near this figure (capped at floor)."},"timeline_urgency":{"type":"string","enum":["low","medium","high"],"title":"Timeline Urgency"}},"type":"object","required":["deal_id","customer_size","competitive_pressure","deal_complexity","timeline_urgency"],"title":"PricingContext","description":"Inputs for ``recommend_pricing``."},"PricingRecommendRequest":{"properties":{"context":{"$ref":"#/components/schemas/PricingContext"},"our_pricing_floors":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Our Pricing Floors","description":"Optional override of floor pct by customer_size (keys: smb, mid_market, enterprise; values 0.50-1.0)."}},"type":"object","required":["context"],"title":"PricingRecommendRequest"},"PricingRecommendation":{"properties":{"recommendation_id":{"type":"string","format":"uuid","title":"Recommendation Id"},"recommended_tier":{"type":"string","title":"Recommended Tier"},"list_price_usd":{"type":"number","title":"List Price Usd"},"suggested_floor_price_usd":{"type":"number","title":"Suggested Floor Price Usd"},"discount_pct_max":{"type":"number","title":"Discount Pct Max"},"justification":{"items":{"type":"string"},"type":"array","title":"Justification"},"deal_levers":{"items":{"type":"string"},"type":"array","title":"Deal Levers"},"risk_factors":{"items":{"type":"string"},"type":"array","title":"Risk Factors"},"display_priority":{"type":"integer","enum":[1,2,3],"title":"Display Priority","default":1},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"notable"}},"type":"object","required":["recommended_tier","list_price_usd","suggested_floor_price_usd","discount_pct_max","justification","deal_levers","risk_factors"],"title":"PricingRecommendation","description":"Output of ``recommend_pricing``."},"PricingTier":{"type":"string","enum":["starter","manager","agency"],"title":"PricingTier"},"PricingTierResponse":{"properties":{"tier":{"type":"string","title":"Tier"},"name":{"type":"string","title":"Name"},"tagline":{"type":"string","title":"Tagline"},"price_monthly":{"type":"integer","title":"Price Monthly"},"price_yearly":{"type":"integer","title":"Price Yearly"},"credits_monthly":{"type":"integer","title":"Credits Monthly"},"employees_count":{"type":"integer","title":"Employees Count"},"can_use_browser":{"type":"boolean","title":"Can Use Browser"},"safety_cap":{"type":"string","title":"Safety Cap"},"features":{"items":{"type":"string"},"type":"array","title":"Features"},"access_methods":{"items":{"type":"string"},"type":"array","title":"Access Methods"}},"type":"object","required":["tier","name","tagline","price_monthly","price_yearly","credits_monthly","employees_count","can_use_browser","safety_cap","features","access_methods"],"title":"PricingTierResponse"},"PrimePopulationRequest":{"properties":{"seed":{"$ref":"#/components/schemas/SeedInput"},"population_id":{"type":"string","title":"Population Id","description":"sim_id of a live simulation in the registry"},"priming_strength":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Priming Strength","default":0.3}},"type":"object","required":["seed","population_id"],"title":"PrimePopulationRequest","description":"POST /api/v1/forum/seed/prime body.\n\nArgs:\n    seed: the real-world signal to prime against.\n    population_id: sim_id of an existing live simulation in the\n        in-process SimulationRegistry. The endpoint mutates that\n        simulation's ``digital_twins`` list in place.\n    priming_strength: optional override for the builder's default\n        (0.3). Lower = more conservative priming, higher = more\n        reactive population. Capped at 1.0."},"ProfileCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"niche":{"type":"string","maxLength":4000,"minLength":1,"title":"Niche"},"audience":{"additionalProperties":true,"type":"object","title":"Audience"},"intake":{"$ref":"#/components/schemas/ProfileIntake"},"writing_samples":{"items":{"type":"string"},"type":"array","title":"Writing Samples"},"voice_guide":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Voice Guide"},"activate":{"type":"boolean","title":"Activate","default":true}},"type":"object","required":["name","niche"],"title":"ProfileCreate"},"ProfileIntake":{"properties":{"transformation":{"type":"string","maxLength":4000,"title":"Transformation","default":""},"point_of_view":{"type":"string","maxLength":4000,"title":"Point Of View","default":""},"desired_reaction":{"type":"string","maxLength":2000,"title":"Desired Reaction","default":""},"offer":{"type":"string","maxLength":4000,"title":"Offer","default":""},"anti_list":{"items":{"type":"string"},"type":"array","title":"Anti List"}},"type":"object","title":"ProfileIntake"},"PropagateInsightRequest":{"properties":{"source_employee":{"type":"string","maxLength":64,"minLength":1,"title":"Source Employee"},"insight":{"type":"string","maxLength":4000,"minLength":3,"title":"Insight"},"impact_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Impact Score"},"task_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Task Context"}},"type":"object","required":["source_employee","insight","impact_score"],"title":"PropagateInsightRequest"},"PropagateInsightResponse":{"properties":{"insight_id":{"type":"string","title":"Insight Id"},"source_employee":{"type":"string","title":"Source Employee"},"recipients":{"items":{"type":"string"},"type":"array","title":"Recipients"},"impact_score":{"type":"number","title":"Impact Score"}},"type":"object","required":["insight_id","source_employee","recipients","impact_score"],"title":"PropagateInsightResponse"},"Proposal":{"properties":{"proposal_id":{"type":"string","format":"uuid","title":"Proposal Id"},"tenant_id":{"type":"string","minLength":1,"title":"Tenant Id"},"customer_id":{"type":"string","title":"Customer Id"},"sections":{"items":{"$ref":"#/components/schemas/ProposalSection"},"type":"array","title":"Sections"},"pricing_tier_recommended":{"type":"string","title":"Pricing Tier Recommended"},"total_value_usd":{"type":"number","title":"Total Value Usd"},"delivery_timeline_weeks":{"type":"integer","title":"Delivery Timeline Weeks"},"display_priority":{"type":"integer","enum":[1,2,3],"title":"Display Priority","default":1},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"notable"},"chart_hint":{"type":"string","const":"timeline","title":"Chart Hint","default":"timeline"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["tenant_id","customer_id","sections","pricing_tier_recommended","total_value_usd","delivery_timeline_weeks"],"title":"Proposal","description":"A complete proposal artifact."},"ProposalGenerateRequest":{"properties":{"customer_context":{"additionalProperties":true,"type":"object","title":"Customer Context"},"qualification":{"$ref":"#/components/schemas/RFPQualification"},"roi":{"$ref":"#/components/schemas/ROIModel"}},"type":"object","required":["customer_context","qualification","roi"],"title":"ProposalGenerateRequest"},"ProposalSection":{"properties":{"section_id":{"type":"string","title":"Section Id"},"title":{"type":"string","title":"Title"},"body":{"type":"string","title":"Body"},"section_type":{"type":"string","enum":["executive_summary","problem_statement","solution","pricing","timeline","team","case_studies"],"title":"Section Type"}},"type":"object","required":["section_id","title","body","section_type"],"title":"ProposalSection","description":"One section of a proposal."},"ProviderInfo":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"oauth_type":{"type":"string","title":"Oauth Type"},"developer_portal":{"type":"string","title":"Developer Portal"},"default_scopes":{"items":{"type":"string"},"type":"array","title":"Default Scopes"},"use_cases":{"items":{"type":"string"},"type":"array","title":"Use Cases"}},"type":"object","required":["id","name","oauth_type","developer_portal","default_scopes","use_cases"],"title":"ProviderInfo","description":"Information about an available provider."},"PublishRequest":{"properties":{"conversation":{"$ref":"#/components/schemas/ConversationIn"},"text":{"type":"string","maxLength":10000,"minLength":1,"title":"Text"}},"type":"object","required":["conversation","text"],"title":"PublishRequest"},"QueryRequest":{"properties":{"query":{"type":"string","maxLength":5000,"minLength":1,"title":"Query","description":"Search query"},"top_k":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Top K","description":"Number of results","default":5},"similarity_threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Similarity Threshold","description":"Minimum similarity","default":0.7},"employee_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id","description":"Filter by employee context"}},"type":"object","required":["query"],"title":"QueryRequest","description":"Semantic search query request"},"QueryResponse":{"properties":{"query":{"type":"string","title":"Query"},"results":{"items":{"$ref":"#/components/schemas/ChunkResult"},"type":"array","title":"Results"},"count":{"type":"integer","title":"Count"},"search_time_ms":{"type":"integer","title":"Search Time Ms"}},"type":"object","required":["query","results","count","search_time_ms"],"title":"QueryResponse","description":"Semantic search response"},"RFPQualification":{"properties":{"rfp_id":{"type":"string","title":"Rfp Id"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"fit_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Fit Score"},"fit_factors":{"additionalProperties":{"type":"number"},"type":"object","title":"Fit Factors"},"recommended_action":{"type":"string","enum":["pursue","qualify_further","decline"],"title":"Recommended Action"},"decline_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decline Reason"},"estimated_win_probability":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Estimated Win Probability"},"display_priority":{"type":"integer","enum":[1,2,3],"title":"Display Priority","default":1},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"notable"},"chart_hint":{"type":"string","const":"bar","title":"Chart Hint","default":"bar"},"qualified_at":{"type":"string","format":"date-time","title":"Qualified At"}},"type":"object","required":["rfp_id","fit_score","recommended_action","estimated_win_probability"],"title":"RFPQualification","description":"Deterministic RFP fit scorecard.\n\nfit_score is a weighted combination of fit_factors. Recommendation is\nthreshold-driven: pursue >= 0.7, qualify_further 0.4..0.7, decline < 0.4."},"RFPQualifyRequest":{"properties":{"rfp_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rfp Id"},"rfp_text":{"type":"string","minLength":1,"title":"Rfp Text"},"our_capabilities":{"additionalProperties":true,"type":"object","title":"Our Capabilities","description":"Shape: {tags: list[str], target_deal_size: float, lead_time_weeks: int}"},"budget_signal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Budget Signal"}},"type":"object","required":["rfp_text","our_capabilities"],"title":"RFPQualifyRequest"},"ROIModel":{"properties":{"model_id":{"type":"string","format":"uuid","title":"Model Id"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"customer_id":{"type":"string","title":"Customer Id"},"inputs":{"additionalProperties":{"type":"number"},"type":"object","title":"Inputs"},"outputs":{"additionalProperties":{"type":"number"},"type":"object","title":"Outputs"},"sensitivity_analysis":{"additionalProperties":{"additionalProperties":{"type":"number"},"type":"object"},"type":"object","title":"Sensitivity Analysis"},"display_priority":{"type":"integer","enum":[1,2,3],"title":"Display Priority","default":1},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"notable"},"chart_hint":{"type":"string","enum":["bar","waterfall"],"title":"Chart Hint","default":"waterfall"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["customer_id","inputs","outputs","sensitivity_analysis"],"title":"ROIModel","description":"Deterministic 3-year customer ROI model.\n\ninputs: {current_cost, projected_savings_pct, hours_saved_per_week,\n         hourly_rate, deployment_cost}\noutputs: {year_1_savings, year_3_npv_at_10pct, payback_months, irr}\nsensitivity_analysis: {pessimistic, base, optimistic} — scaled NPV"},"ROIModelRequest":{"properties":{"customer_id":{"type":"string","minLength":1,"title":"Customer Id"},"inputs":{"additionalProperties":{"type":"number"},"type":"object","title":"Inputs","description":"Required keys: current_cost, projected_savings_pct, hours_saved_per_week, hourly_rate, deployment_cost"}},"type":"object","required":["customer_id","inputs"],"title":"ROIModelRequest"},"RecipientContext":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Recipient's name"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Recipient's job title"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company","description":"Recipient's company name"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry","description":"Recipient's industry"},"company_size":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Size","description":"e.g. 'startup', 'mid-market', 'enterprise'"}},"type":"object","title":"RecipientContext","description":"Optional context about the email recipient for personalization scoring."},"RecordOutcomeRequest":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the skill application was successful"},"feedback":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback","description":"Optional feedback about the application"},"improvement_suggestions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Improvement Suggestions","description":"Suggestions for improving the skill"}},"type":"object","required":["success"],"title":"RecordOutcomeRequest","description":"Request to record the outcome of a skill application","example":{"feedback":"Worked great for cross-timezone scheduling","improvement_suggestions":"Could add video conferencing link generation","success":true}},"RegisterMCPServerRequest":{"properties":{"server_url":{"type":"string","title":"Server Url","description":"Streamable HTTP URL of the MCP server"},"auth_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Token","description":"Bearer token for server authentication"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Human-readable name for this server"}},"type":"object","required":["server_url"],"title":"RegisterMCPServerRequest","description":"Request to register an external MCP server."},"RegisterRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"full_name":{"type":"string","title":"Full Name"}},"type":"object","required":["email","password","full_name"],"title":"RegisterRequest","description":"User registration request"},"RegistrySummaryResponse":{"properties":{"total_employees":{"type":"integer","title":"Total Employees"},"phases":{"additionalProperties":{"type":"integer"},"type":"object","title":"Phases"},"departments":{"additionalProperties":{"type":"integer"},"type":"object","title":"Departments"},"employee_ids":{"items":{"type":"string"},"type":"array","title":"Employee Ids"}},"type":"object","required":["total_employees","phases","departments","employee_ids"],"title":"RegistrySummaryResponse","description":"Registry summary response"},"RejectionRequest":{"properties":{"request_id":{"type":"string","title":"Request Id","description":"Approval request ID"},"reason":{"type":"string","title":"Reason","description":"Rejection reason"}},"type":"object","required":["request_id","reason"],"title":"RejectionRequest","description":"HITL rejection request. Rejector identity comes from the JWT."},"ReloadResponse":{"properties":{"status":{"type":"string","title":"Status"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"message":{"type":"string","title":"Message"}},"type":"object","required":["status","message"],"title":"ReloadResponse"},"ReportSection":{"properties":{"section_id":{"type":"string","title":"Section Id"},"title":{"type":"string","title":"Title"},"display_priority":{"type":"integer","enum":[1,2,3],"title":"Display Priority"},"chart_hint":{"type":"string","enum":["sparkline","bar","heatmap","network","table"],"title":"Chart Hint"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"severity_tier":{"type":"string","enum":["info","notable","critical"],"title":"Severity Tier","default":"info"}},"type":"object","required":["section_id","title","display_priority","chart_hint"],"title":"ReportSection","description":"A single dashboard section. The frontend renders these in priority order.\n\n`payload` is intentionally a free dict so each section can carry its\nnatural shape (the canonical typed lists below are also surfaced at the\nreport root for direct typed access). Section payloads echo the typed\nshapes for self-contained rendering of a single card."},"RequestStatus":{"type":"string","enum":["pending","in_review","in_progress","completed","rejected"],"title":"RequestStatus"},"ResendVerificationRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ResendVerificationRequest","description":"Resend email verification"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordRequest","description":"Password reset confirmation"},"ResolveApprovalRequest":{"properties":{"decision":{"type":"string","title":"Decision"}},"type":"object","required":["decision"],"title":"ResolveApprovalRequest"},"ResolveRequest":{"properties":{"resolved_by":{"type":"string","maxLength":255,"title":"Resolved By"},"note":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Note"}},"type":"object","required":["resolved_by"],"title":"ResolveRequest"},"ResolveResponse":{"properties":{"error_hash":{"type":"string","title":"Error Hash"},"status":{"type":"string","title":"Status"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By"},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved At"}},"type":"object","required":["error_hash","status"],"title":"ResolveResponse"},"RestoreSimulationResponse":{"properties":{"new_sim_id":{"type":"string","title":"New Sim Id"},"source_snapshot_id":{"type":"string","title":"Source Snapshot Id"},"twin_count":{"type":"integer","title":"Twin Count"},"restored_at":{"type":"string","format":"date-time","title":"Restored At"}},"type":"object","required":["new_sim_id","source_snapshot_id","twin_count","restored_at"],"title":"RestoreSimulationResponse"},"RetainIQSettings":{"properties":{"risk_thresholds":{"$ref":"#/components/schemas/RiskThresholds"},"health_weights":{"$ref":"#/components/schemas/HealthWeights"},"notification_preferences":{"$ref":"#/components/schemas/NotificationPreferences"},"survival_model_enabled":{"type":"boolean","title":"Survival Model Enabled","default":false}},"type":"object","title":"RetainIQSettings"},"RevOpsSettings":{"properties":{"forecast_cadence":{"type":"string","title":"Forecast Cadence","description":"daily | weekly | monthly","default":"weekly"},"stale_deal_threshold_days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Stale Deal Threshold Days","default":14},"deal_scoring_weights":{"additionalProperties":{"type":"number"},"type":"object","title":"Deal Scoring Weights"},"crm_sync_frequency":{"type":"integer","maximum":1440.0,"minimum":1.0,"title":"Crm Sync Frequency","description":"minutes","default":15},"ml_scoring_enabled":{"type":"boolean","title":"Ml Scoring Enabled","default":false},"notification_preferences":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Notification Preferences"}},"type":"object","title":"RevOpsSettings","description":"User-facing RevOps settings, persisted in UserEntitlement.feature_flags."},"ReviewAppeal":{"properties":{"appeal_note":{"type":"string","maxLength":2000,"minLength":1,"title":"Appeal Note"}},"type":"object","required":["appeal_note"],"title":"ReviewAppeal","description":"Payload to appeal a decided item."},"ReviewClaim":{"properties":{"assigned_to":{"type":"string","maxLength":255,"minLength":1,"title":"Assigned To"}},"type":"object","required":["assigned_to"],"title":"ReviewClaim","description":"Payload to claim a pending item."},"ReviewDecide":{"properties":{"decision":{"$ref":"#/components/schemas/ReviewDecisionValue"},"assigned_to":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Assigned To"}},"type":"object","required":["decision"],"title":"ReviewDecide","description":"Payload to decide a claimed item."},"ReviewDecisionValue":{"type":"string","enum":["upheld","overturned"],"title":"ReviewDecisionValue","description":"The outcome a moderator (or appeal reviewer) records."},"ReviewEnqueue":{"properties":{"event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Id"},"content_excerpt":{"type":"string","maxLength":4000,"title":"Content Excerpt","default":""},"reason":{"type":"string","maxLength":1000,"title":"Reason","default":""}},"type":"object","title":"ReviewEnqueue","description":"Payload to enqueue a new review item."},"ReviewQueueItem":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Id"},"content_excerpt":{"type":"string","title":"Content Excerpt","default":""},"reason":{"type":"string","title":"Reason","default":""},"status":{"$ref":"#/components/schemas/ReviewStatus","default":"pending"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"},"decision":{"anyOf":[{"$ref":"#/components/schemas/ReviewDecisionValue"},{"type":"null"}]},"appeal_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appeal Note"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id"],"title":"ReviewQueueItem","description":"A single item in the moderator review queue."},"ReviewResolve":{"properties":{"decision":{"$ref":"#/components/schemas/ReviewDecisionValue"},"resolution_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Resolution Note"}},"type":"object","required":["decision"],"title":"ReviewResolve","description":"Payload to resolve an appealed item with a final decision."},"ReviewStatus":{"type":"string","enum":["pending","claimed","decided","appealed","resolved"],"title":"ReviewStatus","description":"Lifecycle state of a review-queue item.\n\nState machine (the moderator UX contract):\n    pending  -> claimed   (moderator claims the item)\n    claimed  -> decided   (moderator upholds or overturns)\n    decided  -> appealed  (subject appeals the decision)\n    appealed -> resolved  (appeal reviewer issues a final decision)"},"RevokeKeyResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"revoked_at":{"type":"string","title":"Revoked At"}},"type":"object","required":["success","message","revoked_at"],"title":"RevokeKeyResponse","description":"Response when key is revoked"},"RiskDashboardResponse":{"properties":{"compliance_score":{"type":"number","title":"Compliance Score"},"total_decisions":{"type":"integer","title":"Total Decisions"},"risk_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Risk Distribution"},"recent_risk_events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Recent Risk Events"},"human_approval_rate":{"type":"number","title":"Human Approval Rate"},"top_risk_employees":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Top Risk Employees"},"methodology_usage":{"additionalProperties":{"type":"integer"},"type":"object","title":"Methodology Usage"},"disclaimer":{"type":"string","title":"Disclaimer"}},"type":"object","required":["compliance_score","total_decisions","risk_distribution","recent_risk_events","human_approval_rate","top_risk_employees","methodology_usage","disclaimer"],"title":"RiskDashboardResponse"},"RiskThresholds":{"properties":{"critical":{"type":"number","title":"Critical","default":30.0},"high":{"type":"number","title":"High","default":50.0},"medium":{"type":"number","title":"Medium","default":70.0}},"type":"object","title":"RiskThresholds"},"Rule":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description","default":""},"sml_content":{"type":"string","title":"Sml Content"},"category":{"$ref":"#/components/schemas/RuleCategory"},"severity":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Severity","default":3},"is_active":{"type":"boolean","title":"Is Active","default":true},"version":{"type":"integer","title":"Version","default":1},"parent_rule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Rule Id"},"created_by":{"type":"string","title":"Created By","default":""},"source_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Template"},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","name","sml_content","category"],"title":"Rule","description":"A moderation rule written in SML (Shield Markup Language)."},"RuleCategory":{"type":"string","enum":["spam","abuse","fraud","bot","content","custom"],"title":"RuleCategory","description":"High-level category for a moderation rule."},"RuleCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"type":"string","title":"Description","default":""},"sml_content":{"type":"string","minLength":1,"title":"Sml Content"},"category":{"$ref":"#/components/schemas/RuleCategory"},"severity":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Severity","default":3},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["name","sml_content","category"],"title":"RuleCreate","description":"Payload for creating a new rule."},"RuleDeployItem":{"properties":{"name":{"type":"string","title":"Name","description":"Rule identifier (used as filename stem)"},"sml_content":{"type":"string","title":"Sml Content","description":"SML rule body"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the rule should be deployed","default":true}},"type":"object","required":["name","sml_content"],"title":"RuleDeployItem","description":"A single rule to deploy."},"RuleFromNaturalLanguage":{"properties":{"description":{"type":"string","minLength":10,"title":"Description","description":"Plain-English description of the desired rule."},"category":{"$ref":"#/components/schemas/RuleCategory"},"severity":{"anyOf":[{"type":"integer","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Severity"},"examples":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Examples"}},"type":"object","required":["description","category"],"title":"RuleFromNaturalLanguage","description":"Request to generate a rule from plain-English description."},"RunBatchRequest":{"properties":{"employee_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"}},"type":"object","title":"RunBatchRequest","description":"Request to run batch tests."},"RunStatus":{"type":"string","enum":["pending","running","completed","failed","cancelled"],"title":"RunStatus"},"RunTaskRequest":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"task":{"type":"string","title":"Task"},"max_steps":{"type":"integer","title":"Max Steps","default":50},"os_type":{"type":"string","title":"Os Type","default":"linux"}},"type":"object","required":["employee_id","task"],"title":"RunTaskRequest","description":"Request to run a custom task."},"RunWorkflowRequest":{"properties":{"input_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Data","description":"Initial input data for the workflow","default":{}},"triggered_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Triggered By","description":"Who/what triggered this run","default":"user"}},"type":"object","title":"RunWorkflowRequest","description":"Request to manually trigger a workflow run"},"ScheduleSequenceRequest":{"properties":{"user_id":{"type":"string","title":"User Id","description":"Internal user identifier"},"user_email":{"type":"string","title":"User Email","description":"Recipient email address"},"context":{"additionalProperties":true,"type":"object","title":"Context","description":"Shared context for all emails in the sequence"}},"type":"object","required":["user_id","user_email"],"title":"ScheduleSequenceRequest","description":"Schedule the full 5-email onboarding drip."},"SearchRequest":{"properties":{"query":{"type":"string","title":"Query","description":"Search query"},"top_k":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Top K","description":"Number of results","default":10},"filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters"}},"type":"object","required":["query"],"title":"SearchRequest","description":"Request for visual document search"},"SearchResponse":{"properties":{"query":{"type":"string","title":"Query"},"matches":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Matches"},"count":{"type":"integer","title":"Count"},"cost_usd":{"type":"number","title":"Cost Usd"}},"type":"object","required":["query","matches","count","cost_usd"],"title":"SearchResponse","description":"Response from visual search"},"SeedInput":{"properties":{"seed_type":{"type":"string","enum":["news_headline","policy_text","market_signal","viral_post","structured_feed"],"title":"Seed Type"},"text":{"type":"string","title":"Text","description":"Raw seed text for keyword extraction"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"},"timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Timestamp"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["seed_type","text"],"title":"SeedInput","description":"A real-world signal used to prime the twin population.\n\nThe five seed_type values map to the Sentinel UI's input modes:\n    - news_headline:   short text, optional URL (\"Fed cuts rates 50bp\")\n    - policy_text:     long text (full bill text or executive order)\n    - market_signal:   ticker move / price alert (\"BTC -12% in 4h\")\n    - viral_post:      tweet / reel caption with virality metadata\n    - structured_feed: pre-parsed JSON from NewsAPI/GDELT/etc."},"SendEmailRequest":{"properties":{"user_email":{"type":"string","title":"User Email","description":"Recipient email address"},"template_name":{"type":"string","title":"Template Name","description":"Template identifier (e.g. welcome_instant_value)"},"context":{"additionalProperties":true,"type":"object","title":"Context","description":"Template variables (name, employee_name, etc.)"}},"type":"object","required":["user_email","template_name"],"title":"SendEmailRequest","description":"Send a single onboarding email."},"SendIn":{"properties":{"recipient_email":{"type":"string","title":"Recipient Email"},"subject":{"type":"string","title":"Subject","default":""},"body":{"type":"string","title":"Body","default":""},"sender":{"$ref":"#/components/schemas/SenderIn"},"message_kind":{"type":"string","title":"Message Kind","default":"commercial"},"has_unsubscribe_link":{"type":"boolean","title":"Has Unsubscribe Link","default":false},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers"},"domain_spam_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Domain Spam Rate"},"auth":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Auth"},"daily_volume":{"type":"integer","title":"Daily Volume","default":0}},"type":"object","required":["recipient_email"],"title":"SendIn"},"SenderIn":{"properties":{"name":{"type":"string","title":"Name","default":""},"mailing_address":{"type":"string","title":"Mailing Address","default":""},"contact_method":{"type":"string","title":"Contact Method","default":""}},"type":"object","title":"SenderIn"},"SessionBaseline":{"properties":{"avg_typing_speed_cpm":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Typing Speed Cpm"},"avg_action_interval_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Action Interval Ms"},"typical_pages":{"items":{"type":"string"},"type":"array","title":"Typical Pages"},"typical_session_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Typical Session Duration Seconds"},"typical_login_hours_utc":{"items":{"type":"integer"},"type":"array","title":"Typical Login Hours Utc"},"typical_geo_regions":{"items":{"type":"string"},"type":"array","title":"Typical Geo Regions"},"avg_actions_per_session":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Actions Per Session"}},"type":"object","title":"SessionBaseline","description":"Historical baseline for the entity's session behavior."},"SessionEvent":{"properties":{"event_type":{"type":"string","title":"Event Type"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"page":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["event_type"],"title":"SessionEvent","description":"A single event within a user session."},"ShieldPlan":{"type":"string","enum":["starter","pro","enterprise"],"title":"ShieldPlan","description":"Subscription tier for a Shield tenant."},"ShieldStats":{"properties":{"total_events":{"type":"integer","title":"Total Events","default":0},"total_verdicts":{"type":"integer","title":"Total Verdicts","default":0},"rejection_rate":{"type":"number","title":"Rejection Rate","default":0.0},"false_positive_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"False Positive Rate"},"top_rules":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Top Rules"},"events_by_category":{"additionalProperties":{"type":"integer"},"type":"object","title":"Events By Category"},"verdicts_by_action":{"additionalProperties":{"type":"integer"},"type":"object","title":"Verdicts By Action"}},"type":"object","title":"ShieldStats","description":"Aggregate statistics for a tenant or the platform."},"SimulationRequest":{"properties":{"days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Days","default":90}},"type":"object","title":"SimulationRequest","description":"Request body for the health simulation endpoint."},"SimulationStateResponse":{"properties":{"sim_id":{"type":"string","title":"Sim Id"},"current_round":{"type":"integer","title":"Current Round"},"twin_count":{"type":"integer","title":"Twin Count"},"total_purchases":{"type":"integer","title":"Total Purchases"},"total_revenue":{"type":"number","title":"Total Revenue"},"enable_social_layer":{"type":"boolean","title":"Enable Social Layer"},"effective_state":{"additionalProperties":true,"type":"object","title":"Effective State"},"injections":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Injections"},"social_graph":{"anyOf":[{"$ref":"#/components/schemas/SocialGraphStats"},{"type":"null"}]}},"type":"object","required":["sim_id","current_round","twin_count","total_purchases","total_revenue","enable_social_layer"],"title":"SimulationStateResponse"},"SkillAnalyticsResponse":{"properties":{"total_skills":{"type":"integer","title":"Total Skills"},"total_applications":{"type":"integer","title":"Total Applications"},"by_category":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Category"},"by_maturity":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Maturity"},"average_success_rate":{"type":"number","title":"Average Success Rate"},"top_skills":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Top Skills"}},"type":"object","required":["total_skills","total_applications","by_category","by_maturity","average_success_rate","top_skills"],"title":"SkillAnalyticsResponse","description":"Response containing skill pool analytics","example":{"average_success_rate":0.78,"by_category":{"communication":32,"problem_solving":28,"task_pattern":45},"by_maturity":{"emerging":42,"mastered":11,"refined":35,"validated":68},"top_skills":[{"confidence":0.92,"id":"abc123","name":"Email Response Pattern"}],"total_applications":2340,"total_skills":156}},"SkillCategoryEnum":{"type":"string","enum":["task_pattern","communication","problem_solving","domain_knowledge","tool_usage","error_recovery","efficiency","quality"],"title":"SkillCategoryEnum","description":"Skill categories for API"},"SkillListResponse":{"properties":{"skills":{"items":{"$ref":"#/components/schemas/src__api__routers__user_skills_router__SkillResponse"},"type":"array","title":"Skills"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["skills","total","page","page_size"],"title":"SkillListResponse","description":"Response with list of skills"},"SkillMaturityEnum":{"type":"string","enum":["emerging","validated","refined","mastered"],"title":"SkillMaturityEnum","description":"Skill maturity levels for API"},"SkillStatsResponse":{"properties":{"total_skills":{"type":"integer","title":"Total Skills"},"enabled_skills":{"type":"integer","title":"Enabled Skills"},"total_executions":{"type":"integer","title":"Total Executions"},"successful_executions":{"type":"integer","title":"Successful Executions"},"by_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Type"},"most_used_skill":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Most Used Skill"},"most_used_count":{"type":"integer","title":"Most Used Count"}},"type":"object","required":["total_skills","enabled_skills","total_executions","successful_executions","by_type","most_used_skill","most_used_count"],"title":"SkillStatsResponse","description":"Response with skill statistics"},"SkillType":{"type":"string","enum":["prompt","tool","api","workflow"],"title":"SkillType","description":"Skill type classification"},"SlackConnectionStatus":{"properties":{"connected":{"type":"boolean","title":"Connected"},"team_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Name"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"connected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected At"},"scopes":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Scopes"}},"type":"object","required":["connected"],"title":"SlackConnectionStatus","description":"Slack connection status response"},"SlackDisconnectResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"SlackDisconnectResponse","description":"Slack disconnect response"},"SocialGraphStats":{"properties":{"total_twins":{"type":"integer","title":"Total Twins"},"total_links":{"type":"integer","title":"Total Links"},"avg_degree":{"type":"number","title":"Avg Degree"},"median_degree":{"type":"number","title":"Median Degree"},"max_degree":{"type":"integer","title":"Max Degree"},"isolated_twin_count":{"type":"integer","title":"Isolated Twin Count"},"clustering_coefficient":{"type":"number","title":"Clustering Coefficient"},"top_influencers":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Top Influencers"},"link_type_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Link Type Distribution"}},"type":"object","required":["total_twins","total_links","avg_degree","median_degree","max_degree","isolated_twin_count","clustering_coefficient"],"title":"SocialGraphStats"},"SocialLinkOut":{"properties":{"target_twin_id":{"type":"string","title":"Target Twin Id"},"strength":{"type":"number","title":"Strength"},"link_type":{"type":"string","title":"Link Type"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["target_twin_id","strength","link_type"],"title":"SocialLinkOut"},"StartJourneyRequest":{"properties":{"journey_type":{"$ref":"#/components/schemas/JourneyType","description":"Type of journey (onboarding, offboarding, leave, transfer)"},"subject":{"type":"string","title":"Subject","description":"Subject of the journey (typically the employee or user identifier)"},"initiated_by":{"type":"string","title":"Initiated By","description":"Actor initiating the journey"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Optional journey metadata"}},"type":"object","required":["journey_type","subject","initiated_by"],"title":"StartJourneyRequest"},"StartSessionRequest":{"properties":{"scenario_id":{"type":"string","title":"Scenario Id","description":"Scenario ID returned by /scenarios/generate."}},"type":"object","required":["scenario_id"],"title":"StartSessionRequest","description":"Request body for starting a training session."},"StartWorkflowRequest":{"properties":{"integration_name":{"type":"string","title":"Integration Name","description":"Name of the integration (e.g., 'zoom')"},"employees":{"items":{"type":"string"},"type":"array","title":"Employees","description":"Employee names needing this integration"},"priority":{"type":"string","title":"Priority","description":"Priority: low, medium, high","default":"medium"}},"type":"object","required":["integration_name","employees"],"title":"StartWorkflowRequest","description":"Request to start a new integration workflow."},"StatsResponse":{"properties":{"total_documents":{"type":"integer","title":"Total Documents"},"total_chunks":{"type":"integer","title":"Total Chunks"},"total_tokens":{"type":"integer","title":"Total Tokens"},"total_size_bytes":{"type":"integer","title":"Total Size Bytes"},"documents_by_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"Documents By Status"},"documents_by_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"Documents By Type"}},"type":"object","required":["total_documents","total_chunks","total_tokens","total_size_bytes","documents_by_status","documents_by_type"],"title":"StatsResponse","description":"Knowledge base statistics"},"StatusResponse":{"properties":{"id":{"type":"string","title":"Id"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"goal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goal"},"tasks":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tasks"},"total_estimated_ncu":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Estimated Ncu"},"tasks_completed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tasks Completed"},"tasks_failed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tasks Failed"},"total_ncu_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Ncu Used"},"results":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Results"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["id"],"title":"StatusResponse"},"StepAction":{"type":"string","enum":["analyze","generate","review","execute"],"title":"StepAction"},"StuckArtifactsResponse":{"properties":{"pipeline_id":{"type":"string","title":"Pipeline Id"},"stuck_after_hours":{"type":"number","title":"Stuck After Hours"},"artifacts":{"items":{"$ref":"#/components/schemas/ContentArtifact"},"type":"array","title":"Artifacts"}},"type":"object","required":["pipeline_id","stuck_after_hours","artifacts"],"title":"StuckArtifactsResponse"},"SubscribeRequest":{"properties":{"plan_id":{"type":"string","title":"Plan Id","description":"Shield plan ID (shield_starter, shield_pro, shield_enterprise)"},"payment_method_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Method Token","description":"Stripe payment method token"},"billing_cycle":{"type":"string","title":"Billing Cycle","description":"monthly or annual","default":"monthly"}},"type":"object","required":["plan_id"],"title":"SubscribeRequest"},"SuppressionIn":{"properties":{"email":{"type":"string","title":"Email"},"reason":{"type":"string","title":"Reason","default":"unsubscribe"},"received_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Received At"}},"type":"object","required":["email"],"title":"SuppressionIn"},"SwitchActingEmployeeRequest":{"properties":{"employee_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Id"}},"type":"object","title":"SwitchActingEmployeeRequest","description":"Body for POST /api/auth/switch-acting-employee.\n\n`employee_id` is nullable: passing `null` (or omitting the field)\nREVERTS impersonation by minting a token without the\n`acting_employee_id` claim."},"SwitchActingEmployeeResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_at":{"type":"string","title":"Expires At"},"acting_employee_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Acting Employee Id"}},"type":"object","required":["access_token","expires_at","acting_employee_id"],"title":"SwitchActingEmployeeResponse","description":"Response payload for the switch endpoint.\n\n`acting_employee_id` is null when the action was a revert. The\n`expires_at` is the SAME timestamp as the previous token's `exp` —\nimpersonation never extends the session."},"SwitchEmpireRequest":{"properties":{"empire_id":{"type":"string","title":"Empire Id","description":"UUID of the empire to switch to"}},"type":"object","required":["empire_id"],"title":"SwitchEmpireRequest","description":"Body for POST /api/auth/switch-empire."},"SwitchEmpireResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In"},"empire_id":{"type":"string","title":"Empire Id"},"vertical":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"},"empire_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Empire Role"}},"type":"object","required":["success","access_token","expires_in","empire_id"],"title":"SwitchEmpireResponse","description":"Response for POST /api/auth/switch-empire."},"SyntheticCheckRequest":{"properties":{"document":{"$ref":"#/components/schemas/DocumentData"},"identity":{"$ref":"#/components/schemas/IdentityData"},"device":{"$ref":"#/components/schemas/DeviceData"},"context":{"additionalProperties":true,"type":"object","title":"Context"}},"type":"object","title":"SyntheticCheckRequest","description":"Request body for the synthetic-check endpoint."},"TaskCategory":{"properties":{"category":{"type":"string","title":"Category"},"count":{"type":"integer","title":"Count"},"percent":{"type":"number","title":"Percent"}},"type":"object","required":["category","count","percent"],"title":"TaskCategory","description":"Task breakdown by category"},"TaskCreate":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"task_type":{"type":"string","title":"Task Type"},"description":{"type":"string","title":"Description"},"input_data":{"additionalProperties":true,"type":"object","title":"Input Data"},"priority":{"type":"integer","title":"Priority","default":5}},"type":"object","required":["agent_id","task_type","description"],"title":"TaskCreate"},"TaskTypeBreakdown":{"properties":{"task_type":{"type":"string","title":"Task Type"},"count":{"type":"integer","title":"Count"},"percentage":{"type":"number","title":"Percentage"}},"type":"object","required":["task_type","count","percentage"],"title":"TaskTypeBreakdown"},"TeamDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"owner_id":{"type":"string","title":"Owner Id"},"settings":{"additionalProperties":true,"type":"object","title":"Settings"},"member_count":{"type":"integer","title":"Member Count"},"created_at":{"type":"string","title":"Created At"},"members":{"items":{"$ref":"#/components/schemas/TeamMemberResponse"},"type":"array","title":"Members"}},"type":"object","required":["id","name","slug","owner_id","settings","member_count","created_at","members"],"title":"TeamDetailResponse","description":"Team with members"},"TeamListResponse":{"properties":{"teams":{"items":{"$ref":"#/components/schemas/TeamResponse"},"type":"array","title":"Teams"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["teams","total"],"title":"TeamListResponse","description":"List of teams"},"TeamMemberResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role":{"type":"string","title":"Role"},"invited_at":{"type":"string","title":"Invited At"},"joined_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Joined At"}},"type":"object","required":["user_id","email","role","invited_at"],"title":"TeamMemberResponse","description":"Team member information"},"TeamResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"owner_id":{"type":"string","title":"Owner Id"},"settings":{"additionalProperties":true,"type":"object","title":"Settings"},"member_count":{"type":"integer","title":"Member Count"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","name","slug","owner_id","settings","member_count","created_at"],"title":"TeamResponse","description":"Team information"},"TemplateListResponse":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/TemplateResponse"},"type":"array","title":"Templates"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["templates","total"],"title":"TemplateListResponse"},"TemplateResponse":{"properties":{"template_id":{"type":"string","title":"Template Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"category":{"type":"string","title":"Category"},"vertical":{"type":"string","title":"Vertical"},"tier_required":{"type":"string","title":"Tier Required"},"employees_involved":{"items":{"type":"string"},"type":"array","title":"Employees Involved"},"estimated_ncu":{"type":"integer","title":"Estimated Ncu"},"human_approval_gates":{"type":"integer","title":"Human Approval Gates"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"weft_program":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weft Program"}},"type":"object","required":["template_id","name","description","category","vertical","tier_required","employees_involved","estimated_ncu","human_approval_gates","tags"],"title":"TemplateResponse"},"TenantCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"slug":{"type":"string","maxLength":63,"minLength":1,"pattern":"^[a-z0-9][a-z0-9\\-]*$","title":"Slug"},"plan":{"$ref":"#/components/schemas/ShieldPlan","default":"starter"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"}},"type":"object","required":["name","slug"],"title":"TenantCreate","description":"Payload for provisioning a new tenant."},"TestCustomEmployeeRequest":{"properties":{"message":{"type":"string","maxLength":2000,"minLength":1,"title":"Message","description":"Test message to send"}},"type":"object","required":["message"],"title":"TestCustomEmployeeRequest","description":"Request body for testing a custom employee.","example":{"message":"What are the top 3 growth tactics for a B2B SaaS product?"}},"TiersIn":{"properties":{"leads":{"items":{"$ref":"#/components/schemas/LeadIn"},"type":"array","title":"Leads"},"thresholds":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Thresholds"},"score_source":{"type":"string","title":"Score Source","default":"unspecified"}},"type":"object","required":["leads"],"title":"TiersIn"},"TimelineGroup":{"properties":{"hour":{"type":"string","title":"Hour"},"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"},"decisions":{"items":{"$ref":"#/components/schemas/DecisionSummary"},"type":"array","title":"Decisions"}},"type":"object","required":["hour","label","count","decisions"],"title":"TimelineGroup"},"TimelinePoint":{"properties":{"day":{"type":"string","title":"Day"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["day","count"],"title":"TimelinePoint"},"TopInfluencer":{"properties":{"twin_id":{"type":"string","title":"Twin Id"},"influence_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Influence Score"},"degree":{"type":"integer","minimum":0.0,"title":"Degree"},"avg_neighbor_engagement_lift":{"type":"number","title":"Avg Neighbor Engagement Lift"},"display_rank":{"type":"integer","minimum":1.0,"title":"Display Rank"}},"type":"object","required":["twin_id","influence_score","degree","avg_neighbor_engagement_lift","display_rank"],"title":"TopInfluencer","description":"A twin with disproportionate reach + influence within the sim.\n\n`influence_score` blends three signals:\n    0.4 * normalized_degree\n    0.4 * avg_neighbor_engagement_lift  (how much neighbors engage MORE\n          when this twin engaged with the same content vs not)\n    0.2 * own_engagement_rate\n\n`display_rank` is 1-indexed and stable for the same inputs (ties broken\nby twin_id ascending — deterministic)."},"TopicExtraction":{"properties":{"topic":{"type":"string","title":"Topic"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"matched_terms":{"items":{"type":"string"},"type":"array","title":"Matched Terms"},"emotion_tags":{"items":{"type":"string"},"type":"array","title":"Emotion Tags"},"salience":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Salience"}},"type":"object","required":["topic","confidence","salience"],"title":"TopicExtraction","description":"One topic match against the curated taxonomy."},"TransactionSignals":{"properties":{"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"currency":{"type":"string","title":"Currency","default":"USD"},"transaction_count_24h":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transaction Count 24H"},"transaction_count_7d":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transaction Count 7D"},"average_transaction_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Transaction Amount"},"max_historical_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Historical Amount"},"is_first_transaction":{"type":"boolean","title":"Is First Transaction","default":false},"recipient_is_new":{"type":"boolean","title":"Recipient Is New","default":false}},"type":"object","title":"TransactionSignals","description":"Transaction risk signals."},"TranscriptTurn":{"properties":{"speaker":{"type":"string","title":"Speaker"},"text":{"type":"string","title":"Text"},"timestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Timestamp"}},"type":"object","required":["speaker","text"],"title":"TranscriptTurn","description":"Single turn in a call transcript."},"TrialSignupRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"name":{"type":"string","title":"Name"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"use_case":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use Case"}},"type":"object","required":["email","name"],"title":"TrialSignupRequest","description":"Trial signup request"},"TrialSignupResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"trial_id":{"type":"string","title":"Trial Id"},"email":{"type":"string","title":"Email"},"expires_at":{"type":"string","title":"Expires At"},"credits":{"type":"integer","title":"Credits"},"tier":{"type":"string","title":"Tier"},"employees":{"type":"integer","title":"Employees"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","trial_id","email","expires_at","credits","tier","employees","message"],"title":"TrialSignupResponse","description":"Trial signup response"},"TrialStatusResponse":{"properties":{"active":{"type":"boolean","title":"Active"},"trial_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trial Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"credits_remaining":{"type":"integer","title":"Credits Remaining"},"credits_used":{"type":"integer","title":"Credits Used"},"days_remaining":{"type":"integer","title":"Days Remaining"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"tier":{"type":"string","title":"Tier"}},"type":"object","required":["active","trial_id","email","credits_remaining","credits_used","days_remaining","expires_at","tier"],"title":"TrialStatusResponse","description":"Trial status response"},"TriggerConfig":{"properties":{"cron":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cron","description":"Cron expression for schedule triggers"},"webhook_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Path","description":"Webhook URL path"},"event_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Name","description":"Event name to listen for"}},"type":"object","title":"TriggerConfig","description":"Configuration for workflow triggers"},"TriggerType":{"type":"string","enum":["manual","schedule","webhook","event"],"title":"TriggerType"},"TrustScoreRequest":{"properties":{"document":{"$ref":"#/components/schemas/DocumentSignals"},"behavioral":{"$ref":"#/components/schemas/BehavioralSignals"},"transaction":{"$ref":"#/components/schemas/TransactionSignals"},"reputation":{"$ref":"#/components/schemas/EntityReputation"},"context":{"additionalProperties":true,"type":"object","title":"Context","description":"Free-form context for audit trail."}},"type":"object","title":"TrustScoreRequest","description":"Request body for the trust-score endpoint."},"TwinDecisionsResponse":{"properties":{"twin_id":{"type":"string","title":"Twin Id"},"sim_id":{"type":"string","title":"Sim Id"},"decisions":{"items":{"$ref":"#/components/schemas/EngagementDecisionOut"},"type":"array","title":"Decisions"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["twin_id","sim_id","decisions","count"],"title":"TwinDecisionsResponse"},"TwinDetail":{"properties":{"twin_id":{"type":"string","title":"Twin Id"},"demographics":{"additionalProperties":true,"type":"object","title":"Demographics"},"psychographics":{"additionalProperties":true,"type":"object","title":"Psychographics"},"big_five":{"additionalProperties":{"type":"number"},"type":"object","title":"Big Five"},"consumer_traits":{"additionalProperties":{"type":"number"},"type":"object","title":"Consumer Traits"},"content_traits":{"additionalProperties":{"type":"number"},"type":"object","title":"Content Traits"},"neighbor_ids":{"items":{"type":"string"},"type":"array","title":"Neighbor Ids"},"social_links":{"items":{"$ref":"#/components/schemas/SocialLinkOut"},"type":"array","title":"Social Links"},"recent_engagements":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Recent Engagements"},"purchase_count":{"type":"integer","title":"Purchase Count","default":0},"cart_abandonment_count":{"type":"integer","title":"Cart Abandonment Count","default":0}},"type":"object","required":["twin_id"],"title":"TwinDetail","description":"Full per-twin state for the /twins/{id} drilldown."},"TwinListResponse":{"properties":{"twins":{"items":{"$ref":"#/components/schemas/TwinSummary"},"type":"array","title":"Twins"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"sim_id":{"type":"string","title":"Sim Id"}},"type":"object","required":["twins","total","limit","offset","sim_id"],"title":"TwinListResponse"},"TwinSummary":{"properties":{"twin_id":{"type":"string","title":"Twin Id"},"age":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Age"},"income":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Income"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"},"lifestyle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifestyle"},"social_link_count":{"type":"integer","title":"Social Link Count","default":0},"purchase_count":{"type":"integer","title":"Purchase Count","default":0}},"type":"object","required":["twin_id"],"title":"TwinSummary","description":"Compact row for the /twins list endpoint."},"UDFDefinition":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name","description":"Function name (must be a valid Python identifier)"},"description":{"type":"string","maxLength":2048,"title":"Description","default":""},"source_code":{"type":"string","maxLength":65536,"title":"Source Code"},"function_signature":{"additionalProperties":true,"type":"object","title":"Function Signature","description":"Schema: {args: {name: type, ...}, return_type: str}"},"is_active":{"type":"boolean","title":"Is Active","default":false},"version":{"type":"integer","title":"Version","default":1},"sandbox_level":{"type":"string","title":"Sandbox Level","description":"One of: standard, restricted, strict","default":"restricted"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"test_results":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Test Results"}},"type":"object","required":["tenant_id","name","source_code"],"title":"UDFDefinition","description":"Full UDF record as stored and returned to the client."},"UDFTestRequest":{"properties":{"source_code":{"type":"string","maxLength":65536,"title":"Source Code"},"test_inputs":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":20,"minItems":1,"title":"Test Inputs","description":"Sample inputs to run through the UDF"}},"type":"object","required":["source_code","test_inputs"],"title":"UDFTestRequest","description":"Request to test a UDF in the sandbox without saving it."},"UDFTestResult":{"properties":{"success":{"type":"boolean","title":"Success"},"outputs":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Outputs"},"execution_time_ms":{"type":"number","title":"Execution Time Ms","default":0.0},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"security_scan":{"additionalProperties":true,"type":"object","title":"Security Scan"}},"type":"object","required":["success"],"title":"UDFTestResult","description":"Result of a sandbox test run."},"UDFUpload":{"properties":{"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":2048,"title":"Description","default":""},"source_code":{"type":"string","maxLength":65536,"title":"Source Code"},"function_signature":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Function Signature"},"sandbox_level":{"type":"string","title":"Sandbox Level","default":"restricted"}},"type":"object","required":["name","source_code"],"title":"UDFUpload","description":"API input model for creating/updating a UDF."},"UpdateBudgetRequest":{"properties":{"ncu_amount":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Ncu Amount","description":"New NCU allocation"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period","description":"New budget period"},"auto_renew":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Renew","description":"Auto-renew budget each period"}},"type":"object","title":"UpdateBudgetRequest"},"UpdateCustomEmployeeRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":64,"minLength":2},{"type":"null"}],"title":"Name"},"role":{"anyOf":[{"type":"string","maxLength":128,"minLength":2},{"type":"null"}],"title":"Role"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"specializations":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Specializations"},"personality_traits":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Personality Traits"},"methodologies":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Methodologies"},"capabilities":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Capabilities"},"integrations":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Integrations"},"system_prompt_additions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"System Prompt Additions"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url"}},"type":"object","title":"UpdateCustomEmployeeRequest","description":"Request body for updating a custom employee (partial updates)."},"UpdateDealStageRequest":{"properties":{"stage":{"type":"string","title":"Stage","description":"Target stage (see VALID_DEAL_STAGES)"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Optional note for the stage change"}},"type":"object","required":["stage"],"title":"UpdateDealStageRequest","description":"Payload for PATCH /deals/{deal_id}/stage — used by the kanban drag-drop UI."},"UpdateMemberRoleRequest":{"properties":{"role":{"type":"string","pattern":"^(admin|member|viewer)$","title":"Role"}},"type":"object","required":["role"],"title":"UpdateMemberRoleRequest","description":"Request to update a member's role"},"UpdateSkillRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"},"skill_type":{"anyOf":[{"$ref":"#/components/schemas/SkillType"},{"type":"null"}]},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions"},"triggers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Triggers"},"employee_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Employee Ids"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"UpdateSkillRequest","description":"Request to update an existing skill"},"UpdateTeamRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Settings"}},"type":"object","title":"UpdateTeamRequest","description":"Request to update team settings"},"UpdateWorkflowRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"trigger_type":{"anyOf":[{"$ref":"#/components/schemas/TriggerType"},{"type":"null"}]},"trigger_config":{"anyOf":[{"$ref":"#/components/schemas/TriggerConfig"},{"type":"null"}]},"steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/WorkflowStep"},"type":"array"},{"type":"null"}],"title":"Steps"},"status":{"anyOf":[{"$ref":"#/components/schemas/WorkflowStatus"},{"type":"null"}]},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"}},"type":"object","title":"UpdateWorkflowRequest","description":"Request to update an existing workflow"},"UsageData":{"properties":{"metrics":{"$ref":"#/components/schemas/UsageMetrics"},"employee_usage":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Employee Usage"},"tasks_by_category":{"items":{"$ref":"#/components/schemas/TaskCategory"},"type":"array","title":"Tasks By Category"},"cost_savings":{"$ref":"#/components/schemas/CostSavings"},"daily_usage":{"items":{"type":"integer"},"type":"array","title":"Daily Usage"}},"type":"object","required":["metrics","employee_usage","tasks_by_category","cost_savings","daily_usage"],"title":"UsageData","description":"Full usage data response matching frontend expectations"},"UsageMetrics":{"properties":{"total_tasks":{"type":"integer","title":"Total Tasks"},"total_tasks_change":{"type":"number","title":"Total Tasks Change"},"credits_used":{"type":"integer","title":"Credits Used"},"credits_used_change":{"type":"number","title":"Credits Used Change"},"avg_response_time_ms":{"type":"integer","title":"Avg Response Time Ms"},"response_time_change":{"type":"number","title":"Response Time Change"},"success_rate":{"type":"number","title":"Success Rate"},"success_rate_change":{"type":"number","title":"Success Rate Change"}},"type":"object","required":["total_tasks","total_tasks_change","credits_used","credits_used_change","avg_response_time_ms","response_time_change","success_rate","success_rate_change"],"title":"UsageMetrics","description":"Usage metrics with change percentages"},"UserResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"type":"string","title":"Full Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"email_verified":{"type":"boolean","title":"Email Verified"},"tier":{"type":"string","title":"Tier"},"credits_remaining":{"type":"integer","title":"Credits Remaining"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","email","full_name","email_verified","tier","credits_remaining","created_at"],"title":"UserResponse","description":"User profile response"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Verdict":{"properties":{"id":{"type":"string","title":"Id"},"event_id":{"type":"string","title":"Event Id"},"action":{"$ref":"#/components/schemas/VerdictAction"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"matched_rules":{"items":{"type":"string"},"type":"array","title":"Matched Rules"},"effects":{"additionalProperties":true,"type":"object","title":"Effects"},"explanation":{"type":"string","title":"Explanation","default":""},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","event_id","action","confidence"],"title":"Verdict","description":"The engine's decision on a single event."},"VerdictAction":{"type":"string","enum":["allow","reject","flag","escalate","shadow_ban"],"title":"VerdictAction","description":"Action the engine may take on an evaluated event."},"VerdictResponse":{"properties":{"verdict":{"$ref":"#/components/schemas/Verdict"},"processing_time_ms":{"type":"integer","title":"Processing Time Ms"},"credits_used":{"type":"integer","title":"Credits Used"}},"type":"object","required":["verdict","processing_time_ms","credits_used"],"title":"VerdictResponse","description":"Wrapper returned to callers after event evaluation."},"VerificationRequestBody":{"properties":{"user_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"User Id"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"}},"type":"object","title":"VerificationRequestBody","description":"Body for POST /verification/request.\n\nAt least one of ``user_id`` or ``email`` is required. When both are\nprovided, ``email`` wins as the lookup key (matches ``auth_store``\nnamespacing) and ``user_id`` is used as a cross-check."},"VerificationRequestResponse":{"properties":{"request_id":{"type":"string","title":"Request Id"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["request_id","expires_at"],"title":"VerificationRequestResponse"},"VerifyBody":{"properties":{"request_id":{"type":"string","maxLength":128,"minLength":1,"title":"Request Id"},"code":{"type":"string","maxLength":6,"minLength":6,"title":"Code"}},"type":"object","required":["request_id","code"],"title":"VerifyBody"},"VerifyEmailRequest":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"VerifyEmailRequest","description":"Email verification request"},"VerifyResponse":{"properties":{"verified":{"type":"boolean","title":"Verified"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email"},"verified_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verified At"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["verified"],"title":"VerifyResponse"},"ViralCascade":{"properties":{"seed_twin_id":{"type":"string","title":"Seed Twin Id"},"seed_content_id":{"type":"string","title":"Seed Content Id"},"cascade_length":{"type":"integer","minimum":1.0,"title":"Cascade Length","description":"Number of BFS hops"},"cascade_breadth":{"type":"integer","minimum":1.0,"title":"Cascade Breadth","description":"Total twins reached including seed"},"cascade_velocity":{"type":"number","minimum":0.0,"title":"Cascade Velocity","description":"Twins reached per round (normalized)"},"visual_color":{"type":"string","enum":["pink","amber","teal"],"title":"Visual Color","default":"pink"}},"type":"object","required":["seed_twin_id","seed_content_id","cascade_length","cascade_breadth","cascade_velocity"],"title":"ViralCascade","description":"A content piece that spread through the social graph.\n\nDetected by BFS over engagement timestamps + social links: starting from\nthe twin who first engaged with `seed_content_id`, we expand to neighbors\nwho engaged in subsequent rounds, counting hop-depth and total reach.\n\n`visual_color` defaults to Forum brand accent (#EC4899 -> \"pink\"). Top\ncascades get differentiated colors on the dashboard so they remain\ndistinguishable when several are rendered on the same canvas."},"VisitorChatBody":{"properties":{"session_id":{"type":"string","maxLength":64,"minLength":8,"title":"Session Id"},"message":{"type":"string","minLength":1,"title":"Message"}},"type":"object","required":["session_id","message"],"title":"VisitorChatBody"},"VisitorIntentRequest":{"properties":{"visitor_id":{"type":"string","title":"Visitor Id","description":"Anonymous session / visitor ID"},"visits":{"items":{"$ref":"#/components/schemas/PageVisitInput"},"type":"array","minItems":1,"title":"Visits"},"company_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Domain","description":"Company domain if identified via reverse IP"}},"type":"object","required":["visitor_id","visits"],"title":"VisitorIntentRequest","description":"Request body: a visitor's page visit history."},"VisitorIntentResponse":{"properties":{"visitor_id":{"type":"string","title":"Visitor Id"},"intent_score":{"type":"number","title":"Intent Score"},"intent_level":{"type":"string","title":"Intent Level"},"signals":{"items":{"$ref":"#/components/schemas/IntentSignalOut"},"type":"array","title":"Signals"},"page_journey":{"items":{"type":"string"},"type":"array","title":"Page Journey"},"total_visits":{"type":"integer","title":"Total Visits"},"total_time_seconds":{"type":"number","title":"Total Time Seconds"},"first_visit":{"type":"string","title":"First Visit"},"last_visit":{"type":"string","title":"Last Visit"},"likely_stage":{"type":"string","title":"Likely Stage"},"company_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Domain"},"is_heuristic":{"type":"boolean","title":"Is Heuristic","default":true}},"type":"object","required":["visitor_id","intent_score","intent_level","signals","page_journey","total_visits","total_time_seconds","first_visit","last_visit","likely_stage","company_domain"],"title":"VisitorIntentResponse"},"VoiceCloneListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VoiceCloneResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"additionalProperties":false,"type":"object","required":["items","total"],"title":"VoiceCloneListResponse","description":"Response for GET /voices."},"VoiceCloneResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"source_sample_url":{"type":"string","title":"Source Sample Url"},"embedding_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Embedding Path"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"additionalProperties":false,"type":"object","required":["id","name","source_sample_url","created_at","updated_at"],"title":"VoiceCloneResponse","description":"Response for POST /voices/clone, GET /voices, DELETE /voices/{id}."},"VoiceJobListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VoiceJobResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"additionalProperties":false,"type":"object","required":["items","total"],"title":"VoiceJobListResponse","description":"Response for GET /jobs."},"VoiceJobResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"type":"string","enum":["pending","transcribing","translating","synthesizing","muxing","complete","failed"],"title":"Status"},"input_video_url":{"type":"string","title":"Input Video Url"},"target_languages":{"items":{"type":"string"},"type":"array","title":"Target Languages"},"voice_clone_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Voice Clone Id"},"outputs":{"anyOf":[{"items":{"$ref":"#/components/schemas/VoiceOutput"},"type":"array"},{"type":"null"}],"title":"Outputs"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"engine_version":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Engine Version"},"progress_percent":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Progress Percent"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"additionalProperties":false,"type":"object","required":["id","status","input_video_url","target_languages","created_at","updated_at"],"title":"VoiceJobResponse","description":"Response for POST /jobs (202) and GET /jobs/{id}.\n\nProgress fields (`engine_version`, `progress_percent`) are populated by\nthe DubbingService at state transitions; both are NULLable and remain\n`None` until that service wires them in a follow-up commit (see migration\n73_voice_progress.sql). Clients MUST tolerate `None` and fall back to a\nper-status default. The schema exposes the surface ahead of the service\nso the frontend can render granular progress the moment the service ships\nwithout a synchronized release."},"VoiceOutput":{"properties":{"language":{"type":"string","title":"Language","description":"BCP-47 language code (e.g. 'es-ES')."},"url":{"type":"string","title":"Url","description":"URL to the muxed video for this language."},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds","description":"Probed video duration in seconds; null if probe failed."}},"additionalProperties":false,"type":"object","required":["language","url"],"title":"VoiceOutput","description":"One per-language dubbed output for a VoiceJob.\n\nA single job produces N outputs (one per requested target language); the\nresponse's ``outputs`` array preserves the request's ``target_languages``\norder so a client can pair them by index without a server-side lookup.\n\nFields:\n  - language: BCP-47 code (e.g. 'es-ES', 'pt-BR') — matches the entry in\n    the originating request's target_languages list.\n  - url: fetchable URL to the muxed video (signed or public — the\n    OutputStorage implementation decides; client treats as opaque).\n  - duration_seconds: probed length of the muxed video. Float (not int)\n    because ffprobe reports sub-second precision; nullable because probe\n    is best-effort and may fail without failing the job."},"VoiceStatusResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"default_provider":{"type":"string","title":"Default Provider"},"available_employees":{"type":"integer","title":"Available Employees"},"providers":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Providers"}},"type":"object","required":["enabled","default_provider","available_employees","providers"],"title":"VoiceStatusResponse","description":"Voice system status."},"VoiceTicketRequest":{"properties":{"employee_id":{"type":"string","title":"Employee Id"}},"type":"object","required":["employee_id"],"title":"VoiceTicketRequest","description":"Request to mint a voice-session ticket for one employee."},"VoiceTicketResponse":{"properties":{"ticket":{"type":"string","title":"Ticket"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["ticket","expires_in"],"title":"VoiceTicketResponse","description":"Short-lived single-use ticket for the /ws/{employee_id} handshake."},"VoiceUsageResponse":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"billing_period":{"type":"string","format":"date","title":"Billing Period"},"minutes_used":{"type":"number","title":"Minutes Used"}},"additionalProperties":false,"type":"object","required":["user_id","billing_period","minutes_used"],"title":"VoiceUsageResponse","description":"Response for GET /usage. v1 returns the current billing period only."},"WatcherStatusResponse":{"properties":{"running":{"type":"boolean","title":"Running"},"rules_base_dir":{"type":"string","title":"Rules Base Dir"},"last_scan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Scan"},"tenants_watched":{"items":{"type":"string"},"type":"array","title":"Tenants Watched"},"subscriber_count":{"type":"integer","title":"Subscriber Count"}},"type":"object","required":["running","rules_base_dir","last_scan","tenants_watched","subscriber_count"],"title":"WatcherStatusResponse"},"WebhookConfig":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"},"events":{"items":{"type":"string"},"type":"array","title":"Events","description":"Verdict actions that trigger a webhook delivery."},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["url"],"title":"WebhookConfig","description":"Tenant webhook configuration."},"WebhookResponse":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Id"}},"type":"object","required":["status","message"],"title":"WebhookResponse","description":"Webhook response"},"WeftStatusResponse":{"properties":{"available":{"type":"boolean","title":"Available"},"weft_api_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weft Api Url"},"backend_url":{"type":"string","title":"Backend Url"},"total_employees_registered":{"type":"integer","title":"Total Employees Registered"},"active_workflows":{"type":"integer","title":"Active Workflows"}},"type":"object","required":["available","backend_url","total_employees_registered","active_workflows"],"title":"WeftStatusResponse","description":"Overall Weft integration status."},"WorkflowActionRequest":{"properties":{"command":{"type":"string","title":"Command","description":"Command: DONE, SKIP, HELP, ABORT, DEPLOY, etc."},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data","description":"Additional data (credentials, etc.)"}},"type":"object","required":["command"],"title":"WorkflowActionRequest","description":"Request to submit a human action."},"WorkflowGraphResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"nodes":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Nodes"},"edges":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Edges"},"employees":{"items":{"type":"string"},"type":"array","title":"Employees"}},"type":"object","required":["workflow_id","nodes","edges","employees"],"title":"WorkflowGraphResponse","description":"Visual graph representation of a Weft workflow."},"WorkflowListItem":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"integration_name":{"type":"string","title":"Integration Name"},"current_state":{"type":"string","title":"Current State"},"status":{"type":"string","title":"Status"},"employees":{"items":{"type":"string"},"type":"array","title":"Employees"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["workflow_id","integration_name","current_state","status","employees","created_at","updated_at"],"title":"WorkflowListItem","description":"Summary of a workflow for listing."},"WorkflowRunListResponse":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/WorkflowRunResponse"},"type":"array","title":"Runs"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["runs","total","limit","offset"],"title":"WorkflowRunListResponse","description":"Response for listing workflow runs"},"WorkflowRunResponse":{"properties":{"id":{"type":"string","title":"Id"},"workflow_id":{"type":"string","title":"Workflow Id"},"workflow_name":{"type":"string","title":"Workflow Name"},"status":{"$ref":"#/components/schemas/RunStatus"},"triggered_by":{"type":"string","title":"Triggered By"},"input_data":{"additionalProperties":true,"type":"object","title":"Input Data"},"results":{"additionalProperties":true,"type":"object","title":"Results"},"current_step_index":{"type":"integer","title":"Current Step Index"},"steps_completed":{"type":"integer","title":"Steps Completed"},"steps_total":{"type":"integer","title":"Steps Total"},"progress_percent":{"type":"number","title":"Progress Percent"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"error_step_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Step Id"},"credits_used":{"type":"integer","title":"Credits Used"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","workflow_id","workflow_name","status","triggered_by","input_data","results","current_step_index","steps_completed","steps_total","progress_percent","error","error_step_id","credits_used","started_at","completed_at","duration_ms","created_at"],"title":"WorkflowRunResponse","description":"Response with workflow run details"},"WorkflowStatsResponse":{"properties":{"total_workflows":{"type":"integer","title":"Total Workflows"},"active_workflows":{"type":"integer","title":"Active Workflows"},"total_runs":{"type":"integer","title":"Total Runs"},"successful_runs":{"type":"integer","title":"Successful Runs"},"failed_runs":{"type":"integer","title":"Failed Runs"},"success_rate":{"type":"number","title":"Success Rate"}},"type":"object","required":["total_workflows","active_workflows","total_runs","successful_runs","failed_runs","success_rate"],"title":"WorkflowStatsResponse","description":"Response with workflow statistics"},"WorkflowStatus":{"type":"string","enum":["draft","active","inactive","archived"],"title":"WorkflowStatus"},"WorkflowStep":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Step ID (auto-generated if not provided)"},"order":{"type":"integer","minimum":1.0,"title":"Order","description":"Step execution order"},"employee_id":{"type":"string","title":"Employee Id","description":"ID of the AI employee to execute this step"},"action":{"$ref":"#/components/schemas/StepAction","description":"Type of action to perform"},"input":{"type":"string","title":"Input","description":"Input text or template (use {{prev.output}} for previous step output)"},"input_mapping":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Input Mapping","description":"Map variables from previous steps"},"condition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Condition","description":"Execution condition"},"timeout_seconds":{"type":"integer","maximum":3600.0,"minimum":10.0,"title":"Timeout Seconds","description":"Step timeout in seconds","default":300},"retry_count":{"type":"integer","maximum":5.0,"minimum":0.0,"title":"Retry Count","description":"Number of retries on failure","default":0}},"type":"object","required":["order","employee_id","action","input"],"title":"WorkflowStep","description":"Configuration for a single workflow step"},"WorkflowTemplateResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"type":"string","title":"Category"},"trigger_type":{"$ref":"#/components/schemas/TriggerType"},"steps":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Steps"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"times_used":{"type":"integer","title":"Times Used"},"is_featured":{"type":"boolean","title":"Is Featured"}},"type":"object","required":["id","name","description","category","trigger_type","steps","tags","times_used","is_featured"],"title":"WorkflowTemplateResponse","description":"Response with workflow template"},"WorldPrimingResult":{"properties":{"seed":{"$ref":"#/components/schemas/SeedInput"},"extracted_topics":{"items":{"$ref":"#/components/schemas/TopicExtraction"},"type":"array","title":"Extracted Topics"},"twins_primed":{"type":"integer","title":"Twins Primed","default":0},"awareness_changes":{"additionalProperties":{"additionalProperties":{"type":"number"},"type":"object"},"type":"object","title":"Awareness Changes"},"needs_added":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Needs Added"},"affected_segment_summary":{"additionalProperties":{"type":"integer"},"type":"object","title":"Affected Segment Summary"}},"type":"object","required":["seed"],"title":"WorldPrimingResult","description":"Result of priming a twin population against a seed.\n\nDesigned for \"before vs after\" UI rendering. The UI shows:\n    - the seed and its extracted topics (top of card)\n    - a heatmap by demographic segment (affected_segment_summary)\n    - a per-twin drilldown (awareness_changes + needs_added)"},"src__admin__models__ChatRequest":{"properties":{"message":{"type":"string","title":"Message"},"context":{"additionalProperties":true,"type":"object","title":"Context"}},"type":"object","required":["message"],"title":"ChatRequest"},"src__api__routers__a2ui_router__IntentDetectionRequest":{"properties":{"query":{"type":"string","title":"Query","description":"User's query"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Additional context"}},"type":"object","required":["query"],"title":"IntentDetectionRequest","description":"Request for intent detection."},"src__api__routers__api_keys_router__APIKeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"key_type":{"type":"string","title":"Key Type"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"created_at":{"type":"string","title":"Created At"},"revoked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","name","key_prefix","key_type","permissions","created_at"],"title":"APIKeyResponse","description":"Response containing API key metadata (without the full key)"},"src__api__routers__audit_router__TimelineResponse":{"properties":{"groups":{"items":{"$ref":"#/components/schemas/TimelineGroup"},"type":"array","title":"Groups"},"total":{"type":"integer","title":"Total"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"}},"type":"object","required":["groups","total","period_start","period_end"],"title":"TimelineResponse"},"src__api__routers__billing_router__CreditPurchaseRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"package":{"type":"string","title":"Package"}},"type":"object","required":["email","package"],"title":"CreditPurchaseRequest","description":"Request to purchase additional credits"},"src__api__routers__billing_router__TierName":{"type":"string","enum":["starter","manager","agency"],"title":"TierName"},"src__api__routers__chat_router__ChatMessage":{"properties":{"role":{"type":"string","enum":["system","user","assistant"],"title":"Role"},"content":{"type":"string","title":"Content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["role","content"],"title":"ChatMessage","description":"Single message in chat"},"src__api__routers__copilotkit_router__ChatMessage":{"properties":{"role":{"type":"string","title":"Role","description":"Message role (user/assistant/system)"},"content":{"type":"string","title":"Content","description":"Message content"}},"type":"object","required":["role","content"],"title":"ChatMessage","description":"Chat message"},"src__api__routers__copilotkit_router__ChatRequest":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/src__api__routers__copilotkit_router__ChatMessage"},"type":"array","title":"Messages","description":"Chat messages"},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Threadid","description":"Thread ID for conversation continuity"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Application context"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"LLM configuration"}},"type":"object","title":"ChatRequest","description":"CopilotKit chat request"},"src__api__routers__enrichment_router__IntentDetectionRequest":{"properties":{"company_name":{"type":"string","maxLength":500,"minLength":1,"title":"Company Name","description":"Company name"},"domain":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Domain","description":"Company domain"}},"type":"object","required":["company_name"],"title":"IntentDetectionRequest"},"src__api__routers__files_router__GenerateRequest":{"properties":{"format":{"type":"string","title":"Format","description":"xlsx | pptx | docx"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Output filename; extension is enforced"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Document/deck title"},"sections":{"items":{},"type":"array","title":"Sections","description":"Format-specific section list"},"brief":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brief","description":"Natural-language brief; planned into sections when `sections` is empty"},"theme":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Theme","description":"Optional colour overrides: accent/ink/muted/band (hex)"}},"type":"object","required":["format"],"title":"GenerateRequest","description":"Spec for a generated document. Deliberately simple + explicit."},"src__api__routers__integration_workflow_router__WorkflowResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"integration_name":{"type":"string","title":"Integration Name"},"current_state":{"type":"string","title":"Current State"},"status":{"type":"string","title":"Status"},"waiting_for_human":{"type":"boolean","title":"Waiting For Human"},"a2ui":{"additionalProperties":true,"type":"object","title":"A2Ui"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["workflow_id","integration_name","current_state","status","waiting_for_human","a2ui"],"title":"WorkflowResponse","description":"Response with workflow state and A2UI."},"src__api__routers__observability_events_router__TimelineResponse":{"properties":{"event":{"type":"string","title":"Event"},"days":{"type":"integer","title":"Days"},"points":{"items":{"$ref":"#/components/schemas/TimelinePoint"},"type":"array","title":"Points"}},"type":"object","required":["event","days","points"],"title":"TimelineResponse"},"src__api__routers__osgym_router__RunScenarioRequest":{"properties":{"employee_id":{"type":"string","title":"Employee Id"},"scenario_id":{"type":"string","title":"Scenario Id"}},"type":"object","required":["employee_id","scenario_id"],"title":"RunScenarioRequest","description":"Request to run a predefined scenario."},"src__api__routers__pricing_router__APIKeyResponse":{"properties":{"api_key":{"type":"string","title":"Api Key"},"tier":{"type":"string","title":"Tier"},"credits_monthly":{"type":"integer","title":"Credits Monthly"},"created_at":{"type":"string","title":"Created At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["api_key","tier","credits_monthly","created_at"],"title":"APIKeyResponse"},"src__api__routers__pricing_router__UpgradeRequest":{"properties":{"current_tier":{"$ref":"#/components/schemas/PricingTier"},"target_tier":{"$ref":"#/components/schemas/PricingTier"},"billing_period":{"type":"string","title":"Billing Period","default":"monthly"}},"type":"object","required":["current_tier","target_tier"],"title":"UpgradeRequest"},"src__api__routers__pricing_router__UpgradeResponse":{"properties":{"current_tier":{"type":"string","title":"Current Tier"},"target_tier":{"type":"string","title":"Target Tier"},"price_difference":{"type":"integer","title":"Price Difference"},"credits_increase":{"type":"integer","title":"Credits Increase"},"new_features":{"items":{"type":"string"},"type":"array","title":"New Features"},"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url"}},"type":"object","required":["current_tier","target_tier","price_difference","credits_increase","new_features"],"title":"UpgradeResponse"},"src__api__routers__qa_router__RunScenarioRequest":{"properties":{"scenario_id":{"type":"string","title":"Scenario Id"},"employee_id":{"type":"string","title":"Employee Id"}},"type":"object","required":["scenario_id","employee_id"],"title":"RunScenarioRequest","description":"Request to run a specific scenario."},"src__api__routers__qa_router__SendMessageRequest":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"SendMessageRequest","description":"Request to send message in session."},"src__api__routers__shield_billing_router__UpgradeRequest":{"properties":{"new_plan_id":{"type":"string","title":"New Plan Id","description":"Target Shield plan ID"}},"type":"object","required":["new_plan_id"],"title":"UpgradeRequest"},"src__api__routers__skill_pool_router__SkillResponse":{"properties":{"skill_id":{"type":"string","title":"Skill Id"},"name":{"type":"string","title":"Name"},"category":{"type":"string","title":"Category"},"description":{"type":"string","title":"Description"},"pattern":{"additionalProperties":true,"type":"object","title":"Pattern"},"application_template":{"type":"string","title":"Application Template"},"preconditions":{"items":{"type":"string"},"type":"array","title":"Preconditions"},"success_criteria":{"items":{"type":"string"},"type":"array","title":"Success Criteria"},"maturity":{"type":"string","title":"Maturity"},"success_count":{"type":"integer","title":"Success Count"},"failure_count":{"type":"integer","title":"Failure Count"},"success_rate":{"type":"number","title":"Success Rate"},"confidence_score":{"type":"number","title":"Confidence Score"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used"},"contributor_count":{"type":"integer","title":"Contributor Count"},"customer_count":{"type":"integer","title":"Customer Count"},"methodology_ids":{"items":{"type":"integer"},"type":"array","title":"Methodology Ids"}},"type":"object","required":["skill_id","name","category","description","pattern","application_template","preconditions","success_criteria","maturity","success_count","failure_count","success_rate","confidence_score","created_at","last_used","contributor_count","customer_count","methodology_ids"],"title":"SkillResponse","description":"Response containing skill information","example":{"application_template":"Approach: Propose 3 time options...","category":"task_pattern","confidence_score":0.72,"contributor_count":12,"created_at":"2024-01-15T10:30:00Z","customer_count":8,"description":"Learned pattern for handling meeting_scheduling tasks","failure_count":5,"last_used":"2024-01-20T14:22:00Z","maturity":"validated","methodology_ids":[29,31],"name":"Meeting Scheduling Pattern","pattern":{"task_type":"meeting_scheduling"},"preconditions":["Verify context matches pattern"],"skill_id":"abc123def456","success_count":45,"success_criteria":["Task completed successfully"],"success_rate":0.9}},"src__api__routers__subscription_router__CreditPurchaseRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"package":{"type":"string","title":"Package"}},"type":"object","required":["email","package"],"title":"CreditPurchaseRequest","description":"Credit purchase request"},"src__api__routers__subscription_router__TierName":{"type":"string","enum":["starter","manager","agency","trial"],"title":"TierName"},"src__api__routers__subscription_router__UpgradeRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"new_tier":{"$ref":"#/components/schemas/src__api__routers__subscription_router__TierName"}},"type":"object","required":["email","new_tier"],"title":"UpgradeRequest","description":"Plan upgrade/downgrade request"},"src__api__routers__subscription_router__UpgradeResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"old_tier":{"type":"string","title":"Old Tier"},"new_tier":{"type":"string","title":"New Tier"},"prorated_credit":{"type":"number","title":"Prorated Credit"},"credits_carried_over":{"type":"integer","title":"Credits Carried Over"},"new_credits_total":{"type":"integer","title":"New Credits Total"},"effective_date":{"type":"string","title":"Effective Date"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","old_tier","new_tier","prorated_credit","credits_carried_over","new_credits_total","effective_date","message"],"title":"UpgradeResponse","description":"Plan change response"},"src__api__routers__training_router__SendMessageRequest":{"properties":{"message":{"type":"string","maxLength":2000,"minLength":1,"title":"Message"}},"type":"object","required":["message"],"title":"SendMessageRequest","description":"Request body for sending a message during a training session."},"src__api__routers__user_skills_router__SkillResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"skill_type":{"type":"string","title":"Skill Type"},"instructions":{"type":"string","title":"Instructions"},"triggers":{"items":{"type":"string"},"type":"array","title":"Triggers"},"employee_ids":{"items":{"type":"string"},"type":"array","title":"Employee Ids"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"enabled":{"type":"boolean","title":"Enabled"},"usage_count":{"type":"integer","title":"Usage Count"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","user_id","name","description","skill_type","instructions","triggers","employee_ids","config","enabled","usage_count","last_used_at","created_at","updated_at"],"title":"SkillResponse","description":"Response containing skill information","example":{"config":{},"created_at":"2024-01-01T08:00:00Z","description":"Generates weekly team reports","employee_ids":["atlas","insight"],"enabled":true,"id":"skill_abc12345","instructions":"When asked for weekly report, compile...","last_used_at":"2024-01-20T10:30:00Z","name":"Weekly Report Generator","skill_type":"prompt","triggers":["weekly report","team summary"],"updated_at":"2024-01-15T14:20:00Z","usage_count":15,"user_id":"user_xyz789"}},"src__api__routers__weft_router__CreateWorkflowRequest":{"properties":{"goal":{"type":"string","maxLength":4000,"minLength":3,"title":"Goal","description":"High-level goal to accomplish"},"employees":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Employees","description":"Employee IDs to include. If omitted, auto-selects based on goal."},"human_approval_required":{"type":"boolean","title":"Human Approval Required","description":"Whether to insert a human approval step before delivery","default":false},"engine":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine","description":"Orchestration engine override: 'python' or 'weft'. If omitted, uses ORCHESTRATION_ENGINE env var."},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Optional context passed to the decomposition LLM"}},"type":"object","required":["goal"],"title":"CreateWorkflowRequest","description":"Create a new Weft workflow from a goal + employee selection."},"src__api__routers__weft_router__WorkflowListResponse":{"properties":{"workflows":{"items":{"$ref":"#/components/schemas/src__api__routers__weft_router__WorkflowResponse"},"type":"array","title":"Workflows"},"total":{"type":"integer","title":"Total"},"weft_available":{"type":"boolean","title":"Weft Available"}},"type":"object","required":["workflows","total","weft_available"],"title":"WorkflowListResponse"},"src__api__routers__weft_router__WorkflowResponse":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"goal":{"type":"string","title":"Goal"},"employees":{"items":{"type":"string"},"type":"array","title":"Employees"},"status":{"type":"string","title":"Status"},"weft_program":{"type":"string","title":"Weft Program"},"execution_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Id"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","title":"Created At"},"submitted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["workflow_id","goal","employees","status","weft_program","created_at"],"title":"WorkflowResponse"},"src__api__routers__workflow_router__CreateWorkflowRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Workflow name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"Workflow description"},"trigger_type":{"$ref":"#/components/schemas/TriggerType","description":"How the workflow is triggered","default":"manual"},"trigger_config":{"anyOf":[{"$ref":"#/components/schemas/TriggerConfig"},{"type":"null"}],"description":"Trigger-specific configuration"},"steps":{"items":{"$ref":"#/components/schemas/WorkflowStep"},"type":"array","title":"Steps","description":"List of workflow steps","default":[]},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"Deprecated and IGNORED - the owner is the authenticated caller","deprecated":true},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Owner email"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Workflow tags","default":[]}},"type":"object","required":["name"],"title":"CreateWorkflowRequest","description":"Request to create a new workflow"},"src__api__routers__workflow_router__WorkflowListResponse":{"properties":{"workflows":{"items":{"$ref":"#/components/schemas/src__api__routers__workflow_router__WorkflowResponse"},"type":"array","title":"Workflows"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["workflows","total","limit","offset"],"title":"WorkflowListResponse","description":"Response for listing workflows"},"src__api__routers__workflow_router__WorkflowResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"trigger_type":{"$ref":"#/components/schemas/TriggerType"},"trigger_config":{"additionalProperties":true,"type":"object","title":"Trigger Config"},"steps":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Steps"},"status":{"$ref":"#/components/schemas/WorkflowStatus"},"user_id":{"type":"string","title":"User Id"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"total_runs":{"type":"integer","title":"Total Runs"},"successful_runs":{"type":"integer","title":"Successful Runs"},"failed_runs":{"type":"integer","title":"Failed Runs"},"success_rate":{"type":"number","title":"Success Rate"},"last_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Run At"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","name","description","trigger_type","trigger_config","steps","status","user_id","tags","total_runs","successful_runs","failed_runs","success_rate","last_run_at","created_at","updated_at"],"title":"WorkflowResponse","description":"Response with workflow details"},"src__empires__forum__draft_routes__GenerateRequest":{"properties":{"topic":{"type":"string","maxLength":2000,"minLength":1,"title":"Topic"},"platform":{"type":"string","title":"Platform","default":"tiktok"},"profile_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Profile Id"},"pillars":{"items":{"type":"string"},"type":"array","title":"Pillars"},"run_ab_test":{"type":"boolean","title":"Run Ab Test","default":false},"population_size":{"type":"integer","maximum":10000.0,"minimum":100.0,"title":"Population Size","default":1000},"max_slop_composite":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Max Slop Composite","default":40}},"type":"object","required":["topic"],"title":"GenerateRequest"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}