{"openapi":"3.1.0","info":{"title":"Revenue Sleuth API","version":"0.1.0","description":"Agent-first business-plan catalog and purchase API with public previews, visible evidence, and token-based retrieval."},"servers":[{"url":"http://localhost:3210"}],"paths":{"/api/plans":{"get":{"operationId":"listPlans","summary":"List or search published plans","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":2,"maxLength":120},"description":"Keyword query matched against plan title, teaser, premise, and category."},{"name":"category","in":"query","required":false,"schema":{"type":"string","maxLength":60},"description":"Case-insensitive category filter."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":5},"description":"Maximum number of plans to return."}],"responses":{"200":{"description":"Published plan catalog or filtered search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanCatalog"}}}},"429":{"description":"Too many requests"}}}},"/api/ops":{"get":{"operationId":"getOpsSnapshot","summary":"Get the live operations snapshot, queue state, and internal pipeline reports","responses":{"200":{"description":"Operations snapshot","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/plans/{slug}":{"get":{"operationId":"getPlan","summary":"Get one plan preview, evidence metadata, and its offers","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Plan preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPreview"}}}},"404":{"description":"Plan not found"}}}},"/api/checkout":{"post":{"operationId":"createCheckoutSession","summary":"Create a one-time checkout session for a plan offer","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["planId","offerId"],"properties":{"planId":{"type":"string"},"offerId":{"type":"string"}}}}}},"responses":{"303":{"description":"Redirect to Stripe Checkout"},"400":{"description":"Offer or plan pairing is invalid"},"503":{"description":"Stripe is not configured"}}}},"/api/access/{token}":{"get":{"operationId":"getPurchasedPlan","summary":"Retrieve purchased plan content using the access token in the URL","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Purchased plan content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchasedPlan"}}}},"404":{"description":"Token not found"}}}},"/api/plans/{slug}/json":{"get":{"operationId":"getPlanPreviewJsonArtifact","summary":"Retrieve the proxied public preview JSON artifact for a plan","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Plan preview JSON artifact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPreviewArtifact"}}}},"404":{"description":"Plan not found"}}}},"/api/plans/{slug}/markdown":{"get":{"operationId":"getPlanPreviewMarkdownArtifact","summary":"Retrieve the proxied public preview markdown artifact for a plan","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Plan preview markdown artifact","content":{"text/markdown":{"schema":{"type":"string"}}}},"404":{"description":"Plan not found"}}}},"/api/access/{token}/json":{"get":{"operationId":"getPurchasedPlanJsonArtifact","summary":"Retrieve the proxied paid JSON artifact using the purchase token","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Purchased plan JSON artifact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchasedPlanArtifact"}}}},"404":{"description":"Token not found"}}}},"/api/access/{token}/markdown":{"get":{"operationId":"getPurchasedPlanMarkdownArtifact","summary":"Retrieve the proxied paid markdown artifact using the purchase token","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Purchased plan markdown artifact","content":{"text/markdown":{"schema":{"type":"string"}}}},"404":{"description":"Token not found"}}}},"/api/purchases/fulfill":{"post":{"operationId":"fulfillPurchaseWebhook","summary":"Webhook relay callback used by fallible-webhooks after Stripe confirms payment","responses":{"200":{"description":"Webhook processed"}}}}},"components":{"schemas":{"PlanOffer":{"type":"object","required":["id","tier","title","description","priceUsdCents","checkoutFormAction"],"properties":{"id":{"type":"string"},"tier":{"type":"string","enum":["RESEARCH","EXECUTION","FINANCIAL","FULL"]},"title":{"type":"string"},"description":{"type":"string"},"includes":{"type":"array","items":{"type":"string"}},"priceUsdCents":{"type":"integer"},"checkoutFormAction":{"type":"string","format":"uri"}}},"PlanSource":{"type":"object","required":["title","url","domain"],"properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"},"domain":{"type":"string"},"note":{"type":"string"}}},"RevenueScenario":{"type":"object","required":["revenue12mUsd","formula"],"properties":{"revenue12mUsd":{"type":"integer"},"formula":{"type":"string"}}},"RevenueModel":{"type":"object","required":["businessModel","revenueBasis","pricingModel","assumptions","lowCase","baseCase","highCase","displayedExpectedRevenue12mUsd","justification","confidenceNotes"],"properties":{"businessModel":{"type":"string"},"revenueBasis":{"type":"string"},"pricingModel":{"type":"string"},"assumptions":{"type":"array","items":{"type":"string"}},"lowCase":{"$ref":"#/components/schemas/RevenueScenario"},"baseCase":{"$ref":"#/components/schemas/RevenueScenario"},"highCase":{"$ref":"#/components/schemas/RevenueScenario"},"displayedExpectedRevenue12mUsd":{"type":"integer"},"justification":{"type":"array","items":{"type":"string"}},"confidenceNotes":{"type":"string"}}},"PlanListItem":{"type":"object","required":["slug","title","teaser","url","apiUrl","offers"],"properties":{"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"teaser":{"type":"string"},"publishedAt":{"type":"string","format":"date-time"},"revenueModel":{"$ref":"#/components/schemas/RevenueModel"},"url":{"type":"string","format":"uri"},"apiUrl":{"type":"string","format":"uri"},"jsonBlobUrl":{"type":"string","format":"uri","description":"Proxied JSON artifact URL served by the app."},"markdownBlobUrl":{"type":"string","format":"uri","description":"Proxied markdown artifact URL served by the app."},"offers":{"type":"array","items":{"$ref":"#/components/schemas/PlanOffer"}}}},"PlanCatalog":{"type":"object","required":["app","description","baseUrl","catalogUrl","llmsUrl","openapiUrl","resultCount","intentCaptured","plans"],"properties":{"app":{"type":"string"},"description":{"type":"string"},"baseUrl":{"type":"string","format":"uri"},"catalogUrl":{"type":"string","format":"uri"},"query":{"type":"object","properties":{"q":{"type":["string","null"]},"category":{"type":["string","null"]},"limit":{"type":["integer","null"]}}},"llmsUrl":{"type":"string","format":"uri"},"openapiUrl":{"type":"string","format":"uri"},"resultCount":{"type":"integer"},"intentCaptured":{"type":"boolean","description":"True when a keyword or category search was recorded as buyer intent."},"plans":{"type":"array","items":{"$ref":"#/components/schemas/PlanListItem"}}}},"PlanPreview":{"type":"object","required":["slug","title","teaser","url","apiUrl","offers","sources"],"properties":{"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"premise":{"type":"string"},"teaser":{"type":"string"},"previewMarkdown":{"type":"string"},"validationNotes":{"type":"string"},"freshnessDate":{"type":"string","format":"date-time"},"publishedAt":{"type":"string","format":"date-time"},"revenueModel":{"$ref":"#/components/schemas/RevenueModel"},"url":{"type":"string","format":"uri"},"apiUrl":{"type":"string","format":"uri"},"jsonBlobUrl":{"type":"string","format":"uri","description":"Proxied preview JSON artifact URL served by the app."},"markdownBlobUrl":{"type":"string","format":"uri","description":"Proxied preview markdown artifact URL served by the app."},"offers":{"type":"array","items":{"$ref":"#/components/schemas/PlanOffer"}},"sources":{"type":"array","items":{"$ref":"#/components/schemas/PlanSource"}}}},"PurchasedPlan":{"type":"object","required":["purchaseId","accessToken","status","tier","offer","plan"],"properties":{"purchaseId":{"type":"string"},"accessToken":{"type":"string"},"status":{"type":"string","enum":["PENDING","PAID","FULFILLED","FAILED"]},"tier":{"type":"string","enum":["RESEARCH","EXECUTION","FINANCIAL","FULL"]},"offer":{"type":"object","required":["title","description","includes"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"includes":{"type":"array","items":{"type":"string"}}}},"plan":{"type":"object","required":["slug","title","teaser","sources"],"properties":{"slug":{"type":"string"},"title":{"type":"string"},"teaser":{"type":"string"},"fullMarkdown":{"type":"string"},"revenueModel":{"$ref":"#/components/schemas/RevenueModel"},"jsonBlobUrl":{"type":"string","format":"uri","description":"Proxied paid JSON artifact URL served by the app."},"markdownBlobUrl":{"type":"string","format":"uri","description":"Proxied paid markdown artifact URL served by the app."},"sources":{"type":"array","items":{"$ref":"#/components/schemas/PlanSource"}}}}}},"PlanPreviewArtifact":{"type":"object","required":["slug","title","teaser","previewMarkdown","offers","sources"],"properties":{"slug":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"premise":{"type":"string"},"teaser":{"type":"string"},"previewMarkdown":{"type":"string"},"validationNotes":{"type":"string"},"freshnessDate":{"type":"string","format":"date-time"},"publishedAt":{"type":"string","format":"date-time"},"revenueModel":{"$ref":"#/components/schemas/RevenueModel"},"offers":{"type":"array","items":{"$ref":"#/components/schemas/PlanOffer"}},"sources":{"type":"array","items":{"$ref":"#/components/schemas/PlanSource"}}}},"PurchasedPlanArtifact":{"type":"object","required":["purchaseId","accessToken","tier","offer","plan"],"properties":{"purchaseId":{"type":"string"},"accessToken":{"type":"string"},"tier":{"type":"string","enum":["RESEARCH","EXECUTION","FINANCIAL","FULL"]},"offer":{"type":"object","required":["title","description","includes","priceUsdCents"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"includes":{"type":"array","items":{"type":"string"}},"priceUsdCents":{"type":"integer"}}},"plan":{"type":"object","required":["slug","title","teaser"],"properties":{"slug":{"type":"string"},"title":{"type":"string"},"teaser":{"type":"string"},"fullMarkdown":{"type":"string"},"revenueModel":{"$ref":"#/components/schemas/RevenueModel"},"planJson":{},"sources":{"type":"array","items":{"$ref":"#/components/schemas/PlanSource"}}}}}}}}}