{"openapi":"3.1.0","info":{"title":"Hushwork API Gateway","version":"0.1.0"},"paths":{"/api/health":{"get":{"summary":"Health","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Api Health Get"}}}}}}},"/api/protected":{"get":{"summary":"Protected Route","operationId":"protected_route_api_protected_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Protected Route Api Protected Get"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/admin/test":{"get":{"summary":"Admin Test","operationId":"admin_test_api_admin_test_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Test Api Admin Test Get"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/stores/{store_id}/crawls":{"get":{"tags":["crawls"],"summary":"List Crawl Jobs","description":"List crawl jobs for a store, newest first.","operationId":"list_crawl_jobs_api_stores__store_id__crawls_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CrawlJobResponse"},"title":"Response List Crawl Jobs Api Stores  Store Id  Crawls Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/crawls/trigger":{"post":{"tags":["crawls"],"summary":"Trigger Manual Crawl","description":"Manually trigger a crawl for a store. Creates a pending CrawlJob and publishes event.","operationId":"trigger_manual_crawl_api_stores__store_id__crawls_trigger_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/shopify/install":{"get":{"tags":["shopify-oauth"],"summary":"Shopify Install","description":"Initiate the Shopify OAuth flow — OAuth comes FIRST, always.\n\nDashboard-initiated (Clerk bearer token present): the user ID is signed\ninto the state and the authorization URL is returned as JSON for the\ndashboard route to redirect to.\n\nAnonymous browser hit (App Store install link — no Authorization header):\n302 straight to Shopify's authorize page with an anonymous state. Account\nsign-up happens only AFTER the OAuth handshake, on /claim-store\n(App Store requirement 2.3.2: no login or UI before auth).","operationId":"shopify_install_api_auth_shopify_install_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"shop","in":"query","required":true,"schema":{"type":"string","title":"Shop"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/shopify/callback":{"get":{"tags":["shopify-oauth"],"summary":"Shopify Callback","description":"Complete the Shopify OAuth flow.\n\nSteps (in order):\n  1. Validate shop domain format.\n  2. Verify the signed OAuth state and extract the Clerk user ID.\n  4. Verify HMAC signature from Shopify (timing-safe compare_digest).\n  5. Exchange authorization code for a long-lived access token.\n  6. Encrypt the token with Fernet and upsert ShopifyStore in the DB.\n  7. Publish store.connected event.\n  8. Clear OAuth cookies and redirect to the onboarding next step.","operationId":"shopify_callback_api_auth_shopify_callback_get","parameters":[{"name":"shop","in":"query","required":true,"schema":{"type":"string","title":"Shop"}},{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}},{"name":"hmac","in":"query","required":true,"schema":{"type":"string","title":"Hmac"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/shopify/claim":{"post":{"tags":["shopify-oauth"],"summary":"Claim Store","description":"Bind a freshly-installed store to the signed-in Clerk user.\n\nClaim tokens are minted only by the OAuth callback and the embedded\nbootstrap, both of which verify shop-admin access first, so the bearer is\nentitled to the store even if another account currently holds it — that\nrebind is audit-logged by :func:`rebind_store_owner`. Treating a stale\nbinding as final would leave the merchant with no way in.","operationId":"claim_store_api_auth_shopify_claim_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/embedded/bootstrap":{"post":{"tags":["embedded"],"summary":"Embedded Bootstrap","description":"Install-or-refresh for the embedded shell; returns the overview payload.","operationId":"embedded_bootstrap_api_embedded_bootstrap_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/embedded/pages":{"get":{"tags":["embedded"],"summary":"Embedded Pages","description":"Hosted pages with publish state and pageview counts (last `days`).","operationId":"embedded_pages_api_embedded_pages_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{},"title":"Response Embedded Pages Api Embedded Pages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/embedded/pages/{page_id}":{"delete":{"tags":["embedded"],"summary":"Embedded Delete Page","description":"Soft-delete a hosted page (status='deleted') and publish page.deleted.\n\nScoped to the session's own store, so a page id belonging to another shop\nis a 404 rather than a cross-tenant delete.","operationId":"embedded_delete_page_api_embedded_pages__page_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/embedded/traction":{"get":{"tags":["embedded"],"summary":"Embedded Traction","description":"ROI funnel numbers for the last `days` days (see PIVOT.md for shape).","operationId":"embedded_traction_api_embedded_traction_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/embedded/billing":{"get":{"tags":["embedded"],"summary":"Embedded Billing","description":"Billing state + the full tier catalog for the in-admin pricing UI.","operationId":"embedded_billing_api_embedded_billing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/embedded/billing/subscribe":{"post":{"tags":["embedded"],"summary":"Embedded Subscribe","description":"Start a paid subscription from inside the Shopify admin.\n\nIdentical charge logic to the dashboard route (billed on approval, and a\nforced test charge on partner/development stores) — the only difference is\nthe return_url marker, which brings the merchant back into the admin\ninstead of out to the standalone dashboard.","operationId":"embedded_subscribe_api_embedded_billing_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/embedded/billing/cancel":{"post":{"tags":["embedded"],"summary":"Embedded Cancel","description":"Cancel the store's paid plan from inside the Shopify admin.\n\nSame flow as the dashboard route: the plan stays usable until the end of\nthe period already paid for. Returns the updated billing state.","operationId":"embedded_cancel_api_embedded_billing_cancel_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/auth/gsc/connect":{"get":{"tags":["gsc-oauth"],"summary":"Gsc Connect","description":"Initiate the Google Search Console OAuth flow.\n\nGenerates a state token, stores it in an HttpOnly cookie, and redirects\nthe browser to the Google consent screen.  Returns HTTP 503 when\nGOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET are not configured so the caller\ngets a clear error instead of a cryptic Google 400.","operationId":"gsc_connect_api_auth_gsc_connect_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/auth/gsc/callback":{"get":{"tags":["gsc-oauth"],"summary":"Gsc Callback","description":"Complete the Google Search Console OAuth flow.\n\nSteps (in order):\n  1. If user denied consent (error param present), redirect to dashboard\n     with an error query param — do not raise an exception.\n  2. Validate state cookie — raise HTTP 400 on mismatch (CSRF guard).\n  3. Exchange authorization code for credentials via Google token endpoint.\n  4. Assert refresh_token is present — redirect to dashboard with error if\n     absent (happens when prompt=consent was not set or Google deduped).\n  5. Fernet-encrypt the refresh token and persist on ShopifyStore.\n  6. Advance onboarding_step to \"connect_gsc\" (unless already \"complete\").\n  7. Clear the state cookie and redirect to dashboard with success param.","operationId":"gsc_callback_api_auth_gsc_callback_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/me":{"get":{"tags":["stores"],"summary":"Get My Store","description":"Return the authenticated user's connected Shopify store.\n\nReturns 404 if the user has not yet connected a store.  The encrypted\naccess token is never included in the response.\n\nA user is expected to own one store, but ownership can legitimately move\n(see rebind_store_owner), so pick deterministically — active first, then\nmost recent — rather than erroring out when there are several.","operationId":"get_my_store_api_stores_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreResponse"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/stores/me/context":{"get":{"tags":["store-context"],"summary":"Get Store Context","description":"Return the authenticated store's saved business context.\n\nReturns 404 if no store or no context has been saved yet.","operationId":"get_store_context_api_stores_me_context_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreContextResponse"}}}}},"security":[{"ClerkHTTPBearer":[]}]},"post":{"tags":["store-context"],"summary":"Upsert Store Context","description":"Upsert the authenticated store's business context.\n\nSaves niche, target audience, competitor URLs, and target markets.\nAdvances onboarding_step from \"connect_store\" to \"business_context\"\nso the frontend knows to move on.","operationId":"upsert_store_context_api_stores_me_context_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreContextRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreContextResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/tasks/{task_id}":{"get":{"tags":["tasks"],"summary":"Get Task Status","description":"Return task status.\n\nSince we moved to event-driven architecture, this endpoint checks\nthe DB for completion markers rather than querying Celery.","operationId":"get_task_status_api_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/keywords":{"get":{"tags":["keywords"],"summary":"List Keywords","description":"List keywords for a store, ordered by opportunity_score descending.","operationId":"list_keywords_api_stores__store_id__keywords_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tier"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KeywordResponse"},"title":"Response List Keywords Api Stores  Store Id  Keywords Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/keywords/{keyword_id}/status":{"patch":{"tags":["keywords"],"summary":"Update Keyword Status","description":"Update a single keyword's status (approved/rejected/pending).","operationId":"update_keyword_status_api_stores__store_id__keywords__keyword_id__status_patch","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"keyword_id","in":"path","required":true,"schema":{"type":"integer","title":"Keyword Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__keywords__StatusUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/keywords/bulk-status":{"post":{"tags":["keywords"],"summary":"Bulk Update Keyword Status","description":"Bulk update keyword statuses for a list of keyword IDs.","operationId":"bulk_update_keyword_status_api_stores__store_id__keywords_bulk_status_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/keywords/score":{"post":{"tags":["keywords"],"summary":"Trigger Scoring","description":"Dispatch scoring for this store via event. Returns 202 Accepted.","operationId":"trigger_scoring_api_stores__store_id__keywords_score_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/content/brief":{"post":{"tags":["content"],"summary":"Generate Brief","description":"Generate a content brief for an approved keyword (CONT-02).","operationId":"generate_brief_api_stores__store_id__content_brief_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Generate Brief Api Stores  Store Id  Content Brief Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/content/{page_id}/generate":{"post":{"tags":["content"],"summary":"Trigger Generate","description":"Dispatch content generation event (CONT-03). Returns 202 Accepted.","operationId":"trigger_generate_api_stores__store_id__content__page_id__generate_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trigger Generate Api Stores  Store Id  Content  Page Id  Generate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/content":{"get":{"tags":["content"],"summary":"List Content","description":"List latest content version per page for this store (CONT-07).","operationId":"list_content_api_stores__store_id__content_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContentVersionResponse"},"title":"Response List Content Api Stores  Store Id  Content Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/content/{page_id}/versions":{"get":{"tags":["content"],"summary":"List Versions","description":"List all content versions for a specific page, newest first (CONT-06).","operationId":"list_versions_api_stores__store_id__content__page_id__versions_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContentVersionResponse"},"title":"Response List Versions Api Stores  Store Id  Content  Page Id  Versions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/content/{page_id}/versions/{version_id}":{"get":{"tags":["content"],"summary":"Get Version","description":"Get specific content version with SEO preview data (CONT-07, CONT-08).","operationId":"get_version_api_stores__store_id__content__page_id__versions__version_id__get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"integer","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["content"],"summary":"Update Version","description":"Save editor changes as a new content version (NEVER overwrites existing).","operationId":"update_version_api_stores__store_id__content__page_id__versions__version_id__patch","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"integer","title":"Version Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentVersionPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/content/{version_id}/optimize":{"post":{"tags":["seo"],"summary":"Optimize Content Version","description":"Dispatch SEO optimization event for a content version. Returns 202.","operationId":"optimize_content_version_api_stores__store_id__content__version_id__optimize_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"integer","title":"Version Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/content/{version_id}/seo":{"get":{"tags":["seo"],"summary":"Get Seo Metadata","description":"Fetch stored SEO metadata for a content version.","operationId":"get_seo_metadata_api_stores__store_id__content__version_id__seo_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"integer","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SEOOptimizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/llms.txt":{"get":{"tags":["seo"],"summary":"Get Llms Txt","description":"Return the store's cached llms.txt content.\n\nThe llms.txt is generated asynchronously by the llms_txt_updater consumer\non content.published and store.crawl_completed events. This endpoint reads\nthe latest generated content from the store_contexts table.","operationId":"get_llms_txt_api_stores__store_id__llms_txt_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/pages/{page_id}/publish":{"post":{"tags":["publish"],"summary":"Publish Now","description":"Dispatch immediate publish of a page to Shopify. Returns 202.","operationId":"publish_now_api_stores__store_id__pages__page_id__publish_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRequest","default":{}}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/pages/{page_id}/schedule":{"post":{"tags":["publish"],"summary":"Schedule Publish","description":"Schedule a page for future publish.","operationId":"schedule_publish_api_stores__store_id__pages__page_id__schedule_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["publish"],"summary":"Cancel Schedule","description":"Cancel a scheduled publish. Resets status to 'draft'.","operationId":"cancel_schedule_api_stores__store_id__pages__page_id__schedule_delete","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/pages/{page_id}/publish-status":{"get":{"tags":["publish"],"summary":"Get Publish Status","description":"Get the current publish status of a page.","operationId":"get_publish_status_api_stores__store_id__pages__page_id__publish_status_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/customers":{"get":{"tags":["admin"],"summary":"List Customers","description":"Return customer list with Shopify store details and usage stats (ADMIN-01, ADMIN-02).","operationId":"list_customers_api_admin_customers_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Customers Api Admin Customers Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/customers/{customer_id}/usage":{"get":{"tags":["admin"],"summary":"Get Customer Usage","description":"Return detailed API usage for a single customer (ADMIN-02).","operationId":"get_customer_usage_api_admin_customers__customer_id__usage_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Customer Usage Api Admin Customers  Customer Id  Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/worker-health":{"get":{"tags":["admin"],"summary":"Get Worker Health","description":"Broker + Redis health, per-queue depth, consumer liveness, DLQ counts.","operationId":"get_worker_health_api_admin_worker_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Worker Health Api Admin Worker Health Get"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/admin/config":{"get":{"tags":["admin"],"summary":"List Config","description":"List global admin configuration entries (ADMIN-04).\n\nadmin_config doubles as a per-store KV store: llms_txt_updater writes the\nwhole llms.txt body under llms_txt_{store_id} and index_pinger writes\nIndexNow keys there. Those are not settings — unfiltered, the config editor\ngrows a row per store and renders a multi-KB document inside a text input.","operationId":"list_config_api_admin_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Config Api Admin Config Get"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/admin/config/{key}":{"put":{"tags":["admin"],"summary":"Update Config","description":"Update a global config value and write an audit log entry (ADMIN-04, ADMIN-05).","operationId":"update_config_api_admin_config__key__put","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Config Api Admin Config  Key  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/audit-log":{"get":{"tags":["admin"],"summary":"List Audit Log","description":"Return recent audit log entries, newest first (ADMIN-05).","operationId":"list_audit_log_api_admin_audit_log_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"actor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Id"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Audit Log Api Admin Audit Log Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/keyword-metrics/compare":{"get":{"tags":["admin"],"summary":"Compare Keyword Metrics","description":"Compare keyword volume/difficulty across providers (both mode).","operationId":"compare_keyword_metrics_api_admin_keyword_metrics_compare_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"geo","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geo"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/stores":{"get":{"tags":["admin-stores"],"summary":"List Stores","description":"Every store with its tier, feed size, crawl state and error counts.","operationId":"list_stores_api_admin_stores_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"created_at","title":"Sort"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","default":"desc","title":"Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Stores Api Admin Stores Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/stores/{store_id}":{"get":{"tags":["admin-stores"],"summary":"Get Store Detail","description":"Everything an operator needs about one store on a single screen.","operationId":"get_store_detail_api_admin_stores__store_id__get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Store Detail Api Admin Stores  Store Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/stores/{store_id}/crawl":{"post":{"tags":["admin-stores"],"summary":"Admin Trigger Crawl","description":"Re-crawl the storefront. Mirrors the merchant trigger, without the cooldown.","operationId":"admin_trigger_crawl_api_admin_stores__store_id__crawl_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Trigger Crawl Api Admin Stores  Store Id  Crawl Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/stores/{store_id}/rebake":{"post":{"tags":["admin-stores"],"summary":"Admin Rebake","description":"Re-bake every hosted page for this store (theme or template changes).","operationId":"admin_rebake_api_admin_stores__store_id__rebake_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Rebake Api Admin Stores  Store Id  Rebake Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/stores/{store_id}/strategy/regenerate":{"post":{"tags":["admin-stores"],"summary":"Admin Regenerate Strategy","description":"Re-synthesize the store's SEO strategy artifact.","operationId":"admin_regenerate_strategy_api_admin_stores__store_id__strategy_regenerate_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Regenerate Strategy Api Admin Stores  Store Id  Strategy Regenerate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/stores/{store_id}/webhooks/register":{"post":{"tags":["admin-stores"],"summary":"Admin Register Webhooks","description":"Backfill Shopify webhook subscriptions for a connected store.","operationId":"admin_register_webhooks_api_admin_stores__store_id__webhooks_register_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Register Webhooks Api Admin Stores  Store Id  Webhooks Register Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/stores/{store_id}/campaign":{"patch":{"tags":["admin-stores"],"summary":"Admin Update Campaign","description":"Set fast_mode and/or paused on any store's campaign.","operationId":"admin_update_campaign_api_admin_stores__store_id__campaign_patch","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignAdminUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Update Campaign Api Admin Stores  Store Id  Campaign Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/overview":{"get":{"tags":["admin-fleet"],"summary":"Get Overview","description":"Counts for the admin home. DB only — the page fetches health separately.","operationId":"get_overview_api_admin_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Overview Api Admin Overview Get"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/admin/billing/summary":{"get":{"tags":["admin-fleet"],"summary":"Get Billing Summary","description":"MRR and the three lists worth acting on: expiring, frozen, uninstalled.","operationId":"get_billing_summary_api_admin_billing_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Billing Summary Api Admin Billing Summary Get"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/admin/impact/summary":{"get":{"tags":["admin-fleet"],"summary":"Get Impact Summary","description":"Traffic, attributed revenue and token spend per store over a window.\n\nIndependent LATERALs, never a three-way join: page_views, attributed_orders\nand content_versions are all siblings at store grain, and joining them would\nmultiply rows and inflate every sum (the fan-out that once made the admin\ncustomers list report 100,000x the real token count).","operationId":"get_impact_summary_api_admin_impact_summary_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Impact Summary Api Admin Impact Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dead-letters":{"get":{"tags":["admin-fleet"],"summary":"List Dead Letters","description":"Persisted dead letters, newest first. Payloads are fetched per row.","operationId":"list_dead_letters_api_admin_dead_letters_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"routing_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Routing Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Dead Letters Api Admin Dead Letters Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dead-letters/{dead_letter_id}":{"get":{"tags":["admin-fleet"],"summary":"Get Dead Letter","description":"One dead letter with its full payload and headers.","operationId":"get_dead_letter_api_admin_dead_letters__dead_letter_id__get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"dead_letter_id","in":"path","required":true,"schema":{"type":"integer","title":"Dead Letter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Dead Letter Api Admin Dead Letters  Dead Letter Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dead-letters/{dead_letter_id}/replay":{"post":{"tags":["admin-fleet"],"summary":"Replay Dead Letter","description":"Republish a dead letter on its original routing key.\n\nReplay is recorded and refused a second time: the point of a DLQ is that the\nmessage already failed, and a replay loop is how one poison message becomes\nan outage.","operationId":"replay_dead_letter_api_admin_dead_letters__dead_letter_id__replay_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"dead_letter_id","in":"path","required":true,"schema":{"type":"integer","title":"Dead Letter Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Replay Dead Letter Api Admin Dead Letters  Dead Letter Id  Replay Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/webhook-failures":{"get":{"tags":["admin-fleet"],"summary":"List Webhook Failures","description":"Shopify webhooks that errored or were never processed.\n\nPayloads are deliberately excluded — orders/create bodies carry customer\ndata, and an operator diagnosing delivery failures needs the topic and the\nerror, not the contents.","operationId":"list_webhook_failures_api_admin_webhook_failures_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"store_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Webhook Failures Api Admin Webhook Failures Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/refresh/candidates":{"get":{"tags":["refresh"],"summary":"List Refresh Candidates","description":"List all pages flagged for content refresh.","operationId":"list_refresh_candidates_api_stores__store_id__refresh_candidates_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RefreshCandidateResponse"},"title":"Response List Refresh Candidates Api Stores  Store Id  Refresh Candidates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/refresh/{page_id}/approve":{"post":{"tags":["refresh"],"summary":"Approve Refresh","description":"Queue a regenerate + republish for a flagged page.\n\nThe regenerated version optimizes and republishes in place automatically —\nthe merchant approves the refresh, not each step of it.","operationId":"approve_refresh_api_stores__store_id__refresh__page_id__approve_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Approve Refresh Api Stores  Store Id  Refresh  Page Id  Approve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/refresh/{page_id}/diff":{"get":{"tags":["refresh"],"summary":"Get Refresh Diff","description":"Get the before/after diff for a pending refresh.","operationId":"get_refresh_diff_api_stores__store_id__refresh__page_id__diff_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshDiffResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/refresh/{page_id}/history":{"get":{"tags":["refresh"],"summary":"Get Refresh History","description":"Get refresh history for a page.","operationId":"get_refresh_history_api_stores__store_id__refresh__page_id__history_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RefreshHistoryItem"},"title":"Response Get Refresh History Api Stores  Store Id  Refresh  Page Id  History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/refresh/{page_id}/auto-refresh":{"patch":{"tags":["refresh"],"summary":"Toggle Auto Refresh","description":"Toggle the auto_refresh flag for a page.","operationId":"toggle_auto_refresh_api_stores__store_id__refresh__page_id__auto_refresh_patch","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoRefreshToggle"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Toggle Auto Refresh Api Stores  Store Id  Refresh  Page Id  Auto Refresh Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/rankings":{"get":{"tags":["rankings"],"summary":"List Rankings","description":"List latest ranking position per keyword for a store.\n\nReturns the most recent ranking row per (keyword, source) pair,\nsorted by position ascending (best first), with delta vs prior day.","operationId":"list_rankings_api_stores__store_id__rankings_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RankingRow"},"title":"Response List Rankings Api Stores  Store Id  Rankings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/rankings/{keyword_id}/history":{"get":{"tags":["rankings"],"summary":"Get Ranking History","description":"Return 90-day ranking trend for a specific keyword.\n\nReturns daily aggregated positions (avg per day) for chart rendering.","operationId":"get_ranking_history_api_stores__store_id__rankings__keyword_id__history_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"keyword_id","in":"path","required":true,"schema":{"type":"integer","title":"Keyword Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankingHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/rankings/config":{"get":{"tags":["rankings"],"summary":"Get Alert Config","description":"Get the ranking alert threshold configured for this store.","operationId":"get_alert_config_api_stores__store_id__rankings_config_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["rankings"],"summary":"Update Alert Config","description":"Update the ranking alert threshold for this store (1-100).","operationId":"update_alert_config_api_stores__store_id__rankings_config_put","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/rankings/track":{"post":{"tags":["rankings"],"summary":"Trigger Ranking Track","description":"Dispatch ranking tracking for this store via event. Returns 202 Accepted.","operationId":"trigger_ranking_track_api_stores__store_id__rankings_track_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/rankings/domain":{"get":{"tags":["rankings"],"summary":"List Domain Rankings","description":"The store's EXISTING organic footprint on its own domain (the 'where do\nyou rank today' diagnostic). Best position per keyword across sources.","operationId":"list_domain_rankings_api_stores__store_id__rankings_domain_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"max_position","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Position"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DomainRankingRow"},"title":"Response List Domain Rankings Api Stores  Store Id  Rankings Domain Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/backlinks/opportunities":{"get":{"tags":["backlinks"],"summary":"List Opportunities","description":"List backlink opportunities for a store, sorted by DA score descending.\n\nBL-04: Users see backlink opportunities with scores in the dashboard.\n\nQuery params:\n    status_filter: Filter by status (new/contacted/won/lost). Maps to ?status= in URL.\n    link_type: Filter by link type (guest_post/citation/resource_page/directory).\n    limit: Max results (default 50).","operationId":"list_opportunities_api_stores__store_id__backlinks_opportunities_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}},{"name":"link_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Link Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BacklinkOpportunityResponse"},"title":"Response List Opportunities Api Stores  Store Id  Backlinks Opportunities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/backlinks/opportunities/{opportunity_id}/status":{"patch":{"tags":["backlinks"],"summary":"Update Opportunity Status","description":"Update the status of a backlink opportunity.\n\nBL-04: User can mark opportunities as contacted/won/lost.\nStatus workflow: new → contacted → won/lost\n\nReturns 404 if opportunity not found.","operationId":"update_opportunity_status_api_stores__store_id__backlinks_opportunities__opportunity_id__status_patch","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"opportunity_id","in":"path","required":true,"schema":{"type":"integer","title":"Opportunity Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__backlinks__StatusUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/backlinks/discover":{"post":{"tags":["backlinks"],"summary":"Trigger Discovery","description":"Trigger an immediate backlink discovery run for a store.\n\nBL-01: Publishes event for backlink discovery. Returns 202 Accepted.","operationId":"trigger_discovery_api_stores__store_id__backlinks_discover_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/backlinks/gains":{"get":{"tags":["backlinks"],"summary":"List Gains","description":"List gained backlinks (status='won').\n\nBL-06: Dashboard shows gained links.\nSorted by most recently discovered first.","operationId":"list_gains_api_stores__store_id__backlinks_gains_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BacklinkOpportunityResponse"},"title":"Response List Gains Api Stores  Store Id  Backlinks Gains Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/backlinks/losses":{"get":{"tags":["backlinks"],"summary":"List Losses","description":"List lost backlinks (status='lost').\n\nBL-06: Dashboard shows lost links (detected as dead by monitoring task).\nSorted by most recently discovered first.","operationId":"list_losses_api_stores__store_id__backlinks_losses_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BacklinkOpportunityResponse"},"title":"Response List Losses Api Stores  Store Id  Backlinks Losses Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/ai-mentions":{"get":{"tags":["ai-mentions"],"summary":"List Ai Mentions","description":"List recent AI mentions for this store, newest first.","operationId":"list_ai_mentions_api_stores__store_id__ai_mentions_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AIMentionResponse"},"title":"Response List Ai Mentions Api Stores  Store Id  Ai Mentions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/ai-mentions/trends":{"get":{"tags":["ai-mentions"],"summary":"Get Mention Trends","description":"Return mention counts grouped by date and platform for trend charts.","operationId":"get_mention_trends_api_stores__store_id__ai_mentions_trends_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TrendPoint"},"title":"Response Get Mention Trends Api Stores  Store Id  Ai Mentions Trends Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/ai-mentions/check":{"post":{"tags":["ai-mentions"],"summary":"Trigger Mention Check","description":"Manually trigger AI mention check for this store.","operationId":"trigger_mention_check_api_stores__store_id__ai_mentions_check_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/shopify":{"post":{"tags":["webhooks"],"summary":"Receive Shopify Webhook","description":"Receive, verify, log, and fan out a Shopify webhook. Always 200 on success-path.","operationId":"receive_shopify_webhook_api_webhooks_shopify_post","parameters":[{"name":"x-shopify-hmac-sha256","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Shopify-Hmac-Sha256"}},{"name":"x-shopify-topic","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Shopify-Topic"}},{"name":"x-shopify-shop-domain","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Shopify-Shop-Domain"}},{"name":"x-shopify-webhook-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shopify-Webhook-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/platform/verify-proxy":{"get":{"tags":["internal-platform"],"summary":"Verify Proxy","description":"Verify an App Proxy request and return the signed shop.\n\nThe renderer forwards the original proxy query string here so the secret\nnever leaves the gateway. Uses the store's own ``app_proxy_secret``\n(custom-distribution app) when present, else the global public-app secret.\n\nReturns ``{\"verified\": bool, \"shop\": str | None}``.","operationId":"verify_proxy_internal_platform_verify_proxy_get","parameters":[{"name":"x-internal-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Verify Proxy Internal Platform Verify Proxy Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/platform/site":{"get":{"tags":["internal-platform"],"summary":"Get Site","description":"Store metadata + published, non-deleted pages for the hub index/sitemap.","operationId":"get_site_internal_platform_site_get","parameters":[{"name":"shop","in":"query","required":true,"schema":{"type":"string","title":"Shop"}},{"name":"x-internal-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/platform/page":{"get":{"tags":["internal-platform"],"summary":"Get Page","description":"Full content for one hosted page: latest published version (fallback: latest).","operationId":"get_page_internal_platform_page_get","parameters":[{"name":"shop","in":"query","required":true,"schema":{"type":"string","title":"Shop"}},{"name":"slug","in":"query","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"x-internal-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/platform/collect":{"post":{"tags":["internal-platform"],"summary":"Collect Events","description":"Verify the App Proxy signature and fan a batch of beacon events out.\n\nVerification lives here rather than in the renderer so one HTTP call does\nboth, and so the proxy secret never leaves the gateway. The store lookup is\nmemoized, so the steady-state cost of a beacon hit is a signature check, a\nRedis INCR, and a publish — no DB read.","operationId":"collect_events_internal_platform_collect_post","parameters":[{"name":"x-internal-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/platform/rebake":{"post":{"tags":["internal-platform"],"summary":"Rebake","description":"Trigger a re-bake of a store's pages, or all stores (e.g. after a\ntemplate change). Publishes content.rebake_requested per store; the\npage_builder consumer does the actual baking.","operationId":"rebake_internal_platform_rebake_post","parameters":[{"name":"x-internal-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RebakeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/pages":{"get":{"tags":["traction"],"summary":"List Hosted Pages","description":"List hosted pages with publish state and pageview counts (last `days`).","operationId":"list_hosted_pages_api_stores__store_id__pages_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{},"title":"Response List Hosted Pages Api Stores  Store Id  Pages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/pages/{page_id}":{"delete":{"tags":["traction"],"summary":"Delete Hosted Page","description":"Soft-delete a hosted page (status='deleted') and publish page.deleted.","operationId":"delete_hosted_page_api_stores__store_id__pages__page_id__delete","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/webhooks/register":{"post":{"tags":["traction"],"summary":"Register Store Webhooks","description":"Register Shopify webhook subscriptions for an already-connected store.","operationId":"register_store_webhooks_api_stores__store_id__webhooks_register_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/traction/overview":{"get":{"tags":["traction"],"summary":"Traction Overview","description":"ROI funnel numbers for the last `days` days (see PIVOT.md for shape).","operationId":"traction_overview_api_stores__store_id__traction_overview_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/campaign":{"get":{"tags":["traction"],"summary":"Get Campaign","description":"Campaign tier/billing state + feed progress, auto-created as a trial.","operationId":"get_campaign_api_stores__store_id__campaign_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["traction"],"summary":"Update Campaign","description":"Update pause state (owner) and/or fast_mode (admin role only).","operationId":"update_campaign_api_stores__store_id__campaign_patch","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/feed-path":{"get":{"tags":["traction"],"summary":"Get Feed Path","description":"Current feed subpath, whether it can still be changed, and a preview URL.","operationId":"get_feed_path_api_stores__store_id__feed_path_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["traction"],"summary":"Update Feed Path","description":"Change the feed subpath. 409 once locked (first publish) or any page is live.","operationId":"update_feed_path_api_stores__store_id__feed_path_patch","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedPathUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/setup-status":{"get":{"tags":["traction"],"summary":"Get Setup Status","description":"Non-blocking view of the automated post-connect pipeline.\n\nThe dashboard polls this to show a friendly \"analyzing your store\" card\ninstead of a hard-blocking spinner tied to a single task. It is derived\npurely from row counts, so it never waits on any one job and can't wedge:\neach stage simply reflects what has landed in the database so far.\n\n  analyzing   -> crawl running (no store_pages yet)\n  discovering -> crawl done, finding keyword opportunities\n  planning    -> keywords found, clustering/planning the content feed\n  building    -> pages created, generating & publishing\n  live        -> at least one page is published","operationId":"get_setup_status_api_stores__store_id__setup_status_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/strategy":{"get":{"tags":["traction"],"summary":"Get Strategy","description":"Latest synthesized SEO strategy for the store, or 404 if none exists yet.","operationId":"get_strategy_api_stores__store_id__strategy_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/strategy/regenerate":{"post":{"tags":["traction"],"summary":"Regenerate Strategy","description":"Dispatch strategy regeneration to the strategy_synthesizer consumer.","operationId":"regenerate_strategy_api_stores__store_id__strategy_regenerate_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/billing/subscribe":{"post":{"tags":["billing"],"summary":"Subscribe","description":"Create a Shopify recurring subscription for a paid tier.\n\nbilling_status stays unchanged until the merchant approves and the\ncallback confirms the subscription is ACTIVE.","operationId":"subscribe_api_stores__store_id__billing_subscribe_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/billing/cancel":{"post":{"tags":["billing"],"summary":"Cancel","description":"Cancel the store's paid plan. Returns the updated billing state.\n\nAccess to the plan continues until the end of the period Shopify already\nbilled; nothing is prorated or refunded.","operationId":"cancel_api_stores__store_id__billing_cancel_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/billing/callback":{"get":{"tags":["billing"],"summary":"Billing Callback","description":"Shopify approval return_url target — merchant arrives from Shopify admin.\n\nNo Clerk auth (browser redirect carries no bearer token); the request is\nvalidated against the pending_subscription_id stored at subscribe time,\nand the subscription status is verified server-side via GraphQL.\n\nShopify only sends the merchant here after they APPROVE. Declining leaves\nthem on the admin's Apps page and never calls this URL, so a declined\ncharge is cleaned up by the app_subscriptions/update webhook instead.\n\n`origin=embedded` (set on the return_url by the embedded subscribe) sends\nthe merchant back into the Shopify admin rather than out to the standalone\ndashboard — a flow started inside the admin must finish inside the admin.","operationId":"billing_callback_api_stores__store_id__billing_callback_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"charge_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Charge Id"}},{"name":"origin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/billing":{"get":{"tags":["billing"],"summary":"Get Billing","description":"Billing state + the full tier catalog for the pricing UI.","operationId":"get_billing_api_stores__store_id__billing_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/products":{"get":{"tags":["products"],"summary":"List Products","description":"Catalog products with metafield price/image/status and linked hosted pages.","operationId":"list_products_api_stores__store_id__products_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{},"title":"Response List Products Api Stores  Store Id  Products Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/products/{product_id}/takedown":{"post":{"tags":["products"],"summary":"Takedown Product Pages","description":"Unpublish every published page linked to a product (restorable).","operationId":"takedown_product_pages_api_stores__store_id__products__product_id__takedown_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/pages/{page_id}/republish":{"post":{"tags":["products"],"summary":"Republish Page","description":"Restore an 'unpublished' page via the normal publish chain (202).","operationId":"republish_page_api_stores__store_id__pages__page_id__republish_post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/impact/pages":{"get":{"tags":["impact"],"summary":"List Impact Pages","operationId":"list_impact_pages_api_stores__store_id__impact_pages_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ImpactPage"},"title":"Response List Impact Pages Api Stores  Store Id  Impact Pages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/impact/summary":{"get":{"tags":["impact"],"summary":"Impact Summary","description":"Store-level proof totals. credited_only=True (default) excludes the\nassist tier from the headline numbers (it stays counted in pages_assist).","operationId":"impact_summary_api_stores__store_id__impact_summary_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"credited_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Credited Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImpactSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/impact/llm-citations":{"get":{"tags":["impact"],"summary":"Llm Citations","description":"AI-search citation share over the window — the LLM-answer channel KPI.","operationId":"llm_citations_api_stores__store_id__impact_llm_citations_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":90,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LlmCitations"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stores/{store_id}/geo/opportunities":{"get":{"tags":["geo"],"summary":"Geo Opportunities","operationId":"geo_opportunities_api_stores__store_id__geo_opportunities_get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarketOpportunity"},"title":"Response Geo Opportunities Api Stores  Store Id  Geo Opportunities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/test-suite/seed":{"post":{"tags":["test-suite"],"summary":"Seed Test Stores","description":"Seed all 5 test stores. Idempotent: clears existing test data first.","operationId":"seed_test_stores_api_admin_test_suite_seed_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedResponse"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/admin/test-suite/trigger/{store_id}/{step}":{"post":{"tags":["test-suite"],"summary":"Trigger Step","description":"Trigger a specific pipeline step for a test store.","operationId":"trigger_step_api_admin_test_suite_trigger__store_id___step__post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"step","in":"path","required":true,"schema":{"type":"string","title":"Step"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/test-suite/status/{store_id}":{"get":{"tags":["test-suite"],"summary":"Get Store Status","description":"Return current state of test data for a store.","operationId":"get_store_status_api_admin_test_suite_status__store_id__get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/test-suite/stores":{"get":{"tags":["test-suite"],"summary":"List Test Stores","description":"List all test stores with summary stats.","operationId":"list_test_stores_api_admin_test_suite_stores_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Test Stores Api Admin Test Suite Stores Get"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/admin/test-suite/cleanup":{"delete":{"tags":["test-suite"],"summary":"Cleanup Test Data","description":"Remove all test stores and associated data.","operationId":"cleanup_test_data_api_admin_test_suite_cleanup_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Cleanup Test Data Api Admin Test Suite Cleanup Delete"}}}}},"security":[{"ClerkHTTPBearer":[]}]}},"/api/admin/test-suite/approve-keywords/{store_id}":{"post":{"tags":["test-suite"],"summary":"Approve Keywords","description":"Auto-approve top N keywords by opportunity_score.","operationId":"approve_keywords_api_admin_test_suite_approve_keywords__store_id__post","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"n","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":5,"title":"N"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/test-suite/event-log/{store_id}":{"get":{"tags":["test-suite"],"summary":"Get Event Log","description":"Return chronological timeline of pipeline events for a test store.","operationId":"get_event_log_api_admin_test_suite_event_log__store_id__get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventLogEntry"},"title":"Response Get Event Log Api Admin Test Suite Event Log  Store Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/test-suite/content-diff/{store_id}/{page_id}":{"get":{"tags":["test-suite"],"summary":"Get Content Diff","description":"Return before/after diff of content versions for a page.","operationId":"get_content_diff_api_admin_test_suite_content_diff__store_id___page_id__get","security":[{"ClerkHTTPBearer":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","title":"Page Id"}},{"name":"v1","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"V1"}},{"name":"v2","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"V2"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Content Diff Api Admin Test Suite Content Diff  Store Id   Page Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AIMentionResponse":{"properties":{"id":{"type":"integer","title":"Id"},"platform":{"type":"string","title":"Platform"},"query_text":{"type":"string","title":"Query Text"},"response_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Text"},"mentioned":{"type":"boolean","title":"Mentioned"},"cited_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cited Url"},"competitor_mentioned":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Competitor Mentioned"},"detected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detected At"}},"type":"object","required":["id","platform","query_text","mentioned"],"title":"AIMentionResponse"},"AlertConfigRequest":{"properties":{"alert_threshold":{"type":"integer","title":"Alert Threshold"}},"type":"object","required":["alert_threshold"],"title":"AlertConfigRequest"},"AlertConfigResponse":{"properties":{"alert_threshold":{"type":"integer","title":"Alert Threshold"}},"type":"object","required":["alert_threshold"],"title":"AlertConfigResponse"},"AnalyticsEventItem":{"properties":{"event_type":{"type":"string","enum":["pageview","outbound_click","engagement"],"title":"Event Type"},"path":{"type":"string","title":"Path"},"event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Id"},"visitor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Visitor Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"referrer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referrer"},"target_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Url"},"click_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Click Id"},"utm_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Source"},"utm_medium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Medium"},"utm_campaign":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Campaign"},"engaged_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Engaged Ms"},"scroll_depth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scroll Depth"},"occurred_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Occurred At"}},"type":"object","required":["event_type","path"],"title":"AnalyticsEventItem"},"ApproveResponse":{"properties":{"approved":{"type":"integer","title":"Approved"},"keyword_ids":{"items":{"type":"integer"},"type":"array","title":"Keyword Ids"}},"type":"object","required":["approved","keyword_ids"],"title":"ApproveResponse"},"AutoRefreshToggle":{"properties":{"auto_refresh":{"type":"boolean","title":"Auto Refresh"}},"type":"object","required":["auto_refresh"],"title":"AutoRefreshToggle"},"BacklinkOpportunityResponse":{"properties":{"id":{"type":"integer","title":"Id"},"url":{"type":"string","title":"Url"},"domain":{"type":"string","title":"Domain"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"da_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Da Score"},"link_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Link Type"},"status":{"type":"string","title":"Status"},"discovered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discovered At"},"is_live":{"type":"boolean","title":"Is Live","default":true}},"type":"object","required":["id","url","domain","status"],"title":"BacklinkOpportunityResponse"},"BriefRequest":{"properties":{"keyword_id":{"type":"integer","title":"Keyword Id"}},"type":"object","required":["keyword_id"],"title":"BriefRequest"},"BulkStatusRequest":{"properties":{"keyword_ids":{"items":{"type":"integer"},"type":"array","title":"Keyword Ids"},"status":{"type":"string","enum":["approved","rejected","pending"],"title":"Status"}},"type":"object","required":["keyword_ids","status"],"title":"BulkStatusRequest"},"CampaignAdminUpdate":{"properties":{"fast_mode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Fast Mode"},"paused":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Paused"}},"type":"object","title":"CampaignAdminUpdate"},"CampaignUpdateRequest":{"properties":{"paused":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Paused"},"fast_mode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Fast Mode"},"monthly_page_budget":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Page Budget"}},"type":"object","title":"CampaignUpdateRequest"},"CollectRequest":{"properties":{"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"shop":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shop"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"events":{"items":{"$ref":"#/components/schemas/AnalyticsEventItem"},"type":"array","maxItems":100,"minItems":1,"title":"Events"}},"type":"object","required":["events"],"title":"CollectRequest","description":"One batch of beacon events from the renderer.\n\n`query` is the raw signed App Proxy query string; verifying it here means the\nrenderer needs neither the secret nor a second round trip. `shop` is the\nlegacy/dev fallback — trusted only because the internal key already gates\nthis endpoint, and it skips replay protection, so prefer `query`."},"ConfigUpdateRequest":{"properties":{"value":{"type":"string","title":"Value"}},"type":"object","required":["value"],"title":"ConfigUpdateRequest"},"ContentVersionPatch":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"meta_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Description"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"ContentVersionPatch"},"ContentVersionResponse":{"properties":{"id":{"type":"integer","title":"Id"},"page_id":{"type":"integer","title":"Page Id"},"version_number":{"type":"integer","title":"Version Number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"meta_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Description"},"body_html":{"type":"string","title":"Body Html"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"keyword_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Keyword Id"},"brief":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Brief"},"model_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Used"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"seo_preview":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Seo Preview"}},"type":"object","required":["id","page_id","version_number","body_html"],"title":"ContentVersionResponse"},"CrawlJobResponse":{"properties":{"id":{"type":"integer","title":"Id"},"store_id":{"type":"integer","title":"Store Id"},"status":{"type":"string","title":"Status"},"trigger":{"type":"string","title":"Trigger"},"pages_crawled":{"type":"integer","title":"Pages Crawled"},"errors":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Errors"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","store_id","status","trigger","pages_crawled","created_at"],"title":"CrawlJobResponse"},"DomainRankingRow":{"properties":{"keyword_text":{"type":"string","title":"Keyword Text"},"ranking_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ranking Url"},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"},"search_volume":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Search Volume"},"source":{"type":"string","title":"Source"}},"type":"object","required":["keyword_text","source"],"title":"DomainRankingRow"},"EventLogEntry":{"properties":{"id":{"type":"integer","title":"Id"},"timestamp":{"type":"string","title":"Timestamp"},"event":{"type":"string","title":"Event"},"consumer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consumer"},"status":{"type":"string","title":"Status"},"details":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Details"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"}},"type":"object","required":["id","timestamp","event","status"],"title":"EventLogEntry"},"FeedPathUpdateRequest":{"properties":{"subpath":{"type":"string","title":"Subpath"}},"type":"object","required":["subpath"],"title":"FeedPathUpdateRequest"},"GenerateRequest":{"properties":{"keyword_id":{"type":"integer","title":"Keyword Id"}},"type":"object","required":["keyword_id"],"title":"GenerateRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImpactPage":{"properties":{"page_id":{"type":"integer","title":"Page Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"url_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url Slug"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"strategy_type":{"type":"string","title":"Strategy Type"},"target_keyword_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Keyword Text"},"geo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geo"},"expected_volume":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Volume"},"baseline_rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Baseline Rank"},"current_rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Rank"},"pageviews":{"type":"integer","title":"Pageviews","default":0},"outbound_clicks":{"type":"integer","title":"Outbound Clicks","default":0},"attributed_orders":{"type":"integer","title":"Attributed Orders","default":0},"attributed_revenue":{"type":"number","title":"Attributed Revenue","default":0.0},"published_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Published At"}},"type":"object","required":["page_id","strategy_type"],"title":"ImpactPage"},"ImpactSummary":{"properties":{"pages_total":{"type":"integer","title":"Pages Total","default":0},"pages_credited":{"type":"integer","title":"Pages Credited","default":0},"pages_assist":{"type":"integer","title":"Pages Assist","default":0},"pages_live":{"type":"integer","title":"Pages Live","default":0},"pageviews":{"type":"integer","title":"Pageviews","default":0},"outbound_clicks":{"type":"integer","title":"Outbound Clicks","default":0},"attributed_orders":{"type":"integer","title":"Attributed Orders","default":0},"attributed_revenue":{"type":"number","title":"Attributed Revenue","default":0.0}},"type":"object","title":"ImpactSummary"},"KeywordResponse":{"properties":{"id":{"type":"integer","title":"Id"},"keyword_text":{"type":"string","title":"Keyword Text"},"estimated_volume":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Estimated Volume"},"difficulty_estimate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Difficulty Estimate"},"intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent"},"trend_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trend Score"},"opportunity_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Opportunity Score"},"tier":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tier"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"score_breakdown":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Score Breakdown"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","keyword_text"],"title":"KeywordResponse"},"LlmCitations":{"properties":{"days":{"type":"integer","title":"Days"},"checks":{"type":"integer","title":"Checks"},"mentions":{"type":"integer","title":"Mentions"},"citations":{"type":"integer","title":"Citations"},"mention_share":{"type":"number","title":"Mention Share"},"platforms":{"type":"integer","title":"Platforms"}},"type":"object","required":["days","checks","mentions","citations","mention_share","platforms"],"title":"LlmCitations"},"MarketOpportunity":{"properties":{"geo":{"type":"string","title":"Geo"},"keywords":{"type":"integer","title":"Keywords"},"total_volume":{"type":"integer","title":"Total Volume"},"targeted":{"type":"boolean","title":"Targeted"},"serviceable":{"type":"boolean","title":"Serviceable"},"recommended":{"type":"boolean","title":"Recommended"}},"type":"object","required":["geo","keywords","total_volume","targeted","serviceable","recommended"],"title":"MarketOpportunity"},"PublishRequest":{"properties":{"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"}},"type":"object","title":"PublishRequest"},"PublishStatusResponse":{"properties":{"page_id":{"type":"integer","title":"Page Id"},"status":{"type":"string","title":"Status"},"url_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url Slug"},"published_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Published At"},"scheduled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled At"},"shopify_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shopify Url"},"shopify_page_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shopify Page Id"},"shopify_blog_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Shopify Blog Id"}},"type":"object","required":["page_id","status"],"title":"PublishStatusResponse"},"RankingHistoryPoint":{"properties":{"date":{"type":"string","title":"Date"},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"},"source":{"type":"string","title":"Source"}},"type":"object","required":["date","source"],"title":"RankingHistoryPoint"},"RankingHistoryResponse":{"properties":{"keyword_id":{"type":"integer","title":"Keyword Id"},"keyword_text":{"type":"string","title":"Keyword Text"},"trend":{"items":{"$ref":"#/components/schemas/RankingHistoryPoint"},"type":"array","title":"Trend"}},"type":"object","required":["keyword_id","keyword_text","trend"],"title":"RankingHistoryResponse"},"RankingRow":{"properties":{"keyword_id":{"type":"integer","title":"Keyword Id"},"keyword_text":{"type":"string","title":"Keyword Text"},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"},"impressions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Impressions"},"clicks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Clicks"},"ctr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ctr"},"source":{"type":"string","title":"Source","default":"serp"},"tracked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracked At"},"delta":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delta"}},"type":"object","required":["keyword_id","keyword_text"],"title":"RankingRow"},"RebakeRequest":{"properties":{"shop":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shop"},"all":{"type":"boolean","title":"All","default":false}},"type":"object","title":"RebakeRequest"},"RefreshCandidateResponse":{"properties":{"page_id":{"type":"integer","title":"Page Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"refresh_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Reason"},"published_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Published At"},"auto_refresh":{"type":"boolean","title":"Auto Refresh","default":false},"url_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url Slug"}},"type":"object","required":["page_id"],"title":"RefreshCandidateResponse"},"RefreshDiffResponse":{"properties":{"version_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version Id"},"prev_version_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prev Version Id"},"unified_diff":{"type":"string","title":"Unified Diff","default":""},"old_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Old Title"},"new_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Title"},"old_body_html":{"type":"string","title":"Old Body Html","default":""},"new_body_html":{"type":"string","title":"New Body Html","default":""}},"type":"object","title":"RefreshDiffResponse"},"RefreshHistoryItem":{"properties":{"id":{"type":"integer","title":"Id"},"version_number":{"type":"integer","title":"Version Number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"prev_version_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prev Version Id"}},"type":"object","required":["id","version_number"],"title":"RefreshHistoryItem"},"SEOOptimizeResponse":{"properties":{"version_id":{"type":"integer","title":"Version Id"},"seo_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Seo Score"},"seo_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seo Title"},"meta_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Description"},"schema_markup":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Schema Markup"},"seo_score_breakdown":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Seo Score Breakdown"},"internal_link_suggestions":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Internal Link Suggestions"}},"type":"object","required":["version_id"],"title":"SEOOptimizeResponse"},"ScheduleRequest":{"properties":{"scheduled_at":{"type":"string","format":"date-time","title":"Scheduled At"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"}},"type":"object","required":["scheduled_at"],"title":"ScheduleRequest"},"SeedResponse":{"properties":{"store_ids":{"items":{"type":"integer"},"type":"array","title":"Store Ids"},"message":{"type":"string","title":"Message"}},"type":"object","required":["store_ids","message"],"title":"SeedResponse"},"StoreContextRequest":{"properties":{"niche":{"type":"string","title":"Niche"},"target_audience":{"type":"string","title":"Target Audience"},"competitor_urls":{"items":{"type":"string"},"type":"array","title":"Competitor Urls","default":[]},"target_markets":{"items":{"type":"string"},"type":"array","title":"Target Markets"},"customer_questions":{"items":{"type":"string"},"type":"array","title":"Customer Questions","default":[]},"brand_unique_value":{"type":"string","title":"Brand Unique Value","default":""}},"type":"object","required":["niche","target_audience","target_markets"],"title":"StoreContextRequest"},"StoreContextResponse":{"properties":{"id":{"type":"integer","title":"Id"},"store_id":{"type":"integer","title":"Store Id"},"niche":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Niche"},"target_audience":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Audience"},"competitor_urls":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Competitor Urls"},"target_markets":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Target Markets"},"customer_questions":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Customer Questions"},"brand_unique_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Unique Value"}},"type":"object","required":["id","store_id","niche","target_audience","competitor_urls","target_markets"],"title":"StoreContextResponse"},"StoreResponse":{"properties":{"id":{"type":"integer","title":"Id"},"shop_domain":{"type":"string","title":"Shop Domain"},"onboarding_step":{"type":"string","title":"Onboarding Step"},"initial_pull_task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initial Pull Task Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","shop_domain","onboarding_step","created_at"],"title":"StoreResponse"},"StoreStatusResponse":{"properties":{"store_id":{"type":"integer","title":"Store Id"},"shop_domain":{"type":"string","title":"Shop Domain"},"shop_name":{"type":"string","title":"Shop Name"},"niche":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Niche"},"store_pages_count":{"type":"integer","title":"Store Pages Count","default":0},"keywords":{"additionalProperties":true,"type":"object","title":"Keywords","default":{}},"pages":{"additionalProperties":true,"type":"object","title":"Pages","default":{}},"content_versions_count":{"type":"integer","title":"Content Versions Count","default":0},"latest_version":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Latest Version"},"rankings_count":{"type":"integer","title":"Rankings Count","default":0},"ai_mentions":{"additionalProperties":true,"type":"object","title":"Ai Mentions","default":{}},"crawl_jobs":{"additionalProperties":true,"type":"object","title":"Crawl Jobs","default":{}}},"type":"object","required":["store_id","shop_domain","shop_name"],"title":"StoreStatusResponse"},"SubscribeRequest":{"properties":{"tier":{"type":"string","title":"Tier"}},"type":"object","required":["tier"],"title":"SubscribeRequest"},"TrendPoint":{"properties":{"date":{"type":"string","title":"Date"},"platform":{"type":"string","title":"Platform"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["date","platform","count"],"title":"TrendPoint"},"TriggerResponse":{"properties":{"step":{"type":"string","title":"Step"},"event_published":{"type":"string","title":"Event Published"},"store_id":{"type":"integer","title":"Store Id"},"details":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Details"}},"type":"object","required":["step","event_published","store_id"],"title":"TriggerResponse"},"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"},"app__routers__backlinks__StatusUpdateRequest":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"StatusUpdateRequest"},"app__routers__keywords__StatusUpdateRequest":{"properties":{"status":{"type":"string","enum":["approved","rejected","pending"],"title":"Status"}},"type":"object","required":["status"],"title":"StatusUpdateRequest"}},"securitySchemes":{"ClerkHTTPBearer":{"type":"http","scheme":"bearer"},"HTTPBearer":{"type":"http","scheme":"bearer"}}}}