{"openapi":"3.1.0","info":{"title":"repohealth","version":"1.0.0"},"servers":[{"url":"https://repohealth.forage.bot"}],"components":{"schemas":{},"parameters":{},"securitySchemes":{"forageKey":{"type":"http","scheme":"bearer","bearerFormat":"fk_<key>"},"internalJwt":{"type":"http","scheme":"bearer","bearerFormat":"ik_<jwt>"}}},"paths":{"/api/v1/me":{"get":{"summary":"Returns information about the authenticated caller","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"kind":{"type":"string","enum":["customer","internal","anonymous"]}},"required":["kind"]},"_links":{"type":"object","additionalProperties":{"type":"string"}}},"required":["data"]}}}},"401":{"description":"invalid_auth","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"details":{"type":"object","additionalProperties":{}}},"required":["code","message","request_id"]}},"required":["error"]}}}}}}},"/api/v1/usage":{"get":{"summary":"Recent usage on this op for the calling account (paginated)","security":[{"forageKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{}}},"required":["items"]},"_links":{"type":"object","additionalProperties":{"type":"string"}}},"required":["data"]}}}},"401":{"description":"invalid_auth","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"details":{"type":"object","additionalProperties":{}}},"required":["code","message","request_id"]}},"required":["error"]}}}}}}},"/api/v1/feedback":{"post":{"summary":"Submit feedback about repohealth","security":[{"forageKey":[]},{"internalJwt":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["bug","idea","question"]},"message":{"type":"string","minLength":1,"maxLength":5000},"email":{"type":"string","format":"email"}},"required":["message"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"_links":{"type":"object","additionalProperties":{"type":"string"}}},"required":["data"]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"details":{"type":"object","additionalProperties":{}}},"required":["code","message","request_id"]}},"required":["error"]}}}}}}},"/api/v1/reports":{"get":{"summary":"List published public engineering-health reports. Each entry links to the hosted report page on this domain (principle 8 — never a raw storage URL).","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"reportSlug":{"type":["string","null"]},"url":{"type":"string"},"published_at":{"type":"string"}},"required":["runId","reportSlug","url","published_at"]}}},"required":["items"]},"_links":{"type":"object","additionalProperties":{"type":"string"}}},"required":["data"]}}}}}}},"/api/v1/reports/{runId}":{"get":{"summary":"Fetch a buyer's engineering-health report by runId: the measured numbers (commits in the last 12 months, active authors, top-author share, bus factor by top-level directory, test-to-source file ratio, CI presence, stale dependencies), a written assessment (executive summary, concentration and continuity risk, delivery and maintenance signals, follow-up questions for a diligence reviewer), a note on how each number was computed, and a link to the hosted report page on this domain.","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"runId":{"type":"string"},"status":{"type":"string","enum":["pending_checkout","paid","analyzing","ready","refunded","failed"]},"created_at":{"type":"string"},"delivered_at":{"type":["string","null"]},"preparing_for":{"type":["string","null"]},"report_url":{"type":["string","null"]},"report":{}},"required":["runId","status","created_at","delivered_at","preparing_for","report_url"]},"_links":{"type":"object","additionalProperties":{"type":"string"}}},"required":["data"]}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"details":{"type":"object","additionalProperties":{}}},"required":["code","message","request_id"]}},"required":["error"]}}}}}}},"/api/v1/orders":{"post":{"summary":"Create an order for an engineering-health report from a read-only public GitHub repo URL. Returns the order and a Stripe Checkout URL to complete payment.","security":[{"forageKey":[]},{"internalJwt":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["github"]},"repoUrl":{"type":"string"}},"required":["kind","repoUrl"]},{"type":"object","properties":{"kind":{"type":"string","enum":["archive"]},"archiveRef":{"type":"string"}},"required":["kind","archiveRef"]}]},"email":{"type":"string","format":"email"},"preparing_for":{"type":"string"}},"required":["source","email"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"runId":{"type":"string"},"status":{"type":"string","enum":["pending_checkout","paid","analyzing","ready","refunded","failed"]},"checkout_url":{"type":"string"}},"required":["runId","status","checkout_url"]},"_links":{"type":"object","additionalProperties":{"type":"string"}}},"required":["data"]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"details":{"type":"object","additionalProperties":{}}},"required":["code","message","request_id"]}},"required":["error"]}}}}}}},"/api/v1/orders/{runId}":{"get":{"summary":"Fetch an order's current status by runId. Poll this after checkout until status flips to ready, then read the report at the returned report_url.","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"runId":{"type":"string"},"status":{"type":"string","enum":["pending_checkout","paid","analyzing","ready","refunded","failed"]},"ready":{"type":"boolean"},"report_url":{"type":["string","null"]}},"required":["runId","status","ready","report_url"]},"_links":{"type":"object","additionalProperties":{"type":"string"}}},"required":["data"]}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"details":{"type":"object","additionalProperties":{}}},"required":["code","message","request_id"]}},"required":["error"]}}}}}}}},"webhooks":{}}