{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/api/v1/jobs":{"post":{"tags":["jobs"],"summary":"Create Job","operationId":"create_job_api_v1_jobs_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Job Api V1 Jobs Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["jobs"],"summary":"List Jobs","operationId":"list_jobs_api_v1_jobs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Jobs Api V1 Jobs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}":{"get":{"tags":["jobs"],"summary":"Get Job","operationId":"get_job_api_v1_jobs__job_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Job Api V1 Jobs  Job Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/items":{"get":{"tags":["jobs"],"summary":"Get Job Items","operationId":"get_job_items_api_v1_jobs__job_id__items_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Job Items Api V1 Jobs  Job Id  Items Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/dependency-health":{"get":{"tags":["jobs"],"summary":"Get Job Dependency Health","operationId":"get_job_dependency_health_api_v1_jobs__job_id__dependency_health_get","security":[{"OAuth2PasswordBearer":[]}],"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":{"type":"object","additionalProperties":true,"title":"Response Get Job Dependency Health Api V1 Jobs  Job Id  Dependency Health Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/artifacts/{job_item_id}":{"get":{"tags":["jobs"],"summary":"Get Artifacts","operationId":"get_artifacts_api_v1_artifacts__job_item_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"job_item_id","in":"path","required":true,"schema":{"type":"string","title":"Job Item Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Artifacts Api V1 Artifacts  Job Item Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/prompt_sets":{"get":{"tags":["API v1","prompt_catalog"],"summary":"List Prompt Sets","operationId":"list_prompt_sets_api_v1_prompt_sets_get","parameters":[{"name":"sector","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Prompt Sets Api V1 Prompt Sets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tools/run":{"post":{"tags":["API v1","tools"],"summary":"Run Tool","operationId":"run_tool_api_v1_tools_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Run Tool Api V1 Tools Run Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/sectors":{"get":{"tags":["API v1"],"summary":"Get Sectors","description":"Return sectors grouped by the UI taxonomy (see ``sector_groups.py``).\n\nResponse shape:\n    [\n      {\n        \"group_key\": \"retail_ecommerce\",\n        \"group_label\": \"Retail & E-commerce\",\n        \"leaves\": [\n          {\"key\": \"retail_ecommerce\", \"label\": \"All Retail & E-commerce (generic)\",\n           \"is_generic\": true, \"has_intents_v2\": true, \"intents_count\": 20},\n          {\"key\": \"ecommerce_retail\", \"label\": \"E-commerce / Retail\",\n           \"is_generic\": false, \"has_intents_v2\": true, \"intents_count\": 20},\n          ...\n        ]\n      },\n      ...\n    ]\n\nEach group always contains an \"(generic)\" entry whose ``key`` equals the\ngroup key itself. When the frontend sends that key to ``/scan``, the\nsector_manager translates it to the group's generic leaf and the auto\ndetector is free to refine during the scan. Leaf entries are explicit\nuser picks — detector leaves them alone.","operationId":"get_sectors_api_v1_sectors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/analyses/list":{"get":{"tags":["API v1"],"summary":"List Analyses V1","operationId":"list_analyses_v1_api_v1_analyses_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api_models__AnalysesListResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/scan/extract-context":{"get":{"tags":["API v1"],"summary":"Extract Context From Url","description":"Multi-page business-context extraction.\n\nReads up to four pages (homepage + best-effort about/services/contact),\nruns a single LLM pass, and returns a draft BusinessContext the user\ncan review and edit on the scan form. Replaces ``/scan/detect-sector``\nas the prescan entry point. Requires a workspace; the LLM call counts\nagainst its monthly budget and is refused with 402 when that is spent.\n\n``language`` (e.g. \"nl\") forces the draft's user-facing fields to that\nlanguage so an NL scan yields a Dutch draft (the FE passes the scan\nlanguage derived from the Target Region).","operationId":"extract_context_from_url_api_v1_scan_extract_context_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","title":"Domain"}},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scan/previous-context":{"get":{"tags":["API v1"],"summary":"Scan Previous Context","description":"Return business context from the most recent scan of this domain.\n\nUsed by the scan form to pre-fill context fields when re-scanning a\ndomain that was scanned before.","operationId":"scan_previous_context_api_v1_scan_previous_context_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scan/preview-intents":{"post":{"tags":["API v1"],"summary":"Preview Intents","description":"Generate the AI questions we'll test for this scan, before submission.\n\nUses the user-confirmed business context to call the dynamic-intent\ngenerator fresh (bypassing the cache so \"regenerate\" works), then\nwrites the result back to the workspace's own cache the scan flow\nreads from. The user reviews the intents on the form; clicking\n\"Start scan\" submits to ``/scan`` and the scan picks the same intents\nup via the normal cache-hit path.","operationId":"preview_intents_api_v1_scan_preview_intents_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewIntentsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/scan":{"post":{"tags":["API v1"],"summary":"Scan Domain","description":"Scan a domain and calculate discoverability scores.\n\nDefault (no flag): **async**. Returns immediately with status=\"in_progress\" and\nanalysis_id; the scan runs in the background. Frontend polls\n/api/v1/analyses/{analysis_id} until status becomes \"completed\" or \"failed\".\nSafe under Cloudflare's 100s edge timeout (each poll is sub-second).\n\nPass `?sync=1` to block until the scan finishes and return the full result inline.\nUsed by tests and admin scripts that don't go through Cloudflare. Browsers should\nNOT use this — long scans will hit the 100s edge timeout and surface a 504.","operationId":"scan_domain_api_v1_scan_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"sync","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Sync"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/benchmark":{"post":{"tags":["API v1"],"summary":"Benchmark Domain","description":"Run LLM benchmark tests for a domain.\nDelegates to BenchmarkService and persists results if analysisId is provided.","operationId":"benchmark_domain_api_v1_benchmark_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BenchmarkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/analyses/{analysis_id}":{"get":{"tags":["API v1"],"summary":"Get Analysis","description":"Get full analysis details by ID.\nReturns normalized analysis data including scores, intents, and actions.\n\nWhen ``include_raw=true``, the full ``raw_analysis`` dict is attached to the\nresponse. This is intended for ground-truth audits of the scanner's output\n(signal values, check diagnostics, crawl snapshots). The payload is large\nand internal, so the flag is restricted to workspace owners and admins.\nRegular members receive ``403 Forbidden`` when setting the flag.\n\nWhen ``lang`` is provided (en/nl/de/fr/es), intent labels in\n``intent_results_v2`` are re-resolved from the bilingual registry. Without\n``lang`` the response is byte-identical to prior behaviour.","operationId":"get_analysis_api_v1_analyses__analysis_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"include_raw","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Raw"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/fact-file":{"get":{"tags":["API v1"],"summary":"Get Fact File Preview","description":"Return deterministic facts.json + llms.txt preview derived from stored analysis.","operationId":"get_fact_file_preview_api_v1_analyses__analysis_id__fact_file_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/check-files":{"get":{"tags":["API v1"],"summary":"Check Domain Files","description":"Check whether facts.json and llms.txt are publicly accessible on the\nscanned domain.\n\nThe domain is resolved from an existing analysis owned by the requesting\nworkspace — this prevents the endpoint from being used as an open proxy\nto probe arbitrary hosts.\n\nReturns:\n- domain: normalised hostname\n- facts_json: { \"url\": \"...\", \"exists\": true/false, \"status_code\": int|null }\n- llms_txt:   { \"url\": \"...\", \"exists\": true/false, \"status_code\": int|null }","operationId":"check_domain_files_api_v1_analyses__analysis_id__check_files_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/actions/custom":{"get":{"tags":["API v1"],"summary":"List Custom Actions","operationId":"list_custom_actions_api_v1_analyses__analysis_id__actions_custom_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomActionsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["API v1"],"summary":"Create Custom Action","operationId":"create_custom_action_api_v1_analyses__analysis_id__actions_custom_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomActionCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/actions/custom/{action_id}":{"patch":{"tags":["API v1"],"summary":"Update Custom Action","operationId":"update_custom_action_api_v1_analyses__analysis_id__actions_custom__action_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"action_id","in":"path","required":true,"schema":{"type":"string","title":"Action Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomActionUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["API v1"],"summary":"Delete Custom Action","operationId":"delete_custom_action_api_v1_analyses__analysis_id__actions_custom__action_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"action_id","in":"path","required":true,"schema":{"type":"string","title":"Action Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/actions/status":{"get":{"tags":["API v1"],"summary":"Get Analysis Action Statuses","description":"Get the status of all actions for a specific analysis.","operationId":"get_analysis_action_statuses_api_v1_analyses__analysis_id__actions_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/app__domain__actions__ActionStatusResponse"},"title":"Response Get Analysis Action Statuses Api V1 Analyses  Analysis Id  Actions Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["API v1"],"summary":"Update Analysis Action Statuses","description":"Update the status of one or more actions for a specific analysis.","operationId":"update_analysis_action_statuses_api_v1_analyses__analysis_id__actions_status_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/app__domain__actions__ActionStatusUpdate"},"title":"Updates"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/app__domain__actions__ActionStatusResponse"},"title":"Response Update Analysis Action Statuses Api V1 Analyses  Analysis Id  Actions Status Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/actions/{action_id}/hide":{"delete":{"tags":["API v1"],"summary":"Unhide an action","description":"**POST** — sets `is_hidden=true` on the action row (creates the row if absent).\n**DELETE** — sets `is_hidden=false` (unhide).\n\nThe action's `status` (open/done) is not affected by this call.","operationId":"toggle_action_hidden_api_v1_analyses__analysis_id__actions__action_id__hide_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"action_id","in":"path","required":true,"schema":{"type":"string","title":"Action Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__domain__actions__ActionStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["API v1"],"summary":"Hide an action","description":"**POST** — sets `is_hidden=true` on the action row (creates the row if absent).\n**DELETE** — sets `is_hidden=false` (unhide).\n\nThe action's `status` (open/done) is not affected by this call.","operationId":"toggle_action_hidden_api_v1_analyses__analysis_id__actions__action_id__hide_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"action_id","in":"path","required":true,"schema":{"type":"string","title":"Action Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__domain__actions__ActionStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/action-outcomes":{"get":{"tags":["API v1"],"summary":"Get Analysis Action Outcomes","description":"Return all outcome rows captured for a given analysis.\n\nEach row carries:\n- ``baseline``: snapshot at the moment the action was marked done\n- ``milestone_30/60/90``: snapshots from scans crossing the\n  30/60/90-day thresholds (null when no such scan has happened yet)\n- ``delta_30/60/90``: computed score deltas vs baseline (null when\n  the corresponding milestone is null)\n\nPure-read endpoint. No LLM cost, no side effects. Intended for\ninternal analysis + future \"proof of impact\" features in the UI.","operationId":"get_analysis_action_outcomes_api_v1_analyses__analysis_id__action_outcomes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/domains/{domain}/visibility-timeline":{"get":{"tags":["API v1"],"summary":"Get Domain Visibility Timeline","description":"Phase A Day 3.5 — visibility-over-time + implementation-event markers.\n\nReturns the time series powering the customer-facing visibility chart on\nthe case Overview. Two parallel arrays:\n\n- ``scans``: one point per completed scan in the last ``days`` days,\n  sorted ascending by ``scanned_at``. Each entry carries the total\n  score, the AI-visibility-side numbers we can compute cheaply\n  (mention_rate, intents_mentioned, intents_total), and the verdict\n  mix when present.\n- ``events``: implementation-event markers from ``action_outcomes``\n  (both human-marked and auto-detected), keyed by ``implemented_at``\n  so the chart can render ▲ markers correlating fix → effect.\n\n``breakdown=true`` adds a per-model and per-intent rollup to every scan\n(storyline slice 1). It is opt-in because the chart does not need it and\nthis endpoint is called on every case open; ``lang`` localises the intent\nlabels inside that rollup and does nothing without it.\n\nPure-read, no LLM cost. Authorised against the workspace just like\nthe existing /action-outcomes endpoint.","operationId":"get_domain_visibility_timeline_api_v1_domains__domain__visibility_timeline_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","title":"Domain"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":90,"title":"Days"}},{"name":"breakdown","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Breakdown"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/rescan-signal":{"get":{"tags":["API v1"],"summary":"Get Analysis Rescan Signal","description":"Phase A Day 4 — the come-back-in-N-days signal.\n\nReturns the timestamp at which a customer should rescan to verify\na fix (7d after the oldest pending implementation), or for monthly\nre-measurement (30d after the last scan). null when neither\nsignal applies.\n\nFrontend renders a banner card on the case page when ``rescan_due_now``.","operationId":"get_analysis_rescan_signal_api_v1_analyses__analysis_id__rescan_signal_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/readiness":{"get":{"tags":["API v1"],"summary":"Get Analysis Readiness","description":"Bridge Phase 5 — single source of truth for \"is the funnel ready?\".\n\nThe scan itself is async (``status`` flips to ``completed`` after ~1min),\nbut the AI Visibility verdicts + prioritized worklist come from a SECOND\nasync phase — the AMC probe job (often 5-6min) that writes\n``raw_analysis.visibility_verdicts_v1``. Nothing exposed a unified\n\"everything is ready\" signal, so each surface guessed (jobPending /\nno_runs) with edge cases. This endpoint reports per-stage readiness +\n``fully_ready`` so the FE can hold one honest \"crunching\" wait screen and\nreveal the complete funnel at once. Read-only; cheap.\n\nStages:\n  - ``scan``: in_progress | completed | failed  (Analysis.status)\n  - ``demand``: pending | ready  (intent_demand_questions rows exist)\n  - ``ai_visibility``: pending | ready | failed\n        ready  = raw_analysis.visibility_verdicts_v1 present (the\n                 authoritative \"verdicts written\" signal)\n        failed = newest AMC job failed/budget_hit AND no verdicts yet\n        pending = otherwise (job queued/running, or not started)","operationId":"get_analysis_readiness_api_v1_analyses__analysis_id__readiness_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/mark-results-viewed":{"post":{"tags":["API v1"],"summary":"Mark Analysis Results Viewed","description":"Bridge Phase 5 Slice 4 — record that the customer opened the funnel\nresults in-app (AI Visibility). Suppresses the \"results ready\" email nudge\n(the +60min one); the +12h recap still sends. Idempotent — first call wins.","operationId":"mark_analysis_results_viewed_api_v1_analyses__analysis_id__mark_results_viewed_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/register":{"post":{"tags":["auth"],"summary":"Register User","description":"Register a new user and send verification email.","operationId":"register_user_api_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/verify-email":{"get":{"tags":["auth"],"summary":"Verify Email","description":"Verify user email with token.","operationId":"verify_email_api_v1_auth_verify_email_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/v1/auth/resend-verification-email":{"post":{"tags":["auth"],"summary":"Resend Verification Email","description":"Resend the verification email for an unverified account.","operationId":"resend_verification_email_api_v1_auth_resend_verification_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"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/auth/login":{"post":{"tags":["auth"],"summary":"Login For Access Token","operationId":"login_for_access_token_api_v1_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/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/forgot-password":{"post":{"tags":["auth"],"summary":"Forgot Password","description":"Request password reset email.","operationId":"forgot_password_api_v1_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"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/auth/reset-password":{"post":{"tags":["auth"],"summary":"Reset Password","description":"Reset password using token.","operationId":"reset_password_api_v1_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"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/auth/me":{"get":{"tags":["auth"],"summary":"Read Users Me","operationId":"read_users_me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"patch":{"tags":["auth"],"summary":"Update Profile","description":"Update the current user's profile (name, task-mail toggle).","operationId":"update_profile_api_v1_auth_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/me/welcome-tour-seen":{"post":{"tags":["auth"],"summary":"Mark Welcome Tour Seen","operationId":"mark_welcome_tour_seen_api_v1_auth_me_welcome_tour_seen_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/me/quota-modal-seen":{"post":{"tags":["auth"],"summary":"Mark Quota Modal Seen","description":"Stamp the user's quota_modal_seen_period with the current period sentinel.\n\nSentinel is \"trial\" while the user's workspace is trialing; otherwise the\nISO date of the first of the current calendar month. The match is checked\nby compute_scan_quota — when sentinel != current period, the modal re-fires\n(this is what makes it auto-renew month-to-month for paid tiers).","operationId":"mark_quota_modal_seen_api_v1_auth_me_quota_modal_seen_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/me/upload-avatar":{"post":{"tags":["auth"],"summary":"Upload Avatar","description":"Upload an avatar image for the current user.\n\nThe file is written to uploads/avatars/ on disk and served under\n/uploads/avatars/<filename>. Any previous avatar file is removed from\ndisk when a new one is uploaded.","operationId":"upload_avatar_api_v1_auth_me_upload_avatar_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_avatar_api_v1_auth_me_upload_avatar_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/change-password":{"post":{"tags":["auth"],"summary":"Change Password","description":"Change the current user's password.","operationId":"change_password_api_v1_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/act-as/{user_id}":{"post":{"tags":["auth"],"summary":"Act As User","description":"Impersonate another user (admin only).\n\nCreates a short-lived token scoped to the target user's identity.\nThe admin's action is recorded in the audit log.","operationId":"act_as_user_api_v1_auth_act_as__user_id__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/my":{"get":{"tags":["workspaces"],"summary":"List My Workspaces","description":"List all workspaces the current user is a member of.","operationId":"list_my_workspaces_api_v1_workspaces_my_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WorkspaceResponse"},"type":"array","title":"Response List My Workspaces Api V1 Workspaces My Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/workspaces/":{"post":{"tags":["workspaces"],"summary":"Create Workspace","description":"Create a new workspace and make the creator an owner. System Admin only.","operationId":"create_workspace_api_v1_workspaces__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/workspaces/current/members":{"get":{"tags":["workspaces"],"summary":"List Current Workspace Members","description":"List members of the current workspace (Admin/Owner only).","operationId":"list_current_workspace_members_api_v1_workspaces_current_members_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WorkspaceMemberResponse"},"type":"array","title":"Response List Current Workspace Members Api V1 Workspaces Current Members Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/workspaces/{workspace_id}/members":{"get":{"tags":["workspaces"],"summary":"List Workspace Members","description":"List members of a workspace (Admin only).","operationId":"list_workspace_members_api_v1_workspaces__workspace_id__members_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceMemberResponse"},"title":"Response List Workspace Members Api V1 Workspaces  Workspace Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["workspaces"],"summary":"Add Workspace Member","description":"Add a member to a workspace (Admin only).","operationId":"add_workspace_member_api_v1_workspaces__workspace_id__members_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMemberAddRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/{workspace_id}/assignable-members":{"get":{"tags":["workspaces"],"summary":"List Assignable Members","description":"List members of a workspace for the task \"Assign to...\" picker.\n\nUnlike GET /{workspace_id}/members (owner/admin only, used for team\nmanagement), this endpoint is available to ANY member of the workspace so\nthat all roles can assign tasks to a colleague. It is read-only and does\nnot expose management actions. The assignment write endpoint\n(POST /analyses/{id}/actions/status) already permits owner/admin/member.","operationId":"list_assignable_members_api_v1_workspaces__workspace_id__assignable_members_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}},{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only people who may see this website","title":"Domain"},"description":"Only people who may see this website"},{"name":"profile_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only people who may see this Brand","title":"Profile Id"},"description":"Only people who may see this Brand"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceMemberResponse"},"title":"Response List Assignable Members Api V1 Workspaces  Workspace Id  Assignable Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/{workspace_id}/members/{user_id}":{"patch":{"tags":["workspaces"],"summary":"Update Member Role","description":"Update a member's role (Admin only).","operationId":"update_member_role_api_v1_workspaces__workspace_id__members__user_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMemberUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["workspaces"],"summary":"Remove Workspace Member","description":"Remove a member from a workspace. Users can remove themselves; removing others requires admin rights.","operationId":"remove_workspace_member_api_v1_workspaces__workspace_id__members__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/auto-rescan":{"get":{"tags":["workspaces"],"summary":"Get Auto Rescan Setting","description":"Whether automatic 30/60/90-day re-measurement scans are on for this\nworkspace, plus whether the workspace is on a paid plan (auto-rescans only\nactually run for paid workspaces).","operationId":"get_auto_rescan_setting_api_v1_workspaces_auto_rescan_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoRescanSettingResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["workspaces"],"summary":"Update Auto Rescan Setting","description":"Enable/disable automatic re-measurement scans. Owner/admin only.","operationId":"update_auto_rescan_setting_api_v1_workspaces_auto_rescan_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoRescanUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoRescanSettingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/branding/my":{"get":{"tags":["branding"],"summary":"Get My Branding","description":"Get agency branding for the current workspace.\nCreates default branding if none exists.","operationId":"get_my_branding_api_v1_branding_my_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyBrandingResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["branding"],"summary":"Update My Branding","description":"Update agency branding for the current workspace.\nOnly workspace admins/owners can update branding.","operationId":"update_my_branding_api_v1_branding_my_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyBrandingUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyBrandingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["branding"],"summary":"Reset My Branding","description":"Reset agency branding to defaults for the current workspace.\nOnly workspace admins/owners can reset branding.","operationId":"reset_my_branding_api_v1_branding_my_delete","responses":{"204":{"description":"Successful Response"}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/branding/upload-logo":{"post":{"tags":["branding"],"summary":"Upload Logo","description":"Upload a logo for the workspace branding.\n\nThe file is written to uploads/logos/ on disk and served under\n/uploads/logos/<filename>. The URL is persisted on the branding row\nimmediately so it survives even if the user never clicks \"Save\".\nAny previous logo file is removed from disk when a new one is uploaded.\nOnly workspace admins/owners can upload logos.","operationId":"upload_logo_api_v1_branding_upload_logo_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_logo_api_v1_branding_upload_logo_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/dashboard/metrics":{"get":{"tags":["dashboard-v1"],"summary":"Get Dashboard Metrics V1","description":"Return workspace-scoped dashboard metrics for snapshot cards.","operationId":"get_dashboard_metrics_v1_api_v1_dashboard_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardMetricsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/tasks":{"get":{"tags":["tasks"],"summary":"List Tasks","operationId":"list_tasks_api_v1_tasks_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"assignee","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A users.id, or \"me\" for the caller. Omit for every assignee.","title":"Assignee"},"description":"A users.id, or \"me\" for the caller. Omit for every assignee."},{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact domain match.","title":"Domain"},"description":"Exact domain match."},{"name":"include_done","in":"query","required":false,"schema":{"type":"boolean","description":"Include completed tasks.","default":false,"title":"Include Done"},"description":"Include completed tasks."},{"name":"include_unassigned","in":"query","required":false,"schema":{"type":"boolean","description":"Also list the open tasks nobody is assigned to, from the newest completed scan of every website (#949 point 4). Ignored when filtering on an assignee.","default":false,"title":"Include Unassigned"},"description":"Also list the open tasks nobody is assigned to, from the newest completed scan of every website (#949 point 4). Ignored when filtering on an assignee."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TasksResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications":{"get":{"tags":["notifications"],"summary":"List Notifications","operationId":"list_notifications_api_v1_notifications_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":15,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NotificationItem"},"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":"Get Unread Count","description":"The polled endpoint. Kept to a single indexed COUNT.","operationId":"get_unread_count_api_v1_notifications_unread_count_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnreadCountResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/notifications/{notification_id}/read":{"post":{"tags":["notifications"],"summary":"Mark Read","operationId":"mark_read_api_v1_notifications__notification_id__read_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/read-all":{"post":{"tags":["notifications"],"summary":"Mark All Read","operationId":"mark_all_read_api_v1_notifications_read_all_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnreadCountResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/invitations":{"get":{"tags":["invitations"],"summary":"List Invitations","description":"List pending invitations for the current workspace.\nOnly OWNER or ADMIN can list.","operationId":"list_invitations_api_v1_invitations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/InvitationResponse"},"type":"array","title":"Response List Invitations Api V1 Invitations Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["invitations"],"summary":"Create Invitation","description":"Invite a user to the current workspace.\nOnly OWNER or ADMIN can invite.","operationId":"create_invitation_api_v1_invitations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/invitations/{invitation_id}":{"delete":{"tags":["invitations"],"summary":"Revoke Invitation","description":"Revoke (cancel) a workspace invitation.\n\nPermission: workspace owner for the invitation's workspace, or system admin.\nIdempotent: returns 204 even if the invitation does not exist or is not pending.","operationId":"revoke_invitation_api_v1_invitations__invitation_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invitations/{token}":{"get":{"tags":["invitations"],"summary":"Get Invitation By Token","description":"Get invitation details by token (public endpoint for registration page).\nReturns basic invitation info without requiring authentication.","operationId":"get_invitation_by_token_api_v1_invitations__token__get","parameters":[{"name":"token","in":"path","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/v1/invitations/{token}/accept":{"post":{"tags":["invitations"],"summary":"Accept Invitation","description":"Accept an invitation.\nUser must be logged in and invitation must be for their email.","operationId":"accept_invitation_api_v1_invitations__token__accept_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"token","in":"path","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/v1/billing/create-checkout-session":{"post":{"tags":["billing"],"summary":"Create Checkout Session","description":"Create a Stripe Checkout Session for subscription.","operationId":"create_checkout_session_api_v1_billing_create_checkout_session_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/create-portal-session":{"post":{"tags":["billing"],"summary":"Create Portal Session","description":"Create a Stripe Customer Portal session for managing subscription.\n\nBody is optional — clients that POST with no body get the portal home\n(existing \"Manage subscription\" button). Clients that POST\n``{\"flow\": \"subscription_update\"}`` deep-link to the subscription edit\nscreen (used by the \"Add domains\" / \"Add seats\" buttons).","operationId":"create_portal_session_api_v1_billing_create_portal_session_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PortalSessionRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/activate-now":{"post":{"tags":["billing"],"summary":"Activate Subscription Now","description":"End the trial immediately and start charging.\n\nSets ``trial_end='now'`` on the Stripe subscription, which ends the trial\non the spot and triggers the first invoice through normal Stripe billing.\nThe webhook (invoice.paid / customer.subscription.updated) is the source\nof truth for subscription_status; we sync it here so the response reflects\nthe new state without waiting for the webhook to land.","operationId":"activate_subscription_now_api_v1_billing_activate_now_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateNowResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/subscription":{"get":{"tags":["billing"],"summary":"Get Subscription","description":"Get current subscription status and usage for the workspace.","operationId":"get_subscription_api_v1_billing_subscription_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/addons/preview":{"post":{"tags":["billing"],"summary":"Preview Addon","description":"Compute what would happen if the customer applied a quantity change,\nwithout actually mutating the subscription. Returns the prorated charge or\ncredit that would land on the next invoice plus the recurring delta.\n\nFrontend calls this on every quantity stepper change so the user sees the\ncost commitment before clicking Apply. Mirrors validation of /addons/update\nso the same errors surface here first.","operationId":"preview_addon_api_v1_billing_addons_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonPreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/addons/update":{"post":{"tags":["billing"],"summary":"Update Addon","description":"Adjust per-domain or per-seat add-on quantity on the workspace's Stripe\nsubscription. Picks monthly vs annual add-on price based on the parent\nsubscription's interval, then creates / modifies / deletes the line item\nas needed. Self-heals workspace.purchased_addon_* from the result.","operationId":"update_addon_api_v1_billing_addons_update_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonUpdateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/webhook":{"post":{"tags":["billing"],"summary":"Stripe Webhook","description":"Handle Stripe webhook events. No auth — validated by Stripe signature.","operationId":"stripe_webhook_api_v1_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/forecast":{"get":{"tags":["billing"],"summary":"Get Revenue Forecast","description":"Admin-only: estimated MRR/ARR from current subscribers.\n\nUses workspace counts from the DB (source of truth) and resolves monthly\nunit prices from Stripe using the ``stripe_price_id_monthly`` stored in\n``pricing_packages``. Add-on quantities (domains + seats) are read directly\nfrom workspace columns.\n\nAnnual-billed workspaces are treated as monthly for this estimate — actual\nARR is collected upfront for those customers, so the figures here represent\na normalised run-rate view. See ``response.notes`` for caveats.","operationId":"get_revenue_forecast_api_v1_billing_forecast_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/cron/trial-nudges":{"post":{"tags":["cron"],"summary":"Run Trial Nudges","description":"Enqueue day-7 and day-12 nudge emails for trialing workspaces.\n\nTrial duration is 14 days. Day-7 catches mid-trial customers; day-12 is\nthe urgency push 2 days before expiry. Tolerates a 1-day window on either\nside so a slightly late cron firing still finds the right customers.\n\nEnqueues into ``mail_queue`` for immediate dispatch by the worker.\nDeduplication via (source_type='trial_nudge', source_id='{ws_id}:day{N}')\nprevents double-queuing if the cron fires twice in the same window.\n\nThe worker tick now drives this on its own schedule; this route stays as a\nmanual trigger. Both call the same ``enqueue_due_trial_nudges`` core.","operationId":"run_trial_nudges_api_cron_trial_nudges_post","parameters":[{"name":"x-cron-secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Cron-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Trial Nudges Api Cron Trial Nudges Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cron/sweep-stuck-analyses":{"post":{"tags":["cron"],"summary":"Run Sweep Stuck Analyses","description":"Phase 5 Bucket B — flip abandoned IN_PROGRESS analyses to FAILED.\n\nThe async /scan pipeline runs as a FastAPI BackgroundTask. If the\ncontainer is killed mid-scan (deploy, OOM, SIGTERM), the task dies\nsilently without raising — `_mark_analysis_failed` never fires and\nthe Analysis row sits at IN_PROGRESS forever. This sweep catches\nthose rows so the cases page flips to the \"Scan failed\" UX instead\nof showing a stuck spinner.\n\nThreshold: 10 min of no `updated_at` movement (well above typical\n3-5 min scan duration). Idempotent; safe to run every few minutes.","operationId":"run_sweep_stuck_analyses_api_cron_sweep_stuck_analyses_post","parameters":[{"name":"x-cron-secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Cron-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Sweep Stuck Analyses Api Cron Sweep Stuck Analyses Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cron/scan-failure-streaks":{"post":{"tags":["cron"],"summary":"Run Scan Failure Streaks","description":"Escalate domains whose scans keep failing.\n\nDistinct from ``/sweep-stuck-analyses``, which catches rows *wedged* in\nIN_PROGRESS. This catches the opposite: scans that fail promptly and\ncorrectly, over and over, on the same domain.\n\nkralenstulpje.nl failed 11 consecutive scans across 12 days in a paying\npilot workspace and nobody noticed. An alert fired every single time --\nthat was the problem. Eleven identical per-event warnings spread over\ntwelve days read as routine noise, and no per-event alert can say the\nthing that actually mattered: this domain has been broken for 12 days.\n\nOne aggregated alert per run, not one per failure. Read-only; safe to\nrun daily and safe to re-run.","operationId":"run_scan_failure_streaks_api_cron_scan_failure_streaks_post","parameters":[{"name":"threshold","in":"query","required":false,"schema":{"type":"integer","default":3,"title":"Threshold"}},{"name":"lookback_days","in":"query","required":false,"schema":{"type":"integer","default":14,"title":"Lookback Days"}},{"name":"x-cron-secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Cron-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Scan Failure Streaks Api Cron Scan Failure Streaks Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cron/worker-watchdog":{"post":{"tags":["cron"],"summary":"Run Worker Watchdog","description":"Alert when the worker has stopped draining the job queue.\n\nOn 2026-09-10 an AI mention job was enqueued at 17:39:04; the worker\nlogged its last line at 17:44:47 and produced nothing for the next two\nand a half hours while that job sat QUEUED. Coolify showed the resource\nRunning throughout, and the case page reported \"AI-meting: niet\nuitgevoerd\" — a stalled queue presented as if nothing had been asked for.\n\nNothing caught it, and nothing inside the worker could have: its\nheartbeat is written inside the same tick that wedges, so a frozen worker\ncannot report its own freeze. Docker restart policies act on process\nexit, and neither Docker nor Coolify restarts a container that is\nunhealthy but still running. The observer has to be another process, so\nit lives here.\n\nTwo signals together, because either alone is ambiguous: a silent\nheartbeat looks the same as an idle Sunday, and a deep queue looks the\nsame as a legitimate burst. Work waiting AND nobody claiming it is not\nambiguous.\n\nAlerts on the transition in and out of trouble, not per run — a 5-minute\nschedule would otherwise repeat itself twelve times an hour, which is the\nnoise ``/scan-failure-streaks`` above was written to avoid.\n\nRead-only apart from its own dedupe row. It does not restart the worker or\nre-queue jobs; that is a separate change so this can ship on its own.\n\nSchedule every 5 minutes (Coolify Scheduled Task or any external cron):\n    curl -X POST -H \"X-Cron-Secret: ${CRON_SECRET}\"           https://api.findalyse.com/api/cron/worker-watchdog","operationId":"run_worker_watchdog_api_cron_worker_watchdog_post","parameters":[{"name":"x-cron-secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Cron-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Worker Watchdog Api Cron Worker Watchdog Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cron/auto-rescans":{"post":{"tags":["cron"],"summary":"Run Auto Rescans","description":"Phase 4b — fire any pending 5-day auto-rescans.\n\nReads ``scheduled_scans`` rows whose ``scheduled_at`` has elapsed.\nFor each: skip if the customer already rescanned (status →\n'superseded'), otherwise seed a new Analysis row and kick off the\nscan via the existing background pipeline (status → 'executed').\nOn crash, bump retry_count and reschedule next-day; after 3 retries\nmark 'failed' and Discord alert.\n\nIdempotent by design — the WHERE filter ensures only pending rows\nare picked up; status flips happen synchronously before the\nbackground task fires.\n\nAlso enqueues milestone-triggered rescans (paid + opted-in workspaces with\na due 30/60/90-day outcome milestone) into the same scheduled_scans queue\nfirst, so they fire on this same tick via the dispatcher below.","operationId":"run_auto_rescans_api_cron_auto_rescans_post","parameters":[{"name":"x-cron-secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Cron-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Auto Rescans Api Cron Auto Rescans Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/front/contact":{"post":{"tags":["public"],"summary":"Submit Contact","description":"Accept a contact form submission from the marketing website.","operationId":"submit_contact_api_front_contact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/front/pricing":{"get":{"tags":["public"],"summary":"Get Pricing","description":"Return pricing plans from the database for the marketing website.","operationId":"get_pricing_api_front_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/probes/":{"post":{"tags":["probes"],"summary":"Create Probe","description":"Create a new AI probe definition for the current workspace.\n\nA probe defines a reusable question or scenario to test with LLMs.\nFor example: \"Best plumbers in Groningen\" to check if a domain is mentioned.\n\nReturns:\n    Created probe definition","operationId":"create_probe_api_v1_probes__post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProbeCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProbeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["probes"],"summary":"List Probes","description":"List all probes for the current workspace.\n\nArgs:\n    active_only: If True, only return active probes (default: True)\n    \nReturns:\n    List of probes, ordered by creation date (newest first)","operationId":"list_probes_api_v1_probes__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProbeResponse"},"title":"Response List Probes Api V1 Probes  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/probes/{probe_id}":{"get":{"tags":["probes"],"summary":"Get Probe","operationId":"get_probe_api_v1_probes__probe_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"probe_id","in":"path","required":true,"schema":{"type":"string","title":"Probe Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProbeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["probes"],"summary":"Update Probe","operationId":"update_probe_api_v1_probes__probe_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"probe_id","in":"path","required":true,"schema":{"type":"string","title":"Probe Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProbeUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProbeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["probes"],"summary":"Delete Probe","operationId":"delete_probe_api_v1_probes__probe_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"probe_id","in":"path","required":true,"schema":{"type":"string","title":"Probe Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/probes/{probe_id}/runs":{"post":{"tags":["probes"],"summary":"Create Probe Run","description":"Create a new probe run for the current workspace.\n\nThis creates a run in 'pending' status. Execution happens in the worker.\n\nArgs:\n    probe_id: ID of probe to run\n    request: Run configuration (optional analysis_id to link)\n    \nReturns:\n    Created probe run with status 'pending'","operationId":"create_probe_run_api_v1_probes__probe_id__runs_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"probe_id","in":"path","required":true,"schema":{"type":"string","title":"Probe Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProbeRunCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProbeRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/probes/runs/{run_id}":{"get":{"tags":["probes"],"summary":"Get Probe Run","description":"Get details of a probe run including results.\n\nReturns full probe run details with:\n- Run status and timestamps\n- Linked probe definition\n- Results from LLM executions (if any)\n- Linked analysis (if any)\n\nArgs:\n    run_id: Probe run ID\n    \nReturns:\n    Probe run details\n    \nRaises:\n    404: If run not found or not accessible in current workspace","operationId":"get_probe_run_api_v1_probes_runs__run_id__get","security":[{"OAuth2PasswordBearer":[]}],"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/ProbeRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/probes/runs/{run_id}/results":{"get":{"tags":["probes"],"summary":"Get Probe Run Results","operationId":"get_probe_run_results_api_v1_probes_runs__run_id__results_get","security":[{"OAuth2PasswordBearer":[]}],"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/ProbeRunResultsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/worker-status":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Worker Status","description":"Return current AI Ranking worker status and configuration.","operationId":"worker_status_api_v1_ai_ranking_worker_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Worker Status Api V1 Ai Ranking Worker Status Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-ranking/worker-toggle":{"post":{"tags":["ai-ranking","AI Ranking"],"summary":"Worker Toggle","description":"Toggle AI Ranking worker enabled/disabled in admin settings.","operationId":"worker_toggle_api_v1_ai_ranking_worker_toggle_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Worker Toggle Api V1 Ai Ranking Worker Toggle Post"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-ranking/reset-usage":{"post":{"tags":["ai-ranking","AI Ranking"],"summary":"Reset Usage","description":"Reset daily scan/benchmark/pdf usage counters for a workspace. Admin only.","operationId":"reset_usage_api_v1_ai_ranking_reset_usage_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"query","required":true,"schema":{"type":"string","description":"Workspace ID to reset usage for","title":"Workspace Id"},"description":"Workspace ID to reset usage for"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reset Usage Api V1 Ai Ranking Reset Usage Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/model-responses":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Model Responses","description":"Return raw AI model responses for a domain — what each model said per intent.\n\nWhen ``lang`` is supplied, each response row gains an ``intent_label`` field\nresolved from the intents_v2 bilingual registry. Without ``lang`` the\nresponse is byte-identical to prior behaviour.","operationId":"model_responses_api_v1_ai_ranking_model_responses_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}},{"name":"analysis_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Locale for intent labels (en/nl/de/fr/es)","title":"Lang"},"description":"Locale for intent labels (en/nl/de/fr/es)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Model Responses Api V1 Ai Ranking Model Responses Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/content-gaps":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Content Gaps","description":"Identify content gaps: intents where you're not mentioned + no matching page exists.\n\nPure data cross-reference — no LLM cost. Uses AI mention results,\ncrawled page summaries, and intent labels to find gaps.\n\nWhen ``lang`` is supplied (en/nl/de/fr/es), each gap's ``intent_label``\nis resolved from the bilingual intents_v2 registry. Without ``lang`` the\nresponse keeps the prompt-set's single-language ``intent_description`` for\nbackward compatibility.","operationId":"content_gaps_api_v1_ai_ranking_content_gaps_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}},{"name":"analysis_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Content Gaps Api V1 Ai Ranking Content Gaps Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/generate-article/jobs":{"post":{"tags":["ai-ranking","AI Ranking"],"summary":"Queue Generate Article","description":"Queue an article generation on the worker and return at once.\n\nSame body as ``/generate-article``. Returns ``{\"status\": \"queued\", \"job\":\n{...}}``, or the refusal the synchronous endpoint would give (budget,\nquota, missing fields). Poll ``GET /generate-article/jobs/{job_id}``.","operationId":"queue_generate_article_api_v1_ai_ranking_generate_article_jobs_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Queue Generate Article Api V1 Ai Ranking Generate Article Jobs Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["ai-ranking","AI Ranking"],"summary":"List Active Generate Article Jobs","description":"Queued and running generations of this workspace on ``domain``, so a\npage opened mid-generation can pick up where it was.","operationId":"list_active_generate_article_jobs_api_v1_ai_ranking_generate_article_jobs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Active Generate Article Jobs Api V1 Ai Ranking Generate Article Jobs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/generate-article/jobs/{job_id}":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Get Generate Article Job","description":"One generation: status, step and, when done, the full article\nresponse under ``result``. Another workspace's job is a 404.","operationId":"get_generate_article_job_api_v1_ai_ranking_generate_article_jobs__job_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Generate Article Job Api V1 Ai Ranking Generate Article Jobs  Job Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/user-competitors":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Get User Competitors","description":"Get user-specified competitor names for a domain the workspace owns.","operationId":"get_user_competitors_api_v1_ai_ranking_user_competitors_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get User Competitors Api V1 Ai Ranking User Competitors Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["ai-ranking","AI Ranking"],"summary":"Save User Competitors","description":"Save user-specified competitor names for a domain the workspace owns.","operationId":"save_user_competitors_api_v1_ai_ranking_user_competitors_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","title":"Domain"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Save User Competitors Api V1 Ai Ranking User Competitors Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/user-prompts":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Get User Prompts","description":"Get user-curated custom prompts for a domain the workspace owns.","operationId":"get_user_prompts_api_v1_ai_ranking_user_prompts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get User Prompts Api V1 Ai Ranking User Prompts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["ai-ranking","AI Ranking"],"summary":"Save User Prompts","description":"Save user-curated custom prompts for a domain. Cap: 10 per domain.\n\nBody: ``{\"prompts\": [{\"label\": str, \"question\": str, \"journey_phase\": str}, ...]}``.\nIntent keys are auto-generated from labels (slugified); callers may pre-supply\n``custom.*`` intent_keys to keep them stable across edits.","operationId":"save_user_prompts_api_v1_ai_ranking_user_prompts_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","title":"Domain"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Save User Prompts Api V1 Ai Ranking User Prompts Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/disabled-questions":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Get Disabled Questions Endpoint","description":"The generated questions this workspace switched off for a domain\n(backend#942 3.3). They are left out from the next measurement on.","operationId":"get_disabled_questions_endpoint_api_v1_ai_ranking_disabled_questions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Disabled Questions Endpoint Api V1 Ai Ranking Disabled Questions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["ai-ranking","AI Ranking"],"summary":"Save Disabled Questions Endpoint","description":"Replace the switched-off generated questions for a domain.\n\nBody: ``{\"intent_keys\": [\"sector.question\", ...]}``. Own questions\n(``custom.*``) cannot be switched off and are dropped; remove them on the\nPrompts tab instead.","operationId":"save_disabled_questions_endpoint_api_v1_ai_ranking_disabled_questions_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","title":"Domain"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Save Disabled Questions Endpoint Api V1 Ai Ranking Disabled Questions Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/suggest-prompts":{"post":{"tags":["ai-ranking","AI Ranking"],"summary":"Suggest Prompts","description":"Generate candidate prompts for the user to track.\n\nPowers the Prompt Generator UI in the AI Visibility > Prompts sub-tab.\nThe customer enters a topic + optional role + region + how many\nsuggestions they want; we call GPT-4o-mini to produce realistic\nquestions a target audience would actually ask AI assistants. The\ncustomer then chooses which to add to their tracked custom prompts.\n\nBody shape::\n\n    {\n      \"topic\": \"AI visibility tools for SMBs\",\n      \"role\": \"marketing manager\" (optional),\n      \"region\": \"Netherlands\" (optional),\n      \"count\": 5 | 10 | 20,\n      \"language\": \"en\" | \"nl\" (optional, default en)\n    }\n\nReturns::\n\n    {\"prompts\": [{\"question\": str, \"label\": str}], \"cost_cents\": float}\n\nCost: ~$0.001 per call (gpt-4o-mini). No caching at the endpoint —\neach call generates fresh suggestions; customer controls how often.","operationId":"suggest_prompts_api_v1_ai_ranking_suggest_prompts_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Suggest Prompts Api V1 Ai Ranking Suggest Prompts Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-ranking/ensure-data":{"post":{"tags":["ai-ranking","AI Ranking"],"summary":"Ensure Ai Ranking Data","description":"Ensure AI mention data exists for a domain. Creates a job if none exists for the current scan.\n\nCalled by the frontend when the AI Ranking page loads. Only creates one job per analysis_id\nto avoid duplicate charges.","operationId":"ensure_ai_ranking_data_api_v1_ai_ranking_ensure_data_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Ensure Ai Ranking Data Api V1 Ai Ranking Ensure Data Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-ranking/monitoring":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Get Monitoring","description":"Get monitoring subscription status for a domain.","operationId":"get_monitoring_api_v1_ai_ranking_monitoring_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Monitoring Api V1 Ai Ranking Monitoring Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["ai-ranking","AI Ranking"],"summary":"Update Monitoring","description":"Create or update monitoring subscription for a domain.","operationId":"update_monitoring_api_v1_ai_ranking_monitoring_put","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Monitoring Api V1 Ai Ranking Monitoring Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["ai-ranking","AI Ranking"],"summary":"Delete Monitoring","description":"Delete (unsubscribe) a monitoring subscription for a domain.","operationId":"delete_monitoring_api_v1_ai_ranking_monitoring_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Monitoring Api V1 Ai Ranking Monitoring Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/monitoring/reports":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Get Monitoring Reports","description":"Get all past monitoring reports for a domain.","operationId":"get_monitoring_reports_api_v1_ai_ranking_monitoring_reports_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Monitoring Reports Api V1 Ai Ranking Monitoring Reports Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/monitoring/trigger":{"post":{"tags":["ai-ranking","AI Ranking"],"summary":"Trigger Monitoring Run","description":"Send monitoring report NOW using existing AI mention data.","operationId":"trigger_monitoring_run_api_v1_ai_ranking_monitoring_trigger_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Trigger Monitoring Run Api V1 Ai Ranking Monitoring Trigger Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-ranking/monitoring/preview":{"post":{"tags":["ai-ranking","AI Ranking"],"summary":"Preview Monitoring Report","description":"Generate a preview of the monitoring report HTML (no email sent).","operationId":"preview_monitoring_report_api_v1_ai_ranking_monitoring_preview_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Preview Monitoring Report Api V1 Ai Ranking Monitoring Preview Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-ranking/competitor-insights":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Competitor Insights","description":"Competitive intelligence grounded in actual AI model responses.\n\nFeeds real AI mention check responses into an LLM to extract:\n- Which competitors actually appear in AI responses (not guessed)\n- Why AI recommends them (with exact quotes)\n- Intent opportunities (easy wins, biggest gaps)\n- Priority actions with evidence","operationId":"competitor_insights_api_v1_ai_ranking_competitor_insights_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}},{"name":"analysis_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"}},{"name":"cached_only","in":"query","required":false,"schema":{"type":"boolean","description":"Wave A commit A4 — when true, only return cached results. Never invokes the LLM; returns status=no_cache on miss so the AI Competitors page can auto-load on mount without triggering an expensive regeneration.","default":false,"title":"Cached Only"},"description":"Wave A commit A4 — when true, only return cached results. Never invokes the LLM; returns status=no_cache on miss so the AI Competitors page can auto-load on mount without triggering an expensive regeneration."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Competitor Insights Api V1 Ai Ranking Competitor Insights Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/summary":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Ai Ranking Summary","description":"Return AI Ranking summary for a domain or analysis.\n\nCombines:\n- Latest mention check score + consensus\n- Per-intent breakdown (which queries mention the domain)\n- Per-model breakdown (GPT vs Claude)\n- Historical runs with scores for trend visualization\n\nWhen ``lang`` is provided, each per-intent breakdown entry gains an\n``intent_label`` field resolved from the bilingual intents_v2 registry.\nWithout ``lang`` the response is byte-identical to prior behaviour.\n\n``status=\"measuring\"`` is returned when the caller asked about one specific\nanalysis whose AI-mention probe is still queued or running. The alternative\nis the fallback below, which would answer with the previous measurement's\nnumbers and no way for the caller to tell.\n\n``shown_measurement`` names the job the numbers came from and whether it\nbelongs to the analysis the caller asked about.","operationId":"ai_ranking_summary_api_v1_ai_ranking_summary_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by domain","title":"Domain"},"description":"Filter by domain"},{"name":"analysis_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by analysis ID","title":"Analysis Id"},"description":"Filter by analysis ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Max historical runs to return","default":10,"title":"Limit"},"description":"Max historical runs to return"},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Locale for intent labels (en/nl/de/fr/es)","title":"Lang"},"description":"Locale for intent labels (en/nl/de/fr/es)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ai Ranking Summary Api V1 Ai Ranking Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/competitor-scan":{"post":{"tags":["ai-ranking","AI Ranking"],"summary":"Start Competitor Pillar Scan","description":"Kick off a pillar scan against a user-added competitor.\n\nDebits one competitor-scan from the workspace's monthly quota\n(raises 429 on exhaustion), creates a `CompetitorScan` row in\n`pending`, and schedules the scanner to run in the background.","operationId":"start_competitor_pillar_scan_api_v1_ai_ranking_competitor_scan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompetitorScanStartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Start Competitor Pillar Scan Api V1 Ai Ranking Competitor Scan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/ai-ranking/competitor-scan/{scan_id}":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Get Competitor Scan Status","description":"Poll a scan's status + results. Used by the frontend to drive\nthe per-competitor progress UI.","operationId":"get_competitor_scan_status_api_v1_ai_ranking_competitor_scan__scan_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"string","title":"Scan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Competitor Scan Status Api V1 Ai Ranking Competitor Scan  Scan Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/competitor-scans":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"List Competitor Scans","description":"List all competitor scans for an analysis, plus a ``primary`` block\nwith the scanned domain's own pillar scores so the frontend can\ncompute rank without a second round-trip.\n\nFrontend uses this to render the rank card (you vs scanned\ncompetitors) and the per-competitor status rows.","operationId":"list_competitor_scans_api_v1_ai_ranking_competitor_scans_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"query","required":true,"schema":{"type":"string","description":"Primary analysis UUID","title":"Analysis Id"},"description":"Primary analysis UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Competitor Scans Api V1 Ai Ranking Competitor Scans Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-ranking/competitor-drilldown":{"get":{"tags":["ai-ranking","AI Ranking"],"summary":"Competitor Drilldown","description":"Per-intent signal-level diff between the primary domain and one\nscanned competitor — \"why AI mentions them for this intent and not\nyou.\" Requires the competitor's scan to be in status=done.","operationId":"competitor_drilldown_api_v1_ai_ranking_competitor_drilldown_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"query","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"competitor_domain","in":"query","required":true,"schema":{"type":"string","title":"Competitor Domain"}},{"name":"intent_key","in":"query","required":true,"schema":{"type":"string","title":"Intent Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Competitor Drilldown Api V1 Ai Ranking Competitor Drilldown Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/content-studio/persona":{"get":{"tags":["content-studio","content-studio"],"summary":"Get Persona","description":"Return the saved persona for (workspace, domain), or neutral defaults so\nthe FE always has something to render (exists=false on first visit).","operationId":"get_persona_api_v1_content_studio_persona_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","description":"Domain the persona belongs to","title":"Domain"},"description":"Domain the persona belongs to"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Persona Api V1 Content Studio Persona Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["content-studio","content-studio"],"summary":"Upsert Persona","description":"Create or update the persona for (workspace, domain).","operationId":"upsert_persona_api_v1_content_studio_persona_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","description":"Domain the persona belongs to","title":"Domain"},"description":"Domain the persona belongs to"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Upsert Persona Api V1 Content Studio Persona Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/content-studio/score-draft":{"post":{"tags":["content-studio","content-studio"],"summary":"Score Draft Endpoint","description":"P4 — re-score an (edited) draft with the real content-check engine.\nPowers the edit→re-score loop: the FE sends the current markdown (+ FAQ\nschema), we return the Content Readiness sub-score + per-check results.\nDeterministic + free (no LLM), so the user can iterate without a meter.\nIf ``draft_id`` is given and owned by this workspace, the stored score is\nupdated too (status flips to ``edited``).","operationId":"score_draft_endpoint_api_v1_content_studio_score_draft_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Score Draft Endpoint Api V1 Content Studio Score Draft Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/content-studio/drafts":{"get":{"tags":["content-studio","content-studio"],"summary":"List Drafts","description":"P6 — the generated-content library + outcome attribution. Lists drafts\nfor (workspace, domain) with the targeted intent's verdict at generation\n(baseline) vs now. Until a rescan happens the outcome is 'pending'; after a\nrescan we compare — 'improved' is the prove-it-worked signal.","operationId":"list_drafts_api_v1_content_studio_drafts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","description":"Domain to list generated content for","title":"Domain"},"description":"Domain to list generated content for"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Drafts Api V1 Content Studio Drafts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/content-studio/drafts/{draft_id}":{"get":{"tags":["content-studio","content-studio"],"summary":"Get Draft","description":"Fetch a single ContentDraft (workspace-scoped) with its full body and the\ntargeted intent's current outcome — backs the reopen/edit view.","operationId":"get_draft_api_v1_content_studio_drafts__draft_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","title":"Draft Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Draft Api V1 Content Studio Drafts  Draft Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["content-studio","content-studio"],"summary":"Update Draft","description":"Edit a saved draft's title/body/status. Editing the body recomputes the\nword count and marks the draft 'edited' (unless an explicit status is sent).","operationId":"update_draft_api_v1_content_studio_drafts__draft_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","title":"Draft Id"}}],"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 Draft Api V1 Content Studio Drafts  Draft Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/content-studio/persona/suggest":{"post":{"tags":["content-studio","content-studio"],"summary":"Suggest Persona","description":"Draft a persona from the scan's business_context + AI-inferred brand\nperception. Returns a DRAFT (not saved) — the user reviews then PUTs it.\nProvenance: this is why our AI-suggest starts smarter than a blank slate.","operationId":"suggest_persona_api_v1_content_studio_persona_suggest_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","description":"Domain to draft a persona for","title":"Domain"},"description":"Domain to draft a persona for"},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Locale for the prose fields (en/nl)","title":"Lang"},"description":"Locale for the prose fields (en/nl)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Suggest Persona Api V1 Content Studio Persona Suggest Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports":{"post":{"tags":["saved-reports","saved-reports"],"summary":"Save Report","description":"Persist a generated report as a frozen snapshot for this workspace.","operationId":"save_report_api_v1_reports_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveReportRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Save Report Api V1 Reports Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["saved-reports","saved-reports"],"summary":"List Reports","description":"List this workspace's saved reports (most recent first, light fields).","operationId":"list_reports_api_v1_reports_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to one domain","title":"Domain"},"description":"Filter to one domain"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Reports Api V1 Reports Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/{report_id}":{"get":{"tags":["saved-reports","saved-reports"],"summary":"Get Report","description":"Fetch one saved report in full, including the report_json snapshot.","operationId":"get_report_api_v1_reports__report_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Report Api V1 Reports  Report Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["saved-reports","saved-reports"],"summary":"Delete Report","description":"Delete one saved report (workspace-scoped).","operationId":"delete_report_api_v1_reports__report_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-competitors/{analysis_id}":{"get":{"tags":["ai-competitors"],"summary":"Get Ai Competitors","description":"Return the head-to-head result for this (analysis × competitor set ×\ntier config). Triggers the probe pipeline on first miss as a background\ntask; frontend polls the same endpoint until status flips to ready.\n\nResponse shapes:\n  - {status: 'no_competitors', ...}        when no competitors registered\n  - {status: 'pending', ...}               (HTTP 202) while pipeline runs\n  - {status: 'ready', result: {...}, ...}  when pipeline succeeded\n  - {status: 'failed', error_message, ...} when pipeline raised","operationId":"get_ai_competitors_api_v1_ai_competitors__analysis_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Ai Competitors Api V1 Ai Competitors  Analysis Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-competitors/{analysis_id}/run":{"post":{"tags":["ai-competitors"],"summary":"Start Ai Competitors Run","description":"Start the head-to-head comparison for this scan on the customer's\nrequest. Returns the cached result when one exists for the current\ncompetitor set and method (nothing is rerun), 202 pending while a run is\non its way, and otherwise creates the pending row and schedules the\npipeline, like the GET used to do on first miss.","operationId":"start_ai_competitors_run_api_v1_ai_competitors__analysis_id__run_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Start Ai Competitors Run Api V1 Ai Competitors  Analysis Id  Run Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/search-insights/{analysis_id}":{"get":{"tags":["search-insights","Search Insights"],"summary":"Get Search Insights","description":"Return the full Search Insights payload for one analysis.","operationId":"get_search_insights_api_v1_search_insights__analysis_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchInsightsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/search-insights/{analysis_id}/enrich-queries":{"post":{"tags":["search-insights","Search Insights"],"summary":"Enrich Queries","description":"Trigger the LLM brainstorm for this analysis's sector.\n\nIdempotent: if a cached result exists for\n`(sector_key, workspace_id, language)`, this returns it without\ncalling the LLM. Use `force_refresh=True` to bypass — currently\ntriggered from the UI via a \"regenerate\" button that POSTs with no\nbody, so we keep `force_refresh` off by default at the router layer.","operationId":"enrich_queries_api_v1_search_insights__analysis_id__enrich_queries_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainstormResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/search-insights/{analysis_id}/enrich-paa":{"post":{"tags":["search-insights","Search Insights"],"summary":"Enrich Paa","description":"Trigger a SerpAPI PAA fetch for one intent's question.\n\nThe request body must include `intent_id`. The intent's question\ntext is looked up from the analysis's `intent_results_v2` envelope,\nthe SerpAPI call is made, and the result is persisted to\n`raw_analysis.search_insights.paa_enrichments[intent_id]` so the GET\nendpoint can return it on subsequent loads without a fresh call.\n\nRate-limited implicitly by the 24h cache: if a fresh cached result\nalready exists for this intent, we return it without hitting SerpAPI.","operationId":"enrich_paa_api_v1_search_insights__analysis_id__enrich_paa_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichPaaRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaaResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gsc/authorize":{"post":{"tags":["gsc","Google Search Console"],"summary":"Authorize","description":"Start the Google OAuth flow. Returns the consent URL.","operationId":"authorize_api_v1_gsc_authorize_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/gsc/oauth-callback":{"get":{"tags":["gsc","Google Search Console"],"summary":"Oauth Callback","description":"Google redirects here after consent. UNAUTHED — validated via state JWT.\n\nOn success: exchanges the code for tokens, stores the refresh token,\nredirects to the frontend with ?status=ok.\n\nOn failure: redirects to the frontend with ?status=error&reason=...","operationId":"oauth_callback_api_v1_gsc_oauth_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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gsc/connection-status":{"get":{"tags":["gsc","Google Search Console"],"summary":"Connection Status","description":"Check whether this workspace has a GSC connection. With ``?domain=``\nthe response also carries that website's stored property.","operationId":"connection_status_api_v1_gsc_connection_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gsc/disconnect":{"post":{"tags":["gsc","Google Search Console"],"summary":"Disconnect","description":"Disconnect GSC: revoke the token (best-effort) and clear it. The\nproperty of each website is kept for a reconnect.","operationId":"disconnect_api_v1_gsc_disconnect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/gsc/properties":{"get":{"tags":["gsc","Google Search Console"],"summary":"Get Properties","description":"List the user's verified GSC properties.","operationId":"get_properties_api_v1_gsc_properties_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PropertiesResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/gsc/websites":{"get":{"tags":["gsc","Google Search Console"],"summary":"List Websites","description":"The Search Console property of every website in the workspace.","operationId":"list_websites_api_v1_gsc_websites_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"resolve","in":"query","required":false,"schema":{"type":"boolean","description":"Resolve websites without a stored property through one sites.list call and store the matches. Without it, no Google call.","default":false,"title":"Resolve"},"description":"Resolve websites without a stored property through one sites.list call and store the matches. Without it, no Google call."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsitesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gsc/websites/{domain}/property":{"put":{"tags":["gsc","Google Search Console"],"summary":"Set Website Property","description":"Choose the property of one website, or pass ``site_url: null`` to go\nback to automatic resolution. The property must be one the linked\nGoogle account can read.","operationId":"set_website_property_api_v1_gsc_websites__domain__property_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","title":"Domain"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetWebsitePropertyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsitePropertyItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gsc/{analysis_id}/intent-coverage":{"get":{"tags":["gsc","Google Search Console"],"summary":"Intent Coverage","description":"Cross-reference the analysis's intent envelope with real GSC query data.\n\nWithout ``?property=`` the property of the analysis's website is used\n(stored, or resolved and stored). ``?property=X`` overrides it for this\nrequest; for an owner or admin it also becomes that website's property.","operationId":"intent_coverage_api_v1_gsc__analysis_id__intent_coverage_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":28,"title":"Days"}},{"name":"property","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Property"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/action-plan/{analysis_id}":{"get":{"tags":["action-plan","Action Plan"],"summary":"Get Action Plan","description":"Return the full prioritized action plan for a scan.\n\nAuth: workspace-scoped. A user can only see plans for analyses\nbelonging to their workspace. 404 if the analysis doesn't exist\nor belongs to a different workspace.\n\nBehavior:\n    * Cache lookup: serialized plan body keyed on (analysis_id,\n      updated_at) in AdminSetting. Cache hit → skip the pipeline.\n    * Cache miss: takes the build slot for this cache key, reads the\n      cache once more (a request that was ahead of us may have filled\n      it meanwhile), and only then runs the full Action Plan pipeline\n      (aggregation, candidate discovery, evidence extraction, recipe\n      matching, Sonnet synthesis, scoring, gating, theming) and writes\n      the result to the cache. So concurrent readers of one uncached\n      plan cost one build, not one each (#1111).\n    * Hydrates per-action ``completed`` from AnalysisActionStatus\n      (always fresh — never cached, so Mark Done is instant).\n    * Injects CustomAction rows into the matching themes (always\n      fresh, same reason).\n\nPerformance:\n    * Cold (first hit per analysis_id): ~15-25s (Sonnet synthesis +\n      pipeline). Already-cached action briefs cut LLM time.\n    * Warm (subsequent hits, same analysis): <500ms (pure DB read +\n      JSON deserialize + hydrate).\n\nThe cache uses analysis.updated_at as part of the key so any update\nto raw_analysis (business context refresh, rescan on same id, etc.)\nnaturally evicts the stale entry.","operationId":"get_action_plan_api_v1_action_plan__analysis_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","description":"Skip the cache read and rebuild the plan fresh (then overwrite the cache). Use after a backend change adds new action fields (e.g. associated_intents) so existing scans pick them up without a full rescan.","default":false,"title":"Force"},"description":"Skip the cache read and rebuild the plan fresh (then overwrite the cache). Use after a backend change adds new action fields (e.g. associated_intents) so existing scans pick them up without a full rescan."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizationPlanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/action-plan/{analysis_id}/actions/{action_id}":{"patch":{"tags":["action-plan","Action Plan"],"summary":"Update Action Status","description":"Mark an engine-generated action complete or open.\n\nUpserts an ``AnalysisActionStatus`` row. Custom-user-created\nactions use the separate /custom-actions endpoints — those have\nricher editable fields.","operationId":"update_action_status_api_v1_action_plan__analysis_id__actions__action_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"action_id","in":"path","required":true,"schema":{"type":"string","title":"Action Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__action_plan__ActionStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__action_plan__ActionStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/actions/{action_key}/recheck":{"post":{"tags":["action-recheck","action-recheck"],"summary":"Recheck a single action without a full rescan","description":"Re-evaluate the check behind one typed_action.\n\nCrawls the scan's page budget for the domain, re-extracts signals, re-runs\nthe check that produced this action, and returns whether it now passes.\n\nUseful for verifying a site fix without waiting for a full rescan.\nThe recheck result is persisted to ``raw_analysis[\"recheck_results\"]``\nkeyed by ``check_key``.","operationId":"recheck_typed_action_api_v1_analyses__analysis_id__actions__action_key__recheck_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"action_key","in":"path","required":true,"schema":{"type":"string","title":"Action Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRecheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyses/{analysis_id}/actions/{action_key}/attest":{"post":{"tags":["action-recheck","action-recheck"],"summary":"Confirm a check we cannot see the proof of (Bing verified via Search Console)","description":"The customer confirms the domain is verified in Bing Webmaster Tools\nanother way (NC Websites, #881: imported from Google Search Console, so\nno meta tag). Stores the confirmation for (workspace, domain), applies\nit to this scan's stored signals and checks so score and action list\nfollow at once, and closes the task. Only checks in ATTESTABLE_CHECKS.","operationId":"attest_typed_action_api_v1_analyses__analysis_id__actions__action_key__attest_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"action_key","in":"path","required":true,"schema":{"type":"string","title":"Action Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/demand-discovery/{analysis_id}":{"get":{"tags":["demand-discovery","Demand Discovery"],"summary":"Get Demand Discovery","description":"Return canonical demand questions grouped by category for one scan.\n\nAuth: workspace-scoped via the standard dep. 404 if the analysis\ndoesn't exist or doesn't belong to the caller's workspace.\n\nBehavior:\n- Cache lookup via AdminSetting; key includes ``updated_at`` so\n  rescans naturally bust the entry. Two cache entries per analysis\n  (one with ``opportunities_only=true``, one without).\n- Cache miss → fresh DB read + group + serialize + write cache.\n- Returns the five canonical categories in a stable order, with\n  empty lists for categories that have no rows.\n\nPerformance: ~150 rows max per scan, ordered by category + volume\nDESC. Sub-100ms cold; sub-50ms cached.","operationId":"get_demand_discovery_api_v1_demand_discovery__analysis_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"opportunities_only","in":"query","required":false,"schema":{"type":"boolean","description":"If true, only return rows where is_opportunity=True.","default":false,"title":"Opportunities Only"},"description":"If true, only return rows where is_opportunity=True."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemandDiscoveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/demand-discovery/{analysis_id}/rerun":{"post":{"tags":["demand-discovery","Demand Discovery"],"summary":"Rerun Demand Discovery","description":"Regenerate demand questions for an existing scan (no full rescan).\n\nThe demand pipeline runs + persists at scan time, so a backend change\n(e.g. the language fix) doesn't reach existing scans until they re-run.\nThis deletes the existing rows + busts the cache, then re-runs the\npipeline in the background (~90-180s). The Market Demand tab's auto-poll\nsurfaces the fresh questions when they land.\n\nAuth: workspace-scoped. 404 if the analysis isn't in the caller's\nworkspace.","operationId":"rerun_demand_discovery_api_v1_demand_discovery__analysis_id__rerun_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Rerun Demand Discovery Api V1 Demand Discovery  Analysis Id  Rerun Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/brand-perception/{analysis_id}":{"get":{"tags":["brand-perception","Brand Perception"],"summary":"Get Brand Perception","description":"Return AI's view of the brand + drift vs the scan-derived profile.\n\nLazy-computes on first hit (one Haiku 4.5 call, ~3-5s), persists\nthe result on ``analysis.raw_analysis``. Subsequent calls return\ncached.","operationId":"get_brand_perception_api_v1_brand_perception__analysis_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandPerceptionResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/brand-perception/{analysis_id}/sources":{"get":{"tags":["brand-perception","Brand Perception"],"summary":"Get Brand Perception Sources","description":"Layer 2 — for each unique citation URL, fetch + analyze sentiment.\n\nPro+ tier only. Light receives ``status=\"tier_locked\"``.\n\nCached at two layers:\n- Per-(url, brand) row in ``admin_settings`` with 30-day TTL —\n  stable across analyses for the same brand.\n- Per-analysis aggregate on ``analysis.raw_analysis[_SOURCES_CACHE_KEY]`` —\n  avoids re-aggregating on every page view.","operationId":"get_brand_perception_sources_api_v1_brand_perception__analysis_id__sources_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandPerceptionSourcesReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/brand-perception/{analysis_id}/actions":{"get":{"tags":["brand-perception","Brand Perception"],"summary":"Get Brand Perception Actions","description":"Layer 3 — synthesize \"shift the source\" actions from Layers 1 + 2.\n\nPure deterministic synthesis (no LLM call here — all the LLM work\nhappened at Layer 1 + 2). Reads cached perception + sources_report\nfrom raw_analysis when present, otherwise returns ``no_data``.\n\nPro+ tier only. Light receives ``status=\"tier_locked\"``.","operationId":"get_brand_perception_actions_api_v1_brand_perception__analysis_id__actions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftActionsReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/limits":{"get":{"tags":["profiles","profiles"],"summary":"Get Profile Limits","description":"The plan's quota, for the wizard to size profiles, themes and the prompt set.","operationId":"get_profile_limits_api_v1_profiles_limits_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TierPresenceLimits"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/profiles/slots":{"get":{"tags":["profiles","profiles"],"summary":"Get Brand Slots","description":"Brand-slots and website places, filled and free, for the slot overview\n(PR 3.10, #800): each active Brand with its websites and free places,\nthen the Brand-slots nobody uses yet.","operationId":"get_brand_slots_api_v1_profiles_slots_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Brand Slots Api V1 Profiles Slots Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/profiles/lookup":{"get":{"tags":["profiles","profiles"],"summary":"Lookup Profiles By Domain","description":"The active profiles of this workspace that link ``domain`` as a website.\n\nThe case page reads this to draw the bridge to AI Presence (option B,\nrule 7). One read, no measurement logic: the headline comes from the\nlatest completed run as stored. An unknown or malformed domain is an\nempty list, not an error, because a website without a profile is the\nnormal state.\n\nMeasured profiles come first, the most recently measured at the top, then\nthe unmeasured ones in creation order: the bridge shows the first item,\nand it used to show an older unmeasured profile over a measured one\n(backend#945 6.5).","operationId":"lookup_profiles_by_domain_api_v1_profiles_lookup_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":253,"title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles":{"post":{"tags":["profiles","profiles"],"summary":"Create Profile","operationId":"create_profile_api_v1_profiles_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["profiles","profiles"],"summary":"List Profiles","operationId":"list_profiles_api_v1_profiles_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}":{"get":{"tags":["profiles","profiles"],"summary":"Get Profile","operationId":"get_profile_api_v1_profiles__profile_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["profiles","profiles"],"summary":"Update Profile","operationId":"update_profile_api_v1_profiles__profile_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["profiles","profiles"],"summary":"Archive Profile","description":"Archive, never hard delete: runs and results stay for the history. Frees a quota slot.","operationId":"archive_profile_api_v1_profiles__profile_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/reactivate":{"post":{"tags":["profiles","profiles"],"summary":"Reactivate Profile","description":"Bring an archived Brand back, within the Brand-slots (PR 3.4). 402\nprofile_limit_exceeded when every slot is in use. History is untouched.","operationId":"reactivate_profile_api_v1_profiles__profile_id__reactivate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/domains":{"get":{"tags":["profiles","profiles"],"summary":"Get Profile Domains","description":"The profile's websites with the Domain Readiness of each.","operationId":"get_profile_domains_api_v1_profiles__profile_id__domains_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileDomainsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["profiles","profiles"],"summary":"Put Profile Domains","description":"Full replace of the profile's websites. A domain is unique within the\nprofile only; other profiles may link the same website. Removing a link\nnever touches the Domain Scan.","operationId":"put_profile_domains_api_v1_profiles__profile_id__domains_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileDomainsPutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileDomainsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/themes":{"get":{"tags":["profiles","profiles"],"summary":"Get Profile Themes","operationId":"get_profile_themes_api_v1_profiles__profile_id__themes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["profiles","profiles"],"summary":"Put Profile Themes","description":"Full replace of the themes. Omitted themes are archived, never deleted.\n\nOnly the set of active theme keys enters the measurement fingerprint;\nlabels, descriptions and example questions are customer copy.","operationId":"put_profile_themes_api_v1_profiles__profile_id__themes_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemesPutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/themes/suggest":{"post":{"tags":["profiles","profiles"],"summary":"Suggest Profile Themes","description":"Theme candidates for \"waarvoor wil je zichtbaar zijn\". Nothing is stored;\nthe customer confirms through PUT /themes. Uses the sector and business\ncontext of a scanned linked website when there is one.","operationId":"suggest_profile_themes_api_v1_profiles__profile_id__themes_suggest_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeSuggestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeSuggestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/setup/suggest":{"post":{"tags":["profiles","profiles"],"summary":"Suggest Profile Setup","description":"Proposals for every section of the profile setup, from one button.\n\nNothing is stored: the customer reviews, edits and confirms through the\nexisting PUT endpoints, and stored values always win. Two model calls\nat most: the existing theme suggester and one setup call for the\ndescription and alternatives (``setup_suggester_v1``). Websites echo\nwhat is linked, channels are types without a URL, Wikipedia and Wikidata\nare never among them.\n\nPartial success contract: the HTTP status is about the request (404,\n409, 422 as elsewhere) and never about the model. Without an API key or\nwhen a call fails, the affected section comes back empty and is named in\n``unavailable`` with ``llm_not_configured`` or ``llm_failed``; the\nsections that need no model (websites, channels) are always filled, and\nthe other model section still is when its own call succeeded. So the\nwizard can always fall back to manual entry for exactly the sections\nthat failed. Both calls are booked on the workspace LLM budget as\nregistration only; a spent budget does not refuse a suggestion.","operationId":"suggest_profile_setup_api_v1_profiles__profile_id__setup_suggest_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupSuggestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupSuggestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/prompts":{"get":{"tags":["profiles","profiles"],"summary":"Get Profile Prompts","description":"The prompt set with its balance report per theme and fingerprint preview.","operationId":"get_profile_prompts_api_v1_profiles__profile_id__prompts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptSetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["profiles","profiles"],"summary":"Put Profile Prompts","description":"Full replace of the prompt set. Keys survive edits; omitted prompts are removed.\n\nAny discovery prompt (benchmark or live) that names the profile, an\nalias or a linked website is rejected with 400. The balance rule marks\n``prompts_per_theme`` benchmark discovery prompts per active theme as\n``headline_eligible``; live prompts and extras run as diagnostics.","operationId":"put_profile_prompts_api_v1_profiles__profile_id__prompts_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptSetPutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptSetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/prompts/suggest":{"post":{"tags":["profiles","profiles"],"summary":"Suggest Profile Prompts","description":"LLM candidates per active theme. Nothing is stored; the customer picks and PUTs.","operationId":"suggest_profile_prompts_api_v1_profiles__profile_id__prompts_suggest_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptSuggestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptSuggestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/runs":{"post":{"tags":["profiles","profiles"],"summary":"Create Profile Run","description":"Queue a measurement. 400 when the prompt set is incomplete, 429 on the\nprofile's monthly run quota, 402 on the workspace LLM budget. The worker\npicks the run up; poll GET /runs/{run_id}.","operationId":"create_profile_run_api_v1_profiles__profile_id__runs_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreateRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["profiles","profiles"],"summary":"List Profile Runs","operationId":"list_profile_runs_api_v1_profiles__profile_id__runs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"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/RunListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/runs/{run_id}":{"get":{"tags":["profiles","profiles"],"summary":"Get Profile Run","operationId":"get_profile_run_api_v1_profiles__profile_id__runs__run_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"include_results","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Results"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/runs/{run_id}/cancel":{"post":{"tags":["profiles","profiles"],"summary":"Cancel Profile Run","description":"Queued: cancelled at once, slot refunded. Running: stops at the runner's next check.","operationId":"cancel_profile_run_api_v1_profiles__profile_id__runs__run_id__cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"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/RunOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/overview":{"get":{"tags":["profiles","profiles"],"summary":"Get Profile Overview","description":"The Presence tab: latest measurement, per model, per theme, alternatives,\nwebsites with readiness, history with break markers, and the opportunities\nthis measurement supports. Read-only, everything derived from the stored run.","operationId":"get_profile_overview_api_v1_profiles__profile_id__overview_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"description":"Language of the copy (nl | en): the workspace UI language; defaults to the profile language","title":"Lang"},"description":"Language of the copy (nl | en): the workspace UI language; defaults to the profile language"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/history":{"get":{"tags":["profiles","profiles"],"summary":"Get Profile History","operationId":"get_profile_history_api_v1_profiles__profile_id__history_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"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":{"$ref":"#/components/schemas/HistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/actions":{"get":{"tags":["profiles","profiles"],"summary":"Get Profile Actions","description":"The presence actions of the latest measurement, with status. Derived\nat read time from the stored summary; nothing is stored but the status.","operationId":"get_profile_actions_api_v1_profiles__profile_id__actions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"name":"include_hidden","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Hidden"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"description":"Language of the copy (nl | en): the workspace UI language; defaults to the profile language","title":"Lang"},"description":"Language of the copy (nl | en): the workspace UI language; defaults to the profile language"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/actions/{action_id}":{"patch":{"tags":["profiles","profiles"],"summary":"Patch Profile Action","description":"Tick, assign or hide a presence action. The same row backs the card in\nthe Action Plan of the linked website.","operationId":"patch_profile_action_api_v1_profiles__profile_id__actions__action_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"name":"action_id","in":"path","required":true,"schema":{"type":"string","title":"Action Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresenceActionStatusPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresenceActionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/actions/{action_id}/hooks":{"post":{"tags":["profiles","profiles"],"summary":"Generate Profile Action Hooks","description":"Propose three editorial angles for one source action (slice 6b.2).\n\nExplicitly a POST: this is the one place in AI Presence that may call a\nmodel on request, so reading actions stays free. Cached per measurement\nand action; a new measurement asks again.","operationId":"generate_profile_action_hooks_api_v1_profiles__profile_id__actions__action_id__hooks_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"name":"action_id","in":"path","required":true,"schema":{"type":"string","title":"Action Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","description":"Ignore the cached hooks of this measurement and ask again","default":false,"title":"Force"},"description":"Ignore the cached hooks of this measurement and ask again"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HooksResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/sources":{"get":{"tags":["profiles","profiles"],"summary":"Get Profile Sources","description":"The profile's own pages and partner relations, with the last check of\neach and the source types still worth adding for this profile type.","operationId":"get_profile_sources_api_v1_profiles__profile_id__sources_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileSourcesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["profiles","profiles"],"summary":"Put Profile Sources","description":"Full replace, like the websites. A source that stays keeps its check.","operationId":"put_profile_sources_api_v1_profiles__profile_id__sources_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileSourcesPutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileSourcesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/sources/check":{"post":{"tags":["profiles","profiles"],"summary":"Check Profile Sources","description":"Read every automatic source once and store what it says: does the page\ncarry the name, does it name the themes. Never a model call; manual\nsources are untouched and wait for a confirmation.","operationId":"check_profile_sources_api_v1_profiles__profile_id__sources_check_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileSourcesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/profiles/{profile_id}/sources/{source_id}/confirm":{"post":{"tags":["profiles","profiles"],"summary":"Confirm Profile Source","description":"Confirm a source no server can read (Instagram, TikTok, Google\nBusiness): the customer says it exists and is filled. A confirmation\nrecords who looked and when, never that the page is good.","operationId":"confirm_profile_source_api_v1_profiles__profile_id__sources__source_id__confirm_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceConfirmRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileSourceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/models/catalog":{"get":{"tags":["models","models"],"summary":"Get Catalog","operationId":"get_catalog_api_v1_models_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Catalog Api V1 Models Catalog Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/models":{"get":{"tags":["admin-models","admin-models"],"summary":"Get Admin Models","operationId":"get_admin_models_api_admin_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Admin Models Api Admin Models Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/models/{model_id}/settings":{"put":{"tags":["admin-models","admin-models"],"summary":"Put Model Settings","description":"Set (or with an empty body, clear) one model's thinking override.\n\nTakes effect within a minute on every process (the setting is cached\nfor 60 s). AI Presence freezes the setting into each new run, so a\nchange shows there as a methodology change, never as a silent shift.","operationId":"put_model_settings_api_admin_models__model_id__settings_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelSettingsPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Put Model Settings Api Admin Models  Model Id  Settings Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/kpis":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Dashboard Kpis","description":"Returns all 6 KPI card metrics in a single response.\n\nTODO: Replace with real database queries:\n- Total workspaces: COUNT(*) FROM workspaces\n- Active users: Users with last_login/activity in last 30d\n- Total scans: COUNT(*) FROM analyses WHERE created_at IN period\n- Failed scans: COUNT(*) WHERE status='failed' IN period\n- Queue health: COUNT(*) FROM jobs WHERE status IN ('queued', 'running')\n- System health: Aggregate from error_logs, request_logs, health_checks","operationId":"get_dashboard_kpis_api_admin_dashboard_kpis_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","description":"Time period: 24h | 7d | 30d | all","default":"7d","title":"Period"},"description":"Time period: 24h | 7d | 30d | all"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardKPIsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/scan-pipeline":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Scan Pipeline","description":"Returns scan status distribution.\n\nTODO: Replace with:\nSELECT\n  COUNT(*) FILTER (WHERE status = 'queued') AS queued,\n  COUNT(*) FILTER (WHERE status = 'running') AS running,\n  COUNT(*) FILTER (WHERE status = 'completed') AS completed,\n  COUNT(*) FILTER (WHERE status = 'failed') AS failed\nFROM analyses\nWHERE created_at BETWEEN :period_start AND :period_end","operationId":"get_scan_pipeline_api_admin_dashboard_scan_pipeline_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","description":"Time period","default":"7d","title":"Period"},"description":"Time period"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanPipelineResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/top-errors":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Top Errors","description":"Returns top 10 most frequent errors (Fixed 24h window).\n\nTODO: Replace with:\nSELECT error_type, COUNT(*) as count, MAX(timestamp) as last_seen\nFROM error_logs\nWHERE timestamp >= NOW() - INTERVAL '24 hours'\nGROUP BY error_type\nORDER BY count DESC\nLIMIT 10","operationId":"get_top_errors_api_admin_dashboard_top_errors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopErrorsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/dashboard/ai-mention-health":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Ai Mention Health","description":"Returns AI mention check job health metrics (Fixed 24h window).\n\nTODO: Replace with job statistics query filtering on:\n- job_type = 'ai_mention_check'\n- queued_at >= NOW() - INTERVAL '24 hours'\n- Success: status='completed' AND verdict IS NOT NULL\n- Cache hit: cache_hit = true","operationId":"get_ai_mention_health_api_admin_dashboard_ai_mention_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIMentionHealthResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/dashboard/top-workspaces":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Top Workspaces","description":"Returns top N workspaces by scan volume.\n\nTODO: Replace with:\nSELECT w.id, w.name, COUNT(a.id) as scan_count\nFROM workspaces w\nLEFT JOIN analyses a ON a.workspace_id = w.id\n  AND a.created_at BETWEEN :period_start AND :period_end\nGROUP BY w.id, w.name\nORDER BY scan_count DESC\nLIMIT :limit","operationId":"get_top_workspaces_api_admin_dashboard_top_workspaces_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","description":"Time period","default":"7d","title":"Period"},"description":"Time period"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Max workspaces to return","default":10,"title":"Limit"},"description":"Max workspaces to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopWorkspacesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/high-failure-workspaces":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get High Failure Workspaces","description":"Returns workspaces with failure rate above threshold.\n\nTODO: Replace with query calculating failure_rate and filtering by min_failure_rate.","operationId":"get_high_failure_workspaces_api_admin_dashboard_high_failure_workspaces_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","description":"Time period","default":"7d","title":"Period"},"description":"Time period"},{"name":"min_failure_rate","in":"query","required":false,"schema":{"type":"number","description":"Minimum failure % to include","default":10.0,"title":"Min Failure Rate"},"description":"Minimum failure % to include"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HighFailureWorkspacesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/score-trend":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Score Trend","description":"Returns average AI visibility score over time.\n\nTODO: Replace with query that:\n- Buckets by hour (24h), day (7d/30d), or week (all)\n- Averages unified_score per bucket\n- Filters status='completed' AND unified_score IS NOT NULL","operationId":"get_score_trend_api_admin_dashboard_score_trend_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","description":"Time period","default":"7d","title":"Period"},"description":"Time period"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreTrendResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/score-distribution":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Score Distribution","description":"Returns scan count per score bucket.\n\nTODO: Replace with CASE query grouping unified_score into 4 buckets.","operationId":"get_score_distribution_api_admin_dashboard_score_distribution_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","description":"Time period","default":"7d","title":"Period"},"description":"Time period"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreDistributionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/scores-by-sector":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Scores By Sector","description":"Returns average score per sector with trend comparison.\n\nTODO: Replace with query that:\n- Groups by sector\n- Calculates avg_score and scan_count for current period\n- Compares to previous period for trend (up/down/neutral)","operationId":"get_scores_by_sector_api_admin_dashboard_scores_by_sector_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","description":"Time period","default":"7d","title":"Period"},"description":"Time period"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoresBySectorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard/subscriptions":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Subscriptions","description":"Returns subscription breakdown (Not period-aware, always current snapshot).\n\nTODO: Replace with query grouping workspaces by plan.\nNOTE: MRR values are placeholders only. Real billing integration required.","operationId":"get_subscriptions_api_admin_dashboard_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/dashboard/anomalies":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Anomalies","description":"Returns detected anomalies (Fixed 24h window).\n\nTODO: Replace with anomaly detection logic:\n- Scan spike: Daily volume > 3x 7d avg\n- Failure spike: Failure rate > 2x 7d avg\n- Repeated timeouts: Same domain ≥3 timeouts in 24h\nSort by severity (high > medium > low), then magnitude.","operationId":"get_anomalies_api_admin_dashboard_anomalies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnomaliesResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/dashboard/monitoring":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Monitoring","description":"Returns system health monitoring data.\n\nTODO: Replace with queries from:\n- error_logs table (last 7d trend, top error types)\n- request_logs table (percentile latencies, slow requests)\n- health_checks table (uptime % trend, incidents)","operationId":"get_monitoring_api_admin_dashboard_monitoring_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitoringResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/scans":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Scans","description":"Returns paginated list of scans with optional filtering.\n\nDB-backed implementation (source of truth: analyses table).","operationId":"get_scans_api_admin_scans_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Time period: 24h | 7d | 30d | all","title":"Period"},"description":"Time period: 24h | 7d | 30d | all"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"workspaceId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by workspace UUID","title":"Workspaceid"},"description":"Filter by workspace UUID"},{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by domain (partial match)","title":"Domain"},"description":"Filter by domain (partial match)"},{"name":"sectorKey","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by sector","title":"Sectorkey"},"description":"Filter by sector"},{"name":"scoreBucket","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by score range","title":"Scorebucket"},"description":"Filter by score range"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Results per page","default":50,"title":"Limit"},"description":"Results per page"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScansListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Workspaces","description":"Returns paginated list of workspaces with filtering.\n\nDB-backed implementation (source of truth: workspaces + workspace_members + users + analyses).\n\nNotes:\n- Billing/plan is not modeled in the DB; `plan` is returned as \"unknown\".","operationId":"get_workspaces_api_admin_workspaces_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search workspace name or owner email","title":"Search"},"description":"Search workspace name or owner email"},{"name":"plan","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by plan","title":"Plan"},"description":"Filter by plan"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: active | inactive","title":"Status"},"description":"Filter by status: active | inactive"},{"name":"sort","in":"query","required":false,"schema":{"type":"string","description":"Sort: name_asc | scans_desc | created_desc","default":"name_asc","title":"Sort"},"description":"Sort: name_asc | scans_desc | created_desc"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Results per page","default":25,"title":"Limit"},"description":"Results per page"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacesListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{id}":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Workspace Detail","description":"Returns detailed information for a single workspace, including all users and scans.\n\nDB-backed implementation.","operationId":"get_workspace_detail_api_admin_workspaces__id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"Workspace UUID","title":"Id"},"description":"Workspace UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{id}/members/{user_id}":{"patch":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Patch Workspace Member Role","description":"Change a workspace member's role (admin only).\n\nSystem admins use this from the admin workspace detail page to promote or\ndemote members (member / admin / owner). This is distinct from the\nworkspace-scoped ``PATCH /workspaces/{id}/members/{user_id}``, which requires\nthe caller to be an owner/admin *of that workspace*. This admin variant is\nguarded by ``require_admin`` at the router level, so it works for any\nworkspace regardless of whether the acting admin is a member of it.","operationId":"patch_workspace_member_role_api_admin_workspaces__id__members__user_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"Workspace UUID","title":"Id"},"description":"Workspace UUID"},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","description":"User UUID","title":"User Id"},"description":"User UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceMemberRolePatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUserItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{id}/plan":{"patch":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Patch Workspace Plan","description":"Update a workspace's plan tier (admin only).","operationId":"patch_workspace_plan_api_admin_workspaces__id__plan_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"Workspace UUID","title":"Id"},"description":"Workspace UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{id}/name":{"put":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Put Workspace Name","description":"Rename a workspace (admin only).\n\nThe name is what every member sees at the top of the sidebar, including\nan agency's client logins (Klanttoegang), so a signup default like\n\"Jane Doe's Workspace\" should become the agency's name.","operationId":"put_workspace_name_api_admin_workspaces__id__name_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"Workspace UUID","title":"Id"},"description":"Workspace UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceRenameRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceNotesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{id}/notes":{"put":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Put Workspace Notes","description":"Set admin notes for a workspace.","operationId":"put_workspace_notes_api_admin_workspaces__id__notes_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"Workspace UUID","title":"Id"},"description":"Workspace UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceNotesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceNotesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{id}/disable":{"post":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Disable Workspace","description":"Disable a workspace. Users in this workspace will not be able to log in\nand no further scans can be initiated.","operationId":"disable_workspace_api_admin_workspaces__id__disable_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"Workspace UUID","title":"Id"},"description":"Workspace UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{id}/enable":{"post":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Enable Workspace","description":"Re-enable a previously disabled workspace.","operationId":"enable_workspace_api_admin_workspaces__id__enable_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"Workspace UUID","title":"Id"},"description":"Workspace UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{id}/empty":{"delete":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Delete Empty Workspace","description":"Permanently delete a workspace that holds nothing (backend#1096).\n\nSignup without an invitation creates a workspace before any plan is\nchosen. When that person belongs in another workspace, the empty one is\nin the way: the default workspace pick prefers owner over member, so they\nland in the empty workspace and get \"select a plan\". This removes such a\nworkspace and only such a workspace: no live subscription, not internal,\nat most one member, and no rows in any table with a ``workspace_id`` other\nthan the membership and the branding row signup creates. Anything else is\nrefused with 409 and nothing is deleted.","operationId":"delete_empty_workspace_api_admin_workspaces__id__empty_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"Workspace UUID","title":"Id"},"description":"Workspace UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/errors":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Errors","description":"Returns paginated list of errors with filtering and grouping.\n\nDB-backed implementation (source of truth: scan_events where event_type=scan_failed).\n\nNotes:\n- No stack traces are persisted in the DB; `stack_trace` is returned as None.","operationId":"get_errors_api_admin_errors_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Time period","title":"Period"},"description":"Time period"},{"name":"errorType","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by error type","title":"Errortype"},"description":"Filter by error type"},{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by severity","title":"Severity"},"description":"Filter by severity"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search in error message","title":"Search"},"description":"Search in error message"},{"name":"groupBy","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Group by: error_type","title":"Groupby"},"description":"Group by: error_type"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Results per page","default":50,"title":"Limit"},"description":"Results per page"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/jobs":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Jobs","description":"Returns paginated list of jobs with queue statistics.\n\nDB-backed implementation (source of truth: ai_mention_jobs table).\n\nNotes:\n- Only AI mention check jobs are currently modeled in the DB.\n- Worker utilization is not represented; returned as 0.0.","operationId":"get_jobs_api_admin_jobs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"jobType","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by job type","title":"Jobtype"},"description":"Filter by job type"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search job ID or domain","title":"Search"},"description":"Search job ID or domain"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"Results per page","default":50,"title":"Limit"},"description":"Results per page"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{id}/health":{"get":{"tags":["admin-dashboard","admin-dashboard"],"summary":"Get Workspace Health","description":"Returns detailed health metrics for a specific workspace.\n\nDB-backed implementation.\n\nNotes:\n- Billing/plan is not modeled in the DB; `plan` is returned as \"unknown\".","operationId":"get_workspace_health_api_admin_workspaces__id__health_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"Workspace UUID","title":"Id"},"description":"Workspace UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceHealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/settings/feature-flags":{"get":{"tags":["admin-settings","admin-settings"],"summary":"Get Feature Flags","description":"List the curated feature flags with their current (override) state.","operationId":"get_feature_flags_api_admin_settings_feature_flags_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/settings/feature-flags/{key}":{"put":{"tags":["admin-settings","admin-settings"],"summary":"Set Feature Flag","description":"Toggle a feature flag via its AdminSetting override.","operationId":"set_feature_flag_api_admin_settings_feature_flags__key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/settings/model-limits":{"get":{"tags":["admin-settings","admin-settings"],"summary":"Get Model Limits","description":"Read model limits from pricing_packages table.","operationId":"get_model_limits_api_admin_settings_model_limits_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminModelLimitsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"patch":{"tags":["admin-settings","admin-settings"],"summary":"Patch Model Limits","description":"Write model limits to pricing_packages table.","operationId":"patch_model_limits_api_admin_settings_model_limits_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminModelLimitsPatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminModelLimitsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/settings/llm-usage":{"get":{"tags":["admin-settings","admin-settings"],"summary":"Get Llm Usage","description":"List all workspaces with current month LLM usage and budget.","operationId":"get_llm_usage_api_admin_settings_llm_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/settings/llm-budget/{workspace_id}":{"patch":{"tags":["admin-settings","admin-settings"],"summary":"Set Llm Budget","description":"Set monthly LLM budget for a workspace.","operationId":"set_llm_budget_api_admin_settings_llm_budget__workspace_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin-settings","admin-settings"],"summary":"Delete Llm Budget","description":"Remove per-workspace LLM budget override, falling back to tier/default.","operationId":"delete_llm_budget_api_admin_settings_llm_budget__workspace_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/settings/llm-pricing":{"get":{"tags":["admin-settings","admin-settings"],"summary":"Get Llm Pricing","description":"Get current LLM model pricing table.","operationId":"get_llm_pricing_api_admin_settings_llm_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"patch":{"tags":["admin-settings","admin-settings"],"summary":"Patch Llm Pricing","description":"Update LLM model pricing table.","operationId":"patch_llm_pricing_api_admin_settings_llm_pricing_patch","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/settings/llm-budget-default":{"get":{"tags":["admin-settings","admin-settings"],"summary":"Get Llm Budget Default","description":"Get global default LLM budget.","operationId":"get_llm_budget_default_api_admin_settings_llm_budget_default_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"patch":{"tags":["admin-settings","admin-settings"],"summary":"Set Llm Budget Default","description":"Set global default LLM budget.","operationId":"set_llm_budget_default_api_admin_settings_llm_budget_default_patch","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/settings/ai-visibility-verdicts":{"get":{"tags":["admin-settings","admin-settings"],"summary":"Get Ai Visibility Verdicts Flag","operationId":"get_ai_visibility_verdicts_flag_api_admin_settings_ai_visibility_verdicts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["admin-settings","admin-settings"],"summary":"Put Ai Visibility Verdicts Flag","description":"Body: ``{\"enabled\": true | false | null}``. ``null`` clears the override\nso the env var takes effect again.","operationId":"put_ai_visibility_verdicts_flag_api_admin_settings_ai_visibility_verdicts_put","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/workspaces/{workspace_id}/settings":{"get":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Get Workspace Settings","description":"Return the current settings for a workspace.\n\nDefault: all tools are allowed.","operationId":"get_workspace_settings_api_admin_workspaces__workspace_id__settings_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Update Workspace Settings","description":"Replace the workspace settings (allowed tools list).","operationId":"update_workspace_settings_api_admin_workspaces__workspace_id__settings_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSettingsUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{workspace_id}/internal":{"get":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Get Workspace Internal","description":"Whether this workspace is marked internal.","operationId":"get_workspace_internal_api_admin_workspaces__workspace_id__internal_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceInternalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Update Workspace Internal","description":"Mark a workspace internal (or hand it back to normal automation).\n\nTurning this ON does not cancel work already queued — pending rescans are\nstopped at their fire point by the dispatcher, which re-checks the flag.","operationId":"update_workspace_internal_api_admin_workspaces__workspace_id__internal_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceInternalUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceInternalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{workspace_id}/stripe-link":{"get":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Get Workspace Stripe Link","description":"The Stripe ids and billing fields the workspace holds. Reads the DB only.","operationId":"get_workspace_stripe_link_api_admin_workspaces__workspace_id__stripe_link_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeLinkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Update Workspace Stripe Link","description":"Link a live Stripe subscription to the workspace, then sync from it.\n\nRefused unless Stripe holds the subscription, it belongs to the given\ncustomer and is active, trialing or past due, and no other workspace holds\nthat customer. Reads Stripe only, never writes to it. The tier, status,\nperiod end and add-on quantities are then taken from the subscription.","operationId":"update_workspace_stripe_link_api_admin_workspaces__workspace_id__stripe_link_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeLinkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{workspace_id}/bonus-slots":{"get":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Get Workspace Bonus Slots","description":"The workspace's Brand-slots: included, purchased, bonus and the sum.","operationId":"get_workspace_bonus_slots_api_admin_workspaces__workspace_id__bonus_slots_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BonusSlotsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Update Workspace Bonus Slots","description":"Grant, change or end the free Brand-slots of a workspace. Never touches\nStripe. Lowering the slots below the active Brands is allowed; the\ncapacity check (PR 3.5) reports the Brands outside the slots.","operationId":"update_workspace_bonus_slots_api_admin_workspaces__workspace_id__bonus_slots_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BonusSlotsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BonusSlotsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{workspace_id}/capacity":{"get":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Get Workspace Capacity","operationId":"get_workspace_capacity_api_admin_workspaces__workspace_id__capacity_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}},{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Compute as if on this tier, e.g. agency_partner","title":"Tier"},"description":"Compute as if on this tier, e.g. agency_partner"},{"name":"brand_slots","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":500,"minimum":0},{"type":"null"}],"description":"Override the Brand-slots for the dry run","title":"Brand Slots"},"description":"Override the Brand-slots for the 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/workspaces/{workspace_id}/websites":{"get":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Get Workspace Websites","description":"Every website the workspace scanned: scans, last scan, archived or\nnot, and the Brand that holds it.","operationId":"get_workspace_websites_api_admin_workspaces__workspace_id__websites_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{workspace_id}/websites/archive":{"post":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Archive Workspace Websites","description":"Archive websites (out of Cases, no automatic work, no Brand needed) or\nbring them back. Scans are kept. 409 when a website still belongs to an\nactive Brand; then nothing is changed.","operationId":"archive_workspace_websites_api_admin_workspaces__workspace_id__websites_archive_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsitesArchiveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{workspace_id}/brand-layout":{"post":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Apply Workspace Brand Layout","description":"Lay websites out in Brands: add them to the Brand that holds one of\nthem (or ``brand_id``), else make a new Brand. Checked as a whole: 422\nwith the reasons when anything is wrong, and then nothing is written.","operationId":"apply_workspace_brand_layout_api_admin_workspaces__workspace_id__brand_layout_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandLayoutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{workspace_id}/brands/{brand_id}/status":{"post":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Set Workspace Brand Status","description":"Archive a Brand or bring it back (#794), standard as a dry run.\nBringing back counts against the Brand-slots: 402\nprofile_limit_exceeded when they are full, and nothing changes.","operationId":"set_workspace_brand_status_api_admin_workspaces__workspace_id__brands__brand_id__status_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}},{"name":"brand_id","in":"path","required":true,"schema":{"type":"string","title":"Brand Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{workspace_id}/agency-partner-invoice":{"post":{"tags":["admin-workspace-settings","admin-workspace-settings"],"summary":"Create Workspace Agency Invoice","description":"Set a workspace up on Agency Partner, paid by invoice (founder decision\n1-12-2026, replaces the payment link of #806). Dry run by default: the plan\nwith amounts, nothing written to Stripe. With ``dry_run: false`` it creates\nthe Stripe customer, the subscription on invoice (first invoice a draft)\nand links it to the workspace.","operationId":"create_workspace_agency_invoice_api_admin_workspaces__workspace_id__agency_partner_invoice_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyInvoiceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users":{"get":{"tags":["admin-users","admin-users"],"summary":"List Users","description":"Return a paginated list of all users with workspace counts.","operationId":"list_users_api_admin_users_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by email or full name (partial match)","title":"Search"},"description":"Search by email or full name (partial match)"},{"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":"is_system_admin","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by system admin flag","title":"Is System Admin"},"description":"Filter by system admin flag"},{"name":"sort","in":"query","required":false,"schema":{"type":"string","description":"Sort: created_desc | created_asc | email_asc | email_desc","default":"created_desc","title":"Sort"},"description":"Sort: created_desc | created_asc | email_asc | email_desc"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Results per page","default":25,"title":"Limit"},"description":"Results per page"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsersListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{id}":{"get":{"tags":["admin-users","admin-users"],"summary":"Get User Detail","description":"Return detailed information for a single user, including workspace memberships.","operationId":"get_user_detail_api_admin_users__id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"User UUID","title":"Id"},"description":"User UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["admin-users","admin-users"],"summary":"Update User","description":"Update one or more fields on a user (admin only).\n\nSupported fields: full_name, is_active, is_verified, is_system_admin.\nOnly the fields present in the request body are changed.","operationId":"update_user_api_admin_users__id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"User UUID","title":"Id"},"description":"User UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin-users","admin-users"],"summary":"Delete User","description":"Permanently delete a user and all associated data (admin only).\n\nDisables SQLite FK enforcement, then deletes user, memberships,\nand orphaned workspaces. Orphaned rows in child tables are harmless.","operationId":"delete_user_api_admin_users__id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"User UUID","title":"Id"},"description":"User UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/user-events":{"get":{"tags":["admin-users","admin-users"],"summary":"List User Events","description":"Return a paginated list of all user events (audit log).","operationId":"list_user_events_api_admin_user_events_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by email or IP address (partial match)","title":"Search"},"description":"Search by email or IP address (partial match)"},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by action (e.g. login_success, register, invite_sent)","title":"Action"},"description":"Filter by action (e.g. login_success, register, invite_sent)"},{"name":"success","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by success/failure","title":"Success"},"description":"Filter by success/failure"},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by user UUID","title":"User Id"},"description":"Filter by user UUID"},{"name":"sort","in":"query","required":false,"schema":{"type":"string","description":"Sort: created_desc | created_asc","default":"created_desc","title":"Sort"},"description":"Sort: created_desc | created_asc"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"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"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEventsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/emails":{"get":{"tags":["admin-emails"],"summary":"List Emails","description":"Return a paginated unified list of all email activity.\n\nCombines sent_emails (direct Resend sends) and mail_queue (scheduled sends)\ninto a single chronological feed.  Use ``source`` to narrow to one table.","operationId":"list_emails_api_admin_emails_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Restrict to one table: sent_email | mail_queue. Omit for both.","title":"Source"},"description":"Restrict to one table: sent_email | mail_queue. Omit for both."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status (sent, failed, mock, pending, cancelled)","title":"Status"},"description":"Filter by status (sent, failed, mock, pending, cancelled)"},{"name":"email_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by email_type (verification, password_reset, invitation, generic, trial_nudge_day7 …)","title":"Email Type"},"description":"Filter by email_type (verification, password_reset, invitation, generic, trial_nudge_day7 …)"},{"name":"to_email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Partial match on recipient address","title":"To Email"},"description":"Partial match on recipient address"},{"name":"source_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"mail_queue only – filter by source_type (trial_nudge, analysis_ready …)","title":"Source Type"},"description":"mail_queue only – filter by source_type (trial_nudge, analysis_ready …)"},{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"mail_queue only – filter by workspace UUID","title":"Workspace Id"},"description":"mail_queue only – filter by workspace UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnifiedEmailsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/emails/{item_id}/cancel":{"delete":{"tags":["admin-emails"],"summary":"Cancel Queued Email","description":"Soft-cancel a pending mail_queue item.\n\nSets status to 'cancelled'. Only pending items can be cancelled;\nalready-sent or already-cancelled items return 409.","operationId":"cancel_queued_email_api_admin_emails__item_id__cancel_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailQueueItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/email-templates":{"get":{"tags":["admin-email-templates"],"summary":"List Email Templates","description":"Return all email templates ordered by name.","operationId":"list_email_templates_api_admin_email_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/EmailTemplateOut"},"type":"array","title":"Response List Email Templates Api Admin Email Templates Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["admin-email-templates"],"summary":"Create Email Template","description":"Create a new email template. ``name`` must be unique.","operationId":"create_email_template_api_admin_email_templates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/email-templates/{template_id}":{"get":{"tags":["admin-email-templates"],"summary":"Get Email Template","description":"Return a single template by id.","operationId":"get_email_template_api_admin_email_templates__template_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"integer","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin-email-templates"],"summary":"Update Email Template","description":"Update an existing template. ``name`` uniqueness is enforced (excluding self).","operationId":"update_email_template_api_admin_email_templates__template_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"integer","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin-email-templates"],"summary":"Delete Email Template","description":"Permanently delete a template.","operationId":"delete_email_template_api_admin_email_templates__template_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"integer","title":"Template Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/email-templates/{template_id}/send-test":{"post":{"tags":["admin-email-templates"],"summary":"Send Test Email","description":"Render a template with provided variables and send a test email.\n\nAccepts ``{ \"email\": \"admin@example.com\", \"variables\": {\"domain\": \"example.com\"} }``.\nReturns ``{\"ok\": true, \"subject\": \"...\", \"to\": \"...\"}`` on success.","operationId":"send_test_email_api_admin_email_templates__template_id__send_test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"integer","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send Test Email Api Admin Email Templates  Template Id  Send Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/worker-jobs":{"get":{"tags":["admin-worker-jobs"],"summary":"List Worker Jobs","description":"List worker job log entries with pagination and optional filters.\n\nstatus=queued    – jobs waiting to be picked up (from source tables, not yet in WorkerJobLog)\nstatus=running   – jobs currently in-flight (WorkerJobLog PICKED rows with no finished_at)\nstatus=picked    – alias for running (raw WorkerJobLog status name)\nstatus=completed – finished successfully\nstatus=failed    – finished with error\nstatus=skipped   – skipped by worker\nNo status filter – queued items first, then WorkerJobLog rows newest-first","operationId":"list_worker_jobs_api_admin_worker_jobs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"job_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by job type: legacy_job, ai_mention, probe_run, benchmark, monitoring_check, monitoring_report","title":"Job Type"},"description":"Filter by job type: legacy_job, ai_mention, probe_run, benchmark, monitoring_check, monitoring_report"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: queued, picked, running, completed, failed, skipped","title":"Status"},"description":"Filter by status: queued, picked, running, completed, failed, skipped"},{"name":"job_ref_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by upstream job/run ID","title":"Job Ref Id"},"description":"Filter by upstream job/run ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerJobsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/worker-jobs/{log_id}":{"get":{"tags":["admin-worker-jobs"],"summary":"Get Worker Job","description":"Get a single worker job log entry by ID.","operationId":"get_worker_job_api_admin_worker_jobs__log_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","title":"Log Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkerJobDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/worker-jobs/close-stale":{"post":{"tags":["admin-worker-jobs"],"summary":"Close Stale Worker Jobs","description":"Close worker_job_logs rows stuck in PICKED (status=running) as FAILED.\n\nThese are audit rows a dead worker never closed; they are what keeps\n``queue_health_status`` red. The worker closes them itself (on boot and\nevery 15 min, see services/worker_job_log_reaper_v1.py); this is the\non-demand version for an operator or the ops bot. It only closes the log\nrows: the jobs behind them are requeued or failed by their own queues.\n\n``matched`` is every row that fits; ``closed`` is how many were written\n(0 on a dry run, at most ``limit``).","operationId":"close_stale_worker_jobs_api_admin_worker_jobs_close_stale_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"older_than_hours","in":"query","required":false,"schema":{"type":"integer","maximum":8760,"minimum":1,"description":"Only rows picked more than this many hours ago","default":24,"title":"Older Than Hours"},"description":"Only rows picked more than this many hours ago"},{"name":"dry_run","in":"query","required":false,"schema":{"type":"boolean","description":"List what would be closed without writing","default":false,"title":"Dry Run"},"description":"List what would be closed without writing"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Close at most this many rows, oldest first","default":50,"title":"Limit"},"description":"Close at most this many rows, oldest first"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseStaleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/llm-pricing":{"get":{"tags":["admin-llm-pricing"],"summary":"List Llm Pricing","description":"Return all LLM model pricing entries (active and inactive).","operationId":"list_llm_pricing_api_admin_llm_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LlmPricingListResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["admin-llm-pricing"],"summary":"Create Llm Pricing","description":"Create a new pricing entry for a model.","operationId":"create_llm_pricing_api_admin_llm_pricing_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LlmPricingCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LlmPricingItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/llm-pricing/{pricing_id}":{"put":{"tags":["admin-llm-pricing"],"summary":"Update Llm Pricing","description":"Update pricing for an existing entry.","operationId":"update_llm_pricing_api_admin_llm_pricing__pricing_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"pricing_id","in":"path","required":true,"schema":{"type":"string","title":"Pricing Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LlmPricingUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LlmPricingItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/llm-pricing/summary":{"get":{"tags":["admin-llm-pricing"],"summary":"Llm Cost Summary","description":"Return aggregated token + cost totals from worker_job_logs grouped by model.\n\nReads the dedicated tokens_in / tokens_out / cost_usd columns, so this is\nfast even on large tables.  Only counts rows with job_type='llm_call' and\nstatus='completed'.","operationId":"llm_cost_summary_api_admin_llm_pricing_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LlmCostSummaryResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/llm-pricing/dashboard":{"get":{"tags":["admin-llm-pricing"],"summary":"Llm Cost Dashboard","description":"Return all data needed by the admin LLM cost dashboard in a single call.\n\nIncludes:\n- Period summaries: last 30 days, last 365 days, all-time\n- Daily series (last 30 days) for a cost/calls trend graph\n- Monthly series (last 12 months) for a bar/area chart\n- Per-model breakdowns for both last-30-days and all-time pie/table widgets","operationId":"llm_cost_dashboard_api_admin_llm_pricing_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LlmDashboardResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/llm-pricing/by-workspace":{"get":{"tags":["admin-llm-pricing"],"summary":"Llm Costs By Workspace","description":"LLM costs per workspace per calendar month (UTC), newest month last.\n``unattributed`` holds calls without a workspace: platform work (sector\nclassification, admin tools) and older rows that cannot be traced.","operationId":"llm_costs_by_workspace_api_admin_llm_pricing_by_workspace_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"months","in":"query","required":false,"schema":{"type":"integer","default":6,"title":"Months"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Llm Costs By Workspace Api Admin Llm Pricing By Workspace Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{workspace_id}/llm-costs":{"get":{"tags":["admin-llm-pricing"],"summary":"Llm Costs For Workspace","description":"One workspace's LLM costs per month, and per Brand. Calls of this\nworkspace without a Brand (website scans, Content Studio) are under\n``brand: null``.","operationId":"llm_costs_for_workspace_api_admin_workspaces__workspace_id__llm_costs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}},{"name":"months","in":"query","required":false,"schema":{"type":"integer","default":6,"title":"Months"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Llm Costs For Workspace Api Admin Workspaces  Workspace Id  Llm Costs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/analyses":{"get":{"tags":["admin-analyses","admin-analyses"],"summary":"List Analyses","description":"Return a paginated list of all analyses across all workspaces.","operationId":"list_analyses_api_admin_analyses_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"},{"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":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by domain (partial match)","title":"Search"},"description":"Search by domain (partial match)"},{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by workspace ID","title":"Workspace Id"},"description":"Filter by workspace ID"},{"name":"sector","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by sector","title":"Sector"},"description":"Filter by sector"},{"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":"sort","in":"query","required":false,"schema":{"type":"string","description":"Sort: created_desc | created_asc","default":"created_desc","title":"Sort"},"description":"Sort: created_desc | created_asc"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__admin_analyses__AnalysesListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/analyses/{analysis_id}":{"get":{"tags":["admin-analyses","admin-analyses"],"summary":"Get Analysis","description":"Return full detail for a single analysis including workspace, users, and linked worker jobs.","operationId":"get_analysis_api_admin_analyses__analysis_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","description":"The analysis_id (UUID string) or integer row ID","title":"Analysis Id"},"description":"The analysis_id (UUID string) or integer row ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalysisDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/analyses/{analysis_id}/delete":{"delete":{"tags":["admin-analyses","admin-analyses"],"summary":"Delete Analysis","description":"Hard-delete an analysis record by analysis_id or integer row ID.","operationId":"delete_analysis_api_admin_analyses__analysis_id__delete_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","description":"The analysis_id (UUID string) or integer row ID","title":"Analysis Id"},"description":"The analysis_id (UUID string) or integer row ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalysisDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/front/pricing":{"get":{"tags":["admin-front"],"summary":"Get All Pricing","description":"Return ALL pricing packages (admin view).","operationId":"get_all_pricing_api_admin_front_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["admin-front"],"summary":"Upsert Pricing","description":"Upsert pricing packages by name.","operationId":"upsert_pricing_api_admin_front_pricing_put","requestBody":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PackageInput"},"type":"array","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/front/deploy-website":{"post":{"tags":["admin-front"],"summary":"Trigger Website Deploy","description":"Trigger a redeploy of the marketing website (findalyse.com).\n\nUsed after admin pricing edits — pricing is baked at build time on the\nwebsite, so changes do not appear until a rebuild. Calls Coolify's\ndeploy webhook and returns the deployment UUID for log-link purposes.","operationId":"trigger_website_deploy_api_admin_front_deploy_website_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/debug-crawl":{"get":{"tags":["admin-debug"],"summary":"Debug Crawl","description":"Run the production crawler against a URL and return what it sees.\n\nAdmin-only. Intended for diagnosing cases where prod's stored\n``raw_analysis`` does not match what a local/manual fetch returns.","operationId":"debug_crawl_api_admin_debug_crawl_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","description":"Absolute URL to crawl (http/https only)","title":"Url"},"description":"Absolute URL to crawl (http/https only)"},{"name":"max_pages","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"description":"Hard-capped at 10","default":10,"title":"Max Pages"},"description":"Hard-capped at 10"},{"name":"mode","in":"query","required":false,"schema":{"type":"string","description":"AI_VISIBILITY | COVERAGE","default":"AI_VISIBILITY","title":"Mode"},"description":"AI_VISIBILITY | COVERAGE"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Debug Crawl Api Admin Debug Crawl Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/debug-scan-bits/{analysis_id}":{"get":{"tags":["admin-debug"],"summary":"Debug Scan Bits","description":"Return Phase 1 diagnostic fields for a stored scan.\n\nAdmin-only. Surfaces just enough of raw_analysis to diagnose whether\nPhase 1 supplement layers ran, what the homepage crawl looked like,\nand whether price-indication markers are present in the crawled HTML.\n\nUseful when the UI shows a surprising action (e.g. 'Add price\nindications to your pricing page') on a site where the signal is\nvisibly there — so we can tell apart regex vs crawl-response vs\ncode-not-deployed causes.","operationId":"debug_scan_bits_api_admin_debug_scan_bits__analysis_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","description":"Analysis UUID to inspect","title":"Analysis Id"},"description":"Analysis UUID to inspect"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Debug Scan Bits Api Admin Debug Scan Bits  Analysis Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/sectors/sbi-codes":{"get":{"tags":["admin-sectors","admin-sectors"],"summary":"Search Sbi Codes","description":"Search SBI codes by code prefix or label text.\n\nAdmin-only endpoint for taxonomy lookup.","operationId":"search_sbi_codes_api_v1_admin_sectors_sbi_codes_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string","description":"Search term for code or label","default":"","title":"Query"},"description":"Search term for code or label"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max results to return","default":50,"title":"Limit"},"description":"Max results to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SbiCodesListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/sectors":{"get":{"tags":["admin-sectors","admin-sectors"],"summary":"List Sectors","description":"List all sectors (admin view includes disabled).","operationId":"list_sectors_api_v1_admin_sectors_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"include_disabled","in":"query","required":false,"schema":{"type":"boolean","description":"Include disabled sectors","default":true,"title":"Include Disabled"},"description":"Include disabled sectors"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SectorResponse"},"title":"Response List Sectors Api V1 Admin Sectors Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin-sectors","admin-sectors"],"summary":"Create Sector","description":"Create a new sector.","operationId":"create_sector_api_v1_admin_sectors_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/sectors/{key}":{"get":{"tags":["admin-sectors","admin-sectors"],"summary":"Get Sector","description":"Get a single sector by key.","operationId":"get_sector_api_v1_admin_sectors__key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","description":"Sector key","title":"Key"},"description":"Sector key"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin-sectors","admin-sectors"],"summary":"Update Sector","description":"Update a sector's properties.","operationId":"update_sector_api_v1_admin_sectors__key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","description":"Sector key","title":"Key"},"description":"Sector key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/sectors/{key}/enable":{"patch":{"tags":["admin-sectors","admin-sectors"],"summary":"Enable Sector","description":"Enable a sector.","operationId":"enable_sector_api_v1_admin_sectors__key__enable_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","description":"Sector key","title":"Key"},"description":"Sector key"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/sectors/{key}/disable":{"patch":{"tags":["admin-sectors","admin-sectors"],"summary":"Disable Sector","description":"Disable a sector (soft delete).","operationId":"disable_sector_api_v1_admin_sectors__key__disable_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","description":"Sector key","title":"Key"},"description":"Sector key"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/sectors/{key}/intents":{"get":{"tags":["admin-sectors","admin-sectors"],"summary":"List Sector Intents","description":"List intents for a sector.","operationId":"list_sector_intents_api_v1_admin_sectors__key__intents_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","description":"Sector key","title":"Key"},"description":"Sector key"},{"name":"include_disabled","in":"query","required":false,"schema":{"type":"boolean","description":"Include disabled intents","default":true,"title":"Include Disabled"},"description":"Include disabled intents"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SectorIntentResponse"},"title":"Response List Sector Intents Api V1 Admin Sectors  Key  Intents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin-sectors","admin-sectors"],"summary":"Create Sector Intent","description":"Create a new intent for a sector.","operationId":"create_sector_intent_api_v1_admin_sectors__key__intents_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","description":"Sector key","title":"Key"},"description":"Sector key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorIntentCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorIntentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/sectors/{key}/intents/{intent_id}":{"put":{"tags":["admin-sectors","admin-sectors"],"summary":"Update Sector Intent","description":"Update a sector intent.","operationId":"update_sector_intent_api_v1_admin_sectors__key__intents__intent_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","description":"Sector key","title":"Key"},"description":"Sector key"},{"name":"intent_id","in":"path","required":true,"schema":{"type":"string","description":"Intent ID","title":"Intent Id"},"description":"Intent ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorIntentUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorIntentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/sectors/{key}/intents/{intent_id}/enable":{"patch":{"tags":["admin-sectors","admin-sectors"],"summary":"Enable Sector Intent","description":"Enable a sector intent.","operationId":"enable_sector_intent_api_v1_admin_sectors__key__intents__intent_id__enable_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","description":"Sector key","title":"Key"},"description":"Sector key"},{"name":"intent_id","in":"path","required":true,"schema":{"type":"string","description":"Intent ID","title":"Intent Id"},"description":"Intent ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorIntentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/sectors/{key}/intents/{intent_id}/disable":{"patch":{"tags":["admin-sectors","admin-sectors"],"summary":"Disable Sector Intent","description":"Disable a sector intent.","operationId":"disable_sector_intent_api_v1_admin_sectors__key__intents__intent_id__disable_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","description":"Sector key","title":"Key"},"description":"Sector key"},{"name":"intent_id","in":"path","required":true,"schema":{"type":"string","description":"Intent ID","title":"Intent Id"},"description":"Intent ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectorIntentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhook/contact-form":{"post":{"tags":["webhook"],"summary":"Receive Contact Form","operationId":"receive_contact_form_api_webhook_contact_form_post","parameters":[{"name":"secret","in":"query","required":true,"schema":{"type":"string","description":"Webhook secret","title":"Secret"},"description":"Webhook secret"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactFormWebhookPayload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/contact-forms":{"get":{"tags":["admin-contact-forms"],"summary":"List Contact Forms","operationId":"list_contact_forms_api_admin_contact_forms_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"Include shadow-deleted entries","default":false,"title":"Include Deleted"},"description":"Include shadow-deleted entries"},{"name":"is_read","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by read status","title":"Is Read"},"description":"Filter by read 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/ContactFormListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/contact-forms/{submission_id}/read":{"patch":{"tags":["admin-contact-forms"],"summary":"Mark Contact Form Read","operationId":"mark_contact_form_read_api_admin_contact_forms__submission_id__read_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"submission_id","in":"path","required":true,"schema":{"type":"string","title":"Submission Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/contact-forms/{submission_id}":{"delete":{"tags":["admin-contact-forms"],"summary":"Delete Contact Form","operationId":"delete_contact_form_api_admin_contact_forms__submission_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"submission_id","in":"path","required":true,"schema":{"type":"string","title":"Submission Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/lead-scanner/sectors":{"get":{"tags":["lead-scanner"],"summary":"List Sectors","description":"Return available sectors for the dropdown (DB-driven).","operationId":"list_sectors_api_v1_lead_scanner_sectors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Sectors Api V1 Lead Scanner Sectors Get"}}}}}}},"/api/v1/lead-scanner/scan":{"post":{"tags":["lead-scanner"],"summary":"Lead Scan","description":"Run a lightweight scan + AI visibility check on a domain.","operationId":"lead_scan_api_v1_lead_scanner_scan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadScanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Lead Scan Api V1 Lead Scanner Scan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/lead-scanner/leads":{"get":{"tags":["lead-scanner"],"summary":"List Leads","operationId":"list_leads_api_v1_lead_scanner_leads_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"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":"object","additionalProperties":true,"title":"Response List Leads Api V1 Lead Scanner Leads Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/lead-scanner/{lead_id}":{"patch":{"tags":["lead-scanner"],"summary":"Update Lead","operationId":"update_lead_api_v1_lead_scanner__lead_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadContactUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Lead Api V1 Lead Scanner  Lead Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/lead-scanner/{lead_id}/preview-report":{"get":{"tags":["lead-scanner"],"summary":"Preview Lead Report","description":"Return PDF bytes for in-browser preview.","operationId":"preview_lead_report_api_v1_lead_scanner__lead_id__preview_report_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/lead-scanner/{lead_id}/send-report":{"post":{"tags":["lead-scanner"],"summary":"Send Lead Report","operationId":"send_lead_report_api_v1_lead_scanner__lead_id__send_report_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send Lead Report Api V1 Lead Scanner  Lead Id  Send Report Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/domains/{analysis_id}/rescan":{"put":{"tags":["domains","domains"],"summary":"Toggle Rescan","description":"Enable or disable automatic rescanning for a domain.\n\nTwo halves, because either alone is insufficient. Cancelling the queued row\nwithout storing the preference bought about 24 hours: the milestone\nscheduler re-enqueued the domain once its cooldown lapsed, so a customer\nwho switched rescans off saw them come back. Storing the preference without\ncancelling would leave one already-queued scan to fire.\n\n- ``rescan=true``: clears the pause and upserts a pending scheduled_scans\n  row for now + 5 days. Returns the existing row if one is already pending.\n- ``rescan=false``: persists the pause on ``workspace_domains`` AND marks\n  any pending row for this (workspace, domain) as 'cancelled'.","operationId":"toggle_rescan_api_v1_domains__analysis_id__rescan_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RescanToggleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RescanToggleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/domains/{analysis_id}/reach":{"put":{"tags":["domains","domains"],"summary":"Set Reach","description":"Store where this website wants to be found.\n\nThe next AI measurement reads it: \"international\" asks in English without\na place, \"national\" names the country, \"local\" and \"regional\" the city.\nNothing is re-measured here; the case page offers a rescan.","operationId":"set_reach_api_v1_domains__analysis_id__reach_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReachRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReachResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/scans/queue":{"get":{"tags":["admin-scans","admin-scans"],"summary":"List Queue","description":"List queued scans. Defaults to pending rows; pass status= to filter differently.","operationId":"list_queue_api_admin_scans_queue_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"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 (default: pending)","title":"Status"},"description":"Filter by status (default: pending)"},{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by workspace ID","title":"Workspace Id"},"description":"Filter by workspace ID"},{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by domain (partial match)","title":"Domain"},"description":"Filter by domain (partial match)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/scans/auto-rescan":{"get":{"tags":["admin-scans","admin-scans"],"summary":"Get Auto Rescan Status","description":"Where auto-rescans currently stand: the global brake, and per workspace\nthe opt-out flag plus how many rows are still queued.\n\nLists every workspace that either has pending rows or has been explicitly\nswitched off — the ones an admin chasing scan spend actually cares about.","operationId":"get_auto_rescan_status_api_admin_scans_auto_rescan_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Limit to one workspace","title":"Workspace Id"},"description":"Limit to one workspace"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoRescanStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/scans/stop":{"post":{"tags":["admin-scans","admin-scans"],"summary":"Stop Auto Rescans","description":"Stop auto-rescans — for one workspace, one domain, or everything.\n\nTwo halves, because either alone is insufficient:\n\n1. Every matching pending ``scheduled_scans`` row is cancelled, so nothing\n   already queued fires.\n2. Unless ``disable_future`` is false, the kill switch is flipped — the\n   workspace's opt-out flag, or the global brake when no workspace is\n   named. Without this the schedulers simply re-enqueue on the next tick.\n\nA ``domain`` filter only narrows the cancellation; the switch is\nworkspace-wide either way, since there is no per-domain flag. Cancelling a\nsingle domain and leaving the switch on buys about 24 hours, so pass a\ndomain only when you mean a one-off drain.","operationId":"stop_auto_rescans_api_admin_scans_stop_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoRescanStopRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoRescanStopResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/scans/resume":{"post":{"tags":["admin-scans","admin-scans"],"summary":"Resume Auto Rescans","description":"Undo a stop: flip the switch back on for a workspace, or globally.\n\nDeliberately does not resurrect cancelled rows. The schedulers re-derive\nwhat is genuinely due on their next tick, so anything still worth scanning\ncomes back on its own — and anything that was only queued because of a\nrunaway loop stays gone.","operationId":"resume_auto_rescans_api_admin_scans_resume_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoRescanStopRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoRescanStopResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/scans/{scan_id}":{"delete":{"tags":["admin-scans","admin-scans"],"summary":"Delete Scan","description":"Remove a scan from the queue by marking it 'cancelled'.","operationId":"delete_scan_api_admin_scans__scan_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"string","description":"The scheduled_scans row UUID","title":"Scan Id"},"description":"The scheduled_scans row UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["admin-scans","admin-scans"],"summary":"Reschedule Scan","description":"Update the scheduled date of a queued scan.\n\n``rescan_on`` must be a valid ISO 8601 date or datetime string\n(e.g. ``2026-07-01`` or ``2026-07-01T09:00:00``).\nOnly pending scans can be rescheduled.","operationId":"reschedule_scan_api_admin_scans__scan_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"string","description":"The scheduled_scans row UUID","title":"Scan Id"},"description":"The scheduled_scans row UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanRescheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanRescheduleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/changelog":{"get":{"tags":["admin-changelog"],"summary":"Get Changelog","operationId":"get_changelog_api_admin_changelog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Changelog Api Admin Changelog Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AIMentionHealthResponse":{"properties":{"success_rate":{"type":"number","title":"Success Rate"},"avg_response_time_ms":{"type":"integer","title":"Avg Response Time Ms"},"cache_hit_rate":{"type":"number","title":"Cache Hit Rate"},"total_checks":{"type":"integer","title":"Total Checks"},"successful_checks":{"type":"integer","title":"Successful Checks"},"failed_checks":{"type":"integer","title":"Failed Checks"},"cache_hits":{"type":"integer","title":"Cache Hits"},"cache_misses":{"type":"integer","title":"Cache Misses"}},"type":"object","required":["success_rate","avg_response_time_ms","cache_hit_rate","total_checks","successful_checks","failed_checks","cache_hits","cache_misses"],"title":"AIMentionHealthResponse","description":"Response for GET /api/admin/dashboard/ai-mention-health"},"AIModelMention":{"properties":{"model":{"type":"string","title":"Model"},"intent_key":{"type":"string","title":"Intent Key"},"mentioned":{"type":"boolean","title":"Mentioned"},"mention_type":{"type":"string","title":"Mention Type","default":"none"},"rank_band":{"type":"string","title":"Rank Band","default":"unknown"},"snippet":{"type":"string","title":"Snippet","default":""},"confidence":{"type":"number","title":"Confidence","default":0.0}},"type":"object","required":["model","intent_key","mentioned"],"title":"AIModelMention","description":"One AI Visibility mention, shaped like `/ai-ranking/model-responses`."},"AIProbeQuote":{"properties":{"model":{"type":"string","title":"Model"},"intent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent Key"},"quote":{"type":"string","title":"Quote"},"mentioned":{"type":"boolean","title":"Mentioned"},"rank_band":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rank Band"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"}},"type":"object","required":["model","quote","mentioned"],"title":"AIProbeQuote","description":"A verbatim quote from a stored ``AiMentionResult`` row.\n\nThe quote stays in its original English — the synthesis prompt\ninstructs the model to keep it untranslated inside quotation marks.\n``confidence`` helps the UI show a credibility indicator."},"ActionItem":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for this action item. Leave empty and it is derived deterministically from pillar_key + action_key by _fill_stable_action_id below, so the id is identical across re-scans of the same domain (completion/assignment is keyed on it).","default":""},"actionKey":{"type":"string","title":"Actionkey","description":"Stable machine-readable identifier (e.g., 'add_pricing_page', 'fix_localbusiness_schema')"},"pillarKey":{"anyOf":[{"$ref":"#/components/schemas/PillarKey"},{"type":"null"}],"description":"Which pillar this action relates to (entity, content, trust, intents). Type-safe enum."},"intentKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intentkey","description":"Optional link to specific intent when relevant"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity","description":"Severity level: 'critical', 'significant', 'moderate', 'minor'"},"riskClass":{"type":"string","title":"Riskclass","description":"Reliable Scanner classification: 'hard' = deterministic check (severity may be CRITICAL); 'soft' = interpretive check (severity capped at NEEDS_WORK). Default 'soft' is the safe fallback for actions that pre-date PR A2 / for unknown keys.","default":"soft"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority","description":"UX tier for the customer-facing list: 'action' = surface as a fix-action (CRITICAL severity, or NEEDS_WORK on a hard check); 'watch' = noted, lower urgency (NEEDS_WORK on a soft check, or NICE_TO_HAVE / generic-fallback for checks without a dedicated action template). Populated during action assembly via app.domain.check_classification_v1.determine_priority. None on read = the frontend falls back to 'action' chrome."},"impact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Impact","description":"Expected impact: 'very_high', 'high', 'medium', 'low'"},"effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effort","description":"Implementation effort: 'low', 'medium', 'high'"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Human-readable title (may be filled by LLM or static text)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Human-readable explanation of what to do"},"whyItMatters":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whyitmatters","description":"Optional explanation for the Actions step (why this helps AI findability)"},"howToFix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Howtofix","description":"Optional implementation guidance for technical people"},"evidenceRefs":{"items":{"type":"string"},"type":"array","title":"Evidencerefs","description":"List of check keys or URLs that led to this action"},"evidenceSnippets":{"items":{"type":"string"},"type":"array","title":"Evidencesnippets","description":"Optional bounded evidence snippets aligned to evidenceRefs (max 3; each <= 200 chars)."},"evidenceHashes":{"items":{"type":"string"},"type":"array","title":"Evidencehashes","description":"Optional bounded sha256 hashes for evidenceSnippets (max 3)."},"evidenceChunkIds":{"items":{"type":"string"},"type":"array","title":"Evidencechunkids","description":"Optional bounded chunk ids for evidenceSnippets (max 3)."},"explanationEntity":{"anyOf":[{},{"type":"null"}],"title":"Explanationentity","description":"Entity V2 explanation data (EntityActionExplanationV2 when populated)"},"explanationContent":{"anyOf":[{},{"type":"null"}],"title":"Explanationcontent","description":"Content V2 explanation data (ContentActionExplanationV2 when populated)"},"explanationTrust":{"anyOf":[{},{"type":"null"}],"title":"Explanationtrust","description":"Trust V2 explanation data (TrustActionExplanationV2 when populated)"},"explanationIntents":{"anyOf":[{},{"type":"null"}],"title":"Explanationintents","description":"Intent V2 explanation data (IntentActionExplanationV2 when populated)"},"explanationAiPresence":{"anyOf":[{},{"type":"null"}],"title":"Explanationaipresence","description":"AI Presence V2 explanation data (AiPresenceActionExplanationV2 when populated)"},"explanationTechnical":{"anyOf":[{},{"type":"null"}],"title":"Explanationtechnical","description":"Technical V2 explanation data (TechnicalActionExplanationV2 when populated)"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta","description":"Generic extra metadata field for future extensions"},"themeKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Themekey","description":"One of the six strategic themes this action belongs to: 'ai_awareness', 'buyer_questions', 'build_proof', 'fix_tech', 'win_search', 'close_gaps'. Derived from pillar_key + action_key via app.services.optimization.themer.derive_theme_key_for_typed_action during typed_actions assembly. Optional on read for backwards compatibility with cached pre-PR responses."},"actionability":{"type":"string","title":"Actionability","description":"'action' = a concrete intervention the customer can carry out. 'insight' = a finding we show and deliberately do not turn into a task, because the off-site contract can name no first step or no place for it (app.domain.offsite_actionability_v1). Who owns the outcome is not part of that judgement, since 2026-09-21. The default keeps every cached scan and every on-site action exactly as it was, and the id never changes, so a ticked task survives the demotion.","default":"action"},"insightReason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Insightreason","description":"Why this finding produces no task, from the shared vocabulary in offsite_actionability_v1.INSIGHT_REASONS: the AI Presence reasons plus 'no_destination'. ('third_party_decides' is retired and only appears in payloads written before 2026-09-21.) Only set when actionability is 'insight'."},"destination":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Destination","description":"WHERE an off-site action lands: {host, url, kind}. The kind shares its vocabulary with the AI Presence doors (claim, listing, event, editorial_tip and so on) plus 'profile', 'tool' and 'own_site'. None for on-site actions and for anything without a destination."},"predictedScoreIncrease":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Predictedscoreincrease","description":"Estimated number of score points gained after resolving this action. Computed as OAP penalty reduction + direct pillar score gain for the linked check. Rounded to 1 decimal place. Null for legacy cached actions that predate this field."}},"type":"object","required":["actionKey"],"title":"ActionItem","description":"Single actionable recommendation in the domain model.\n\nRepresents a specific action that can improve AI visibility. This is the\nunified action model for Pillar 2.0, used across:\n- Actions step (action plan display)\n- Report step (prioritized recommendations)\n- API responses\n\nThis replaces the previous untyped dict-based action representations.\n\nKey features:\n- Links to pillar and optionally to specific intent\n- Includes prioritization metrics (severity, impact, effort)\n- Contains human-readable explanations\n- References evidence that led to this recommendation\n\nUsage:\n    action = ActionItem(\n        id=\"action-001\",\n        action_key=\"add_pricing_page\",\n        pillar_key=PillarKey.INTENTS,\n        intent_key=\"pricing_quote\",\n        severity=\"critical\",\n        impact=\"high\",\n        effort=\"medium\",\n        title=\"Add dedicated pricing page\",\n        description=\"Create a page that clearly lists service prices...\",\n        why_it_matters=\"AI models look for explicit pricing information...\",\n        how_to_fix=\"Create /pricing or /prices page with clear price list...\",\n        evidence_refs=[\"pricing_explicit_check\", \"https://example.com/services\"]\n    )"},"ActionRecheckResponse":{"properties":{"analysis_id":{"type":"string","title":"Analysis Id"},"action_key":{"type":"string","title":"Action Key"},"check_key":{"type":"string","title":"Check Key"},"pillar":{"type":"string","title":"Pillar"},"previous_result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Result"},"new_result":{"type":"string","title":"New Result"},"check_message":{"type":"string","title":"Check Message"},"resolved":{"type":"boolean","title":"Resolved"},"rechecked_at":{"type":"string","title":"Rechecked At"}},"type":"object","required":["analysis_id","action_key","check_key","pillar","previous_result","new_result","check_message","resolved","rechecked_at"],"title":"ActionRecheckResponse"},"ActionsResponse":{"properties":{"profile_id":{"type":"string","title":"Profile Id"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"measured":{"type":"boolean","title":"Measured"},"rules_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rules Version"},"actions":{"items":{"$ref":"#/components/schemas/PresenceActionOut"},"type":"array","title":"Actions"},"superseded":{"items":{"type":"string"},"type":"array","title":"Superseded","description":"Rules dropped because a more specific rule fired (slice 6b.2)"},"insufficient":{"items":{"$ref":"#/components/schemas/InsufficientRule"},"type":"array","title":"Insufficient","description":"Rules that could not judge: too little data"},"insights":{"items":{"$ref":"#/components/schemas/PresenceInsightOut"},"type":"array","title":"Insights","description":"Observed sources with a gap and no defensible action (decision 2026-09-20 §12)"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"}},"type":"object","required":["profile_id","measured"],"title":"ActionsResponse"},"ActivateNowResponse":{"properties":{"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"}},"type":"object","title":"ActivateNowResponse"},"AddonPreviewRequest":{"properties":{"kind":{"type":"string","title":"Kind"},"quantity":{"type":"integer","title":"Quantity"}},"type":"object","required":["kind","quantity"],"title":"AddonPreviewRequest"},"AddonPreviewResponse":{"properties":{"kind":{"type":"string","title":"Kind"},"requested_quantity":{"type":"integer","title":"Requested Quantity"},"current_quantity":{"type":"integer","title":"Current Quantity"},"interval":{"type":"string","title":"Interval"},"currency":{"type":"string","title":"Currency"},"unit_amount_cents":{"type":"integer","title":"Unit Amount Cents"},"recurring_total_cents":{"type":"integer","title":"Recurring Total Cents"},"recurring_delta_cents":{"type":"integer","title":"Recurring Delta Cents"},"proration_cents":{"type":"integer","title":"Proration Cents"},"next_invoice_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Invoice At"}},"type":"object","required":["kind","requested_quantity","current_quantity","interval","currency","unit_amount_cents","recurring_total_cents","recurring_delta_cents","proration_cents"],"title":"AddonPreviewResponse"},"AddonUpdateRequest":{"properties":{"kind":{"type":"string","title":"Kind"},"quantity":{"type":"integer","title":"Quantity"}},"type":"object","required":["kind","quantity"],"title":"AddonUpdateRequest"},"AddonUpdateResponse":{"properties":{"domains":{"additionalProperties":true,"type":"object","title":"Domains"},"seats":{"additionalProperties":true,"type":"object","title":"Seats"},"brands":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Brands"}},"type":"object","required":["domains","seats"],"title":"AddonUpdateResponse"},"AdminBrandItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"archived_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Archived At"},"websites":{"items":{"type":"string"},"type":"array","title":"Websites"},"active_themes":{"type":"integer","title":"Active Themes"},"last_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Run At"},"runs_this_month":{"type":"integer","title":"Runs This Month"}},"type":"object","required":["id","name","status","websites","active_themes","runs_this_month"],"title":"AdminBrandItem","description":"One Brand (presence profile) on the admin workspace page."},"AdminBrandSlots":{"properties":{"included":{"type":"integer","title":"Included"},"purchased":{"type":"integer","title":"Purchased"},"bonus":{"type":"integer","title":"Bonus"},"in_use":{"type":"integer","title":"In Use"},"bonus_granted":{"type":"integer","title":"Bonus Granted","default":0},"bonus_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bonus Until"},"bonus_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bonus Reason"},"effective":{"type":"integer","title":"Effective","default":0}},"type":"object","required":["included","purchased","bonus","in_use"],"title":"AdminBrandSlots"},"AdminModelLimitsPatchRequest":{"properties":{"model_limits_by_tier":{"$ref":"#/components/schemas/ModelLimitsByTierPatch"}},"additionalProperties":false,"type":"object","required":["model_limits_by_tier"],"title":"AdminModelLimitsPatchRequest"},"AdminModelLimitsResponse":{"properties":{"model_limits_by_tier":{"$ref":"#/components/schemas/ModelLimitsByTier"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":false,"type":"object","required":["model_limits_by_tier"],"title":"AdminModelLimitsResponse"},"AgencyBrandingResponse":{"properties":{"id":{"type":"string","title":"Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"agency_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agency Name"},"agency_logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agency Logo Url"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagline"},"about_agency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"About Agency"},"website_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website Url"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"cta_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cta Text"},"closing_cta_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closing Cta Body"},"primary_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Color"},"secondary_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secondary Color"},"accent_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accent Color"},"show_product_branding":{"type":"boolean","title":"Show Product Branding","default":true},"report_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Language","default":"en"},"ui_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ui Language","default":"en"},"expertise_bullets":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Expertise Bullets"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","created_at","updated_at"],"title":"AgencyBrandingResponse","description":"Agency branding configuration for white label reports."},"AgencyBrandingUpdate":{"properties":{"agency_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Agency Name"},"agency_logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agency Logo Url"},"tagline":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Tagline"},"about_agency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"About Agency"},"website_url":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Website Url"},"contact_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Contact Phone"},"cta_text":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Cta Text"},"closing_cta_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closing Cta Body"},"primary_color":{"anyOf":[{"type":"string","maxLength":20,"pattern":"^#[0-9A-Fa-f]{6}$|^#[0-9A-Fa-f]{3}$|^$"},{"type":"null"}],"title":"Primary Color"},"secondary_color":{"anyOf":[{"type":"string","maxLength":20,"pattern":"^#[0-9A-Fa-f]{6}$|^#[0-9A-Fa-f]{3}$|^$"},{"type":"null"}],"title":"Secondary Color"},"accent_color":{"anyOf":[{"type":"string","maxLength":20,"pattern":"^#[0-9A-Fa-f]{6}$|^#[0-9A-Fa-f]{3}$|^$"},{"type":"null"}],"title":"Accent Color"},"show_product_branding":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Show Product Branding"},"report_language":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Report Language"},"ui_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ui Language"},"expertise_bullets":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":10},{"type":"null"}],"title":"Expertise Bullets"}},"type":"object","title":"AgencyBrandingUpdate","description":"Update request for agency branding. All fields optional."},"AgencyInvoiceRequest":{"properties":{"email":{"type":"string","maxLength":200,"minLength":3,"title":"Email"},"company_name":{"type":"string","maxLength":200,"minLength":1,"title":"Company Name"},"country":{"type":"string","maxLength":2,"minLength":2,"title":"Country","default":"NL"},"postal_code":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Postal Code"},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"City"},"line1":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Line1"},"vat_id":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Vat Id"},"extra_brands":{"type":"integer","maximum":500.0,"minimum":0.0,"title":"Extra Brands","default":0},"discount_cents":{"type":"integer","minimum":0.0,"title":"Discount Cents","default":0},"discount_months":{"type":"integer","maximum":36.0,"minimum":0.0,"title":"Discount Months","default":0},"days_until_due":{"type":"integer","maximum":90.0,"minimum":1.0,"title":"Days Until Due","default":30},"first_invoice_draft":{"type":"boolean","title":"First Invoice Draft","default":true},"dry_run":{"type":"boolean","title":"Dry Run","default":true}},"additionalProperties":false,"type":"object","required":["email","company_name"],"title":"AgencyInvoiceRequest"},"AiVisibilityEvidence":{"properties":{"intents":{"items":{"$ref":"#/components/schemas/AiVisibilityEvidenceIntent"},"type":"array","title":"Intents"},"models_probed":{"items":{"type":"string"},"type":"array","title":"Models Probed"}},"type":"object","title":"AiVisibilityEvidence","description":"Provenance + diagnostic detail tying an action to AI Visibility (Phase B).\n\nNon-null only when at least one probe on this action came back\n``mentioned=False``. Drives the \"AI Visibility evidence\" badge on the\nAction Plan card."},"AiVisibilityEvidenceIntent":{"properties":{"intent_key":{"type":"string","title":"Intent Key"},"intent_question":{"type":"string","title":"Intent Question"},"journey_stage":{"type":"string","title":"Journey Stage"},"models_unmentioned":{"items":{"type":"string"},"type":"array","title":"Models Unmentioned"}},"type":"object","required":["intent_key","intent_question","journey_stage"],"title":"AiVisibilityEvidenceIntent","description":"One unmentioned intent whose gap this action would help close.\n\nSurfaced from ``CurrentState.ai_probe_quotes`` (Phase B). The frontend\nrenders ``intent_question`` verbatim and ``models_unmentioned`` as a\nshort pill list (\"ChatGPT, Claude\")."},"AliasIn":{"properties":{"text":{"type":"string","maxLength":120,"title":"Text"},"match":{"type":"string","enum":["phrase","word"],"title":"Match","default":"phrase"}},"additionalProperties":false,"type":"object","required":["text"],"title":"AliasIn"},"AlternativeSuggestion":{"properties":{"name":{"type":"string","title":"Name"},"reason":{"type":"string","title":"Reason","description":"Customer-facing, in the profile language: why this is an alternative"}},"type":"object","required":["name","reason"],"title":"AlternativeSuggestion","description":"A name and a reason, never a domain: nothing in our context can vouch for one."},"AnalysisDeleteResponse":{"properties":{"deleted":{"type":"boolean","title":"Deleted"},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"},"id":{"type":"integer","title":"Id"}},"type":"object","required":["deleted","id"],"title":"AnalysisDeleteResponse"},"AnalysisDetailResponse":{"properties":{"id":{"type":"integer","title":"Id"},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"},"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"sector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"status":{"type":"string","title":"Status"},"total_calibrated":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Calibrated"},"ai_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Level"},"ai_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Summary"},"projected_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Projected Score"},"entity_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Entity Score"},"content_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Content Score"},"trust_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trust Score"},"intents_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Intents Score"},"progress_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Pct"},"progress_phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress Phase"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"error_traceback":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Traceback"},"action_deadline_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Deadline At"},"next_rescan_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Rescan At"},"results_viewed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Results Viewed At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"workspace":{"anyOf":[{"$ref":"#/components/schemas/AnalysisWorkspaceSummary"},{"type":"null"}]},"workspace_members":{"items":{"$ref":"#/components/schemas/AnalysisMemberSummary"},"type":"array","title":"Workspace Members","default":[]},"worker_jobs":{"items":{"$ref":"#/components/schemas/AnalysisWorkerJobSummary"},"type":"array","title":"Worker Jobs","default":[]},"rescan":{"type":"boolean","title":"Rescan","default":false},"rescan_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rescan On"},"subscores":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Subscores"},"benchmark_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Benchmark Summary"},"report_overrides":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Report Overrides"}},"type":"object","required":["id","status"],"title":"AnalysisDetailResponse"},"AnalysisMemberSummary":{"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"},"is_active":{"type":"boolean","title":"Is Active","default":true},"is_system_admin":{"type":"boolean","title":"Is System Admin","default":false}},"type":"object","required":["user_id","email","role"],"title":"AnalysisMemberSummary"},"AnalysisWorkerJobSummary":{"properties":{"id":{"type":"string","title":"Id"},"job_type":{"type":"string","title":"Job Type"},"job_ref_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Ref Id"},"status":{"type":"string","title":"Status"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"cost":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["id","job_type","status"],"title":"AnalysisWorkerJobSummary"},"AnalysisWorkspaceSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"is_demo":{"type":"boolean","title":"Is Demo","default":false},"is_disabled":{"type":"boolean","title":"Is Disabled","default":false}},"type":"object","required":["id","name"],"title":"AnalysisWorkspaceSummary"},"AnomaliesResponse":{"properties":{"anomalies":{"items":{"$ref":"#/components/schemas/AnomalyItem"},"type":"array","title":"Anomalies"}},"type":"object","required":["anomalies"],"title":"AnomaliesResponse","description":"Response for GET /api/admin/dashboard/anomalies"},"AnomalyItem":{"properties":{"type":{"type":"string","title":"Type"},"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"},"resource_name":{"type":"string","title":"Resource Name"},"metric":{"type":"string","title":"Metric"},"threshold":{"type":"string","title":"Threshold"},"current_value":{"type":"string","title":"Current Value"},"severity":{"type":"string","title":"Severity"}},"type":"object","required":["type","resource_type","resource_id","resource_name","metric","threshold","current_value","severity"],"title":"AnomalyItem","description":"Detected anomaly."},"AspectEvaluation":{"properties":{"aspectKey":{"type":"string","title":"Aspectkey","description":"Stable machine-readable key (e.g., 'coverage', 'freshness', 'decision_support')"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Human-readable label (optional, can be handled via i18n)"},"score":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Score","description":"Score between 0 and 100 for this aspect"},"level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level","description":"Human-friendly level (e.g., 'weak', 'fair', 'strong')"},"checkCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Checkcount","description":"How many checks contributed to this aspect"},"passedCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Passedcount","description":"How many checks passed"},"details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details","description":"Optional bag of extra info for later use"}},"type":"object","required":["aspectKey"],"title":"AspectEvaluation","description":"Evaluation of a logical sub-area within a pillar.\n\nRepresents granular evaluation within a pillar. For example, within the\nContent pillar you might have aspects like:\n- coverage: How completely does content answer user questions?\n- depth: How detailed and comprehensive is the content?\n- freshness: How up-to-date is the information?\n- decision_support: Does content help users make decisions?\n\nThis allows pillar scores to be broken down into meaningful components\nfor better transparency and actionability.\n\nUsage:\n    aspect = AspectEvaluation(\n        aspect_key=\"coverage\",\n        label=\"Content Coverage\",\n        score=75.0,\n        level=\"fair\",\n        check_count=10,\n        passed_count=7\n    )"},"AttestRequest":{"properties":{"how":{"type":"string","title":"How","default":"gsc_import"}},"type":"object","title":"AttestRequest"},"AttestResponse":{"properties":{"analysis_id":{"type":"string","title":"Analysis Id"},"action_key":{"type":"string","title":"Action Key"},"check_key":{"type":"string","title":"Check Key"},"attested":{"type":"boolean","title":"Attested"},"how":{"type":"string","title":"How"}},"type":"object","required":["analysis_id","action_key","check_key","attested","how"],"title":"AttestResponse"},"AuthorizeResponse":{"properties":{"auth_url":{"type":"string","title":"Auth Url"}},"type":"object","required":["auth_url"],"title":"AuthorizeResponse"},"AutoRescanSettingResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"is_paid":{"type":"boolean","title":"Is Paid"}},"type":"object","required":["enabled","is_paid"],"title":"AutoRescanSettingResponse"},"AutoRescanStatusItem":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"workspace_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Name"},"enabled":{"type":"boolean","title":"Enabled"},"pending_scans":{"type":"integer","title":"Pending Scans"}},"type":"object","required":["workspace_id","enabled","pending_scans"],"title":"AutoRescanStatusItem"},"AutoRescanStatusResponse":{"properties":{"global_enabled":{"type":"boolean","title":"Global Enabled"},"total_pending":{"type":"integer","title":"Total Pending"},"workspaces":{"items":{"$ref":"#/components/schemas/AutoRescanStatusItem"},"type":"array","title":"Workspaces"}},"type":"object","required":["global_enabled","total_pending","workspaces"],"title":"AutoRescanStatusResponse"},"AutoRescanStopRequest":{"properties":{"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"disable_future":{"type":"boolean","title":"Disable Future","default":true},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","title":"AutoRescanStopRequest","description":"Omit ``workspace_id`` to stop auto-rescans system-wide.\n\n``disable_future`` is the difference between draining the queue (which the\nschedulers refill) and actually stopping: leave it on unless you only want\na one-off drain."},"AutoRescanStopResponse":{"properties":{"scope":{"type":"string","title":"Scope"},"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id"},"workspace_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Name"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"cancelled":{"type":"integer","title":"Cancelled"},"future_disabled":{"type":"boolean","title":"Future Disabled"},"global_enabled":{"type":"boolean","title":"Global Enabled"}},"type":"object","required":["scope","cancelled","future_disabled","global_enabled"],"title":"AutoRescanStopResponse"},"AutoRescanUpdateRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"AutoRescanUpdateRequest"},"BalanceReport":{"properties":{"prompts_per_theme":{"type":"integer","title":"Prompts Per Theme"},"complete":{"type":"boolean","title":"Complete"},"themes":{"items":{"$ref":"#/components/schemas/BalanceThemeRow"},"type":"array","title":"Themes"},"headline_total":{"type":"integer","title":"Headline Total"},"diagnostic_total":{"type":"integer","title":"Diagnostic Total"},"live_total":{"type":"integer","title":"Live Total"},"perception_total":{"type":"integer","title":"Perception Total"},"comparison_total":{"type":"integer","title":"Comparison Total"}},"type":"object","required":["prompts_per_theme","complete","headline_total","diagnostic_total","live_total","perception_total","comparison_total"],"title":"BalanceReport"},"BalanceThemeRow":{"properties":{"theme_key":{"type":"string","title":"Theme Key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"headline_count":{"type":"integer","title":"Headline Count"},"required":{"type":"integer","title":"Required"},"diagnostic_count":{"type":"integer","title":"Diagnostic Count"},"live_count":{"type":"integer","title":"Live Count"},"shortfall":{"type":"integer","title":"Shortfall"}},"type":"object","required":["theme_key","headline_count","required","diagnostic_count","live_count","shortfall"],"title":"BalanceThemeRow"},"BenchmarkRequest":{"properties":{"domain":{"type":"string","title":"Domain","description":"Domain to benchmark"},"sector":{"type":"string","title":"Sector","description":"Business sector for context"},"locale":{"$ref":"#/components/schemas/LocaleModel","description":"Locale targeting with country (required), region and city (optional)"},"radius_km":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Radius Km","description":"Radius in km for city-level targeting (default: 25)","default":25},"market_scope":{"type":"string","title":"Market Scope","description":"Market scope: 'local', 'regional', or 'national' (default: 'local')","default":"local"},"scope":{"type":"string","title":"Scope","description":"Deprecated: use market_scope instead","default":"local"},"competitors":{"items":{"type":"string"},"type":"array","title":"Competitors","description":"Competitor domains to test against"},"auto_competitors_enabled":{"type":"boolean","title":"Auto Competitors Enabled","description":"Auto-discover market competitors using LLM","default":false},"models":{"items":{"type":"string"},"type":"array","title":"Models","description":"LLM models to test (default: the light OpenAI role, claude-haiku-4-5, gemini-1.5-flash). Retired ids resolve through app.model_registry."},"analysisId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysisid","description":"Optional: Analysis ID to attach results to"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode","description":"Benchmark profile mode: 'default', 'lite', 'deep' (default: 'default')"}},"type":"object","required":["domain","sector","locale"],"title":"BenchmarkRequest","description":"Request to run LLM benchmark tests."},"BlockingIntentDetail":{"properties":{"intent_key":{"type":"string","title":"Intent Key"},"label":{"type":"string","title":"Label"},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question"},"score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Score"},"band":{"type":"string","enum":["none","weak","ok","strong"],"title":"Band"},"journey_phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journey Phase"},"missing_signals":{"items":{"type":"string"},"type":"array","title":"Missing Signals"},"weak_signals":{"items":{"type":"string"},"type":"array","title":"Weak Signals"}},"type":"object","required":["intent_key","label","score","band"],"title":"BlockingIntentDetail","description":"An intent this action unblocks, with its full state."},"Body_upload_avatar_api_v1_auth_me_upload_avatar_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_avatar_api_v1_auth_me_upload_avatar_post"},"Body_upload_logo_api_v1_branding_upload_logo_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_logo_api_v1_branding_upload_logo_post"},"BonusSlotsRequest":{"properties":{"slots":{"anyOf":[{"type":"integer","maximum":500.0,"minimum":0.0},{"type":"null"}],"title":"Slots"},"until":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Until"},"clear_until":{"type":"boolean","title":"Clear Until","default":false},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason"}},"additionalProperties":false,"type":"object","title":"BonusSlotsRequest","description":"Free Brand-slots outside Stripe (PR 3.1b, decision 15.2). ``until`` is\nthe last day they count; leave it out for no end. Fields that are not\nsent keep their value."},"BonusSlotsResponse":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"brand_slots":{"additionalProperties":true,"type":"object","title":"Brand Slots"}},"type":"object","required":["workspace_id","brand_slots"],"title":"BonusSlotsResponse"},"BrainstormResult":{"properties":{"status":{"type":"string","enum":["ok","budget_exceeded","llm_error","parse_error","no_adapter"],"title":"Status"},"cached":{"type":"boolean","title":"Cached","default":false},"queries":{"items":{"$ref":"#/components/schemas/BrainstormedQuery"},"type":"array","title":"Queries"},"model":{"type":"string","title":"Model","default":"gpt-4o-mini"},"cost_cents":{"type":"integer","title":"Cost Cents","default":0},"tokens_in":{"type":"integer","title":"Tokens In","default":0},"tokens_out":{"type":"integer","title":"Tokens Out","default":0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"sector_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector Key"},"language":{"type":"string","title":"Language","default":"nl"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["status"],"title":"BrainstormResult","description":"Stable-shape return type for `brainstorm_queries`."},"BrainstormedQuery":{"properties":{"query":{"type":"string","title":"Query","description":"The conversational question a buyer would ask."},"phase":{"type":"string","title":"Phase","description":"One of the journey phases — lowercased key."},"intent_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent Hint","description":"Optional short label summarizing the underlying need."}},"type":"object","required":["query","phase"],"title":"BrainstormedQuery","description":"A single brainstormed buyer query."},"BrandLayoutEntry":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Name"},"websites":{"items":{"type":"string"},"type":"array","maxItems":20,"minItems":1,"title":"Websites"},"brand_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Id"}},"additionalProperties":false,"type":"object","required":["websites"],"title":"BrandLayoutEntry"},"BrandLayoutRequest":{"properties":{"brands":{"items":{"$ref":"#/components/schemas/BrandLayoutEntry"},"type":"array","maxItems":200,"minItems":1,"title":"Brands"},"websites_per_brand":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Websites Per Brand","default":3},"dry_run":{"type":"boolean","title":"Dry Run","default":true}},"additionalProperties":false,"type":"object","required":["brands"],"title":"BrandLayoutRequest"},"BrandPerception":{"properties":{"summary":{"type":"string","title":"Summary","description":"One-sentence overall view: 'AI sees you as <X>.' Customer-facing copy."},"themes":{"$ref":"#/components/schemas/BrandPerceptionThemes"},"sibling_brands_detected":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Sibling Brands Detected","description":"Other brand names AI mentioned alongside or instead of the scanned brand."},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"LLM-self-reported confidence in the extraction (0.0-1.0).","default":0.5}},"type":"object","required":["summary","themes"],"title":"BrandPerception","description":"Structured AI view of the brand, distilled from AMC raw_text.\n\n``sibling_brands_detected`` flags the multi-brand-domain case (per\nproject memory): when AI confused the scanned brand with another\nbrand on the same domain or a similarly-named one (the canonical\nexample: \"if you meant Finalyse...\"). Surfaces in the UI as a\nmethodology note + a \"scan separately\" suggestion."},"BrandPerceptionResult":{"properties":{"status":{"type":"string","enum":["ok","no_amc_data","error"],"title":"Status","default":"ok"},"brand_name":{"type":"string","title":"Brand Name"},"brand_confidence":{"type":"string","enum":["schema_org","domain_root"],"title":"Brand Confidence"},"domain":{"type":"string","title":"Domain"},"perception":{"anyOf":[{"$ref":"#/components/schemas/BrandPerception"},{"type":"null"}]},"drift":{"items":{"$ref":"#/components/schemas/DriftItem"},"type":"array","title":"Drift"},"computed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Computed At"},"model_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Used"},"cached":{"type":"boolean","title":"Cached","default":false},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["brand_name","brand_confidence","domain"],"title":"BrandPerceptionResult","description":"Top-level response envelope.\n\n``status`` lets the frontend distinguish 'no AMC data yet' from\n'computed successfully' from 'LLM call failed' without overloading\nperception fields with sentinel values."},"BrandPerceptionSourcesReport":{"properties":{"status":{"type":"string","enum":["ok","no_amc_data","no_citations","tier_locked","error"],"title":"Status","default":"ok"},"brand_name":{"type":"string","title":"Brand Name"},"domain":{"type":"string","title":"Domain"},"sources":{"items":{"$ref":"#/components/schemas/SourceAnalysis"},"type":"array","title":"Sources"},"breakdown":{"items":{"$ref":"#/components/schemas/SourceClassBreakdown"},"type":"array","title":"Breakdown"},"computed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Computed At"},"cached":{"type":"boolean","title":"Cached","default":false},"tier_required":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier Required"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["brand_name","domain"],"title":"BrandPerceptionSourcesReport","description":"Top-level response envelope for ``/brand-perception/{id}/sources``.\n\n``status``:\n- ``ok``          — sources analyzed (may have a mix of ok / unavailable / not_about_brand rows)\n- ``no_amc_data`` — no AMC results yet for this analysis\n- ``no_citations`` — AMC ran but produced zero citation URLs\n- ``tier_locked`` — workspace is on Light; Layer 2 is Pro+ only\n- ``error``       — top-level failure (DB, etc.)"},"BrandPerceptionThemes":{"properties":{"positioning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Positioning","description":"One sentence: how AI describes what kind of brand this is."},"services":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Services","description":"What AI thinks the brand does/offers. Max 5 items."},"sector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector","description":"The sector/industry AI places the brand in."},"tone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tone","description":"One word/phrase: how AI characterizes the brand's tone (premium / budget / specialist / generalist / etc.)"},"vs_competitors":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vs Competitors","description":"One sentence: how AI positions the brand relative to competitors (or 'unknown to AI' when there's no comparative signal)."}},"type":"object","title":"BrandPerceptionThemes","description":"Five themes the LLM clusters AI's view of the brand into.\n\nAll fields optional — the LLM returns only what it can confidently\nextract. Empty fields render as \"AI didn't say anything specific\nabout <theme>\" in the UI rather than blanks."},"BrandStatusRequest":{"properties":{"archived":{"type":"boolean","title":"Archived","default":true},"include_websites":{"type":"boolean","title":"Include Websites","default":true},"dry_run":{"type":"boolean","title":"Dry Run","default":true}},"additionalProperties":false,"type":"object","title":"BrandStatusRequest"},"BusinessContext":{"properties":{"core_offering":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Core Offering","description":"What does this business do? e.g. 'AI-powered SEO tool for agencies'"},"audience_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audience Type","description":"Target audience: 'b2b', 'b2c', or 'b2b_b2c'"},"audience_segments":{"items":{"type":"string"},"type":"array","title":"Audience Segments","description":"Specific audience segments (max 5), e.g. 'Dutch local agencies'"},"key_differentiators":{"items":{"type":"string"},"type":"array","title":"Key Differentiators","description":"What makes this business different (max 5 tags)"},"competitors":{"items":{"type":"string"},"type":"array","title":"Competitors","description":"Key competitor domain names (max 5)"},"additional_context":{"anyOf":[{"type":"string","maxLength":1500},{"type":"null"}],"title":"Additional Context","description":"Free-text context the structured fields do not capture"},"detected_sector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detected Sector","description":"Internal: leaf sector key inferred during extraction. Drives scoring rubric, not user-facing."}},"type":"object","title":"BusinessContext","description":"Business context captured on the scan form.\n\nDrafted by ``business_context_extractor`` from a multi-page read of the\ndomain, then reviewed/edited by the user before scan submission. Feeds\nAI Visibility probes, actions, competitor analysis, content gaps, and\nintent generation. Stored in ``raw_analysis[\"business_context\"]`` on the\nAnalysis row."},"ChangePasswordRequest":{"properties":{"old_password":{"type":"string","title":"Old Password"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["old_password","new_password"],"title":"ChangePasswordRequest"},"ChannelSuggestion":{"properties":{"source_type":{"type":"string","title":"Source Type"},"type_label":{"type":"string","title":"Type Label"},"check_mode":{"type":"string","title":"Check Mode"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["source_type","type_label","check_mode","reason"],"title":"ChannelSuggestion","description":"A channel type without a URL: the customer fills it in, so no page is claimed to exist."},"CheckoutRequest":{"properties":{"plan_tier":{"type":"string","title":"Plan Tier"},"billing_cycle":{"type":"string","title":"Billing Cycle","default":"monthly"}},"type":"object","required":["plan_tier"],"title":"CheckoutRequest"},"CheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"}},"type":"object","required":["checkout_url"],"title":"CheckoutResponse"},"CloseStaleResponse":{"properties":{"matched":{"type":"integer","title":"Matched"},"closed":{"type":"integer","title":"Closed"},"dry_run":{"type":"boolean","title":"Dry Run"},"older_than_hours":{"type":"integer","title":"Older Than Hours"},"items":{"items":{"$ref":"#/components/schemas/ClosedJobLogItem"},"type":"array","title":"Items"}},"type":"object","required":["matched","closed","dry_run","older_than_hours","items"],"title":"CloseStaleResponse"},"ClosedJobLogItem":{"properties":{"id":{"type":"string","title":"Id"},"job_type":{"type":"string","title":"Job Type"},"job_ref_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Ref Id"},"worker_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Worker Id"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"age_hours":{"type":"number","title":"Age Hours"}},"type":"object","required":["id","job_type","age_hours"],"title":"ClosedJobLogItem"},"CodeSnippet":{"properties":{"language":{"type":"string","enum":["json","html","javascript","css","text"],"title":"Language"},"label":{"type":"string","title":"Label"},"code":{"type":"string","title":"Code"}},"type":"object","required":["language","label","code"],"title":"CodeSnippet","description":"A code block users paste verbatim (JSON-LD, HTML, meta tags)."},"CompetitorAdvantageDetail":{"properties":{"competitor_name":{"type":"string","title":"Competitor Name"},"intents_won":{"items":{"type":"string"},"type":"array","title":"Intents Won"},"intents_won_labels":{"items":{"type":"string"},"type":"array","title":"Intents Won Labels"},"wins_over_you_reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wins Over You Reasoning"}},"type":"object","required":["competitor_name"],"title":"CompetitorAdvantageDetail","description":"Why a named competitor wins the intent(s) this action addresses.\n\n``wins_over_you_reasoning`` quotes the stored LLM-synthesized\nreasoning from ``competitor_insights_v7`` verbatim — that reasoning\nwas already generated per-domain during AI Competitors analysis and\nis the highest-quality competitive signal we have.\n\n``intents_won_labels`` carries the human-readable names alongside\nthe dotted ``intents_won`` keys so downstream renderers (brief\nsynthesis, frontend) never leak tool-speak into user-facing copy."},"CompetitorIn":{"properties":{"key":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Key","description":"Stable slug; derived from name when omitted"},"name":{"type":"string","maxLength":200,"title":"Name"},"aliases":{"items":{"$ref":"#/components/schemas/AliasIn"},"type":"array","title":"Aliases"},"domain":{"anyOf":[{"type":"string","maxLength":253},{"type":"null"}],"title":"Domain"}},"additionalProperties":false,"type":"object","required":["name"],"title":"CompetitorIn"},"CompetitorScanStartRequest":{"properties":{"analysis_id":{"type":"string","title":"Analysis Id","description":"Primary analysis UUID"},"competitor_domain":{"type":"string","title":"Competitor Domain","description":"Competitor URL or bare domain"}},"type":"object","required":["analysis_id","competitor_domain"],"title":"CompetitorScanStartRequest"},"ConnectionStatusResponse":{"properties":{"connected":{"type":"boolean","title":"Connected","default":false},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"needs_reauth":{"type":"boolean","title":"Needs Reauth","default":false},"selected_property":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Property"},"connected_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected By User Id"},"can_manage":{"type":"boolean","title":"Can Manage","default":false}},"type":"object","title":"ConnectionStatusResponse"},"ContactFormListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ContactFormOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"ContactFormListResponse"},"ContactFormOut":{"properties":{"id":{"type":"string","title":"Id"},"form_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Form Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"website_count":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website Count"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"},"is_read":{"type":"boolean","title":"Is Read","default":false},"is_deleted":{"type":"boolean","title":"Is Deleted","default":false},"submitted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id"],"title":"ContactFormOut"},"ContactFormWebhookPayload":{"properties":{},"additionalProperties":true,"type":"object","title":"ContactFormWebhookPayload","description":"Accept the Gravity Forms webhook payload as-is (all fields optional)."},"ContactRequest":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"message":{"type":"string","title":"Message"},"token":{"type":"string","title":"Token"}},"type":"object","required":["name","email","message","token"],"title":"ContactRequest"},"ContentTemplate":{"properties":{"label":{"type":"string","title":"Label"},"body":{"type":"string","title":"Body"}},"type":"object","required":["label","body"],"title":"ContentTemplate","description":"A copy/page-structure template — outline, not finished content."},"CreateJobRequest":{"properties":{"analysis_id":{"type":"string","title":"Analysis Id","description":"UUID analysis_id"},"prompt_set_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Set Id","description":"Prompt set identifier"},"prompt_set_ids":{"items":{"type":"string"},"type":"array","title":"Prompt Set Ids","description":"(Deprecated) use prompt_set_id"},"max_items":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Items","default":25},"max_tokens":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Tokens","default":5000},"model_id":{"type":"string","minLength":1,"title":"Model Id"},"hard_timeout_seconds":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Hard Timeout Seconds","default":300},"timeout_seconds":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Timeout Seconds","description":"(Deprecated) use hard_timeout_seconds"}},"type":"object","required":["analysis_id","model_id"],"title":"CreateJobRequest"},"CurrentState":{"properties":{"diagnostic_summary":{"type":"string","title":"Diagnostic Summary"},"failing_checks":{"items":{"$ref":"#/components/schemas/FailingCheckDetail"},"type":"array","title":"Failing Checks"},"blocking_intents":{"items":{"$ref":"#/components/schemas/BlockingIntentDetail"},"type":"array","title":"Blocking Intents"},"ai_probe_quotes":{"items":{"$ref":"#/components/schemas/AIProbeQuote"},"type":"array","title":"Ai Probe Quotes"},"gsc_evidence":{"items":{"$ref":"#/components/schemas/GscQueryEvidence"},"type":"array","title":"Gsc Evidence"},"competitor_advantage":{"anyOf":[{"$ref":"#/components/schemas/CompetitorAdvantageDetail"},{"type":"null"}]},"business_context_tie":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Context Tie"}},"type":"object","required":["diagnostic_summary"],"title":"CurrentState","description":"Part 1 — what's wrong right now, extracted from real data.\n\nThe frontend renders these fields under \"WHAT WE OBSERVED\". Every\npopulated field becomes a bullet. Empty lists simply render nothing."},"CustomActionCreateRequest":{"properties":{"pillar":{"type":"string","enum":["entity","content","trust","ai_presence"],"title":"Pillar"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"},"effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effort"}},"additionalProperties":false,"type":"object","required":["pillar","title"],"title":"CustomActionCreateRequest"},"CustomActionResponse":{"properties":{"action_id":{"type":"string","title":"Action Id"},"pillar":{"type":"string","enum":["entity","content","trust","ai_presence"],"title":"Pillar"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"},"effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effort"},"created_by_user_id":{"type":"string","title":"Created By User Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["action_id","pillar","title","created_by_user_id","created_at","updated_at"],"title":"CustomActionResponse"},"CustomActionUpdateRequest":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"},"effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effort"}},"type":"object","title":"CustomActionUpdateRequest"},"CustomActionsListResponse":{"properties":{"actions":{"items":{"$ref":"#/components/schemas/CustomActionResponse"},"type":"array","title":"Actions"}},"type":"object","required":["actions"],"title":"CustomActionsListResponse"},"CustomerType":{"type":"string","enum":["b2c","b2b"],"title":"CustomerType","description":"Type of customer making the query.\n\nAllows differentiation between consumer and business queries:\n- B2C: Business to consumer (homeowners, individuals)\n- B2B: Business to business (property managers, contractors)"},"DashboardKPIsResponse":{"properties":{"total_workspaces":{"type":"integer","title":"Total Workspaces"},"workspaces_change":{"type":"string","title":"Workspaces Change"},"active_users_30d":{"type":"integer","title":"Active Users 30D"},"active_users_change":{"type":"string","title":"Active Users Change"},"total_scans":{"type":"integer","title":"Total Scans"},"scans_change":{"type":"string","title":"Scans Change"},"failed_scans":{"type":"integer","title":"Failed Scans"},"failed_scans_percentage":{"type":"number","title":"Failed Scans Percentage"},"failed_scans_status":{"type":"string","title":"Failed Scans Status"},"queue_depth":{"type":"integer","title":"Queue Depth"},"queue_oldest_age_minutes":{"type":"integer","title":"Queue Oldest Age Minutes"},"queue_health_status":{"type":"string","title":"Queue Health Status"},"system_health":{"$ref":"#/components/schemas/SystemHealthSubmetrics"}},"type":"object","required":["total_workspaces","workspaces_change","active_users_30d","active_users_change","total_scans","scans_change","failed_scans","failed_scans_percentage","failed_scans_status","queue_depth","queue_oldest_age_minutes","queue_health_status","system_health"],"title":"DashboardKPIsResponse","description":"Response for GET /api/admin/dashboard/kpis"},"DashboardMetricsResponse":{"properties":{"cases_total":{"type":"integer","title":"Cases Total"},"analyses_total":{"type":"integer","title":"Analyses Total"},"analyses_completed":{"type":"integer","title":"Analyses Completed"},"analyses_in_progress":{"type":"integer","title":"Analyses In Progress"},"jobs_queued":{"type":"integer","title":"Jobs Queued"},"jobs_running":{"type":"integer","title":"Jobs Running"},"latest_analysis_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Latest Analysis At"},"visibility_avg":{"type":"number","title":"Visibility Avg"},"visibility_delta":{"type":"number","title":"Visibility Delta"},"attention_total":{"type":"integer","title":"Attention Total"},"attention_subtitle":{"type":"string","title":"Attention Subtitle"}},"type":"object","required":["cases_total","analyses_total","analyses_completed","analyses_in_progress","jobs_queued","jobs_running","visibility_avg","visibility_delta","attention_total","attention_subtitle"],"title":"DashboardMetricsResponse","description":"Minimal dashboard metrics for Home/Dashboard snapshot cards."},"DemandDiscoveryResponse":{"properties":{"analysis_id":{"type":"string","title":"Analysis Id"},"domain":{"type":"string","title":"Domain"},"language":{"type":"string","title":"Language"},"total_questions":{"type":"integer","title":"Total Questions"},"total_opportunities":{"type":"integer","title":"Total Opportunities"},"by_category":{"additionalProperties":{"items":{"$ref":"#/components/schemas/DemandQuestion"},"type":"array"},"type":"object","title":"By Category"}},"type":"object","required":["analysis_id","domain","language","total_questions","total_opportunities"],"title":"DemandDiscoveryResponse","description":"Full demand-discovery payload for one analysis."},"DemandQuestion":{"properties":{"seed_intent_key":{"type":"string","title":"Seed Intent Key"},"question_text":{"type":"string","title":"Question Text"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"monthly_volume":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Volume"},"monthly_searches_json":{"items":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"array","title":"Monthly Searches Json"},"citation_status_json":{"additionalProperties":{"type":"string"},"type":"object","title":"Citation Status Json"},"citation_source":{"type":"string","title":"Citation Source","default":"inherited_from_seed"},"cluster_size":{"type":"integer","title":"Cluster Size","default":1},"is_opportunity":{"type":"boolean","title":"Is Opportunity","default":false}},"type":"object","required":["seed_intent_key","question_text"],"title":"DemandQuestion","description":"One canonical demand question — slim API view of IntentDemandQuestion."},"DescriptionSuggestion":{"properties":{"value":{"type":"string","title":"Value","description":"One sentence: when should AI mention or recommend this profile"},"reason":{"type":"string","title":"Reason","description":"Customer-facing, in the profile language: what the sentence was derived from"}},"type":"object","required":["value","reason"],"title":"DescriptionSuggestion"},"DisconnectResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"DisconnectResponse"},"DriftItem":{"properties":{"aspect":{"type":"string","enum":["positioning","services","sector","scope"],"title":"Aspect"},"ai_says":{"type":"string","title":"Ai Says"},"site_says":{"type":"string","title":"Site Says"},"severity":{"type":"string","enum":["high","medium","low"],"title":"Severity","description":"high = AI describes the brand as something materially different (wrong sector, wrong audience). medium = imprecise but in the ballpark. low = small framing difference.","default":"medium"}},"type":"object","required":["aspect","ai_says","site_says"],"title":"DriftItem","description":"A single point of disagreement between AI's view and the site's actual content."},"EmailTemplateIn":{"properties":{"name":{"type":"string","maxLength":128,"title":"Name","description":"Unique human-readable identifier"},"subject":{"type":"string","maxLength":512,"title":"Subject","description":"Subject line (supports {{variable}})"},"body_html":{"type":"string","title":"Body Html","description":"HTML body (supports {{variable}})"},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text","description":"Plain-text fallback (supports {{variable}})"},"variables":{"items":{"type":"string"},"type":"array","title":"Variables","description":"Documented variable names, e.g. ['domain', 'workspace_name']"}},"type":"object","required":["name","subject","body_html"],"title":"EmailTemplateIn"},"EmailTemplateOut":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"subject":{"type":"string","title":"Subject"},"body_html":{"type":"string","title":"Body Html"},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"variables":{"items":{"type":"string"},"type":"array","title":"Variables"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","name","subject","body_html","body_text","variables","created_at","updated_at"],"title":"EmailTemplateOut"},"EnrichPaaRequest":{"properties":{"intent_id":{"type":"string","title":"Intent Id"}},"type":"object","required":["intent_id"],"title":"EnrichPaaRequest"},"ErrorItem":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"timestamp":{"type":"string","title":"Timestamp"},"error_type":{"type":"string","title":"Error Type"},"message":{"type":"string","title":"Message"},"affected_resource":{"type":"string","title":"Affected Resource"},"severity":{"type":"string","title":"Severity"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"},"stack_trace":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stack Trace"}},"type":"object","required":["id","timestamp","error_type","message","affected_resource","severity","count","stack_trace"],"title":"ErrorItem","description":"Individual error in list."},"ErrorRateData":{"properties":{"total_errors_24h":{"type":"integer","title":"Total Errors 24H"},"trend":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Trend"},"top_errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Top Errors"}},"type":"object","required":["total_errors_24h","trend","top_errors"],"title":"ErrorRateData","description":"Error rate metrics."},"ErrorsListResponse":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/ErrorItem"},"type":"array","title":"Errors"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["errors","total","page","limit"],"title":"ErrorsListResponse","description":"Response for GET /api/admin/errors"},"ExpectedImpact":{"properties":{"intents_unblocked":{"items":{"type":"string"},"type":"array","title":"Intents Unblocked"},"checks_resolved":{"items":{"type":"string"},"type":"array","title":"Checks Resolved"},"projected_score_uplift":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Projected Score Uplift"},"affected_pillars":{"items":{"type":"string"},"type":"array","title":"Affected Pillars"}},"type":"object","title":"ExpectedImpact","description":"Part 4 — what changes if the user completes this action."},"FailingCheckDetail":{"properties":{"check_key":{"type":"string","title":"Check Key"},"pillar":{"type":"string","title":"Pillar"},"status":{"type":"string","enum":["warn","fail"],"title":"Status"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"details":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Details"},"diagnostics":{"additionalProperties":true,"type":"object","title":"Diagnostics"}},"type":"object","required":["check_key","pillar","status"],"title":"FailingCheckDetail","description":"One specific failing check with its raw diagnostics dict.\n\n``diagnostics`` is the exact dict the check emitted — the UI surfaces\nit verbatim so users see the ground-truth numbers (word counts,\nelement counts, URL patterns). Never paraphrased."},"FailureBreakdownItem":{"properties":{"error_type":{"type":"string","title":"Error Type"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["error_type","count"],"title":"FailureBreakdownItem","description":"Error type count."},"FixItem":{"properties":{"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key","description":"Optional evidence key this fix addresses"},"title":{"type":"string","title":"Title","description":"Human-readable fix title","default":""},"impact":{"type":"string","enum":["high","medium","low"],"title":"Impact"},"effort":{"type":"string","enum":["high","medium","low"],"title":"Effort"},"steps":{"items":{"type":"string"},"type":"array","title":"Steps"}},"type":"object","required":["impact","effort","steps"],"title":"FixItem","description":"Single fix/recommendation item for an intent gap."},"ForecastAddonBreakdown":{"properties":{"total_addon_domain_units":{"type":"integer","title":"Total Addon Domain Units"},"total_addon_seat_units":{"type":"integer","title":"Total Addon Seat Units"},"domain_monthly_unit_price_cents":{"type":"integer","title":"Domain Monthly Unit Price Cents"},"seat_monthly_unit_price_cents":{"type":"integer","title":"Seat Monthly Unit Price Cents"},"total_addon_brand_units":{"type":"integer","title":"Total Addon Brand Units","default":0},"brand_monthly_unit_price_cents":{"additionalProperties":true,"type":"object","title":"Brand Monthly Unit Price Cents","default":{}},"mrr_cents":{"type":"integer","title":"Mrr Cents"}},"type":"object","required":["total_addon_domain_units","total_addon_seat_units","domain_monthly_unit_price_cents","seat_monthly_unit_price_cents","mrr_cents"],"title":"ForecastAddonBreakdown","description":"Aggregated add-on revenue across all active workspaces."},"ForecastResponse":{"properties":{"generated_at":{"type":"string","title":"Generated At"},"currency":{"type":"string","title":"Currency"},"tiers":{"items":{"$ref":"#/components/schemas/ForecastTierBreakdown"},"type":"array","title":"Tiers"},"addons":{"$ref":"#/components/schemas/ForecastAddonBreakdown"},"total_active_subscriptions":{"type":"integer","title":"Total Active Subscriptions"},"total_trialing_subscriptions":{"type":"integer","title":"Total Trialing Subscriptions"},"total_past_due_subscriptions":{"type":"integer","title":"Total Past Due Subscriptions"},"base_mrr_cents":{"type":"integer","title":"Base Mrr Cents"},"addon_mrr_cents":{"type":"integer","title":"Addon Mrr Cents"},"total_mrr_cents":{"type":"integer","title":"Total Mrr Cents"},"total_arr_cents":{"type":"integer","title":"Total Arr Cents"},"pipeline_mrr_cents":{"type":"integer","title":"Pipeline Mrr Cents"},"data_source":{"type":"string","title":"Data Source"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","required":["generated_at","currency","tiers","addons","total_active_subscriptions","total_trialing_subscriptions","total_past_due_subscriptions","base_mrr_cents","addon_mrr_cents","total_mrr_cents","total_arr_cents","pipeline_mrr_cents","data_source","notes"],"title":"ForecastResponse","description":"Revenue forecast based on current subscribers.\n\nAll monetary amounts are in the smallest currency unit (cents).\nMRR figures cover active subscribers only; trialing is shown separately\nas pipeline. Annual-billed workspaces use the same monthly unit price\n(see notes)."},"ForecastTierBreakdown":{"properties":{"tier":{"type":"string","title":"Tier"},"count_active":{"type":"integer","title":"Count Active"},"count_trialing":{"type":"integer","title":"Count Trialing"},"count_past_due":{"type":"integer","title":"Count Past Due"},"monthly_unit_price_cents":{"type":"integer","title":"Monthly Unit Price Cents"},"mrr_cents":{"type":"integer","title":"Mrr Cents"},"workspaces":{"items":{"$ref":"#/components/schemas/ForecastWorkspace"},"type":"array","title":"Workspaces"}},"type":"object","required":["tier","count_active","count_trialing","count_past_due","monthly_unit_price_cents","mrr_cents","workspaces"],"title":"ForecastTierBreakdown","description":"MRR breakdown for a single pricing tier."},"ForecastWorkspace":{"properties":{"name":{"type":"string","title":"Name"},"subscription_status":{"type":"string","title":"Subscription Status"},"subscribed_since":{"type":"string","title":"Subscribed Since"},"days_active":{"type":"integer","title":"Days Active"},"addon_domains":{"type":"integer","title":"Addon Domains"},"addon_seats":{"type":"integer","title":"Addon Seats"},"addon_brands":{"type":"integer","title":"Addon Brands","default":0},"bonus_brand_slots":{"type":"integer","title":"Bonus Brand Slots","default":0},"mrr_cents":{"type":"integer","title":"Mrr Cents"}},"type":"object","required":["name","subscription_status","subscribed_since","days_active","addon_domains","addon_seats","mrr_cents"],"title":"ForecastWorkspace","description":"Per-workspace summary inside a tier breakdown."},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","title":"Email"},"captchaToken":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Captchatoken"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"GscPropertyItem":{"properties":{"site_url":{"type":"string","title":"Site Url"},"permission_level":{"type":"string","title":"Permission Level"}},"type":"object","required":["site_url","permission_level"],"title":"GscPropertyItem"},"GscQueryEvidence":{"properties":{"query":{"type":"string","title":"Query"},"impressions":{"type":"integer","title":"Impressions"},"clicks":{"type":"integer","title":"Clicks"},"ctr":{"type":"number","title":"Ctr"},"position":{"type":"number","title":"Position"},"matched_intent_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Intent Key"}},"type":"object","required":["query","impressions","clicks","ctr","position"],"title":"GscQueryEvidence","description":"A real search-query row from Search Console, scoped to this action."},"GscQueryRef":{"properties":{"query":{"type":"string","title":"Query"},"clicks":{"type":"integer","title":"Clicks","default":0},"impressions":{"type":"integer","title":"Impressions","default":0},"ctr":{"type":"number","title":"Ctr","default":0.0},"position":{"type":"number","title":"Position","default":0.0},"match_score":{"type":"number","title":"Match Score","default":0.0}},"type":"object","required":["query"],"title":"GscQueryRef","description":"Reference to a single GSC query with its metrics."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HeadlessRenderSummary":{"properties":{"spa_detected":{"type":"boolean","title":"Spa Detected","default":false},"triggered":{"type":"boolean","title":"Triggered","default":false},"pages_rendered":{"type":"integer","title":"Pages Rendered","default":0},"pages_failed":{"type":"integer","title":"Pages Failed","default":0},"total_render_seconds":{"type":"number","title":"Total Render Seconds","default":0.0},"bot_wall_count":{"type":"integer","title":"Bot Wall Count","default":0},"spa_indicators":{"items":{"type":"string"},"type":"array","title":"Spa Indicators"}},"type":"object","title":"HeadlessRenderSummary","description":"Condensed SPA-rendering telemetry surfaced to the Action Plan UI.\n\nSourced from ``raw_analysis[\"headless_render_stats\"]`` populated by\nthe crawler pipeline (PR #200). The UI uses this to render the\n\"SPA rendered\" badge + \"bot protection detected\" warning so users\ncan see that the headless crawler was active (or why their scan\ntook longer than usual).\n\n``None`` fields = the stat wasn't captured on this scan (older\nscan predating PR #200, or the stat wasn't populated for some\nreason). The UI hides the badge entirely when the whole object\nis None or ``spa_detected`` is False."},"HighFailureWorkspaceItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"total_scans":{"type":"integer","title":"Total Scans"},"failed_scans":{"type":"integer","title":"Failed Scans"},"failure_rate":{"type":"number","title":"Failure Rate"}},"type":"object","required":["id","name","total_scans","failed_scans","failure_rate"],"title":"HighFailureWorkspaceItem","description":"Workspace with high failure rate."},"HighFailureWorkspacesResponse":{"properties":{"workspaces":{"items":{"$ref":"#/components/schemas/HighFailureWorkspaceItem"},"type":"array","title":"Workspaces"}},"type":"object","required":["workspaces"],"title":"HighFailureWorkspacesResponse","description":"Response for GET /api/admin/dashboard/high-failure-workspaces"},"HistoryEntry":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"},"presence_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Presence Pct"},"answered":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Answered"},"mentioned":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mentioned"},"share_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Share Pct"},"perception_mentioned":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Perception Mentioned"},"comparability":{"additionalProperties":{"type":"string"},"type":"object","title":"Comparability"},"breaks":{"items":{"type":"string"},"type":"array","title":"Breaks","description":"Series that are not comparable with the previous run"},"measurement_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Measurement Hash"},"competition_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Competition Hash"},"perception_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Perception Hash"},"model_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Fingerprint"},"source_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Hash"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"channels":{"items":{"type":"string"},"type":"array","title":"Channels"}},"type":"object","required":["run_id","status"],"title":"HistoryEntry"},"HistoryResponse":{"properties":{"profile_id":{"type":"string","title":"Profile Id"},"entries":{"items":{"$ref":"#/components/schemas/HistoryEntry"},"type":"array","title":"Entries"}},"type":"object","required":["profile_id"],"title":"HistoryResponse"},"HooksResponse":{"properties":{"action_id":{"type":"string","title":"Action Id"},"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status","description":"ready | unavailable_no_description | not_applicable | failed"},"cached":{"type":"boolean","title":"Cached","default":false},"hooks":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Hooks"}},"type":"object","required":["action_id","run_id","status"],"title":"HooksResponse"},"ImproveExistingItem":{"properties":{"intent_key":{"type":"string","title":"Intent Key"},"label":{"type":"string","title":"Label"},"current_band":{"type":"string","enum":["ok","strong"],"title":"Current Band"},"current_score":{"type":"number","title":"Current Score"},"weak_signals":{"items":{"type":"string"},"type":"array","title":"Weak Signals"},"suggestion":{"type":"string","title":"Suggestion"}},"type":"object","required":["intent_key","label","current_band","current_score","suggestion"],"title":"ImproveExistingItem","description":"A polish move on an intent already at ``ok`` band.\n\nRendered as a distinct compact section below the 6 themes, not as a\nfull ``OptimizationAction`` — these are tighter-wins, not strategic\nshifts."},"InstructionStep":{"properties":{"number":{"type":"integer","title":"Number"},"title":{"type":"string","title":"Title"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["number","title"],"title":"InstructionStep","description":"One numbered step in the prescriptive recipe.\n\n``detail`` may include template values that the recipe pre-filled\nfrom ``business_context`` (e.g. plan names, competitor names)."},"InsufficientRule":{"properties":{"rule_key":{"type":"string","title":"Rule Key"},"n":{"type":"integer","title":"N"},"min_n":{"type":"integer","title":"Min N"},"segment":{"type":"string","title":"Segment"}},"type":"object","required":["rule_key","n","min_n","segment"],"title":"InsufficientRule"},"IntentDiagnosis":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"journey_phase":{"type":"string","title":"Journey Phase"},"question":{"type":"string","title":"Question"},"score":{"type":"number","title":"Score"},"band":{"type":"string","title":"Band"},"ai_can_answer":{"type":"boolean","title":"Ai Can Answer","default":false},"missing_signals":{"items":{"type":"string"},"type":"array","title":"Missing Signals"},"weak_signals":{"items":{"type":"string"},"type":"array","title":"Weak Signals"},"has_blocker":{"type":"boolean","title":"Has Blocker","default":false},"blocker_reasons":{"items":{"type":"string"},"type":"array","title":"Blocker Reasons"},"dimensions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Dimensions"},"customer_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Type"},"project_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Type"}},"type":"object","required":["id","label","journey_phase","question","score","band"],"title":"IntentDiagnosis","description":"Full per-intent view surfaced on the Search Insights page.\n\nMirrors the relevant fields from `IntentResultV2` but flat-JSON-friendly\nand tolerant of envelope drift (unknown fields on the envelope are\nignored by Pydantic's default behavior)."},"IntentDimensionResult":{"properties":{"name":{"type":"string","title":"Name","description":"Dimension name (matches config)"},"score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Score","description":"Dimension score (0-100)"},"band":{"type":"string","title":"Band","description":"Categorization: 'none' | 'weak' | 'ok' | 'strong'"},"details":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Details","description":"Optional explanation or context"}},"type":"object","required":["name","score","band"],"title":"IntentDimensionResult","description":"Evaluation result for a single dimension within an intent.\n\nRepresents the score and band for one aspect of intent evaluation.\n\nExample:\n    IntentDimensionResult(\n        name=\"coverage\",\n        score=75.0,\n        band=\"strong\",\n        details=\"Pricing page found with clear price list\"\n    )"},"IntentMatch":{"properties":{"intent_id":{"type":"string","title":"Intent Id"},"label":{"type":"string","title":"Label"},"band":{"type":"string","title":"Band"},"journey_phase":{"type":"string","title":"Journey Phase"},"matched_query_count":{"type":"integer","title":"Matched Query Count","default":0},"real_world":{"$ref":"#/components/schemas/RealWorldStats"},"top_matches":{"items":{"$ref":"#/components/schemas/GscQueryRef"},"type":"array","title":"Top Matches"}},"type":"object","required":["intent_id","label","band","journey_phase"],"title":"IntentMatch","description":"One row in the intent coverage table — one per envelope intent."},"IntentResultV2":{"properties":{"id":{"type":"string","title":"Id","description":"Intent ID (matches config)"},"label":{"type":"string","title":"Label","description":"Human-readable label"},"journey_phase":{"$ref":"#/components/schemas/JourneyPhase","description":"awareness | consideration | decision | post_purchase"},"customer_type":{"anyOf":[{"$ref":"#/components/schemas/CustomerType"},{"type":"null"}],"description":"b2c | b2b | None"},"project_type":{"anyOf":[{"$ref":"#/components/schemas/ProjectType"},{"type":"null"}],"description":"Construction project type (sector-specific)"},"question":{"type":"string","title":"Question","description":"Resolved question with placeholders filled (e.g., city, subtype replaced)"},"score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Score","description":"Overall intent score (0-100)"},"band":{"type":"string","enum":["none","weak","ok","strong"],"title":"Band","description":"Categorization based on bands: none (<weak), weak, ok, strong"},"ai_can_answer":{"type":"boolean","title":"Ai Can Answer","description":"Whether AI models can confidently answer this intent (typically band >= 'ok' and no blockers)"},"dimensions":{"items":{"$ref":"#/components/schemas/IntentDimensionResult"},"type":"array","title":"Dimensions","description":"Breakdown by dimension (coverage, depth, proof, clarity, etc.)"},"missing_signals":{"items":{"type":"string"},"type":"array","title":"Missing Signals","description":"List of signal_keys that are missing or below threshold"},"weak_signals":{"items":{"type":"string"},"type":"array","title":"Weak Signals","description":"List of signal_keys that are present but weak (partial pass)"},"has_blocker":{"type":"boolean","title":"Has Blocker","description":"Whether a critical blocker was triggered","default":false},"blocker_reasons":{"items":{"type":"string"},"type":"array","title":"Blocker Reasons","description":"Human-readable explanations for blockers that were triggered"},"model_support_score":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Model Support Score","description":"ML-based calibration score (future feature, not yet implemented)"},"competitor_gap_score":{"anyOf":[{"type":"number","maximum":100.0,"minimum":-100.0},{"type":"null"}],"title":"Competitor Gap Score","description":"Score relative to competitors (future feature: negative = behind, positive = ahead)"},"version":{"type":"string","title":"Version","description":"Result schema version","default":"v2.0"}},"type":"object","required":["id","label","journey_phase","question","score","band","ai_can_answer","dimensions"],"title":"IntentResultV2","description":"Journey-based intent evaluation result.\n\nComplete evaluation outcome for one intent, including:\n- Journey context (phase, customer type, project type)\n- Resolved question from template\n- Overall score and band\n- Dimension-level breakdown\n- Gap analysis (missing/weak signals)\n- Blocker detection\n- Future extension fields (ML, competitor gaps)\n\nExample:\n    IntentResultV2(\n        id=\"construction.pricing_quote\",\n        label=\"Pricing & Quote Request\",\n        journey_phase=JourneyPhase.CONSIDERATION,\n        customer_type=CustomerType.B2C,\n        project_type=ProjectType.RENOVATION,\n        question=\"Wat kost het om renovatie te laten uitvoeren door een bouwbedrijf in Amsterdam?\",\n        score=65.0,\n        band=\"ok\",\n        ai_can_answer=True,\n        dimensions=[...],\n        missing_signals=[\"price_ranges_mentioned\"],\n        weak_signals=[\"example_projects_with_prices\"],\n        has_blocker=False,\n        blocker_reasons=[],\n        version=\"v2.0\"\n    )"},"IntentResultsEnvelope":{"properties":{"version":{"type":"string","title":"Version","description":"Intent scoring version","default":"v1"},"sectorKey":{"type":"string","title":"Sectorkey","description":"Sector identifier (e.g. 'restaurants')"},"subtype":{"type":"string","title":"Subtype","description":"Sector subtype (e.g. 'Italian')"},"overallIntentScore":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Overallintentscore","description":"Overall intent coverage score 0-100"},"intents":{"items":{"$ref":"#/components/schemas/IntentScoreItem"},"type":"array","title":"Intents","description":"Scored intents for this sector"},"prioritizedIntents":{"items":{"$ref":"#/components/schemas/PrioritizedIntent"},"type":"array","title":"Prioritizedintents","description":"Intents sorted by priority"},"evidenceHits":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Evidencehits","description":"Evidence hit counts across all intents"}},"type":"object","required":["sectorKey","subtype","overallIntentScore","intents"],"title":"IntentResultsEnvelope","description":"Complete intent analysis results envelope.\nStable schema exported to frontend."},"IntentResultsV2Envelope":{"properties":{"version":{"type":"string","title":"Version","description":"Results schema version","default":"v2.0"},"sector_key":{"type":"string","title":"Sector Key","description":"Sector identifier (e.g., 'construction')"},"subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtype","description":"Sector subtype (e.g., 'construction_company')"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"Target city for localized questions"},"overall_score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Overall Score","description":"Average score across all applicable intents"},"intents":{"items":{"$ref":"#/components/schemas/IntentResultV2"},"type":"array","title":"Intents","description":"Individual intent evaluation results"},"total_intents":{"type":"integer","title":"Total Intents","description":"Total number of intents evaluated"},"strong_intents":{"type":"integer","title":"Strong Intents","description":"Count of intents with 'strong' band","default":0},"ok_intents":{"type":"integer","title":"Ok Intents","description":"Count of intents with 'ok' band","default":0},"weak_intents":{"type":"integer","title":"Weak Intents","description":"Count of intents with 'weak' band","default":0},"none_intents":{"type":"integer","title":"None Intents","description":"Count of intents with 'none' band","default":0}},"type":"object","required":["sector_key","overall_score","intents","total_intents"],"title":"IntentResultsV2Envelope","description":"Container for all intent v2 results for a scan.\n\nTop-level envelope that holds all intent evaluation results plus summary statistics.\nThis is what gets stored in Analysis.intent_results_v2 and returned via API.\n\nExample:\n    IntentResultsV2Envelope(\n        version=\"v2.0\",\n        sector_key=\"construction\",\n        subtype=\"construction_company\",\n        city=\"Amsterdam\",\n        overall_score=62.5,\n        intents=[...],\n        total_intents=6,\n        strong_intents=2,\n        ok_intents=2,\n        weak_intents=1,\n        none_intents=1\n    )"},"IntentScoreItem":{"properties":{"intentKey":{"type":"string","title":"Intentkey","description":"Intent identifier (e.g. 'local_discovery')"},"intentName":{"type":"string","title":"Intentname","description":"Human-readable intent name"},"intentScore":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Intentscore","description":"Intent score 0-100"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Confidence in score 0-1"},"familyScores":{"additionalProperties":{"type":"number"},"type":"object","title":"Familyscores","description":"Scores per evidence family (content, entity, etc.)"},"evidenceHits":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"additionalProperties":{"type":"integer"},"type":"object"}],"title":"Evidencehits","description":"Evidence items found (list of keys or dict with counts)"},"topGaps":{"items":{"type":"string"},"type":"array","title":"Topgaps","description":"Top gaps/missing evidence"},"causalChain":{"items":{"type":"string"},"type":"array","title":"Causalchain","description":"Causal explanation chain"},"soWhatPerModel":{"additionalProperties":{"type":"string"},"type":"object","title":"Sowhatpermodel","description":"Impact per AI model (gpt, claude, gemini)"},"fixes":{"items":{"$ref":"#/components/schemas/FixItem"},"type":"array","title":"Fixes","description":"Recommended fixes for gaps"},"exampleQuestions":{"items":{"type":"string"},"type":"array","title":"Examplequestions","description":"Example AI queries for this intent"},"weights":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Weights","description":"Optional legacy weights field for backward compatibility"}},"type":"object","required":["intentKey","intentName","intentScore","confidence","familyScores"],"title":"IntentScoreItem","description":"Score and analysis for a single intent."},"InvitationCreate":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"member"},"profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Id"}},"type":"object","required":["email"],"title":"InvitationCreate"},"InvitationResponse":{"properties":{"id":{"type":"string","title":"Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Id"},"invited_by_user_id":{"type":"string","title":"Invited By User Id"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["id","workspace_id","email","role","invited_by_user_id","status","created_at","expires_at"],"title":"InvitationResponse"},"JobItem":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"status":{"type":"string","title":"Status"},"queued_at":{"type":"string","title":"Queued At"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","required":["id","type","domain","status","queued_at","started_at","duration_seconds"],"title":"JobItem","description":"Individual job in queue."},"JobStats":{"properties":{"queue_depth":{"type":"integer","title":"Queue Depth"},"avg_wait_time_seconds":{"type":"number","title":"Avg Wait Time Seconds"},"avg_processing_time_seconds":{"type":"number","title":"Avg Processing Time Seconds"},"worker_utilization_percent":{"type":"number","title":"Worker Utilization Percent"}},"type":"object","required":["queue_depth","avg_wait_time_seconds","avg_processing_time_seconds","worker_utilization_percent"],"title":"JobStats","description":"Queue statistics."},"JobsListResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/JobItem"},"type":"array","title":"Jobs"},"stats":{"$ref":"#/components/schemas/JobStats"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["jobs","stats","total","page","limit"],"title":"JobsListResponse","description":"Response for GET /api/admin/jobs"},"JourneyPhase":{"type":"string","enum":["awareness","consideration","decision","post_purchase"],"title":"JourneyPhase","description":"Customer journey phase where the intent occurs.\n\nMaps search intents to stages in the customer decision process:\n- AWARENESS: Discovery, problem recognition (\"I need a renovation\")\n- CONSIDERATION: Evaluation, comparison (\"Which contractor is best?\")\n- DECISION: Final selection, booking (\"Get a quote\", \"Book now\")\n- POST_PURCHASE: Loyalty, advocacy, support (\"Leave a review\")"},"LeadContactUpdate":{"properties":{"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"contact_company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Company"},"contacts":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Contacts"}},"type":"object","title":"LeadContactUpdate"},"LeadScanRequest":{"properties":{"domain":{"type":"string","title":"Domain"},"sector_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector Key"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"}},"type":"object","required":["domain"],"title":"LeadScanRequest"},"LlmCostSummaryResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/LlmCostSummaryRow"},"type":"array","title":"Rows"},"grand_total_calls":{"type":"integer","title":"Grand Total Calls"},"grand_total_tokens":{"type":"integer","title":"Grand Total Tokens"},"grand_total_cost_usd":{"type":"number","title":"Grand Total Cost Usd"}},"type":"object","required":["rows","grand_total_calls","grand_total_tokens","grand_total_cost_usd"],"title":"LlmCostSummaryResponse"},"LlmCostSummaryRow":{"properties":{"provider":{"type":"string","title":"Provider"},"model_key":{"type":"string","title":"Model Key"},"total_calls":{"type":"integer","title":"Total Calls"},"total_tokens_in":{"type":"integer","title":"Total Tokens In"},"total_tokens_out":{"type":"integer","title":"Total Tokens Out"},"total_tokens":{"type":"integer","title":"Total Tokens"},"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"price_per_1k_input_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Per 1K Input Usd"},"price_per_1k_output_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Per 1K Output Usd"}},"type":"object","required":["provider","model_key","total_calls","total_tokens_in","total_tokens_out","total_tokens","total_cost_usd"],"title":"LlmCostSummaryRow"},"LlmDailyPoint":{"properties":{"date":{"type":"string","title":"Date"},"calls":{"type":"integer","title":"Calls"},"tokens_in":{"type":"integer","title":"Tokens In"},"tokens_out":{"type":"integer","title":"Tokens Out"},"cost_usd":{"type":"number","title":"Cost Usd"}},"type":"object","required":["date","calls","tokens_in","tokens_out","cost_usd"],"title":"LlmDailyPoint","description":"One data point for a daily time-series graph."},"LlmDashboardPeriodStats":{"properties":{"period":{"type":"string","title":"Period"},"total_calls":{"type":"integer","title":"Total Calls"},"total_tokens_in":{"type":"integer","title":"Total Tokens In"},"total_tokens_out":{"type":"integer","title":"Total Tokens Out"},"total_tokens":{"type":"integer","title":"Total Tokens"},"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"failed_calls":{"type":"integer","title":"Failed Calls"}},"type":"object","required":["period","total_calls","total_tokens_in","total_tokens_out","total_tokens","total_cost_usd","failed_calls"],"title":"LlmDashboardPeriodStats","description":"Aggregated stats for a single time window."},"LlmDashboardResponse":{"properties":{"last_30_days":{"$ref":"#/components/schemas/LlmDashboardPeriodStats"},"last_365_days":{"$ref":"#/components/schemas/LlmDashboardPeriodStats"},"all_time":{"$ref":"#/components/schemas/LlmDashboardPeriodStats"},"daily_last_30_days":{"items":{"$ref":"#/components/schemas/LlmDailyPoint"},"type":"array","title":"Daily Last 30 Days"},"monthly_last_12_months":{"items":{"$ref":"#/components/schemas/LlmMonthlyPoint"},"type":"array","title":"Monthly Last 12 Months"},"model_breakdown_30d":{"items":{"$ref":"#/components/schemas/LlmModelBreakdown"},"type":"array","title":"Model Breakdown 30D"},"model_breakdown_all":{"items":{"$ref":"#/components/schemas/LlmModelBreakdown"},"type":"array","title":"Model Breakdown All"}},"type":"object","required":["last_30_days","last_365_days","all_time","daily_last_30_days","monthly_last_12_months","model_breakdown_30d","model_breakdown_all"],"title":"LlmDashboardResponse","description":"Single endpoint returning everything the admin cost dashboard needs."},"LlmModelBreakdown":{"properties":{"model_key":{"type":"string","title":"Model Key"},"provider":{"type":"string","title":"Provider"},"calls":{"type":"integer","title":"Calls"},"tokens_in":{"type":"integer","title":"Tokens In"},"tokens_out":{"type":"integer","title":"Tokens Out"},"cost_usd":{"type":"number","title":"Cost Usd"},"cost_share_pct":{"type":"number","title":"Cost Share Pct"}},"type":"object","required":["model_key","provider","calls","tokens_in","tokens_out","cost_usd","cost_share_pct"],"title":"LlmModelBreakdown","description":"Per-model share of costs / calls for a given period."},"LlmMonthlyPoint":{"properties":{"month":{"type":"string","title":"Month"},"calls":{"type":"integer","title":"Calls"},"tokens_in":{"type":"integer","title":"Tokens In"},"tokens_out":{"type":"integer","title":"Tokens Out"},"cost_usd":{"type":"number","title":"Cost Usd"}},"type":"object","required":["month","calls","tokens_in","tokens_out","cost_usd"],"title":"LlmMonthlyPoint","description":"One data point for a monthly time-series graph."},"LlmPricingCreateRequest":{"properties":{"model_key":{"type":"string","maxLength":128,"minLength":1,"title":"Model Key"},"provider":{"type":"string","maxLength":64,"minLength":1,"title":"Provider"},"price_per_1k_input_usd":{"type":"number","minimum":0.0,"title":"Price Per 1K Input Usd"},"price_per_1k_output_usd":{"type":"number","minimum":0.0,"title":"Price Per 1K Output Usd"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["model_key","provider","price_per_1k_input_usd","price_per_1k_output_usd"],"title":"LlmPricingCreateRequest"},"LlmPricingItem":{"properties":{"id":{"type":"string","title":"Id"},"model_key":{"type":"string","title":"Model Key"},"provider":{"type":"string","title":"Provider"},"price_per_1k_input_usd":{"type":"number","title":"Price Per 1K Input Usd"},"price_per_1k_output_usd":{"type":"number","title":"Price Per 1K Output Usd"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_active":{"type":"boolean","title":"Is Active"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","model_key","provider","price_per_1k_input_usd","price_per_1k_output_usd","is_active"],"title":"LlmPricingItem"},"LlmPricingListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/LlmPricingItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"LlmPricingListResponse"},"LlmPricingUpdateRequest":{"properties":{"price_per_1k_input_usd":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Price Per 1K Input Usd"},"price_per_1k_output_usd":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Price Per 1K Output Usd"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"LlmPricingUpdateRequest"},"LocaleModel":{"properties":{"country":{"type":"string","title":"Country","description":"Country code (e.g. 'NL', 'BE')"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region","description":"Region/province name"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"City name"}},"type":"object","required":["country"],"title":"LocaleModel","description":"Locale information for benchmark targeting."},"LoginRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"captchaToken":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Captchatoken"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"MailQueueItem":{"properties":{"id":{"type":"string","title":"Id"},"to_email":{"type":"string","title":"To Email"},"subject":{"type":"string","title":"Subject"},"email_type":{"type":"string","title":"Email Type"},"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"scheduled_at":{"type":"string","title":"Scheduled At"},"queued_by":{"type":"string","title":"Queued By"},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type"},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Id"},"status":{"type":"string","title":"Status"},"sent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent At"},"cancelled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancelled At"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"retry_count":{"type":"integer","title":"Retry Count","default":0},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","to_email","subject","email_type","scheduled_at","queued_by","status","created_at"],"title":"MailQueueItem","description":"A single row from the central mail_queue table (used by cancel endpoint)."},"MatchResult":{"properties":{"intent_coverage":{"items":{"$ref":"#/components/schemas/IntentMatch"},"type":"array","title":"Intent Coverage"},"unmatched_queries":{"items":{"$ref":"#/components/schemas/GscQueryRef"},"type":"array","title":"Unmatched Queries"},"match_threshold":{"type":"number","title":"Match Threshold","default":0.3},"total_queries_analyzed":{"type":"integer","title":"Total Queries Analyzed","default":0}},"type":"object","title":"MatchResult","description":"Complete output of ``match_queries_to_intents``."},"ModelLimitsByTier":{"properties":{"demo":{"$ref":"#/components/schemas/TierModelLimit"},"light":{"$ref":"#/components/schemas/TierModelLimit"},"pro":{"$ref":"#/components/schemas/TierModelLimit"},"agency":{"$ref":"#/components/schemas/TierModelLimit"}},"additionalProperties":false,"type":"object","required":["demo","light","pro","agency"],"title":"ModelLimitsByTier"},"ModelLimitsByTierPatch":{"properties":{"demo":{"anyOf":[{"$ref":"#/components/schemas/TierModelLimitPatch"},{"type":"null"}]},"light":{"anyOf":[{"$ref":"#/components/schemas/TierModelLimitPatch"},{"type":"null"}]},"pro":{"anyOf":[{"$ref":"#/components/schemas/TierModelLimitPatch"},{"type":"null"}]},"agency":{"anyOf":[{"$ref":"#/components/schemas/TierModelLimitPatch"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"ModelLimitsByTierPatch"},"ModelSettingsPatch":{"properties":{"thinking":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thinking"},"effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effort"}},"type":"object","title":"ModelSettingsPatch"},"MonitoringResponse":{"properties":{"error_rate":{"$ref":"#/components/schemas/ErrorRateData"},"performance":{"$ref":"#/components/schemas/PerformanceData"},"uptime":{"$ref":"#/components/schemas/UptimeData"},"worker_last_tick_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Worker Last Tick At"},"worker_alive":{"type":"boolean","title":"Worker Alive","default":false}},"type":"object","required":["error_rate","performance","uptime"],"title":"MonitoringResponse","description":"Response for GET /api/admin/dashboard/monitoring"},"NotificationItem":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"actor_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor User Id"},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"},"profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Id"},"action_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Id"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"task_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Title"},"has_note":{"type":"boolean","title":"Has Note","default":false},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Read At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","type"],"title":"NotificationItem"},"OpportunityEvidenceOut":{"properties":{"type":{"type":"string","title":"Type"},"path":{"type":"string","title":"Path"},"value":{"title":"Value"},"numerator":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numerator"},"denominator":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Denominator"},"comparison_value":{"title":"Comparison Value"},"theme_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Key"},"theme_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Label"},"competitor_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Competitor Key"},"competitor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Competitor Name"},"host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host"},"prompt_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Key"}},"type":"object","required":["type","path"],"title":"OpportunityEvidenceOut","description":"One measured fact behind an opportunity, with the path it is read back from.\n\n``path`` resolves against the run's stored summary\n(``presence_opportunities_v1.resolve_path``); the regression suite reads\nevery row back, which is what keeps an invented number out."},"OptimizationAction":{"properties":{"action_id":{"type":"string","title":"Action Id"},"theme_key":{"type":"string","enum":["ai_awareness","buyer_questions","build_proof","fix_tech","win_search","close_gaps"],"title":"Theme Key"},"category":{"type":"string","enum":["content_creation","technical_fix","trust_signal","ai_presence","search_optimization","competitive_response"],"title":"Category"},"title":{"type":"string","title":"Title"},"priority_score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Priority Score"},"impact_band":{"type":"string","enum":["very_high","high","medium","low"],"title":"Impact Band"},"effort_band":{"type":"string","enum":["low","medium","high"],"title":"Effort Band"},"current_state":{"$ref":"#/components/schemas/CurrentState"},"instructions":{"$ref":"#/components/schemas/PrescriptiveInstructions"},"brief":{"$ref":"#/components/schemas/SynthesizedBrief"},"expected_impact":{"$ref":"#/components/schemas/ExpectedImpact"},"deep_links":{"additionalProperties":{"type":"string"},"type":"object","title":"Deep Links"},"completed":{"type":"boolean","title":"Completed","default":false},"sources":{"items":{"type":"string"},"type":"array","title":"Sources"},"ai_visibility_evidence":{"anyOf":[{"$ref":"#/components/schemas/AiVisibilityEvidence"},{"type":"null"}]},"associated_intents":{"items":{"type":"string"},"type":"array","title":"Associated Intents"},"presence_evidence":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Presence Evidence"},"target":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Target"}},"type":"object","required":["action_id","theme_key","category","title","priority_score","impact_band","effort_band","current_state","instructions","brief","expected_impact"],"title":"OptimizationAction","description":"One action card in a theme.\n\n``action_id`` is ``sha1(category + stable_id)[:16]`` where\n``stable_id`` is ALWAYS the primary ``intent_key`` or ``check_key``\n— never derived from title, so copy edits do not invalidate\nfrontend completion state."},"OptimizationHero":{"properties":{"overall_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overall Score"},"intent_coverage_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Intent Coverage Pct"},"trust_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trust Score"},"ai_presence_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ai Presence Score"}},"type":"object","title":"OptimizationHero","description":"Top-of-page \"where you stand today\" band."},"OptimizationMatrixPoint":{"properties":{"action_id":{"type":"string","title":"Action Id"},"title":{"type":"string","title":"Title"},"category":{"type":"string","enum":["content_creation","technical_fix","trust_signal","ai_presence","search_optimization","competitive_response"],"title":"Category"},"theme_key":{"type":"string","enum":["ai_awareness","buyer_questions","build_proof","fix_tech","win_search","close_gaps"],"title":"Theme Key"},"impact_score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Impact Score"},"effort_score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Effort Score"}},"type":"object","required":["action_id","title","category","theme_key","impact_score","effort_score"],"title":"OptimizationMatrixPoint","description":"One dot in the Impact/Effort 2x2 scatter visual."},"OptimizationPlanResponse":{"properties":{"status":{"type":"string","enum":["ok","error"],"title":"Status"},"analysis_id":{"type":"string","title":"Analysis Id"},"domain":{"type":"string","title":"Domain"},"generated_at":{"type":"string","title":"Generated At"},"locale":{"type":"string","title":"Locale"},"hero":{"$ref":"#/components/schemas/OptimizationHero"},"themes":{"items":{"$ref":"#/components/schemas/OptimizationTheme"},"type":"array","title":"Themes"},"matrix_points":{"items":{"$ref":"#/components/schemas/OptimizationMatrixPoint"},"type":"array","title":"Matrix Points"},"improve_existing":{"items":{"$ref":"#/components/schemas/ImproveExistingItem"},"type":"array","title":"Improve Existing"},"insights":{"items":{"$ref":"#/components/schemas/PlanInsight"},"type":"array","title":"Insights"},"sparse_mode":{"$ref":"#/components/schemas/SparseModeNotice"},"headless_render":{"anyOf":[{"$ref":"#/components/schemas/HeadlessRenderSummary"},{"type":"null"}]},"data_sources_used":{"items":{"type":"string"},"type":"array","title":"Data Sources Used"},"total_actions":{"type":"integer","title":"Total Actions","default":0},"candidates_discovered":{"type":"integer","title":"Candidates Discovered","default":0},"candidates_after_gate":{"type":"integer","title":"Candidates After Gate","default":0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"presence_action_count":{"type":"integer","title":"Presence Action Count","default":0},"presence_outside_website":{"items":{"$ref":"#/components/schemas/PresenceActionRef"},"type":"array","title":"Presence Outside Website"},"presence_references":{"items":{"$ref":"#/components/schemas/PresenceActionRef"},"type":"array","title":"Presence References"}},"type":"object","required":["status","analysis_id","domain","generated_at","locale","hero","sparse_mode"],"title":"OptimizationPlanResponse","description":"Full response body for ``GET /api/v1/action-plan/{analysis_id}``."},"OptimizationTheme":{"properties":{"theme_key":{"type":"string","enum":["ai_awareness","buyer_questions","build_proof","fix_tech","win_search","close_gaps"],"title":"Theme Key"},"title":{"type":"string","title":"Title"},"summary":{"type":"string","title":"Summary"},"impact_score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Impact Score"},"impact_band":{"type":"string","enum":["very_high","high","medium","low"],"title":"Impact Band"},"actions":{"items":{"$ref":"#/components/schemas/OptimizationAction"},"type":"array","title":"Actions"},"visible":{"type":"boolean","title":"Visible","default":true},"hidden_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hidden Reason"}},"type":"object","required":["theme_key","title","summary","impact_score","impact_band"],"title":"OptimizationTheme","description":"Strategic grouping of actions. One of six fixed themes."},"OverviewResponse":{"properties":{"profile":{"$ref":"#/components/schemas/ProfileResponse"},"measured":{"type":"boolean","title":"Measured"},"latest_run":{"anyOf":[{"$ref":"#/components/schemas/RunOut"},{"type":"null"}]},"active_run":{"anyOf":[{"$ref":"#/components/schemas/RunOut"},{"type":"null"}]},"summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Summary"},"trend":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Trend"},"themes":{"items":{"$ref":"#/components/schemas/ThemeOut"},"type":"array","title":"Themes"},"alternatives":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Alternatives"},"websites":{"items":{"$ref":"#/components/schemas/ProfileDomainOut"},"type":"array","title":"Websites"},"primary_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Domain"},"history":{"items":{"$ref":"#/components/schemas/HistoryEntry"},"type":"array","title":"History"},"sources_by_theme":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sources By Theme","description":"Source map of the latest measurement per theme (slice 6b.1)"},"sources_overall":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sources Overall","description":"Per subject the number of top sources covering it, over the themes"},"registered_sources":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Registered Sources","description":"The profile's own pages and partner relations (slice 6c)"},"source_suggestions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Source Suggestions","description":"Source types worth adding for this profile type"},"actions":{"additionalProperties":{"type":"integer"},"type":"object","title":"Actions","description":"Presence action counts on the latest measurement (slice 6)"},"opportunities":{"items":{"$ref":"#/components/schemas/PresenceOpportunityOut"},"type":"array","title":"Opportunities","description":"The two to four openings this measurement supports, ranked; derived at read time"},"quota":{"additionalProperties":{"type":"integer"},"type":"object","title":"Quota"},"methodology":{"additionalProperties":true,"type":"object","title":"Methodology"}},"type":"object","required":["profile","measured"],"title":"OverviewResponse"},"PaaItem":{"properties":{"question":{"type":"string","title":"Question"},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snippet"},"source_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Title"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"}},"type":"object","required":["question"],"title":"PaaItem","description":"One People Also Ask entry."},"PaaResult":{"properties":{"status":{"type":"string","enum":["ok","not_configured","empty_query","rate_limited","timeout","api_error","no_data"],"title":"Status"},"query":{"type":"string","title":"Query"},"paa_items":{"items":{"$ref":"#/components/schemas/PaaItem"},"type":"array","title":"Paa Items"},"related_searches":{"items":{"$ref":"#/components/schemas/RelatedSearch"},"type":"array","title":"Related Searches"},"latency_ms":{"type":"integer","title":"Latency Ms","default":0},"fetched_at":{"type":"string","title":"Fetched At"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["status","query"],"title":"PaaResult","description":"Stable-shape return type for `fetch_paa_and_related`.\n\nEvery failure mode returns a `PaaResult` with `status` set to a\nnon-\"ok\" value — callers should check `status` before trusting\n`paa_items` / `related_searches`."},"PackageInput":{"properties":{"name":{"type":"string","title":"Name"},"price":{"type":"string","title":"Price"},"price_period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Period"},"price_annual":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Annual"},"price_period_annual":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Period Annual"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagline"},"cta_text":{"type":"string","title":"Cta Text"},"cta_href":{"type":"string","title":"Cta Href"},"cta_style":{"type":"string","title":"Cta Style"},"is_featured":{"type":"boolean","title":"Is Featured"},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"},"features":{"items":{"type":"string"},"type":"array","title":"Features"},"max_models":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Models"},"llm_budget_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Llm Budget Cents"},"allowed_models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Models"},"scan_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scan Per Month"},"benchmark_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Benchmark Per Month"},"pdf_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pdf Per Month"},"competitor_scans_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Competitor Scans Per Month"},"articles_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Articles Per Month"},"max_domains":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Domains"},"max_team_members":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Team Members"},"stripe_price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Price Id"},"head_to_head_models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Head To Head Models"},"head_to_head_probes_per_competitor":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Head To Head Probes Per Competitor"},"presence_profiles_included":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Presence Profiles Included"},"presence_runs_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Presence Runs Per Month"},"presence_max_themes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Presence Max Themes"},"presence_prompts_per_theme":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Presence Prompts Per Theme"},"presence_max_prompts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Presence Max Prompts"},"presence_models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Presence Models"},"presence_channels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Presence Channels"}},"type":"object","required":["name","price","cta_text","cta_href","cta_style","is_featured","features"],"title":"PackageInput"},"PerformanceData":{"properties":{"p50_latency_ms":{"type":"integer","title":"P50 Latency Ms"},"p95_latency_ms":{"type":"integer","title":"P95 Latency Ms"},"p99_latency_ms":{"type":"integer","title":"P99 Latency Ms"},"trend":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Trend"},"slow_requests":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Slow Requests"}},"type":"object","required":["p50_latency_ms","p95_latency_ms","p99_latency_ms","trend","slow_requests"],"title":"PerformanceData","description":"Performance metrics."},"PillarEvaluation":{"properties":{"pillarKey":{"$ref":"#/components/schemas/PillarKey","description":"Canonical pillar identifier (entity, content, trust, intents). Type-safe enum ensures consistency."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Human-readable label (optional, frontend handles via keys and i18n)"},"score":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Score","description":"Total pillar score 0-100"},"level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level","description":"Human-friendly level (e.g., 'weak', 'fair', 'strong')"},"aspects":{"items":{"$ref":"#/components/schemas/AspectEvaluation"},"type":"array","title":"Aspects","description":"Breakdown into sub-aspects (can be empty)"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary","description":"Short explanation text for the pillar evaluation"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta","description":"Optional metadata for future extensions"}},"type":"object","required":["pillarKey"],"title":"PillarEvaluation","description":"Comprehensive evaluation of one pillar (Intents, Entity, Content, Trust).\n\nRepresents the full evaluation state of a pillar including:\n- Overall pillar score\n- Breakdown into aspects\n- Human-readable summary\n\nThis is the core structure for Pillar 2.0 scoring, replacing the previous\nuntyped dict-based pillar representations.\n\nPillar keys:\n- \"intents\": User intent coverage\n- \"entity\": Business entity recognition\n- \"content\": Content quality and completeness\n- \"trust\": Authority, reliability, citations\n\nUsage:\n    pillar = PillarEvaluation(\n        pillar_key=PillarKey.CONTENT,\n        label=\"Content Quality\",\n        score=78.5,\n        level=\"fair\",\n        aspects=[\n            AspectEvaluation(aspect_key=\"coverage\", score=80.0, level=\"strong\"),\n            AspectEvaluation(aspect_key=\"depth\", score=75.0, level=\"fair\"),\n            AspectEvaluation(aspect_key=\"freshness\", score=70.0, level=\"fair\"),\n        ],\n        summary=\"Content covers main topics but lacks depth in some areas\"\n    )"},"PillarKey":{"type":"string","enum":["entity","content","trust","ai_presence","intents","technical","relevance","market"],"title":"PillarKey","description":"Canonical pillar identifiers for Pillar 2.0 architecture.\n\nThese keys are stable and used across:\n- Backend domain models\n- API responses (JSON)\n- Frontend TypeScript types\n- Database storage (future)\n\nDo not change these values without a migration plan."},"PillarScoreResponse":{"properties":{"name":{"type":"string","title":"Name","description":"Pillar name"},"percent":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Percent","description":"Percentage score 0-100"},"points":{"type":"integer","minimum":0.0,"title":"Points","description":"Points awarded"},"max_points":{"type":"integer","minimum":0.0,"title":"Max Points","description":"Maximum possible points"},"subpillars":{"items":{"$ref":"#/components/schemas/SubpillarScoreResponse"},"type":"array","title":"Subpillars","description":"Sub-pillar breakdown if applicable"}},"type":"object","required":["name","percent","points","max_points"],"title":"PillarScoreResponse","description":"Individual pillar score with optional sub-pillars."},"PlanInsight":{"properties":{"key":{"type":"string","title":"Key"},"title":{"type":"string","title":"Title"},"category":{"type":"string","title":"Category"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["key","title","category","reason"],"title":"PlanInsight","description":"A finding the plan shows and deliberately does not turn into an action.\n\nSame idea as the AI Presence insight block: the recipe behind it cannot say\nwhere the work happens, or the outcome belongs to an editor rather than to\nthe customer, so we show what we saw and why there is no step\n(``app.domain.offsite_actionability_v1``). No steps, no effort, no id the\nTasks layer tracks: it is a finding, not work."},"PortalResponse":{"properties":{"portal_url":{"type":"string","title":"Portal Url"}},"type":"object","required":["portal_url"],"title":"PortalResponse"},"PortalSessionRequest":{"properties":{"flow":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flow"}},"type":"object","title":"PortalSessionRequest"},"PrescriptiveInstructions":{"properties":{"steps":{"items":{"$ref":"#/components/schemas/InstructionStep"},"type":"array","title":"Steps"},"code_snippets":{"items":{"$ref":"#/components/schemas/CodeSnippet"},"type":"array","title":"Code Snippets"},"content_templates":{"items":{"$ref":"#/components/schemas/ContentTemplate"},"type":"array","title":"Content Templates"},"resources":{"items":{"$ref":"#/components/schemas/ResourceLink"},"type":"array","title":"Resources"},"estimated_hours":{"type":"number","minimum":0.0,"title":"Estimated Hours"}},"type":"object","required":["estimated_hours"],"title":"PrescriptiveInstructions","description":"Part 2 — exactly what to do, with snippets and templates."},"PresenceActionOut":{"properties":{"action_id":{"type":"string","title":"Action Id"},"rule_key":{"type":"string","title":"Rule Key"},"pillar":{"type":"string","title":"Pillar"},"category":{"type":"string","title":"Category"},"title":{"type":"string","title":"Title"},"summary":{"type":"string","title":"Summary"},"steps":{"items":{"type":"string"},"type":"array","title":"Steps"},"expected_impact":{"type":"string","title":"Expected Impact"},"impact_band":{"type":"string","title":"Impact Band"},"effort_band":{"type":"string","title":"Effort Band"},"priority_score":{"type":"number","title":"Priority Score"},"sources":{"items":{"type":"string"},"type":"array","title":"Sources"},"presence_evidence":{"additionalProperties":true,"type":"object","title":"Presence Evidence"},"target":{"additionalProperties":true,"type":"object","title":"Target"},"deep_links":{"additionalProperties":{"type":"string"},"type":"object","title":"Deep Links"},"check_keys":{"items":{"type":"string"},"type":"array","title":"Check Keys"},"route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route","description":"listing | editorial | platform | owned | all, for source actions (slice 6b.2)"},"hooks":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Hooks","description":"Proposed editorial angles; generated on request, never while reading"},"hooks_status":{"type":"string","title":"Hooks Status","default":"not_applicable"},"intervention":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Intervention","description":"For a source action (decision 2026-09-20 §14): kind direct | indirect, where (source | editorial_desk | partner | own_website), access {kind, url, title}, requirements [quoted conditions], next_step (the one thing the customer does first)"},"status":{"type":"string","title":"Status","default":"open"},"completed":{"type":"boolean","title":"Completed","default":false},"assigned_to_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To User Id"},"assigned_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned By User Id"},"assigned_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned At"},"assignment_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Note"},"due_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due At"},"is_hidden":{"type":"boolean","title":"Is Hidden","default":false},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["action_id","rule_key","pillar","category","title","summary","expected_impact","impact_band","effort_band","priority_score"],"title":"PresenceActionOut"},"PresenceActionRef":{"properties":{"action_id":{"type":"string","title":"Action Id"},"rule_key":{"type":"string","title":"Rule Key"},"pillar":{"type":"string","title":"Pillar"},"route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route"},"title":{"type":"string","title":"Title"},"profile_id":{"type":"string","title":"Profile Id"},"profile_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Name"},"target":{"additionalProperties":true,"type":"object","title":"Target"},"presence_evidence":{"additionalProperties":true,"type":"object","title":"Presence Evidence"},"deep_links":{"additionalProperties":{"type":"string"},"type":"object","title":"Deep Links"},"completed":{"type":"boolean","title":"Completed","default":false},"see_action_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"See Action Id"}},"type":"object","required":["action_id","rule_key","pillar","title","profile_id"],"title":"PresenceActionRef","description":"A presence action shown in the plan as a compact line, not a card.\n\nEither it acts outside this website (a source or the profile itself:\nblock \"For AI Presence outside this website\") or it duplicates an\nexisting website action (``see_action_id``: shown as a reference)."},"PresenceActionStatusPatch":{"properties":{"completed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Completed"},"assigned_to_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To User Id"},"assignment_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Note"},"due_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due At"},"hidden":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hidden"}},"type":"object","title":"PresenceActionStatusPatch","description":"Partial: only the fields sent are changed."},"PresenceInsightOut":{"properties":{"theme_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Key"},"theme_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Label"},"host":{"type":"string","title":"Host"},"gap":{"type":"string","title":"Gap","description":"coverage_gap | representation_gap | unknown"},"route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route"},"route_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route Method"},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type"},"reason":{"type":"string","title":"Reason","description":"why this is not an action: unknown_check | default_classification | not_a_source | ineligible | territory_mismatch | single_citation | no_covered_alternative | no_intervention | conflict_of_interest | no_channel"},"citations":{"type":"integer","title":"Citations","default":0},"covered_by":{"items":{"type":"string"},"type":"array","title":"Covered By"},"evidence_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Url"},"access":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Access"},"criteria":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Criteria"}},"type":"object","required":["host","gap","reason"],"title":"PresenceInsightOut","description":"An observed source with a gap and no action (decision 2026-09-20 §12): the\nSource Map keeps showing it, nothing is added to the customer's to-do list."},"PresenceOpportunityOut":{"properties":{"key":{"type":"string","title":"Key"},"archetype":{"type":"string","title":"Archetype"},"confidence":{"type":"string","title":"Confidence","description":"high | tentative"},"prominent":{"type":"boolean","title":"Prominent","default":false},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"headline":{"type":"string","title":"Headline","default":""},"observation":{"type":"string","title":"Observation","description":"What we saw, in measured numbers","default":""},"synthesis":{"type":"string","title":"Synthesis","description":"Why this is an opening, across signals","default":""},"confidence_label":{"type":"string","title":"Confidence Label","default":""},"confidence_explanation":{"type":"string","title":"Confidence Explanation","default":""},"what_would_unlock":{"type":"string","title":"What Would Unlock","description":"Only when no action hangs under it","default":""},"theme_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Key"},"theme_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Label"},"competitor_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Competitor Key"},"competitor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Competitor Name"},"hosts":{"items":{"type":"string"},"type":"array","title":"Hosts"},"because":{"items":{"$ref":"#/components/schemas/OpportunityEvidenceOut"},"type":"array","title":"Because"},"evidence_hash":{"type":"string","title":"Evidence Hash","default":""},"actions":{"items":{"type":"string"},"type":"array","title":"Actions","description":"action_ids, referenced not copied"},"insights":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Insights"},"values":{"additionalProperties":true,"type":"object","title":"Values"}},"type":"object","required":["key","archetype","confidence"],"title":"PresenceOpportunityOut","description":"A strategic opening synthesised from this run's own evidence.\n\nNot an action and not a finding: it groups and ranks what the measurement\nalready produced, so a customer reads direction instead of a list. Derived\nat read time from the run that is named in ``run_id``; never stored, never\nrewritten when the profile changes."},"PreviewIntentsRequest":{"properties":{"domain":{"type":"string","title":"Domain","description":"Domain the scan will run on"},"business_context":{"$ref":"#/components/schemas/BusinessContext","description":"The user-confirmed business context to seed intent generation"},"language":{"type":"string","title":"Language","description":"Output language for the generated questions","default":"nl"}},"type":"object","required":["domain","business_context"],"title":"PreviewIntentsRequest","description":"Body for ``POST /scan/preview-intents``.\n\nGenerates the dynamic AI-visibility intents for a domain *before*\nthe scan starts so the user can preview (and regenerate) the\nquestions we will ask LLMs about their business."},"PrioritizedIntent":{"properties":{"intentKey":{"type":"string","title":"Intentkey"},"score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Score","description":"Intent score 0-100"}},"type":"object","required":["intentKey","score"],"title":"PrioritizedIntent","description":"Intent with priority ranking."},"ProbeCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Probe name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Probe description"},"sector":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Sector","description":"Optional sector/category"},"query_template":{"type":"string","minLength":1,"title":"Query Template","description":"LLM prompt/query template"}},"type":"object","required":["name","query_template"],"title":"ProbeCreateRequest","description":"Request to create a new AI probe definition."},"ProbeResponse":{"properties":{"id":{"type":"string","title":"Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"sector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector"},"query_template":{"type":"string","title":"Query Template"},"is_active":{"type":"boolean","title":"Is Active","default":true},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","workspace_id","name","description","query_template"],"title":"ProbeResponse","description":"Response for a probe definition."},"ProbeResultResponse":{"properties":{"id":{"type":"string","title":"Id"},"model_name":{"type":"string","title":"Model Name"},"raw_response":{"additionalProperties":true,"type":"object","title":"Raw Response"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","model_name","raw_response"],"title":"ProbeResultResponse","description":"Response for probe result data."},"ProbeRunCreateRequest":{"properties":{"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id","description":"Optional target analysis ID"},"models":{"items":{"type":"string"},"type":"array","title":"Models","description":"Requested model IDs (ordered)"},"parameters":{"additionalProperties":true,"type":"object","title":"Parameters","description":"Template parameters (e.g., city)"},"model_params":{"additionalProperties":true,"type":"object","title":"Model Params","description":"Per-call model parameters (e.g., temperature, max_tokens)"}},"type":"object","title":"ProbeRunCreateRequest","description":"Request to create a new probe run."},"ProbeRunResponse":{"properties":{"id":{"type":"string","title":"Id"},"job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Id","description":"Alias for id; reserved for async job wiring"},"probe_id":{"type":"string","title":"Probe Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"},"status":{"type":"string","title":"Status"},"requested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Requested At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"requested_models":{"items":{"type":"string"},"type":"array","title":"Requested Models"},"parameters":{"additionalProperties":true,"type":"object","title":"Parameters"},"model_params":{"additionalProperties":true,"type":"object","title":"Model Params"},"telemetry":{"additionalProperties":true,"type":"object","title":"Telemetry"},"probe":{"anyOf":[{"$ref":"#/components/schemas/ProbeResponse"},{"type":"null"}]},"results":{"anyOf":[{"items":{"$ref":"#/components/schemas/ProbeResultResponse"},"type":"array"},{"type":"null"}],"title":"Results"}},"type":"object","required":["id","probe_id","workspace_id","status"],"title":"ProbeRunResponse","description":"Response for a probe run (details endpoint)."},"ProbeRunResultsResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Id"},"status":{"type":"string","title":"Status"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"results":{"items":{"$ref":"#/components/schemas/ProbeResultResponse"},"type":"array","title":"Results"}},"type":"object","required":["run_id","status"],"title":"ProbeRunResultsResponse","description":"Response envelope for run results.\n\nDesigned for polling UIs:\n- Always 200 for an existing run (even when results are empty)\n- Includes run status metadata alongside results"},"ProbeUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"Probe name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Probe description"},"sector":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Sector","description":"Optional sector/category"},"query_template":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Query Template","description":"LLM prompt/query template"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Soft-enable/disable this probe"}},"type":"object","title":"ProbeUpdateRequest","description":"Request to update an existing probe definition.\n\nAll fields are optional; omitted fields are left unchanged."},"ProfileCreateRequest":{"properties":{"name":{"type":"string","maxLength":200,"title":"Name"},"profile_type":{"type":"string","enum":["brand","organisation","destination","product","other"],"title":"Profile Type","default":"brand"},"parent_profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Profile Id"},"relationship_type":{"anyOf":[{"type":"string","enum":["sub_brand","location","product","business_unit"]},{"type":"null"}],"title":"Relationship Type"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"When should someone find or recommend this profile, in plain language"},"aliases":{"items":{"$ref":"#/components/schemas/AliasIn"},"type":"array","title":"Aliases"},"category":{"items":{"type":"string"},"type":"array","title":"Category","description":"Optional derived context (sector, category); not an onboarding step"},"markets":{"items":{"type":"string"},"type":"array","title":"Markets"},"audiences":{"items":{"type":"string"},"type":"array","title":"Audiences"},"competitors":{"items":{"$ref":"#/components/schemas/CompetitorIn"},"type":"array","title":"Competitors"},"language":{"type":"string","maxLength":2,"title":"Language","default":"nl"},"locale":{"anyOf":[{"type":"string","maxLength":5},{"type":"null"}],"title":"Locale"},"models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Models","description":"Subset of the plan's models; defaults to all of them"},"channels":{"items":{"type":"string"},"type":"array","title":"Channels","description":"AI search channels, e.g. serp-google-aio"}},"additionalProperties":false,"type":"object","required":["name"],"title":"ProfileCreateRequest"},"ProfileDomainIn":{"properties":{"domain":{"type":"string","maxLength":253,"title":"Domain"},"label":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Label"},"is_primary":{"type":"boolean","title":"Is Primary","default":false},"status":{"type":"string","enum":["active","archived"],"title":"Status","default":"active"}},"additionalProperties":false,"type":"object","required":["domain"],"title":"ProfileDomainIn"},"ProfileDomainOut":{"properties":{"id":{"type":"string","title":"Id"},"domain":{"type":"string","title":"Domain"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"is_primary":{"type":"boolean","title":"Is Primary"},"status":{"type":"string","title":"Status"},"readiness":{"anyOf":[{"$ref":"#/components/schemas/ReadinessOut"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","domain","is_primary","status"],"title":"ProfileDomainOut"},"ProfileDomainsPutRequest":{"properties":{"domains":{"items":{"$ref":"#/components/schemas/ProfileDomainIn"},"type":"array","title":"Domains"}},"additionalProperties":false,"type":"object","title":"ProfileDomainsPutRequest"},"ProfileDomainsResponse":{"properties":{"profile_id":{"type":"string","title":"Profile Id"},"domains":{"items":{"$ref":"#/components/schemas/ProfileDomainOut"},"type":"array","title":"Domains"},"primary_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Domain"}},"type":"object","required":["profile_id"],"title":"ProfileDomainsResponse"},"ProfileListResponse":{"properties":{"profiles":{"items":{"$ref":"#/components/schemas/ProfileResponse"},"type":"array","title":"Profiles"},"total":{"type":"integer","title":"Total"},"profiles_allowed":{"type":"integer","title":"Profiles Allowed"},"profiles_active":{"type":"integer","title":"Profiles Active"}},"type":"object","required":["profiles","total","profiles_allowed","profiles_active"],"title":"ProfileListResponse"},"ProfileLookupItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"profile_type":{"type":"string","title":"Profile Type"},"measured":{"type":"boolean","title":"Measured"},"presence_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Presence Pct"},"mentioned":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mentioned"},"answered":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Answered"},"last_measured_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Measured At"}},"type":"object","required":["id","name","profile_type","measured"],"title":"ProfileLookupItem","description":"A profile seen from a website (option B, rule 7): enough for a bridge, not a copy of the overview."},"ProfileLookupResponse":{"properties":{"domain":{"type":"string","title":"Domain"},"profiles":{"items":{"$ref":"#/components/schemas/ProfileLookupItem"},"type":"array","title":"Profiles"}},"type":"object","required":["domain"],"title":"ProfileLookupResponse"},"ProfileResponse":{"properties":{"id":{"type":"string","title":"Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"profile_type":{"type":"string","title":"Profile Type"},"parent_profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Profile Id"},"relationship_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relationship Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"aliases":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Aliases"},"category":{"items":{"type":"string"},"type":"array","title":"Category"},"markets":{"items":{"type":"string"},"type":"array","title":"Markets"},"audiences":{"items":{"type":"string"},"type":"array","title":"Audiences"},"competitors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Competitors"},"language":{"type":"string","title":"Language"},"locale":{"type":"string","title":"Locale"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"channels":{"items":{"type":"string"},"type":"array","title":"Channels"},"status":{"type":"string","title":"Status"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"archived_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Archived At"},"domains":{"items":{"$ref":"#/components/schemas/ProfileDomainOut"},"type":"array","title":"Domains"},"active_theme_count":{"type":"integer","title":"Active Theme Count","default":0}},"type":"object","required":["id","workspace_id","name","profile_type","language","locale","status"],"title":"ProfileResponse"},"ProfileSourceIn":{"properties":{"source_type":{"type":"string","title":"Source Type","description":"wikipedia | wikidata | linkedin | facebook | youtube | review_platform | directory | google_business | instagram | tiktok | other"},"url":{"type":"string","title":"Url"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"role":{"type":"string","title":"Role","description":"platform (a page you control) or partner (a relation)","default":"platform"},"status":{"type":"string","title":"Status","default":"active"}},"additionalProperties":false,"type":"object","required":["source_type","url"],"title":"ProfileSourceIn"},"ProfileSourceOut":{"properties":{"id":{"type":"string","title":"Id"},"source_type":{"type":"string","title":"Source Type"},"type_label":{"type":"string","title":"Type Label"},"url":{"type":"string","title":"Url"},"host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"check_mode":{"type":"string","title":"Check Mode"},"check":{"additionalProperties":true,"type":"object","title":"Check"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","source_type","type_label","url","role","status","check_mode"],"title":"ProfileSourceOut"},"ProfileSourcesPutRequest":{"properties":{"sources":{"items":{"$ref":"#/components/schemas/ProfileSourceIn"},"type":"array","title":"Sources"}},"additionalProperties":false,"type":"object","title":"ProfileSourcesPutRequest"},"ProfileSourcesResponse":{"properties":{"profile_id":{"type":"string","title":"Profile Id"},"sources":{"items":{"$ref":"#/components/schemas/ProfileSourceOut"},"type":"array","title":"Sources"},"suggestions":{"items":{"$ref":"#/components/schemas/SourceSuggestion"},"type":"array","title":"Suggestions","description":"Source types worth having for this profile type that it does not have yet"}},"type":"object","required":["profile_id"],"title":"ProfileSourcesResponse"},"ProfileUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"},"profile_type":{"anyOf":[{"type":"string","enum":["brand","organisation","destination","product","other"]},{"type":"null"}],"title":"Profile Type"},"parent_profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Profile Id"},"relationship_type":{"anyOf":[{"type":"string","enum":["sub_brand","location","product","business_unit"]},{"type":"null"}],"title":"Relationship Type"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"aliases":{"anyOf":[{"items":{"$ref":"#/components/schemas/AliasIn"},"type":"array"},{"type":"null"}],"title":"Aliases"},"category":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Category"},"markets":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Markets"},"audiences":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Audiences"},"competitors":{"anyOf":[{"items":{"$ref":"#/components/schemas/CompetitorIn"},"type":"array"},{"type":"null"}],"title":"Competitors"},"language":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Language"},"locale":{"anyOf":[{"type":"string","maxLength":5},{"type":"null"}],"title":"Locale"},"models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Models"},"channels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Channels"}},"additionalProperties":false,"type":"object","title":"ProfileUpdateRequest","description":"Partial update: only the fields sent are changed."},"ProjectType":{"type":"string","enum":["small_job","renovation","extension","new_build"],"title":"ProjectType","description":"Construction project type (sector-specific enum).\n\nClassifies construction/renovation projects by scale and complexity:\n- SMALL_JOB: Minor repairs, maintenance, handyman tasks\n- RENOVATION: Home renovation, remodeling projects\n- EXTENSION: Building extensions, additions\n- NEW_BUILD: New construction projects\n\nNote: This is construction-specific. Other sectors may define\ntheir own classification enums (e.g., RestaurantType, EventType)."},"PromptCandidate":{"properties":{"theme_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Key"},"prompt_type":{"type":"string","title":"Prompt Type"},"prompt_kind":{"type":"string","title":"Prompt Kind"},"text":{"type":"string","title":"Text"},"language":{"type":"string","title":"Language"}},"type":"object","required":["prompt_type","prompt_kind","text","language"],"title":"PromptCandidate"},"PromptIn":{"properties":{"prompt_key":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Prompt Key"},"prompt_type":{"type":"string","enum":["discovery","perception","comparison"],"title":"Prompt Type","default":"discovery"},"prompt_kind":{"type":"string","enum":["benchmark","live"],"title":"Prompt Kind","default":"benchmark"},"theme_key":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Theme Key"},"text":{"type":"string","maxLength":500,"title":"Text"},"language":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Language"},"source":{"type":"string","enum":["user","generated","template"],"title":"Source","default":"user"},"is_active":{"type":"boolean","title":"Is Active","default":true},"headline_eligible":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Headline Eligible","description":"Leave unset to let the balance rule decide; False pins the prompt as diagnostic"}},"additionalProperties":false,"type":"object","required":["text"],"title":"PromptIn","description":"One prompt in a PUT. ``prompt_key`` keeps identity across edits; omit it for a new prompt."},"PromptOut":{"properties":{"id":{"type":"string","title":"Id"},"prompt_key":{"type":"string","title":"Prompt Key"},"prompt_type":{"type":"string","title":"Prompt Type"},"prompt_kind":{"type":"string","title":"Prompt Kind"},"theme_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Key"},"text":{"type":"string","title":"Text"},"language":{"type":"string","title":"Language"},"source":{"type":"string","title":"Source"},"is_active":{"type":"boolean","title":"Is Active"},"headline_eligible":{"type":"boolean","title":"Headline Eligible"},"version":{"type":"integer","title":"Version"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","prompt_key","prompt_type","prompt_kind","text","language","source","is_active","headline_eligible","version"],"title":"PromptOut"},"PromptSetPutRequest":{"properties":{"prompts":{"items":{"$ref":"#/components/schemas/PromptIn"},"type":"array","title":"Prompts"}},"additionalProperties":false,"type":"object","title":"PromptSetPutRequest"},"PromptSetResponse":{"properties":{"profile_id":{"type":"string","title":"Profile Id"},"prompts":{"items":{"$ref":"#/components/schemas/PromptOut"},"type":"array","title":"Prompts"},"balance":{"$ref":"#/components/schemas/BalanceReport"},"limits":{"additionalProperties":{"type":"integer"},"type":"object","title":"Limits"},"fingerprints":{"additionalProperties":{"type":"string"},"type":"object","title":"Fingerprints"}},"type":"object","required":["profile_id","balance"],"title":"PromptSetResponse"},"PromptSuggestRequest":{"properties":{"theme_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Theme Keys","description":"Defaults to every active theme of the profile"},"count_per_theme":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Count Per Theme","default":5},"prompt_type":{"type":"string","enum":["discovery","perception","comparison"],"title":"Prompt Type","default":"discovery"},"prompt_kind":{"type":"string","enum":["benchmark","live"],"title":"Prompt Kind","default":"benchmark"},"language":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Language"}},"additionalProperties":false,"type":"object","title":"PromptSuggestRequest"},"PromptSuggestResponse":{"properties":{"candidates":{"items":{"$ref":"#/components/schemas/PromptCandidate"},"type":"array","title":"Candidates"},"dropped_leaks":{"type":"integer","title":"Dropped Leaks","default":0},"dropped_timebound":{"type":"integer","title":"Dropped Timebound","description":"Benchmark candidates dropped for a date, season, holiday or campaign word","default":0},"model":{"type":"string","title":"Model"},"language":{"type":"string","title":"Language"}},"type":"object","required":["model","language"],"title":"PromptSuggestResponse"},"PropertiesResponse":{"properties":{"properties":{"items":{"$ref":"#/components/schemas/GscPropertyItem"},"type":"array","title":"Properties"}},"type":"object","title":"PropertiesResponse"},"QueueResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/QueuedScanItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["items","total","page","limit"],"title":"QueueResponse"},"QueuedScanItem":{"properties":{"id":{"type":"string","title":"Id"},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id"},"workspace_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Name"},"scheduled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled At"},"executed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executed At"},"status":{"type":"string","title":"Status"},"retry_count":{"type":"integer","title":"Retry Count","default":0},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","status"],"title":"QueuedScanItem"},"ReachRequest":{"properties":{"reach":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reach"}},"type":"object","title":"ReachRequest"},"ReachResponse":{"properties":{"analysis_id":{"type":"string","title":"Analysis Id"},"domain":{"type":"string","title":"Domain"},"reach":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reach"}},"type":"object","required":["analysis_id","domain"],"title":"ReachResponse"},"ReadinessOut":{"properties":{"status":{"type":"string","title":"Status"},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"},"projected_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Projected Score"},"pillars":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Pillars"},"scanned_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scanned At"}},"type":"object","required":["status"],"title":"ReadinessOut"},"RealWorldStats":{"properties":{"impressions":{"type":"integer","title":"Impressions","default":0},"clicks":{"type":"integer","title":"Clicks","default":0},"ctr":{"type":"number","title":"Ctr","default":0.0},"avg_position":{"type":"number","title":"Avg Position","default":0.0}},"type":"object","title":"RealWorldStats","description":"Aggregated GSC metrics for a matched intent."},"RecentFailedScan":{"properties":{"id":{"type":"string","title":"Id"},"domain":{"type":"string","title":"Domain"},"created_at":{"type":"string","title":"Created At"},"error_message":{"type":"string","title":"Error Message"}},"type":"object","required":["id","domain","created_at","error_message"],"title":"RecentFailedScan","description":"Failed scan detail."},"RelatedSearch":{"properties":{"query":{"type":"string","title":"Query"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","required":["query"],"title":"RelatedSearch","description":"One related-search suggestion."},"RescanToggleRequest":{"properties":{"rescan":{"type":"boolean","title":"Rescan"}},"type":"object","required":["rescan"],"title":"RescanToggleRequest"},"RescanToggleResponse":{"properties":{"analysis_id":{"type":"string","title":"Analysis Id"},"rescan":{"type":"boolean","title":"Rescan"},"rescan_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rescan On"}},"type":"object","required":["analysis_id","rescan"],"title":"RescanToggleResponse"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","title":"New Password"},"captchaToken":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Captchatoken"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordRequest"},"ResourceLink":{"properties":{"label":{"type":"string","title":"Label"},"url":{"type":"string","title":"Url"}},"type":"object","required":["label","url"],"title":"ResourceLink","description":"A pointer to further reading (docs, validator, competitor example)."},"RunCreateRequest":{"properties":{"models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Models","description":"Subset of the profile's models; defaults to all of them"},"channels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Channels","description":"Subset of the profile's channels; defaults to all of them"}},"additionalProperties":false,"type":"object","title":"RunCreateRequest","description":"Start a measurement. Models and channels default to the profile's."},"RunDetailResponse":{"properties":{"run":{"$ref":"#/components/schemas/RunOut"},"results":{"items":{"$ref":"#/components/schemas/RunResultOut"},"type":"array","title":"Results"},"prompt_snapshot":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Prompt Snapshot"},"profile_snapshot":{"additionalProperties":true,"type":"object","title":"Profile Snapshot"},"model_config_snapshot":{"additionalProperties":true,"type":"object","title":"Model Config Snapshot"}},"type":"object","required":["run"],"title":"RunDetailResponse"},"RunEstimateOut":{"properties":{"probe_calls":{"type":"integer","title":"Probe Calls"},"channel_calls":{"type":"integer","title":"Channel Calls"},"classifier_calls":{"type":"integer","title":"Classifier Calls"},"tokens_in":{"type":"integer","title":"Tokens In"},"tokens_out":{"type":"integer","title":"Tokens Out"},"cost_cents":{"type":"integer","title":"Cost Cents"},"source_calls":{"type":"integer","title":"Source Calls","default":0},"source_checks":{"type":"integer","title":"Source Checks","default":0},"source_cost_cents":{"type":"integer","title":"Source Cost Cents","default":0}},"type":"object","required":["probe_calls","channel_calls","classifier_calls","tokens_in","tokens_out","cost_cents"],"title":"RunEstimateOut"},"RunListResponse":{"properties":{"profile_id":{"type":"string","title":"Profile Id"},"runs":{"items":{"$ref":"#/components/schemas/RunOut"},"type":"array","title":"Runs"},"runs_used_this_month":{"type":"integer","title":"Runs Used This Month"},"runs_per_month":{"type":"integer","title":"Runs Per Month"}},"type":"object","required":["profile_id","runs_used_this_month","runs_per_month"],"title":"RunListResponse"},"RunOut":{"properties":{"id":{"type":"string","title":"Id"},"profile_id":{"type":"string","title":"Profile Id"},"status":{"type":"string","title":"Status"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"channels":{"items":{"type":"string"},"type":"array","title":"Channels"},"prompt_count":{"type":"integer","title":"Prompt Count"},"headline_prompt_count":{"type":"integer","title":"Headline Prompt Count"},"measurement_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Measurement Hash"},"competition_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Competition Hash"},"perception_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Perception Hash"},"model_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Fingerprint"},"source_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Hash"},"samples_per_prompt":{"type":"integer","title":"Samples Per Prompt","default":1},"policy":{"additionalProperties":true,"type":"object","title":"Policy"},"provenance":{"additionalProperties":true,"type":"object","title":"Provenance"},"versions":{"additionalProperties":true,"type":"object","title":"Versions"},"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"},"summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Summary"},"estimate":{"anyOf":[{"$ref":"#/components/schemas/RunEstimateOut"},{"type":"null"}]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"},"cancelled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancelled At"}},"type":"object","required":["id","profile_id","status","prompt_count","headline_prompt_count"],"title":"RunOut"},"RunResultOut":{"properties":{"id":{"type":"integer","title":"Id"},"prompt_id":{"type":"string","title":"Prompt Id"},"prompt_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Key"},"prompt_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Type"},"prompt_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Kind"},"theme_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Key"},"headline_eligible":{"type":"boolean","title":"Headline Eligible"},"model":{"type":"string","title":"Model"},"resolved_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Model"},"sample_idx":{"type":"integer","title":"Sample Idx"},"raw_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raw Text"},"citations":{"items":{"type":"string"},"type":"array","title":"Citations"},"citation_sources":{"additionalProperties":{"type":"integer"},"type":"object","title":"Citation Sources"},"provider_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Status"},"provider_error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Error Code"},"target_mentioned":{"type":"boolean","title":"Target Mentioned"},"target_match_kind":{"type":"string","title":"Target Match Kind"},"target_mention_order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target Mention Order"},"target_rank_position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target Rank Position"},"rank_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rank Source"},"recommendation_strength":{"type":"string","title":"Recommendation Strength"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"classifier_called":{"type":"boolean","title":"Classifier Called"},"competitors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Competitors"},"detector_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detector Version"},"latency_ms":{"type":"integer","title":"Latency Ms","default":0}},"type":"object","required":["id","prompt_id","headline_eligible","model","sample_idx","target_mentioned","target_match_kind","recommendation_strength","classifier_called"],"title":"RunResultOut"},"SaveReportRequest":{"properties":{"domain":{"type":"string","title":"Domain"},"report_json":{"additionalProperties":true,"type":"object","title":"Report Json"},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"},"variant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},"type":"object","required":["domain","report_json"],"title":"SaveReportRequest"},"SbiCodeResponse":{"properties":{"code":{"type":"string","title":"Code"},"nl_label":{"type":"string","title":"Nl Label"},"en_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"En Label"},"level":{"type":"integer","title":"Level"},"parent_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Code"}},"type":"object","required":["code","nl_label","level"],"title":"SbiCodeResponse","description":"SBI code item in response."},"SbiCodesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SbiCodeResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"SbiCodesListResponse","description":"Response for SBI codes lookup."},"ScanDeleteResponse":{"properties":{"deleted":{"type":"boolean","title":"Deleted"},"id":{"type":"string","title":"Id"}},"type":"object","required":["deleted","id"],"title":"ScanDeleteResponse"},"ScanItem":{"properties":{"id":{"type":"string","title":"Id"},"domain":{"type":"string","title":"Domain"},"workspace_name":{"type":"string","title":"Workspace Name"},"sector":{"type":"string","title":"Sector"},"status":{"type":"string","title":"Status"},"score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Score"},"created_at":{"type":"string","title":"Created At"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","required":["id","domain","workspace_name","sector","status","score","created_at","duration_seconds"],"title":"ScanItem","description":"Individual scan in list."},"ScanPageInfo":{"properties":{"url":{"type":"string","title":"Url"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"meta_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Description"},"has_schema":{"type":"boolean","title":"Has Schema","default":false},"schema_types":{"items":{"type":"string"},"type":"array","title":"Schema Types","default":[]}},"type":"object","required":["url"],"title":"ScanPageInfo","description":"Information about a crawled page."},"ScanPipelineResponse":{"properties":{"queued":{"type":"integer","title":"Queued"},"running":{"type":"integer","title":"Running"},"completed":{"type":"integer","title":"Completed"},"failed":{"type":"integer","title":"Failed"}},"type":"object","required":["queued","running","completed","failed"],"title":"ScanPipelineResponse","description":"Response for GET /api/admin/dashboard/scan-pipeline"},"ScanRequest":{"properties":{"url":{"type":"string","title":"Url","description":"Root URL of domain to scan (e.g. 'example.com' or 'https://example.com')"},"target_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Url","description":"Optional crawl root URL on the same domain (deterministic target selection can set this)."},"max_pages":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":1.0},{"type":"null"}],"title":"Max Pages","description":"Max pages to crawl (1-50, default: 20). Phase 1 Crawl Coverage raised default from 10 to 20; cap raised from 20 to 50 to accommodate sector modifiers (ecommerce/publisher +10, service_business +5).","default":20},"sector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector","description":"Business sector hint (legacy)"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region","description":"Operating region hint (legacy)"},"brand_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Id","description":"Brand (profile) id the scanned website belongs to (v1 tiers)"},"brand_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Brand Name","description":"Name for the Brand a first scan creates (v1 tiers); default from the domain"},"reach":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reach","description":"local | regional | national | international; null = sector default"},"analysisId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Analysisid","description":"Existing analysis ID (UUID) to update (if provided)"},"sectorKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sectorkey","description":"Sector key from taxonomy (e.g. 'restaurants')"},"sectorLabel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sectorlabel","description":"User-confirmed sector label (free text, e.g. 'Italian Restaurant')"},"subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtype","description":"Sector subtype (e.g. 'Italian')"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location","description":"Business location (City/Area)"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"Legacy alias for location (City/Area)"},"locale":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Locale","description":"Locale (legacy/compat). Accepts string (e.g. 'nl-NL') or object like {country, language}."},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"Country hint (legacy/compat)"},"coreOffering":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coreoffering","description":"Core offering description"},"topServices":{"items":{"type":"string"},"type":"array","title":"Topservices","description":"List of top services (max 5)"},"language":{"type":"string","title":"Language","description":"Content language (default: nl)","default":"nl"},"serviceArea":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Servicearea","description":"Service area description"},"business_context":{"anyOf":[{"$ref":"#/components/schemas/BusinessContext"},{"type":"null"}],"description":"Structured business context: core offering, audience type, competitors"},"customer_questions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Customer Questions","description":"Up to 3 questions the customer wants the AI measurement to ask (joins the domain's own questions)"},"prescanData":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Prescandata","description":"Pre-scan results from /api/v1/prescan to avoid duplicate work"}},"type":"object","required":["url"],"title":"ScanRequest","description":"Request to scan a domain and calculate discoverability scores."},"ScanRescheduleRequest":{"properties":{"rescan_on":{"type":"string","title":"Rescan On"}},"type":"object","required":["rescan_on"],"title":"ScanRescheduleRequest"},"ScanRescheduleResponse":{"properties":{"id":{"type":"string","title":"Id"},"scheduled_at":{"type":"string","title":"Scheduled At"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","scheduled_at","status"],"title":"ScanRescheduleResponse"},"ScanResponse":{"properties":{"domain":{"type":"string","title":"Domain","description":"Domain that was scanned"},"scanned_at":{"type":"string","title":"Scanned At","description":"Scan timestamp (ISO 8601)"},"status":{"type":"string","title":"Status","description":"Scan status: completed, failed","default":"completed"},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id","description":"Unique analysis identifier (UUID) for this scan"},"sectorKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sectorkey","description":"Sector identifier (e.g., 'restaurants', 'construction_company')"},"subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtype","description":"Sector subtype (e.g., 'Italian', 'residential')"},"sector":{"anyOf":[{"$ref":"#/components/schemas/SectorInfo"},{"type":"null"}],"description":"Sector calibration data with taxonomy"},"sector_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sector Score","description":"Sector-calibrated score"},"scores":{"$ref":"#/components/schemas/ScanScores","description":"Component scores (technical, content, entities, authority, citations)"},"global_score":{"type":"integer","title":"Global Score","description":"Global discoverability score (0-100)"},"score":{"anyOf":[{"$ref":"#/components/schemas/ScoreResponse"},{"type":"null"}],"description":"Unified scoring model result (0-100 points total)"},"score_primary_source":{"anyOf":[{"type":"string","enum":["unified","v2"]},{"type":"null"}],"title":"Score Primary Source","description":"Which score is written into score.total_points (unified or v2)"},"score_primary_value":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Score Primary Value","description":"The value used as the primary score (mirrors score.total_points)"},"score_primary_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Score Primary Details","description":"Compact explanation of primary score selection (includes unified and v2 totals when available)"},"unifiedScoreV1":{"anyOf":[{"$ref":"#/components/schemas/UnifiedScoreV1"},{"type":"null"}],"description":"Canonical score envelope: observed if available else predicted (additive)."},"pillars":{"items":{"$ref":"#/components/schemas/PillarEvaluation"},"type":"array","title":"Pillars","description":"Pillar 2.0 evaluations (new architecture)"},"typedActions":{"items":{"$ref":"#/components/schemas/ActionItem"},"type":"array","title":"Typedactions","description":"Actions 2.0: Typed action items converted from legacy intent actions"},"pages_analyzed":{"type":"integer","title":"Pages Analyzed","description":"Number of pages crawled and analyzed"},"pages":{"items":{"$ref":"#/components/schemas/ScanPageInfo"},"type":"array","title":"Pages","description":"Information about crawled pages"},"insights":{"items":{"type":"string"},"type":"array","title":"Insights","description":"Key insights and recommendations"},"strengths":{"items":{"type":"string"},"type":"array","title":"Strengths","description":"Additive: positive findings derived deterministically from existing scan outputs"},"strengths_v1":{"items":{"$ref":"#/components/schemas/StrengthV1"},"type":"array","title":"Strengths V1","description":"Additive: structured strengths with minimal evidence pointers and crawl context"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Warnings intended to be visible in UI and exported artifacts"},"readinessTierV1":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Readinesstierv1","description":"Additive: readiness tier and reasons derived from observable scan outputs (starter|growing|mature)."},"improvementPotentialV1":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Improvementpotentialv1","description":"Additive: improvement potential points (0-30) and top expected-impact actions (rule-based)."},"scanHealthV1":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Scanhealthv1","description":"Additive: scan health classification for probe safety (ok|degraded|blocked) with reasons and inputs."},"calibrationEligibleV1":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Calibrationeligiblev1","description":"Additive: whether probes/calibration are allowed for this domain based on scan health."},"lighthouse_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lighthouse Status","description":"Status of Lighthouse fetch: ok | partial | failed"},"scan_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scan Stage","description":"queued | running | null (legacy API-run scan)"},"scan_attempt":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scan Attempt","description":"Worker claims so far (0 while queued, 1 or 2 once running)"},"queue":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Queue","description":"Only while queued: position, ahead, running, slots, eta_seconds, expected_start_at, median_scan_seconds, queued_at, worker_alive, worker_heartbeat_age_s"},"avif":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Avif","description":"AI Visibility Impact Framework breakdown: authority, verifiability, information, factual, overall"},"intent_results":{"anyOf":[{"$ref":"#/components/schemas/IntentResultsEnvelope"},{"type":"null"}],"description":"Intent scoring results for sector-specific intents (v1 - legacy)"},"intent_actions":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Intent Actions","description":"Intent-driven actionable recommendations (v1 - legacy)"},"intentResultsV2":{"anyOf":[{"$ref":"#/components/schemas/IntentResultsV2Envelope"},{"type":"null"}],"description":"Journey-based intent evaluation results (v2 - new architecture)"},"reportContentV1":{"anyOf":[{},{"type":"null"}],"title":"Reportcontentv1","description":"Structured professional report content (v1)"},"contentDetailsV2":{"anyOf":[{},{"type":"null"}],"title":"Contentdetailsv2","description":"Content pillar V2 analysis details with score, checks, and actions"},"trustDetailsV2":{"anyOf":[{},{"type":"null"}],"title":"Trustdetailsv2","description":"Trust pillar V2 analysis details with score, checks, and actions"},"intentDetailsV2":{"anyOf":[{},{"type":"null"}],"title":"Intentdetailsv2","description":"Intent pillar V2 analysis details with score, checks, actions, and coverage breakdown"},"aiPresenceDetailsV2":{"anyOf":[{},{"type":"null"}],"title":"Aipresencedetailsv2","description":"AI Presence pillar V2 analysis details with score, checks, actions, and probe-ready contract"},"aiMentionCheckV1":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Aimentioncheckv1","description":"Trends: AI visibility tracking data — mention check consensus and job status (async; auto-triggered after scan)."},"crawlPolicySnapshotV1":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Crawlpolicysnapshotv1","description":"Snapshot of Crawl V2 policy/budgets used for this scan (policy_v1)"},"raw_analysis":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Raw Analysis","description":"Raw analysis data including E-E-A-T signals"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["domain","scanned_at","scores","global_score","pages_analyzed"],"title":"ScanResponse","description":"Response with scan results and discoverability scores.\n\nThis model contains all data needed for Score, Actions, and Report steps:\n- Overall score and band (global_score, score)\n- Pillar evaluations with aspect breakdowns (pillars)\n- Typed action items with prioritization (typed_actions)\n- Sector context (sector_key, sector, sector_score)\n- Metadata (analysis_id, domain, scanned_at)"},"ScanScores":{"properties":{"overall":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Overall","description":"Overall discoverability score"},"technical":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Technical","description":"Technical SEO score"},"content":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Content","description":"Content quality score"},"entities":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Entities","description":"Entity recognition score"},"authority":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Authority","description":"Authority signals score"},"citations":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Citations","description":"AI citation readiness score"}},"type":"object","required":["overall","technical","content","entities","authority","citations"],"title":"ScanScores","description":"Discoverability scores from 0-100."},"ScansListResponse":{"properties":{"scans":{"items":{"$ref":"#/components/schemas/ScanItem"},"type":"array","title":"Scans"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["scans","total","page","limit"],"title":"ScansListResponse","description":"Response for GET /api/admin/scans"},"ScoreBucketItem":{"properties":{"range":{"type":"string","title":"Range"},"count":{"type":"integer","title":"Count"},"label":{"type":"string","title":"Label"}},"type":"object","required":["range","count","label"],"title":"ScoreBucketItem","description":"Score distribution bucket."},"ScoreDistributionResponse":{"properties":{"buckets":{"items":{"$ref":"#/components/schemas/ScoreBucketItem"},"type":"array","title":"Buckets"}},"type":"object","required":["buckets"],"title":"ScoreDistributionResponse","description":"Response for GET /api/admin/dashboard/score-distribution"},"ScoreResponse":{"properties":{"total_points":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Total Points","description":"Total points out of 100"},"entity":{"$ref":"#/components/schemas/PillarScoreResponse","description":"Entity pillar score (max 25 points)"},"content":{"$ref":"#/components/schemas/PillarScoreResponse","description":"Content pillar score (max 25 points)"},"relevance_reliability":{"$ref":"#/components/schemas/PillarScoreResponse","description":"Relevance & Reliability pillar score (max 30 points)"},"intent_coverage":{"$ref":"#/components/schemas/PillarScoreResponse","description":"Intent Coverage pillar score (max 20 points)"},"technical":{"$ref":"#/components/schemas/SubpillarScoreResponse","description":"Technical sub-pillar (max 10 points)"},"authority":{"$ref":"#/components/schemas/SubpillarScoreResponse","description":"Authority sub-pillar (max 10 points)"},"citations":{"$ref":"#/components/schemas/SubpillarScoreResponse","description":"Citations sub-pillar (max 10 points)"}},"type":"object","required":["total_points","entity","content","relevance_reliability","intent_coverage","technical","authority","citations"],"title":"ScoreResponse","description":"Unified scoring result: 0-100 points total.\nPoints distribution: Entity 25 + Content 25 + R&R 30 + Intent 20 = 100."},"ScoreTrendDataPoint":{"properties":{"timestamp":{"type":"string","title":"Timestamp"},"avg_score":{"type":"number","title":"Avg Score"},"scan_count":{"type":"integer","title":"Scan Count"}},"type":"object","required":["timestamp","avg_score","scan_count"],"title":"ScoreTrendDataPoint","description":"Single data point in score trend."},"ScoreTrendResponse":{"properties":{"data_points":{"items":{"$ref":"#/components/schemas/ScoreTrendDataPoint"},"type":"array","title":"Data Points"}},"type":"object","required":["data_points"],"title":"ScoreTrendResponse","description":"Response for GET /api/admin/dashboard/score-trend"},"ScoresBySectorResponse":{"properties":{"sectors":{"items":{"$ref":"#/components/schemas/SectorScoreItem"},"type":"array","title":"Sectors"}},"type":"object","required":["sectors"],"title":"ScoresBySectorResponse","description":"Response for GET /api/admin/dashboard/scores-by-sector"},"SearchInsightsResponse":{"properties":{"analysis_id":{"type":"string","title":"Analysis Id"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"sector_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector Key"},"language":{"type":"string","title":"Language","default":"nl"},"coverage_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Coverage Summary"},"intents":{"items":{"$ref":"#/components/schemas/IntentDiagnosis"},"type":"array","title":"Intents"},"ai_mentions_by_intent":{"additionalProperties":{"items":{"$ref":"#/components/schemas/AIModelMention"},"type":"array"},"type":"object","title":"Ai Mentions By Intent"},"suggested_actions_by_intent":{"additionalProperties":{"items":{"$ref":"#/components/schemas/SuggestedAction"},"type":"array"},"type":"object","title":"Suggested Actions By Intent"},"brainstormed_queries":{"anyOf":[{"$ref":"#/components/schemas/BrainstormResult"},{"type":"null"}]},"paa_enrichments_by_intent":{"additionalProperties":{"$ref":"#/components/schemas/PaaResult"},"type":"object","title":"Paa Enrichments By Intent"}},"type":"object","required":["analysis_id"],"title":"SearchInsightsResponse"},"SectorCreateRequest":{"properties":{"key":{"type":"string","maxLength":64,"minLength":2,"title":"Key"},"label":{"type":"string","maxLength":255,"minLength":1,"title":"Label"},"taxonomy_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Taxonomy Code"},"enabled":{"type":"boolean","title":"Enabled","default":true},"sort_order":{"type":"integer","title":"Sort Order","default":0}},"type":"object","required":["key","label"],"title":"SectorCreateRequest","description":"Request to create a sector."},"SectorInfo":{"properties":{"id":{"type":"string","title":"Id","description":"Sector identifier (e.g. 'hospitality', 'big_tech')"},"name":{"type":"string","title":"Name","description":"Human-readable sector name"},"baseline":{"type":"number","title":"Baseline","description":"Expected baseline score for this sector"},"ceiling":{"type":"number","title":"Ceiling","description":"Realistic maximum score for this sector"},"floor":{"type":"number","title":"Floor","description":"Minimum acceptable score for this sector"},"position_label":{"type":"string","title":"Position Label","description":"Position relative to peers (e.g. 'Ahead of peers')"},"delta_from_baseline":{"type":"number","title":"Delta From Baseline","description":"Score difference from sector baseline"},"taxonomy":{"anyOf":[{"$ref":"#/components/schemas/SectorTaxonomy"},{"type":"null"}],"description":"Standardized taxonomy mapping (sector code, industry code, names)"}},"type":"object","required":["id","name","baseline","ceiling","floor","position_label","delta_from_baseline"],"title":"SectorInfo","description":"Sector-specific calibration information."},"SectorIntentCreateRequest":{"properties":{"question":{"type":"string","maxLength":500,"minLength":1,"title":"Question"},"enabled":{"type":"boolean","title":"Enabled","default":true},"priority":{"type":"integer","title":"Priority","default":0},"intent_type":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Intent Type"}},"type":"object","required":["question"],"title":"SectorIntentCreateRequest","description":"Request to create a sector intent."},"SectorIntentResponse":{"properties":{"id":{"type":"string","title":"Id"},"sector_key":{"type":"string","title":"Sector Key"},"question":{"type":"string","title":"Question"},"enabled":{"type":"boolean","title":"Enabled"},"priority":{"type":"integer","title":"Priority"},"intent_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent Type"}},"type":"object","required":["id","sector_key","question","enabled","priority"],"title":"SectorIntentResponse","description":"Sector intent item in response."},"SectorIntentUpdateRequest":{"properties":{"question":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Question"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"intent_type":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Intent Type"}},"type":"object","title":"SectorIntentUpdateRequest","description":"Request to update a sector intent."},"SectorResponse":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"taxonomy_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Taxonomy Code"},"enabled":{"type":"boolean","title":"Enabled"},"sort_order":{"type":"integer","title":"Sort Order"},"intents_count":{"type":"integer","title":"Intents Count","default":0},"has_intents_v2":{"type":"boolean","title":"Has Intents V2","default":false}},"type":"object","required":["key","label","enabled","sort_order"],"title":"SectorResponse","description":"Sector item in admin response."},"SectorScoreItem":{"properties":{"sector_key":{"type":"string","title":"Sector Key"},"sector_name":{"type":"string","title":"Sector Name"},"avg_score":{"type":"number","title":"Avg Score"},"scan_count":{"type":"integer","title":"Scan Count"},"trend":{"type":"string","title":"Trend"}},"type":"object","required":["sector_key","sector_name","avg_score","scan_count","trend"],"title":"SectorScoreItem","description":"Sector score summary."},"SectorTaxonomy":{"properties":{"sector_code":{"type":"string","title":"Sector Code","description":"Top-level sector code (e.g., '23' for Construction)"},"sector_name":{"type":"string","title":"Sector Name","description":"Human-readable sector name (e.g., 'Construction')"},"industry_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry Code","description":"More specific industry code (e.g., '236' for Construction of Buildings)"},"industry_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry Name","description":"Human-readable industry name"},"level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level","description":"Taxonomy level: 'sector', 'industry', 'subindustry', 'type'"}},"type":"object","required":["sector_code","sector_name"],"title":"SectorTaxonomy","description":"Mapping of internal sector to standardized taxonomy.\n\nLinks our internal sector keys (e.g., 'construction_company') to the\nofficial industry taxonomy from industries_expanded.csv.\n\nExample for construction_company:\n    sector_code: \"23\"\n    sector_name: \"Construction\"\n    industry_code: \"236\"\n    industry_name: \"Construction of Buildings\"\n    level: \"industry\"\n\nThis allows us to:\n- Use friendly internal keys like 'construction_company'\n- Map to standardized industry codes for reporting\n- Support future integrations with industry databases"},"SectorUpdateRequest":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Label"},"taxonomy_code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Taxonomy Code"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"sort_order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sort Order"}},"type":"object","title":"SectorUpdateRequest","description":"Request to update a sector."},"SetWebsitePropertyRequest":{"properties":{"site_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Url"}},"type":"object","title":"SetWebsitePropertyRequest"},"SetupIdentitySuggestion":{"properties":{"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionSuggestion"},{"type":"null"}],"description":"None when the model gave no usable sentence or was unavailable"}},"type":"object","title":"SetupIdentitySuggestion"},"SetupSectionUnavailable":{"properties":{"section":{"type":"string","enum":["themes","identity"],"title":"Section"},"code":{"type":"string","enum":["llm_not_configured","llm_failed"],"title":"Code"}},"type":"object","required":["section","code"],"title":"SetupSectionUnavailable"},"SetupSuggestRequest":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"One sentence: when should AI mention or recommend this profile"},"markets":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Markets","description":"Region or market; optional and context-dependent"},"audiences":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Audiences"},"language":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Language"}},"additionalProperties":false,"type":"object","title":"SetupSuggestRequest","description":"One button in the wizard. Same overrides as the theme suggestion:\nwhat the wizard holds but has not saved yet wins for this call only,\nand nothing is stored."},"SetupSuggestResponse":{"properties":{"identity":{"$ref":"#/components/schemas/SetupIdentitySuggestion"},"themes":{"items":{"$ref":"#/components/schemas/ThemeCandidate"},"type":"array","title":"Themes","description":"Same shape as POST /themes/suggest"},"alternatives":{"items":{"$ref":"#/components/schemas/AlternativeSuggestion"},"type":"array","title":"Alternatives"},"websites":{"items":{"$ref":"#/components/schemas/WebsiteSuggestion"},"type":"array","title":"Websites"},"channels":{"items":{"$ref":"#/components/schemas/ChannelSuggestion"},"type":"array","title":"Channels"},"language":{"type":"string","title":"Language"},"website_context_used":{"type":"boolean","title":"Website Context Used","description":"A scanned linked website grounded the themes and the identity","default":false},"model":{"type":"string","title":"Model"},"unavailable":{"items":{"$ref":"#/components/schemas/SetupSectionUnavailable"},"type":"array","title":"Unavailable","description":"Sections the model could not fill; empty on full success"},"dropped_leaks":{"type":"integer","title":"Dropped Leaks","description":"Theme example questions dropped because they named the profile","default":0},"dropped_invalid":{"type":"integer","title":"Dropped Invalid","description":"Alternatives dropped because they did not fit the schema","default":0},"dropped_known":{"type":"integer","title":"Dropped Known","description":"Alternatives dropped because they named the profile, an alias, a linked website or an alternative it already has","default":0}},"type":"object","required":["language","model"],"title":"SetupSuggestResponse","description":"Proposals grouped by the sections the customer already knows. Always\n200 for a valid profile: a section the model could not fill is listed in\n``unavailable`` and comes back empty, the others are still filled, and\nmanual setup stays possible in every case."},"ShiftAction":{"properties":{"action_type":{"type":"string","enum":["respond_to_negative_source","strengthen_mixed_source","update_homepage_hero","refine_positioning_copy","improve_site_authority","place_content_on_source"],"title":"Action Type"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"severity":{"type":"string","enum":["high","medium","low"],"title":"Severity"},"target_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Url"},"target_source_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Source Class"},"drift_aspect":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Drift Aspect"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"destination":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Destination"}},"type":"object","required":["action_type","title","description","severity"],"title":"ShiftAction","description":"One concrete recommendation surfaced to the customer."},"ShiftActionsReport":{"properties":{"status":{"type":"string","enum":["ok","no_data","tier_locked","error"],"title":"Status","default":"ok"},"actions":{"items":{"$ref":"#/components/schemas/ShiftAction"},"type":"array","title":"Actions"},"insights":{"items":{"$ref":"#/components/schemas/ShiftInsight"},"type":"array","title":"Insights"},"computed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Computed At"},"tier_required":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier Required"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"ShiftActionsReport"},"ShiftInsight":{"properties":{"action_type":{"type":"string","enum":["respond_to_negative_source","strengthen_mixed_source","update_homepage_hero","refine_positioning_copy","improve_site_authority","place_content_on_source"],"title":"Action Type"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"reason":{"type":"string","title":"Reason"},"target_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Url"},"target_source_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Source Class"}},"type":"object","required":["action_type","title","description","reason"],"title":"ShiftInsight","description":"A source worth knowing about that produces no action.\n\n\"Get a real mention placed on X\" carries the url AI cited, which is why it\nstays visible. Whether it is also a task depends on the host, not on the\narchetype: with a channel to pitch through it is an action, without one it\nis this — a finding with `no_channel`. Who decides the outcome stopped\nbeing part of that judgement on 2026-09-21\n(app.domain.offsite_actionability_v1)."},"SourceAnalysis":{"properties":{"url":{"type":"string","title":"Url"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"source_class":{"type":"string","enum":["own_site","review_platform","directory","news","social","forum_reddit","other"],"title":"Source Class"},"cited_in_n_intents":{"type":"integer","title":"Cited In N Intents","default":0},"status":{"type":"string","enum":["ok","unavailable","not_about_brand","mismatched_sibling_brand"],"title":"Status","default":"ok"},"brand_quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Quote"},"sentiment":{"type":"string","enum":["positive","neutral","negative","mixed","unknown"],"title":"Sentiment","default":"unknown"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","default":0.5},"fetched_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fetched At"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"matched_brand_instead":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Brand Instead"}},"type":"object","required":["url","source_class"],"title":"SourceAnalysis","description":"One analyzed citation URL.\n\n``status`` distinguishes a usable analysis from a fetch/LLM failure:\n- ``ok``           — page fetched, LLM extracted a brand_quote + sentiment\n- ``unavailable``  — non-200 / paywall / dead URL; ``brand_quote``/``sentiment`` empty\n- ``not_about_brand`` — page did not actually mention the brand; we\n  preserve the row so the UI can show \"AI cited this URL even though\n  it's not about you\" but mark sentiment=\"unknown\"\n- ``mismatched_sibling_brand`` — the page DOES mention a brand, but\n  it's a sibling brand (Findable / Findalyze / Finalyse on a Findalyse\n  scan, etc.) rather than the actual scanned brand. Surfaced so the\n  UI can flag \"AI cited this URL but it's actually about <other_brand>\"\n  and the user understands the AI confusion explicitly."},"SourceClassBreakdown":{"properties":{"source_class":{"type":"string","enum":["own_site","review_platform","directory","news","social","forum_reddit","other"],"title":"Source Class"},"total_sources":{"type":"integer","title":"Total Sources","default":0},"total_citations":{"type":"integer","title":"Total Citations","default":0},"sentiment_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Sentiment Counts"}},"type":"object","required":["source_class"],"title":"SourceClassBreakdown","description":"Aggregated rollup per source_class for the UI's hero numbers."},"SourceConfirmRequest":{"properties":{"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"additionalProperties":false,"type":"object","title":"SourceConfirmRequest"},"SourceSuggestion":{"properties":{"source_type":{"type":"string","title":"Source Type"},"type_label":{"type":"string","title":"Type Label"},"check_mode":{"type":"string","title":"Check Mode"},"recommended_for":{"type":"string","title":"Recommended For"}},"type":"object","required":["source_type","type_label","check_mode","recommended_for"],"title":"SourceSuggestion"},"SparseModeNotice":{"properties":{"active":{"type":"boolean","title":"Active"},"sources_present_count":{"type":"integer","title":"Sources Present Count"},"missing_sources":{"items":{"type":"string"},"type":"array","title":"Missing Sources"},"message":{"type":"string","title":"Message"},"source_states":{"additionalProperties":{"type":"string"},"type":"object","title":"Source States"}},"type":"object","required":["active","sources_present_count","message"],"title":"SparseModeNotice","description":"Banner content when the gate loosened for sparse-data domains."},"StrengthV1":{"properties":{"id":{"type":"string","title":"Id","description":"Stable strength identifier"},"pillar":{"type":"string","title":"Pillar","description":"Pillar key or grouping label (string for now)"},"title":{"type":"string","title":"Title","description":"Short human title"},"summary":{"type":"string","title":"Summary","description":"Evidence-based summary"},"evidence_urls":{"items":{"type":"string"},"type":"array","title":"Evidence Urls","description":"Optional bounded URL pointers (max 3)"},"evidenceRefs":{"items":{"type":"string"},"type":"array","title":"Evidencerefs","description":"Additive: bounded evidence URL references (max 3)"},"evidence_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Evidence Counts","description":"Small stable counts derived from crawl/signal outputs"},"evidence_snippets":{"items":{"type":"string"},"type":"array","title":"Evidence Snippets","description":"Optional bounded evidence snippets derived from content chunks (max 3, each <= 200 chars)"},"evidence_hashes":{"items":{"type":"string"},"type":"array","title":"Evidence Hashes","description":"Optional bounded sha256 hashes for evidence_snippets (max 3)"}},"type":"object","required":["id","pillar","title","summary"],"title":"StrengthV1","description":"Structured Strength item (v1).\n\nAdditive-only contract. Intended to provide minimal evidence pointers\nand crawl context without changing existing strengths: List[str]."},"StripeLinkRequest":{"properties":{"stripe_customer_id":{"type":"string","minLength":4,"title":"Stripe Customer Id"},"stripe_subscription_id":{"type":"string","minLength":4,"title":"Stripe Subscription Id"}},"additionalProperties":false,"type":"object","required":["stripe_customer_id","stripe_subscription_id"],"title":"StripeLinkRequest"},"StripeLinkResponse":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id"},"stripe_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Subscription Id"},"previous_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Customer Id"},"previous_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Subscription Id"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"purchased_addon_domains":{"type":"integer","title":"Purchased Addon Domains","default":0},"purchased_addon_seats":{"type":"integer","title":"Purchased Addon Seats","default":0},"purchased_addon_brands":{"type":"integer","title":"Purchased Addon Brands","default":0}},"type":"object","required":["workspace_id"],"title":"StripeLinkResponse"},"SubpillarScoreResponse":{"properties":{"name":{"type":"string","title":"Name","description":"Sub-pillar name"},"percent":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Percent","description":"Percentage score 0-100"},"points":{"type":"integer","minimum":0.0,"title":"Points","description":"Points awarded"},"max_points":{"type":"integer","minimum":0.0,"title":"Max Points","description":"Maximum possible points"}},"type":"object","required":["name","percent","points","max_points"],"title":"SubpillarScoreResponse","description":"Individual sub-pillar score (e.g. Technical, Authority, Citations)."},"SubscriptionItem":{"properties":{"plan":{"type":"string","title":"Plan"},"count":{"type":"integer","title":"Count"},"percentage":{"type":"number","title":"Percentage"},"mrr":{"type":"integer","title":"Mrr"}},"type":"object","required":["plan","count","percentage","mrr"],"title":"SubscriptionItem","description":"Subscription plan summary."},"SubscriptionResponse":{"properties":{"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","default":false},"usage":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Usage"},"addons":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Addons"},"trial":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Trial"},"scan_quota":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Scan Quota"},"prices":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Prices"}},"type":"object","title":"SubscriptionResponse"},"SubscriptionsResponse":{"properties":{"subscriptions":{"items":{"$ref":"#/components/schemas/SubscriptionItem"},"type":"array","title":"Subscriptions"},"total_workspaces":{"type":"integer","title":"Total Workspaces"},"total_mrr":{"type":"integer","title":"Total Mrr"},"note":{"type":"string","title":"Note","default":"MRR is placeholder data, not connected to real billing"}},"type":"object","required":["subscriptions","total_workspaces","total_mrr"],"title":"SubscriptionsResponse","description":"Response for GET /api/admin/dashboard/subscriptions"},"SuggestedAction":{"properties":{"id":{"type":"string","title":"Id"},"action_key":{"type":"string","title":"Action Key"},"pillar_key":{"type":"string","title":"Pillar Key"},"severity":{"type":"string","title":"Severity"},"impact":{"type":"string","title":"Impact"},"effort":{"type":"string","title":"Effort"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"why_it_matters":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Why It Matters"},"how_to_fix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"How To Fix"}},"type":"object","required":["id","action_key","pillar_key","severity","impact","effort"],"title":"SuggestedAction","description":"One `typed_actions` entry reduced to the fields the UI renders."},"SynthesizedBrief":{"properties":{"one_line_pitch":{"type":"string","title":"One Line Pitch"},"brief_text":{"type":"string","title":"Brief Text"},"input_data_hash":{"type":"string","title":"Input Data Hash"},"model":{"type":"string","title":"Model"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"generated_by_fallback":{"type":"boolean","title":"Generated By Fallback","default":false}},"type":"object","required":["one_line_pitch","brief_text","input_data_hash","model"],"title":"SynthesizedBrief","description":"Part 3 — LLM-written 3–4 sentence personalized brief.\n\n``input_data_hash`` is the cache key — any change to the inputs\n(evidence, recipe, business_context) produces a new hash and a new\nbrief. ``generated_by_fallback=True`` means the LLM call failed and\nthe brief was assembled from the recipe + evidence summary."},"SystemHealthSubmetrics":{"properties":{"error_rate_24h":{"type":"integer","title":"Error Rate 24H","description":"Total errors in last 24h"},"p95_latency_ms":{"type":"integer","title":"P95 Latency Ms","description":"P95 latency in milliseconds"},"uptime_percent":{"type":"number","title":"Uptime Percent","description":"Uptime percentage"},"status":{"type":"string","title":"Status","description":"Overall status: green | yellow | red"}},"type":"object","required":["error_rate_24h","p95_latency_ms","uptime_percent","status"],"title":"SystemHealthSubmetrics","description":"System health submetrics."},"TaskItem":{"properties":{"action_id":{"type":"string","title":"Action Id"},"analysis_id":{"type":"string","title":"Analysis Id"},"domain":{"type":"string","title":"Domain"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"type":"string","title":"Status"},"assigned_to_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To User Id"},"assigned_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned By User Id"},"assigned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Assigned At"},"assignment_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Note"},"due_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due At"},"is_stale_scan":{"type":"boolean","title":"Is Stale Scan","default":false},"scan_created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scan Created At"},"source":{"type":"string","title":"Source","default":"scan"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"},"profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Id"},"profile_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Name"},"done_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Done Source"},"resolved_by_scan":{"type":"boolean","title":"Resolved By Scan","default":false},"impact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Impact"}},"type":"object","required":["action_id","analysis_id","domain","status"],"title":"TaskItem"},"TasksResponse":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/TaskItem"},"type":"array","title":"Tasks"},"domains":{"items":{"type":"string"},"type":"array","title":"Domains"}},"type":"object","required":["tasks","domains"],"title":"TasksResponse"},"TestSendRequest":{"properties":{"email":{"type":"string","title":"Email","description":"Recipient address for the test email"},"variables":{"additionalProperties":{"type":"string"},"type":"object","title":"Variables","description":"Variable values to interpolate, e.g. {\"domain\": \"example.com\"}"}},"type":"object","required":["email"],"title":"TestSendRequest"},"ThemeCandidate":{"properties":{"theme_key":{"type":"string","title":"Theme Key"},"label":{"type":"string","title":"Label"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"user_need":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Need"},"example_questions":{"items":{"type":"string"},"type":"array","title":"Example Questions"},"status":{"type":"string","title":"Status","default":"suggested"},"source":{"type":"string","title":"Source","default":"generated"}},"type":"object","required":["theme_key","label"],"title":"ThemeCandidate"},"ThemeIn":{"properties":{"theme_key":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Theme Key","description":"Keeps identity across edits; omit for a new theme"},"label":{"type":"string","maxLength":120,"title":"Label"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"},"user_need":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"User Need"},"audiences":{"items":{"type":"string"},"type":"array","title":"Audiences"},"context":{"additionalProperties":true,"type":"object","title":"Context"},"example_questions":{"items":{"type":"string"},"type":"array","title":"Example Questions"},"status":{"type":"string","enum":["suggested","active","archived"],"title":"Status","default":"active"},"source":{"anyOf":[{"type":"string","enum":["generated","user"]},{"type":"null"}],"title":"Source"}},"additionalProperties":false,"type":"object","required":["label"],"title":"ThemeIn"},"ThemeOut":{"properties":{"id":{"type":"string","title":"Id"},"theme_key":{"type":"string","title":"Theme Key"},"label":{"type":"string","title":"Label"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"user_need":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Need"},"audiences":{"items":{"type":"string"},"type":"array","title":"Audiences"},"context":{"additionalProperties":true,"type":"object","title":"Context"},"example_questions":{"items":{"type":"string"},"type":"array","title":"Example Questions"},"status":{"type":"string","title":"Status"},"source":{"type":"string","title":"Source"},"sort_order":{"type":"integer","title":"Sort Order","default":0},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","theme_key","label","status","source"],"title":"ThemeOut"},"ThemeSuggestRequest":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"One sentence: when should AI mention or recommend this profile"},"markets":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Markets","description":"Region or market; optional and context-dependent"},"audiences":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Audiences"},"language":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Language"}},"additionalProperties":false,"type":"object","title":"ThemeSuggestRequest","description":"Step 2 of the setup. Every field is optional: the profile's stored\nvalues are used when a field is omitted; a sent field overrides for this\ncall only and is not stored (the wizard saves through PUT /profiles/{id})."},"ThemeSuggestResponse":{"properties":{"candidates":{"items":{"$ref":"#/components/schemas/ThemeCandidate"},"type":"array","title":"Candidates"},"dropped_leaks":{"type":"integer","title":"Dropped Leaks","description":"Example questions dropped because they named the profile","default":0},"model":{"type":"string","title":"Model"},"language":{"type":"string","title":"Language"},"max_themes":{"type":"integer","title":"Max Themes"},"website_context_used":{"type":"boolean","title":"Website Context Used","default":false}},"type":"object","required":["model","language","max_themes"],"title":"ThemeSuggestResponse"},"ThemesPutRequest":{"properties":{"themes":{"items":{"$ref":"#/components/schemas/ThemeIn"},"type":"array","title":"Themes"}},"additionalProperties":false,"type":"object","title":"ThemesPutRequest"},"ThemesResponse":{"properties":{"profile_id":{"type":"string","title":"Profile Id"},"themes":{"items":{"$ref":"#/components/schemas/ThemeOut"},"type":"array","title":"Themes"},"active_count":{"type":"integer","title":"Active Count"},"max_themes":{"type":"integer","title":"Max Themes"},"fingerprints":{"additionalProperties":{"type":"string"},"type":"object","title":"Fingerprints"}},"type":"object","required":["profile_id","active_count","max_themes"],"title":"ThemesResponse"},"TierModelLimit":{"properties":{"max_models":{"type":"integer","minimum":1.0,"title":"Max Models"},"llm_budget":{"type":"integer","minimum":0.0,"title":"Llm Budget","description":"Monthly LLM budget in euro cents"},"allowed_models":{"items":{"type":"string"},"type":"array","title":"Allowed Models","description":"Which AI models this tier can use"}},"additionalProperties":false,"type":"object","required":["max_models","llm_budget"],"title":"TierModelLimit"},"TierModelLimitPatch":{"properties":{"max_models":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Models"},"llm_budget":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Llm Budget","description":"Monthly LLM budget in euro cents"},"allowed_models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Models","description":"Which AI models this tier can use"}},"additionalProperties":false,"type":"object","title":"TierModelLimitPatch"},"TierPresenceLimits":{"properties":{"profiles_included":{"type":"integer","title":"Profiles Included"},"profiles_allowed":{"type":"integer","title":"Profiles Allowed"},"profiles_active":{"type":"integer","title":"Profiles Active"},"runs_per_profile_per_month":{"type":"integer","title":"Runs Per Profile Per Month"},"max_themes":{"type":"integer","title":"Max Themes"},"prompts_per_theme":{"type":"integer","title":"Prompts Per Theme"},"max_prompts":{"type":"integer","title":"Max Prompts"},"models":{"items":{"type":"string"},"type":"array","title":"Models"},"channels":{"items":{"type":"string"},"type":"array","title":"Channels"}},"type":"object","required":["profiles_included","profiles_allowed","profiles_active","runs_per_profile_per_month","max_themes","prompts_per_theme","max_prompts"],"title":"TierPresenceLimits","description":"What the workspace's plan allows; the wizard reads this before creating."},"TimelineDataPoint":{"properties":{"date":{"type":"string","title":"Date"},"success_count":{"type":"integer","title":"Success Count"},"fail_count":{"type":"integer","title":"Fail Count"}},"type":"object","required":["date","success_count","fail_count"],"title":"TimelineDataPoint","description":"Daily scan stats."},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"}},"type":"object","required":["access_token","token_type"],"title":"Token"},"ToolRunRequest":{"properties":{"analysis_id":{"type":"string","title":"Analysis Id","description":"Analysis.analysis_id"},"tool_key":{"type":"string","title":"Tool Key","description":"ai_prompt_lab|authority_index|market_gaps|topic_strategy|momentum"},"model_id":{"type":"string","minLength":1,"title":"Model Id"},"prompt_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Text","description":"Required for ai_prompt_lab"},"sector_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector Key","description":"Optional override; defaults to analysis.sector"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"Optional {{city}} substitution for intent question templates"},"max_items":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Items","default":25},"max_tokens":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Tokens","default":5000},"hard_timeout_seconds":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Hard Timeout Seconds","default":300}},"type":"object","required":["analysis_id","tool_key","model_id"],"title":"ToolRunRequest"},"TopErrorItem":{"properties":{"error_type":{"type":"string","title":"Error Type"},"count":{"type":"integer","title":"Count"},"last_seen":{"type":"string","title":"Last Seen"}},"type":"object","required":["error_type","count","last_seen"],"title":"TopErrorItem","description":"Individual error item."},"TopErrorsResponse":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/TopErrorItem"},"type":"array","title":"Errors"}},"type":"object","required":["errors"],"title":"TopErrorsResponse","description":"Response for GET /api/admin/dashboard/top-errors"},"TopWorkspacesResponse":{"properties":{"workspaces":{"items":{"$ref":"#/components/schemas/WorkspaceItem"},"type":"array","title":"Workspaces"}},"type":"object","required":["workspaces"],"title":"TopWorkspacesResponse","description":"Response for GET /api/admin/dashboard/top-workspaces"},"UnifiedEmailItem":{"properties":{"id":{"type":"string","title":"Id"},"source":{"type":"string","title":"Source"},"to_email":{"type":"string","title":"To Email"},"from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Email"},"subject":{"type":"string","title":"Subject"},"email_type":{"type":"string","title":"Email Type"},"status":{"type":"string","title":"Status"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id"},"created_at":{"type":"string","title":"Created At"},"provider_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Message Id"},"last_event":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Event"},"scheduled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled At"},"queued_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Queued By"},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type"},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Id"},"sent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent At"},"cancelled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancelled At"},"retry_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retry Count"}},"type":"object","required":["id","source","to_email","subject","email_type","status","created_at"],"title":"UnifiedEmailItem","description":"A single email record from either sent_emails or mail_queue."},"UnifiedEmailsListResponse":{"properties":{"emails":{"items":{"$ref":"#/components/schemas/UnifiedEmailItem"},"type":"array","title":"Emails"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["emails","total","page","limit"],"title":"UnifiedEmailsListResponse","description":"Response for GET /api/admin/emails"},"UnifiedScoreV1":{"properties":{"score_value_0_100":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Score Value 0 100","description":"Canonical score in [0, 100]"},"score_source":{"type":"string","enum":["observed","predicted"],"title":"Score Source","description":"Which source produced score_value_0_100"},"confidence_0_1":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence 0 1","description":"Confidence proxy in [0, 1]"},"source_refs":{"additionalProperties":true,"type":"object","title":"Source Refs","description":"Source references (observed_job_id, predicted_source)"}},"type":"object","required":["score_value_0_100","score_source","confidence_0_1"],"title":"UnifiedScoreV1","description":"Canonical score envelope for API consumers.\n\nSelection rule:\n- Prefer observed (raw_analysis.observed_visibility_v1) when present and the referenced job is DONE.\n- Otherwise fall back to predicted (existing score_primary_* fields)."},"UnreadCountResponse":{"properties":{"count":{"type":"integer","title":"Count"}},"type":"object","required":["count"],"title":"UnreadCountResponse"},"UpdateProfileRequest":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email_on_task_assigned":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email On Task Assigned"}},"type":"object","title":"UpdateProfileRequest"},"UptimeData":{"properties":{"uptime_percent_30d":{"type":"number","title":"Uptime Percent 30D"},"trend":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Trend"},"incidents":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Incidents"}},"type":"object","required":["uptime_percent_30d","trend","incidents"],"title":"UptimeData","description":"Uptime metrics."},"UserCreateRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"captchaToken":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Captchatoken"},"ui_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ui Language"}},"type":"object","required":["email","password"],"title":"UserCreateRequest"},"UserDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"is_active":{"type":"boolean","title":"Is Active"},"is_verified":{"type":"boolean","title":"Is Verified"},"is_system_admin":{"type":"boolean","title":"Is System Admin"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"workspaces":{"items":{"$ref":"#/components/schemas/UserWorkspaceMembership"},"type":"array","title":"Workspaces"},"scan_count":{"type":"integer","title":"Scan Count"},"recent_events":{"items":{"$ref":"#/components/schemas/UserEventItem"},"type":"array","title":"Recent Events"}},"type":"object","required":["id","email","full_name","is_active","is_verified","is_system_admin","created_at","updated_at","workspaces","scan_count","recent_events"],"title":"UserDetailResponse","description":"Response for GET /api/admin/users/{id}"},"UserEventItem":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"action":{"type":"string","title":"Action"},"success":{"type":"boolean","title":"Success"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","email","user_id","action","success","detail","ip_address","user_agent","created_at"],"title":"UserEventItem","description":"Individual user event (audit log entry)."},"UserEventsListResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/UserEventItem"},"type":"array","title":"Events"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["events","total","page","limit"],"title":"UserEventsListResponse","description":"Response for GET /api/admin/user-events"},"UserListItem":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"is_active":{"type":"boolean","title":"Is Active"},"is_verified":{"type":"boolean","title":"Is Verified"},"is_system_admin":{"type":"boolean","title":"Is System Admin"},"workspace_count":{"type":"integer","title":"Workspace Count"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","email","full_name","is_active","is_verified","is_system_admin","workspace_count","created_at","updated_at"],"title":"UserListItem","description":"Individual user in the admin user list."},"UserPatchRequest":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name","description":"Display name"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Enable / disable user"},"is_verified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Verified","description":"Email-verified flag"},"is_system_admin":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is System Admin","description":"Promote / demote to system admin"}},"type":"object","title":"UserPatchRequest","description":"Request body for PATCH /api/admin/users/{id}\n\nAll fields are optional – only supplied fields are updated."},"UserPatchResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"is_active":{"type":"boolean","title":"Is Active"},"is_verified":{"type":"boolean","title":"Is Verified"},"is_system_admin":{"type":"boolean","title":"Is System Admin"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","email","full_name","is_active","is_verified","is_system_admin","updated_at"],"title":"UserPatchResponse","description":"Response for PATCH /api/admin/users/{id}"},"UserResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"avatar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar"},"is_active":{"type":"boolean","title":"Is Active"},"is_verified":{"type":"boolean","title":"Is Verified","default":false},"is_superuser":{"type":"boolean","title":"Is Superuser","default":false},"is_system_admin":{"type":"boolean","title":"Is System Admin","default":false},"welcome_tour_seen":{"type":"boolean","title":"Welcome Tour Seen","default":false},"quota_modal_seen_period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quota Modal Seen Period"},"email_on_task_assigned":{"type":"boolean","title":"Email On Task Assigned","default":true},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","is_active","created_at"],"title":"UserResponse"},"UserWorkspaceMembership":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"workspace_name":{"type":"string","title":"Workspace Name"},"role":{"type":"string","title":"Role"},"joined_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Joined At"}},"type":"object","required":["workspace_id","workspace_name","role","joined_at"],"title":"UserWorkspaceMembership","description":"Workspace membership for a user."},"UsersListResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/UserListItem"},"type":"array","title":"Users"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["users","total","page","limit"],"title":"UsersListResponse","description":"Response for GET /api/admin/users"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebsitePropertyItem":{"properties":{"domain":{"type":"string","title":"Domain"},"site_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Url"},"match_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Kind"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"verified_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verified At"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"}},"type":"object","required":["domain"],"title":"WebsitePropertyItem"},"WebsiteSuggestion":{"properties":{"domain":{"type":"string","title":"Domain"},"is_primary":{"type":"boolean","title":"Is Primary","default":false},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["domain","reason"],"title":"WebsiteSuggestion","description":"Only ever a website already linked to the profile; this product never invents a domain."},"WebsitesArchiveRequest":{"properties":{"domains":{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1,"title":"Domains"},"archived":{"type":"boolean","title":"Archived","default":true},"dry_run":{"type":"boolean","title":"Dry Run","default":true}},"additionalProperties":false,"type":"object","required":["domains"],"title":"WebsitesArchiveRequest"},"WebsitesResponse":{"properties":{"connected":{"type":"boolean","title":"Connected","default":false},"websites":{"items":{"$ref":"#/components/schemas/WebsitePropertyItem"},"type":"array","title":"Websites"}},"type":"object","title":"WebsitesResponse"},"WorkerJobDetailResponse":{"properties":{"item":{"$ref":"#/components/schemas/WorkerJobItem"}},"type":"object","required":["item"],"title":"WorkerJobDetailResponse"},"WorkerJobItem":{"properties":{"id":{"type":"string","title":"Id"},"job_type":{"type":"string","title":"Job Type"},"job_ref_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Ref Id"},"worker_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Worker Id"},"status":{"type":"string","title":"Status"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"input_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Summary"},"output_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output Summary"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"workspace":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"},"analysis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis"},"tokens_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens In"},"tokens_out":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens Out"},"cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Usd"}},"type":"object","required":["id","job_type","status"],"title":"WorkerJobItem"},"WorkerJobsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WorkerJobItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["items","total","page","limit"],"title":"WorkerJobsListResponse"},"WorkspaceBudgetInfo":{"properties":{"budget_cents":{"type":"integer","title":"Budget Cents"},"used_cents":{"type":"integer","title":"Used Cents"},"calls":{"type":"integer","title":"Calls"},"percent_used":{"type":"number","title":"Percent Used"},"has_override":{"type":"boolean","title":"Has Override"},"source":{"type":"string","title":"Source"}},"type":"object","required":["budget_cents","used_cents","calls","percent_used","has_override","source"],"title":"WorkspaceBudgetInfo","description":"LLM budget info for a workspace."},"WorkspaceCreateRequest":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"WorkspaceCreateRequest"},"WorkspaceDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"owner_email":{"type":"string","title":"Owner Email"},"plan":{"type":"string","title":"Plan"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_disabled":{"type":"boolean","title":"Is Disabled"},"user_count":{"type":"integer","title":"User Count"},"scan_count":{"type":"integer","title":"Scan Count"},"last_activity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Activity"},"created_at":{"type":"string","title":"Created At"},"users":{"items":{"$ref":"#/components/schemas/WorkspaceUserItem"},"type":"array","title":"Users"},"scans":{"items":{"$ref":"#/components/schemas/WorkspaceScanItem"},"type":"array","title":"Scans"},"budget":{"anyOf":[{"$ref":"#/components/schemas/WorkspaceBudgetInfo"},{"type":"null"}]},"brands":{"items":{"$ref":"#/components/schemas/AdminBrandItem"},"type":"array","title":"Brands","default":[]},"brand_slots":{"anyOf":[{"$ref":"#/components/schemas/AdminBrandSlots"},{"type":"null"}]}},"type":"object","required":["id","name","owner_email","plan","notes","is_disabled","user_count","scan_count","last_activity","created_at","users","scans"],"title":"WorkspaceDetailResponse","description":"Response for GET /api/admin/workspaces/{id}"},"WorkspaceHealthMetadata":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"plan":{"type":"string","title":"Plan"},"created_at":{"type":"string","title":"Created At"},"user_count":{"type":"integer","title":"User Count"}},"type":"object","required":["id","name","plan","created_at","user_count"],"title":"WorkspaceHealthMetadata","description":"Workspace metadata."},"WorkspaceHealthResponse":{"properties":{"workspace":{"$ref":"#/components/schemas/WorkspaceHealthMetadata"},"scans":{"$ref":"#/components/schemas/WorkspaceScansStats"},"failure_breakdown":{"items":{"$ref":"#/components/schemas/FailureBreakdownItem"},"type":"array","title":"Failure Breakdown"},"timeline":{"items":{"$ref":"#/components/schemas/TimelineDataPoint"},"type":"array","title":"Timeline"},"recent_failed_scans":{"items":{"$ref":"#/components/schemas/RecentFailedScan"},"type":"array","title":"Recent Failed Scans"}},"type":"object","required":["workspace","scans","failure_breakdown","timeline","recent_failed_scans"],"title":"WorkspaceHealthResponse","description":"Response for GET /api/admin/workspaces/{id}/health"},"WorkspaceInternalResponse":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"is_internal":{"type":"boolean","title":"Is Internal"}},"type":"object","required":["workspace_id","is_internal"],"title":"WorkspaceInternalResponse"},"WorkspaceInternalUpdateRequest":{"properties":{"is_internal":{"type":"boolean","title":"Is Internal"}},"type":"object","required":["is_internal"],"title":"WorkspaceInternalUpdateRequest"},"WorkspaceItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"scan_count":{"type":"integer","title":"Scan Count"}},"type":"object","required":["id","name","scan_count"],"title":"WorkspaceItem","description":"Workspace summary item."},"WorkspaceListItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"owner_email":{"type":"string","title":"Owner Email"},"plan":{"type":"string","title":"Plan"},"is_disabled":{"type":"boolean","title":"Is Disabled"},"user_count":{"type":"integer","title":"User Count"},"scan_count":{"type":"integer","title":"Scan Count"},"last_activity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Activity"},"created_at":{"type":"string","title":"Created At"},"budget":{"anyOf":[{"$ref":"#/components/schemas/WorkspaceBudgetInfo"},{"type":"null"}]}},"type":"object","required":["id","name","owner_email","plan","is_disabled","user_count","scan_count","last_activity","created_at"],"title":"WorkspaceListItem","description":"Individual workspace in list."},"WorkspaceMemberAddRequest":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"member"},"profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Id"},"bypass_seat_limit":{"type":"boolean","title":"Bypass Seat Limit","default":false}},"type":"object","required":["email"],"title":"WorkspaceMemberAddRequest"},"WorkspaceMemberResponse":{"properties":{"id":{"type":"string","title":"Id"},"workspace_id":{"type":"string","title":"Workspace Id"},"user_id":{"type":"string","title":"User Id"},"role":{"type":"string","title":"Role"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","workspace_id","user_id","role","created_at"],"title":"WorkspaceMemberResponse"},"WorkspaceMemberRolePatchRequest":{"properties":{"role":{"type":"string","title":"Role","description":"New workspace role: owner | admin | member | client"},"profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Id","description":"Brand for the client role"}},"type":"object","required":["role"],"title":"WorkspaceMemberRolePatchRequest","description":"Request body for PATCH /api/admin/workspaces/{id}/members/{user_id}"},"WorkspaceMemberUpdateRequest":{"properties":{"role":{"type":"string","title":"Role"},"profile_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Id"}},"type":"object","required":["role"],"title":"WorkspaceMemberUpdateRequest"},"WorkspaceNotesRequest":{"properties":{"notes":{"type":"string","title":"Notes","description":"Free-text admin notes for this workspace"}},"type":"object","required":["notes"],"title":"WorkspaceNotesRequest","description":"Request body for PUT /api/admin/workspaces/{id}/notes"},"WorkspaceNotesResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","name","notes","updated_at"],"title":"WorkspaceNotesResponse","description":"Response for PUT /api/admin/workspaces/{id}/notes"},"WorkspacePatchRequest":{"properties":{"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan","description":"Plan tier: demo | light | pro | agency"}},"type":"object","title":"WorkspacePatchRequest","description":"Request body for PATCH /api/admin/workspaces/{id}/plan"},"WorkspacePatchResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"plan":{"type":"string","title":"Plan"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","name","plan","updated_at"],"title":"WorkspacePatchResponse","description":"Response for PATCH /api/admin/workspaces/{id}/plan"},"WorkspaceRenameRequest":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name","description":"Name shown in the app's sidebar"}},"type":"object","required":["name"],"title":"WorkspaceRenameRequest","description":"Request body for PUT /api/admin/workspaces/{id}/name"},"WorkspaceResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"is_demo":{"type":"boolean","title":"Is Demo"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"allowed_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Tools"},"client_profile_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Client Profile Ids"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"}},"type":"object","required":["id","name","is_demo","created_at"],"title":"WorkspaceResponse"},"WorkspaceScanItem":{"properties":{"id":{"type":"string","title":"Id"},"domain":{"type":"string","title":"Domain"},"sector":{"type":"string","title":"Sector"},"status":{"type":"string","title":"Status"},"score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Score"},"created_at":{"type":"string","title":"Created At"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","required":["id","domain","sector","status","score","created_at","duration_seconds"],"title":"WorkspaceScanItem","description":"Scan (analysis) belonging to a workspace."},"WorkspaceScansStats":{"properties":{"total":{"type":"integer","title":"Total"},"success":{"type":"integer","title":"Success"},"failed":{"type":"integer","title":"Failed"},"in_progress":{"type":"integer","title":"In Progress"}},"type":"object","required":["total","success","failed","in_progress"],"title":"WorkspaceScansStats","description":"Scan statistics."},"WorkspaceSettingsResponse":{"properties":{"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":false,"type":"object","required":["allowed_tools"],"title":"WorkspaceSettingsResponse"},"WorkspaceSettingsUpdateRequest":{"properties":{"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"}},"additionalProperties":false,"type":"object","required":["allowed_tools"],"title":"WorkspaceSettingsUpdateRequest"},"WorkspaceStatusResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"is_disabled":{"type":"boolean","title":"Is Disabled"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","name","is_disabled","updated_at"],"title":"WorkspaceStatusResponse","description":"Response for POST /api/admin/workspaces/{id}/disable and /enable"},"WorkspaceUserItem":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role":{"type":"string","title":"Role"},"is_active":{"type":"boolean","title":"Is Active"},"joined_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Joined At"}},"type":"object","required":["id","email","full_name","role","is_active","joined_at"],"title":"WorkspaceUserItem","description":"User belonging to a workspace."},"WorkspacesListResponse":{"properties":{"workspaces":{"items":{"$ref":"#/components/schemas/WorkspaceListItem"},"type":"array","title":"Workspaces"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["workspaces","total","page","limit"],"title":"WorkspacesListResponse","description":"Response for GET /api/admin/workspaces"},"app__api_models__AnalysesListResponse":{"properties":{"count":{"type":"integer","title":"Count"},"analyses":{"items":{"$ref":"#/components/schemas/app__api_models__AnalysisListItem"},"type":"array","title":"Analyses"}},"type":"object","required":["count","analyses"],"title":"AnalysesListResponse"},"app__api_models__AnalysisListItem":{"properties":{"id":{"type":"string","title":"Id"},"analysis_id":{"type":"string","title":"Analysis Id"},"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id"},"domain":{"type":"string","title":"Domain"},"sector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"created_at":{"type":"string","title":"Created At"},"projected_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Projected Score"},"action_deadline_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Deadline At"},"next_rescan_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Rescan At"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"measuring":{"type":"boolean","title":"Measuring","default":false},"measurement_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Measurement Status"},"progress_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Pct"},"progress_phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress Phase"},"scan_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scan Stage"},"scan_attempt":{"type":"integer","title":"Scan Attempt","default":0},"queue":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Queue"},"rescan":{"type":"boolean","title":"Rescan","default":false},"rescan_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rescan On"}},"type":"object","required":["id","analysis_id","domain","created_at"],"title":"AnalysisListItem"},"app__domain__actions__ActionStatusResponse":{"properties":{"action_id":{"type":"string","title":"Action Id"},"status":{"type":"string","enum":["open","done"],"title":"Status"},"is_hidden":{"type":"boolean","title":"Is Hidden","default":false},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"assigned_to_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To User Id"},"due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due At"},"assigned_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned By User Id"},"assigned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Assigned At"},"assignment_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Note"},"action_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Title"},"done_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Done Source"}},"type":"object","required":["action_id","status","updated_at"],"title":"ActionStatusResponse"},"app__domain__actions__ActionStatusUpdate":{"properties":{"action_id":{"type":"string","title":"Action Id"},"status":{"type":"string","enum":["open","done"],"title":"Status"},"assigned_to_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To User Id"},"due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due At"},"assignment_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Assignment Note"},"action_title":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Action Title"}},"type":"object","required":["action_id","status"],"title":"ActionStatusUpdate"},"app__routers__action_plan__ActionStatusResponse":{"properties":{"action_id":{"type":"string","title":"Action Id"},"completed":{"type":"boolean","title":"Completed"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["action_id","completed","updated_at"],"title":"ActionStatusResponse"},"app__routers__action_plan__ActionStatusUpdate":{"properties":{"completed":{"type":"boolean","title":"Completed"}},"type":"object","required":["completed"],"title":"ActionStatusUpdate"},"app__routers__admin_analyses__AnalysesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/app__routers__admin_analyses__AnalysisListItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["items","total","page","limit"],"title":"AnalysesListResponse"},"app__routers__admin_analyses__AnalysisListItem":{"properties":{"id":{"type":"integer","title":"Id"},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id"},"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id"},"workspace_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Name"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"sector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sector"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"status":{"type":"string","title":"Status"},"total_calibrated":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Calibrated"},"progress_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Pct"},"progress_phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress Phase"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"worker_job_count":{"type":"integer","title":"Worker Job Count","default":0},"total_cost":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Cost"},"rescan":{"type":"boolean","title":"Rescan","default":false},"rescan_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rescan On"}},"type":"object","required":["id","status"],"title":"AnalysisListItem"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/auth/login"}}}}}}