{"openapi":"3.1.0","info":{"title":"AgentReady API","description":"AI Readiness Infrastructure for E-Commerce","version":"1.0.0"},"paths":{"/api/scan":{"post":{"summary":"Perform Scan","operationId":"perform_scan_api_scan_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Perform Scan Api Scan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inject":{"post":{"summary":"Inject Schema","description":"Inject validated JSON-LD into a Shopify theme. Requires authentication.","operationId":"inject_schema_api_inject_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InjectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Inject Schema Api Inject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/history/stores":{"get":{"tags":["history"],"summary":"Get User Stores","description":"Return all stores belonging to the authenticated user.","operationId":"get_user_stores_api_history_stores_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get User Stores Api History Stores Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/history/":{"get":{"tags":["history"],"summary":"Get User History","operationId":"get_user_history_api_history__get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get User History Api History  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/create-checkout-session":{"post":{"tags":["billing"],"summary":"Create Checkout Session","operationId":"create_checkout_session_api_v1_billing_create_checkout_session_post","parameters":[{"name":"plan","in":"query","required":true,"schema":{"type":"string","title":"Plan"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Create Checkout Session Api V1 Billing Create Checkout Session Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/webhook":{"post":{"tags":["billing"],"summary":"Stripe Webhook","operationId":"stripe_webhook_api_v1_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Stripe Webhook Api V1 Billing Webhook Post"}}}}}}},"/api/v1/public/feed/slugs":{"get":{"tags":["feed"],"summary":"List Feed Slugs","description":"Return all store slugs that have an AI product feed, for sitemap generation.","operationId":"list_feed_slugs_api_v1_public_feed_slugs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response List Feed Slugs Api V1 Public Feed Slugs Get"}}}}}}},"/api/v1/public/feed/{store_slug}":{"get":{"tags":["feed"],"summary":"Get Ai Feed","description":"Public AI product feed for a store identified by slug.\nReturns a JSON-LD ItemList consumable by AI agents.","operationId":"get_ai_feed_api_v1_public_feed__store_slug__get","parameters":[{"name":"store_slug","in":"path","required":true,"schema":{"type":"string","title":"Store Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Ai Feed Api V1 Public Feed  Store Slug  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/clerk":{"post":{"tags":["webhooks"],"summary":"Clerk Webhook","operationId":"clerk_webhook_api_webhooks_clerk_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/simulate/":{"post":{"tags":["simulate"],"summary":"Simulate Agent","operationId":"simulate_agent_api_v1_simulate__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/simulate/stream":{"get":{"tags":["simulate"],"summary":"Simulate Stream","description":"SSE streaming endpoint — tokens stream in real time for the typewriter effect.","operationId":"simulate_stream_api_v1_simulate_stream_get","parameters":[{"name":"store_url","in":"query","required":true,"schema":{"type":"string","title":"Store Url"}},{"name":"query","in":"query","required":true,"schema":{"type":"string","title":"Query"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shopify/install":{"get":{"tags":["shopify_oauth"],"summary":"Shopify Install","description":"Redirect merchant to Shopify OAuth screen.","operationId":"shopify_install_api_shopify_install_get","parameters":[{"name":"shop","in":"query","required":true,"schema":{"type":"string","description":"mystore.myshopify.com","title":"Shop"},"description":"mystore.myshopify.com"},{"name":"clerk_id","in":"query","required":true,"schema":{"type":"string","description":"The Clerk ID of the logged-in user","title":"Clerk Id"},"description":"The Clerk ID of the logged-in user"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shopify/callback":{"get":{"tags":["shopify_oauth"],"summary":"Shopify Callback","description":"Exchange OAuth code for permanent access token and store it.","operationId":"shopify_callback_api_shopify_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"shop","in":"query","required":true,"schema":{"type":"string","title":"Shop"}},{"name":"hmac","in":"query","required":true,"schema":{"type":"string","title":"Hmac"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","description":"clerk_id passed via state","title":"State"},"description":"clerk_id passed via state"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shopify/deploy-fix":{"post":{"tags":["shopify_oauth"],"summary":"Deploy Fix","description":"One-Click Fix: Inject generated schema into Shopify theme.","operationId":"deploy_fix_api_shopify_deploy_fix_post","parameters":[{"name":"scan_id","in":"query","required":true,"schema":{"type":"integer","title":"Scan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/competitor/scan":{"post":{"tags":["competitor"],"summary":"Scan Competitors","description":"Parallel competitor scanning. Growth+ only.","operationId":"scan_competitors_api_v1_competitor_scan_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompetitorRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Scan Competitors Api V1 Competitor Scan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/monitoring/settings":{"get":{"tags":["monitoring"],"summary":"Get Monitoring Settings","operationId":"get_monitoring_settings_api_v1_monitoring_settings_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Monitoring Settings Api V1 Monitoring Settings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["monitoring"],"summary":"Save Monitoring Settings","operationId":"save_monitoring_settings_api_v1_monitoring_settings_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitoringSettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Save Monitoring Settings Api V1 Monitoring Settings Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/monitoring/history/{store_id}":{"get":{"tags":["monitoring"],"summary":"Get Scan History For Chart","operationId":"get_scan_history_for_chart_api_v1_monitoring_history__store_id__get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"integer","title":"Store Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Scan History For Chart Api V1 Monitoring History  Store Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bulk/scan":{"post":{"tags":["bulk"],"summary":"Start Bulk Scan","description":"Kick off a bulk scan job. Pro tier only.","operationId":"start_bulk_scan_api_v1_bulk_scan_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkScanRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Start Bulk Scan Api V1 Bulk Scan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bulk/status/{job_id}":{"get":{"tags":["bulk"],"summary":"Get Bulk Status","description":"Poll bulk job progress. Reads live state from Redis.","operationId":"get_bulk_status_api_v1_bulk_status__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Bulk Status Api V1 Bulk Status  Job Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/fix/checkout":{"post":{"tags":["fix-orders"],"summary":"Create Fix Checkout","operationId":"create_fix_checkout_api_v1_fix_checkout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FixCheckoutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Create Fix Checkout Api V1 Fix Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Read Root","operationId":"read_root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Shallow health check — verifies Redis is reachable (used by load balancers).","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/deep":{"get":{"summary":"Health Check Deep","description":"Deep health check — verifies database and Redis connectivity.","operationId":"health_check_deep_health_deep_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"BulkScanRequest":{"properties":{"store_urls":{"items":{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},"type":"array","title":"Store Urls"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"}},"type":"object","required":["store_urls"],"title":"BulkScanRequest"},"CompetitorRequest":{"properties":{"my_store_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"My Store Url"},"competitor_urls":{"items":{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},"type":"array","title":"Competitor Urls"}},"type":"object","required":["my_store_url","competitor_urls"],"title":"CompetitorRequest"},"FixCheckoutRequest":{"properties":{"scan_id":{"type":"integer","title":"Scan Id"},"plan":{"type":"string","title":"Plan"},"store_url":{"type":"string","title":"Store Url"}},"type":"object","required":["scan_id","plan","store_url"],"title":"FixCheckoutRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InjectRequest":{"properties":{"store_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Store Url"},"custom_token":{"type":"string","title":"Custom Token"},"schema_json":{"type":"string","title":"Schema Json"}},"type":"object","required":["store_url","custom_token","schema_json"],"title":"InjectRequest"},"MonitoringSettingsUpdate":{"properties":{"store_id":{"type":"integer","title":"Store Id"},"alert_threshold":{"type":"integer","title":"Alert Threshold","default":60},"email_alerts":{"type":"boolean","title":"Email Alerts","default":true},"slack_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Webhook Url"},"weekly_digest":{"type":"boolean","title":"Weekly Digest","default":true}},"type":"object","required":["store_id"],"title":"MonitoringSettingsUpdate"},"ScanRequest":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"}},"type":"object","required":["url"],"title":"ScanRequest"},"SimulateRequest":{"properties":{"store_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Store Url"},"query":{"type":"string","title":"Query"}},"type":"object","required":["store_url","query"],"title":"SimulateRequest"},"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"}}}}