{"openapi":"3.1.0","info":{"title":"Valundis","version":"0.1.0"},"paths":{"/admin/env-check":{"get":{"tags":["admin"],"summary":"Env Check","description":"Show which env vars the app actually loaded.\nSecrets are masked. Useful to debug Render misconfig.","operationId":"env_check_admin_env_check_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Env Check Admin Env Check Get"}}}}}}},"/admin/locations":{"get":{"tags":["admin"],"summary":"List Locations","description":"Dump all locations + their integration provider + scrape_url + review count.\nLets you see whether onboarding actually saved a usable record.","operationId":"list_locations_admin_locations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Locations Admin Locations Get"}}}}}}},"/admin/locations/{location_id}":{"delete":{"tags":["admin"],"summary":"Delete Location","description":"Hard-delete a test location and all its reviews. For cleaning up junk.","operationId":"delete_location_admin_locations__location_id__delete","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Location Admin Locations  Location Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/reviews/{review_id}/reset-reply":{"post":{"tags":["admin"],"summary":"Reset Review Reply","description":"Reset a review to unanswered — clears the published/detected reply so it\nre-enters the publishable set. Test/ops helper (prod DB is internal-only).","operationId":"reset_review_reply_admin_reviews__review_id__reset_reply_post","parameters":[{"name":"review_id","in":"path","required":true,"schema":{"type":"string","title":"Review Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reset Review Reply Admin Reviews  Review Id  Reset Reply Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sync":{"post":{"tags":["admin"],"summary":"Manual Sync","description":"Trigger an immediate review sync for all active locations.\n\nUseful for testing the full pipeline without waiting for the Celery schedule.\nReturns how many locations were processed and how many new reviews were inserted.","operationId":"manual_sync_admin_sync_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Manual Sync Admin Sync Post"}}}}}}},"/admin/demo-costs":{"get":{"tags":["admin"],"summary":"Demo Costs","operationId":"demo_costs_admin_demo_costs_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/stats.json":{"get":{"tags":["admin"],"summary":"Stats Json","operationId":"stats_json_admin_stats_json_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"7d","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Stats Json Admin Stats Json Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/login":{"get":{"tags":["admin"],"summary":"Admin Login Page","operationId":"admin_login_page_admin_login_get","parameters":[{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin"],"summary":"Admin Login Submit","operationId":"admin_login_submit_admin_login_post","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_admin_login_submit_admin_login_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/logout":{"post":{"tags":["admin"],"summary":"Admin Logout","operationId":"admin_logout_admin_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/auth/google":{"get":{"tags":["admin"],"summary":"Admin Google Start","description":"Start the admin Google-login ceremony.\n\n503 when no allowlist is configured (feature off — only the token form\nworks). Otherwise redirects to Google with an identity-only scope and a\nsigned ``purpose=admin_login`` state.","operationId":"admin_google_start_admin_auth_google_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/auth/google/callback":{"get":{"tags":["admin"],"summary":"Admin Google Callback","description":"Complete admin Google login.\n\nverify state (purpose=admin_login) → exchange code → userinfo → check the\nGoogle-verified email against ADMIN_EMAILS. On match: mint the admin cookie\nand 303 to ``/admin/``. On any failure or a non-allowlisted email: bounce\nto ``/admin/login`` with an error flag — never a 500 on crafted input, and\nnever reveal whether the email exists (uniform \"not authorized\").","operationId":"admin_google_callback_admin_auth_google_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/":{"get":{"tags":["admin"],"summary":"Admin Dashboard","operationId":"admin_dashboard_admin__get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"7d","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/login":{"get":{"tags":["auth"],"summary":"Login Form","operationId":"login_form_app_login_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["auth"],"summary":"Login Submit","operationId":"login_submit_app_login_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_submit_app_login_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/auth/magic/{token}":{"get":{"tags":["auth"],"summary":"Magic Login","operationId":"magic_login_app_auth_magic__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_app_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/app/billing":{"get":{"tags":["billing"],"summary":"Billing Page","operationId":"billing_page_app_billing_get","parameters":[{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/billing/language":{"post":{"tags":["billing"],"summary":"Set Org Language","operationId":"set_org_language_app_billing_language_post","parameters":[{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_set_org_language_app_billing_language_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/billing/checkout":{"post":{"tags":["billing"],"summary":"Checkout","description":"L3-gated Paddle hosted-checkout entry.\n\nReads ?plan={starter|business|agency} from query (or form, future-proofing),\nrejects 'trial' (HTTP 400), maps plan→price_id via settings, and creates\na Paddle transaction. Returns 303 to the hosted checkout URL.","operationId":"checkout_app_billing_checkout_post","parameters":[{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/billing/change-plan":{"post":{"tags":["billing"],"summary":"Change Plan","description":"L3-gated subscription plan change with immediate proration.","operationId":"change_plan_app_billing_change_plan_post","parameters":[{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/billing/payment-method":{"post":{"tags":["billing"],"summary":"Payment Method","description":"L3-gated payment-method update via Paddle hosted portal.","operationId":"payment_method_app_billing_payment_method_post","parameters":[{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/webhook":{"post":{"tags":["billing-webhook"],"summary":"Paddle Webhook","operationId":"paddle_webhook_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/connect":{"get":{"tags":["oauth"],"summary":"Oauth Connect","description":"Start the self-serve GBP business connect (business.manage + identity).\n\nRedirects straight to Google (302) rather than rendering an interstitial —\nthe empty-state \"Connect Google Business\" button links here.","operationId":"oauth_connect_oauth_connect_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/callback":{"get":{"tags":["oauth"],"summary":"Oauth Callback","description":"Complete the self-serve connect: log the user in, enumerate their GBP\nlocations directly (no demo/Places round-trip), claim each as manager, and\nland on the dashboard.\n\nFail-soft: any failure 303s to the lander with ``?error=connect_failed`` —\nnever a 500 on crafted input (mirrors the signin/claim flows).","operationId":"oauth_callback_oauth_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/preview/connect":{"get":{"tags":["oauth"],"summary":"Oauth Preview Connect","operationId":"oauth_preview_connect_oauth_preview_connect_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/preview/callback":{"get":{"tags":["oauth"],"summary":"Oauth Preview Callback","operationId":"oauth_preview_callback_oauth_preview_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Oauth Preview Callback Oauth Preview Callback Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/claim/connect":{"get":{"tags":["oauth-claim"],"summary":"Oauth Claim Connect","description":"Start the OAuth claim flow — emit `claim_started`, build state, redirect.\n\nValidates the demo (exists, not expired, not already claimed) BEFORE\nburning any OAuth round-trip. Emits the `claim_started` audit row in\nits own transaction so the audit chain captures the visitor's intent\neven if the user abandons the OAuth consent screen.","operationId":"oauth_claim_connect_oauth_claim_connect_get","parameters":[{"name":"demo_token","in":"query","required":true,"schema":{"type":"string","title":"Demo Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/claim/callback":{"get":{"tags":["oauth-claim"],"summary":"Oauth Claim Callback","description":"Complete the OAuth claim — verify state, GBP ownership, complete_claim.\n\nFailure modes render `claim_rejection.html` with a reason key. Success\nsets the session cookie and 303-redirects to `/app/dashboard?location_id=...`.","operationId":"oauth_claim_callback_oauth_claim_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/signin/connect":{"get":{"tags":["oauth-signin"],"summary":"Oauth Signin Connect","description":"Redirect to Google for identity-only consent.\n\n``return_to`` is an opaque demo token OR an empty string / \"/\" for the\nlanding-nav sign-in path. Empty and \"/\" are equivalent — both trigger\nthe intelligent post-signin redirect (dashboard vs /?l0=1) in the\ncallback via ``_post_signin_redirect``.","operationId":"oauth_signin_connect_oauth_signin_connect_get","parameters":[{"name":"return_to","in":"query","required":false,"schema":{"type":"string","default":"","title":"Return To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/signin/callback":{"get":{"tags":["oauth-signin"],"summary":"Oauth Signin Callback","description":"Complete light sign-in and issue an L1 session.\n\nverify state → exchange code (identity scope) → userinfo → upsert user/org →\ncommit → set session cookie → 303 back to ``/demo/{return_to}`` (or the\ndashboard). Any failure 303s to the lander with ``?error=signin_failed`` —\nnever a 500 on crafted input (mirrors the claim flow's fail-soft contract).","operationId":"oauth_signin_callback_oauth_signin_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/claim/google":{"get":{"tags":["claim-reentry"],"summary":"Claim Google Reentry","description":"Re-initiate the Google OAuth claim flow against an existing Location.\n\nParameters\n----------\nlocation_id : uuid.UUID\n    Query-string UUID. FastAPI parses + validates; a malformed value\n    returns 422 (acceptable behavior for a malformed link).","operationId":"claim_google_reentry_app_claim_google_get","parameters":[{"name":"location_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/magic/{token}":{"get":{"tags":["magic-links"],"summary":"Magic Confirm","operationId":"magic_confirm_magic__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/magic/{token}/publish":{"post":{"tags":["magic-links"],"summary":"Magic Publish","operationId":"magic_publish_magic__token__publish_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/magic/r/{token}":{"get":{"tags":["magic-links"],"summary":"Magic Review","operationId":"magic_review_magic_r__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/magic/r/{token}/generate":{"post":{"tags":["magic-links"],"summary":"Magic Review Generate","operationId":"magic_review_generate_magic_r__token__generate_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/magic/r/{token}/mark-responded":{"post":{"tags":["magic-links"],"summary":"Magic Review Mark Responded","operationId":"magic_review_mark_responded_magic_r__token__mark_responded_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/magic/claim/{token}":{"get":{"tags":["magic-links"],"summary":"Magic Claim","description":"Complete an L1 email claim — verify magic link, complete_claim, redirect.\n\nAction-string contract per OQ2: ``claim_email:{demo_id}:{email}``. Anything\nelse (wrong action, malformed, missing parts) is rejected without touching\nthe magic link.\n\nValidation order (so each rejection branch is unambiguous):\n  1. Magic link exists                  → else 410 invalid\n  2. Magic link not yet used            → else 410 already used\n  3. Magic link not expired             → else 410 expired\n  4. Action starts with 'claim_email:'  → else 303 to '/'\n  5. Action parses into 3 parts         → else 303 to '/'\n  6. Demo exists                        → else 303 to '/demo/...'\n  7. Demo not already claimed           → else 303 to '/demo/<t>'\n\nSteps 8-10 (atomic, inside db.begin()):\n  8. Mark magic.used_at = now()\n  9. complete_claim(method='email')\n 10. (audit events emitted by complete_claim)\n\nThen set the Fernet session cookie and 303-redirect to /app/dashboard.","operationId":"magic_claim_magic_claim__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/magic/g/{token}":{"get":{"tags":["guard-magic"],"summary":"Attack Case","operationId":"attack_case_magic_g__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/magic/g/{token}/status":{"post":{"tags":["guard-magic"],"summary":"Attack Case Status","operationId":"attack_case_status_magic_g__token__status_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_attack_case_status_magic_g__token__status_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/db-health":{"get":{"summary":"Db Health","operationId":"db_health_db_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Db Health Db Health Get"}}}}}}},"/db-write-test":{"get":{"summary":"Db Write Test","operationId":"db_write_test_db_write_test_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Db Write Test Db Write Test Get"}}}}}}},"/debug/xff":{"get":{"summary":"Debug Xff","description":"Diagnostic: reveal how the edge proxy passes the client IP.\n\nSend a request carrying a bogus LEFTMOST ``X-Forwarded-For`` (see\n``scripts/check_xff.py``). If ``xff_raw`` STARTS WITH the bogus token, the\nedge APPENDS the real client IP to the right — the leftmost token is\nspoofable and ``demo_limits._client_ip`` must trust the RIGHTMOST token. If\nthe bogus token is absent, the edge REPLACES the header and leftmost trust\nis safe. Returns only the caller's own request metadata — no secrets.","operationId":"debug_xff_debug_xff_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Debug Xff Debug Xff Get"}}}}}}},"/ready":{"get":{"summary":"Ready","operationId":"ready_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"prefixItems":[{"additionalProperties":true,"type":"object"},{"type":"integer"}],"type":"array","maxItems":2,"minItems":2,"title":"Response Ready Ready Get"}}}}}}},"/app/onboarding":{"get":{"tags":["onboarding"],"summary":"Onboarding Form","operationId":"onboarding_form_app_onboarding_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["onboarding"],"summary":"Onboarding Submit","operationId":"onboarding_submit_app_onboarding_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_onboarding_submit_app_onboarding_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reviews/{review_id}/analysis":{"get":{"tags":["reviews"],"summary":"Get Review Analysis","operationId":"get_review_analysis_reviews__review_id__analysis_get","parameters":[{"name":"review_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Review Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Review Analysis Reviews  Review Id  Analysis Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reviews/{review_id}/analysis/recompute":{"post":{"tags":["reviews"],"summary":"Recompute Review Analysis","operationId":"recompute_review_analysis_reviews__review_id__analysis_recompute_post","parameters":[{"name":"review_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Review Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Recompute Review Analysis Reviews  Review Id  Analysis Recompute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/reviews/{review_id}/translate":{"post":{"tags":["reviews"],"summary":"Translate Review","description":"Retry a translation that previously failed.\n\nReturns 400 if ``target_lang`` is not in SUPPORTED_LOCALES (allowlist\nenforced at the route boundary — mitigates T-09-04-06 prompt-injection\nvia tampered locale codes).\n\nReturns 200 on success with the translated text fragment.\n\nReturns 200 on translator failure with the source-text + unavailable\nspan — the JS helper pastes it back in unchanged. The dashboard\nNEVER 500s on a translation failure (T-09-04-01 mitigation).","operationId":"translate_review_app_reviews__review_id__translate_post","parameters":[{"name":"review_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Review Id"}},{"name":"target_lang","in":"query","required":true,"schema":{"type":"string","title":"Target Lang"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/reviews/{review_id}/publish-reply":{"post":{"tags":["reviews"],"summary":"Publish Review Reply","description":"Post an owner reply to Google Business Profile via the v4 API.\n\nBackend-first: gated by ``settings.gbp_reply_publish_enabled`` (404 while\noff — no UI exposes it yet). Requires the ``manager`` role (OAuth-only): a\nwatcher with only an email claim has no write-capable token anyway.\n\nThe pure poster + refresh-retry orchestration is sync (``requests``-based),\nso it runs in a threadpool; the ORM mutations it makes (review stamps +\nrotated token) are persisted here in one transaction alongside the audit\nrow. Every typed failure maps to a distinct HTTP status so the client can\ntell \"reconnect Google\" (409/403) from \"try again\" (502).","operationId":"publish_review_reply_app_reviews__review_id__publish_reply_post","parameters":[{"name":"review_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Review Id"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_publish_review_reply_app_reviews__review_id__publish_reply_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/reviews/{review_id}/translation":{"get":{"tags":["reviews"],"summary":"Get Translation","description":"Cache-lookup-only endpoint for the JS polling loop.\n\nTRANSLATE-02: the toggleTranslation client hits POST /translate first\nto enqueue the worker task, then polls this endpoint every 1500ms\n(per the ``poll_after_ms`` hint) until the row lands or a client-side\ntimeout. This endpoint never triggers translation itself — no OpenAI,\nno Celery dispatch. Fully synchronous SQL, fast enough to poll.\n\nReturns 200 with ``{ok: true, text: \"...\"}`` on hit,\n200 with ``{ok: false, status: \"pending\"}`` on miss (JS keeps polling).","operationId":"get_translation_app_reviews__review_id__translation_get","parameters":[{"name":"review_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Review Id"}},{"name":"target_lang","in":"query","required":true,"schema":{"type":"string","title":"Target Lang"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/locations/{location_id}/risk":{"get":{"tags":["risk"],"summary":"Get Location Risk","operationId":"get_location_risk_locations__location_id__risk_get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}},{"name":"window","in":"query","required":false,"schema":{"type":"string","default":"30d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Location Risk Locations  Location Id  Risk Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/locations/{location_id}/topics":{"get":{"tags":["risk"],"summary":"Get Location Topics","operationId":"get_location_topics_locations__location_id__topics_get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}},{"name":"window","in":"query","required":false,"schema":{"type":"string","default":"30d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Location Topics Locations  Location Id  Topics Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/competitors":{"post":{"tags":["competitors"],"summary":"Add Competitor","operationId":"add_competitor_app_competitors_post","parameters":[{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_add_competitor_app_competitors_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/competitors/{competitor_id}/deactivate":{"post":{"tags":["competitors"],"summary":"Deactivate Competitor","operationId":"deactivate_competitor_app_competitors__competitor_id__deactivate_post","parameters":[{"name":"competitor_id","in":"path","required":true,"schema":{"type":"string","title":"Competitor Id"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/competitors/{competitor_id}":{"delete":{"tags":["competitors"],"summary":"Delete Competitor","operationId":"delete_competitor_app_competitors__competitor_id__delete","parameters":[{"name":"competitor_id","in":"path","required":true,"schema":{"type":"string","title":"Competitor Id"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/competitors/{competitor_id}/sync":{"post":{"tags":["competitors"],"summary":"Manual Sync Competitor","operationId":"manual_sync_competitor_app_competitors__competitor_id__sync_post","parameters":[{"name":"competitor_id","in":"path","required":true,"schema":{"type":"string","title":"Competitor Id"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/dashboard":{"get":{"tags":["ui"],"summary":"Dashboard","operationId":"dashboard_app_dashboard_get","parameters":[{"name":"location_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Location Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"rating_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rating Max"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"refresh","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/auth/step-up":{"get":{"tags":["step-up"],"summary":"Step Up Entry","description":"Start the step-up OAuth ceremony.\n\nRequires an existing valid session (get_current_user redirects to\n/app/login otherwise). Validates return_url, builds a signed state\ncarrying purpose+user_id+return_url, redirects to Google.","operationId":"step_up_entry_app_auth_step_up_get","parameters":[{"name":"return_url","in":"query","required":false,"schema":{"type":"string","default":"","title":"Return Url"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/auth/step-up/callback":{"get":{"tags":["step-up"],"summary":"Step Up Callback","description":"OAuth callback for the step-up ceremony.\n\nVerifies state has purpose=step_up, exchanges code for tokens, fetches\nGoogle userinfo, compares email to the session user's email in the DB.\nOn match: stamps step_up_at on the session cookie and 303s to the\nvalidated return_url. On mismatch: 403 (attacker-with-stolen-cookie\ncompleting OAuth as themselves).","operationId":"step_up_callback_app_auth_step_up_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/locations/{location_id}":{"delete":{"tags":["locations"],"summary":"Delete Location","description":"manager-gated soft-delete of a Location (SPEC CLAIM-04).\n\nA Location can only be deleted by a caller who holds the `manager` role\n(an oauth claim row) for that exact `{location_id}`. `require_role_path`\nraises TrustGateError(actual=\"L0\") on a missing/unparseable path slot\n(fail-closed per D-12) → 403 trust_gate.html.\n\nWave 3 behavioural change: an email-only claim is no longer sufficient\nto delete (that was already true under L3), but a caller with ONLY an\noauth claim (previously L2, denied under the old L3 gate) is now\n`manager` and CAN delete — OAuth alone is treated as authoritative\nproof of ownership, extending the Wave 1 rationale uniformly.\n\nWave 5 addition: the caller must ALSO have completed a step-up\nceremony within the last 10 minutes (`require_step_up`). A manager\nwhose session lacks a fresh `step_up_at` is redirected (303) to\n`/app/auth/step-up?return_url=<request-url>` rather than allowed\nthrough — the role gate alone is no longer sufficient for this\ndestructive endpoint.\n\nSemantics (D — soft-delete + background purge): stamp `deleted_at`, flip\n`is_active=False` so the sync scheduler stops fetching, emit a\n`location_soft_deleted` audit event, and enqueue `purge_soft_deleted` to\nphysically cascade the row after the grace window. Idempotent: a row that\nis already soft-deleted returns 404 (nothing live to delete).","operationId":"delete_location_app_locations__location_id__delete","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/locations/{location_id}/backfill/retry":{"post":{"tags":["locations"],"summary":"Retry Backfill","description":"Re-enqueue a fresh ScrapeGraph backfill after a terminal failure.\n\nTrust gate: watcher+ (any email-claim OR oauth-claim user on this\nLocation). The require_role_path factory is fail-closed (D-12); a\nmissing or unparseable ``{location_id}`` path slot, or insufficient\nrole, raises ``TrustGateError`` → 403 trust_gate.html.\n\nD-05 ordering contract (mirrors the email-claim handler):\n    1. Auto-begin guard: commit any implicit tx before opening a new one.\n    2. Inside ``async with db.begin():`` reset ``backfill_status='pending'``\n       and clear ``backfill_error``.\n    3. AFTER the block exits, ``.delay()`` the Celery task. The broker\n       never sees a task id whose target row is still uncommitted.\n\nReturns 303 redirect to ``/app/dashboard?location_id={id}`` so the\nPOST-redirect-GET pattern survives an F5 refresh without re-firing\nthe enqueue.","operationId":"retry_backfill_app_locations__location_id__backfill_retry_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/locations/{location_id}/publish-all-replies":{"post":{"tags":["locations"],"summary":"Publish All Replies Route","description":"Bulk-publish every unanswered review's own AI draft to Google.\n\nManager-gated (OAuth-only). Gated by settings.gbp_reply_publish_enabled AND\nthe location's integration holding the business.manage write scope — same\nconditions that render the per-review Publish button. Enqueues the\nplan-aware, quota-paced ``publish_all_replies`` task and returns 202; the\ndashboard reflects each row flipping to Published as the task runs.","operationId":"publish_all_replies_route_app_locations__location_id__publish_all_replies_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/locations/{location_id}/refresh":{"post":{"tags":["locations"],"summary":"Refresh Location","description":"User-triggered single-location refresh (GUARD-TIER-05, Phase 11 plan 05).\n\nWatcher-gated (any oauth OR email claim on this Location) + Redis-backed\n1/day/location rate limit. Runs INDEPENDENTLY of the Plan 01 trial-vs-paid\ncadence gate: a trial-plan org that cannot wait for the Sunday-23:00-UTC\npoll CAN use this button to force a fresh poll mid-week; a paid org can\nuse it to shorten the hourly beat when they spot a burst before the beat\nfires. One button, both tiers — CONTEXT.md D-11-03 implication realized.\n\nRate-limit key ``refresh:loc:{location_id}:{YYYYMMDD}``:\n  * scoped per LOCATION per UTC day (NOT per user) — two members sharing\n    a location share one refresh/day, preventing cross-user amplification.\n  * key wording matches the requirement verbatim; RateLimiter's fixed-\n    window bucket floor wraps at 00:00 UTC for a 86400s window.\n\nD-05 ordering contract (mirrors retry_backfill / delete_location):\n  1. Auto-begin guard: commit any implicit tx before opening a new one.\n  2. Rate-limit check BEFORE opening the tx — a rate-limited call never\n     spends a DB round-trip past the trust dep.\n  3. Inside ``async with db.begin():`` SELECT Location + emit audit row.\n     The block guarantees the audit event is committed before response.\n  4. AFTER the block exits, ``.delay()`` the Celery task. The broker\n     never sees an enqueue whose target row (or audit row) is still\n     uncommitted.\n\nContent negotiation (Accept header):\n  * ``application/json`` → 202 (success) or 429 (rate-limited).\n  * default (form POST)  → 303 redirect to\n    ``/app/dashboard?location_id={id}&refresh=<ok|rate_limited>``.\n\nFailure modes:\n  * Trust gate not met → 403 trust_gate.html (via ``require_role_path``).\n  * Rate-limit fires → 429 (JSON) or 303 with ``?refresh=rate_limited``.\n    Rate-limited attempts are NOT audited (they were never state-changing);\n    the audit chain is for confirmed intent, not blocked attempts\n    (T-11-05-06).\n  * Location soft-deleted between trust gate and our SELECT → 404\n    ``location_not_found`` (narrow race window; same posture as\n    retry_backfill).","operationId":"refresh_location_app_locations__location_id__refresh_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/orgs/{org_id}":{"delete":{"tags":["orgs"],"summary":"Delete Org","description":"manager-gated soft-delete of an Organization (SPEC CLAIM-04).\n\nInterface: `DELETE /app/orgs/{org_id}?location_id=<uuid>`. The role gate\nproves the caller holds `manager` on the named `?location_id`;\n`_tenancy_or_403` then proves that location lives under `{org_id}`\n(closes the cross-org attack in the module docstring). Semantics: stamp\n`deleted_at`, emit `org_soft_deleted` audit, enqueue purge. The DB-level\n`ondelete=CASCADE` on child FKs carries the physical purge; billing\nteardown (Paddle subscription cancel) is left to the purge task /\noperator follow-up.\n\nWave 5 addition: the caller must ALSO have completed a step-up\nceremony within the last 10 minutes (`require_step_up`), alongside\nthe existing manager-role gate. A stale/missing `step_up_at` redirects\n(303) to `/app/auth/step-up?return_url=<request-url>`.","operationId":"delete_org_app_orgs__org_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Org Id"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/orgs/{org_id}/members/{user_id}":{"delete":{"tags":["orgs"],"summary":"Remove Member","description":"manager-gated removal of an org member (SPEC CLAIM-04).\n\nInterface: `DELETE /app/orgs/{org_id}/members/{user_id}?location_id=<uuid>`.\nThe role check is on the CALLER's `manager` role for `?location_id`; the\npath-param `{user_id}` is the member being removed. `_tenancy_or_403`\nenforces that `?location_id` belongs to `{org_id}`.\n\nMembership removal is a hard delete of the `org_members` row (soft-deleting\na join row has no meaning). Guards: refuse to remove the last remaining\nmember (would orphan the org) → 409. Emits `member_removed` audit.\n\nWave 5 addition: the caller must ALSO have completed a step-up\nceremony within the last 10 minutes (`require_step_up`), alongside\nthe existing manager-role gate. A stale/missing `step_up_at` redirects\n(303) to `/app/auth/step-up?return_url=<request-url>`.","operationId":"remove_member_app_orgs__org_id__members__user_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"reputor_session","in":"cookie","required":false,"schema":{"type":"string","title":"Reputor Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"tags":["public"],"summary":"Landing","description":"Render the public marketing lander.\n\nTwo state variants (D-02, D-13):\n\n- ``?error=<key>&url_or_name=<original>`` — re-renders the page with\n  an inline error banner above the form and the form input\n  pre-filled. Recognised keys (UI-SPEC §Surface 1 inline-rejection\n  table): ``not_found``, ``places_5xx``, ``timeout``, ``ip_cap``,\n  ``global_cap``, ``no_reviews``. Unknown keys render no banner.\n- ``?l0=1`` — renders an informational L0-empty-state banner above\n  the form (D-13: authenticated users with zero claims redirected\n  here from ``/app/dashboard``).","operationId":"landing__get","parameters":[{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"url_or_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url Or Name"}},{"name":"l0","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"L0"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/privacy/":{"get":{"tags":["public"],"summary":"Privacy","operationId":"privacy_privacy__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/terms/":{"get":{"tags":["public"],"summary":"Terms","operationId":"terms_terms__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/refund/":{"get":{"tags":["public"],"summary":"Refund","operationId":"refund_refund__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/pricing/":{"get":{"tags":["public"],"summary":"Pricing","operationId":"pricing_pricing__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/contact/":{"get":{"tags":["public"],"summary":"Contact","operationId":"contact_contact__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/thanks/":{"get":{"tags":["public"],"summary":"Thanks","operationId":"thanks_thanks__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/pricing.md":{"get":{"tags":["public"],"summary":"Pricing Md","operationId":"pricing_md_pricing_md_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/llms.txt":{"get":{"tags":["public"],"summary":"Llms Txt","operationId":"llms_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/sitemap.xml":{"get":{"tags":["public"],"summary":"Sitemap","operationId":"sitemap_sitemap_xml_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/robots.txt":{"get":{"tags":["public"],"summary":"Robots","operationId":"robots_robots_txt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/pl/":{"get":{"tags":["seo"],"summary":"Seo Hub Pl","operationId":"seo_hub_pl_pl__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/pl/{niche}/{city}/":{"get":{"tags":["seo"],"summary":"Seo Landing Pl","operationId":"seo_landing_pl_pl__niche___city___get","parameters":[{"name":"niche","in":"path","required":true,"schema":{"type":"string","title":"Niche"}},{"name":"city","in":"path","required":true,"schema":{"type":"string","title":"City"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ua/":{"get":{"tags":["seo"],"summary":"Seo Hub Ua","operationId":"seo_hub_ua_ua__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/ua/{niche}/{city}/":{"get":{"tags":["seo"],"summary":"Seo Landing Ua","operationId":"seo_landing_ua_ua__niche___city___get","parameters":[{"name":"niche","in":"path","required":true,"schema":{"type":"string","title":"Niche"}},{"name":"city","in":"path","required":true,"schema":{"type":"string","title":"City"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/uk/":{"get":{"tags":["seo"],"summary":"Seo Hub Uk","operationId":"seo_hub_uk_uk__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/uk/{niche}/{city}/":{"get":{"tags":["seo"],"summary":"Seo Landing Uk","operationId":"seo_landing_uk_uk__niche___city___get","parameters":[{"name":"niche","in":"path","required":true,"schema":{"type":"string","title":"Niche"}},{"name":"city","in":"path","required":true,"schema":{"type":"string","title":"City"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/us/":{"get":{"tags":["seo"],"summary":"Seo Hub Us","operationId":"seo_hub_us_us__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/us/{niche}/{city}/":{"get":{"tags":["seo"],"summary":"Seo Landing Us","operationId":"seo_landing_us_us__niche___city___get","parameters":[{"name":"niche","in":"path","required":true,"schema":{"type":"string","title":"Niche"}},{"name":"city","in":"path","required":true,"schema":{"type":"string","title":"City"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alternatives/":{"get":{"tags":["alternatives"],"summary":"Alternatives Hub","operationId":"alternatives_hub_alternatives__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/alternatives/{slug}/":{"get":{"tags":["alternatives"],"summary":"Alternative","operationId":"alternative_alternatives__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"}}}}}}},"/demo/submit":{"post":{"tags":["demo"],"summary":"Demo Submit","description":"Synchronous anonymous demo generation per LAND-02 + D-01/D-02/D-03/D-04.\n\nSequence:\n  1. Extract `url_or_name` from form; reject empty inline.\n  2. Extract client IP; pre-check caps; redirect to lander on exceed.\n  3. Places: `resolve_url` → `place_details` via asyncio.to_thread.\n     Any failure → inline-redirect with no DB write, no cap consume.\n  4. Persist DemoLocation/Reviews(/Draft) in one transaction. Best-effort\n     topic + reply AI; failures degrade gracefully (D-04).\n  5. Emit `demo_generated` audit row inside the same transaction.\n  6. Consume caps (fail-open on Redis error per T-08-08-04).\n  7. 303-redirect to `/demo/{token}`.","operationId":"demo_submit_demo_submit_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/demo/{token}":{"get":{"tags":["demo"],"summary":"Demo Report","description":"Render `demo_report.html` (or `demo_already_claimed.html` variant).\n\nLookup is ALWAYS by `token_hash` — never by raw token (Pitfall 4).\nExpired demos (past `expires_at`) render the lander at status 410.","operationId":"demo_report_demo__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/demo/{token}/claim-email":{"post":{"tags":["demo"],"summary":"Demo Claim Email","description":"Begin the L1 (email) claim flow per SPEC CLAIM-02 + OQ2.\n\nCreates a `MagicLink(action='claim_email:{demo.id}:{email}')` with a\n1-hour TTL, sends the magic URL to the visitor-typed email via the\nexisting emailer, emits a `claim_started` audit row, and renders the\n`demo_claim_sent.html` confirmation page.\n\nEdge cases:\n  * Malformed email → 303 to `/demo/{token}?email_error=1`.\n  * Demo not found → 303 to `/` (visitor's token was bogus).\n  * Demo already claimed → 303 to `/demo/{token}` (let the report\n    handler render the already-claimed variant).\n  * Email-send failure → still render the confirmation page so the\n    visitor doesn't leak failure state into the public path; the\n    outbound error is logged for ops triage.","operationId":"demo_claim_email_demo__token__claim_email_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}},"/published":{"get":{"summary":"Published","operationId":"published_published_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"Body_add_competitor_app_competitors_post":{"properties":{"location_id":{"type":"string","title":"Location Id"},"display_name":{"type":"string","title":"Display Name"},"scrape_url":{"type":"string","title":"Scrape Url"}},"type":"object","required":["location_id","display_name","scrape_url"],"title":"Body_add_competitor_app_competitors_post"},"Body_admin_login_submit_admin_login_post":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"Body_admin_login_submit_admin_login_post"},"Body_attack_case_status_magic_g__token__status_post":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"Body_attack_case_status_magic_g__token__status_post"},"Body_login_submit_app_login_post":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"Body_login_submit_app_login_post"},"Body_onboarding_submit_app_onboarding_post":{"properties":{"business_name":{"type":"string","title":"Business Name"},"email":{"type":"string","title":"Email"},"location_name":{"type":"string","title":"Location Name"},"scrape_url":{"type":"string","title":"Scrape Url"}},"type":"object","required":["business_name","email","location_name","scrape_url"],"title":"Body_onboarding_submit_app_onboarding_post"},"Body_publish_review_reply_app_reviews__review_id__publish_reply_post":{"properties":{"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"Body_publish_review_reply_app_reviews__review_id__publish_reply_post"},"Body_set_org_language_app_billing_language_post":{"properties":{"language":{"type":"string","title":"Language"}},"type":"object","required":["language"],"title":"Body_set_org_language_app_billing_language_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"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}