{"openapi":"3.1.0","info":{"title":"Kaine API","description":"Managed AI infrastructure for businesses and developers. Public API for the Developer tier — Bearer-token auth, per-key rate limits, metered usage with cost caps.","version":"1.0.0"},"paths":{"/onboarding/status":{"get":{"summary":"Onboarding Status","operationId":"onboarding_status_onboarding_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboarding/profile":{"get":{"summary":"Get Business Profile","operationId":"get_business_profile_onboarding_profile_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboarding/save":{"post":{"summary":"Save Onboarding","operationId":"save_onboarding_onboarding_save_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Request Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboarding/complete":{"post":{"summary":"Complete Onboarding","operationId":"complete_onboarding_onboarding_complete_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Request Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboarding":{"get":{"summary":"Onboarding Page","operationId":"onboarding_page_onboarding_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"summary":"Onboarding Route","description":"Step 3: save business name, industry, use case. Mark onboarding complete.","operationId":"onboarding_route_onboarding_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/plans":{"get":{"summary":"Get Plans","operationId":"get_plans_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/billing/subscription":{"get":{"summary":"Get My Subscription","operationId":"get_my_subscription_billing_subscription_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/create-checkout":{"post":{"summary":"Create Checkout","operationId":"create_checkout_billing_create_checkout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Request Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/cancel":{"post":{"summary":"Cancel Subscription","operationId":"cancel_subscription_billing_cancel_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/reactivate":{"post":{"summary":"Reactivate Subscription","operationId":"reactivate_subscription_billing_reactivate_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/webhook":{"post":{"summary":"Stripe Webhook","operationId":"stripe_webhook_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/billing/success":{"get":{"summary":"Billing Success","operationId":"billing_success_billing_success_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/billing":{"get":{"summary":"Billing Page","operationId":"billing_page_billing_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/kanban/leads":{"get":{"summary":"Get Kanban Leads","operationId":"get_kanban_leads_kanban_leads_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kanban/move":{"post":{"summary":"Move Lead","operationId":"move_lead_kanban_move_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Request Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kanban/note":{"post":{"summary":"Save Note","operationId":"save_note_kanban_note_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Request Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kanban/lead/{lead_id}":{"delete":{"summary":"Delete Lead","operationId":"delete_lead_kanban_lead__lead_id__delete","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"integer","title":"Lead Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kanban":{"get":{"summary":"Kanban Page","operationId":"kanban_page_kanban_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/v1/ping":{"get":{"tags":["public-api"],"summary":"Health check (no auth)","description":"Lightweight liveness check. No API key required.\n\nReturns: {\"ok\": true, \"version\": \"v1\"}","operationId":"v1_ping_v1_ping_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/me":{"get":{"tags":["public-api"],"summary":"Get the account associated with the API key","description":"Returns the account info for the key in the Authorization header.\nUseful for clients to test their key works.","operationId":"v1_me_v1_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage":{"get":{"tags":["public-api"],"summary":"Current usage and cap","description":"Returns the user's current 30-day usage window stats.\n\nSame data the dashboard usage chip shows. Use this to monitor your\nspend programmatically and gracefully degrade before you hit the cap.","operationId":"v1_usage_v1_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/leads":{"get":{"tags":["public-api"],"summary":"List your leads","description":"List leads owned by the authenticated user.\n\nQuery params:\n  status — filter by status (new / contacted / booked / complete)\n  limit  — max rows to return (default 50)","operationId":"v1_list_leads_v1_leads_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/landing-pages":{"get":{"tags":["public-api"],"summary":"List your generated landing pages","description":"List landing pages this user has generated.","operationId":"v1_list_landing_pages_v1_landing_pages_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["public-api"],"summary":"Generate a new landing page","description":"Generate a new landing page.\n\nBody: {business_name, client_email, industry?, brand_color?, tone?, description?, website_url?}\nReturns: {ok, url, filename} on success.\n\nCosts ~5k input + ~12k output tokens (Sonnet). Pre-checks usage cap.","operationId":"v1_create_landing_page_v1_landing_pages_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/videos":{"post":{"tags":["public-api"],"summary":"Generate a video ad","description":"Generate a video ad via Higgsfield / Runway / Kling / FAL.\n\nBody: {prompt, image_url?, duration?, provider?}\n  provider — higgsfield (default) | runway | kling | fal\n  duration — seconds (default 6)\n\nReturns: {ok, video_url, provider, ...}","operationId":"v1_generate_video_v1_videos_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workflows":{"get":{"tags":["public-api"],"summary":"List your workflows","description":"List workflow runs for this user (n8n + Kaine).","operationId":"v1_list_workflows_v1_workflows_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/_introspect":{"get":{"tags":["public-api"],"summary":"Echo what we see (debugging)","description":"Returns the key + scopes we resolved from your Authorization header.\nUseful when you're debugging auth issues. Doesn't return the key itself.","operationId":"v1_introspect_v1__introspect_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/llm":{"post":{"tags":["public-api"],"summary":"Multi-provider LLM call with automatic routing","description":"Unified LLM endpoint. We pick the cheapest capable model OR you can\nspecify provider/model explicitly. Auto-failover between providers.\n\nBody:\n  {\n    \"prompt\": \"Write a haiku about Florida\",\n    \"task_type\": \"short_copy\",          # optional, influences routing\n    \"max_tokens\": 500,                   # optional\n    \"temperature\": 0.7,                  # optional\n    \"provider\": \"google\" | \"anthropic\" | \"auto\"   # optional, default auto\n  }\n\nReturns: {ok, text, provider, model, tokens_in, tokens_out, cost_usd}","operationId":"v1_llm_v1_llm_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audit":{"get":{"tags":["public-api"],"summary":"Audit log of API calls made by this account","description":"Returns recent usage events for the authenticated account.\nUse for compliance, billing reconciliation, or debugging.\n\nQuery params:\n  limit    — max rows (default 100, max 500)\n  endpoint — filter to a specific endpoint (e.g. '/v1/llm')\n\nReturns: {events, count}\nEach event: {provider_key, units, cost_usd, endpoint, created_at}","operationId":"v1_audit_v1_audit_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"endpoint","in":"query","required":false,"schema":{"type":"string","title":"Endpoint"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/providers":{"get":{"tags":["public-api"],"summary":"List available LLM providers + routing rules","description":"Returns which providers are configured + which one /v1/llm picks for each\ntask_type. Useful for clients to know what auto-routing will do.","operationId":"v1_providers_v1_providers_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents":{"get":{"tags":["public-api"],"summary":"List all available Kaine agents","description":"Returns the full catalog of Kaine agents your API key can invoke via\n/v1/agents/run. Each entry has: name, description, allowed_tools, skills.\n\nThis is the discovery endpoint — call it once at boot to see what's\navailable.","operationId":"v1_list_agents_v1_agents_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/run":{"post":{"tags":["public-api"],"summary":"Execute an agent with a goal","description":"Run a Kaine agent autonomously. The agent plans, picks tools, executes,\nself-critiques, and returns a result.\n\nBody:\n  {\n    \"agent_name\": \"lead_crm_agent\",     # one of the names from GET /v1/agents\n    \"goal\": \"Follow up with this new lead and book a meeting\"\n  }\n\nReturns: {ok, run_id, status, summary, steps}\nPre-checks cost cap. Logs cost. Standard agents ~$0.05-0.30 per run.\nComplex agents (workflow, voice) ~$0.20-1.00 per run.","operationId":"v1_run_agent_v1_agents_run_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audit":{"post":{"summary":"Audit Endpoint","description":"Public, rate-limited free website audit (the lead-magnet wedge).","operationId":"audit_endpoint_api_audit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audit/lead":{"post":{"summary":"Audit Lead","description":"Capture an email from the free audit (the lead magnet). Public + rate-limited.\nValue-first: the audit itself is free + ungated; this just saves the email of owners\nwho want the report + a fix plan, so every audit can build the list.","operationId":"audit_lead_api_audit_lead_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLead"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/app":{"get":{"summary":"App Page","operationId":"app_page_app_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api-docs":{"get":{"summary":"Api Docs Page","description":"Public API documentation (S26 P30 — Developer tier landing).","operationId":"api_docs_page_api_docs_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/privacy":{"get":{"summary":"Privacy Page","description":"Privacy Policy (legal must-have before charging customers — S26 P31).","operationId":"privacy_page_privacy_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/terms":{"get":{"summary":"Terms Page","description":"Terms of Service (legal must-have before charging customers — S26 P31).","operationId":"terms_page_terms_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/agents/{slug}":{"get":{"summary":"Agent Landing Page","description":"Per-agent standalone landing pages (S26 P30 — Layer 1 unbundle).\nEach agent has its own SKU landing. Slug = filename in agents/ directory.\nReturns 404 if file doesn't exist (no path traversal).","operationId":"agent_landing_page_agents__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/favicon.svg":{"get":{"summary":"Favicon","operationId":"favicon_favicon_svg_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/logo-mark.svg":{"get":{"summary":"Logo Mark","operationId":"logo_mark_logo_mark_svg_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/healthz":{"get":{"summary":"Healthz","description":"Standard health probe alias — most uptime monitors look for /healthz, not /health.","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health":{"get":{"summary":"Api Health","description":"API health probe alias for client-side health checks.","operationId":"api_health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/usage":{"get":{"summary":"Api Usage","description":"User-facing: returns this user's current 30-day spend + tier cap.\nSafe to call freely from the frontend (e.g. usage widget in chat.html).","operationId":"api_usage_api_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/usage":{"get":{"summary":"Api Admin Usage","description":"Admin: top spenders in the last 30 days. Restricted to Angel's user IDs.","operationId":"api_admin_usage_api_admin_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/api-keys":{"get":{"summary":"Api List Keys","description":"List the authenticated user's API keys (no plaintext — just prefix + metadata).","operationId":"api_list_keys_api_api_keys_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Api Create Key","description":"Generate a new API key. The FULL key is returned exactly ONCE — UI must show it\nto the user and warn them to save it. We never store plaintext.","operationId":"api_create_key_api_api_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/api-keys/{key_id}":{"delete":{"summary":"Api Revoke Key","description":"Revoke an API key (soft-delete). Idempotent.","operationId":"api_revoke_key_api_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors":{"get":{"summary":"Api List Connectors","description":"List the user's connected tool sources (custom MCPs, OAuth apps, etc.).","operationId":"api_list_connectors_api_connectors_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/mcp":{"post":{"summary":"Api Add Custom Mcp","description":"Add a custom MCP server. Body: {name, url}. Discovers tools before saving.","operationId":"api_add_custom_mcp_api_connectors_mcp_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{connector_id}":{"delete":{"summary":"Api Remove Connector","description":"Disconnect a connector (hard delete).","operationId":"api_remove_connector_api_connectors__connector_id__delete","parameters":[{"name":"connector_id","in":"path","required":true,"schema":{"type":"integer","title":"Connector Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/tools":{"get":{"summary":"Api Connector Tools","description":"Aggregate every tool from every connected connector (what agents can use).","operationId":"api_connector_tools_api_connectors_tools_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/brain":{"get":{"summary":"Api Brain List","description":"What Kaine knows about this customer's business — full list + stats.\nTransparency builds trust ('it knows me') + lets the user correct/teach it.","operationId":"api_brain_list_api_brain_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Api Brain Add","description":"User manually teaches Kaine a fact about their business.\nBody: {fact_type, subject, content, importance?}","operationId":"api_brain_add_api_brain_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/brain/summary":{"get":{"summary":"Api Brain Summary","description":"The compact digest agents inject before acting (also nice for the UI).","operationId":"api_brain_summary_api_brain_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/brain/{fact_id}":{"delete":{"summary":"Api Brain Forget","description":"User tells Kaine to forget a fact.","operationId":"api_brain_forget_api_brain__fact_id__delete","parameters":[{"name":"fact_id","in":"path","required":true,"schema":{"type":"integer","title":"Fact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/brain/recall":{"get":{"summary":"Api Brain Recall","description":"Pull the most relevant facts for a topic (what agents call before acting).","operationId":"api_brain_recall_api_brain_recall_get","parameters":[{"name":"topic","in":"query","required":false,"schema":{"type":"string","title":"Topic"}},{"name":"fact_type","in":"query","required":false,"schema":{"type":"string","title":"Fact Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":15,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/brain/search":{"get":{"summary":"Api Brain Semantic","description":"Phase 4: semantic search — find facts by MEANING, not just keywords.","operationId":"api_brain_semantic_api_brain_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/brain/graph":{"get":{"summary":"Api Brain Graph","description":"Phase 4: the connected brain web (nodes + edges) — the topology view,\nlike an Obsidian graph. For a future visualization in the dashboard.","operationId":"api_brain_graph_api_brain_graph_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/brain/{fact_id}/related":{"get":{"summary":"Api Brain Related","description":"Phase 4: the facts linked to this one (its neighborhood in the web).","operationId":"api_brain_related_api_brain__fact_id__related_get","parameters":[{"name":"fact_id","in":"path","required":true,"schema":{"type":"integer","title":"Fact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/brain/reflect":{"post":{"summary":"Api Brain Reflect","description":"Brain v2: reflect over all facts → write higher-level insights (the jump\nfrom remembering to understanding).","operationId":"api_brain_reflect_api_brain_reflect_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/brain/maintain":{"post":{"summary":"Api Brain Maintain","description":"Brain v2: decay/prune stale facts ('spring cleaning'). Safe to cron.","operationId":"api_brain_maintain_api_brain_maintain_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox":{"get":{"summary":"Api Inbox List","description":"List the email agent's queue (drafts pending approval + sent/dismissed history).","operationId":"api_inbox_list_api_inbox_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","title":"Status"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/refresh":{"post":{"summary":"Api Inbox Refresh","description":"Poll the mailbox now (the demo button): fetch → triage → draft → queue.","operationId":"api_inbox_refresh_api_inbox_refresh_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/{inbox_id}/send":{"post":{"summary":"Api Inbox Send","description":"Approve → send the (optionally edited) draft back to the sender. Body: {body?}","operationId":"api_inbox_send_api_inbox__inbox_id__send_post","parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"integer","title":"Inbox Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/{inbox_id}/dismiss":{"post":{"summary":"Api Inbox Dismiss","description":"Dismiss a draft without sending.","operationId":"api_inbox_dismiss_api_inbox__inbox_id__dismiss_post","parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"integer","title":"Inbox Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email/alias":{"get":{"summary":"Api Email Alias","description":"This user's own AI email address (e.g. complexion@keine.tech). Mail sent\nthere is read + drafted by Kaine and routed to this account for approval.","operationId":"api_email_alias_api_email_alias_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/track":{"post":{"summary":"Api Track","description":"Public page-view beacon. Only name-whitelisted events are accepted so the\nopen endpoint can't write arbitrary analytics.","operationId":"api_track_api_track_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/scoreboard":{"get":{"summary":"Api Scoreboard","description":"The funnel scoreboard — is distribution working? (owner only).","operationId":"api_scoreboard_api_scoreboard_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/robots.txt":{"get":{"summary":"Robots Txt","operationId":"robots_txt_robots_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/models":{"get":{"summary":"List Models","operationId":"list_models_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/download/{filename}":{"get":{"summary":"Download","operationId":"download_download__filename__get","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/signup":{"post":{"summary":"Signup Route","operationId":"signup_route_signup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/login":{"post":{"summary":"Login Route","operationId":"login_route_login_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/logout":{"post":{"summary":"Logout Route","operationId":"logout_route_logout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/signup/send-otp":{"post":{"summary":"Signup Send Otp Route","description":"Step 1 of email-verified signup: validate inputs, send 6-digit OTP.","operationId":"signup_send_otp_route_signup_send_otp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/signup/verify-otp":{"post":{"summary":"Signup Verify Otp Route","description":"Step 2: verify OTP, create account, return session token.","operationId":"signup_verify_otp_route_signup_verify_otp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/forgot-password":{"post":{"summary":"Forgot Password Route","description":"Send a 6-digit OTP to the user's email for password reset.","operationId":"forgot_password_route_auth_forgot_password_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/reset-password":{"post":{"summary":"Reset Password Route","description":"Verify reset OTP and set new password.","operationId":"reset_password_route_auth_reset_password_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/setup/start":{"post":{"summary":"Setup Start Route","description":"Kick off the guided first-run: auto-research their site + generate page #1.\nThe /setup screen polls /api/setup/status and narrates the stages live.","operationId":"setup_start_route_api_setup_start_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/setup/status":{"get":{"summary":"Setup Status Route","operationId":"setup_status_route_api_setup_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me":{"get":{"summary":"Me Route","operationId":"me_route_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/settings":{"get":{"summary":"Get Settings Route","operationId":"get_settings_route_settings_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Update Settings Route","operationId":"update_settings_route_settings_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chats":{"get":{"summary":"List Chats","operationId":"list_chats_chats_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Chat Route","operationId":"create_chat_route_chats_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chats/{chat_id}":{"delete":{"summary":"Delete Chat Route","operationId":"delete_chat_route_chats__chat_id__delete","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","title":"Chat Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Rename Chat Route","operationId":"rename_chat_route_chats__chat_id__patch","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"integer","title":"Chat Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/history":{"get":{"summary":"History Route","operationId":"history_route_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"chat_id","in":"query","required":false,"schema":{"type":"integer","title":"Chat Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Clear History Route","operationId":"clear_history_route_history_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/memories":{"get":{"summary":"List Memories Route","operationId":"list_memories_route_memories_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/memories/{mid}":{"delete":{"summary":"Delete Memory Route","operationId":"delete_memory_route_memories__mid__delete","parameters":[{"name":"mid","in":"path","required":true,"schema":{"type":"integer","title":"Mid"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/stream":{"post":{"summary":"Chat Stream","operationId":"chat_stream_chat_stream_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat":{"post":{"summary":"Chat","operationId":"chat_chat_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/voice":{"post":{"summary":"Chat Voice","description":"Handle voice input: transcribe → agent loop → optional TTS response.","operationId":"chat_voice_chat_voice_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tts/{audio_id}":{"get":{"summary":"Get Tts","description":"Serve TTS audio file.","operationId":"get_tts_tts__audio_id__get","parameters":[{"name":"audio_id","in":"path","required":true,"schema":{"type":"string","title":"Audio Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tts/generate":{"post":{"summary":"Tts Generate","description":"Generate TTS audio from text and return it directly.\n\nRoutes through voice_router (S26 wire-in): defaults to OpenAI TTS for cheap\nbulk voice, escalates to ElevenLabs for long-form or specific cloned voices.\nPreserves the existing StreamingResponse contract (audio/mpeg bytes).","operationId":"tts_generate_tts_generate_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge":{"get":{"summary":"List Knowledge","operationId":"list_knowledge_knowledge_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge/upload":{"post":{"summary":"Upload Knowledge","description":"Upload markdown files (from Obsidian vault or manual). Accepts JSON with files array.","operationId":"upload_knowledge_knowledge_upload_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge/{kb_id}":{"delete":{"summary":"Delete Knowledge Entry","operationId":"delete_knowledge_entry_knowledge__kb_id__delete","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"integer","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge/search":{"get":{"summary":"Search Knowledge","operationId":"search_knowledge_knowledge_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge/graph-search":{"get":{"summary":"Graph Search Knowledge","description":"LightRAG graph-aware search — answers multi-hop relationship questions.","operationId":"graph_search_knowledge_knowledge_graph_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge/obsidian/configure":{"post":{"summary":"Configure Obsidian","description":"Configure Obsidian vault connection.","operationId":"configure_obsidian_knowledge_obsidian_configure_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge/obsidian/sync":{"post":{"summary":"Manual Sync Obsidian","description":"Manually trigger Obsidian vault sync.","operationId":"manual_sync_obsidian_knowledge_obsidian_sync_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge/obsidian/status":{"get":{"summary":"Get Obsidian Status","description":"Get Obsidian sync status and configuration.","operationId":"get_obsidian_status_knowledge_obsidian_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge/obsidian/auto-sync":{"post":{"summary":"Configure Auto Sync","description":"Enable/disable auto-sync for Obsidian (every 60 minutes).","operationId":"configure_auto_sync_knowledge_obsidian_auto_sync_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge/{kb_id}/connections":{"get":{"summary":"Get Knowledge Connections","description":"Get knowledge graph connections for an entry (wikilinks).","operationId":"get_knowledge_connections_knowledge__kb_id__connections_get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"integer","title":"Kb Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge/graph/stats":{"get":{"summary":"Get Graph Stats","description":"Get knowledge graph statistics (connections, network density, etc).","operationId":"get_graph_stats_knowledge_graph_stats_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflow/create":{"post":{"summary":"Workflow Create","description":"Accept a natural language prompt, build and deploy an n8n workflow.","operationId":"workflow_create_workflow_create_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflow/{workflow_id}":{"get":{"summary":"Workflow Status","description":"Get status and metadata for a workflow.","operationId":"workflow_status_workflow__workflow_id__get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"integer","title":"Workflow Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/plan":{"post":{"summary":"Plan Goal","operationId":"plan_goal_plan_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/execute":{"post":{"summary":"Execute Goal","operationId":"execute_goal_execute_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/leads":{"post":{"summary":"Capture Lead","description":"Public endpoint — no auth required.\nReceives lead form submissions from generated landing pages,\nstores them in SQLite, and emails the owner.","operationId":"capture_lead_leads_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"List Leads","description":"View all captured leads (owner only).","operationId":"list_leads_leads_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin":{"get":{"summary":"Admin Dashboard","operationId":"admin_dashboard_admin_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/delete":{"post":{"summary":"Admin Delete","operationId":"admin_delete_admin_delete_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/biz-stats":{"get":{"summary":"Api Biz Stats","description":"Combined analytics for the business operating layer.","operationId":"api_biz_stats_api_biz_stats_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats":{"get":{"summary":"Api Stats","operationId":"api_stats_api_stats_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/recent-activity":{"get":{"summary":"Api Recent Activity","operationId":"api_recent_activity_api_recent_activity_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leads-all":{"get":{"summary":"Api Leads All","operationId":"api_leads_all_api_leads_all_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pages":{"get":{"summary":"Api Pages","operationId":"api_pages_api_pages_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/landing-pages":{"get":{"summary":"Api Landing Pages","operationId":"api_landing_pages_api_landing_pages_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pages/{filename}":{"delete":{"summary":"Api Delete Page","operationId":"api_delete_page_api_pages__filename__delete","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/deploy-site":{"post":{"summary":"Api Deploy Site","description":"Deploy an existing landing page (or any HTML) to Netlify.\nBody: {\"filename\": \"landing_abc123.html\"} OR {\"html\": \"<html>...</html>\", \"site_name\": \"My Business\"}\nReturns: {\"ok\": true, \"url\": \"https://my-business.netlify.app\", ...}\nRequires NETLIFY_TOKEN in .env.","operationId":"api_deploy_site_api_deploy_site_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/vectorize":{"post":{"summary":"Api Vectorize","description":"Convert a raster image (PNG/JPG) to SVG vector using Recraft API.\nAccepts either a file upload or a JSON body with {\"image_url\": \"...\"}.\nReturns: {\"ok\": true, \"filename\": \"recraft_abc.svg\", \"svg_content\": \"<svg>...</svg>\"}\nRequires RECRAFT_API_TOKEN in .env.","operationId":"api_vectorize_api_vectorize_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_api_vectorize_api_vectorize_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/generate-vector":{"post":{"summary":"Api Generate Vector","description":"Generate a brand new SVG vector from a text prompt using Recraft V4 Vector.\nBody: {\"prompt\": \"...\", \"style\": \"vector_illustration\", \"model\": \"recraft-v4-vector\"}\nReturns: {\"ok\": true, \"filename\": \"recraft_abc.svg\", \"svg_content\": \"<svg>...</svg>\"}\nRequires RECRAFT_API_TOKEN in .env.","operationId":"api_generate_vector_api_generate_vector_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/remove-background":{"post":{"summary":"Api Remove Background","description":"Remove background from an image using Recraft API.\nAccepts file upload or JSON body with {\"image_url\": \"...\"}.\nReturns: {\"ok\": true, \"filename\": \"recraft_abc.png\"}\nRequires RECRAFT_API_TOKEN in .env.","operationId":"api_remove_background_api_remove_background_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_api_remove_background_api_remove_background_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate":{"post":{"summary":"Generate Page Direct","operationId":"generate_page_direct_generate_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/generate-ad":{"post":{"summary":"Generate Ad","operationId":"generate_ad_api_generate_ad_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/generate-workflow":{"post":{"summary":"Generate Workflow Endpoint","operationId":"generate_workflow_endpoint_api_generate_workflow_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/deploy-workflow":{"post":{"summary":"Deploy Workflow Endpoint","operationId":"deploy_workflow_endpoint_api_deploy_workflow_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflows":{"get":{"summary":"List Workflows Endpoint","operationId":"list_workflows_endpoint_api_workflows_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/n8n/workflows":{"get":{"summary":"N8N List Workflows","description":"List all workflows live from the n8n instance.","operationId":"n8n_list_workflows_api_n8n_workflows_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/n8n/workflows/{n8n_id}/execute":{"post":{"summary":"N8N Execute Workflow","description":"Trigger a manual execution of an n8n workflow.","operationId":"n8n_execute_workflow_api_n8n_workflows__n8n_id__execute_post","parameters":[{"name":"n8n_id","in":"path","required":true,"schema":{"type":"string","title":"N8N Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/n8n/workflows/{n8n_id}":{"delete":{"summary":"N8N Delete Workflow","description":"Delete a workflow from n8n.","operationId":"n8n_delete_workflow_api_n8n_workflows__n8n_id__delete","parameters":[{"name":"n8n_id","in":"path","required":true,"schema":{"type":"string","title":"N8N Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leads/export":{"get":{"summary":"Export Leads Xlsx","description":"Export all leads + CRM prospects as a formatted Excel (.xlsx) file.\nReturns a file download — triggers Save As in the browser.","operationId":"export_leads_xlsx_api_leads_export_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflow-templates":{"get":{"summary":"Get Workflow Templates","description":"Return the full template catalog for display in the Workflows UI.","operationId":"get_workflow_templates_api_workflow_templates_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflow-templates/deploy":{"post":{"summary":"Deploy Workflow Template","description":"Match user's intent to a template and deploy it to their n8n instance.\nBody: {\"intent\": \"send review request to customers\", \"template_id\": \"optional-override\"}","operationId":"deploy_workflow_template_api_workflow_templates_deploy_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflow-templates/{template_id}":{"get":{"summary":"Get Template Detail","description":"Get full details for a specific template.","operationId":"get_template_detail_api_workflow_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/generate-social":{"post":{"summary":"Generate Social","operationId":"generate_social_api_generate_social_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lead-engine/search":{"post":{"summary":"Lead Engine Search","operationId":"lead_engine_search_lead_engine_search_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lead-engine/prospects":{"get":{"summary":"Lead Engine List","operationId":"lead_engine_list_lead_engine_prospects_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","title":"Status"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lead-engine/prospects/{pid}/outreach":{"post":{"summary":"Lead Engine Outreach","operationId":"lead_engine_outreach_lead_engine_prospects__pid__outreach_post","parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"integer","title":"Pid"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lead-engine/prospects/{pid}":{"patch":{"summary":"Lead Engine Update","operationId":"lead_engine_update_lead_engine_prospects__pid__patch","parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"integer","title":"Pid"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Lead Engine Delete","operationId":"lead_engine_delete_lead_engine_prospects__pid__delete","parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"integer","title":"Pid"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shopify-store":{"post":{"summary":"Shopify Store Generate","operationId":"shopify_store_generate_api_shopify_store_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/biz/profile":{"get":{"summary":"Biz Get Profile","operationId":"biz_get_profile_biz_profile_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Biz Save Profile","operationId":"biz_save_profile_biz_profile_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/biz/services":{"get":{"summary":"Biz List Services","operationId":"biz_list_services_biz_services_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Biz Create Service","operationId":"biz_create_service_biz_services_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/biz/services/{sid}":{"patch":{"summary":"Biz Update Service","operationId":"biz_update_service_biz_services__sid__patch","parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"integer","title":"Sid"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Biz Delete Service","operationId":"biz_delete_service_biz_services__sid__delete","parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"integer","title":"Sid"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/biz/leads":{"get":{"summary":"Biz List Leads","operationId":"biz_list_leads_biz_leads_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","title":"Status"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Biz Create Lead","operationId":"biz_create_lead_biz_leads_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/biz/leads/{iid}":{"patch":{"summary":"Biz Update Lead","operationId":"biz_update_lead_biz_leads__iid__patch","parameters":[{"name":"iid","in":"path","required":true,"schema":{"type":"integer","title":"Iid"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Biz Delete Lead","operationId":"biz_delete_lead_biz_leads__iid__delete","parameters":[{"name":"iid","in":"path","required":true,"schema":{"type":"integer","title":"Iid"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/biz/leads/{iid}/qualify":{"post":{"summary":"Biz Qualify Lead","operationId":"biz_qualify_lead_biz_leads__iid__qualify_post","parameters":[{"name":"iid","in":"path","required":true,"schema":{"type":"integer","title":"Iid"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/biz/leads/{iid}/review-request":{"post":{"summary":"Biz Review Request","operationId":"biz_review_request_biz_leads__iid__review_request_post","parameters":[{"name":"iid","in":"path","required":true,"schema":{"type":"integer","title":"Iid"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/intake/{username}":{"post":{"summary":"Public Lead Intake","operationId":"public_lead_intake_intake__username__post","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/run-followups":{"post":{"summary":"Admin Run Followups","operationId":"admin_run_followups_admin_run_followups_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/followup-queue":{"get":{"summary":"Admin Followup Queue","operationId":"admin_followup_queue_admin_followup_queue_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/widget/{username}/chat":{"post":{"summary":"Widget Chat","description":"Public endpoint — powers the AI chat widget on client websites.\nNo auth needed; rate limited by IP.","operationId":"widget_chat_widget__username__chat_post","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/widget/{username}":{"get":{"summary":"Serve Widget","operationId":"serve_widget_widget__username__get","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/intake/{username}/info":{"get":{"summary":"Widget Info","operationId":"widget_info_intake__username__info_get","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/run":{"post":{"summary":"Agent Run","operationId":"agent_run_agent_run_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/runs":{"get":{"summary":"List Agent Runs","operationId":"list_agent_runs_agent_runs_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/run/{run_id}":{"get":{"summary":"Get Agent Run","operationId":"get_agent_run_agent_run__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/status":{"get":{"summary":"Admin Status","description":"Server health + uptime — safe read-only status check.","operationId":"admin_status_admin_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/confirm-token":{"get":{"summary":"Api Confirm Token","description":"Issue a short-lived HMAC confirm token for a destructive action.\nClient should call this before any DELETE / admin-destructive POST,\nthen include the returned token in the X-Confirm-Token header.\n\nTokens expire in 60s and are bound to (action, user_id).\nAllowed actions: delete_chat, delete_knowledge, delete_prospect,\n                 delete_n8n_workflow, admin_restart, admin_kill, admin_delete.","operationId":"api_confirm_token_api_confirm_token_get","parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","title":"Action"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/restart":{"post":{"summary":"Admin Restart","description":"Gracefully restart Kaine via systemd (safe — auto-recovers).","operationId":"admin_restart_admin_restart_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/kill":{"post":{"summary":"Admin Kill","description":"🔴 EMERGENCY KILL SWITCH\nStops Kaine immediately via systemd stop.\nUse this if an agent goes rogue or the server is misbehaving.\nServer will NOT auto-restart. You must SSH in and run:\n    systemctl start Kaine\nOR run the deploy.sh script.","operationId":"admin_kill_admin_kill_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/deploy":{"post":{"summary":"Admin Deploy","description":"Trigger a safe deploy from GitHub.\nRuns deploy.sh which: backs up → pulls → restarts → auto-rollbacks if broken.","operationId":"admin_deploy_admin_deploy_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/save-key":{"post":{"summary":"Admin Save Key","description":"Save an API key to the .env file and update the live environment.\nKey name must be in the allowlist — no arbitrary env var writes.","operationId":"admin_save_key_admin_save_key_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-stack/status":{"get":{"summary":"Ai Stack Status","operationId":"ai_stack_status_api_ai_stack_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voices":{"get":{"summary":"List Voices","operationId":"list_voices_api_voices_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/generate-voiceover":{"post":{"summary":"Generate Voiceover","description":"Generate a voiceover. Routes via voice_router (S26 wire-in).\n\nDefault mode='auto' picks OpenAI for short/cheap and ElevenLabs for long-form\nor cloned voice IDs. Caller can force mode='premium' to keep using ElevenLabs\n(e.g. for ad voiceovers that need premium quality). Return shape preserved:\n{\"ok\": True, \"filename\": \"...\", \"url\": \"/files/...\", \"provider\": \"...\"}.","operationId":"generate_voiceover_api_generate_voiceover_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/create-assistant":{"post":{"summary":"Create Voice Assistant","operationId":"create_voice_assistant_api_voice_create_assistant_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/assistants":{"get":{"summary":"List Voice Assistants","operationId":"list_voice_assistants_api_voice_assistants_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/call":{"post":{"summary":"Make Voice Call","operationId":"make_voice_call_api_voice_call_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/status":{"get":{"summary":"Voice Status","description":"Phone-agent readiness: is the VAPI key set, is there a number + assistant.","operationId":"voice_status_api_voice_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/test-call":{"post":{"summary":"Voice Test Call","description":"Place a one-click test call: auto-resolves the Vapi caller-ID number and an\nassistant (creates one if none), then dials the number the user gives.","operationId":"voice_test_call_api_voice_test_call_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/upload-image":{"post":{"summary":"Upload Image File","description":"Upload an image file and get back a public URL to use with HiggsField or image generation.","operationId":"upload_image_file_api_upload_image_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_image_file_api_upload_image_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/generate-video":{"post":{"summary":"Generate Video","operationId":"generate_video_api_generate_video_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/video/compose":{"post":{"summary":"Compose Video","description":"C-3: Multi-shot composition. Generates each shot via the chosen provider,\npolls to completion, downloads, then stitches via FFmpeg into one long video.\nBody: { shots: [{prompt, duration}], provider, settings?, image_url? }\nReturns: { ok, job_id }  (compose job_id, NOT a provider job_id)","operationId":"compose_video_api_video_compose_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/video/compose/status/{job_id}":{"get":{"summary":"Compose Video Status","description":"C-3: Poll a multi-shot compose job. Returns status + progress_pct + final url when done.","operationId":"compose_video_status_api_video_compose_status__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/video-status/{job_id}":{"get":{"summary":"Get Video Status","operationId":"get_video_status_api_video_status__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/research":{"post":{"summary":"Web Research","operationId":"web_research_api_research_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/profiles":{"get":{"summary":"Get Social Profiles","operationId":"get_social_profiles_api_social_profiles_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schedule-post":{"post":{"summary":"Schedule Post","operationId":"schedule_post_api_schedule_post_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations":{"get":{"summary":"List Integrations","operationId":"list_integrations_api_integrations_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations/connect":{"post":{"summary":"Connect Integration","operationId":"connect_integration_api_integrations_connect_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations/connections":{"get":{"summary":"Get Connections","operationId":"get_connections_api_integrations_connections_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/integrations/keys-status":{"get":{"summary":"Keys Status","description":"S26 P26 (Quick win B): Reports which upstream API keys are configured in\nthe running env. Returns booleans only (never the key values themselves).\nUsed by the Studio page to dynamically render Active vs Needs Key badges.\nAuth-gated — only logged-in users can probe key presence.","operationId":"keys_status_api_integrations_keys_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/spending":{"get":{"summary":"Spending Dashboard","operationId":"spending_dashboard_admin_spending_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/workflow/latest":{"get":{"summary":"Workflow Latest","description":"Return the most recently created workflow for the current user.\nUsed by the chat UI to show a rich workflow card after Claude builds one.","operationId":"workflow_latest_api_workflow_latest_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/meta/status":{"get":{"summary":"Meta Status","description":"Check if Meta Ads integration is configured.","operationId":"meta_status_api_meta_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/meta/campaigns":{"get":{"summary":"Meta List Campaigns","description":"List all campaigns in the Meta ad account.","operationId":"meta_list_campaigns_api_meta_campaigns_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/meta/copy":{"post":{"summary":"Meta Generate Copy","description":"Generate 3 ad copy variations with Claude.\nBody: {business_name, product_or_service, goal, location, tone?}\nReturns: {ok, variations: [{primary_text, headline, description, cta}]}","operationId":"meta_generate_copy_api_meta_copy_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/meta/creative":{"post":{"summary":"Meta Generate Creative","description":"Generate ad creative image with Flux at correct Meta dimensions.\nBody: {business_name, product_or_service, format?}\nformat: \"square\" (1:1) | \"story\" (9:16) | \"landscape\" (1.91:1)\nReturns: {ok, filename, url}","operationId":"meta_generate_creative_api_meta_creative_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/meta/campaign/create":{"post":{"summary":"Meta Create Campaign","description":"Full pipeline: copy → creative → campaign → ad set → ad (all PAUSED).\nBody: {\n  business_name, product_or_service, goal, location,\n  monthly_budget, landing_url,\n  page_id? (optional, falls back to META_PAGE_ID),\n  creative_format? (\"square\"|\"story\"|\"landscape\"),\n  variation_index? (0-2, which copy variation to use)\n}\nReturns full pipeline results with all created IDs.","operationId":"meta_create_campaign_api_meta_campaign_create_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/meta/insights/{campaign_id}":{"get":{"summary":"Meta Campaign Insights","description":"Get performance metrics for a specific campaign.\ndate_preset: last_7d, last_30d, this_month, last_month","operationId":"meta_campaign_insights_api_meta_insights__campaign_id__get","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}},{"name":"date_preset","in":"query","required":false,"schema":{"type":"string","default":"last_7d","title":"Date Preset"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/meta/campaign/{campaign_id}/toggle":{"post":{"summary":"Meta Toggle Campaign","description":"Pause or activate a campaign.\nBody: {\"active\": true}","operationId":"meta_toggle_campaign_api_meta_campaign__campaign_id__toggle_post","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AuditLead":{"properties":{"email":{"type":"string","title":"Email"},"url":{"type":"string","title":"Url","default":""},"score":{"type":"integer","title":"Score","default":0}},"type":"object","required":["email"],"title":"AuditLead"},"AuditRequest":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"AuditRequest"},"Body_api_remove_background_api_remove_background_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","title":"Body_api_remove_background_api_remove_background_post"},"Body_api_vectorize_api_vectorize_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","title":"Body_api_vectorize_api_vectorize_post"},"Body_upload_image_file_api_upload_image_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_image_file_api_upload_image_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}}}