{"openapi":"3.0.3","info":{"title":"UnicornBurn Startup Failure API","version":"1.2.0","description":"Structured access to 5,032 startup autopsies. Open tier: first 50 entries, no auth. Full dataset access requires X-API-Key (Intelligence+ plan). Risk intelligence and portfolio endpoints require a dashboard session.","contact":{"name":"UnicornBurn","email":"hello@unicornburn.com","url":"https://unicornburn.com"},"license":{"name":"Attribution Required","url":"https://unicornburn.com/data"},"termsOfService":"https://unicornburn.com/terms","x-attribution":{"required":true,"header":"X-Attribution","formats":{"inline":"Data: UnicornBurn Intelligence (unicornburn.com)","apa":"UnicornBurn Intelligence. (2024). Startup Failure Dataset [Data set]. https://unicornburn.com/data","bibtex":"@misc{unicornburn2024,\n  author = {{UnicornBurn Intelligence}},\n  title  = {Startup Failure Dataset},\n  year   = {2024},\n  url    = {https://unicornburn.com/data},\n  note   = {5,032 verified startup autopsies with cause category, collapse style, timeline, and financial data}\n}"}}},"servers":[{"url":"https://unicornburn.com","description":"Production"}],"tags":[{"name":"Autopsies","description":"Startup failure autopsy records"},{"name":"Rankings","description":"Curated failure rankings and lists"},{"name":"Intelligence","description":"Deal evaluation and failure pattern analysis"},{"name":"Monitoring","description":"Platform health and status"},{"name":"Webhooks","description":"Inbound and outbound webhook integration"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Intelligence+ API key. Required for full dataset access (>50 entries). Obtain at https://unicornburn.com/intelligence/pricing"}},"schemas":{"AutopsySummary":{"type":"object","properties":{"slug":{"type":"string","example":"theranos","description":"URL-safe unique identifier"},"name":{"type":"string","example":"Theranos"},"sector":{"type":"string","example":"Healthtech"},"country":{"type":"string","example":"USA"},"year":{"type":"integer","example":2018,"description":"Year of failure"},"causeCategory":{"type":"string","example":"fraud","description":"Primary cause of failure"},"causeCategorySecondary":{"type":"string","example":"governance-failure","nullable":true},"collapseStyle":{"type":"string","example":"Fraud Implosion","description":"How the collapse happened (9 types)"},"collapseVelocity":{"type":"string","example":"Sudden","description":"Speed of collapse"},"hypeCycle":{"type":"string","example":"Peak of Inflated Expectations"},"moatType":{"type":"string","example":"Trade Secret"},"moatStrength":{"type":"string","example":"Weak"},"fatalMistakePrimary":{"type":"string","example":"Fraud"},"fatalMistakeSecondary":{"type":"array","items":{"type":"string"},"nullable":true},"archetype":{"type":"string","example":"Visionary Fraud","nullable":true},"businessModel":{"type":"string","example":"B2B SaaS","nullable":true},"totalFundingM":{"type":"number","example":945,"description":"Total funding in $M","nullable":true},"peakValuationM":{"type":"number","example":9000,"description":"Peak valuation in $M","nullable":true},"survivalMonths":{"type":"integer","example":143,"description":"Months from founding to failure","nullable":true},"founded":{"type":"integer","example":2003,"nullable":true},"died":{"type":"integer","example":2018,"nullable":true},"verified":{"type":"boolean","description":"Editorially verified against public sources"},"tagline_en":{"type":"string","nullable":true},"tagline_es":{"type":"string","nullable":true}}},"AutopsyFull":{"allOf":[{"$ref":"#/components/schemas/AutopsySummary"},{"type":"object","properties":{"lesson":{"type":"object","properties":{"en":{"type":"string"},"es":{"type":"string"}}},"timeline":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"date":{"type":"string","example":"2015-03"},"severity":{"type":"string","example":"Fatal"},"description":{"type":"object","properties":{"en":{"type":"string"},"es":{"type":"string"}}}}}}}}]},"RankingEntry":{"type":"object","properties":{"position":{"type":"integer"},"name":{"type":"string"},"value":{"type":"string"},"country":{"type":"string","nullable":true},"sector":{"type":"string","nullable":true},"autopsySlug":{"type":"string","nullable":true,"description":"Link to full autopsy if available"}}},"RankingSummary":{"type":"object","properties":{"slug":{"type":"string","example":"most-capital-burned"},"title":{"type":"object","properties":{"en":{"type":"string"},"es":{"type":"string"}}},"description":{"type":"object","properties":{"en":{"type":"string"},"es":{"type":"string"}}},"insight":{"type":"object","properties":{"en":{"type":"string"},"es":{"type":"string"}}},"entries":{"type":"array","items":{"$ref":"#/components/schemas/RankingEntry"}}}},"RiskMatchInput":{"type":"object","required":["sector"],"properties":{"sector":{"type":"string","example":"Fintech","description":"One of 18 valid sector values"},"country":{"type":"string","example":"spain","description":"Country (lowercase, hyphenated)"},"business_model":{"type":"string","example":"B2B SaaS","maxLength":50},"b2b_or_b2c":{"type":"string","enum":["B2B","B2C","Both"]},"funding_m":{"type":"number","example":12.5,"description":"Total funding in $M"},"headcount":{"type":"integer","example":45},"founded_year":{"type":"integer","example":2020},"moat_type":{"type":"string","example":"Network Effects"},"moat_strength":{"type":"string","enum":["Weak","Medium","Strong"]},"archetype":{"type":"string"},"fatal_mistake_primary":{"type":"string"},"hype_cycle":{"type":"string"},"recent_events":{"type":"array","items":{"type":"string"},"maxItems":7,"description":"Recent company signals (e.g. \"Series A\", \"CEO exit\", \"Regulatory action\")"},"description":{"type":"string","maxLength":1000,"description":"Free-text company description for semantic matching"},"lang":{"type":"string","enum":["en","es"],"default":"en"},"company_name":{"type":"string"}}},"RiskMatchResult":{"type":"object","properties":{"matches":{"type":"array","description":"Top matching autopsies, ordered by similarity score","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"score":{"type":"number","description":"Similarity score 0–100"},"sector":{"type":"string"},"country":{"type":"string"},"causeCategory":{"type":"string"},"collapseStyle":{"type":"string"},"totalFundingM":{"type":"number","nullable":true},"survivalMonths":{"type":"integer","nullable":true}}}},"riskScore":{"type":"number","description":"Composite risk score 0–100"},"causeDistribution":{"type":"array","items":{"type":"object","properties":{"cause":{"type":"string"},"percentage":{"type":"number"}}}},"survivalCurve":{"type":"array","items":{"type":"object","properties":{"month":{"type":"integer"},"probability":{"type":"number"}}},"description":"Kaplan-Meier survival curve for comparable companies"},"poolStats":{"type":"object","properties":{"total":{"type":"integer","description":"Number of comparable autopsies analyzed"},"topMatch":{"type":"number"}}}}},"AutopsyStats":{"type":"object","properties":{"total":{"type":"integer","example":5032,"description":"Total published autopsies"},"countries":{"type":"integer","example":78},"latamSpain":{"type":"integer","example":1840,"description":"LATAM + Spain subset"},"withTimeline":{"type":"integer","example":4200,"description":"Autopsies with structured timeline data"}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","nullable":true}}}}},"paths":{"/api/autopsies":{"get":{"tags":["Autopsies"],"summary":"List startup autopsies","description":"Returns verified startup autopsies. Open tier: first 50 results, no auth. Full dataset requires X-API-Key (Intelligence+ plan).","parameters":[{"name":"sector","in":"query","schema":{"type":"string"},"example":"fintech","description":"Filter by sector (case-insensitive)"},{"name":"country","in":"query","schema":{"type":"string"},"example":"spain","description":"Filter by country (case-insensitive)"},{"name":"cause","in":"query","schema":{"type":"string"},"example":"fraud","description":"Filter by causeCategory"},{"name":"year","in":"query","schema":{"type":"integer"},"example":2022,"description":"Filter by year of failure"},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200},"description":"Results per page"},{"name":"offset","in":"query","schema":{"type":"integer","default":0},"description":"Pagination offset"}],"security":[],"responses":{"200":{"description":"List of autopsies","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AutopsySummary"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}},"429":{"description":"Rate limit exceeded (10 req/day on open tier)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/autopsies/{slug}":{"get":{"tags":["Autopsies"],"summary":"Get a single autopsy by slug","description":"Returns full autopsy with timeline, lesson, and all narrative fields. Publicly accessible — no authentication required.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"example":"theranos"}],"security":[],"responses":{"200":{"description":"Full autopsy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutopsyFull"}}}},"404":{"description":"Autopsy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/rankings":{"get":{"tags":["Rankings"],"summary":"List all rankings","description":"Returns all available curated rankings with metadata. No auth required.","security":[],"responses":{"200":{"description":"List of rankings","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"object","properties":{"en":{"type":"string"},"es":{"type":"string"}}},"description":{"type":"object","properties":{"en":{"type":"string"},"es":{"type":"string"}}}}}}}}}}}},"/api/rankings/{slug}":{"get":{"tags":["Rankings"],"summary":"Get a single ranking by slug","description":"Returns a ranking with all entries. No auth required.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","enum":["most-capital-burned","deadliest-sectors","deadliest-years","fastest-collapses","biggest-frauds","capital-destroyed-by-cause","deadliest-archetypes"]},"example":"biggest-frauds"}],"security":[],"responses":{"200":{"description":"Full ranking","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankingSummary"}}}},"404":{"description":"Ranking not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/autopsies/search":{"get":{"tags":["Autopsies"],"summary":"Search autopsies by name or filters","description":"Full-text name search with optional sector/country/cause filters. Returns editorial and verified autopsies only. Rate limit: 60 req/min.","security":[],"parameters":[{"name":"q","in":"query","schema":{"type":"string","maxLength":100},"example":"theranos","description":"Name search (case-insensitive prefix match)"},{"name":"sector","in":"query","schema":{"type":"string"},"example":"fintech"},{"name":"country","in":"query","schema":{"type":"string"},"example":"usa,spain","description":"Comma-separated. \"latam\" expands to LATAM countries."},{"name":"cause","in":"query","schema":{"type":"string"},"example":"fraud"},{"name":"sort","in":"query","schema":{"type":"string","enum":["recent","oldest","famous","flame","alpha"],"default":"recent"}},{"name":"cursor","in":"query","schema":{"type":"integer","default":0},"description":"Offset for cursor-based pagination (page size 48)"}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/AutopsySummary"}},"total":{"type":"integer"},"cursor":{"type":"integer"},"hasMore":{"type":"boolean"},"isSearching":{"type":"boolean"}}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/autopsy-stats":{"get":{"tags":["Autopsies"],"summary":"Aggregate autopsy statistics","description":"Returns totals for the dataset. No auth, no rate limit. Cached at DB level.","security":[],"responses":{"200":{"description":"Dataset statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutopsyStats"}}}}}}},"/api/intelligence/risk-match":{"post":{"tags":["Intelligence"],"summary":"Evaluate a deal against the failure database","description":"Core intelligence endpoint. Matches a company profile against 5,032 autopsies using semantic similarity + Bayesian cause modeling. Returns ranked failure matches, cause distribution, survival curve, and risk score.\n\n**Authentication:** Dashboard session (cookie) or unauthenticated (rate-limited preview). This endpoint does not accept X-API-Key — use the dashboard or programmatic inbound webhook instead.\n\n**Rate limits:** 5 req/hour (unauthenticated IP), 500 req/hour (global). Authenticated accounts are subject to monthly tier quota.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskMatchInput"}}}},"responses":{"200":{"description":"Risk match result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskMatchResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Monthly quota exceeded for this tier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/integrations/webhook":{"post":{"tags":["Webhooks"],"summary":"Inbound webhook — score a company via signed URL","description":"Submit a company for risk scoring without a browser session. Authentication is via a per-account signed URL (HMAC-SHA256 token). The webhook responds with the risk score and top cause synchronously.\n\n**How to get your signed URL:** Dashboard → API → Inbound Webhook.\n\n**Idempotent:** same company_name + identical fields return the same score within the same month quota window.\n\nRequires any paid plan (Analyst+).","parameters":[{"name":"account","in":"query","required":true,"schema":{"type":"string"},"description":"Your account ID (shown in your signed URL)"},{"name":"token","in":"query","required":true,"schema":{"type":"string"},"description":"HMAC-SHA256 token (shown in your signed URL)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskMatchInput"}}}},"responses":{"200":{"description":"Risk score result","content":{"application/json":{"schema":{"type":"object","properties":{"risk_score":{"type":"number","description":"Composite risk score 0–100"},"top_cause":{"type":"string","description":"Most likely failure cause"},"match_count":{"type":"integer","description":"Number of comparable autopsies analyzed"}}}}}},"401":{"description":"Invalid or missing token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Intelligence+ plan required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or monthly quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/autopsies/export":{"get":{"tags":["Autopsies"],"summary":"Export autopsy dataset as CSV","description":"Downloads a CSV of up to 500 autopsies matching the given filters. Requires an authenticated dashboard session (Intelligence+ or Fund plan). Not accessible via X-API-Key.\n\n**Rate limit:** 20 requests/hour per IP.","parameters":[{"name":"sector","in":"query","schema":{"type":"string"},"example":"fintech","description":"Filter by sector (case-insensitive)"},{"name":"country","in":"query","schema":{"type":"string"},"example":"usa","description":"Filter by country (case-insensitive)"},{"name":"causecategory","in":"query","schema":{"type":"string"},"example":"fraud","description":"Filter by cause category"},{"name":"collapsestyle","in":"query","schema":{"type":"string"},"example":"Fraud Implosion","description":"Filter by collapse style"}],"security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"CSV file download","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Session required (dashboard login)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Intelligence+ or Fund plan required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/health":{"get":{"tags":["Monitoring"],"summary":"Platform health check","description":"Returns 200 if all systems are operational, 503 if degraded. Pingable by external uptime monitors. `Cache-Control: no-store`.","security":[],"responses":{"200":{"description":"All systems operational","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"],"example":"ok"},"ts":{"type":"string","format":"date-time"}}}}}},"503":{"description":"One or more systems degraded","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["degraded"],"example":"degraded"},"ts":{"type":"string","format":"date-time"}}}}}}}}}}}