{"openapi":"3.1.0","info":{"title":"MarcAI API","version":"0.1.0","description":"Cifre, nu promisiuni. Errors are RFC 9457 application/problem+json."},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"B2B API key: `Authorization: Bearer mk_live_<prefix>_<secret>`."}},"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]},"CourseStatus":{"type":"object","properties":{"enrolled":{"type":"boolean"},"lastLesson":{"type":"integer","minimum":0},"lessons":{"type":"integer"},"finished":{"type":"boolean"},"emailVerified":{"type":"boolean"}},"required":["enrolled","lastLesson","lessons","finished","emailVerified"]},"AppleTokenRequest":{"type":"object","properties":{"authorizationCode":{"type":"string","minLength":8,"maxLength":2048}},"required":["authorizationCode"]}},"parameters":{}},"paths":{"/health":{"get":{"tags":["ops"],"summary":"Liveness probe","responses":{"200":{"description":"Process is alive","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}}}}}}},"/ready":{"get":{"tags":["ops"],"summary":"Readiness probe","responses":{"200":{"description":"Dependencies are reachable","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ready"]}},"required":["status"]}}}},"503":{"description":"A dependency is not ready","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/sports":{"get":{"tags":["catalog"],"summary":"Sports with data","description":"Sports that have an upcoming or live event (kick-off from 3 h ago to 30 days ahead) or one finished in the last 14 days, in catalog order; football is always listed. Sports without a live data source (`HIDDEN_SPORTS`: tennis, basketball, hockey, handball) are never listed (D64).","responses":{"200":{"description":"Sports with data","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]}}},"required":["items"]}}}}}}},"/v1/matches":{"get":{"tags":["matches"],"summary":"List matches","description":"Scheduled/live matches soonest first; `status=finished` newest first. Without `status`, `from`, `to` the list starts 3 h before now (upcoming + live). `value` is enabled only when the model beat the close. Premium/Pro sessions get the full prediction and `value`; anonymous/Free get the favourite outcome only (`prediction.limited`), no `value` (D23).","parameters":[{"schema":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"required":false,"name":"sport","in":"query"},{"schema":{"type":"string","enum":["scheduled","live","finished"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":false,"name":"league","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"maximum":0.5},"required":false,"name":"modelMarketGap","in":"query"}],"responses":{"200":{"description":"Matches ordered by kickoff","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"sport":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"league":{"type":"string","minLength":1},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"resultPending":{"type":"boolean"},"kickoffUnconfirmed":{"type":"boolean"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"bestOf":{"type":"integer","minimum":1,"maximum":7},"prediction":{"type":"object","properties":{"model":{"type":"string","minLength":1},"probabilities":{"type":"object","properties":{"home":{"type":["number","null"],"exclusiveMinimum":0},"draw":{"type":["number","null"],"exclusiveMinimum":0},"away":{"type":["number","null"],"exclusiveMinimum":0}},"required":["home","draw","away"]},"fairOdds":{"type":"object","properties":{"home":{"type":["number","null"],"exclusiveMinimum":0},"draw":{"type":["number","null"],"exclusiveMinimum":0},"away":{"type":["number","null"],"exclusiveMinimum":0}},"required":["home","draw","away"]},"createdAt":{"type":"string","format":"date-time"},"limited":{"type":"boolean"}},"required":["model","probabilities","fairOdds","createdAt"]},"odds":{"type":"object","properties":{"prices":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"opening":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"source":{"type":"string","minLength":1},"observedAt":{"type":"string","format":"date-time"}},"required":["prices","source","observedAt"]},"value":{"type":"object","properties":{"enabled":{"type":"boolean"},"reason":{"type":"string","enum":["validated","model_worse_than_close","no_backtest","no_odds","disabled_by_admin"]}},"required":["enabled","reason"]},"verdict":{"type":"object","properties":{"outcome":{"type":"string","enum":["home","draw","away"]},"modelProbability":{"type":"number","minimum":0,"maximum":1},"marketProbability":{"type":["number","null"],"minimum":0,"maximum":1},"favourite":{"type":"string","enum":["home","draw","away"]},"favouriteHit":{"type":"boolean"},"closer":{"type":["string","null"],"enum":["model","market","level",null]}},"required":["outcome","modelProbability","marketProbability","favourite","favouriteHit","closer"]},"live":{"type":"object","properties":{"minute":{"type":["integer","null"],"minimum":0},"period":{"type":"string","enum":["1H","HT","2H","ET1","ET2","PEN"]},"red":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"yellow":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"corners":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"at":{"type":"string","format":"date-time"}},"required":["minute"]},"source":{"type":"string","minLength":1}},"required":["id","sport","league","home","away","kickoff","status"]}}},"required":["items"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/matches/{id}":{"get":{"tags":["matches"],"summary":"One match with prediction, consensus odds and value gate","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The match","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"sport":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"league":{"type":"string","minLength":1},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"resultPending":{"type":"boolean"},"kickoffUnconfirmed":{"type":"boolean"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"bestOf":{"type":"integer","minimum":1,"maximum":7},"prediction":{"type":"object","properties":{"model":{"type":"string","minLength":1},"probabilities":{"type":"object","properties":{"home":{"type":["number","null"],"exclusiveMinimum":0},"draw":{"type":["number","null"],"exclusiveMinimum":0},"away":{"type":["number","null"],"exclusiveMinimum":0}},"required":["home","draw","away"]},"fairOdds":{"type":"object","properties":{"home":{"type":["number","null"],"exclusiveMinimum":0},"draw":{"type":["number","null"],"exclusiveMinimum":0},"away":{"type":["number","null"],"exclusiveMinimum":0}},"required":["home","draw","away"]},"createdAt":{"type":"string","format":"date-time"},"limited":{"type":"boolean"}},"required":["model","probabilities","fairOdds","createdAt"]},"odds":{"type":"object","properties":{"prices":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"opening":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"source":{"type":"string","minLength":1},"observedAt":{"type":"string","format":"date-time"}},"required":["prices","source","observedAt"]},"value":{"type":"object","properties":{"enabled":{"type":"boolean"},"reason":{"type":"string","enum":["validated","model_worse_than_close","no_backtest","no_odds","disabled_by_admin"]}},"required":["enabled","reason"]},"verdict":{"type":"object","properties":{"outcome":{"type":"string","enum":["home","draw","away"]},"modelProbability":{"type":"number","minimum":0,"maximum":1},"marketProbability":{"type":["number","null"],"minimum":0,"maximum":1},"favourite":{"type":"string","enum":["home","draw","away"]},"favouriteHit":{"type":"boolean"},"closer":{"type":["string","null"],"enum":["model","market","level",null]}},"required":["outcome","modelProbability","marketProbability","favourite","favouriteHit","closer"]},"live":{"type":"object","properties":{"minute":{"type":["integer","null"],"minimum":0},"period":{"type":"string","enum":["1H","HT","2H","ET1","ET2","PEN"]},"red":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"yellow":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"corners":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"at":{"type":"string","format":"date-time"}},"required":["minute"]},"source":{"type":"string","minLength":1}},"required":["id","sport","league","home","away","kickoff","status"]}}}},"400":{"description":"Invalid id","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Match not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/models":{"get":{"tags":["matches"],"summary":"Walk-forward backtest of the active models vs the closing market","responses":{"200":{"description":"Active model reports","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"sport":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"model":{"type":"string","minLength":1},"trainedAt":{"type":"string","format":"date-time"},"leagues":{"type":"array","items":{"type":"string"}},"matches":{"type":"integer","minimum":0},"logLoss":{"type":"object","properties":{"model":{"type":"number"},"market":{"type":"number"},"blend":{"type":"number"}},"required":["model","market"]},"rps":{"type":"object","properties":{"model":{"type":"number"},"market":{"type":"number"}},"required":["model","market"]},"betting":{"type":"object","properties":{"bets":{"type":"integer","minimum":0},"roi":{"type":"number"},"clvBeatRate":{"type":"number"},"meanClv":{"type":"number"}},"required":["bets","roi","clvBeatRate","meanClv"]},"valueEnabled":{"type":"boolean"},"predictionAgeHours":{"type":"number","minimum":0}},"required":["sport","model","trainedAt","leagues","matches","logLoss","valueEnabled"]}}},"required":["items"]}}}}}}},"/v1/tickets/xray":{"post":{"tags":["tickets"],"summary":"Ticket x-ray: margin, fair probability and EV of an accumulator","description":"Pure maths over the supplied odds. Informational only — not betting advice.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"legs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"odds":{"type":"number","exclusiveMinimum":1,"exclusiveMaximum":10000},"marketOdds":{"type":"array","items":{"type":"number","exclusiveMinimum":1,"exclusiveMaximum":10000},"minItems":2,"maxItems":64},"selection":{"type":"integer","minimum":0},"modelProbability":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1}},"required":["id","odds","marketOdds","selection"]},"minItems":1,"maxItems":30}},"required":["legs"]}}}},"responses":{"200":{"description":"Ticket analysis","content":{"application/json":{"schema":{"type":"object","properties":{"legs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"odds":{"type":"number"},"impliedProbability":{"type":"number"},"fairProbability":{"type":"number"},"legMargin":{"type":"number"},"probability":{"type":"number"},"ev":{"type":"number"}},"required":["id","odds","impliedProbability","fairProbability","legMargin","probability","ev"]}},"combinedOdds":{"type":"number"},"winProbability":{"type":"number"},"ev":{"type":"number"},"compoundedMargin":{"type":"number"},"verdict":{"type":"string","enum":["positive","neutral","negative"]}},"required":["legs","combinedOdds","winProbability","ev","compoundedMargin","verdict"]}}}},"400":{"description":"Invalid ticket","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"Ticket cannot be analysed","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many analyses from this address (60 per 10 minutes); see Retry-After","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me":{"get":{"tags":["auth"],"summary":"The signed-in user and effective plan (session cookie from /api/auth)","responses":{"200":{"description":"Signed-in user","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"name":{"type":"string"},"plan":{"type":"string","enum":["free","premium","pro"]},"comp":{"type":"string","enum":["beta"]},"consentPending":{"type":"boolean","enum":[true]},"subscription":{"type":["object","null"],"properties":{"plan":{"type":"string","enum":["premium","pro"]},"status":{"type":"string","enum":["trialing","active","past_due","canceled","expired"]},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"}},"required":["plan","status","currentPeriodEnd","cancelAtPeriodEnd"]}},"required":["id","email","name","plan","subscription"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["account"],"summary":"Delete my account and its data (irreversible)","description":"Body `confirm` must be \"STERGE CONTUL\" or \"DELETE MY ACCOUNT\". Cancel any paid subscription in the billing portal first.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"string","minLength":1,"maxLength":64}},"required":["confirm"]}}}},"responses":{"204":{"description":"Deleted; the session cookie is no longer valid"},"400":{"description":"Missing or wrong confirmation phrase","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"An active paid subscription must be cancelled first","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/billing/checkout":{"post":{"tags":["billing"],"summary":"Start a Stripe Checkout subscription (7-day trial)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"price":{"type":"string","enum":["premium_monthly_ron","premium_yearly_ron","pro_monthly_ron"]},"startImmediately":{"type":"boolean","enum":[true]}},"required":["price","startImmediately"]}}}},"responses":{"200":{"description":"Redirect to Stripe Checkout","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"400":{"description":"Invalid price","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Billing not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/billing/portal":{"post":{"tags":["billing"],"summary":"Open the Stripe Customer Portal","responses":{"200":{"description":"Redirect to the portal","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Billing not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/ledger":{"get":{"tags":["ledger"],"summary":"Public MarcAI system picks, newest first","description":"Append-only, hash-chained pick ledger with closing odds and CLV. Backfilled picks are flagged. Numbers, not promises.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"required":false,"name":"result","in":"query"}],"responses":{"200":{"description":"One page of picks","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"league":{"type":["string","null"],"minLength":1},"kickoff":{"type":"string","format":"date-time"},"market":{"type":"string","minLength":1},"outcome":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"backfill":{"type":"boolean"},"odds":{"type":"number","exclusiveMinimum":1},"modelProbability":{"type":["number","null"],"minimum":0,"maximum":1},"closingOdds":{"type":["number","null"],"exclusiveMinimum":1},"closingFairProbability":{"type":["number","null"],"minimum":0,"maximum":1},"clv":{"type":["number","null"]},"result":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"placedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"counted":{"type":"boolean","default":true},"prevHash":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"hash":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["id","eventId","home","away","league","kickoff","market","outcome","model","backfill","odds","modelProbability","closingOdds","closingFairProbability","clv","result","placedAt","settledAt","prevHash","hash"]}},"page":{"type":"integer","minimum":1},"pageSize":{"type":"integer","minimum":1},"total":{"type":"integer","minimum":0}},"required":["items","page","pageSize","total"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/ledger/summary":{"get":{"tags":["ledger"],"summary":"Flat-stake performance, CLV and 10-bin calibration of the public ledger","responses":{"200":{"description":"Ledger summary","content":{"application/json":{"schema":{"type":"object","properties":{"overall":{"type":"object","properties":{"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"voided":{"type":"integer","minimum":0},"wins":{"type":"number","minimum":0},"hitRate":{"type":["number","null"],"minimum":0,"maximum":1},"staked":{"type":"number","minimum":0},"profit":{"type":"number"},"roi":{"type":["number","null"]},"withClosing":{"type":"integer","minimum":0},"avgClv":{"type":["number","null"]},"beatCloseRate":{"type":["number","null"],"minimum":0,"maximum":1},"brier":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierClose":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierCount":{"type":"integer","minimum":0,"default":0},"hitRateCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]}},"required":["picks","settled","pending","voided","wins","hitRate","staked","profit","roi","withClosing","avgClv","beatCloseRate"]},"origins":{"type":"object","properties":{"live":{"type":"object","properties":{"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"voided":{"type":"integer","minimum":0},"wins":{"type":"number","minimum":0},"hitRate":{"type":["number","null"],"minimum":0,"maximum":1},"staked":{"type":"number","minimum":0},"profit":{"type":"number"},"roi":{"type":["number","null"]},"withClosing":{"type":"integer","minimum":0},"avgClv":{"type":["number","null"]},"beatCloseRate":{"type":["number","null"],"minimum":0,"maximum":1},"brier":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierClose":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierCount":{"type":"integer","minimum":0,"default":0},"hitRateCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]}},"required":["picks","settled","pending","voided","wins","hitRate","staked","profit","roi","withClosing","avgClv","beatCloseRate"]},"backfill":{"type":"object","properties":{"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"voided":{"type":"integer","minimum":0},"wins":{"type":"number","minimum":0},"hitRate":{"type":["number","null"],"minimum":0,"maximum":1},"staked":{"type":"number","minimum":0},"profit":{"type":"number"},"roi":{"type":["number","null"]},"withClosing":{"type":"integer","minimum":0},"avgClv":{"type":["number","null"]},"beatCloseRate":{"type":["number","null"],"minimum":0,"maximum":1},"brier":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierClose":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierCount":{"type":"integer","minimum":0,"default":0},"hitRateCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]}},"required":["picks","settled","pending","voided","wins","hitRate","staked","profit","roi","withClosing","avgClv","beatCloseRate"]}},"required":["live","backfill"]},"calibration":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9},"lower":{"type":"number","minimum":0,"maximum":1},"upper":{"type":"number","minimum":0,"maximum":1},"count":{"type":"integer","minimum":0},"predicted":{"type":["number","null"],"minimum":0,"maximum":1},"observed":{"type":["number","null"],"minimum":0,"maximum":1}},"required":["index","lower","upper","count","predicted","observed"]}},"byModel":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string","minLength":1},"stats":{"type":"object","properties":{"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"voided":{"type":"integer","minimum":0},"wins":{"type":"number","minimum":0},"hitRate":{"type":["number","null"],"minimum":0,"maximum":1},"staked":{"type":"number","minimum":0},"profit":{"type":"number"},"roi":{"type":["number","null"]},"withClosing":{"type":"integer","minimum":0},"avgClv":{"type":["number","null"]},"beatCloseRate":{"type":["number","null"],"minimum":0,"maximum":1},"brier":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierClose":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierCount":{"type":"integer","minimum":0,"default":0},"hitRateCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]}},"required":["picks","settled","pending","voided","wins","hitRate","staked","profit","roi","withClosing","avgClv","beatCloseRate"]}},"required":["model","stats"]}},"duplicatesExcluded":{"type":"integer","minimum":0,"default":0},"generatedAt":{"type":"string","format":"date-time"}},"required":["overall","origins","calibration","byModel","generatedAt"]}}}}}}},"/v1/ledger/verify":{"get":{"tags":["ledger"],"summary":"Recompute the hash chain of the public ledger","responses":{"200":{"description":"Chain verification","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"checked":{"type":"integer","minimum":0},"firstBrokenIndex":{"type":["integer","null"],"minimum":0},"firstBrokenId":{"type":["string","null"],"pattern":"^\\d{1,18}$"},"head":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"checkedAt":{"type":"string","format":"date-time"}},"required":["ok","checked","firstBrokenIndex","firstBrokenId","head","checkedAt"]}}}}}}},"/v1/ledger/head":{"get":{"tags":["ledger"],"summary":"Daily signed commitments to the chain head (anchors)","description":"Newest first. Each anchor fixes the head hash and the number of links at a wall-clock moment and is signed with the service key (HMAC-SHA256), with `prevSignature` chaining the anchors themselves. A reader who kept an anchor can detect a later rewrite of the committed prefix; see /v1/ledger/head/verify.","responses":{"200":{"description":"Anchors","content":{"application/json":{"schema":{"type":"object","properties":{"latest":{"type":["object","null"],"properties":{"day":{"type":"string","format":"date"},"head":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"anchoredAt":{"type":"string","format":"date-time"},"algorithm":{"type":"string","enum":["HMAC-SHA256"]},"signature":{"type":"string","pattern":"^[0-9a-f]{64}$"},"prevSignature":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"}},"required":["day","head","picks","settled","anchoredAt","algorithm","signature","prevSignature"]},"recent":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"head":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"anchoredAt":{"type":"string","format":"date-time"},"algorithm":{"type":"string","enum":["HMAC-SHA256"]},"signature":{"type":"string","pattern":"^[0-9a-f]{64}$"},"prevSignature":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"}},"required":["day","head","picks","settled","anchoredAt","algorithm","signature","prevSignature"]},"maxItems":31},"checkedAt":{"type":"string","format":"date-time"}},"required":["latest","recent","checkedAt"]}}}}}}},"/v1/ledger/head/verify":{"get":{"tags":["ledger"],"summary":"Recompute the anchored prefix of the hash chain and compare it with the published head","description":"ok:false with reason head_mismatch means the published ledger no longer reproduces a head we committed to.","responses":{"200":{"description":"Anchored proof","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"day":{"type":["string","null"],"format":"date"},"checked":{"type":"integer","minimum":0},"computedHead":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"anchoredHead":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"reason":{"type":["string","null"],"enum":["no_anchor","not_configured","signature_invalid","head_mismatch","chain_broken",null]},"checkedAt":{"type":"string","format":"date-time"}},"required":["ok","day","checked","computedHead","anchoredHead","reason","checkedAt"]}}}}}}},"/v1/ledger/picks/{id}":{"get":{"tags":["ledger"],"summary":"One pick as a shareable receipt, with its chain position and the commitment that covers it","description":"The receipt names the pick, its 0-based position in the hash chain and the newest daily commitment to the chain head. Compare it with /v1/ledger/head/verify, which recomputes the anchored prefix.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The receipt","content":{"application/json":{"schema":{"type":"object","properties":{"pick":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"league":{"type":["string","null"],"minLength":1},"kickoff":{"type":"string","format":"date-time"},"market":{"type":"string","minLength":1},"outcome":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"backfill":{"type":"boolean"},"odds":{"type":"number","exclusiveMinimum":1},"modelProbability":{"type":["number","null"],"minimum":0,"maximum":1},"closingOdds":{"type":["number","null"],"exclusiveMinimum":1},"closingFairProbability":{"type":["number","null"],"minimum":0,"maximum":1},"clv":{"type":["number","null"]},"result":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"placedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"counted":{"type":"boolean","default":true},"prevHash":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"hash":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["id","eventId","home","away","league","kickoff","market","outcome","model","backfill","odds","modelProbability","closingOdds","closingFairProbability","clv","result","placedAt","settledAt","prevHash","hash"]},"index":{"type":"integer","minimum":0},"anchor":{"type":["object","null"],"properties":{"day":{"type":"string","format":"date"},"head":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"anchoredAt":{"type":"string","format":"date-time"},"algorithm":{"type":"string","enum":["HMAC-SHA256"]},"signature":{"type":"string","pattern":"^[0-9a-f]{64}$"},"prevSignature":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"}},"required":["day","head","picks","settled","anchoredAt","algorithm","signature","prevSignature"]},"covered":{"type":"boolean"},"checkedAt":{"type":"string","format":"date-time"}},"required":["pick","index","anchor","covered","checkedAt"]}}}},"400":{"description":"Invalid id","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such pick","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Ledger unavailable","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/ledger/export.csv":{"get":{"tags":["ledger"],"summary":"The public ledger as CSV (CC BY 4.0), oldest first, for re-verifying the hash chain","description":"Streams every public MarcAI system pick in insertion order with prev_hash and hash, so the chain can be recomputed top-down (see /v1/ledger/verify). Licence: CC BY 4.0 (Link rel=\"license\"). ETag changes when a pick is added or settled; send If-None-Match for a 304. `from`/`to` are inclusive UTC days on placed_at.","parameters":[{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"required":false,"name":"result","in":"query"}],"responses":{"200":{"description":"CSV, header row first","content":{"text/csv":{"schema":{"type":"string"}}}},"304":{"description":"Not modified (If-None-Match matched the ETag)"},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/bankroll/tickets":{"get":{"tags":["bankroll"],"summary":"My wallet: every recorded ticket (newest first) with live leg states","description":"Legs linked to a MarcAI event carry the event status, minute, score and the provisional result; `state` is open / winning / losing / settled. Pending tickets whose legs are all decided are settled on read.","responses":{"200":{"description":"Tickets","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"stake":{"type":"number"},"totalOdds":{"type":"number"},"potentialWin":{"type":"number"},"status":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"legs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"odds":{"type":"number","exclusiveMinimum":1,"maximum":1000},"marketKey":{"type":"string","minLength":1,"maxLength":40,"default":"manual"},"outcome":{"type":"integer","minimum":0,"maximum":50,"default":0},"eventId":{"type":["string","null"],"pattern":"^\\d{1,18}$","default":null},"live":{"type":["object","null"],"properties":{"home":{"type":"string"},"away":{"type":"string"},"league":{"type":["string","null"]},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished","void"]},"minute":{"type":["integer","null"]},"score":{"type":["object","null"],"properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"result":{"type":"string","enum":["pending","won","lost","void"]}},"default":null,"required":["home","away","league","kickoff","status","minute","score","result"],"description":"Live state of a leg linked to a MarcAI event."}},"required":["label","odds"]}},"placedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"bookmakerCode":{"type":["string","null"],"enum":["s07","s08","s09","s10","s11","s12","s21","s22","s23","s24","s25","other",null],"default":null},"code":{"type":["string","null"],"default":null},"source":{"type":"string","enum":["manual","scan","ocr","builder"],"default":"manual"},"shareId":{"type":["string","null"],"default":null},"note":{"type":["string","null"],"default":null},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":24},"default":[]},"state":{"type":"string","enum":["open","winning","losing","settled"],"default":"open"}},"required":["id","stake","totalOdds","potentialWin","status","legs","placedAt","settledAt"]}}},"required":["items"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["bankroll"],"summary":"Record a ticket placed elsewhere","description":"Refused with 403 during a cool-off or before age confirmation, and with 409 when the stake would exceed a weekly/monthly limit.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stake":{"type":"number","exclusiveMinimum":0,"maximum":1000000},"legs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"odds":{"type":"number","exclusiveMinimum":1,"maximum":1000},"marketKey":{"type":"string","minLength":1,"maxLength":40,"default":"manual"},"outcome":{"type":"integer","minimum":0,"maximum":50,"default":0},"eventId":{"type":["string","null"],"pattern":"^\\d{1,18}$","default":null}},"required":["label","odds"],"description":"One selection of a recorded ticket."},"minItems":1,"maxItems":20},"placedAt":{"type":"string","format":"date-time"},"bookmakerCode":{"type":"string","enum":["s07","s08","s09","s10","s11","s12","s21","s22","s23","s24","s25","other"]},"code":{"type":"string","minLength":1,"maxLength":64},"source":{"type":"string","enum":["manual","scan","ocr"],"default":"manual"},"note":{"type":"string","maxLength":500}},"required":["stake","legs"],"description":"Record a ticket placed elsewhere. MarcAI never places bets."}}}},"responses":{"201":{"description":"Recorded ticket","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"stake":{"type":"number"},"totalOdds":{"type":"number"},"potentialWin":{"type":"number"},"status":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"legs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"odds":{"type":"number","exclusiveMinimum":1,"maximum":1000},"marketKey":{"type":"string","minLength":1,"maxLength":40,"default":"manual"},"outcome":{"type":"integer","minimum":0,"maximum":50,"default":0},"eventId":{"type":["string","null"],"pattern":"^\\d{1,18}$","default":null},"live":{"type":["object","null"],"properties":{"home":{"type":"string"},"away":{"type":"string"},"league":{"type":["string","null"]},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished","void"]},"minute":{"type":["integer","null"]},"score":{"type":["object","null"],"properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"result":{"type":"string","enum":["pending","won","lost","void"]}},"default":null,"required":["home","away","league","kickoff","status","minute","score","result"],"description":"Live state of a leg linked to a MarcAI event."}},"required":["label","odds"]}},"placedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"bookmakerCode":{"type":["string","null"],"enum":["s07","s08","s09","s10","s11","s12","s21","s22","s23","s24","s25","other",null],"default":null},"code":{"type":["string","null"],"default":null},"source":{"type":"string","enum":["manual","scan","ocr","builder"],"default":"manual"},"shareId":{"type":["string","null"],"default":null},"note":{"type":["string","null"],"default":null},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":24},"default":[]},"state":{"type":"string","enum":["open","winning","losing","settled"],"default":"open"}},"required":["id","stake","totalOdds","potentialWin","status","legs","placedAt","settledAt"]}}}},"400":{"description":"Invalid ticket","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Cool-off active or age not confirmed","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Stake limit would be exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/tickets/build":{"post":{"tags":["wallet"],"summary":"Propose a ticket from model predictions + consensus odds (deterministic, no LLM)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"risk":{"type":"string","enum":["low","medium","high"],"default":"medium"},"minOdds":{"type":"number","exclusiveMinimum":1,"maximum":1000,"default":2},"maxOdds":{"type":"number","exclusiveMinimum":1,"maximum":10000,"default":6},"maxLegs":{"type":"integer","minimum":1,"maximum":10,"default":4},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"competitions":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":20,"default":[]},"markets":{"type":"array","items":{"type":"string","enum":["1x2","dc"]},"minItems":1,"default":["1x2","dc"]},"excludeEventIds":{"type":"array","items":{"type":"string","pattern":"^\\d{1,18}$"},"maxItems":50,"default":[]},"keepEventIds":{"type":"array","items":{"type":"string","pattern":"^\\d{1,18}$"},"maxItems":10,"default":[]}},"description":"Deterministic ticket proposal from model predictions + consensus odds. No LLM. Refused (403) for users in stats-only mode."}}}},"responses":{"200":{"description":"Proposed ticket with x-ray","content":{"application/json":{"schema":{"type":"object","properties":{"legs":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string"},"away":{"type":"string"},"league":{"type":"string"},"kickoff":{"type":"string","format":"date-time"},"marketKey":{"type":"string","enum":["1x2","dc"]},"outcome":{"type":"integer","minimum":0,"maximum":2},"label":{"type":"string"},"odds":{"type":"number"},"modelProbability":{"type":"number"},"fairOdds":{"type":"number"},"edge":{"type":"number"}},"required":["eventId","home","away","league","kickoff","marketKey","outcome","label","odds","modelProbability","fairOdds","edge"]}},"totalOdds":{"type":"number"},"inRange":{"type":"boolean"},"xray":{"type":["object","null"],"properties":{"legs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"odds":{"type":"number"},"impliedProbability":{"type":"number"},"fairProbability":{"type":"number"},"legMargin":{"type":"number"},"probability":{"type":"number"},"ev":{"type":"number"}},"required":["id","odds","impliedProbability","fairProbability","legMargin","probability","ev"]}},"combinedOdds":{"type":"number"},"winProbability":{"type":"number"},"ev":{"type":"number"},"compoundedMargin":{"type":"number"},"verdict":{"type":"string","enum":["positive","neutral","negative"]}},"required":["legs","combinedOdds","winProbability","ev","compoundedMargin","verdict"]},"candidates":{"type":"integer","minimum":0},"valueEnabled":{"type":"boolean"},"notes":{"type":"array","items":{"type":"string"}}},"required":["legs","totalOdds","inRange","xray","candidates","valueEnabled","notes"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Stats-only mode is on","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/tickets/build/save":{"post":{"tags":["wallet"],"summary":"Save a proposed ticket to my wallet (source builder)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stake":{"type":"number","exclusiveMinimum":0,"maximum":1000000},"legs":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string"},"away":{"type":"string"},"league":{"type":"string"},"kickoff":{"type":"string","format":"date-time"},"marketKey":{"type":"string","enum":["1x2","dc"]},"outcome":{"type":"integer","minimum":0,"maximum":2},"label":{"type":"string"},"odds":{"type":"number"},"modelProbability":{"type":"number"},"fairOdds":{"type":"number"},"edge":{"type":"number"}},"required":["eventId","home","away","league","kickoff","marketKey","outcome","label","odds","modelProbability","fairOdds","edge"]},"minItems":1,"maxItems":20},"bookmakerCode":{"type":"string","enum":["s07","s08","s09","s10","s11","s12","s21","s22","s23","s24","s25","other"]},"note":{"type":"string","maxLength":500}},"required":["stake","legs"]}}}},"responses":{"201":{"description":"Recorded ticket","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"stake":{"type":"number"},"totalOdds":{"type":"number"},"potentialWin":{"type":"number"},"status":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"legs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"odds":{"type":"number","exclusiveMinimum":1,"maximum":1000},"marketKey":{"type":"string","minLength":1,"maxLength":40,"default":"manual"},"outcome":{"type":"integer","minimum":0,"maximum":50,"default":0},"eventId":{"type":["string","null"],"pattern":"^\\d{1,18}$","default":null},"live":{"type":["object","null"],"properties":{"home":{"type":"string"},"away":{"type":"string"},"league":{"type":["string","null"]},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished","void"]},"minute":{"type":["integer","null"]},"score":{"type":["object","null"],"properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"result":{"type":"string","enum":["pending","won","lost","void"]}},"default":null,"required":["home","away","league","kickoff","status","minute","score","result"],"description":"Live state of a leg linked to a MarcAI event."}},"required":["label","odds"]}},"placedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"bookmakerCode":{"type":["string","null"],"enum":["s07","s08","s09","s10","s11","s12","s21","s22","s23","s24","s25","other",null],"default":null},"code":{"type":["string","null"],"default":null},"source":{"type":"string","enum":["manual","scan","ocr","builder"],"default":"manual"},"shareId":{"type":["string","null"],"default":null},"note":{"type":["string","null"],"default":null},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":24},"default":[]},"state":{"type":"string","enum":["open","winning","losing","settled"],"default":"open"}},"required":["id","stake","totalOdds","potentialWin","status","legs","placedAt","settledAt"]}}}},"400":{"description":"Invalid ticket","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Cool-off active or age not confirmed","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Stake limit would be exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/bankroll/tickets/import":{"post":{"tags":["wallet"],"summary":"Parse a scanned code or OCR text into a draft ticket (nothing is saved)","description":"Confirm the draft with POST /v1/bankroll/tickets (source scan|ocr). URLs from scanned codes are reduced to the ticket id and never returned.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["scan","ocr"]},"bookmakerCode":{"type":"string","enum":["s07","s08","s09","s10","s11","s12","s21","s22","s23","s24","s25","other"]},"code":{"type":"string","minLength":1,"maxLength":2048},"rawText":{"type":"string","maxLength":20000}},"required":["source"],"description":"Parse a scanned code / OCR text into a draft ticket. Nothing is saved."}}}},"responses":{"200":{"description":"Draft","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["scan","ocr"]},"bookmakerCode":{"type":["string","null"],"enum":["s07","s08","s09","s10","s11","s12","s21","s22","s23","s24","s25","other",null]},"code":{"type":["string","null"]},"stake":{"type":["number","null"]},"totalOdds":{"type":["number","null"]},"potentialWin":{"type":["number","null"]},"legs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"odds":{"type":"number","exclusiveMinimum":1,"maximum":1000},"marketKey":{"type":"string","minLength":1,"maxLength":40,"default":"manual"},"outcome":{"type":"integer","minimum":0,"maximum":50,"default":0},"eventId":{"type":["string","null"],"pattern":"^\\d{1,18}$","default":null},"raw":{"type":"string"},"confidence":{"type":["number","null"],"minimum":0,"maximum":1}},"required":["label","odds","raw","confidence"]}},"parser":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["source","bookmakerCode","code","stake","totalOdds","potentialWin","legs","parser","warnings"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/bankroll/tickets/{id}/share":{"post":{"tags":["wallet"],"summary":"Create (or return) the public share id of my ticket","description":"The QR code encodes `url` (APP_URL/b/<shareId>); it is generated client side.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Share link","content":{"application/json":{"schema":{"type":"object","properties":{"shareId":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["shareId","url"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Ticket not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["wallet"],"summary":"Revoke the public share link of my ticket","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Revoked"},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Ticket not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/tickets/shared/{shareId}":{"get":{"tags":["wallet"],"summary":"Public view of a shared ticket (legs, odds, status; no user data)","parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9]{10}$"},"required":true,"name":"shareId","in":"path"}],"responses":{"200":{"description":"Shared ticket","content":{"application/json":{"schema":{"type":"object","properties":{"shareId":{"type":"string"},"totalOdds":{"type":"number"},"status":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"state":{"type":"string","enum":["open","winning","losing","settled"]},"legs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"odds":{"type":"number","exclusiveMinimum":1,"maximum":1000},"marketKey":{"type":"string","minLength":1,"maxLength":40,"default":"manual"},"outcome":{"type":"integer","minimum":0,"maximum":50,"default":0},"eventId":{"type":["string","null"],"pattern":"^\\d{1,18}$","default":null},"live":{"type":["object","null"],"properties":{"home":{"type":"string"},"away":{"type":"string"},"league":{"type":["string","null"]},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished","void"]},"minute":{"type":["integer","null"]},"score":{"type":["object","null"],"properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"result":{"type":"string","enum":["pending","won","lost","void"]}},"default":null,"required":["home","away","league","kickoff","status","minute","score","result"],"description":"Live state of a leg linked to a MarcAI event."}},"required":["label","odds"]}},"placedAt":{"type":"string","format":"date-time"},"source":{"type":"string"}},"required":["shareId","totalOdds","status","state","legs","placedAt","source"]}}}},"404":{"description":"Not shared or revoked","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/bankroll/tickets/{id}":{"patch":{"tags":["bankroll"],"summary":"Settle (won / lost / void) or re-open one of my tickets","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","won","lost","void"]}},"required":["status"]}}}},"responses":{"200":{"description":"Updated ticket","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"stake":{"type":"number"},"totalOdds":{"type":"number"},"potentialWin":{"type":"number"},"status":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"legs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"odds":{"type":"number","exclusiveMinimum":1,"maximum":1000},"marketKey":{"type":"string","minLength":1,"maxLength":40,"default":"manual"},"outcome":{"type":"integer","minimum":0,"maximum":50,"default":0},"eventId":{"type":["string","null"],"pattern":"^\\d{1,18}$","default":null},"live":{"type":["object","null"],"properties":{"home":{"type":"string"},"away":{"type":"string"},"league":{"type":["string","null"]},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished","void"]},"minute":{"type":["integer","null"]},"score":{"type":["object","null"],"properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"result":{"type":"string","enum":["pending","won","lost","void"]}},"default":null,"required":["home","away","league","kickoff","status","minute","score","result"],"description":"Live state of a leg linked to a MarcAI event."}},"required":["label","odds"]}},"placedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"bookmakerCode":{"type":["string","null"],"enum":["s07","s08","s09","s10","s11","s12","s21","s22","s23","s24","s25","other",null],"default":null},"code":{"type":["string","null"],"default":null},"source":{"type":"string","enum":["manual","scan","ocr","builder"],"default":"manual"},"shareId":{"type":["string","null"],"default":null},"note":{"type":["string","null"],"default":null},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":24},"default":[]},"state":{"type":"string","enum":["open","winning","losing","settled"],"default":"open"}},"required":["id","stake","totalOdds","potentialWin","status","legs","placedAt","settledAt"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Ticket not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["bankroll"],"summary":"Delete one of my tickets","description":"The stake keeps counting toward the limits of the period it was recorded in.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Ticket not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/bankroll/tickets/{id}/tags":{"patch":{"tags":["bankroll"],"summary":"Replace the tags on one of my tickets (free on every plan)","description":"Full replacement, at most 8 tags of 24 characters, de-duplicated case-insensitively. Tags are private to the owner and never appear in the public shared-ticket view.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":24},"maxItems":8}},"required":["tags"],"description":"Replace one of my tickets' tags. Free on every plan; tags stay private."}}}},"responses":{"200":{"description":"Updated ticket","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0},"stake":{"type":"number"},"totalOdds":{"type":"number"},"potentialWin":{"type":"number"},"status":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"legs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120},"odds":{"type":"number","exclusiveMinimum":1,"maximum":1000},"marketKey":{"type":"string","minLength":1,"maxLength":40,"default":"manual"},"outcome":{"type":"integer","minimum":0,"maximum":50,"default":0},"eventId":{"type":["string","null"],"pattern":"^\\d{1,18}$","default":null},"live":{"type":["object","null"],"properties":{"home":{"type":"string"},"away":{"type":"string"},"league":{"type":["string","null"]},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished","void"]},"minute":{"type":["integer","null"]},"score":{"type":["object","null"],"properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"result":{"type":"string","enum":["pending","won","lost","void"]}},"default":null,"required":["home","away","league","kickoff","status","minute","score","result"],"description":"Live state of a leg linked to a MarcAI event."}},"required":["label","odds"]}},"placedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"bookmakerCode":{"type":["string","null"],"enum":["s07","s08","s09","s10","s11","s12","s21","s22","s23","s24","s25","other",null],"default":null},"code":{"type":["string","null"],"default":null},"source":{"type":"string","enum":["manual","scan","ocr","builder"],"default":"manual"},"shareId":{"type":["string","null"],"default":null},"note":{"type":["string","null"],"default":null},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":24},"default":[]},"state":{"type":"string","enum":["open","winning","losing","settled"],"default":"open"}},"required":["id","stake","totalOdds","potentialWin","status","legs","placedAt","settledAt"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Ticket not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/bankroll/reports":{"get":{"tags":["bankroll"],"summary":"Per-tag activity and the hourly recording pattern of my tickets (Pro)","description":"Plans without `bankroll.advanced` get `pro: false` with null lists (teaser only). The heatmap is by the local hour a ticket was recorded at, which is what feeds the responsible-gambling view of when you play.","responses":{"200":{"description":"Reports","content":{"application/json":{"schema":{"type":"object","properties":{"pro":{"type":"boolean"},"tags":{"type":["array","null"],"items":{"type":"object","properties":{"tag":{"type":["string","null"]},"tickets":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"staked":{"type":"number"},"returned":{"type":"number"},"profit":{"type":"number"},"roi":{"type":["number","null"]},"winRate":{"type":["number","null"]},"pendingStake":{"type":"number"}},"required":["tag","tickets","settled","pending","staked","returned","profit","roi","winRate","pendingStake"]}},"untagged":{"type":["object","null"],"properties":{"tag":{"type":["string","null"]},"tickets":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"staked":{"type":"number"},"returned":{"type":"number"},"profit":{"type":"number"},"roi":{"type":["number","null"]},"winRate":{"type":["number","null"]},"pendingStake":{"type":"number"}},"required":["tag","tickets","settled","pending","staked","returned","profit","roi","winRate","pendingStake"]},"byHour":{"type":["array","null"],"items":{"type":"object","properties":{"hour":{"type":"integer","minimum":0,"maximum":23},"tickets":{"type":"integer","minimum":0},"staked":{"type":"number"}},"required":["hour","tickets","staked"]}},"busiestHour":{"type":["integer","null"],"minimum":0,"maximum":23}},"required":["pro","tags","untagged","byHour","busiestHour"],"description":"Per-tag activity and the hourly recording pattern behind my own tickets."}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/bankroll/brier":{"get":{"tags":["bankroll"],"summary":"My personal Brier score, one point per local day of the last 30 days","description":"Calibration of the probabilities I recorded on my own settled picks: per local (Europe/Bucharest) day, how many picks settled (`n`) and their mean squared error (`brier`, lower is better, 0.25 = always \"50 %\"). Every day of the window is present, zero-filled; a day below the 10-pick floor carries its count and no score (D47). Free on every plan: it is my own data, read with one indexed query and stored nowhere.","responses":{"200":{"description":"Daily Brier series","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"minN":{"type":"integer","minimum":1},"n":{"type":"integer","minimum":0},"brier":{"type":["number","null"]},"points":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"n":{"type":"integer","minimum":0},"brier":{"type":["number","null"]}},"required":["day","n","brier"]}}},"required":["from","to","minN","n","brier","points"],"description":"Calibration of the probabilities I recorded on my own settled picks, one point per local day (Europe/Bucharest), zero-filled."}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/bankroll/export.csv":{"get":{"tags":["bankroll"],"summary":"CSV export of my tickets or the per-tag report (Pro)","description":"`kind=tickets` (default): one row per ticket, newest first, with the money maths resolved — id, code, placed_at, settled_at, status, stake, total_odds, potential_win, returned, profit (empty while pending), source, bookmaker, legs, tags (\"|\"-joined), note. `kind=reports`: one row per tag with tag, tickets, settled, pending, staked, returned, profit, roi, win_rate, pending_stake (the untagged rest last, empty tag cell). RFC 4180 quoting; a text cell starting with = + - @ is prefixed with an apostrophe so a spreadsheet cannot execute it. Requires `bankroll.advanced` (402 paywall otherwise).","parameters":[{"schema":{"type":"string","enum":["tickets","reports"],"default":"tickets"},"required":false,"name":"kind","in":"query"}],"responses":{"200":{"description":"CSV, header row first","content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"Upgrade required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/bankroll/summary":{"get":{"tags":["bankroll"],"summary":"Balance curve, P/L, ROI, by week/month and streaks","responses":{"200":{"description":"Summary","content":{"application/json":{"schema":{"type":"object","properties":{"tickets":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"pendingStake":{"type":"number"},"staked":{"type":"number"},"returned":{"type":"number"},"profit":{"type":"number"},"roi":{"type":["number","null"]},"winRate":{"type":["number","null"]},"curve":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"balance":{"type":"number"},"ticketId":{"type":"integer","exclusiveMinimum":0}},"required":["at","balance","ticketId"]}},"byWeek":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"tickets":{"type":"integer","minimum":0},"staked":{"type":"number"},"profit":{"type":"number"},"roi":{"type":["number","null"]}},"required":["period","tickets","staked","profit","roi"]}},"byMonth":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"tickets":{"type":"integer","minimum":0},"staked":{"type":"number"},"profit":{"type":"number"},"roi":{"type":["number","null"]}},"required":["period","tickets","staked","profit","roi"]}},"longestWinStreak":{"type":"integer","minimum":0},"longestLossStreak":{"type":"integer","minimum":0}},"required":["tickets","settled","pending","pendingStake","staked","returned","profit","roi","winRate","curve","byWeek","byMonth","longestWinStreak","longestLossStreak"],"description":"Bankroll maths over settled tickets (P/L recognised at settlement)."}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/bankroll/clv":{"get":{"tags":["bankroll"],"summary":"Closing-line value and margin paid on my tickets (placed in [from, to))","description":"Per leg: taken odds against the Shin-devigged last pre-kickoff consensus price (ClickHouse ticks, else odds_latest observed before kickoff). Ticket CLV = Π(odds·p) − 1 over non-void legs. Legs without a close carry a reason. Plans without `bankroll.advanced` get the summary only (`tickets: null`).","parameters":[{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"CLV","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":["string","null"],"format":"date-time"},"to":{"type":["string","null"],"format":"date-time"},"summary":{"type":"object","properties":{"tickets":{"type":"integer","minimum":0},"ticketsWithClv":{"type":"integer","minimum":0},"legs":{"type":"integer","minimum":0},"legsWithClv":{"type":"integer","minimum":0},"avgLegClv":{"type":["number","null"]},"beatCloseRate":{"type":["number","null"]},"avgTicketClv":{"type":["number","null"]},"avgMarginPaid":{"type":["number","null"]},"marginPaidAmount":{"type":["number","null"]}},"required":["tickets","ticketsWithClv","legs","legsWithClv","avgLegClv","beatCloseRate","avgTicketClv","avgMarginPaid","marginPaidAmount"]},"tickets":{"type":["array","null"],"items":{"type":"object","properties":{"ticketId":{"type":"integer","exclusiveMinimum":0},"clv":{"type":["number","null"]},"marginPaid":{"type":["number","null"]},"legs":{"type":"array","items":{"type":"object","properties":{"clv":{"type":["number","null"]},"marginPaid":{"type":["number","null"]},"fairCloseOdds":{"type":["number","null"]},"reason":{"type":["string","null"],"enum":["unlinked","unsupported_market","not_started","no_close","void","placed_live",null]}},"required":["clv","marginPaid","fairCloseOdds","reason"],"description":"Closing-line value of one leg against the anonymous consensus close."}}},"required":["ticketId","clv","marginPaid","legs"]}}},"required":["from","to","summary","tickets"],"description":"Closing-line value and margin paid on my own tickets."}}}},"400":{"description":"Invalid period","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/rg/limits":{"get":{"tags":["responsible-gambling"],"summary":"My limits, any pending raise and cool-off","responses":{"200":{"description":"Limits","content":{"application/json":{"schema":{"type":"object","properties":{"weeklyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"monthlyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"sessionReminderMinutes":{"type":["integer","null"],"minimum":15,"maximum":240},"pending":{"type":["object","null"],"properties":{"changes":{"type":"object","properties":{"weeklyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"monthlyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"sessionReminderMinutes":{"type":["integer","null"],"minimum":15,"maximum":240}}},"effectiveAt":{"type":"string","format":"date-time"}},"required":["changes","effectiveAt"]},"coolOffUntil":{"type":["string","null"],"format":"date-time"}},"required":["weeklyStakeLimit","monthlyStakeLimit","sessionReminderMinutes","pending","coolOffUntil"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"put":{"tags":["responsible-gambling"],"summary":"Set limits: lowering applies now, raising or removing after 24 h","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"weeklyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"monthlyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"sessionReminderMinutes":{"type":["integer","null"],"minimum":15,"maximum":240}},"required":["weeklyStakeLimit","monthlyStakeLimit","sessionReminderMinutes"],"description":"Full replacement. null removes a limit (counts as a raise: applies after 24 h)."}}}},"responses":{"200":{"description":"Limits","content":{"application/json":{"schema":{"type":"object","properties":{"weeklyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"monthlyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"sessionReminderMinutes":{"type":["integer","null"],"minimum":15,"maximum":240},"pending":{"type":["object","null"],"properties":{"changes":{"type":"object","properties":{"weeklyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"monthlyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"sessionReminderMinutes":{"type":["integer","null"],"minimum":15,"maximum":240}}},"effectiveAt":{"type":"string","format":"date-time"}},"required":["changes","effectiveAt"]},"coolOffUntil":{"type":["string","null"],"format":"date-time"}},"required":["weeklyStakeLimit","monthlyStakeLimit","sessionReminderMinutes","pending","coolOffUntil"]}}}},"400":{"description":"Invalid limits","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/rg/cool-off":{"post":{"tags":["responsible-gambling"],"summary":"Start a cool-off (1, 7, 30 or 180 days); it can be extended, never shortened","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"days":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[7]},{"type":"number","enum":[30]},{"type":"number","enum":[180]}]}},"required":["days"]}}}},"responses":{"200":{"description":"Limits","content":{"application/json":{"schema":{"type":"object","properties":{"weeklyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"monthlyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"sessionReminderMinutes":{"type":["integer","null"],"minimum":15,"maximum":240},"pending":{"type":["object","null"],"properties":{"changes":{"type":"object","properties":{"weeklyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"monthlyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"sessionReminderMinutes":{"type":["integer","null"],"minimum":15,"maximum":240}}},"effectiveAt":{"type":"string","format":"date-time"}},"required":["changes","effectiveAt"]},"coolOffUntil":{"type":["string","null"],"format":"date-time"}},"required":["weeklyStakeLimit","monthlyStakeLimit","sessionReminderMinutes","pending","coolOffUntil"]}}}},"400":{"description":"Invalid duration","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"A longer cool-off is already active","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/rg/status":{"get":{"tags":["responsible-gambling"],"summary":"Stake this week/month vs limits, cool-off and age confirmation","responses":{"200":{"description":"Status","content":{"application/json":{"schema":{"type":"object","properties":{"minAge":{"type":"integer","minimum":18,"maximum":21},"ageConfirmed":{"type":"boolean"},"week":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"staked":{"type":"number"},"limit":{"type":["number","null"]},"remaining":{"type":["number","null"]}},"required":["from","staked","limit","remaining"]},"month":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"staked":{"type":"number"},"limit":{"type":["number","null"]},"remaining":{"type":["number","null"]}},"required":["from","staked","limit","remaining"]},"coolOff":{"type":"object","properties":{"active":{"type":"boolean"},"until":{"type":["string","null"],"format":"date-time"}},"required":["active","until"]},"sessionReminderMinutes":{"type":["integer","null"]},"pending":{"type":["object","null"],"properties":{"changes":{"type":"object","properties":{"weeklyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"monthlyStakeLimit":{"type":["number","null"],"exclusiveMinimum":0,"maximum":1000000},"sessionReminderMinutes":{"type":["integer","null"],"minimum":15,"maximum":240}}},"effectiveAt":{"type":"string","format":"date-time"}},"required":["changes","effectiveAt"]}},"required":["minAge","ageConfirmed","week","month","coolOff","sessionReminderMinutes","pending"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/rg/age":{"post":{"tags":["responsible-gambling"],"summary":"Confirm age with a birth year (once; cannot be changed)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"birthYear":{"type":"integer","minimum":1900,"maximum":2100}},"required":["birthYear"]}}}},"responses":{"200":{"description":"Age confirmed","content":{"application/json":{"schema":{"type":"object","properties":{"ageConfirmed":{"type":"boolean","enum":[true]},"minAge":{"type":"integer"}},"required":["ageConfirmed","minAge"]}}}},"400":{"description":"Invalid birth year","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Below the minimum age","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Age already confirmed","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/assistant/chat":{"post":{"tags":["assistant"],"summary":"Ask the analysis assistant; the answer streams as plain text","description":"Creates a thread when threadId is absent; the thread id is returned in the `x-thread-id` header. Max 20 messages per 10 minutes per user. Analysis only, never betting advice.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"threadId":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"},"message":{"type":"string","minLength":1,"maxLength":2000},"locale":{"type":"string","enum":["ro","en"]}},"required":["message"]}}}},"responses":{"200":{"description":"Streamed answer (UTF-8 text); thread id in the x-thread-id header","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"Daily assistant quota of the plan is spent (free 3, premium 50 per Bucharest day)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Thread not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many messages","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/assistant/threads":{"get":{"tags":["assistant"],"summary":"My assistant threads (most recent first)","responses":{"200":{"description":"Threads","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"},"title":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","createdAt","updatedAt"]}}},"required":["items"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/assistant/threads/{id}":{"get":{"tags":["assistant"],"summary":"One of my assistant threads with its messages","parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Thread","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"},"title":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["role","content","createdAt"]}}},"required":["id","title","createdAt","updatedAt","messages"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Thread not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["assistant"],"summary":"Delete one of my assistant threads","parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Thread not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/matches/{id}/center":{"get":{"tags":["match-center"],"summary":"Match center: H2H, form, table, odds movement, stats, momentum, lineups","description":"Odds are the anonymous consensus, labelled only by the masked source code (D12); no operator names or links (D01).","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Match center","content":{"application/json":{"schema":{"type":"object","properties":{"match":{"type":"object","properties":{"id":{"type":"string","minLength":1},"sport":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"league":{"type":"string","minLength":1},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"resultPending":{"type":"boolean"},"kickoffUnconfirmed":{"type":"boolean"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"bestOf":{"type":"integer","minimum":1,"maximum":7},"prediction":{"type":"object","properties":{"model":{"type":"string","minLength":1},"probabilities":{"type":"object","properties":{"home":{"type":["number","null"],"exclusiveMinimum":0},"draw":{"type":["number","null"],"exclusiveMinimum":0},"away":{"type":["number","null"],"exclusiveMinimum":0}},"required":["home","draw","away"]},"fairOdds":{"type":"object","properties":{"home":{"type":["number","null"],"exclusiveMinimum":0},"draw":{"type":["number","null"],"exclusiveMinimum":0},"away":{"type":["number","null"],"exclusiveMinimum":0}},"required":["home","draw","away"]},"createdAt":{"type":"string","format":"date-time"},"limited":{"type":"boolean"}},"required":["model","probabilities","fairOdds","createdAt"]},"odds":{"type":"object","properties":{"prices":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"opening":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"source":{"type":"string","minLength":1},"observedAt":{"type":"string","format":"date-time"}},"required":["prices","source","observedAt"]},"value":{"type":"object","properties":{"enabled":{"type":"boolean"},"reason":{"type":"string","enum":["validated","model_worse_than_close","no_backtest","no_odds","disabled_by_admin"]}},"required":["enabled","reason"]},"verdict":{"type":"object","properties":{"outcome":{"type":"string","enum":["home","draw","away"]},"modelProbability":{"type":"number","minimum":0,"maximum":1},"marketProbability":{"type":["number","null"],"minimum":0,"maximum":1},"favourite":{"type":"string","enum":["home","draw","away"]},"favouriteHit":{"type":"boolean"},"closer":{"type":["string","null"],"enum":["model","market","level",null]}},"required":["outcome","modelProbability","marketProbability","favourite","favouriteHit","closer"]},"live":{"type":"object","properties":{"minute":{"type":["integer","null"],"minimum":0},"period":{"type":"string","enum":["1H","HT","2H","ET1","ET2","PEN"]},"red":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"yellow":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"corners":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"at":{"type":"string","format":"date-time"}},"required":["minute"]},"source":{"type":"string","minLength":1}},"required":["id","sport","league","home","away","kickoff","status"]},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"minute":{"type":"integer","minimum":0},"venue":{"type":"string","minLength":1},"headToHead":{"type":"object","properties":{"matches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}},"summary":{"type":"object","properties":{"homeWins":{"type":"integer","minimum":0},"draws":{"type":"integer","minimum":0},"awayWins":{"type":"integer","minimum":0}},"required":["homeWins","draws","awayWins"]}},"required":["matches","summary"]},"form":{"type":"object","properties":{"home":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"results":{"type":"array","items":{"type":"string","enum":["W","D","L"]}}},"required":["team","results"]},"away":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"results":{"type":"array","items":{"type":"string","enum":["W","D","L"]}}},"required":["team","results"]}},"required":["home","away"]},"table":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","exclusiveMinimum":0},"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"played":{"type":"integer","minimum":0},"won":{"type":"integer","minimum":0},"drawn":{"type":"integer","minimum":0},"lost":{"type":"integer","minimum":0},"goalsFor":{"type":"integer","minimum":0},"goalsAgainst":{"type":"integer","minimum":0},"goalDifference":{"type":"integer"},"points":{"type":"integer","minimum":0},"pointsAdjustment":{"type":"integer"},"form":{"type":"array","items":{"type":"string","enum":["W","D","L"]}}},"required":["position","team","played","won","drawn","lost","goalsFor","goalsAgainst","goalDifference","points","form"]}},"tableCoverage":{"type":"object","properties":{"since":{"type":"string","format":"date-time"},"matches":{"type":"integer","exclusiveMinimum":0}},"required":["since","matches"]},"odds":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"outcomes":{"type":"array","items":{"type":"string","minLength":1},"minItems":2},"opening":{"type":"array","items":{"type":"number","exclusiveMinimum":0}},"latest":{"type":"array","items":{"type":"number","exclusiveMinimum":0}},"observedAt":{"type":"string","format":"date-time"}},"required":["market","source","outcomes","latest","observedAt"]}},"stats":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"home":{"type":"number"},"away":{"type":"number"}},"required":["key","home","away"]}},"momentum":{"type":"array","items":{"type":"object","properties":{"minute":{"type":"integer","minimum":0},"value":{"type":"number","minimum":-1,"maximum":1}},"required":["minute","value"]}},"lineups":{"type":"object","properties":{"home":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"number":{"type":"integer","minimum":0},"position":{"type":"string","minLength":1}},"required":["name"]}},"away":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"number":{"type":"integer","minimum":0},"position":{"type":"string","minLength":1}},"required":["name"]}},"homeBench":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"number":{"type":"integer","minimum":0},"position":{"type":"string","minLength":1}},"required":["name"]}},"awayBench":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"number":{"type":"integer","minimum":0},"position":{"type":"string","minLength":1}},"required":["name"]}}},"required":["home","away"]},"incidents":{"type":"array","items":{"type":"object","properties":{"minute":{"type":"integer","minimum":0},"side":{"type":"string","enum":["home","away"]},"type":{"type":"string","enum":["goal","penaltyGoal","ownGoal","yellow","secondYellow","red","sub"]},"player":{"type":"string","minLength":1},"playerIn":{"type":"string","minLength":1}},"required":["minute","side","type"]},"default":[]},"lateGoals":{"type":"object","properties":{"fromMinute":{"type":"integer","exclusiveMinimum":0},"home":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"scored":{"type":"integer","minimum":0},"scoredLate":{"type":"integer","minimum":0},"conceded":{"type":"integer","minimum":0},"concededLate":{"type":"integer","minimum":0}},"required":["matches","scored","scoredLate","conceded","concededLate"]},"away":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"scored":{"type":"integer","minimum":0},"scoredLate":{"type":"integer","minimum":0},"conceded":{"type":"integer","minimum":0},"concededLate":{"type":"integer","minimum":0}},"required":["matches","scored","scoredLate","conceded","concededLate"]}},"required":["fromMinute","home","away"]},"oddsMoves":{"type":"array","items":{"type":"object","properties":{"minute":{"type":"integer","minimum":0},"outcome":{"type":"string","enum":["home","draw","away"]},"from":{"type":"number","minimum":0,"maximum":1},"to":{"type":"number","minimum":0,"maximum":1},"cause":{"type":"string","enum":["goal","red","none"]},"side":{"type":"string","enum":["home","away"]}},"required":["minute","outcome","from","to","cause"]}},"recap":{"type":"object","properties":{"ro":{"type":"string","minLength":1},"en":{"type":"string","minLength":1},"source":{"type":"string","enum":["agent","template"]},"at":{"type":"string","format":"date-time"}},"required":["ro","en","source","at"]},"why":{"type":"object","properties":{"factors":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["strength","attack","defence","home","form","market"]},"side":{"type":"string","enum":["home","away","neutral"]},"value":{"type":"number"}},"required":["key","side"]},"maxItems":3},"record":{"type":"object","properties":{"n":{"type":"integer","minimum":0},"hits":{"type":"integer","minimum":0},"hitRate":{"type":"number","minimum":0,"maximum":1},"ci":{"type":"object","properties":{"low":{"type":"number","minimum":0,"maximum":1},"high":{"type":"number","minimum":0,"maximum":1}},"required":["low","high"]},"from":{"type":"string","format":"date-time"}},"required":["n","hits","hitRate","ci"]},"gated":{"type":"boolean","default":false}},"required":["factors"]},"winProbability":{"type":"object","properties":{"minute":{"type":"integer","minimum":0,"maximum":90},"home":{"type":"number","minimum":0,"maximum":1},"draw":{"type":"number","minimum":0,"maximum":1},"away":{"type":"number","minimum":0,"maximum":1},"prior":{"type":"string","enum":["market","model"]},"model":{"type":"string","minLength":1},"nextGoal":{"type":"object","properties":{"home":{"type":"number","minimum":0,"maximum":1},"none":{"type":"number","minimum":0,"maximum":1},"away":{"type":"number","minimum":0,"maximum":1}},"required":["home","none","away"]},"over":{"type":"array","items":{"type":"object","properties":{"line":{"type":"number","exclusiveMinimum":0},"p":{"type":"number","minimum":0,"maximum":1}},"required":["line","p"]}},"comeback":{"type":"object","properties":{"side":{"type":"string","enum":["home","away"]},"deficit":{"type":"integer","minimum":1,"maximum":3},"win":{"type":"number","minimum":0,"maximum":1},"draw":{"type":"number","minimum":0,"maximum":1},"history":{"type":"object","properties":{"fromMinute":{"type":"integer","minimum":0,"maximum":90},"n":{"type":"integer","minimum":0},"notLost":{"type":"integer","minimum":0},"won":{"type":"integer","minimum":0},"rate":{"type":"number","minimum":0,"maximum":1},"ci":{"type":"object","properties":{"low":{"type":"number","minimum":0,"maximum":1},"high":{"type":"number","minimum":0,"maximum":1}},"required":["low","high"]}},"required":["fromMinute","n","notLost","won","rate","ci"]}},"required":["side","deficit","win","draw"]}},"required":["minute","home","draw","away","prior","model"]},"liveChances":{"type":"object","properties":{"model":{"type":"string","minLength":1},"prior":{"type":"string","enum":["market","model"]},"final":{"type":"boolean"},"points":{"type":"array","items":{"type":"object","properties":{"minute":{"type":"integer","minimum":0,"maximum":90},"home":{"type":"number","minimum":0,"maximum":1},"draw":{"type":"number","minimum":0,"maximum":1},"away":{"type":"number","minimum":0,"maximum":1}},"required":["minute","home","draw","away"]},"minItems":1},"markers":{"type":"array","items":{"type":"object","properties":{"minute":{"type":"integer","minimum":0,"maximum":90},"kind":{"type":"string","enum":["goal","red"]},"side":{"type":"string","enum":["home","away"]}},"required":["minute","kind","side"]}},"swing":{"type":"object","properties":{"minute":{"type":"integer","minimum":0,"maximum":90},"outcome":{"type":"string","enum":["home","draw","away"]},"from":{"type":"number","minimum":0,"maximum":1},"to":{"type":"number","minimum":0,"maximum":1}},"required":["minute","outcome","from","to"]},"market":{"type":"object","properties":{"points":{"type":"array","items":{"type":"object","properties":{"minute":{"type":"integer","minimum":0,"maximum":90},"home":{"type":"number","minimum":0,"maximum":1},"draw":{"type":"number","minimum":0,"maximum":1},"away":{"type":"number","minimum":0,"maximum":1}},"required":["minute","home","draw","away"]},"minItems":1},"sources":{"type":"array","items":{"type":"string","minLength":1}},"gap":{"type":"object","properties":{"minute":{"type":"integer","minimum":0,"maximum":90},"home":{"type":"number"},"draw":{"type":"number"},"away":{"type":"number"}},"required":["minute","home","draw","away"]}},"required":["points","sources"]}},"required":["model","prior","final","points","markers"]},"scenarios":{"type":"object","properties":{"model":{"type":"string","minLength":1},"prior":{"type":"string","enum":["market","model"]},"base":{"type":"object","properties":{"home":{"type":"number","minimum":0,"maximum":1},"draw":{"type":"number","minimum":0,"maximum":1},"away":{"type":"number","minimum":0,"maximum":1}},"required":["home","draw","away"]},"firstGoal":{"type":"object","properties":{"home":{"type":"number","minimum":0,"maximum":1},"none":{"type":"number","minimum":0,"maximum":1},"away":{"type":"number","minimum":0,"maximum":1}},"required":["home","none","away"]},"scenarios":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["homeFirst15","awayFirst15","goallessHalf","homeFirst60","awayFirst60","homeRed30","awayRed30"]},"minute":{"type":"integer","minimum":0,"maximum":90},"homeGoals":{"type":"integer","minimum":0},"awayGoals":{"type":"integer","minimum":0},"homeReds":{"type":"integer","minimum":0},"awayReds":{"type":"integer","minimum":0},"home":{"type":"number","minimum":0,"maximum":1},"draw":{"type":"number","minimum":0,"maximum":1},"away":{"type":"number","minimum":0,"maximum":1}},"required":["id","minute","homeGoals","awayGoals","homeReds","awayReds","home","draw","away"]}}},"required":["model","prior","base","firstGoal","scenarios"]},"headline":{"type":"object","properties":{"market":{"type":"object","properties":{"home":{"type":"number","minimum":0,"maximum":1},"draw":{"type":"number","minimum":0,"maximum":1},"away":{"type":"number","minimum":0,"maximum":1}},"required":["home","draw","away"]},"basis":{"type":"string","enum":["current","T-5","T-60","latest"]},"observedAt":{"type":"string","format":"date-time"},"disagreement":{"type":"object","properties":{"outcome":{"type":"string","enum":["home","draw","away"]},"direction":{"type":"string","enum":["up","down"]},"model":{"type":"number","minimum":0,"maximum":1},"market":{"type":"number","minimum":0,"maximum":1},"closer":{"type":"string","enum":["model","market","level"]},"predictedAt":{"type":"string","format":"date-time"}},"required":["outcome","direction","model","market"]},"gated":{"type":"boolean","default":false}},"required":["market","basis"]},"broadcast":{"type":"object","properties":{"channel":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"observedAt":{"type":"string","format":"date-time"}},"required":["channel","source","observedAt"]},"scoreDetail":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1},"home":{"type":"number"},"away":{"type":"number"}},"required":["label","home","away"]}}},"required":["match","home","away","competition","headToHead","form","table","odds","stats","momentum","scoreDetail"]}}}},"400":{"description":"Invalid id","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Match not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions":{"get":{"tags":["match-center"],"summary":"Competitions with listed matches","responses":{"200":{"description":"Competitions","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"sport":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"country":{"type":"string","minLength":1},"tier":{"type":"integer"},"season":{"type":"string","minLength":1},"matches":{"type":"integer","minimum":0}},"required":["slug","name","sport","matches"]}}},"required":["items"]}}}}}}},"/v1/competitions/{slug}":{"get":{"tags":["match-center"],"summary":"Competition table (latest season), upcoming and recent matches","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Competition","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"sport":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"country":{"type":"string","minLength":1},"tier":{"type":"integer"},"season":{"type":"string","minLength":1},"matches":{"type":"integer","minimum":0}},"required":["slug","name","sport","matches"]},"table":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","exclusiveMinimum":0},"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"played":{"type":"integer","minimum":0},"won":{"type":"integer","minimum":0},"drawn":{"type":"integer","minimum":0},"lost":{"type":"integer","minimum":0},"goalsFor":{"type":"integer","minimum":0},"goalsAgainst":{"type":"integer","minimum":0},"goalDifference":{"type":"integer"},"points":{"type":"integer","minimum":0},"pointsAdjustment":{"type":"integer"},"form":{"type":"array","items":{"type":"string","enum":["W","D","L"]}}},"required":["position","team","played","won","drawn","lost","goalsFor","goalsAgainst","goalDifference","points","form"]}},"tableCoverage":{"type":"object","properties":{"since":{"type":"string","format":"date-time"},"matches":{"type":"integer","exclusiveMinimum":0}},"required":["since","matches"]},"upcoming":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}}},"required":["competition","table","upcoming","recent"]}}}},"400":{"description":"Invalid slug","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Competition not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/teams/{id}":{"get":{"tags":["match-center"],"summary":"Team profile: form, recent/upcoming matches, home/away splits","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Team","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"sport":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"country":{"type":"string","minLength":1},"shortName":{"type":"string","minLength":1}},"required":["id","name","sport"]},"competitions":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]}},"form":{"type":"array","items":{"type":"string","enum":["W","D","L"]}},"form10":{"type":"array","items":{"type":"string","enum":["W","D","L"]}},"goals":{"type":"object","properties":{"n":{"type":"integer","minimum":0},"avgFor":{"type":"number","minimum":0},"avgAgainst":{"type":"number","minimum":0},"over25":{"type":"number","minimum":0,"maximum":1},"btts":{"type":"number","minimum":0,"maximum":1},"cleanSheets":{"type":"number","minimum":0,"maximum":1}},"required":["n","avgFor","avgAgainst","over25","btts","cleanSheets"]},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}},"upcoming":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}},"splits":{"type":"object","properties":{"home":{"type":"object","properties":{"played":{"type":"integer","minimum":0},"won":{"type":"integer","minimum":0},"drawn":{"type":"integer","minimum":0},"lost":{"type":"integer","minimum":0},"goalsFor":{"type":"integer","minimum":0},"goalsAgainst":{"type":"integer","minimum":0}},"required":["played","won","drawn","lost","goalsFor","goalsAgainst"]},"away":{"type":"object","properties":{"played":{"type":"integer","minimum":0},"won":{"type":"integer","minimum":0},"drawn":{"type":"integer","minimum":0},"lost":{"type":"integer","minimum":0},"goalsFor":{"type":"integer","minimum":0},"goalsAgainst":{"type":"integer","minimum":0}},"required":["played","won","drawn","lost","goalsFor","goalsAgainst"]}},"required":["home","away"]}},"required":["team","competitions","form","recent","upcoming","splits"]}}}},"400":{"description":"Invalid id","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Team not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/community/events/{eventId}/comments":{"get":{"tags":["community"],"summary":"Visible comments of a match (newest first, one level of replies)","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"eventId","in":"path"},{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Comments","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"parentId":{"type":["string","null"]},"author":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"body":{"type":"string"},"live":{"type":"boolean"},"minute":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","enum":["👍","🔥","😂","😮"]},"count":{"type":"integer","minimum":0},"mine":{"type":"boolean"}},"required":["emoji","count","mine"]}},"mine":{"type":"boolean"},"status":{"type":"string","enum":["visible","hidden","removed","pending"]},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"parentId":{"type":["string","null"]},"author":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"body":{"type":"string"},"live":{"type":"boolean"},"minute":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","enum":["👍","🔥","😂","😮"]},"count":{"type":"integer","minimum":0},"mine":{"type":"boolean"}},"required":["emoji","count","mine"]}},"mine":{"type":"boolean"},"status":{"type":"string","enum":["visible","hidden","removed","pending"]}},"required":["id","eventId","parentId","author","body","live","minute","createdAt","reactions","mine","status"]}}},"required":["id","eventId","parentId","author","body","live","minute","createdAt","reactions","mine","status","replies"]}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]}}}},"404":{"description":"Match not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["community"],"summary":"Post a comment or a reply","description":"Comments with links, bookmaker domains, phone numbers, e-mail addresses or banned wording are held for review (status pending). 5 per minute per user.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"eventId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":1000},"parentId":{"type":"string","pattern":"^\\d{1,15}$"}},"required":["body"]}}}},"responses":{"201":{"description":"Created comment","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"parentId":{"type":["string","null"]},"author":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"body":{"type":"string"},"live":{"type":"boolean"},"minute":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","enum":["👍","🔥","😂","😮"]},"count":{"type":"integer","minimum":0},"mine":{"type":"boolean"}},"required":["emoji","count","mine"]}},"mine":{"type":"boolean"},"status":{"type":"string","enum":["visible","hidden","removed","pending"]}},"required":["id","eventId","parentId","author","body","live","minute","createdAt","reactions","mine","status"]}}}},"400":{"description":"Invalid comment","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Account cannot post","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Match or parent comment not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many comments","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/community/comments/{id}":{"delete":{"tags":["community"],"summary":"Remove one of my comments","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Removed"},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Comment not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/community/comments/{id}/reactions":{"post":{"tags":["community"],"summary":"Toggle a reaction (👍 🔥 😂 😮)","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emoji":{"type":"string","enum":["👍","🔥","😂","😮"]}},"required":["emoji"]}}}},"responses":{"200":{"description":"Reactions","content":{"application/json":{"schema":{"type":"object","properties":{"commentId":{"type":"string"},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","enum":["👍","🔥","😂","😮"]},"count":{"type":"integer","minimum":0},"mine":{"type":"boolean"}},"required":["emoji","count","mine"]}}},"required":["commentId","reactions"]}}}},"400":{"description":"Invalid reaction","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Account cannot react","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Comment not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/community/latest":{"get":{"tags":["community"],"summary":"Latest visible comments across matches","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":50,"default":30},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Latest comments","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"eventLabel":{"type":"string"},"author":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"body":{"type":"string"},"live":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","eventId","eventLabel","author","body","live","createdAt"]}}},"required":["items"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/community/ranking":{"get":{"tags":["community"],"summary":"Anonymous weekly ranking: the users vs the model vs the market","description":"One ISO week (Europe/Bucharest, Monday to Sunday): the mean Brier of the model, of the market close and of the best users over the same settled picks. A user appears only as a pseudonymous handle — no id, name, e-mail or individual pick is ever returned. Users with fewer than minPicks settled picks are counted but not listed.","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-W\\d{2}$"},"required":false,"name":"week","in":"query"}],"responses":{"200":{"description":"Weekly ranking","content":{"application/json":{"schema":{"type":"object","properties":{"week":{"type":"string"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"users":{"type":"array","items":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"maxLength":16},"brier":{"type":"number"},"picks":{"type":"integer","minimum":0},"rank":{"type":"integer","exclusiveMinimum":0}},"required":["handle","brier","picks","rank"]}},"participants":{"type":"integer","minimum":0},"ranked":{"type":"integer","minimum":0},"picks":{"type":"integer","minimum":0},"marketPicks":{"type":"integer","minimum":0},"modelPicks":{"type":"integer","minimum":0},"modelBrier":{"type":["number","null"]},"marketBrier":{"type":["number","null"]},"minPicks":{"type":"integer","exclusiveMinimum":0},"top":{"type":"integer","exclusiveMinimum":0},"updatedAt":{"type":"string","format":"date-time"}},"required":["week","from","to","users","participants","ranked","picks","marketPicks","modelPicks","modelBrier","marketBrier","minPicks","top","updatedAt"]}}}},"400":{"description":"Invalid or non-existent week","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/community/reports":{"post":{"tags":["community"],"summary":"Notice of illegal or abusive content (DSA art. 16)","description":"Signed-in or anonymous; anonymous notices need reporterEmail. Returns a reference.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","enum":["illegal_content","harassment","spam","integrity_accusation","other"]},"details":{"type":"string","minLength":10,"maxLength":2000},"commentId":{"type":"string","pattern":"^\\d{1,15}$"},"reporterEmail":{"type":"string","maxLength":254,"format":"email"},"goodFaith":{"type":"boolean","enum":[true]}},"required":["reason","details","goodFaith"]}}}},"responses":{"201":{"description":"Receipt","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"status":{"type":"string","enum":["open"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","reference","status","createdAt"]}}}},"400":{"description":"Invalid notice","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Comment not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many notices","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/community/moderation":{"get":{"tags":["community"],"summary":"Comments held for review and open notices","responses":{"200":{"description":"Queue","content":{"application/json":{"schema":{"type":"object","properties":{"pending":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"eventLabel":{"type":"string"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"body":{"type":"string"},"status":{"type":"string","enum":["visible","hidden","removed","pending"]},"flags":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","eventId","eventLabel","author","body","status","flags","createdAt"]}},"reports":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"reason":{"type":"string","enum":["illegal_content","harassment","spam","integrity_accusation","other"]},"details":{"type":["string","null"]},"anonymous":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"comment":{"type":["object","null"],"properties":{"id":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["visible","hidden","removed","pending"]},"authorName":{"type":"string"}},"required":["id","body","status","authorName"]}},"required":["id","reference","reason","details","anonymous","createdAt","comment"]}}},"required":["pending","reports"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Moderator role required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/community/moderation/{commentId}":{"post":{"tags":["community"],"summary":"Approve, hide or remove a comment","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"commentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["approve","hide","remove"]},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action","reason"]}}}},"responses":{"200":{"description":"New status","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["visible","hidden","removed","pending"]}},"required":["id","status"]}}}},"400":{"description":"Invalid action","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Moderator role required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Comment not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/community/reports/{id}/decide":{"post":{"tags":["community"],"summary":"Decide a notice with a statement of reasons (DSA art. 17)","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["removed","hidden","no_action"]},"statementOfReasons":{"type":"string","minLength":10,"maxLength":2000}},"required":["decision","statementOfReasons"]}}}},"responses":{"200":{"description":"Decision","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"status":{"type":"string","enum":["decided"]},"decision":{"type":"string","enum":["removed","hidden","no_action"]},"decidedAt":{"type":"string","format":"date-time"}},"required":["id","reference","status","decision","decidedAt"]}}}},"400":{"description":"Invalid decision","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Moderator role required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Notice not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Notice already decided","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/strategies":{"get":{"tags":["strategies"],"summary":"Published strategy library","responses":{"200":{"description":"Strategies","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"sport":{"type":["string","null"],"enum":["football","tennis","basketball","hockey","handball","esports",null]},"nameRo":{"type":"string"},"nameEn":{"type":"string"},"summaryRo":{"type":"string"},"summaryEn":{"type":"string"},"riskLevel":{"type":"integer","minimum":1,"maximum":5},"minPlan":{"type":"string","enum":["free","premium","pro"]},"kind":{"type":"string"},"backtestable":{"type":"boolean"}},"required":["slug","sport","nameRo","nameEn","summaryRo","summaryEn","riskLevel","minPlan","kind","backtestable"]}}},"required":["items"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["strategies"],"summary":"Create a strategy (admin)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"sport":{"type":["string","null"],"enum":["football","tennis","basketball","hockey","handball","esports",null],"default":null},"nameRo":{"type":"string","minLength":1,"maxLength":120},"nameEn":{"type":"string","minLength":1,"maxLength":120},"summaryRo":{"type":"string","minLength":1,"maxLength":600},"summaryEn":{"type":"string","minLength":1,"maxLength":600},"rules":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":60}},"required":["kind"],"additionalProperties":{}},"evidence":{"type":["string","null"],"maxLength":4000,"default":null},"riskLevel":{"type":"integer","minimum":1,"maximum":5,"default":3},"minPlan":{"type":"string","enum":["free","premium","pro"],"default":"free"},"published":{"type":"boolean","default":false}},"required":["slug","nameRo","nameEn","summaryRo","summaryEn","rules"],"additionalProperties":false}}}},"responses":{"201":{"description":"Strategy","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"sport":{"type":["string","null"],"enum":["football","tennis","basketball","hockey","handball","esports",null]},"nameRo":{"type":"string"},"nameEn":{"type":"string"},"summaryRo":{"type":"string"},"summaryEn":{"type":"string"},"riskLevel":{"type":"integer","minimum":1,"maximum":5},"minPlan":{"type":"string","enum":["free","premium","pro"]},"kind":{"type":"string"},"backtestable":{"type":"boolean"},"evidence":{"type":["string","null"]},"rules":{"type":"object","additionalProperties":{}},"backtest":{"type":["object","null"],"properties":{"id":{"type":"integer"},"finishedAt":{"type":"string"},"metrics":{"type":"object","properties":{"n":{"type":["integer","null"]},"roi":{"type":["number","null"]},"clv":{"type":["number","null"]},"hitRate":{"type":["number","null"]},"maxDrawdown":{"type":["number","null"]}},"required":["n","roi","clv","hitRate","maxDrawdown"]}},"required":["id","finishedAt","metrics"]},"id":{"type":"integer"},"published":{"type":"boolean"}},"required":["slug","sport","nameRo","nameEn","summaryRo","summaryEn","riskLevel","minPlan","kind","backtestable","evidence","rules","backtest","id","published"]}}}},"400":{"description":"Invalid strategy","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Admin role required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Slug already exists","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/strategies/{slug}":{"get":{"tags":["strategies"],"summary":"One published strategy with the latest finished backtest (or null)","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Strategy","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"sport":{"type":["string","null"],"enum":["football","tennis","basketball","hockey","handball","esports",null]},"nameRo":{"type":"string"},"nameEn":{"type":"string"},"summaryRo":{"type":"string"},"summaryEn":{"type":"string"},"riskLevel":{"type":"integer","minimum":1,"maximum":5},"minPlan":{"type":"string","enum":["free","premium","pro"]},"kind":{"type":"string"},"backtestable":{"type":"boolean"},"evidence":{"type":["string","null"]},"rules":{"type":"object","additionalProperties":{}},"backtest":{"type":["object","null"],"properties":{"id":{"type":"integer"},"finishedAt":{"type":"string"},"metrics":{"type":"object","properties":{"n":{"type":["integer","null"]},"roi":{"type":["number","null"]},"clv":{"type":["number","null"]},"hitRate":{"type":["number","null"]},"maxDrawdown":{"type":["number","null"]}},"required":["n","roi","clv","hitRate","maxDrawdown"]}},"required":["id","finishedAt","metrics"]}},"required":["slug","sport","nameRo","nameEn","summaryRo","summaryEn","riskLevel","minPlan","kind","backtestable","evidence","rules","backtest"]}}}},"404":{"description":"Strategy not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"patch":{"tags":["strategies"],"summary":"Edit or (un)publish a strategy (admin)","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sport":{"type":["string","null"],"enum":["football","tennis","basketball","hockey","handball","esports",null]},"nameRo":{"type":"string","minLength":1,"maxLength":120},"nameEn":{"type":"string","minLength":1,"maxLength":120},"summaryRo":{"type":"string","minLength":1,"maxLength":600},"summaryEn":{"type":"string","minLength":1,"maxLength":600},"rules":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":60}},"required":["kind"],"additionalProperties":{}},"evidence":{"type":["string","null"],"maxLength":4000},"riskLevel":{"type":"integer","minimum":1,"maximum":5},"minPlan":{"type":"string","enum":["free","premium","pro"]},"published":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Strategy","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"sport":{"type":["string","null"],"enum":["football","tennis","basketball","hockey","handball","esports",null]},"nameRo":{"type":"string"},"nameEn":{"type":"string"},"summaryRo":{"type":"string"},"summaryEn":{"type":"string"},"riskLevel":{"type":"integer","minimum":1,"maximum":5},"minPlan":{"type":"string","enum":["free","premium","pro"]},"kind":{"type":"string"},"backtestable":{"type":"boolean"},"evidence":{"type":["string","null"]},"rules":{"type":"object","additionalProperties":{}},"backtest":{"type":["object","null"],"properties":{"id":{"type":"integer"},"finishedAt":{"type":"string"},"metrics":{"type":"object","properties":{"n":{"type":["integer","null"]},"roi":{"type":["number","null"]},"clv":{"type":["number","null"]},"hitRate":{"type":["number","null"]},"maxDrawdown":{"type":["number","null"]}},"required":["n","roi","clv","hitRate","maxDrawdown"]}},"required":["id","finishedAt","metrics"]},"id":{"type":"integer"},"published":{"type":"boolean"}},"required":["slug","sport","nameRo","nameEn","summaryRo","summaryEn","riskLevel","minPlan","kind","backtestable","evidence","rules","backtest","id","published"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Admin role required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Strategy not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/strategies/{slug}/backtest":{"post":{"tags":["strategies"],"summary":"Run a backtest. Empty body = the precomputed default run (any plan that may open the strategy); custom parameters need Pro (backtest.custom).","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"staking":{"type":"string","enum":["flat","proportional","kelly","martingale"]},"stakePct":{"type":"number","minimum":0.001,"maximum":0.1},"kellyFraction":{"type":"number","minimum":0.125,"maximum":0.25},"kellyCap":{"type":"number","minimum":0.001,"maximum":0.05},"multiplier":{"type":"number","minimum":1.5,"maximum":3},"minEdge":{"type":"number","minimum":0,"maximum":0.5},"shrinkage":{"type":"number","minimum":0,"maximum":1},"bankroll":{"type":"number","minimum":10,"maximum":10000000},"ruinLevel":{"type":"number","minimum":0,"maximum":0.9},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"paths":{"type":"integer","minimum":100,"maximum":2000},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"mode":{"type":"string","enum":["bootstrap","market"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Default run (existing or just computed)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"strategy":{"type":"string"},"status":{"type":"string","enum":["queued","running","finished","failed"]},"custom":{"type":"boolean"},"params":{"type":"object","additionalProperties":{}},"metrics":{"type":"object","properties":{"n":{"type":["integer","null"]},"roi":{"type":["number","null"]},"clv":{"type":["number","null"]},"hitRate":{"type":["number","null"]},"maxDrawdown":{"type":["number","null"]},"yield":{"type":["number","null"]},"profit":{"type":["number","null"]},"staked":{"type":["number","null"]},"initialBankroll":{"type":["number","null"]},"finalBankroll":{"type":["number","null"]},"ruinProbability":{"type":["number","null"]},"events":{"type":["integer","null"]}},"required":["n","roi","clv","hitRate","maxDrawdown","yield","profit","staked","initialBankroll","finalBankroll","ruinProbability","events"]},"curve":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer"},"at":{"type":["string","null"]},"bankroll":{"type":"number"},"drawdown":{"type":"number"}},"required":["step","at","bankroll","drawdown"]}},"monteCarlo":{"type":["object","null"],"properties":{"paths":{"type":"integer"},"seed":{"type":"integer"},"mode":{"type":"string","enum":["bootstrap","market"]},"ruinProbability":{"type":"number"},"final":{"type":"object","properties":{"p5":{"type":"number"},"p25":{"type":"number"},"p50":{"type":"number"},"p75":{"type":"number"},"p95":{"type":"number"}},"required":["p5","p25","p50","p75","p95"]},"fan":{"type":"array","items":{"type":"object","properties":{"p5":{"type":"number"},"p25":{"type":"number"},"p50":{"type":"number"},"p75":{"type":"number"},"p95":{"type":"number"},"step":{"type":"integer"}},"required":["p5","p25","p50","p75","p95","step"]}}},"required":["paths","seed","mode","ruinProbability","final","fan"]},"skipped":{"type":"object","additionalProperties":{"type":"number"}},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","strategy","status","custom","params","metrics","curve","monteCarlo","skipped","error","createdAt","finishedAt"]}}}},"201":{"description":"Custom run","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"strategy":{"type":"string"},"status":{"type":"string","enum":["queued","running","finished","failed"]},"custom":{"type":"boolean"},"params":{"type":"object","additionalProperties":{}},"metrics":{"type":"object","properties":{"n":{"type":["integer","null"]},"roi":{"type":["number","null"]},"clv":{"type":["number","null"]},"hitRate":{"type":["number","null"]},"maxDrawdown":{"type":["number","null"]},"yield":{"type":["number","null"]},"profit":{"type":["number","null"]},"staked":{"type":["number","null"]},"initialBankroll":{"type":["number","null"]},"finalBankroll":{"type":["number","null"]},"ruinProbability":{"type":["number","null"]},"events":{"type":["integer","null"]}},"required":["n","roi","clv","hitRate","maxDrawdown","yield","profit","staked","initialBankroll","finalBankroll","ruinProbability","events"]},"curve":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer"},"at":{"type":["string","null"]},"bankroll":{"type":"number"},"drawdown":{"type":"number"}},"required":["step","at","bankroll","drawdown"]}},"monteCarlo":{"type":["object","null"],"properties":{"paths":{"type":"integer"},"seed":{"type":"integer"},"mode":{"type":"string","enum":["bootstrap","market"]},"ruinProbability":{"type":"number"},"final":{"type":"object","properties":{"p5":{"type":"number"},"p25":{"type":"number"},"p50":{"type":"number"},"p75":{"type":"number"},"p95":{"type":"number"}},"required":["p5","p25","p50","p75","p95"]},"fan":{"type":"array","items":{"type":"object","properties":{"p5":{"type":"number"},"p25":{"type":"number"},"p50":{"type":"number"},"p75":{"type":"number"},"p95":{"type":"number"},"step":{"type":"integer"}},"required":["p5","p25","p50","p75","p95","step"]}}},"required":["paths","seed","mode","ruinProbability","final","fan"]},"skipped":{"type":"object","additionalProperties":{"type":"number"}},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","strategy","status","custom","params","metrics","curve","monteCarlo","skipped","error","createdAt","finishedAt"]}}}},"400":{"description":"Invalid parameters","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required (custom runs, premium strategies)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"Plan does not include this strategy or custom backtests","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Strategy not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"Strategy rules cannot be backtested","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/backtests/{id}":{"get":{"tags":["strategies"],"summary":"One backtest run: metrics, equity curve, Monte Carlo fan. Custom runs: owner (or admin) only.","parameters":[{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Run","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"strategy":{"type":"string"},"status":{"type":"string","enum":["queued","running","finished","failed"]},"custom":{"type":"boolean"},"params":{"type":"object","additionalProperties":{}},"metrics":{"type":"object","properties":{"n":{"type":["integer","null"]},"roi":{"type":["number","null"]},"clv":{"type":["number","null"]},"hitRate":{"type":["number","null"]},"maxDrawdown":{"type":["number","null"]},"yield":{"type":["number","null"]},"profit":{"type":["number","null"]},"staked":{"type":["number","null"]},"initialBankroll":{"type":["number","null"]},"finalBankroll":{"type":["number","null"]},"ruinProbability":{"type":["number","null"]},"events":{"type":["integer","null"]}},"required":["n","roi","clv","hitRate","maxDrawdown","yield","profit","staked","initialBankroll","finalBankroll","ruinProbability","events"]},"curve":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer"},"at":{"type":["string","null"]},"bankroll":{"type":"number"},"drawdown":{"type":"number"}},"required":["step","at","bankroll","drawdown"]}},"monteCarlo":{"type":["object","null"],"properties":{"paths":{"type":"integer"},"seed":{"type":"integer"},"mode":{"type":"string","enum":["bootstrap","market"]},"ruinProbability":{"type":"number"},"final":{"type":"object","properties":{"p5":{"type":"number"},"p25":{"type":"number"},"p50":{"type":"number"},"p75":{"type":"number"},"p95":{"type":"number"}},"required":["p5","p25","p50","p75","p95"]},"fan":{"type":"array","items":{"type":"object","properties":{"p5":{"type":"number"},"p25":{"type":"number"},"p50":{"type":"number"},"p75":{"type":"number"},"p95":{"type":"number"},"step":{"type":"integer"}},"required":["p5","p25","p50","p75","p95","step"]}}},"required":["paths","seed","mode","ruinProbability","final","fan"]},"skipped":{"type":"object","additionalProperties":{"type":"number"}},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","strategy","status","custom","params","metrics","curve","monteCarlo","skipped","error","createdAt","finishedAt"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"Plan does not include this strategy","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Run not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/strategies/{slug}/export.csv":{"get":{"tags":["strategies"],"summary":"Picks of the default backtest run as CSV (Pro: export)","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"CSV","content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"Export requires Pro","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Strategy not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"Strategy rules cannot be backtested","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/backtests/{id}/export.csv":{"get":{"tags":["strategies"],"summary":"Picks of one backtest run as CSV (Pro: export)","parameters":[{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"CSV","content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"Export requires Pro","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Run not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/site":{"get":{"tags":["site"],"summary":"Public site status: admin maintenance banner and the global value switch","responses":{"200":{"description":"Site status","content":{"application/json":{"schema":{"type":"object","properties":{"maintenanceBanner":{"type":["string","null"],"minLength":1,"maxLength":280},"valueEnabled":{"type":"boolean"},"billingEnabled":{"type":"boolean"},"honestyCounterEnabled":{"type":"boolean"},"noiseHelperEnabled":{"type":"boolean"}},"required":["maintenanceBanner","valueEnabled"]}}}}}}},"/v1/billing/status":{"get":{"tags":["billing"],"summary":"Whether paid checkout is open (D44); false = free public beta, signed-in users get Premium (D52)","responses":{"200":{"description":"Billing status","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}}}}},"/v1/me/entitlements":{"get":{"tags":["account"],"summary":"My plan, the capabilities it grants and today’s assistant usage (D23)","description":"The server enforces every capability; clients only render this answer.","responses":{"200":{"description":"Entitlements","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["free","premium","pro"]},"capabilities":{"type":"array","items":{"type":"string","enum":["predictions.full","strategies.premium","bankroll.advanced","alerts","integrity.signals","backtest.custom","export","cockpit","ai_tickets","api.access"]}},"assistant":{"type":"object","properties":{"limit":{"type":["integer","null"]},"used":{"type":"integer"},"resetsAt":{"type":"string","format":"date-time"}},"required":["limit","used","resetsAt"]}},"required":["plan","capabilities","assistant"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/preferences":{"get":{"tags":["account"],"summary":"My preferences (theme, locale, odds format, stats-only mode, favourites, notification channels)","responses":{"200":{"description":"Preferences","content":{"application/json":{"schema":{"type":"object","properties":{"surface":{"type":"string","enum":["system","dark","light","oled","dim"]},"accent":{"type":"string","enum":["amber","mint","cobalt","coral","violet"]},"locale":{"type":"string","enum":["ro","en"]},"oddsFormat":{"type":"string","enum":["decimal","fractional","american"]},"statsOnly":{"type":"boolean"},"favouriteCompetitions":{"type":"array","items":{"type":"string","pattern":"^\\d{1,18}$"},"maxItems":50},"favouriteTeams":{"type":"array","items":{"type":"string","pattern":"^\\d{1,18}$"},"maxItems":100},"notifications":{"type":"object","properties":{"email":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]},"push":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]},"inApp":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]},"telegram":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]}},"required":["email","push","inApp","telegram"]},"quietHours":{"type":"object","properties":{"enabled":{"type":"boolean"},"start":{"type":"integer","minimum":0,"maximum":23},"end":{"type":"integer","minimum":0,"maximum":23}},"required":["enabled","start","end"]},"digest":{"type":"object","properties":{"email":{"type":"boolean"},"telegram":{"type":"boolean"}},"required":["email","telegram"]},"community":{"type":"object","properties":{"ranking":{"type":"boolean"}},"required":["ranking"]}},"required":["surface","accent","locale","oddsFormat","statsOnly","favouriteCompetitions","favouriteTeams","notifications","quietHours","digest","community"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"put":{"tags":["account"],"summary":"Update my preferences (any subset; merged over the stored ones)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"surface":{"type":"string","enum":["system","dark","light","oled","dim"]},"accent":{"type":"string","enum":["amber","mint","cobalt","coral","violet"]},"locale":{"type":"string","enum":["ro","en"]},"oddsFormat":{"type":"string","enum":["decimal","fractional","american"]},"statsOnly":{"type":"boolean"},"favouriteCompetitions":{"type":"array","items":{"type":"string","pattern":"^\\d{1,18}$"},"maxItems":50},"favouriteTeams":{"type":"array","items":{"type":"string","pattern":"^\\d{1,18}$"},"maxItems":100},"notifications":{"type":"object","properties":{"email":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}}},"push":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}}},"inApp":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}}},"telegram":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}}}}},"quietHours":{"type":"object","properties":{"enabled":{"type":"boolean"},"start":{"type":"integer","minimum":0,"maximum":23},"end":{"type":"integer","minimum":0,"maximum":23}}},"digest":{"type":"object","properties":{"email":{"type":"boolean"},"telegram":{"type":"boolean"}}},"community":{"type":"object","properties":{"ranking":{"type":"boolean"}}}}}}}},"responses":{"200":{"description":"Preferences","content":{"application/json":{"schema":{"type":"object","properties":{"surface":{"type":"string","enum":["system","dark","light","oled","dim"]},"accent":{"type":"string","enum":["amber","mint","cobalt","coral","violet"]},"locale":{"type":"string","enum":["ro","en"]},"oddsFormat":{"type":"string","enum":["decimal","fractional","american"]},"statsOnly":{"type":"boolean"},"favouriteCompetitions":{"type":"array","items":{"type":"string","pattern":"^\\d{1,18}$"},"maxItems":50},"favouriteTeams":{"type":"array","items":{"type":"string","pattern":"^\\d{1,18}$"},"maxItems":100},"notifications":{"type":"object","properties":{"email":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]},"push":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]},"inApp":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]},"telegram":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]}},"required":["email","push","inApp","telegram"]},"quietHours":{"type":"object","properties":{"enabled":{"type":"boolean"},"start":{"type":"integer","minimum":0,"maximum":23},"end":{"type":"integer","minimum":0,"maximum":23}},"required":["enabled","start","end"]},"digest":{"type":"object","properties":{"email":{"type":"boolean"},"telegram":{"type":"boolean"}},"required":["email","telegram"]},"community":{"type":"object","properties":{"ranking":{"type":"boolean"}},"required":["ranking"]}},"required":["surface","accent","locale","oddsFormat","statsOnly","favouriteCompetitions","favouriteTeams","notifications","quietHours","digest","community"]}}}},"400":{"description":"Invalid preferences","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/follows":{"get":{"tags":["account"],"summary":"Teams and competitions I follow","responses":{"200":{"description":"Follows","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"targetType":{"type":"string","enum":["participant","competition"]},"targetId":{"type":"string"},"name":{"type":["string","null"]},"slug":{"type":["string","null"]},"notify":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["targetType","targetId","name","slug","notify","createdAt"]}}},"required":["items"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["account"],"summary":"Follow a team or competition (idempotent)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"targetType":{"type":"string","enum":["participant","competition"]},"targetId":{"type":"string","pattern":"^(\\d{1,18}|[a-z0-9][a-z0-9-]{0,63})$"}},"required":["targetType","targetId"]}}}},"responses":{"200":{"description":"Follows","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"targetType":{"type":"string","enum":["participant","competition"]},"targetId":{"type":"string"},"name":{"type":["string","null"]},"slug":{"type":["string","null"]},"notify":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["targetType","targetId","name","slug","notify","createdAt"]}}},"required":["items"]}}}},"400":{"description":"Invalid target","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Team or competition not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Too many follows","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["account"],"summary":"Stop following a team or competition","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"targetType":{"type":"string","enum":["participant","competition"]},"targetId":{"type":"string","pattern":"^(\\d{1,18}|[a-z0-9][a-z0-9-]{0,63})$"}},"required":["targetType","targetId"]}}}},"responses":{"200":{"description":"Follows","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"targetType":{"type":"string","enum":["participant","competition"]},"targetId":{"type":"string"},"name":{"type":["string","null"]},"slug":{"type":["string","null"]},"notify":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["targetType","targetId","name","slug","notify","createdAt"]}}},"required":["items"]}}}},"400":{"description":"Invalid target","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/export":{"get":{"tags":["account"],"summary":"Download everything MarcAI stores about me (GDPR art. 15 / 20)","responses":{"200":{"description":"Account export","content":{"application/json":{"schema":{"type":"object","properties":{"exportedAt":{"type":"string","format":"date-time"},"user":{"type":"object","additionalProperties":{}},"preferences":{"type":"object","properties":{"surface":{"type":"string","enum":["system","dark","light","oled","dim"]},"accent":{"type":"string","enum":["amber","mint","cobalt","coral","violet"]},"locale":{"type":"string","enum":["ro","en"]},"oddsFormat":{"type":"string","enum":["decimal","fractional","american"]},"statsOnly":{"type":"boolean"},"favouriteCompetitions":{"type":"array","items":{"type":"string","pattern":"^\\d{1,18}$"},"maxItems":50},"favouriteTeams":{"type":"array","items":{"type":"string","pattern":"^\\d{1,18}$"},"maxItems":100},"notifications":{"type":"object","properties":{"email":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]},"push":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]},"inApp":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]},"telegram":{"type":"object","properties":{"kickoff":{"type":"boolean"},"lineup":{"type":"boolean"},"goal":{"type":"boolean"},"final":{"type":"boolean"},"value":{"type":"boolean"},"opening":{"type":"boolean"},"steam":{"type":"boolean"},"swing":{"type":"boolean"},"unusual":{"type":"boolean"},"jump":{"type":"boolean"},"reply":{"type":"boolean"}},"required":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply"]}},"required":["email","push","inApp","telegram"]},"quietHours":{"type":"object","properties":{"enabled":{"type":"boolean"},"start":{"type":"integer","minimum":0,"maximum":23},"end":{"type":"integer","minimum":0,"maximum":23}},"required":["enabled","start","end"]},"digest":{"type":"object","properties":{"email":{"type":"boolean"},"telegram":{"type":"boolean"}},"required":["email","telegram"]},"community":{"type":"object","properties":{"ranking":{"type":"boolean"}},"required":["ranking"]}},"required":["surface","accent","locale","oddsFormat","statsOnly","favouriteCompetitions","favouriteTeams","notifications","quietHours","digest","community"]},"follows":{"type":"array","items":{"type":"object","properties":{"targetType":{"type":"string","enum":["participant","competition"]},"targetId":{"type":"string"},"name":{"type":["string","null"]},"slug":{"type":["string","null"]},"notify":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["targetType","targetId","name","slug","notify","createdAt"]}},"subscriptions":{"type":"array","items":{"type":"object","additionalProperties":{}}},"tickets":{"type":"array","items":{"type":"object","additionalProperties":{}}},"picks":{"type":"array","items":{"type":"object","additionalProperties":{}}},"comments":{"type":"array","items":{"type":"object","additionalProperties":{}}},"assistantThreads":{"type":"array","items":{"type":"object","additionalProperties":{}}},"notifications":{"type":"array","items":{"type":"object","additionalProperties":{}}},"pushDevices":{"type":"array","items":{"type":"object","additionalProperties":{}}},"telegram":{"type":["object","null"],"additionalProperties":{}},"funnelEvents":{"type":"array","items":{"type":"object","additionalProperties":{}}},"limits":{"type":["object","null"],"additionalProperties":{}}},"required":["exportedAt","user","preferences","follows","subscriptions","tickets","picks","comments","assistantThreads","notifications","pushDevices","limits"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/notifications":{"get":{"tags":["notifications"],"summary":"My notification inbox (newest first, cursor pagination) with the unread count","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["1","true"]},"required":false,"name":"unread","in":"query"}],"responses":{"200":{"description":"Inbox page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["kickoff","lineup","goal","final","value","opening","steam","swing","unusual","jump","reply","system"]},"title":{"type":"string"},"body":{"type":"string"},"url":{"type":["string","null"]},"readAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","kind","title","body","url","readAt","createdAt"]}},"nextCursor":{"type":["string","null"]},"unread":{"type":"integer","minimum":0}},"required":["items","nextCursor","unread"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/notifications/read":{"post":{"tags":["notifications"],"summary":"Mark some (ids) or all of my notifications as read","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","pattern":"^\\d{1,18}$"},"minItems":1,"maxItems":100}},"required":["ids"]},{"type":"object","properties":{"all":{"type":"boolean","enum":[true]}},"required":["all"]}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer"},"unread":{"type":"integer"}},"required":["updated","unread"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/push/vapid-key":{"get":{"tags":["notifications"],"summary":"VAPID application server key for Web Push (null when push is not configured)","responses":{"200":{"description":"VAPID public key","content":{"application/json":{"schema":{"type":"object","properties":{"publicKey":{"type":["string","null"]}},"required":["publicKey"]}}}}}}},"/v1/push/subscriptions":{"post":{"tags":["notifications"],"summary":"Register this browser for Web Push (idempotent per endpoint)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string","maxLength":2048,"format":"uri"},"keys":{"type":"object","properties":{"p256dh":{"type":"string","minLength":1,"maxLength":256},"auth":{"type":"string","minLength":1,"maxLength":64}},"required":["p256dh","auth"]}},"required":["endpoint","keys"]}}}},"responses":{"204":{"description":"Registered"},"400":{"description":"Invalid subscription","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Too many devices","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["notifications"],"summary":"Remove this browser’s Web Push subscription","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string","maxLength":2048,"format":"uri"}},"required":["endpoint"]}}}},"responses":{"204":{"description":"Removed"},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/push/devices":{"post":{"tags":["notifications"],"summary":"Register this phone’s push token (Android FCM id, or iOS APNs token + environment; idempotent per token)","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"platform":{"type":"string","enum":["android"]},"token":{"type":"string","minLength":16,"maxLength":4096,"pattern":"^[\\w:.-]+$"}},"required":["platform","token"]},{"type":"object","properties":{"platform":{"type":"string","enum":["ios"]},"token":{"type":"string","minLength":64,"maxLength":400,"pattern":"^[0-9a-fA-F]+$"},"environment":{"type":"string","enum":["production","sandbox"],"default":"production"}},"required":["platform","token"]}]}}}},"responses":{"204":{"description":"Registered"},"400":{"description":"Invalid token","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Too many devices","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["notifications"],"summary":"Remove this phone’s push token (sign-out, push turned off)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":16,"maxLength":4096,"pattern":"^[\\w:.-]+$"}},"required":["token"]}}}},"responses":{"204":{"description":"Removed"},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/push/live-activities":{"post":{"tags":["notifications"],"summary":"Register the push-to-update token of a match Live Activity (iOS; idempotent per token)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"matchId":{"type":"string","pattern":"^\\d{1,15}$"},"token":{"type":"string","minLength":64,"maxLength":400,"pattern":"^[0-9a-fA-F]+$"},"environment":{"type":"string","enum":["production","sandbox"],"default":"production"},"frequentPushes":{"type":"boolean"}},"required":["matchId","token"]}}}},"responses":{"204":{"description":"Registered"},"400":{"description":"Invalid token","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Match not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Too many Live Activities","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["notifications"],"summary":"Remove a Live Activity token (the activity ended or was dismissed)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":64,"maxLength":400,"pattern":"^[0-9a-fA-F]+$"}},"required":["token"]}}}},"responses":{"204":{"description":"Removed"},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/push/live-activity-start":{"post":{"tags":["notifications"],"summary":"Opt in to automatic Live Activities for followed teams (iOS push-to-start token; idempotent)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":64,"maxLength":400,"pattern":"^[0-9a-fA-F]+$"},"environment":{"type":"string","enum":["production","sandbox"],"default":"production"}},"required":["token"]}}}},"responses":{"204":{"description":"Registered"},"400":{"description":"Invalid token","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Too many devices","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["notifications"],"summary":"Opt out of automatic Live Activities on this iPhone","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":64,"maxLength":400,"pattern":"^[0-9a-fA-F]+$"}},"required":["token"]}}}},"responses":{"204":{"description":"Removed"},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/integrity/signals":{"get":{"tags":["integrity"],"summary":"Published market-anomaly signals past their publication delay (Pro)","parameters":[{"schema":{"type":"string","enum":["pre","live"]},"required":false,"name":"phase","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"maximum":1},"required":false,"name":"minScore","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Signals","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"phase":{"type":"string","enum":["pre","live"]},"score":{"type":"number","minimum":0,"maximum":1},"features":{"type":"object","additionalProperties":{"type":"number"}},"contributions":{"type":"array","items":{"type":"object","properties":{"feature":{"type":"string"},"value":{"type":"number"},"contribution":{"type":"number"}},"required":["feature","value","contribution"]}},"explanation":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]},"visibleFrom":{"type":"string"},"createdAt":{"type":"string"},"match":{"type":"object","properties":{"kickoff":{"type":"string"},"status":{"type":"string"},"competition":{"type":["string","null"]},"home":{"type":"string"},"away":{"type":"string"}},"required":["kickoff","status","competition","home","away"]}},"required":["id","eventId","phase","score","features","contributions","explanation","visibleFrom","createdAt","match"]}}},"required":["items"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"Pro plan required (type ends with /paywall)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/integrity/events/{eventId}":{"get":{"tags":["integrity"],"summary":"Published signals of one event (Pro)","parameters":[{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"eventId","in":"path"}],"responses":{"200":{"description":"Signals","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"phase":{"type":"string","enum":["pre","live"]},"score":{"type":"number","minimum":0,"maximum":1},"features":{"type":"object","additionalProperties":{"type":"number"}},"contributions":{"type":"array","items":{"type":"object","properties":{"feature":{"type":"string"},"value":{"type":"number"},"contribution":{"type":"number"}},"required":["feature","value","contribution"]}},"explanation":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]},"visibleFrom":{"type":"string"},"createdAt":{"type":"string"},"match":{"type":"object","properties":{"kickoff":{"type":"string"},"status":{"type":"string"},"competition":{"type":["string","null"]},"home":{"type":"string"},"away":{"type":"string"}},"required":["kickoff","status","competition","home","away"]}},"required":["id","eventId","phase","score","features","contributions","explanation","visibleFrom","createdAt","match"]}}},"required":["eventId","items"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"Pro plan required (type ends with /paywall)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/integrity/events/{eventId}/odds-history":{"get":{"tags":["integrity"],"summary":"Devigged 1X2 consensus over time for the drift chart (Pro)","parameters":[{"schema":{"type":"integer","exclusiveMinimum":0},"required":true,"name":"eventId","in":"path"}],"responses":{"200":{"description":"Consensus series","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string"},"market":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"t":{"type":"string"},"probs":{"type":"array","items":{"type":"number"}}},"required":["t","probs"]}}},"required":["eventId","market","points"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"Pro plan required (type ends with /paywall)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Event not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/contests":{"get":{"tags":["contests"],"summary":"Weekly contests (current, next, recent). No stakes, no money prizes (D20).","responses":{"200":{"description":"Contests","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"period":{"type":"object","properties":{"kind":{"type":"string","enum":["week"]},"year":{"type":"integer","minimum":2000},"week":{"type":"integer","minimum":1,"maximum":53}},"required":["kind","year","week"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["upcoming","open","closed"]},"entrants":{"type":"integer","minimum":0},"maxPicks":{"type":"integer","exclusiveMinimum":0}},"required":["slug","title","startsAt","endsAt","status","entrants","maxPicks"]}}},"required":["items"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/contests/{slug}":{"get":{"tags":["contests"],"summary":"One contest with its leaderboard (top 100 + your row) and rank changes","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Contest","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"period":{"type":"object","properties":{"kind":{"type":"string","enum":["week"]},"year":{"type":"integer","minimum":2000},"week":{"type":"integer","minimum":1,"maximum":53}},"required":["kind","year","week"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["upcoming","open","closed"]},"entrants":{"type":"integer","minimum":0},"maxPicks":{"type":"integer","exclusiveMinimum":0},"leaderboard":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"integer","exclusiveMinimum":0},"previousRank":{"type":["integer","null"],"exclusiveMinimum":0},"change":{"type":["integer","null"]},"name":{"type":"string"},"points":{"type":"number"},"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"badges":{"type":"array","items":{"type":"string"}},"me":{"type":"boolean"}},"required":["rank","previousRank","change","name","points","picks","settled","badges","me"]}},"joined":{"type":"boolean"}},"required":["slug","title","startsAt","endsAt","status","entrants","maxPicks","leaderboard","joined"]}}}},"404":{"description":"Contest not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/contests/{slug}/join":{"post":{"tags":["contests"],"summary":"Join a contest (idempotent)","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Entry","content":{"application/json":{"schema":{"type":"object","properties":{"contest":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"period":{"type":"object","properties":{"kind":{"type":"string","enum":["week"]},"year":{"type":"integer","minimum":2000},"week":{"type":"integer","minimum":1,"maximum":53}},"required":["kind","year","week"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["upcoming","open","closed"]},"entrants":{"type":"integer","minimum":0},"maxPicks":{"type":"integer","exclusiveMinimum":0}},"required":["slug","title","startsAt","endsAt","status","entrants","maxPicks"]},"joined":{"type":"boolean"},"points":{"type":"number"},"rank":{"type":["integer","null"],"exclusiveMinimum":0},"picks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"eventId":{"type":"integer"},"home":{"type":"string"},"away":{"type":"string"},"kickoff":{"type":"string","format":"date-time"},"outcome":{"type":"integer","minimum":0,"maximum":2},"odds":{"type":"number"},"openFair":{"type":["number","null"]},"result":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"points":{"type":["number","null"]},"hash":{"type":"string"},"prevHash":{"type":["string","null"]},"placedAt":{"type":"string","format":"date-time"}},"required":["id","eventId","home","away","kickoff","outcome","odds","openFair","result","points","hash","prevHash","placedAt"]}}},"required":["contest","joined","points","rank","picks"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Contest not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Contest closed","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/contests/{slug}/me":{"get":{"tags":["contests"],"summary":"Your entry: points, rank and picks (with hash chain links)","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Entry","content":{"application/json":{"schema":{"type":"object","properties":{"contest":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"period":{"type":"object","properties":{"kind":{"type":"string","enum":["week"]},"year":{"type":"integer","minimum":2000},"week":{"type":"integer","minimum":1,"maximum":53}},"required":["kind","year","week"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["upcoming","open","closed"]},"entrants":{"type":"integer","minimum":0},"maxPicks":{"type":"integer","exclusiveMinimum":0}},"required":["slug","title","startsAt","endsAt","status","entrants","maxPicks"]},"joined":{"type":"boolean"},"points":{"type":"number"},"rank":{"type":["integer","null"],"exclusiveMinimum":0},"picks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"eventId":{"type":"integer"},"home":{"type":"string"},"away":{"type":"string"},"kickoff":{"type":"string","format":"date-time"},"outcome":{"type":"integer","minimum":0,"maximum":2},"odds":{"type":"number"},"openFair":{"type":["number","null"]},"result":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"points":{"type":["number","null"]},"hash":{"type":"string"},"prevHash":{"type":["string","null"]},"placedAt":{"type":"string","format":"date-time"}},"required":["id","eventId","home","away","kickoff","outcome","odds","openFair","result","points","hash","prevHash","placedAt"]}}},"required":["contest","joined","points","rank","picks"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Contest not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/contests/{slug}/picks":{"post":{"tags":["contests"],"summary":"Submit a 1X2 pick at the current consensus price (joins the contest when needed)","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"integer","exclusiveMinimum":0},"outcome":{"type":"integer","minimum":0,"maximum":2}},"required":["eventId","outcome"],"additionalProperties":false}}}},"responses":{"201":{"description":"Pick","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"eventId":{"type":"integer"},"home":{"type":"string"},"away":{"type":"string"},"kickoff":{"type":"string","format":"date-time"},"outcome":{"type":"integer","minimum":0,"maximum":2},"odds":{"type":"number"},"openFair":{"type":["number","null"]},"result":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"points":{"type":["number","null"]},"hash":{"type":"string"},"prevHash":{"type":["string","null"]},"placedAt":{"type":"string","format":"date-time"}},"required":["id","eventId","home","away","kickoff","outcome","odds","openFair","result","points","hash","prevHash","placedAt"]}}}},"400":{"description":"Invalid pick","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Contest or match not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Contest closed, match started, duplicate or limit reached","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"No consensus odds for this match","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/contest-badges":{"get":{"tags":["contests"],"summary":"Profile badges earned in contests","responses":{"200":{"description":"Badges","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["first-entry","podium","winner","clv-positive","ten-picks"]},"contest":{"type":"string"},"awardedAt":{"type":["string","null"],"format":"date-time"}},"required":["code","contest","awardedAt"]}}},"required":["items"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/brier":{"get":{"tags":["contests"],"summary":"Your personal duel: pooled Brier vs closing market vs model across every contest you entered (D53)","responses":{"200":{"description":"Brier duel","content":{"application/json":{"schema":{"type":"object","properties":{"n":{"type":"integer","minimum":0},"brier":{"type":["number","null"]},"marketBrier":{"type":["number","null"]},"modelBrier":{"type":["number","null"]},"vsModel":{"type":["number","null"]},"modelN":{"type":"integer","minimum":0},"contests":{"type":"integer","minimum":0},"minN":{"type":"integer","exclusiveMinimum":0},"vsModelCi":{"type":["object","null"],"properties":{"mean":{"type":"number"},"lo":{"type":"number"},"hi":{"type":"number"},"n":{"type":"integer","minimum":0}},"required":["mean","lo","hi","n"]},"verdict":{"type":"string","enum":["better","worse","noise","too_few"]}},"required":["n","brier","marketBrier","modelBrier","vsModel","modelN","contests","minN","vsModelCi","verdict"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/contests/{slug}/forecasts":{"get":{"tags":["contests"],"summary":"Probability contest board: points vs the market close, Brier vs market and model (D39)","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Forecast board","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"maxForecasts":{"type":"integer","exclusiveMinimum":0},"rows":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"points":{"type":"number"},"forecasts":{"type":"integer","minimum":0},"summary":{"type":"object","properties":{"n":{"type":"integer","minimum":0},"brier":{"type":["number","null"]},"marketBrier":{"type":["number","null"]},"modelBrier":{"type":["number","null"]},"vsModel":{"type":["number","null"]},"modelN":{"type":"integer","minimum":0}},"required":["n","brier","marketBrier","modelBrier","vsModel","modelN"]},"me":{"type":"boolean"}},"required":["rank","name","points","forecasts","summary","me"]}},"overall":{"type":"object","properties":{"n":{"type":"integer","minimum":0},"brier":{"type":["number","null"]},"marketBrier":{"type":["number","null"]},"modelBrier":{"type":["number","null"]},"vsModel":{"type":["number","null"]},"modelN":{"type":"integer","minimum":0}},"required":["n","brier","marketBrier","modelBrier","vsModel","modelN"]}},"required":["slug","maxForecasts","rows","overall"]}}}},"404":{"description":"Contest not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["contests"],"summary":"Submit a 1X2 probability triple in whole percent (separate board from the 1X2 picks)","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"integer","exclusiveMinimum":0},"probabilities":{"type":"array","prefixItems":[{"type":"integer","minimum":1,"maximum":98},{"type":"integer","minimum":1,"maximum":98},{"type":"integer","minimum":1,"maximum":98}]}},"required":["eventId","probabilities"],"additionalProperties":false}}}},"responses":{"201":{"description":"Forecast","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"eventId":{"type":"integer"},"home":{"type":"string"},"away":{"type":"string"},"kickoff":{"type":"string","format":"date-time"},"probabilities":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"status":{"type":"string","enum":["pending","settled","void"]},"outcome":{"type":["integer","null"],"minimum":0,"maximum":2},"market":{"type":["array","null"],"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"model":{"type":["array","null"],"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"brier":{"type":["number","null"]},"marketBrier":{"type":["number","null"]},"modelBrier":{"type":["number","null"]},"points":{"type":["number","null"]},"hash":{"type":"string"},"prevHash":{"type":["string","null"]},"placedAt":{"type":"string","format":"date-time"}},"required":["id","eventId","home","away","kickoff","probabilities","status","outcome","market","model","brier","marketBrier","modelBrier","points","hash","prevHash","placedAt"]}}}},"400":{"description":"Invalid forecast","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Contest or match not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Contest closed, match started, duplicate or limit reached","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/contests/{slug}/forecasts/me":{"get":{"tags":["contests"],"summary":"Your probability forecasts with Brier scores and hash chain links","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Forecasts","content":{"application/json":{"schema":{"type":"object","properties":{"contest":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"period":{"type":"object","properties":{"kind":{"type":"string","enum":["week"]},"year":{"type":"integer","minimum":2000},"week":{"type":"integer","minimum":1,"maximum":53}},"required":["kind","year","week"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["upcoming","open","closed"]},"entrants":{"type":"integer","minimum":0},"maxPicks":{"type":"integer","exclusiveMinimum":0}},"required":["slug","title","startsAt","endsAt","status","entrants","maxPicks"]},"maxForecasts":{"type":"integer","exclusiveMinimum":0},"points":{"type":"number"},"rank":{"type":["integer","null"],"exclusiveMinimum":0},"summary":{"type":"object","properties":{"n":{"type":"integer","minimum":0},"brier":{"type":["number","null"]},"marketBrier":{"type":["number","null"]},"modelBrier":{"type":["number","null"]},"vsModel":{"type":["number","null"]},"modelN":{"type":"integer","minimum":0}},"required":["n","brier","marketBrier","modelBrier","vsModel","modelN"]},"forecasts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"eventId":{"type":"integer"},"home":{"type":"string"},"away":{"type":"string"},"kickoff":{"type":"string","format":"date-time"},"probabilities":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"status":{"type":"string","enum":["pending","settled","void"]},"outcome":{"type":["integer","null"],"minimum":0,"maximum":2},"market":{"type":["array","null"],"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"model":{"type":["array","null"],"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"}]},"brier":{"type":["number","null"]},"marketBrier":{"type":["number","null"]},"modelBrier":{"type":["number","null"]},"points":{"type":["number","null"]},"hash":{"type":"string"},"prevHash":{"type":["string","null"]},"placedAt":{"type":"string","format":"date-time"}},"required":["id","eventId","home","away","kickoff","probabilities","status","outcome","market","model","brier","marketBrier","modelBrier","points","hash","prevHash","placedAt"]}}},"required":["contest","maxForecasts","points","rank","summary","forecasts"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Contest not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/contests/{slug}/exact-scores":{"get":{"tags":["contests"],"summary":"Exact-score board: points by exact scoreline (3 exact / 1 right outcome / 0)","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Exact-score board","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"maxExactScores":{"type":"integer","exclusiveMinimum":0},"rows":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"points":{"type":"number"},"scores":{"type":"integer","minimum":0},"exact":{"type":"integer","minimum":0},"me":{"type":"boolean"}},"required":["rank","name","points","scores","exact","me"]}}},"required":["slug","maxExactScores","rows"]}}}},"404":{"description":"Contest not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["contests"],"summary":"Submit an exact-score prediction (separate quick-game board inside the contest)","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"integer","exclusiveMinimum":0},"home":{"type":"integer","minimum":0,"maximum":20},"away":{"type":"integer","minimum":0,"maximum":20}},"required":["eventId","home","away"],"additionalProperties":false}}}},"responses":{"201":{"description":"Exact-score prediction","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"eventId":{"type":"integer"},"home":{"type":"string"},"away":{"type":"string"},"kickoff":{"type":"string","format":"date-time"},"homeScore":{"type":"integer","minimum":0},"awayScore":{"type":"integer","minimum":0},"status":{"type":"string","enum":["pending","settled","void"]},"actual":{"type":["object","null"],"properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"exact":{"type":["boolean","null"]},"outcome":{"type":["integer","null"],"minimum":0,"maximum":2},"points":{"type":["number","null"]},"hash":{"type":"string"},"prevHash":{"type":["string","null"]},"placedAt":{"type":"string","format":"date-time"}},"required":["id","eventId","home","away","kickoff","homeScore","awayScore","status","actual","exact","outcome","points","hash","prevHash","placedAt"]}}}},"400":{"description":"Invalid score","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Contest or match not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Contest closed, match started, duplicate or limit reached","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/contests/{slug}/exact-scores/me":{"get":{"tags":["contests"],"summary":"Your exact-score predictions with the realised scoreline and hash chain links","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Exact scores","content":{"application/json":{"schema":{"type":"object","properties":{"contest":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"period":{"type":"object","properties":{"kind":{"type":"string","enum":["week"]},"year":{"type":"integer","minimum":2000},"week":{"type":"integer","minimum":1,"maximum":53}},"required":["kind","year","week"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["upcoming","open","closed"]},"entrants":{"type":"integer","minimum":0},"maxPicks":{"type":"integer","exclusiveMinimum":0}},"required":["slug","title","startsAt","endsAt","status","entrants","maxPicks"]},"maxExactScores":{"type":"integer","exclusiveMinimum":0},"points":{"type":"number"},"rank":{"type":["integer","null"],"exclusiveMinimum":0},"exact":{"type":"integer","minimum":0},"scores":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"eventId":{"type":"integer"},"home":{"type":"string"},"away":{"type":"string"},"kickoff":{"type":"string","format":"date-time"},"homeScore":{"type":"integer","minimum":0},"awayScore":{"type":"integer","minimum":0},"status":{"type":"string","enum":["pending","settled","void"]},"actual":{"type":["object","null"],"properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"exact":{"type":["boolean","null"]},"outcome":{"type":["integer","null"],"minimum":0,"maximum":2},"points":{"type":["number","null"]},"hash":{"type":"string"},"prevHash":{"type":["string","null"]},"placedAt":{"type":"string","format":"date-time"}},"required":["id","eventId","home","away","kickoff","homeScore","awayScore","status","actual","exact","outcome","points","hash","prevHash","placedAt"]}}},"required":["contest","maxExactScores","points","rank","exact","scores"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Contest not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/projection":{"get":{"tags":["match-center"],"summary":"Season projection: Monte Carlo of the remaining fixtures with the model strengths (D29)","description":"Expected points (p5/p50/p95), expected position and zone probabilities for everyone; the full position distribution (`positions`) only for Premium/Pro sessions — anonymous/Free get `limited: true` (D23). Liga 1 is projected for the regular season only.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Projection","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"phase":{"type":"string","enum":["regular","full"]},"sims":{"type":"integer","exclusiveMinimum":0},"remainingFixtures":{"type":"integer","minimum":0},"playedFixtures":{"type":"integer","minimum":0},"model":{"type":"string","minLength":1},"computedAt":{"type":"string","format":"date-time"},"zones":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["title","ucl","europe","playoff","playout","relegation"]},"from":{"type":"integer","exclusiveMinimum":0},"to":{"type":"integer","exclusiveMinimum":0}},"required":["key","from","to"]}},"rows":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"points":{"type":"integer","minimum":0},"played":{"type":"integer","minimum":0},"expectedPoints":{"type":"number","minimum":0},"pointsRange":{"type":"object","properties":{"p5":{"type":"number"},"p50":{"type":"number"},"p95":{"type":"number"}},"required":["p5","p50","p95"]},"expectedPosition":{"type":"number","exclusiveMinimum":0},"zones":{"type":"object","additionalProperties":{"type":"number","minimum":0,"maximum":1}},"positions":{"type":"array","items":{"type":"number","minimum":0,"maximum":1}}},"required":["team","points","played","expectedPoints","pointsRange","expectedPosition","zones"]}},"limited":{"type":"boolean"}},"required":["competition","phase","sims","remainingFixtures","playedFixtures","model","computedAt","zones","rows"]}}}},"400":{"description":"Invalid slug","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No projection for this competition","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/power":{"get":{"tags":["match-center"],"summary":"Power ratings: model attack/defence strengths of the current season teams (T052)","description":"Newest Dixon-Coles strength snapshot of the competition, restricted to the teams of the current season. Teams the model has not fitted use the promoted-team prior (`prior: true`).","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Power ratings","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"fittedAt":{"type":"string","format":"date-time"},"homeAdvantageGoals":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"integer","exclusiveMinimum":0},"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"rating":{"type":"number"},"attack":{"type":"number"},"defence":{"type":"number"},"goalsFor":{"type":"number","minimum":0},"goalsAgainst":{"type":"number","minimum":0},"prior":{"type":"boolean"}},"required":["rank","team","rating","attack","defence","goalsFor","goalsAgainst","prior"]}}},"required":["competition","model","fittedAt","homeAdvantageGoals","rows"]}}}},"400":{"description":"Invalid slug","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition, no season or no strength snapshot","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/rounds":{"get":{"tags":["match-center"],"summary":"Matchdays of the current season (T052)","description":"Rounds with their kickoff window, match count and finished count. `current` = round of the next unfinished match, else the last round; null when no round is known.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Rounds","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"current":{"type":["integer","null"],"exclusiveMinimum":0},"items":{"type":"array","items":{"type":"object","properties":{"round":{"type":"integer","exclusiveMinimum":0},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"matches":{"type":"integer","minimum":0},"finished":{"type":"integer","minimum":0}},"required":["round","from","to","matches","finished"]}}},"required":["competition","current","items"]}}}},"400":{"description":"Invalid slug","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/rounds/{round}":{"get":{"tags":["match-center"],"summary":"Matches of one matchday of the current season (T052)","description":"Public (D23) match shape, identical to anonymous /v1/matches: favourite-only prediction (`limited`), no value. Kickoff order.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":99},"required":true,"name":"round","in":"path"}],"responses":{"200":{"description":"Round","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"round":{"type":"integer","exclusiveMinimum":0},"lastRound":{"type":"integer","exclusiveMinimum":0},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"sport":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"league":{"type":"string","minLength":1},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"resultPending":{"type":"boolean"},"kickoffUnconfirmed":{"type":"boolean"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"bestOf":{"type":"integer","minimum":1,"maximum":7},"prediction":{"type":"object","properties":{"model":{"type":"string","minLength":1},"probabilities":{"type":"object","properties":{"home":{"type":["number","null"],"exclusiveMinimum":0},"draw":{"type":["number","null"],"exclusiveMinimum":0},"away":{"type":["number","null"],"exclusiveMinimum":0}},"required":["home","draw","away"]},"fairOdds":{"type":"object","properties":{"home":{"type":["number","null"],"exclusiveMinimum":0},"draw":{"type":["number","null"],"exclusiveMinimum":0},"away":{"type":["number","null"],"exclusiveMinimum":0}},"required":["home","draw","away"]},"createdAt":{"type":"string","format":"date-time"},"limited":{"type":"boolean"}},"required":["model","probabilities","fairOdds","createdAt"]},"odds":{"type":"object","properties":{"prices":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"opening":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"source":{"type":"string","minLength":1},"observedAt":{"type":"string","format":"date-time"}},"required":["prices","source","observedAt"]},"value":{"type":"object","properties":{"enabled":{"type":"boolean"},"reason":{"type":"string","enum":["validated","model_worse_than_close","no_backtest","no_odds","disabled_by_admin"]}},"required":["enabled","reason"]},"verdict":{"type":"object","properties":{"outcome":{"type":"string","enum":["home","draw","away"]},"modelProbability":{"type":"number","minimum":0,"maximum":1},"marketProbability":{"type":["number","null"],"minimum":0,"maximum":1},"favourite":{"type":"string","enum":["home","draw","away"]},"favouriteHit":{"type":"boolean"},"closer":{"type":["string","null"],"enum":["model","market","level",null]}},"required":["outcome","modelProbability","marketProbability","favourite","favouriteHit","closer"]},"live":{"type":"object","properties":{"minute":{"type":["integer","null"],"minimum":0},"period":{"type":"string","enum":["1H","HT","2H","ET1","ET2","PEN"]},"red":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"yellow":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"corners":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"at":{"type":"string","format":"date-time"}},"required":["minute"]},"source":{"type":"string","minLength":1}},"required":["id","sport","league","home","away","kickoff","status"]}}},"required":["competition","round","lastRound","items"]}}}},"400":{"description":"Invalid slug or round","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition or round","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/reports/weekly/{week}":{"get":{"tags":["reports"],"summary":"Weekly model report: proper scores vs the no-margin consensus close (T052)","description":"Finished football matches of the ISO week (Monday 00:00 -> Monday 00:00 Europe/Bucharest) that had a pre-match 1X2 prediction: hit rate, log loss, Brier, the same against the consensus close, per league, biggest surprises and the public ledger picks settled in the week.","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-W(0[1-9]|[1-4]\\d|5[0-3])$"},"required":true,"name":"week","in":"path"}],"responses":{"200":{"description":"Weekly report","content":{"application/json":{"schema":{"type":"object","properties":{"week":{"type":"string","pattern":"^\\d{4}-W(0[1-9]|[1-4]\\d|5[0-3])$"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"model":{"type":["string","null"],"minLength":1},"scores":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"favouriteHitRate":{"type":["number","null"],"minimum":0,"maximum":1},"logLoss":{"type":["number","null"],"minimum":0},"brier":{"type":["number","null"],"minimum":0},"marketMatches":{"type":"integer","minimum":0},"marketLogLoss":{"type":["number","null"],"minimum":0},"modelLogLossOnMarketSubset":{"type":["number","null"],"minimum":0},"favouriteHitCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]},"logLossDiff":{"type":["object","null"],"properties":{"mean":{"type":"number"},"lo":{"type":"number"},"hi":{"type":"number"},"n":{"type":"integer","minimum":0}},"required":["mean","lo","hi","n"]}},"required":["matches","favouriteHitRate","logLoss","brier","marketMatches","marketLogLoss","modelLogLossOnMarketSubset"]},"leagues":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"scores":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"favouriteHitRate":{"type":["number","null"],"minimum":0,"maximum":1},"logLoss":{"type":["number","null"],"minimum":0},"brier":{"type":["number","null"],"minimum":0},"marketMatches":{"type":"integer","minimum":0},"marketLogLoss":{"type":["number","null"],"minimum":0},"modelLogLossOnMarketSubset":{"type":["number","null"],"minimum":0},"favouriteHitCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]},"logLossDiff":{"type":["object","null"],"properties":{"mean":{"type":"number"},"lo":{"type":"number"},"hi":{"type":"number"},"n":{"type":"integer","minimum":0}},"required":["mean","lo","hi","n"]}},"required":["matches","favouriteHitRate","logLoss","brier","marketMatches","marketLogLoss","modelLogLossOnMarketSubset"]}},"required":["slug","name","scores"]}},"surprises":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"league":{"type":"string","minLength":1},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"outcome":{"type":"string","enum":["home","draw","away"]},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["id","league","home","away","kickoff","score","outcome","probability"]}},"confident":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"league":{"type":"string","minLength":1},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"outcome":{"type":"string","enum":["home","draw","away"]},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["id","league","home","away","kickoff","score","outcome","probability"]}},"ledger":{"type":"object","properties":{"settled":{"type":"integer","minimum":0},"wins":{"type":"number","minimum":0},"profit":{"type":"number"},"roi":{"type":["number","null"]},"avgClv":{"type":["number","null"]}},"required":["settled","wins","profit","roi","avgClv"]},"generatedAt":{"type":"string","format":"date-time"}},"required":["week","from","to","model","scores","leagues","surprises","confident","ledger","generatedAt"]}}}},"400":{"description":"Invalid week","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No scored match in this week (or the week is in the future)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/reports/last7":{"get":{"tags":["reports"],"summary":"Honesty counter of the last 7 days: favourite hits and misses, model vs close, noise verdict (T189)","description":"Finished football matches kicked off in the last 7 days that had a pre-kickoff 1X2 prediction. Misses are counted with the same weight as hits; the model-minus-market log-loss interval decides the verdict (noise when it contains 0, too_few under 10 matches with a close). 404 while the admin switch honesty_counter_enabled is off.","responses":{"200":{"description":"Honesty counter","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"matches":{"type":"integer","minimum":0},"favouriteHits":{"type":"integer","minimum":0},"favouriteMisses":{"type":"integer","minimum":0},"marketMatches":{"type":"integer","minimum":0},"closer":{"type":"object","properties":{"model":{"type":"integer","minimum":0},"market":{"type":"integer","minimum":0},"level":{"type":"integer","minimum":0}},"required":["model","market","level"]},"logLossDiff":{"type":["object","null"],"properties":{"mean":{"type":"number"},"lo":{"type":"number"},"hi":{"type":"number"},"n":{"type":"integer","minimum":0}},"required":["mean","lo","hi","n"]},"verdict":{"type":"string","enum":["better","worse","noise","too_few"]}},"required":["from","to","matches","favouriteHits","favouriteMisses","marketMatches","closer","logLossDiff","verdict"]}}}},"404":{"description":"Counter switched off","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/reports/weekly":{"get":{"tags":["reports"],"summary":"Weeks with a weekly model report, newest first (max 26) (T052)","responses":{"200":{"description":"Report weeks","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"week":{"type":"string","pattern":"^\\d{4}-W(0[1-9]|[1-4]\\d|5[0-3])$"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"matches":{"type":"integer","minimum":0}},"required":["week","from","to","matches"]}}},"required":["items"]}}}}}}},"/v1/competitions/{slug}/record":{"get":{"tags":["reports"],"summary":"Running model record of a competition vs the no-margin close (T092)","description":"Last `limit` (default 30) finished football matches of the competition in the last 180 days that had a pre-kickoff 1X2 prediction: hit rate, log loss, Brier, the same for the consensus close, and how often the model or the close gave the actual result more probability. Public, shared-cacheable.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"integer","minimum":5,"maximum":100,"default":30},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"League record","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"matches":{"type":"integer","minimum":0},"from":{"type":["string","null"],"format":"date-time"},"to":{"type":["string","null"],"format":"date-time"},"scores":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"favouriteHitRate":{"type":["number","null"],"minimum":0,"maximum":1},"logLoss":{"type":["number","null"],"minimum":0},"brier":{"type":["number","null"],"minimum":0},"marketMatches":{"type":"integer","minimum":0},"marketLogLoss":{"type":["number","null"],"minimum":0},"modelLogLossOnMarketSubset":{"type":["number","null"],"minimum":0},"favouriteHitCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]},"logLossDiff":{"type":["object","null"],"properties":{"mean":{"type":"number"},"lo":{"type":"number"},"hi":{"type":"number"},"n":{"type":"integer","minimum":0}},"required":["mean","lo","hi","n"]}},"required":["matches","favouriteHitRate","logLoss","brier","marketMatches","marketLogLoss","modelLogLossOnMarketSubset"]},"closer":{"type":"object","properties":{"model":{"type":"integer","minimum":0},"market":{"type":"integer","minimum":0},"level":{"type":"integer","minimum":0}},"required":["model","market","level"]}},"required":["competition","matches","from","to","scores","closer"]}}}},"400":{"description":"Invalid slug or limit","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/calibration":{"get":{"tags":["reports"],"summary":"Model calibration of a competition: reliability bands (T383)","description":"The newest `limit` (default 30) finished football matches of the competition in the last 180 days that had a pre-kickoff 1X2 prediction. Every match contributes its three outcome probabilities; they are banded by confidence (five equal 20 % bands) and compared with the share that actually happened, with the Wilson 95 % interval of that share. Public, shared-cacheable. The product proof page: it shows where the model is honest and where it is over-confident.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"integer","minimum":5,"maximum":100,"default":30},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Calibration","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"matches":{"type":"integer","minimum":0},"observations":{"type":"integer","minimum":0},"meanPredicted":{"type":["number","null"],"minimum":0,"maximum":1},"meanObserved":{"type":["number","null"],"minimum":0,"maximum":1},"buckets":{"type":"array","items":{"type":"object","properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1},"n":{"type":"integer","minimum":0},"predicted":{"type":["number","null"],"minimum":0,"maximum":1},"observed":{"type":["number","null"],"minimum":0,"maximum":1},"ci":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]},"delta":{"type":["number","null"],"minimum":-1,"maximum":1},"brier":{"type":["number","null"],"minimum":0},"logLoss":{"type":["number","null"],"minimum":0},"lossShare":{"type":["number","null"],"minimum":0,"maximum":1}},"required":["lo","hi","n","predicted","observed","ci"]}}},"required":["competition","matches","observations","meanPredicted","meanObserved","buckets"]}}}},"400":{"description":"Invalid slug or limit","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition or no scored match","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/calibration-buckets":{"get":{"tags":["reports"],"summary":"Bucketed model calibration: ten probability buckets with the observed share, gap and Brier share (T138)","description":"The same sample as the reliability bands (the newest `limit`, default 30, finished football matches with a pre-kickoff 1X2 prediction), bucketed by ten equal 10 % bands over the model's own probabilities. Each bucket carries n, the mean predicted probability, the share that actually happened, their difference, the Wilson 95 % interval and the bucket's share of the aggregate Brier score. All ten buckets are present (n = 0 for an empty one) and a bucket below the sample floor carries no score and no interval (D47). The reserved slug `all` reads the same buckets over every covered competition at once (the selector's global pool). Feeds the calibration chip on the match pages.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"integer","minimum":5,"maximum":100,"default":30},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Calibration buckets","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"matches":{"type":"integer","minimum":0},"observations":{"type":"integer","minimum":0},"meanPredicted":{"type":["number","null"],"minimum":0,"maximum":1},"meanObserved":{"type":["number","null"],"minimum":0,"maximum":1},"bandWidth":{"type":"number","exclusiveMinimum":0,"maximum":1},"buckets":{"type":"array","items":{"type":"object","properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1},"n":{"type":"integer","minimum":0},"predicted":{"type":["number","null"],"minimum":0,"maximum":1},"observed":{"type":["number","null"],"minimum":0,"maximum":1},"ci":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]},"delta":{"type":["number","null"],"minimum":-1,"maximum":1},"brier":{"type":["number","null"],"minimum":0},"logLoss":{"type":["number","null"],"minimum":0},"lossShare":{"type":["number","null"],"minimum":0,"maximum":1}},"required":["lo","hi","n","predicted","observed","ci"]}}},"required":["competition","matches","observations","meanPredicted","meanObserved","bandWidth","buckets"]}}}},"400":{"description":"Invalid slug or limit","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition or no scored match","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/reports/calibration/competitions":{"get":{"tags":["reports"],"summary":"Competitions with enough scored matches to show calibration for (T411)","description":"The competitions the match-page calibration selector may open: those with at least the D47 sample floor of finished football matches that had a pre-kickoff 1X2 prediction in the last 180 days, with their scored-match count, ordered by name. The same sample the calibration-buckets endpoint reads, so a listed competition always has buckets behind it.","responses":{"200":{"description":"Covered competitions","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"matches":{"type":"integer","minimum":0}},"required":["slug","name","matches"]}}},"required":["items"]}}}}}}},"/v1/billing/stores/config":{"get":{"tags":["billing"],"summary":"Which app stores the server verifies, plus the caller’s store account binding id (T028)","responses":{"200":{"description":"Store config","content":{"application/json":{"schema":{"type":"object","properties":{"google":{"type":"object","properties":{"enabled":{"type":"boolean"},"packageName":{"type":["string","null"]}},"required":["enabled","packageName"]},"apple":{"type":"object","properties":{"enabled":{"type":"boolean"},"bundleId":{"type":["string","null"]}},"required":["enabled","bundleId"]},"productIds":{"type":"array","items":{"type":"string","enum":["premium_monthly_ron","premium_yearly_ron","pro_monthly_ron"]}},"accountId":{"type":"string","format":"uuid"}},"required":["google","apple","productIds","accountId"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/billing/stores/verify":{"post":{"tags":["billing"],"summary":"Verify a Google Play / App Store subscription purchase and record it (T028)","description":"Google: purchase token checked with the Play Developer API (subscriptionsv2) and acknowledged. Apple: StoreKit 2 JWS verified against the pinned Apple Root CA - G3. The purchase must carry the account id from /stores/config.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["google"]},"productId":{"type":"string","enum":["premium_monthly_ron","premium_yearly_ron","pro_monthly_ron"]},"purchaseToken":{"type":"string","minLength":10,"maxLength":4096}},"required":["provider","productId","purchaseToken"]},{"type":"object","properties":{"provider":{"type":"string","enum":["apple"]},"signedTransaction":{"type":"string","minLength":20,"maxLength":16384}},"required":["provider","signedTransaction"]}]}}}},"responses":{"200":{"description":"Effective plan","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["free","premium","pro"]},"subscription":{"type":["object","null"],"properties":{"plan":{"type":"string","enum":["premium","pro"]},"status":{"type":"string","enum":["trialing","active","past_due","canceled","expired"]},"currentPeriodEnd":{"type":"string","format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"}},"required":["plan","status","currentPeriodEnd","cancelAtPeriodEnd"]}},"required":["plan","subscription"]}}}},"400":{"description":"Invalid body","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Billing disabled (free beta, billing_disabled)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Purchase belongs to another account","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"Purchase invalid, pending, unknown or for another app","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Store not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/telegram":{"get":{"tags":["telegram"],"summary":"Telegram alerts: is the bot configured and is a chat linked to my account (T042)","responses":{"200":{"description":"Link status","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"bot":{"type":["string","null"]},"linked":{"type":"boolean"},"username":{"type":["string","null"]},"blocked":{"type":"boolean"},"linkedAt":{"type":["string","null"],"format":"date-time"}},"required":["enabled","bot","linked","username","blocked","linkedAt"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["telegram"],"summary":"Unlink the Telegram chat (alerts stop)","responses":{"204":{"description":"Unlinked (idempotent)"},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/telegram/link":{"post":{"tags":["telegram"],"summary":"One-time t.me deep link (10 min, single use) that links the chat which opens it","responses":{"200":{"description":"Deep link","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}},"required":["url","expiresAt"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Bot not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/tennis/matches":{"get":{"tags":["matches"],"summary":"Tennis matches (ATP/WTA) with the match-winner model and the anonymous market consensus (T021)","description":"Two-way market: `home`/`away` follow the event order. Premium/Pro get both probabilities; anonymous and Free get the favourite only (`limited: true`, D23). Odds carry only the masked source code.","parameters":[{"schema":{"type":"string","enum":["scheduled","live","finished"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["atp","wta"]},"required":false,"name":"tour","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Tennis matches","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"tour":{"type":"string","enum":["atp","wta"]},"tournament":{"type":"string","minLength":1},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"resultPending":{"type":"boolean"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"prediction":{"type":"object","properties":{"model":{"type":"string","minLength":1},"probabilities":{"type":"object","properties":{"home":{"type":["number","null"],"exclusiveMinimum":0},"away":{"type":["number","null"],"exclusiveMinimum":0}},"required":["home","away"]},"fairOdds":{"type":"object","properties":{"home":{"type":["number","null"],"exclusiveMinimum":0},"away":{"type":["number","null"],"exclusiveMinimum":0}},"required":["home","away"]},"surface":{"type":"string","enum":["hard","clay","grass","carpet"]},"createdAt":{"type":"string","format":"date-time"},"limited":{"type":"boolean"}},"required":["model","probabilities","fairOdds","createdAt"]},"odds":{"type":"object","properties":{"prices":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","away"]},"source":{"type":"string","minLength":1},"observedAt":{"type":"string","format":"date-time"}},"required":["prices","source","observedAt"]},"source":{"type":"string","minLength":1}},"required":["id","tour","tournament","home","away","kickoff","status"]}}},"required":["items"]}}}}}}},"/v1/billing/withdrawal":{"get":{"tags":["billing"],"summary":"Can the signed-in user withdraw from the subscription contract now (T085)","responses":{"200":{"description":"Eligibility","content":{"application/json":{"schema":{"type":"object","properties":{"eligible":{"type":"boolean"},"reason":{"type":"string","enum":["none","window_over","already_withdrawn"]},"deadline":{"type":"string","format":"date-time"},"provider":{"type":"string","enum":["stripe","google","apple"]},"contractId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","format":"email"}},"required":["eligible"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["billing"],"summary":"Right-of-withdrawal statement (art. 11^1 OUG 34/2014), signed in or public (T085)","description":"Second step of the withdrawal function (\"Confirmați retragerea\"). Signed in: applies to the caller’s subscription (trial cancelled; paid cancelled + prorated refund; store purchases get the store refund link). Anonymous: matched by account e-mail (+ contract id), else recorded for manual handling. Always returns a receipt with the reference and the time of receipt; the same receipt is e-mailed.","parameters":[{"schema":{"type":"string","enum":["ro","en"]},"required":false,"name":"locale","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"email":{"type":"string","maxLength":254,"format":"email"},"contractId":{"type":"string","maxLength":120},"confirm":{"type":"boolean","enum":[true]}},"required":["name","email","confirm"]}}}},"responses":{"201":{"description":"Receipt","content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":"string"},"receivedAt":{"type":"string","format":"date-time"},"outcome":{"type":"string","enum":["cancelled_trial","refunded","store","manual"]},"refundAmount":{"type":"integer","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"storeRefundUrl":{"type":"string","format":"uri"},"invoiceRef":{"type":"string"},"emailed":{"type":"boolean"}},"required":["reference","receivedAt","outcome","emailed"]}}}},"400":{"description":"Invalid body","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many public statements from this address","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/contact":{"post":{"tags":["support"],"summary":"Help-page contact form: e-mails the operator inbox, stores nothing (T178)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"email":{"type":"string","maxLength":254,"format":"email"},"topic":{"type":"string","enum":["general","account","gdpr","dsa","bug"]},"message":{"type":"string","minLength":20,"maxLength":2000},"website":{"type":"string","maxLength":200}},"required":["email","topic","message"]}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":"string"},"delivered":{"type":"boolean"}},"required":["reference","delivered"]}}}},"400":{"description":"Invalid body","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many messages from this address","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/clubs/{id}":{"get":{"tags":["entities"],"summary":"Club profile: ground, coach, squad, lineage, rivalries, seasons, transfers, records","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Club","content":{"application/json":{"schema":{"type":"object","properties":{"club":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"shortName":{"type":"string"},"country":{"type":"string"},"foundedYear":{"type":"integer"}},"required":["id","name"]},"venue":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"city":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0}},"required":["id","name"]},"coach":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]}},"required":["id","name","role"]},"since":{"type":"string","format":"date"}},"required":["person"]},"squad":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]}},"required":["id","name","role"]},"position":{"type":"string","enum":["GK","DF","MF","FW"]},"shirtNumber":{"type":"integer","exclusiveMinimum":0},"nationality":{"type":"string"},"birthDate":{"type":"string","format":"date"},"since":{"type":"string","format":"date"}},"required":["person"]}},"formerCoaches":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]}},"required":["id","name","role"]},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}},"required":["person"]}},"lineage":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["renamed","refounded","merged","claims_record"]},"direction":{"type":"string","enum":["from","to"]},"other":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"year":{"type":"integer"},"note":{"type":"string"}},"required":["kind","direction","other"]}},"rivalries":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"opponents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]}}},"required":["slug","name","opponents"]}},"seasons":{"type":"array","items":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"seasonKey":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"position":{"type":"integer","exclusiveMinimum":0},"played":{"type":"integer","minimum":0},"points":{"type":"integer"}},"required":["competition","season","seasonKey","played"]}},"transfers":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]}},"required":["id","name","role"]},"direction":{"type":"string","enum":["in","out"]},"date":{"type":"string","format":"date"},"club":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]}},"required":["person","direction"]}},"records":{"type":"object","properties":{"biggestWin":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"biggestLoss":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"longestUnbeaten":{"type":"integer","minimum":0}}}},"required":["club","squad","formerCoaches","lineage","rivalries","seasons","transfers","records"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Club not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/clubs/{id}/leaderboard":{"get":{"tags":["entities"],"summary":"Club scoring board over the stored history: who scored its goals and over how many matches","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Club leaderboard","content":{"application/json":{"schema":{"type":"object","properties":{"club":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"scorers":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]}},"required":["id","name","role"]},"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"goals":{"type":"integer","minimum":0},"apps":{"type":"integer","minimum":0},"yellow":{"type":["integer","null"],"minimum":0},"red":{"type":["integer","null"],"minimum":0}},"required":["person","goals"]}},"matches":{"type":"integer","minimum":0},"first":{"type":"string","format":"date-time"},"last":{"type":"string","format":"date-time"}},"required":["club","scorers","matches"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Club not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/clubs/{id}/opponents":{"get":{"tags":["entities"],"summary":"The most frequent opponents of a club over the stored finished matches, most matches first","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Club opponents","content":{"application/json":{"schema":{"type":"object","properties":{"club":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"opponents":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"matches":{"type":"integer","exclusiveMinimum":0},"goalsFor":{"type":"integer","minimum":0},"goalsAgainst":{"type":"integer","minimum":0}},"required":["team","matches"]}},"matches":{"type":"integer","minimum":0},"first":{"type":"string","format":"date-time"},"last":{"type":"string","format":"date-time"}},"required":["club","opponents","matches"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Club not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/clubs/{id}/grounds":{"get":{"tags":["entities"],"summary":"The grounds a club has played at over the stored finished matches, most matches first","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Club grounds","content":{"application/json":{"schema":{"type":"object","properties":{"club":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"grounds":{"type":"array","items":{"type":"object","properties":{"venue":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"city":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0}},"required":["id","name"]},"matches":{"type":"integer","exclusiveMinimum":0}},"required":["venue","matches"]}},"matches":{"type":"integer","minimum":0},"first":{"type":"string","format":"date-time"},"last":{"type":"string","format":"date-time"}},"required":["club","grounds","matches"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Club not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/seasons":{"get":{"tags":["entities"],"summary":"Seasons of a competition with match counts, champion (when complete) and data credit","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Seasons","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"seasons":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"key":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"matches":{"type":"integer","minimum":0},"champion":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"credit":{"type":"string"}},"required":["name","key","matches"]}}},"required":["competition","seasons"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Competition not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/seasons/{season}":{"get":{"tags":["entities"],"summary":"One season: recomputed table (3/1/0), matches, top scorers, grounds, totals","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":true,"name":"season","in":"path"}],"responses":{"200":{"description":"Season","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"object","properties":{"name":{"type":"string","minLength":1},"key":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"matches":{"type":"integer","minimum":0},"champion":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"credit":{"type":"string"}},"required":["name","key","matches"]},"table":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","exclusiveMinimum":0},"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"played":{"type":"integer","minimum":0},"won":{"type":"integer","minimum":0},"drawn":{"type":"integer","minimum":0},"lost":{"type":"integer","minimum":0},"goalsFor":{"type":"integer","minimum":0},"goalsAgainst":{"type":"integer","minimum":0},"goalDifference":{"type":"integer"},"points":{"type":"integer","minimum":0},"pointsAdjustment":{"type":"integer"},"form":{"type":"array","items":{"type":"string","enum":["W","D","L"]}}},"required":["position","team","played","won","drawn","lost","goalsFor","goalsAgainst","goalDifference","points","form"]}},"tableCoverage":{"type":"object","properties":{"since":{"type":"string","format":"date-time"},"matches":{"type":"integer","exclusiveMinimum":0}},"required":["since","matches"]},"matches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}},"topScorers":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]}},"required":["id","name","role"]},"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"goals":{"type":"integer","minimum":0},"apps":{"type":"integer","minimum":0},"yellow":{"type":["integer","null"],"minimum":0},"red":{"type":["integer","null"],"minimum":0}},"required":["person","goals"]}},"venues":{"type":"array","items":{"type":"object","properties":{"venue":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"city":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0}},"required":["id","name"]},"club":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]}},"required":["venue","club"]}},"totals":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"goals":{"type":"integer","minimum":0},"homeWins":{"type":"integer","minimum":0},"draws":{"type":"integer","minimum":0},"awayWins":{"type":"integer","minimum":0}},"required":["matches","goals","homeWins","draws","awayWins"]}},"required":["competition","season","table","matches","topScorers","venues","totals"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Season not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/seasons/{season}/venues":{"get":{"tags":["entities"],"summary":"Grounds that hosted a season, one row each: games, home wins, draws, away wins and goals","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":true,"name":"season","in":"path"}],"responses":{"200":{"description":"Season venues","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"venues":{"type":"array","items":{"type":"object","properties":{"venue":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"city":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0}},"required":["id","name"]},"played":{"type":"integer","minimum":0},"homeWins":{"type":"integer","minimum":0},"draws":{"type":"integer","minimum":0},"awayWins":{"type":"integer","minimum":0},"goalsHome":{"type":"integer","minimum":0},"goalsAway":{"type":"integer","minimum":0}},"required":["venue","played","homeWins","draws","awayWins","goalsHome","goalsAway"]}}},"required":["competition","season","venues"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Season not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/leaderboard":{"get":{"tags":["entities"],"summary":"A competition all-time scoring board over the stored finished matches","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Competition leaderboard","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"scorers":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]}},"required":["id","name","role"]},"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"goals":{"type":"integer","minimum":0},"apps":{"type":"integer","minimum":0},"yellow":{"type":["integer","null"],"minimum":0},"red":{"type":["integer","null"],"minimum":0}},"required":["person","goals"]}},"matches":{"type":"integer","minimum":0},"first":{"type":"string","format":"date-time"},"last":{"type":"string","format":"date-time"}},"required":["competition","scorers","matches"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Competition not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/venues":{"get":{"tags":["entities"],"summary":"Grounds with the clubs that play there","responses":{"200":{"description":"Venues","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"venue":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"city":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0}},"required":["id","name"]},"clubs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]}},"country":{"type":"string"}},"required":["venue","clubs"]}}},"required":["items"]}}}}}}},"/v1/venues/{id}":{"get":{"tags":["entities"],"summary":"Ground profile: clubs, recent matches and results record","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Venue","content":{"application/json":{"schema":{"type":"object","properties":{"venue":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"city":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0},"country":{"type":"string"},"lat":{"type":"number","minimum":-90,"maximum":90},"lon":{"type":"number","minimum":-180,"maximum":180},"openedYear":{"type":"integer"}},"required":["id","name"]},"clubs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]}},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}},"record":{"type":"object","properties":{"played":{"type":"integer","minimum":0},"homeWins":{"type":"integer","minimum":0},"draws":{"type":"integer","minimum":0},"awayWins":{"type":"integer","minimum":0},"goalsHome":{"type":"integer","minimum":0},"goalsAway":{"type":"integer","minimum":0}},"required":["played","homeWins","draws","awayWins","goalsHome","goalsAway"]}},"required":["venue","clubs","recent","record"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Venue not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/venues/{id}/history":{"get":{"tags":["entities"],"summary":"Ground history: record per season and the standout games played there","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Venue history","content":{"application/json":{"schema":{"type":"object","properties":{"venue":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"city":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0}},"required":["id","name"]},"seasons":{"type":"array","items":{"type":"object","properties":{"season":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"played":{"type":"integer","minimum":0},"homeWins":{"type":"integer","minimum":0},"draws":{"type":"integer","minimum":0},"awayWins":{"type":"integer","minimum":0},"goalsHome":{"type":"integer","minimum":0},"goalsAway":{"type":"integer","minimum":0}},"required":["season","played","homeWins","draws","awayWins","goalsHome","goalsAway"]}},"biggest":{"type":"object","properties":{"homeWin":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"awayWin":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"goals":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}}}},"required":["venue","seasons","biggest"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Venue not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/venues/{id}/tenants":{"get":{"tags":["entities"],"summary":"The clubs that played their finished matches at a ground, most matches first","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Venue tenants","content":{"application/json":{"schema":{"type":"object","properties":{"venue":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"city":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0}},"required":["id","name"]},"tenants":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"matches":{"type":"integer","exclusiveMinimum":0},"goalsFor":{"type":"integer","minimum":0},"goalsAgainst":{"type":"integer","minimum":0}},"required":["team","matches"]}},"matches":{"type":"integer","minimum":0},"first":{"type":"string","format":"date-time"},"last":{"type":"string","format":"date-time"}},"required":["venue","tenants","matches"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Venue not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/people":{"get":{"tags":["entities"],"summary":"Players, coaches or referees ordered by matches","parameters":[{"schema":{"type":"string","enum":["player","coach","referee"]},"required":true,"name":"role","in":"query"},{"schema":{"type":"string","pattern":"^[A-Z]{2}(-[A-Z]{3})?$"},"required":false,"name":"country","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"People","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]}},"required":["id","name","role"]},"nationality":{"type":"string"},"matches":{"type":"integer","minimum":0}},"required":["person","matches"]}}},"required":["items"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/people/{id}":{"get":{"tags":["entities"],"summary":"Person profile: clubs, appearances, neutral officiating averages, coaching form","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Person","content":{"application/json":{"schema":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]},"birthDate":{"type":"string","format":"date"},"birthPlace":{"type":"string"},"nationality":{"type":"string"},"position":{"type":"string","enum":["GK","DF","MF","FW"]},"heightCm":{"type":"integer","exclusiveMinimum":0}},"required":["id","name","role"]},"clubs":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"role":{"type":"string","enum":["player","coach"]},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"apps":{"type":"integer","minimum":0},"goals":{"type":"integer","minimum":0}},"required":["team","role"]}},"appearances":{"type":"array","items":{"type":"object","properties":{"match":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"role":{"type":"string","enum":["start","sub","bench"]},"minuteOn":{"type":"integer","minimum":0},"minuteOff":{"type":"integer","minimum":0},"goals":{"type":"integer","minimum":0},"yellow":{"type":"integer","minimum":0},"red":{"type":"integer","minimum":0}},"required":["match","team","role","goals","yellow","red"]}},"totals":{"type":"object","properties":{"apps":{"type":"integer","minimum":0},"starts":{"type":"integer","minimum":0},"goals":{"type":"integer","minimum":0},"yellow":{"type":"integer","minimum":0},"red":{"type":"integer","minimum":0}},"required":["apps","starts","goals","yellow","red"]},"officiating":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"yellowPerMatch":{"type":"number","minimum":0},"redPerMatch":{"type":"number","minimum":0},"homeWinShare":{"type":"number","minimum":0,"maximum":1},"drawShare":{"type":"number","minimum":0,"maximum":1},"awayWinShare":{"type":"number","minimum":0,"maximum":1}},"required":["matches","yellowPerMatch","redPerMatch","homeWinShare","drawShare","awayWinShare"]},"officiated":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}},"coaching":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"form":{"type":"array","items":{"type":"string","enum":["W","D","L"]}}},"required":["matches","form"]},"notable":{"type":"object","properties":{"biggestWin":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"biggestLoss":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"highestScoring":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}}},"refereeSeasons":{"type":"array","items":{"type":"object","properties":{"season":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"matches":{"type":"integer","minimum":0},"yellow":{"type":"integer","minimum":0},"red":{"type":"integer","minimum":0}},"required":["season","matches","yellow","red"]}}},"required":["person","clubs","appearances","totals","officiated","notable"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Person not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/people/{id}/associations":{"get":{"tags":["entities"],"summary":"Person associations: clubs, competitions, collaborators and opponents derived from stored matches","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Person associations","content":{"application/json":{"schema":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]}},"required":["id","name","role"]},"clubs":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"connection":{"type":"string","enum":["member","refereed","faced"]},"matches":{"type":"integer","exclusiveMinimum":0},"goals":{"type":"integer","minimum":0}},"required":["team","connection","matches"]}},"competitions":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"matches":{"type":"integer","exclusiveMinimum":0}},"required":["slug","name","matches"]}},"collaborators":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]}},"required":["id","name","role"]},"role":{"type":"string","enum":["player","coach","referee"]},"matches":{"type":"integer","exclusiveMinimum":0}},"required":["person","role","matches"]}},"opponents":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"matches":{"type":"integer","exclusiveMinimum":0}},"required":["team","matches"]}},"matches":{"type":"integer","minimum":0},"first":{"type":"string","format":"date-time"},"last":{"type":"string","format":"date-time"}},"required":["person","clubs","competitions","collaborators","opponents","matches"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Person not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/rivalries":{"get":{"tags":["entities"],"summary":"Derbies and rivalries with their clubs","responses":{"200":{"description":"Rivalries","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"opponents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]}}},"required":["slug","name","opponents"]}}},"required":["items"]}}}}}}},"/v1/rivalries/{slug}":{"get":{"tags":["entities"],"summary":"Rivalry: head-to-head summary and matches between member clubs","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Rivalry","content":{"application/json":{"schema":{"type":"object","properties":{"rivalry":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"}},"required":["slug","name"]},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]}},"summary":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"draws":{"type":"integer","minimum":0},"wins":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"wins":{"type":"integer","minimum":0}},"required":["team","wins"]}},"goals":{"type":"integer","minimum":0}},"required":["matches","draws","wins","goals"]},"matches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}}},"required":["rivalry","teams","summary","matches"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Rivalry not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/countries/{code}":{"get":{"tags":["entities"],"summary":"Country: competitions, clubs, grounds, player and referee counts","parameters":[{"schema":{"type":"string","pattern":"^[A-Z]{2}(-[A-Z]{3})?$"},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"Country","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"competitions":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"tier":{"type":"integer"}},"required":["slug","name"]}},"clubs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]}},"venues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"city":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0}},"required":["id","name"]}},"players":{"type":"integer","minimum":0},"referees":{"type":"integer","minimum":0}},"required":["code","competitions","clubs","venues","players","referees"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Country not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/countries/{code}/matches":{"get":{"tags":["entities"],"summary":"Paged recent finished matches across a country's competitions, newest first","parameters":[{"schema":{"type":"string","pattern":"^[A-Z]{2}(-[A-Z]{3})?$"},"required":true,"name":"code","in":"path"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":1000,"default":0},"required":false,"name":"page","in":"query"}],"responses":{"200":{"description":"Country matches","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"matches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}},"page":{"type":"integer","minimum":0},"hasMore":{"type":"boolean"},"seasons":{"type":"array","items":{"type":"object","properties":{"season":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"matches":{"type":"integer","minimum":0},"goals":{"type":"integer","minimum":0}},"required":["season","matches","goals"]}}},"required":["code","matches","page","hasMore","seasons"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Country not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/countries/{code}/top":{"get":{"tags":["entities"],"summary":"A country clubs and grounds by stored finished matches, most matches first","parameters":[{"schema":{"type":"string","pattern":"^[A-Z]{2}(-[A-Z]{3})?$"},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"Country top","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"clubs":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"matches":{"type":"integer","exclusiveMinimum":0},"goalsFor":{"type":"integer","minimum":0},"goalsAgainst":{"type":"integer","minimum":0}},"required":["team","matches"]}},"venues":{"type":"array","items":{"type":"object","properties":{"venue":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"city":{"type":"string"},"capacity":{"type":"integer","exclusiveMinimum":0}},"required":["id","name"]},"matches":{"type":"integer","exclusiveMinimum":0}},"required":["venue","matches"]}},"matches":{"type":"integer","minimum":0},"first":{"type":"string","format":"date-time"},"last":{"type":"string","format":"date-time"}},"required":["code","clubs","venues","matches"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Country not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/entities/search":{"get":{"tags":["entities"],"summary":"Search clubs, people, grounds, competitions and rivalries (diacritics-insensitive)","parameters":[{"schema":{"type":"string","minLength":2,"maxLength":80},"required":true,"name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":30,"default":12},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Results","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["club","person","venue","competition","rivalry","country","pair"]},"key":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]},"detail":{"type":"string"}},"required":["kind","key","name"]}}},"required":["items"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/entities/index":{"get":{"tags":["entities"],"summary":"Paged index of indexable entities for sitemaps (500 per page)","parameters":[{"schema":{"type":"string","enum":["club","person","venue","rivalry"]},"required":true,"name":"kind","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":1000,"default":0},"required":false,"name":"page","in":"query"}],"responses":{"200":{"description":"Index","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["club","person","venue","competition","rivalry","country","pair"]},"key":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]},"detail":{"type":"string"}},"required":["kind","key","name"]}},"next":{"type":"integer","minimum":0}},"required":["items"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/h2h":{"get":{"tags":["entities"],"summary":"Club pairs with at least the minimum of finished meetings (all-time head-to-head index)","parameters":[{"schema":{"type":["integer","null"],"minimum":0,"maximum":1000,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$"},"required":false,"name":"competition","in":"query"}],"responses":{"200":{"description":"Head-to-head pairs","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"teams":{"type":"array","prefixItems":[{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]}]},"played":{"type":"integer","minimum":0},"wins":{"type":"array","prefixItems":[{"type":"integer","minimum":0},{"type":"integer","minimum":0}]},"draws":{"type":"integer","minimum":0},"goals":{"type":"array","prefixItems":[{"type":"integer","minimum":0},{"type":"integer","minimum":0}]},"first":{"type":"string","format":"date-time"},"last":{"type":"string","format":"date-time"}},"required":["teams","played","wins","draws","goals","first","last"]}},"next":{"type":"integer","minimum":0},"minMatches":{"type":"integer","exclusiveMinimum":0},"competitions":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"pairs":{"type":"integer","exclusiveMinimum":0}},"required":["slug","name","pairs"]}}},"required":["items","minMatches","competitions"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/h2h/{a}/{b}":{"get":{"tags":["entities"],"summary":"All-time head-to-head between two clubs (any argument order)","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"a","in":"path"},{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"b","in":"path"}],"responses":{"200":{"description":"Head-to-head","content":{"application/json":{"schema":{"type":"object","properties":{"teams":{"type":"array","prefixItems":[{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]}]},"summary":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"draws":{"type":"integer","minimum":0},"goals":{"type":"integer","minimum":0},"wins":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"wins":{"type":"integer","minimum":0}},"required":["team","wins"]}},"first":{"type":"string","format":"date-time"},"last":{"type":"string","format":"date-time"},"biggest":{"type":"object","properties":{"match":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"margin":{"type":"integer","exclusiveMinimum":0}},"required":["match","margin"]},"runs":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"matches":{"type":"integer","exclusiveMinimum":0}},"required":["team","matches"]}}},"required":["matches","draws","goals","wins","runs"]},"matches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}},"upcoming":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}},"rivalry":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"]}},"required":["teams","summary","matches","upcoming"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Head-to-head not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/entities/counts":{"get":{"tags":["entities"],"summary":"Entity counts (navigation hides empty sections)","responses":{"200":{"description":"Counts","content":{"application/json":{"schema":{"type":"object","properties":{"clubs":{"type":"integer","minimum":0},"players":{"type":"integer","minimum":0},"coaches":{"type":"integer","minimum":0},"referees":{"type":"integer","minimum":0},"venues":{"type":"integer","minimum":0},"rivalries":{"type":"integer","minimum":0}},"required":["clubs","players","coaches","referees","venues","rivalries"]}}}}}}},"/v1/ai-tickets/today":{"get":{"tags":["ai-tickets"],"summary":"Today's AI tickets: daily, weekly (Fridays) and the free single (D39)","description":"The deterministic builder picks the legs; the codai agent explains and may veto, never adds. Anonymous/Free: legs carry only the event and market type (`locked: true`; selection, prices, probabilities and analysis are omitted, not hidden). The daily single and every fully settled ticket are open to all; Premium/Pro (`ai_tickets`) see everything.","responses":{"200":{"description":"Today's tickets","content":{"application/json":{"schema":{"type":"object","properties":{"forDate":{"type":"string","format":"date"},"daily":{"type":["object","null"],"properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"kind":{"type":"string","enum":["daily","weekly","single"]},"forDate":{"type":"string","format":"date"},"status":{"type":"string","enum":["pending","won","lost","void","partial"]},"locked":{"type":"boolean"},"legs":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"league":{"type":["string","null"],"minLength":1},"kickoff":{"type":"string","format":"date-time"},"market":{"type":"string","enum":["1x2","dc"]},"basis":{"type":"string","enum":["model","market"]},"selection":{"type":"integer","minimum":0,"maximum":2},"price":{"type":"number","exclusiveMinimum":1},"probModel":{"type":"number","minimum":0,"maximum":1},"probMarket":{"type":["number","null"],"minimum":0,"maximum":1},"edge":{"type":"number"},"explanation":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]},"result":{"type":"string","enum":["pending","won","lost","void"]},"clv":{"type":["number","null"]},"minPrice":{"type":"number","exclusiveMinimum":1},"priceAt":{"type":"string","format":"date-time"},"modelProb":{"type":"number","minimum":0,"maximum":1}},"required":["eventId","home","away","league","kickoff","market"]},"minItems":1},"basis":{"type":"string","enum":["model","market","mixed"]},"combinedPrice":{"type":"number","exclusiveMinimum":1},"combinedProb":{"type":"number","minimum":0,"maximum":1},"oneIn":{"type":"integer","exclusiveMinimum":0},"margin":{"type":"number"},"ranking":{"type":"string","enum":["market-first"]},"summary":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]},"source":{"type":"string","enum":["agent","fallback"]},"valueEnabled":{"type":"boolean"},"vetoes":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"reason":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]}},"required":["eventId","home","away","kickoff","reason"]}},"modelVersion":{"type":"string","minLength":1},"agentModel":{"type":["string","null"],"minLength":1},"hash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"prevHash":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"publishedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"clv":{"type":["number","null"]},"brier":{"type":["number","null"]}},"required":["id","kind","forDate","status","locked","legs","source","valueEnabled","vetoes","modelVersion","agentModel","hash","prevHash","publishedAt","settledAt"]},"weekly":{"type":["object","null"],"properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"kind":{"type":"string","enum":["daily","weekly","single"]},"forDate":{"type":"string","format":"date"},"status":{"type":"string","enum":["pending","won","lost","void","partial"]},"locked":{"type":"boolean"},"legs":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"league":{"type":["string","null"],"minLength":1},"kickoff":{"type":"string","format":"date-time"},"market":{"type":"string","enum":["1x2","dc"]},"basis":{"type":"string","enum":["model","market"]},"selection":{"type":"integer","minimum":0,"maximum":2},"price":{"type":"number","exclusiveMinimum":1},"probModel":{"type":"number","minimum":0,"maximum":1},"probMarket":{"type":["number","null"],"minimum":0,"maximum":1},"edge":{"type":"number"},"explanation":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]},"result":{"type":"string","enum":["pending","won","lost","void"]},"clv":{"type":["number","null"]},"minPrice":{"type":"number","exclusiveMinimum":1},"priceAt":{"type":"string","format":"date-time"},"modelProb":{"type":"number","minimum":0,"maximum":1}},"required":["eventId","home","away","league","kickoff","market"]},"minItems":1},"basis":{"type":"string","enum":["model","market","mixed"]},"combinedPrice":{"type":"number","exclusiveMinimum":1},"combinedProb":{"type":"number","minimum":0,"maximum":1},"oneIn":{"type":"integer","exclusiveMinimum":0},"margin":{"type":"number"},"ranking":{"type":"string","enum":["market-first"]},"summary":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]},"source":{"type":"string","enum":["agent","fallback"]},"valueEnabled":{"type":"boolean"},"vetoes":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"reason":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]}},"required":["eventId","home","away","kickoff","reason"]}},"modelVersion":{"type":"string","minLength":1},"agentModel":{"type":["string","null"],"minLength":1},"hash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"prevHash":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"publishedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"clv":{"type":["number","null"]},"brier":{"type":["number","null"]}},"required":["id","kind","forDate","status","locked","legs","source","valueEnabled","vetoes","modelVersion","agentModel","hash","prevHash","publishedAt","settledAt"]},"single":{"type":["object","null"],"properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"kind":{"type":"string","enum":["daily","weekly","single"]},"forDate":{"type":"string","format":"date"},"status":{"type":"string","enum":["pending","won","lost","void","partial"]},"locked":{"type":"boolean"},"legs":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"league":{"type":["string","null"],"minLength":1},"kickoff":{"type":"string","format":"date-time"},"market":{"type":"string","enum":["1x2","dc"]},"basis":{"type":"string","enum":["model","market"]},"selection":{"type":"integer","minimum":0,"maximum":2},"price":{"type":"number","exclusiveMinimum":1},"probModel":{"type":"number","minimum":0,"maximum":1},"probMarket":{"type":["number","null"],"minimum":0,"maximum":1},"edge":{"type":"number"},"explanation":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]},"result":{"type":"string","enum":["pending","won","lost","void"]},"clv":{"type":["number","null"]},"minPrice":{"type":"number","exclusiveMinimum":1},"priceAt":{"type":"string","format":"date-time"},"modelProb":{"type":"number","minimum":0,"maximum":1}},"required":["eventId","home","away","league","kickoff","market"]},"minItems":1},"basis":{"type":"string","enum":["model","market","mixed"]},"combinedPrice":{"type":"number","exclusiveMinimum":1},"combinedProb":{"type":"number","minimum":0,"maximum":1},"oneIn":{"type":"integer","exclusiveMinimum":0},"margin":{"type":"number"},"ranking":{"type":"string","enum":["market-first"]},"summary":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]},"source":{"type":"string","enum":["agent","fallback"]},"valueEnabled":{"type":"boolean"},"vetoes":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"reason":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]}},"required":["eventId","home","away","kickoff","reason"]}},"modelVersion":{"type":"string","minLength":1},"agentModel":{"type":["string","null"],"minLength":1},"hash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"prevHash":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"publishedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"clv":{"type":["number","null"]},"brier":{"type":["number","null"]}},"required":["id","kind","forDate","status","locked","legs","source","valueEnabled","vetoes","modelVersion","agentModel","hash","prevHash","publishedAt","settledAt"]},"experimental":{"type":"boolean"}},"required":["forDate","daily","weekly","single"]}}}}}}},"/v1/ai-tickets":{"get":{"tags":["ai-tickets"],"summary":"AI ticket history, newest first (cursor `before` = forDate)","description":"Anonymous/Free: legs carry only the event and market type (`locked: true`; selection, prices, probabilities and analysis are omitted, not hidden). The daily single and every fully settled ticket are open to all; Premium/Pro (`ai_tickets`) see everything.","parameters":[{"schema":{"type":"string","enum":["daily","weekly","single"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"before","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"One page of tickets","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"kind":{"type":"string","enum":["daily","weekly","single"]},"forDate":{"type":"string","format":"date"},"status":{"type":"string","enum":["pending","won","lost","void","partial"]},"locked":{"type":"boolean"},"legs":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"league":{"type":["string","null"],"minLength":1},"kickoff":{"type":"string","format":"date-time"},"market":{"type":"string","enum":["1x2","dc"]},"basis":{"type":"string","enum":["model","market"]},"selection":{"type":"integer","minimum":0,"maximum":2},"price":{"type":"number","exclusiveMinimum":1},"probModel":{"type":"number","minimum":0,"maximum":1},"probMarket":{"type":["number","null"],"minimum":0,"maximum":1},"edge":{"type":"number"},"explanation":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]},"result":{"type":"string","enum":["pending","won","lost","void"]},"clv":{"type":["number","null"]},"minPrice":{"type":"number","exclusiveMinimum":1},"priceAt":{"type":"string","format":"date-time"},"modelProb":{"type":"number","minimum":0,"maximum":1}},"required":["eventId","home","away","league","kickoff","market"]},"minItems":1},"basis":{"type":"string","enum":["model","market","mixed"]},"combinedPrice":{"type":"number","exclusiveMinimum":1},"combinedProb":{"type":"number","minimum":0,"maximum":1},"oneIn":{"type":"integer","exclusiveMinimum":0},"margin":{"type":"number"},"ranking":{"type":"string","enum":["market-first"]},"summary":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]},"source":{"type":"string","enum":["agent","fallback"]},"valueEnabled":{"type":"boolean"},"vetoes":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"reason":{"type":"object","properties":{"ro":{"type":"string"},"en":{"type":"string"}},"required":["ro","en"]}},"required":["eventId","home","away","kickoff","reason"]}},"modelVersion":{"type":"string","minLength":1},"agentModel":{"type":["string","null"],"minLength":1},"hash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"prevHash":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"publishedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"clv":{"type":["number","null"]},"brier":{"type":["number","null"]}},"required":["id","kind","forDate","status","locked","legs","source","valueEnabled","vetoes","modelVersion","agentModel","hash","prevHash","publishedAt","settledAt"]}},"nextBefore":{"type":["string","null"],"format":"date"}},"required":["items","nextBefore"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/ai-tickets/record":{"get":{"tags":["ai-tickets"],"summary":"Public track record by kind: mean CLV, Brier, hit rate with n, flat-stake ROI","responses":{"200":{"description":"Track record","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["daily","weekly","single"]},"n":{"type":"integer","minimum":0},"won":{"type":"integer","minimum":0},"hitRate":{"type":["number","null"]},"meanClv":{"type":["number","null"]},"clvN":{"type":"integer","minimum":0},"brier":{"type":["number","null"]},"roi":{"type":["number","null"]},"from":{"type":["string","null"],"format":"date"},"to":{"type":["string","null"],"format":"date"},"hitRateCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]}},"required":["kind","n","won","hitRate","meanClv","clvN","brier","roi","from","to"]}},"acceptance":{"type":"object","properties":{"n":{"type":"integer","minimum":0},"minN":{"type":"integer","exclusiveMinimum":0},"mean":{"type":["number","null"]},"lo":{"type":["number","null"]},"hi":{"type":["number","null"]},"verdict":{"type":"string","enum":["too_few","positive","negative","noise"]},"consensusPrice":{"type":"boolean"}},"required":["n","minN","mean","lo","hi","verdict","consensusPrice"]},"experimental":{"type":"boolean"},"roiMinN":{"type":"integer","exclusiveMinimum":0},"computedAt":{"type":"string","format":"date-time"}},"required":["rows","computedAt"]}}}}}}},"/v1/mail/unsubscribe":{"get":{"tags":["account"],"summary":"One-click unsubscribe (weekly digest, alert emails) with the HMAC-signed token from the message","parameters":[{"schema":{"type":"string","maxLength":512},"required":true,"name":"token","in":"query"}],"responses":{"200":{"description":"HTML confirmation page","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"Invalid or expired token (HTML page)","content":{"text/html":{"schema":{"type":"string"}}}},"503":{"description":"Not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["account"],"summary":"One-click unsubscribe (weekly digest, alert emails) with the HMAC-signed token from the message","parameters":[{"schema":{"type":"string","maxLength":512},"required":true,"name":"token","in":"query"}],"responses":{"200":{"description":"HTML confirmation page","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"Invalid or expired token (HTML page)","content":{"text/html":{"schema":{"type":"string"}}}},"503":{"description":"Not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/funnel":{"post":{"tags":["analytics"],"summary":"First-party product event beacon (allow-listed names, no personal data, anonymous)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["paywall_open","upgrade_cta","pricing_view","checkout_click","onboarding_shown","onboarding_done","push_prompt_shown","push_granted","push_denied","digest_optin_signup","xray_run","follow","share","ai_ticket_open","digest_toggle","install_click","channel_click"]},"anonId":{"type":"string","pattern":"^[A-Za-z0-9-]{8,64}$"},"source":{"type":"string","maxLength":64,"pattern":"^[a-z0-9_/-]*$"},"props":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":64,"pattern":"^[^@]*$"},{"type":"number"},{"type":"boolean"}]}}},"required":["event","anonId"]}},"text/plain":{"schema":{"type":"string"}}}},"responses":{"204":{"description":"Recorded (or dropped when the database is not configured)"},"400":{"description":"Invalid event","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many events from this address","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/waitlist":{"post":{"tags":["analytics"],"summary":"Founders waitlist: sends a double opt-in confirmation e-mail (same answer for every address)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"locale":{"type":"string","enum":["ro","en"],"default":"ro"},"source":{"type":"string","enum":["upgrade_dialog","pricing"]},"consent":{"type":"boolean","enum":[true]},"website":{"type":"string","maxLength":200}},"required":["email","source","consent"]}}}},"responses":{"202":{"description":"Pending confirmation","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending"]}},"required":["status"]}}}},"400":{"description":"Invalid body","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests from this address","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/waitlist/confirm":{"get":{"tags":["analytics"],"summary":"Founders waitlist: confirm the address (link from the e-mail)","parameters":[{"schema":{"type":"string","maxLength":512},"required":true,"name":"token","in":"query"}],"responses":{"200":{"description":"HTML confirmation page","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"Invalid or expired link (HTML page)","content":{"text/html":{"schema":{"type":"string"}}}},"503":{"description":"Not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/waitlist/unsubscribe":{"get":{"tags":["analytics"],"summary":"Founders waitlist: leave the list (signed link, one click)","parameters":[{"schema":{"type":"string","maxLength":512},"required":true,"name":"token","in":"query"}],"responses":{"200":{"description":"HTML confirmation page","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"Invalid or expired link (HTML page)","content":{"text/html":{"schema":{"type":"string"}}}},"503":{"description":"Not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["analytics"],"summary":"Founders waitlist: leave the list (signed link, one click)","parameters":[{"schema":{"type":"string","maxLength":512},"required":true,"name":"token","in":"query"}],"responses":{"200":{"description":"HTML confirmation page","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"Invalid or expired link (HTML page)","content":{"text/html":{"schema":{"type":"string"}}}},"503":{"description":"Not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/status":{"get":{"tags":["site"],"summary":"Public status: per-component state from the hourly health checks and 7 days of history","responses":{"200":{"description":"Status page","content":{"application/json":{"schema":{"type":"object","properties":{"overall":{"type":"string","enum":["ok","degraded","down","unknown"]},"generatedAt":{"type":"string","format":"date-time"},"components":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["web","api","live","odds","results","push","data","data-watch","search"]},"state":{"type":"string","enum":["ok","degraded","down","unknown"]},"checkedAt":{"type":"string","format":"date-time"},"stale":{"type":"boolean"},"history":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"okRatio":{"type":["number","null"],"minimum":0,"maximum":1}},"required":["day","okRatio"]}}},"required":["id","state","history"]}}},"required":["overall","generatedAt","components"]}}}}}}},"/v1/me/course":{"get":{"tags":["account"],"summary":"My email course status (\"How to read probabilities\", 7 lessons)","responses":{"200":{"description":"Course status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseStatus"}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["account"],"summary":"Opt in to the 7-day email course (verified email required; resumes or restarts)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"optIn":{"type":"boolean","enum":[true]}},"required":["optIn"],"additionalProperties":false}}}},"responses":{"200":{"description":"Course status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseStatus"}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Email address not verified","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["account"],"summary":"Stop the email course","responses":{"200":{"description":"Course status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseStatus"}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/course/unsubscribe":{"get":{"tags":["account"],"summary":"One-click stop of the email course with the HMAC-signed token from a lesson","parameters":[{"schema":{"type":"string","maxLength":512},"required":true,"name":"token","in":"query"}],"responses":{"200":{"description":"HTML confirmation page","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"Invalid or expired token (HTML page)","content":{"text/html":{"schema":{"type":"string"}}}},"503":{"description":"Not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["account"],"summary":"One-click stop of the email course with the HMAC-signed token from a lesson","parameters":[{"schema":{"type":"string","maxLength":512},"required":true,"name":"token","in":"query"}],"responses":{"200":{"description":"HTML confirmation page","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"Invalid or expired token (HTML page)","content":{"text/html":{"schema":{"type":"string"}}}},"503":{"description":"Not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/luck":{"get":{"tags":["reports"],"summary":"Luck table: league points vs the points the no-margin closing market expected (rc1108)","description":"Finished matches of the current season with a closing 1X2 line (T-5, else T-60, else the consensus row): xPts = 3·P(win) + P(draw) after Shin margin removal. luck = points − xPts. Teams with fewer than `minMatches` closes are listed unranked (`qualified: false`). Public, shared-cacheable.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Luck table","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"minMatches":{"type":"integer","exclusiveMinimum":0},"finishedMatches":{"type":"integer","minimum":0},"closedMatches":{"type":"integer","minimum":0},"rows":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"integer","exclusiveMinimum":0},"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"played":{"type":"integer","minimum":0},"matches":{"type":"integer","minimum":0},"points":{"type":"integer","minimum":0},"expectedPoints":{"type":"number","minimum":0},"luck":{"type":"number"},"qualified":{"type":"boolean"}},"required":["team","played","matches","points","expectedPoints","luck","qualified"]}}},"required":["competition","minMatches","finishedMatches","closedMatches","rows"]}}}},"400":{"description":"Invalid slug","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition or no season","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/goal-timing":{"get":{"tags":["reports"],"summary":"Goal timing: goals and concessions per 15-minute bucket, by club and league season (T135)","description":"Where a club scores and where it concedes during a match, in six 15-minute buckets (1-15, 16-30, 31-45, 46-60, 61-75, 76-90): counts, share of the sample, the sample size `n`, a first-half/second-half split and the most dangerous bucket, for attack and defence. `scope=league` needs `competition` (optional `season`, default the current one) and returns one row per club; `scope=club` needs `club` and returns that club only, optionally narrowed by `competition`/`season`. Minutes come from the stored match timeline; a match without one adds no goals and the sample reports it (`withTimeline`). Small samples are returned, flagged `reliable: false`, never hidden. Public, shared-cacheable.","parameters":[{"schema":{"type":"string","enum":["club","league"]},"required":true,"name":"scope","in":"query"},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":false,"name":"competition","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":false,"name":"season","in":"query"},{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":false,"name":"club","in":"query"}],"responses":{"200":{"description":"Goal timing","content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string","enum":["club","league"]},"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"minGoals":{"type":"integer","exclusiveMinimum":0},"buckets":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":5},"from":{"type":"integer","exclusiveMinimum":0},"to":{"type":"integer","exclusiveMinimum":0}},"required":["index","from","to"]}},"sample":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"withTimeline":{"type":"integer","minimum":0},"goals":{"type":"integer","minimum":0}},"required":["matches","withTimeline","goals"]},"club":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"rows":{"type":"array","items":{"type":"object","properties":{"club":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"matches":{"type":"integer","minimum":0},"goalsFor":{"type":"integer","minimum":0},"goalsAgainst":{"type":"integer","minimum":0},"reliable":{"type":"boolean"},"attack":{"type":"object","properties":{"buckets":{"type":"array","items":{"type":"integer","minimum":0}},"shares":{"type":"array","items":{"type":["number","null"],"minimum":0,"maximum":1}},"total":{"type":"integer","minimum":0},"firstHalf":{"type":"integer","minimum":0},"secondHalf":{"type":"integer","minimum":0},"mostDangerous":{"type":["integer","null"],"minimum":0,"maximum":5}},"required":["buckets","shares","total","firstHalf","secondHalf","mostDangerous"]},"defence":{"type":"object","properties":{"buckets":{"type":"array","items":{"type":"integer","minimum":0}},"shares":{"type":"array","items":{"type":["number","null"],"minimum":0,"maximum":1}},"total":{"type":"integer","minimum":0},"firstHalf":{"type":"integer","minimum":0},"secondHalf":{"type":"integer","minimum":0},"mostDangerous":{"type":["integer","null"],"minimum":0,"maximum":5}},"required":["buckets","shares","total","firstHalf","secondHalf","mostDangerous"]}},"required":["club","matches","goalsFor","goalsAgainst","reliable","attack","defence"]}}},"required":["scope","minGoals","buckets","sample","rows"]}}}},"400":{"description":"scope=club without club, or scope=league without competition","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition, season or club","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/calendar":{"get":{"tags":["calendar"],"summary":"ICS feed: the followed teams/competitions (session) or one public competition","description":"RFC 5545 VCALENDAR of the upcoming fixtures. Without `competition` it is the personal feed of the teams and competitions the signed-in user follows (session cookie, no token in the URL). With `competition=<slug>` it is the public feed of that competition (no account). UID is stable per match, so a re-read updates an event rather than adding a duplicate.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":false,"name":"competition","in":"query"}],"responses":{"200":{"description":"ICS calendar (text/calendar; charset=utf-8)","content":{"text/calendar":{"schema":{"type":"string"}}}},"400":{"description":"Invalid competition slug","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required for the personal feed","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/calendar/preview":{"get":{"tags":["calendar"],"summary":"Next fixtures of the followed teams for the calendar page","description":"The calendar page payload: the next fixtures of the teams and competitions the user follows, the personal ICS feed URL (session cookie; never a secret in the URL) and how many days the feed covers. Personalised, so never share-cached.","responses":{"200":{"description":"Preview","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"competition":{"type":"string","minLength":1},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"venue":{"type":"string","minLength":1},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","competition","home","away"]}},"feedUrl":{"type":"string","minLength":1},"days":{"type":"integer","exclusiveMinimum":0},"hasFollows":{"type":"boolean"}},"required":["items","feedUrl","days","hasFollows"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/ledger/matches/{eventId}/proof":{"get":{"tags":["ledger"],"summary":"The public ledger proof for one match: the pick, its chain position and the commitment covering it","description":"Returns null when the ledger has no public system pick for the match. `anchored` is true only when a published daily commitment (see /v1/ledger/head) covers the pick; when anchoring is off (LEDGER_ANCHOR_SECRET unset) it is false and the page says so instead of implying a proof that does not exist.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"eventId","in":"path"}],"responses":{"200":{"description":"The proof, or null when no public pick exists for the match","content":{"application/json":{"schema":{"type":"object","properties":{"pick":{"type":["object","null"],"properties":{"pick":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"league":{"type":["string","null"],"minLength":1},"kickoff":{"type":"string","format":"date-time"},"market":{"type":"string","minLength":1},"outcome":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"backfill":{"type":"boolean"},"odds":{"type":"number","exclusiveMinimum":1},"modelProbability":{"type":["number","null"],"minimum":0,"maximum":1},"closingOdds":{"type":["number","null"],"exclusiveMinimum":1},"closingFairProbability":{"type":["number","null"],"minimum":0,"maximum":1},"clv":{"type":["number","null"]},"result":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"placedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"counted":{"type":"boolean","default":true},"prevHash":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"hash":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["id","eventId","home","away","league","kickoff","market","outcome","model","backfill","odds","modelProbability","closingOdds","closingFairProbability","clv","result","placedAt","settledAt","prevHash","hash"]},"index":{"type":"integer","minimum":0},"head":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"anchor":{"type":["object","null"],"properties":{"day":{"type":"string","format":"date"},"head":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"anchoredAt":{"type":"string","format":"date-time"},"algorithm":{"type":"string","enum":["HMAC-SHA256"]},"signature":{"type":"string","pattern":"^[0-9a-f]{64}$"},"prevSignature":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"}},"required":["day","head","picks","settled","anchoredAt","algorithm","signature","prevSignature"]},"anchored":{"type":"boolean"},"covered":{"type":"boolean"},"checkedAt":{"type":"string","format":"date-time"}},"required":["pick","index","head","anchor","anchored","covered","checkedAt"]}},"required":["pick"]}}}},"400":{"description":"Invalid id","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/power":{"get":{"tags":["match-center"],"summary":"Cross-league power index: model ratings with the change vs the previous snapshot (T220)","description":"Every club the Dixon-Coles model rates across the football competitions: its league, attack/defence, the rating (attack + defence), the delta against the previous strength snapshot (null when there is none, never a fake 0) and a global rank by strength. Public, shared-cacheable; a model estimate, not a promise.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$"},"required":false,"name":"competition","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":40},"required":false,"name":"season","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":200},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Power index","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":["string","null"],"minLength":1},"window":{"type":"object","properties":{"from":{"type":["string","null"],"format":"date-time"},"to":{"type":["string","null"],"format":"date-time"}},"required":["from","to"]},"deltaAvailable":{"type":"boolean"},"leagues":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]}},"seasons":{"type":"array","items":{"type":"string","minLength":1}},"rated":{"type":"integer","minimum":0},"matches":{"type":"integer","minimum":0},"rows":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"integer","exclusiveMinimum":0},"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"league":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"rating":{"type":"number"},"attack":{"type":"number"},"defence":{"type":"number"},"goalsFor":{"type":"number","minimum":0},"goalsAgainst":{"type":"number","minimum":0},"prior":{"type":"boolean"},"delta":{"type":["number","null"]},"previousRating":{"type":["number","null"]},"snapshotAt":{"type":"string","format":"date-time"}},"required":["rank","team","league","rating","attack","defence","goalsFor","goalsAgainst","prior","delta","previousRating","snapshotAt"]}}},"required":["model","window","deltaAvailable","leagues","seasons","rated","matches","rows"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/race":{"get":{"tags":["match-center"],"summary":"Title and relegation race tracker with the weekly deltas (T211)","description":"The projected title race (top group) and relegation race (bottom group) of one competition and season: per club its current position, points and played, its race probability (P(title) / P(relegation)) and the change against the previous stored snapshot — the weekly delta — plus the biggest movers of the week. Public and anonymous (D23): zone probabilities only, never the full position distribution, and no bookmaker names (D01).","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$"},"required":false,"name":"competition","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":false,"name":"season","in":"query"}],"responses":{"200":{"description":"Race tracker","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"projection":{"type":["object","null"],"properties":{"computedAt":{"type":"string","format":"date-time"},"sims":{"type":"integer","exclusiveMinimum":0},"playedFixtures":{"type":"integer","minimum":0},"remainingFixtures":{"type":"integer","minimum":0},"phase":{"type":"string","enum":["regular","full"]}},"required":["computedAt","sims","playedFixtures","remainingFixtures","phase"]},"previous":{"type":["object","null"],"properties":{"computedAt":{"type":"string","format":"date-time"},"sims":{"type":"integer","exclusiveMinimum":0},"playedFixtures":{"type":"integer","minimum":0},"remainingFixtures":{"type":"integer","minimum":0},"phase":{"type":"string","enum":["regular","full"]}},"required":["computedAt","sims","playedFixtures","remainingFixtures","phase"]},"deltaDays":{"type":["number","null"],"minimum":0},"groups":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["title","relegation"]},"zone":{"type":"string","minLength":1},"rows":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"position":{"type":"integer","exclusiveMinimum":0},"points":{"type":"integer","minimum":0},"played":{"type":"integer","minimum":0},"probability":{"type":"number","minimum":0,"maximum":1},"delta":{"type":"number","minimum":-100,"maximum":100},"expectedPosition":{"type":"number","exclusiveMinimum":0},"positionDelta":{"type":["number","null"]}},"required":["team","position","points","played","probability","delta","expectedPosition","positionDelta"]}}},"required":["key","zone","rows"]}},"movers":{"type":"object","properties":{"up":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"key":{"type":"string","enum":["title","relegation"]},"probability":{"type":"number","minimum":0,"maximum":1},"delta":{"type":"number"}},"required":["team","key","probability","delta"]}},"down":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"key":{"type":"string","enum":["title","relegation"]},"probability":{"type":"number","minimum":0,"maximum":1},"delta":{"type":"number"}},"required":["team","key","probability","delta"]}}},"required":["up","down"]}},"required":["competition","projection","previous","deltaDays","groups","movers"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition or no projection to read","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/records":{"get":{"tags":["reports"],"summary":"Records and streaks: biggest wins, unbeaten runs and the top scorers per season (T133)","description":"Three leaderboards over the stored history (RSSSF Liga 1 from 2000/01, big-5 from 2010/11), each capped at `limit`:\n- `biggestWins`: the widest winning margins of the scope, largest first (ties: more goals, then newer).\n- `unbeatenRuns`: the longest runs of finished matches without a defeat, one per club and season, over the newest seasons the scope covers. A run never crosses a season break; `current` marks a run that reaches the club's last finished match of that season in the stored data, so no defeat closed it inside the season.\n- `topScorers`: one row per season and person, newest season first (ties: fewer appearances, then name). A player who scored for two clubs inside one season is one row: `goals` and `apps` count both, and `team` is the club they scored most of them for.\nA finished match carrying an OPEN discrepancy row (D35) is left out of all three lists. `scope` repeats the window the answer actually used. Public, shared-cacheable.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$"},"required":false,"name":"competition","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":false,"name":"season","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Records and streaks of the requested scope","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"object","properties":{"key":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"name":{"type":"string","minLength":1}},"required":["key","name"]},"scope":{"type":"object","properties":{"competitions":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"matches":{"type":"integer","exclusiveMinimum":0}},"required":["slug","name","matches"]}},"seasons":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"name":{"type":"string","minLength":1}},"required":["key","name"]}},"matches":{"type":"integer","minimum":0},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["competitions","seasons","matches"]},"limit":{"type":"integer","exclusiveMinimum":0},"biggestWins":{"type":"array","items":{"type":"object","properties":{"match":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"winner":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"margin":{"type":"integer","exclusiveMinimum":0},"season":{"type":"string","minLength":1}},"required":["match","winner","margin"]}},"unbeatenRuns":{"type":"array","items":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"season":{"type":"string","minLength":1},"matches":{"type":"integer","exclusiveMinimum":0},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"current":{"type":"boolean"}},"required":["team","season","matches","from","to","current"]}},"topScorers":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["player","coach","referee"]}},"required":["id","name","role"]},"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"season":{"type":"string","minLength":1},"goals":{"type":"integer","exclusiveMinimum":0},"apps":{"type":"integer","minimum":0}},"required":["person","team","season","goals","apps"]}}},"required":["scope","limit","biggestWins","unbeatenRuns","topScorers"]}}}},"400":{"description":"Invalid query","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition or season","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Records not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/clubs/{id}/comebacks":{"get":{"tags":["entities"],"summary":"Comeback record of a club: avoided defeat when trailing, and the mirror of losing when leading (T316)","description":"The comeback record of one club over its readable finished matches, a statistic only:\n- `trailing`: matches the club was strictly behind in at some moment (reconstructed from the goals in the order they were scored).\n- `avoidedDefeat` / `won`: of those, how many it did not lose (drew or won) and how many it won outright.\n- `rate`: `avoidedDefeat / trailing`, with its `ci` Wilson 95 % interval — both present only once the club has at least `NOISE_MIN_N` trailing matches, otherwise `reliable` is false and no rate is claimed.\n- `leading` / `lostAfterLeading`: the mirror, for the matches the club led and lost.\nOnly matches whose published goal timeline adds up to the final score are read; the rest are counted in `withoutTimeline` and excluded, never guessed. Public, shared-cacheable.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Club comeback record","content":{"application/json":{"schema":{"type":"object","properties":{"club":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"matches":{"type":"integer","minimum":0},"withoutTimeline":{"type":"integer","minimum":0},"trailing":{"type":"integer","minimum":0},"avoidedDefeat":{"type":"integer","minimum":0},"won":{"type":"integer","minimum":0},"rate":{"type":["number","null"],"minimum":0,"maximum":1},"ci":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]},"reliable":{"type":"boolean"},"leading":{"type":"integer","minimum":0},"lostAfterLeading":{"type":"integer","minimum":0},"first":{"type":"string","format":"date-time"},"last":{"type":"string","format":"date-time"}},"required":["club","matches","withoutTimeline","trailing","avoidedDefeat","won","rate","ci","reliable","leading","lostAfterLeading"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Club not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Comebacks not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/clubs/{id}/history":{"get":{"tags":["entities"],"summary":"Club history: on-this-day matches and all-time rivalries (T224)","description":"The two archive stories of one club in a single payload, a statistic only:\n- `onThisDay`: the finished matches the club played on one calendar day and month (`month`, `day`, read in UTC) in any stored season, newest first, capped — factual history: score, competition, season.\n- `rivalries.mostPlayed`: every opponent the club has met, most meetings first, each with its win/draw/loss counts and the club’s win rate with its Wilson 95 % interval (`ci`) — the interval and rate are present only once the opponent has at least `NOISE_MIN_N` meetings, otherwise `reliable` is false and no rate is claimed.\n- `rivalries.mostBalanced`: among opponents with at least `NOISE_MIN_N` meetings, the ones whose record is closest to even.\nOnly finished matches with a stored score are read; nothing is guessed. Never a prediction, an odd, an operator or a person name (D01/D03). Public, shared-cacheable.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Club history","content":{"application/json":{"schema":{"type":"object","properties":{"club":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"onThisDay":{"type":"object","properties":{"month":{"type":"integer","minimum":1,"maximum":12},"day":{"type":"integer","minimum":1,"maximum":31},"matches":{"type":"array","items":{"type":"object","properties":{"match":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"season":{"type":"string","minLength":1}},"required":["match"]}}},"required":["month","day","matches"]},"rivalries":{"type":"object","properties":{"mostPlayed":{"type":"array","items":{"type":"object","properties":{"opponent":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"matches":{"type":"integer","minimum":0},"wins":{"type":"integer","minimum":0},"draws":{"type":"integer","minimum":0},"losses":{"type":"integer","minimum":0},"rate":{"type":["number","null"],"minimum":0,"maximum":1},"ci":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]},"reliable":{"type":"boolean"}},"required":["opponent","matches","wins","draws","losses","rate","ci","reliable"]}},"mostBalanced":{"type":"array","items":{"type":"object","properties":{"opponent":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"matches":{"type":"integer","minimum":0},"wins":{"type":"integer","minimum":0},"draws":{"type":"integer","minimum":0},"losses":{"type":"integer","minimum":0},"rate":{"type":["number","null"],"minimum":0,"maximum":1},"ci":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]},"reliable":{"type":"boolean"}},"required":["opponent","matches","wins","draws","losses","rate","ci","reliable"]}}},"required":["mostPlayed","mostBalanced"]}},"required":["club","onThisDay","rivalries"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Club not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Club history not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/scorecard":{"get":{"tags":["reports"],"summary":"Round scorecard: model vs no-margin market per matchday, with season totals (T140)","description":"Every finished fixture of the current season (or `?season=`) that had a pre-kickoff 1X2 prediction, grouped by matchday: the model probability of the result against the Shin no-margin consensus closing probability, whether the two sides disagreed by at least 5 percentage points, whose favourite matched, and the per-match multiclass Brier / log loss. The season totals carry the model and market Brier, how often each was closer, the disagreement count and a ten-decile calibration of the model. Every number travels with the sample it is computed on and is null where the sample cannot support it (D47). Public, shared-cacheable, no bookmaker names (D01).","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"competition","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":32},"required":false,"name":"season","in":"query"}],"responses":{"200":{"description":"Scorecard index","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"current":{"type":["integer","null"],"exclusiveMinimum":0},"rounds":{"type":"array","items":{"type":"object","properties":{"round":{"type":"integer","exclusiveMinimum":0},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"matches":{"type":"integer","minimum":0},"marketMatches":{"type":"integer","minimum":0},"modelBrier":{"type":["number","null"],"minimum":0},"marketBrier":{"type":["number","null"],"minimum":0},"disagreements":{"type":"integer","minimum":0},"closer":{"type":"object","properties":{"model":{"type":"integer","minimum":0},"market":{"type":"integer","minimum":0},"level":{"type":"integer","minimum":0}},"required":["model","market","level"]}},"required":["round","from","to","matches","marketMatches","modelBrier","marketBrier","disagreements","closer"]}},"totals":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"marketMatches":{"type":"integer","minimum":0},"modelBrier":{"type":["number","null"],"minimum":0},"modelLogLoss":{"type":["number","null"],"minimum":0},"marketBrier":{"type":["number","null"],"minimum":0},"marketLogLoss":{"type":["number","null"],"minimum":0},"modelBrierOnMarketSubset":{"type":["number","null"],"minimum":0},"modelLogLossOnMarketSubset":{"type":["number","null"],"minimum":0},"closer":{"type":"object","properties":{"model":{"type":"integer","minimum":0},"market":{"type":"integer","minimum":0},"level":{"type":"integer","minimum":0}},"required":["model","market","level"]},"right":{"type":"object","properties":{"model":{"type":"integer","minimum":0},"market":{"type":"integer","minimum":0},"both":{"type":"integer","minimum":0},"neither":{"type":"integer","minimum":0}},"required":["model","market","both","neither"]},"disagreements":{"type":"integer","minimum":0},"edge":{"type":"object","properties":{"n":{"type":"integer","minimum":0},"meanDiff":{"type":["number","null"]},"sd":{"type":["number","null"],"minimum":0},"se":{"type":["number","null"],"minimum":0},"halfWidth":{"type":["number","null"],"minimum":0},"lo":{"type":["number","null"]},"hi":{"type":["number","null"]},"favoursModel":{"type":"boolean"}},"required":["n","meanDiff","sd","se","halfWidth","lo","hi","favoursModel"]},"calibration":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9},"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1},"n":{"type":"integer","minimum":0},"predicted":{"type":["number","null"],"minimum":0,"maximum":1},"observed":{"type":["number","null"],"minimum":0,"maximum":1}},"required":["index","lo","hi","n","predicted","observed"]}}},"required":["matches","marketMatches","modelBrier","modelLogLoss","marketBrier","marketLogLoss","modelBrierOnMarketSubset","modelLogLossOnMarketSubset","closer","right","disagreements","edge","calibration"]}},"required":["competition","current","rounds","totals"]}}}},"400":{"description":"Invalid competition or season","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition or season","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/scorecard/{week}":{"get":{"tags":["reports"],"summary":"One matchday of the round scorecard (T140)","description":"Per-match rows of one matchday (`week` is the etapa number, 1..99) plus the round totals, computed like the index. A matchday with no settled match answers 200 with an empty `matches` list and zeroed totals, so the page can render an explicit \"no settled matches\" state instead of zeros that look like data. Public, shared-cacheable.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":99},"required":true,"name":"week","in":"path"},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"competition","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":32},"required":false,"name":"season","in":"query"}],"responses":{"200":{"description":"Round scorecard","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"round":{"type":"integer","exclusiveMinimum":0},"totals":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"marketMatches":{"type":"integer","minimum":0},"modelBrier":{"type":["number","null"],"minimum":0},"modelLogLoss":{"type":["number","null"],"minimum":0},"marketBrier":{"type":["number","null"],"minimum":0},"marketLogLoss":{"type":["number","null"],"minimum":0},"modelBrierOnMarketSubset":{"type":["number","null"],"minimum":0},"modelLogLossOnMarketSubset":{"type":["number","null"],"minimum":0},"closer":{"type":"object","properties":{"model":{"type":"integer","minimum":0},"market":{"type":"integer","minimum":0},"level":{"type":"integer","minimum":0}},"required":["model","market","level"]},"right":{"type":"object","properties":{"model":{"type":"integer","minimum":0},"market":{"type":"integer","minimum":0},"both":{"type":"integer","minimum":0},"neither":{"type":"integer","minimum":0}},"required":["model","market","both","neither"]},"disagreements":{"type":"integer","minimum":0},"edge":{"type":"object","properties":{"n":{"type":"integer","minimum":0},"meanDiff":{"type":["number","null"]},"sd":{"type":["number","null"],"minimum":0},"se":{"type":["number","null"],"minimum":0},"halfWidth":{"type":["number","null"],"minimum":0},"lo":{"type":["number","null"]},"hi":{"type":["number","null"]},"favoursModel":{"type":"boolean"}},"required":["n","meanDiff","sd","se","halfWidth","lo","hi","favoursModel"]},"calibration":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9},"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1},"n":{"type":"integer","minimum":0},"predicted":{"type":["number","null"],"minimum":0,"maximum":1},"observed":{"type":["number","null"],"minimum":0,"maximum":1}},"required":["index","lo","hi","n","predicted","observed"]}}},"required":["matches","marketMatches","modelBrier","modelLogLoss","marketBrier","marketLogLoss","modelBrierOnMarketSubset","modelLogLossOnMarketSubset","closer","right","disagreements","edge","calibration"]},"matches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"outcome":{"type":"string","enum":["home","draw","away"]},"model":{"type":"array","prefixItems":[{"type":"number","minimum":0,"maximum":1},{"type":"number","minimum":0,"maximum":1},{"type":"number","minimum":0,"maximum":1}]},"market":{"type":["array","null"],"prefixItems":[{"type":"number","minimum":0,"maximum":1},{"type":"number","minimum":0,"maximum":1},{"type":"number","minimum":0,"maximum":1}]},"modelProbability":{"type":"number","minimum":0,"maximum":1},"marketProbability":{"type":["number","null"],"minimum":0,"maximum":1},"brierModel":{"type":"number","minimum":0},"brierMarket":{"type":["number","null"],"minimum":0},"logLossModel":{"type":"number","minimum":0},"logLossMarket":{"type":["number","null"],"minimum":0},"gapPp":{"type":["number","null"],"minimum":0},"disagreed":{"type":"boolean"},"right":{"type":["string","null"],"enum":["model","market","both","neither",null]},"closer":{"type":["string","null"],"enum":["model","market","level",null]}},"required":["id","home","away","kickoff","score","outcome","model","market","modelProbability","marketProbability","brierModel","brierMarket","logLossModel","logLossMarket","gapPp","disagreed","right","closer"]}}},"required":["competition","round","totals","matches"]}}}},"400":{"description":"Invalid matchday, competition or season","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition or season","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/wallet/import":{"post":{"tags":["bankroll"],"summary":"Bulk-import my own historical tickets from a file (T117)","description":"Parses a file I uploaded myself (CSV, or an XLSX/XLS workbook when it can be decoded; a workbook the parser cannot read is refused with `xlsx_unsupported`) and records every row as one of MY tickets. All-or-nothing: the file is validated row by row first and nothing is written unless every row is valid and non-duplicate, so the wallet’s money maths is never half-written. The response is a per-row report (`issues[].row` is the file line) for both a refusal and a success. No operator account is read and nothing is scraped (D33). Requires age confirmation; refused (403) during a cool-off or when the imported stake would exceed a weekly/monthly limit.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"encoding":{"type":"string","enum":["utf8","base64"],"default":"utf8"},"content":{"type":"string","maxLength":4000000}},"required":["filename","content"],"description":"My own ticket history, uploaded by me (no operator account is read, nothing is scraped — D33). The import only ever writes tickets that belong to the signed-in user."}}}},"responses":{"200":{"description":"Import report (imported rows, or the issues that refused the file)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"imported":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":0},"issues":{"type":"array","items":{"type":"object","properties":{"row":{"type":["integer","null"],"minimum":0},"code":{"type":"string","enum":["empty_file","unsupported_format","xlsx_unsupported","header_mismatch","missing_column","too_many_rows","invalid_date","invalid_stake","invalid_odds","invalid_status","invalid_bookmaker","invalid_legs","too_many_legs","duplicate"]},"detail":{"type":"string","maxLength":64}},"required":["row","code"],"description":"One reason a row or the whole file was refused."},"maxItems":1000}},"required":["ok","imported","total","issues"],"description":"Per-row report of a bulk import; nothing is written when `ok` is false."}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Age not confirmed, cool-off active or a stake limit would be exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/disagreement":{"get":{"tags":["reports"],"summary":"Disagreement board: the matches the model and the closing line read differently, graded after full time (T204/T441)","description":"Every finished match of the last `?days=` (default 90, 7..365) that had a pre-kickoff 1X2 prediction and a usable closing line, where the model probability and the Shin no-margin closing probability were at least 5 percentage points apart on some outcome: the outcome the row is about (`disagreementOutcome`), both probabilities, the gap, the result that happened (`outcome`), whose favourite matched it (`right`), who gave the result more probability (`closer`) and whether the row landed (`hit`). The coverage carries how many matches could be read at all, how many of them were disagreements, how many confirmed, the rate and its 95 % Wilson interval; below the shared observation floor the rate and the interval are null while the counts stay, so nothing prints a percentage computed on a handful of matches (D47). A live or future match is never read, and a fixture without a usable close only appears in `coverage.matches`. Optionally scope the window to one competition with `?competition=<slug>` and, within it, one season with `?season=<name>` — the season named, else the competition's current one; the window is then the span of that season's fixtures, and the response carries the `competition` and `season` it answered with. A season with no graded match answers an empty board, never an error. Public, shared-cacheable, neutral wording, no bookmaker names (D01/D03/D12).","parameters":[{"schema":{"type":"integer","minimum":7,"maximum":365,"default":90},"required":false,"name":"days","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"competition","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"season","in":"query"}],"responses":{"200":{"description":"Disagreement board","content":{"application/json":{"schema":{"type":"object","properties":{"windowDays":{"type":"integer","minimum":7,"maximum":365},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"thresholdPp":{"type":"number","exclusiveMinimum":0},"coverage":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"disagreements":{"type":"integer","minimum":0},"confirmed":{"type":"integer","minimum":0},"rate":{"type":["number","null"],"minimum":0,"maximum":1},"lo":{"type":["number","null"],"minimum":0,"maximum":1},"hi":{"type":["number","null"],"minimum":0,"maximum":1},"tooFew":{"type":"boolean"}},"required":["matches","disagreements","confirmed","rate","lo","hi","tooFew"]},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"outcome":{"type":"string","enum":["home","draw","away"]},"disagreementOutcome":{"type":"string","enum":["home","draw","away"]},"modelProbability":{"type":"number","minimum":0,"maximum":1},"marketProbability":{"type":"number","minimum":0,"maximum":1},"gapPp":{"type":"number","minimum":5},"right":{"type":"string","enum":["model","market","both","neither"]},"closer":{"type":"string","enum":["model","market","level"]},"hit":{"type":"boolean"},"league":{"type":"string","minLength":1}},"required":["id","home","away","kickoff","score","outcome","disagreementOutcome","modelProbability","marketProbability","gapPp","right","closer","hit","league"]}}},"required":["windowDays","from","to","thresholdPp","coverage","rows"]}}}},"400":{"description":"Invalid window","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/community/barometer":{"get":{"tags":["community"],"summary":"Anonymous community barometer: how opted-in tickets split across the outcomes of each match","description":"Built only from the tickets of users who opted into the community board (Idea 5, D03) — the same consent rule the weekly ranking uses. For each match: how many tickets picked the match (a multi-leg ticket counts once per leg on it), the split across outcomes and the average odds. A match with fewer than minK tickets publishes its count only (hidden: true) and no figure at all. A row is an opaque match key: no user, ticket, bookmaker or source name is ever returned.","responses":{"200":{"description":"Community barometer","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"n":{"type":"integer","minimum":0},"share":{"type":["array","null"],"items":{"type":"number","minimum":0,"maximum":1}},"avgOdds":{"type":["number","null"],"exclusiveMinimum":0},"hidden":{"type":"boolean"}},"required":["key","n","share","avgOdds","hidden"]}},"events":{"type":"integer","minimum":0},"hiddenEvents":{"type":"integer","minimum":0},"minK":{"type":"integer","exclusiveMinimum":0},"updatedAt":{"type":"string","format":"date-time"}},"required":["rows","events","hiddenEvents","minK","updatedAt"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/datasets":{"get":{"tags":["datasets"],"summary":"Open datasets catalog: one export per competition + season (T443)","description":"Reproducible open-data exports. Each entry is one competition + season with its open licence (only CC0-1.0, ODbL-1.0 and CC-BY-SA-4.0 leave the platform), the masked source codes behind it (never a real name, D12), the number of rows and the absolute CSV URL. A season whose rows include a commercial or restricted source, or a source whose kill-switch is off, is not listed and cannot be downloaded; `withheld` says how many seasons were left out.","responses":{"200":{"description":"The catalog of exportable datasets","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}$"},"competition":{"type":"string","minLength":1},"season":{"type":"string","minLength":1},"licence":{"type":"string","enum":["CC0-1.0","ODbL-1.0","CC-BY-SA-4.0"]},"sources":{"type":"array","items":{"type":"string","pattern":"^S\\d{2}$"},"minItems":1},"rows":{"type":"integer","minimum":0},"csvUrl":{"type":"string","minLength":1}},"required":["id","competition","season","licence","sources","rows","csvUrl"]}},"withheld":{"type":"integer","minimum":0}},"required":["items","withheld"]}}}},"503":{"description":"Catalog not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/datasets/{id}":{"get":{"tags":["datasets"],"summary":"CSV export of one dataset (factual rows only)","description":"Factual columns only — date, competition, season, home, away, home_score, away_score, masked source code — no odds and no predictions. The file is byte-stable for a given set of rows (rows are ordered by kick-off). Public, shared-cacheable. The `{id}` is the dataset id WITH its `.csv` suffix (`<id>.csv`) — exactly the `csvUrl` that GET /v1/datasets returns for each dataset; that catalog is the canonical way to discover the download link. Calling this route WITHOUT the `.csv` suffix is a 404 by design (it is not a second endpoint), and an id that is not lowercase letters, digits and hyphens answers 400 `invalid dataset id`.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,79}\\.csv$","description":"The dataset id plus its required `.csv` suffix, e.g. `ger-bundesliga-2018-19.csv`. Use the `csvUrl` from GET /v1/datasets: the bare id without `.csv` is a 404 by design, and an id that is not lowercase letters, digits and hyphens is a 400 `invalid dataset id`.","example":"ger-bundesliga-2018-19.csv"},"required":true,"description":"The dataset id plus its required `.csv` suffix, e.g. `ger-bundesliga-2018-19.csv`. Use the `csvUrl` from GET /v1/datasets: the bare id without `.csv` is a 404 by design, and an id that is not lowercase letters, digits and hyphens is a 400 `invalid dataset id`.","name":"id","in":"path"}],"responses":{"200":{"description":"CSV (text/csv; charset=utf-8)","content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"Invalid dataset id (not lowercase letters, digits and hyphens)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Dataset not found or not exportable, or the request carried no `.csv` suffix","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Catalog not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/matches/{id}/market-panel":{"get":{"tags":["matches"],"summary":"Market panel: per-source margin, devigged implied probabilities and the consensus (T439)","description":"The headline (1X2) market of one match, read per masked source (D12):\n- `rows`: one row per source quoting the match, ordered by `overround` (the tightest line first). Each row carries `overround` (Σ 1/odds − 1), the devigged `implied` probabilities and how many `outcomes` it covers. A source quoting a single outcome is left out (there is no margin to remove from one price).\n- `consensus`: the normalised mean of the devigged lines of the same width, with how many `sources` went into it; null when nothing is quoted.\nA match known but not yet quoted answers with an empty `rows`, not a 404. Public, shared-cacheable. No operator name ever appears (D01/D36).","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Market panel of the requested match","content":{"application/json":{"schema":{"type":"object","properties":{"market":{"type":"string","minLength":1},"outcomes":{"type":"array","items":{"type":"string","minLength":1},"minItems":2},"rows":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","minLength":1},"outcomes":{"type":"integer","minimum":2},"overround":{"type":"number"},"implied":{"type":"array","items":{"type":"number","minimum":0,"maximum":1},"minItems":2}},"required":["source","outcomes","overround","implied"]}},"consensus":{"type":["object","null"],"properties":{"implied":{"type":"array","items":{"type":"number","minimum":0,"maximum":1},"minItems":2},"sources":{"type":"integer","exclusiveMinimum":0}},"required":["implied","sources"]},"observedAt":{"type":"string","format":"date-time"}},"required":["market","outcomes","rows","consensus"]}}}},"404":{"description":"Unknown match","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Market panel not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/matches/{id}/pulse":{"get":{"tags":["match-center"],"summary":"Market pulse: how the in-play consensus moved over a short window (T446, D47)","description":"The no-margin consensus of the live 1X2 (masked source codes only, D12) compared at the start and the end of a short window: the direction it moved, the move in percentage points and how many sources moved. Below the noise threshold the answer is `flat` and carries no numbers. Neutral statistics, not advice (D01/D03). Public, shared-cacheable.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Market pulse of the match","content":{"application/json":{"schema":{"type":"object","properties":{"direction":{"type":"string","enum":["up","down","flat"]},"deltaPp":{"type":"number","minimum":0},"sources":{"type":"integer","minimum":0},"at":{"type":["string","null"],"format":"date-time"},"windowS":{"type":"integer","exclusiveMinimum":0},"thresholdPp":{"type":"number","exclusiveMinimum":0}},"required":["direction","deltaPp","sources","at","windowS","thresholdPp"]}}}},"400":{"description":"Invalid id","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Match not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/matches/{id}/context":{"get":{"tags":["match-center"],"summary":"Pre-match context: H2H, record at venue, streaks, referee card (T132)","description":"Computed from the matches already stored (no new source, no expensive query): the head-to-head of the two clubs, the home club record at the venue of this match, the current run of each club and the stored referee appointment with neutral per-match averages. Neutral statistics: no operator name (D01/D12) and no wording that invites a wager (D36). A venue record is omitted when no finished match is stored there; `officials` is empty until an appointment source is ingested. Public, shared-cacheable.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Pre-match context of the match","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"headToHead":{"type":"object","properties":{"matches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]}},"summary":{"type":"object","properties":{"homeWins":{"type":"integer","minimum":0},"draws":{"type":"integer","minimum":0},"awayWins":{"type":"integer","minimum":0}},"required":["homeWins","draws","awayWins"]}},"required":["matches","summary"]},"streaks":{"type":"object","properties":{"home":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"kind":{"type":"string","enum":["win","unbeaten","loss","winless"]},"length":{"type":"integer","exclusiveMinimum":0},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["team","kind","length","from","to"]},"away":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"kind":{"type":"string","enum":["win","unbeaten","loss","winless"]},"length":{"type":"integer","exclusiveMinimum":0},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["team","kind","length","from","to"]}}},"venueRecord":{"type":"object","properties":{"venue":{"type":"string","minLength":1},"record":{"type":"object","properties":{"played":{"type":"integer","minimum":0},"won":{"type":"integer","minimum":0},"drawn":{"type":"integer","minimum":0},"lost":{"type":"integer","minimum":0},"goalsFor":{"type":"integer","minimum":0},"goalsAgainst":{"type":"integer","minimum":0}},"required":["played","won","drawn","lost","goalsFor","goalsAgainst"]}},"required":["record"]},"officials":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"role":{"type":"string","enum":["referee","assistant","fourth","var"]}},"required":["person","role"]}},"referee":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"averages":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"yellowPerMatch":{"type":"number","minimum":0},"redPerMatch":{"type":"number","minimum":0},"homeWinShare":{"type":"number","minimum":0,"maximum":1},"drawShare":{"type":"number","minimum":0,"maximum":1},"awayWinShare":{"type":"number","minimum":0,"maximum":1}},"required":["matches","yellowPerMatch","redPerMatch","homeWinShare","drawShare","awayWinShare"]}},"required":["person"]}},"required":["eventId","headToHead","streaks","officials"]}}}},"400":{"description":"Invalid id","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Match not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Match context not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/competitions/{slug}/rounds/{round}/officials":{"get":{"tags":["match-center"],"summary":"Referee appointments of one round with neutral stats (T213)","description":"One item per fixture of the matchday, with the officials a source stored for it and the head referee neutral per-match averages (D03: factual counts, no integrity wording). Appointments are empty until an appointment source is ingested. Public, shared-cacheable.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":99},"required":true,"name":"round","in":"path"}],"responses":{"200":{"description":"Referee appointments of the round","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"round":{"type":"integer","exclusiveMinimum":0},"items":{"type":"array","items":{"type":"object","properties":{"match":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"officials":{"type":"array","items":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"role":{"type":"string","enum":["referee","assistant","fourth","var"]}},"required":["person","role"]}},"referee":{"type":"object","properties":{"person":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"averages":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"yellowPerMatch":{"type":"number","minimum":0},"redPerMatch":{"type":"number","minimum":0},"homeWinShare":{"type":"number","minimum":0,"maximum":1},"drawShare":{"type":"number","minimum":0,"maximum":1},"awayWinShare":{"type":"number","minimum":0,"maximum":1}},"required":["matches","yellowPerMatch","redPerMatch","homeWinShare","drawShare","awayWinShare"]}},"required":["person"]}},"required":["match","officials"]}}},"required":["competition","round","items"]}}}},"400":{"description":"Invalid slug or round","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Match context not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/matches/{id}/lineups":{"get":{"tags":["match-center"],"summary":"Estimated line-ups from past XIs and known absences, plus the confirmed-XI impact delta (T226, T116)","description":"The starting eleven each club is most likely to field, derived from the elevens it actually started in its recent finished matches, minus the players known to be out. This is an ESTIMATE, never the official team sheet: the payload carries `estimated: true` and every club block names the window it was read from (`basedOnMatches`) and how many absences were applied. A short window or a long absence list yields a short eleven with `complete: false` rather than invented names. When the sheet is stored, an optional `impact` block (T116) measures how the confirmed XI moves the expected goals and the win/draw/loss probabilities from the expected XI, graded against the result once the match is finished; it is absent on a thin window or without scoring evidence. Statistics only, never a tip. Public, shared-cacheable.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Estimated line-ups of both clubs","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"estimated":{"type":"boolean","enum":[true]},"home":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"formation":{"type":"string","minLength":1},"players":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"position":{"type":"string","enum":["GK","DF","MF","FW"]},"shirtNumber":{"type":["integer","null"],"minimum":0},"starts":{"type":"integer","minimum":0},"startRate":{"type":"number","minimum":0,"maximum":1}},"required":["personId","name","position","shirtNumber","starts","startRate"]},"maxItems":11},"basedOnMatches":{"type":"integer","minimum":0},"absencesApplied":{"type":"integer","minimum":0},"absences":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"reason":{"type":"string","enum":["suspended","injury","other"]}},"required":["personId","name","reason"]}},"complete":{"type":"boolean"}},"required":["team","formation","players","basedOnMatches","absencesApplied","absences","complete"]},"away":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"formation":{"type":"string","minLength":1},"players":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"position":{"type":"string","enum":["GK","DF","MF","FW"]},"shirtNumber":{"type":["integer","null"],"minimum":0},"starts":{"type":"integer","minimum":0},"startRate":{"type":"number","minimum":0,"maximum":1}},"required":["personId","name","position","shirtNumber","starts","startRate"]},"maxItems":11},"basedOnMatches":{"type":"integer","minimum":0},"absencesApplied":{"type":"integer","minimum":0},"absences":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"reason":{"type":"string","enum":["suspended","injury","other"]}},"required":["personId","name","reason"]}},"complete":{"type":"boolean"}},"required":["team","formation","players","basedOnMatches","absencesApplied","absences","complete"]},"impact":{"type":"object","properties":{"changes":{"type":"integer","minimum":0},"home":{"type":"object","properties":{"missing":{"type":"integer","minimum":0},"unexpected":{"type":"integer","minimum":0},"goalsBefore":{"type":"number","minimum":0},"goalsAfter":{"type":"number","minimum":0},"deltaGoals":{"type":"number"}},"required":["missing","unexpected","goalsBefore","goalsAfter","deltaGoals"]},"away":{"type":"object","properties":{"missing":{"type":"integer","minimum":0},"unexpected":{"type":"integer","minimum":0},"goalsBefore":{"type":"number","minimum":0},"goalsAfter":{"type":"number","minimum":0},"deltaGoals":{"type":"number"}},"required":["missing","unexpected","goalsBefore","goalsAfter","deltaGoals"]},"goalsBefore":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}]},"goalsAfter":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}]},"before":{"type":"object","properties":{"home":{"type":"number"},"draw":{"type":"number"},"away":{"type":"number"}},"required":["home","draw","away"]},"after":{"type":"object","properties":{"home":{"type":"number"},"draw":{"type":"number"},"away":{"type":"number"}},"required":["home","draw","away"]},"delta":{"type":"object","properties":{"home":{"type":"number"},"draw":{"type":"number"},"away":{"type":"number"}},"required":["home","draw","away"]},"grade":{"type":"object","properties":{"expectedGoals":{"type":"number","minimum":0},"actualGoals":{"type":"integer","minimum":0},"direction":{"type":"string","enum":["more","fewer"]},"hit":{"type":"boolean"}},"required":["expectedGoals","actualGoals","direction","hit"]}},"required":["changes","home","away","goalsBefore","goalsAfter","before","after","delta"]}},"required":["eventId","estimated","home","away"]}}}},"400":{"description":"Invalid id","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Match not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Line-ups not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/on-this-day":{"get":{"tags":["reports"],"summary":"On this day: the finished matches played on one calendar day across the stored seasons (T442)","description":"The finished matches whose stored kick-off falls on the given calendar day and month (`month`, `day`), in any season — the same day of the year, not the same year. Newest kick-off first, capped at `limit`. Factual history only: the score, the competition and the season of each match, never a prediction, an odd or an operator name (D01/D03). A finished match carrying an OPEN discrepancy row (D35) is left out: a score two sources disagree about is not quoted as history. Public, shared-cacheable.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":12},"required":true,"name":"month","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":31},"required":true,"name":"day","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":60,"default":24},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"The finished matches of that calendar day, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"month":{"type":"integer","minimum":1,"maximum":12},"day":{"type":"integer","minimum":1,"maximum":31},"limit":{"type":"integer","exclusiveMinimum":0},"matches":{"type":"array","items":{"type":"object","properties":{"match":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"competition":{"type":"string","minLength":1},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"kickoffUnconfirmed":{"type":"boolean"}},"required":["id","kickoff","status","competition","home","away"]},"season":{"type":"string","minLength":1}},"required":["match"]}}},"required":["month","day","limit","matches"]}}}},"400":{"description":"Invalid month, day or limit (a 30 February is not a calendar day)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"On this day not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/surprise":{"get":{"tags":["reports"],"summary":"Surprise of the round: the least likely closing-market result of each completed matchday (T137)","description":"Finished football matches of the current season with a closing 1X2 line (T-5, else T-60, else the pre-match consensus), ranked by the no-margin (Shin) probability of the outcome that actually happened — the lowest probability is the biggest surprise. Per round: the mean surprise and how often the model gave the actual outcome more probability than the market did. A round without a usable close carries `closed: 0` and null means, never zeros. Public, anonymous, shared-cacheable; neutral wording, no operator name (D01/D03).","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"competition","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":40},"required":false,"name":"season","in":"query"}],"responses":{"200":{"description":"Rounds with their surprise picks, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"competition":{"type":"object","properties":{"slug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["slug","name"]},"season":{"type":"string","minLength":1},"lastRound":{"type":["integer","null"],"exclusiveMinimum":0},"latestRound":{"type":["integer","null"],"exclusiveMinimum":0},"finishedMatches":{"type":"integer","minimum":0},"closedMatches":{"type":"integer","minimum":0},"rounds":{"type":"array","items":{"type":"object","properties":{"round":{"type":"integer","exclusiveMinimum":0},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"matches":{"type":"integer","minimum":0},"closed":{"type":"integer","minimum":0},"meanSurprise":{"type":["number","null"],"minimum":0,"maximum":1},"meanProbability":{"type":["number","null"],"minimum":0,"maximum":1},"favouriteMisses":{"type":"integer","minimum":0},"modelCalledUpsets":{"type":"integer","minimum":0},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"kickoff":{"type":"string","format":"date-time"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"outcome":{"type":"string","enum":["home","draw","away"]},"probability":{"type":"number","minimum":0,"maximum":1},"favouriteProbability":{"type":"number","minimum":0,"maximum":1},"marketWrongPp":{"type":"number","minimum":0},"modelProbability":{"type":["number","null"],"minimum":0,"maximum":1},"modelDeltaPp":{"type":["number","null"]},"modelCalledUpset":{"type":"boolean"}},"required":["id","home","away","kickoff","score","outcome","probability","favouriteProbability","marketWrongPp","modelProbability","modelDeltaPp","modelCalledUpset"]}}},"required":["round","from","to","matches","closed","meanSurprise","meanProbability","favouriteMisses","modelCalledUpsets","items"]}}},"required":["competition","lastRound","latestRound","finishedMatches","closedMatches","rounds"]}}}},"400":{"description":"Invalid competition slug or season","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition or season","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/surprise/{week}":{"get":{"tags":["reports"],"summary":"One matchday of the surprise ranking (the `week` segment is the round number) (T137)","description":"The surprise ranking of a single matchday. The competition slug (`competition`) and an optional season name (`season`, the current one by default). A round with no finished match with a usable close answers with an explicit empty state (`closed: 0`, null means), never zeros.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":99},"required":true,"name":"week","in":"path"},{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$"},"required":true,"name":"competition","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":40},"required":false,"name":"season","in":"query"}],"responses":{"200":{"description":"Round surprise","content":{"application/json":{"schema":{"type":"object","properties":{"round":{"type":"integer","exclusiveMinimum":0},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"matches":{"type":"integer","minimum":0},"closed":{"type":"integer","minimum":0},"meanSurprise":{"type":["number","null"],"minimum":0,"maximum":1},"meanProbability":{"type":["number","null"],"minimum":0,"maximum":1},"favouriteMisses":{"type":"integer","minimum":0},"modelCalledUpsets":{"type":"integer","minimum":0},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"away":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"name":{"type":"string","minLength":1}},"required":["id","name"]},"kickoff":{"type":"string","format":"date-time"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"outcome":{"type":"string","enum":["home","draw","away"]},"probability":{"type":"number","minimum":0,"maximum":1},"favouriteProbability":{"type":"number","minimum":0,"maximum":1},"marketWrongPp":{"type":"number","minimum":0},"modelProbability":{"type":["number","null"],"minimum":0,"maximum":1},"modelDeltaPp":{"type":["number","null"]},"modelCalledUpset":{"type":"boolean"}},"required":["id","home","away","kickoff","score","outcome","probability","favouriteProbability","marketWrongPp","modelProbability","modelDeltaPp","modelCalledUpset"]}}},"required":["round","from","to","matches","closed","meanSurprise","meanProbability","favouriteMisses","modelCalledUpsets","items"]}}}},"400":{"description":"Invalid competition slug, season or round number","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Unknown competition, season or round","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/reports/calibration/live":{"get":{"tags":["reports"],"summary":"Live model calibration: in-play win probability by confidence bucket, with Wilson 95 % bands (T315)","description":"The DR live model (T209) is sampled at fixed match minutes (15', 30', 45', 60', 75') over the finished football matches of the last `days` (default 30, max 120). Each read contributes its three outcome probabilities against the final result; they are pooled, banded by the ten equal 10 % confidence buckets of the model's own view (T138) and compared with the share that actually happened, with the Wilson 95 % interval of that share and the sample size `n` per bucket. A bucket below the shared sample floor carries its count and no interval (D47). `indexable` is false while the sample is too thin to be a finding, so the page stays out of the search index.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":120},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Live calibration curve","content":{"application/json":{"schema":{"type":"object","properties":{"asOf":{"type":"string","format":"date-time"},"windowDays":{"type":"integer","exclusiveMinimum":0},"minutes":{"type":"array","items":{"type":"integer","minimum":0,"maximum":90}},"sample":{"type":"object","properties":{"matches":{"type":"integer","minimum":0},"reads":{"type":"integer","minimum":0},"observations":{"type":"integer","minimum":0}},"required":["matches","reads","observations"]},"bandWidth":{"type":"number","exclusiveMinimum":0,"maximum":1},"bands":{"type":"array","items":{"type":"object","properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1},"n":{"type":"integer","minimum":0},"predicted":{"type":"number","minimum":0,"maximum":1},"observed":{"type":"number","minimum":0,"maximum":1},"ci":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]},"gap":{"type":"number","minimum":-1,"maximum":1}},"required":["lo","hi","n","predicted","observed","ci","gap"]}},"indexable":{"type":"boolean"}},"required":["asOf","windowDays","minutes","sample","bandWidth","bands","indexable"]}}}},"400":{"description":"Invalid window","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No finished match with a readable in-play line in the window (or ClickHouse not configured)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/feature-board/requests":{"get":{"tags":["feature-board"],"summary":"Public feature-request board, ordered by votes","description":"Read-only for anonymous visitors. Highest vote count first, newest as the tiebreak. The vote count is shown; each signed-in reader also sees whether they voted.","responses":{"200":{"description":"Feature requests","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["open","planned","done","closed"]},"votes":{"type":"integer","minimum":0},"voted":{"type":"boolean"},"mine":{"type":"boolean"},"answer":{"type":["string","null"]},"author":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"createdAt":{"type":"string","format":"date-time"},"answeredAt":{"type":["string","null"],"format":"date-time"}},"required":["id","title","body","status","votes","voted","mine","answer","author","createdAt","answeredAt"]}},"quota":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"cap":{"type":"integer","exclusiveMinimum":0}},"required":["used","cap"]}},"required":["items","quota"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["feature-board"],"summary":"Post a feature request","description":"Signed-in only. 3 requests per hour, and at most 5 open requests per account. The author is taken from the session, never the body.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":8,"maxLength":120},"body":{"type":"string","minLength":20,"maxLength":2000}},"required":["title","body"]}}}},"responses":{"201":{"description":"Created request","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["open","planned","done","closed"]},"votes":{"type":"integer","minimum":0},"voted":{"type":"boolean"},"mine":{"type":"boolean"},"answer":{"type":["string","null"]},"author":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"createdAt":{"type":"string","format":"date-time"},"answeredAt":{"type":["string","null"],"format":"date-time"}},"required":["id","title","body","status","votes","voted","mine","answer","author","createdAt","answeredAt"]}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Account cannot post","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Open-request cap reached","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/feature-board/requests/{id}/votes":{"post":{"tags":["feature-board"],"summary":"Upvote a request (idempotent: one vote per user per request)","description":"A second vote from the same account is a no-op — a unique index holds the guarantee.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Vote count","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"votes":{"type":"integer","minimum":0},"voted":{"type":"boolean"}},"required":["id","votes","voted"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Account cannot vote","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Request not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many votes","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["feature-board"],"summary":"Remove my vote from a request","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Vote count","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"votes":{"type":"integer","minimum":0},"voted":{"type":"boolean"}},"required":["id","votes","voted"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Request not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/feature-board/requests/{id}/decision":{"post":{"tags":["feature-board"],"summary":"Answer or close a request (admin)","description":"Sets the status and the public answer. Audit-logged with the acting admin.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","planned","done","closed"]},"answer":{"type":"string","minLength":3,"maxLength":2000}},"required":["status","answer"]}}}},"responses":{"200":{"description":"Updated request","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["open","planned","done","closed"]},"votes":{"type":"integer","minimum":0},"voted":{"type":"boolean"},"mine":{"type":"boolean"},"answer":{"type":["string","null"]},"author":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"createdAt":{"type":"string","format":"date-time"},"answeredAt":{"type":["string","null"],"format":"date-time"}},"required":["id","title","body","status","votes","voted","mine","answer","author","createdAt","answeredAt"]}}}},"400":{"description":"Invalid decision","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"Admin role required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Request not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/consumption/money.v1.json":{"get":{"tags":["consumption"],"summary":"The versioned cross-repo consumption contract (T403)","description":"The fields a cross-repo consumer may depend on, as a versioned JSON document: one entry per read endpoint with the JSON Schema of its query and of its response, plus the invariants that must not be assumed away. Derived from the same Zod schemas the routes answer with, and checked against the pinned file in `packages/contracts/consumption/` by `pnpm guards`.","responses":{"200":{"description":"The current contract","content":{"application/json":{"schema":{"type":"object","properties":{"contract":{"type":"string","enum":["money-consumption"]},"version":{"type":"integer","exclusiveMinimum":0},"source":{"type":"string","enum":["@marcai/contracts"]},"note":{"type":"string","minLength":1},"endpoints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"method":{"type":"string","enum":["GET"]},"path":{"type":"string","minLength":1},"summary":{"type":"string","minLength":1},"dark":{"type":"boolean"},"gate":{"type":["string","null"],"minLength":1},"query":{"type":["object","null"],"additionalProperties":{}},"schema":{"type":"object","additionalProperties":{}}},"required":["id","method","path","summary","dark","gate","query","schema"]},"minItems":1},"invariants":{"type":"array","items":{"type":"string","minLength":1},"minItems":1}},"required":["contract","version","source","note","endpoints","invariants"]}}}}}}},"/v1/private-leagues":{"get":{"tags":["private-leagues"],"summary":"The leagues I belong to","description":"Signed-in only. Returns only the leagues the caller is a member of, newest first. Nothing about a league anybody else belongs to is ever returned.","responses":{"200":{"description":"My leagues","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","member"]},"memberCount":{"type":"integer","minimum":0},"joinedAt":{"type":"string","format":"date-time"}},"required":["id","name","role","memberCount","joinedAt"]}}},"required":["items"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["private-leagues"],"summary":"Create a private league and get its invite code","description":"Signed-in only, 5 per hour. The caller becomes the owner. The invite code is generated server-side and returned once here and on every standings read, so a member can always re-share it. No stake, prize or entry fee exists anywhere in this feature.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":48}},"required":["name"]}}}},"responses":{"201":{"description":"Created league","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","member"]},"memberCount":{"type":"integer","minimum":0},"joinedAt":{"type":"string","format":"date-time"},"code":{"type":"string"}},"required":["id","name","role","memberCount","joinedAt","code"]}}}},"400":{"description":"Invalid name","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many leagues created","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/private-leagues/join":{"post":{"tags":["private-leagues"],"summary":"Join a league with its invite code","description":"Signed-in only, 20 per hour. The code is normalised (trim + upper case, spaces and dashes dropped) before the lookup. Joining twice is harmless: the answer says whether this call created the membership. A code that matches no league is 404.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":4,"maxLength":16}},"required":["code"]}}}},"responses":{"200":{"description":"Joined league","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","member"]},"memberCount":{"type":"integer","minimum":0},"joinedAt":{"type":"string","format":"date-time"},"code":{"type":"string"},"joined":{"type":"boolean"}},"required":["id","name","role","memberCount","joinedAt","code","joined"]}}}},"400":{"description":"Invalid code","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No league has this code","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many join attempts","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/private-leagues/{id}":{"get":{"tags":["private-leagues"],"summary":"A league and its leaderboard","description":"Members only. A non-member receives 404 — the same answer as an unknown id, so the endpoint never reveals that a league exists. Standings are scored from the tips each member already stored since they joined; there is no separate entry.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"League standings","content":{"application/json":{"schema":{"type":"object","properties":{"league":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","member"]},"memberCount":{"type":"integer","minimum":0},"code":{"type":"string"}},"required":["id","name","role","memberCount","code"]},"standings":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"integer","exclusiveMinimum":0},"name":{"type":"string"},"you":{"type":"boolean"},"points":{"type":"integer","minimum":0},"won":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0}},"required":["rank","name","you","points","won","settled"]}}},"required":["league","standings"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"League not found, or you are not a member","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/private-leagues/{id}/leave":{"post":{"tags":["private-leagues"],"summary":"Leave a league I am a member of","description":"Members only. The owner cannot leave their own league (409) — the league is theirs to keep or to hand over, and this feature has no delete.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,15}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Left the league","content":{"application/json":{"schema":{"type":"object","properties":{"left":{"type":"boolean"}},"required":["left"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"League not found, or you are not a member","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The owner cannot leave","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/events/calibration":{"get":{"tags":["events"],"summary":"Quoted price vs what happened, over the resolved event markets","description":"Reliability bands (mean price asked vs observed frequency of the outcome) per venue kind, with the Brier score of the same sample. Every number carries n and below the sample floor there is no number at all (D47). Only the masked source code travels, never a venue name (D12).","responses":{"200":{"description":"The scoreboard","content":{"application/json":{"schema":{"type":"object","properties":{"asOf":{"type":"string","format":"date-time"},"items":{"type":"array","items":{"type":"object","properties":{"marketId":{"type":["string","null"],"minLength":1},"venueKind":{"type":["string","null"],"enum":["book","prediction","consensus",null]},"bands":{"type":"array","items":{"type":"object","properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1},"n":{"type":"integer","minimum":0},"meanQuoted":{"type":"number","minimum":0,"maximum":1},"observed":{"type":"number","minimum":0,"maximum":1},"ci":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]},"verdict":{"type":"string","enum":["overpriced","underpriced","noise","too_few"]}},"required":["lo","hi","n","meanQuoted","observed","ci","verdict"]}},"brier":{"type":["number","null"],"minimum":0,"maximum":1},"n":{"type":"integer","minimum":0}},"required":["marketId","venueKind","bands","brier","n"]}},"sample":{"type":"object","properties":{"resolvedMarkets":{"type":"integer","minimum":0},"scoredMarkets":{"type":"integer","minimum":0},"withoutQuote":{"type":"integer","minimum":0},"outcomes":{"type":"integer","minimum":0}},"required":["resolvedMarkets","scoredMarkets","withoutQuote","outcomes"]}},"required":["asOf","items","sample"]}}}},"404":{"description":"Not published on this deployment","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/events/markets":{"get":{"tags":["events"],"summary":"Cross-domain markets with the price their own source holds","description":"Event markets (politics, economy, weather, culture, crypto, other) with the latest quote of their own source and, once the venue published a result, that result. Prices are quoted implied probabilities, never de-vigged. A market with no publishable quote is returned with `quote: null` instead of being hidden. The source is the masked code (D12) and no operator is ever named; there is no field that could carry a venue name or a link.","parameters":[{"schema":{"type":"string","enum":["sport","politics","economy","weather","culture","crypto","other"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string","enum":["open","resolved"]},"required":false,"name":"state","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"The markets, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"asOf":{"type":"string","format":"date-time"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kind":{"type":"string","enum":["sport","politics","economy","weather","culture","crypto","other"]},"question":{"type":"string","minLength":1,"maxLength":500},"closesAt":{"type":["string","null"],"format":"date-time"},"resolvedAt":{"type":["string","null"],"format":"date-time"},"resolution":{"type":["string","null"],"minLength":1,"maxLength":64},"quote":{"type":["object","null"],"properties":{"source":{"type":"string","pattern":"^S[0-9]{2}$"},"venueKind":{"type":"string","enum":["book","prediction","consensus"]},"venueCount":{"type":["integer","null"],"exclusiveMinimum":0},"outcomes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"label":{"type":"string","minLength":1,"maxLength":200},"price":{"type":"number","minimum":0,"maximum":1}},"required":["key","label","price"]},"minItems":2,"maxItems":64},"overround":{"type":"number","exclusiveMinimum":0},"seenAt":{"type":"string","format":"date-time"}},"required":["source","venueKind","venueCount","outcomes","overround","seenAt"]}},"required":["id","kind","question","closesAt","resolvedAt","resolution","quote"]}}},"required":["asOf","items"]}}}},"404":{"description":"Not published on this deployment","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/events/markets/{id}/calibration":{"get":{"tags":["events"],"summary":"One market's quoted price vs what happened, in probability buckets","description":"The resolved outcomes of one market, bucketed by the price its own source quoted before the result, with the share that happened, the Wilson 95 % interval and the band verdict, plus the Brier score of the same sample. Price bands use the ten equal buckets of the model calibration (T138). Below the sample floor every band reads `too_few` (D47). 404 while the surface is dark, for a market whose venue published no result, or for one whose source this deployment may not publish.","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The market calibration","content":{"application/json":{"schema":{"type":"object","properties":{"marketId":{"type":["string","null"],"minLength":1},"venueKind":{"type":["string","null"],"enum":["book","prediction","consensus",null]},"bands":{"type":"array","items":{"type":"object","properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1},"n":{"type":"integer","minimum":0},"meanQuoted":{"type":"number","minimum":0,"maximum":1},"observed":{"type":"number","minimum":0,"maximum":1},"ci":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]},"verdict":{"type":"string","enum":["overpriced","underpriced","noise","too_few"]}},"required":["lo","hi","n","meanQuoted","observed","ci","verdict"]}},"brier":{"type":["number","null"],"minimum":0,"maximum":1},"n":{"type":"integer","minimum":0}},"required":["marketId","venueKind","bands","brier","n"]}}}},"400":{"description":"Invalid id","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Not published on this deployment, unknown market, or nothing scoreable yet","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/b2b/me":{"get":{"tags":["b2b"],"security":[{"bearerAuth":[]}],"summary":"Identity of the calling key and today’s usage","description":"Bearer `<token>`. The cheapest endpoint to poll while integrating.","responses":{"200":{"description":"Identity","content":{"application/json":{"schema":{"type":"object","properties":{"keyId":{"type":"integer"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["matches:read","odds:read","model:read","ledger:read"]}},"dailyLimit":{"type":"integer"},"usedToday":{"type":"integer","minimum":0},"day":{"type":"string"}},"required":["keyId","name","prefix","scopes","dailyLimit","usedToday","day"]}}}},"401":{"description":"Missing, unknown or revoked key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"The owning account no longer holds api.access","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Daily allowance or burst guard exceeded (Retry-After)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/b2b/matches":{"get":{"tags":["b2b"],"security":[{"bearerAuth":[]}],"summary":"Full match feed: every model outcome, no-margin consensus odds and the value gate","description":"Bearer `<token>`, scope `matches:read`. Public GET /v1/matches never returns this shape (D23).","parameters":[{"schema":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"required":false,"name":"sport","in":"query"},{"schema":{"type":"string","enum":["scheduled","live","finished"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":false,"name":"league","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"maximum":0.5},"required":false,"name":"modelMarketGap","in":"query"}],"responses":{"200":{"description":"Match feed","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"sport":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"league":{"type":"string","minLength":1},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"resultPending":{"type":"boolean"},"kickoffUnconfirmed":{"type":"boolean"},"score":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"bestOf":{"type":"integer","minimum":1,"maximum":7},"prediction":{"type":"object","properties":{"model":{"type":"string","minLength":1},"probabilities":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"fairOdds":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"createdAt":{"type":"string","format":"date-time"}},"required":["model","probabilities","fairOdds","createdAt"]},"odds":{"type":"object","properties":{"prices":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"opening":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"source":{"type":"string","minLength":1},"observedAt":{"type":"string","format":"date-time"}},"required":["prices","source","observedAt"]},"value":{"type":"object","properties":{"enabled":{"type":"boolean"},"reason":{"type":"string","enum":["validated","model_worse_than_close","no_backtest","no_odds","disabled_by_admin"]}},"required":["enabled","reason"]},"verdict":{"type":"object","properties":{"outcome":{"type":"string","enum":["home","draw","away"]},"modelProbability":{"type":"number","minimum":0,"maximum":1},"marketProbability":{"type":["number","null"],"minimum":0,"maximum":1},"favourite":{"type":"string","enum":["home","draw","away"]},"favouriteHit":{"type":"boolean"},"closer":{"type":["string","null"],"enum":["model","market","level",null]}},"required":["outcome","modelProbability","marketProbability","favourite","favouriteHit","closer"]},"live":{"type":"object","properties":{"minute":{"type":["integer","null"],"minimum":0},"period":{"type":"string","enum":["1H","HT","2H","ET1","ET2","PEN"]},"red":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"yellow":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"corners":{"type":"object","properties":{"home":{"type":"integer","minimum":0},"away":{"type":"integer","minimum":0}},"required":["home","away"]},"at":{"type":"string","format":"date-time"}},"required":["minute"]},"source":{"type":"string","minLength":1}},"required":["id","sport","league","home","away","kickoff","status"]}},"from":{"type":["string","null"],"format":"date-time"},"to":{"type":["string","null"],"format":"date-time"},"limit":{"type":"integer","exclusiveMinimum":0}},"required":["items","from","to","limit"]}}}},"401":{"description":"Missing, unknown or revoked key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"The owning account no longer holds api.access","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The key lacks the matches:read scope","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Daily allowance or burst guard exceeded (Retry-After)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/b2b/ledger":{"get":{"tags":["b2b"],"security":[{"bearerAuth":[]}],"summary":"The public pick ledger, newest first","description":"Bearer `<token>`, scope `ledger:read`. Same rows as the public /v1/ledger (T024).","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"required":false,"name":"result","in":"query"}],"responses":{"200":{"description":"Ledger page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{1,18}$"},"eventId":{"type":"string","pattern":"^\\d{1,18}$"},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"league":{"type":["string","null"],"minLength":1},"kickoff":{"type":"string","format":"date-time"},"market":{"type":"string","minLength":1},"outcome":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"backfill":{"type":"boolean"},"odds":{"type":"number","exclusiveMinimum":1},"modelProbability":{"type":["number","null"],"minimum":0,"maximum":1},"closingOdds":{"type":["number","null"],"exclusiveMinimum":1},"closingFairProbability":{"type":["number","null"],"minimum":0,"maximum":1},"clv":{"type":["number","null"]},"result":{"type":"string","enum":["pending","won","lost","void","half_won","half_lost"]},"placedAt":{"type":"string","format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"counted":{"type":"boolean","default":true},"prevHash":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"hash":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["id","eventId","home","away","league","kickoff","market","outcome","model","backfill","odds","modelProbability","closingOdds","closingFairProbability","clv","result","placedAt","settledAt","prevHash","hash"]}},"page":{"type":"integer","minimum":1},"pageSize":{"type":"integer","minimum":1},"total":{"type":"integer","minimum":0}},"required":["items","page","pageSize","total"]}}}},"401":{"description":"Missing, unknown or revoked key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"The owning account no longer holds api.access","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The key lacks the scope this route needs","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Daily allowance or burst guard exceeded (Retry-After)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/b2b/ledger/summary":{"get":{"tags":["b2b"],"security":[{"bearerAuth":[]}],"summary":"Flat-stake performance, CLV and calibration of the public ledger","description":"Bearer `<token>`, scope `ledger:read`.","responses":{"200":{"description":"Summary","content":{"application/json":{"schema":{"type":"object","properties":{"overall":{"type":"object","properties":{"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"voided":{"type":"integer","minimum":0},"wins":{"type":"number","minimum":0},"hitRate":{"type":["number","null"],"minimum":0,"maximum":1},"staked":{"type":"number","minimum":0},"profit":{"type":"number"},"roi":{"type":["number","null"]},"withClosing":{"type":"integer","minimum":0},"avgClv":{"type":["number","null"]},"beatCloseRate":{"type":["number","null"],"minimum":0,"maximum":1},"brier":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierClose":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierCount":{"type":"integer","minimum":0,"default":0},"hitRateCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]}},"required":["picks","settled","pending","voided","wins","hitRate","staked","profit","roi","withClosing","avgClv","beatCloseRate"]},"origins":{"type":"object","properties":{"live":{"type":"object","properties":{"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"voided":{"type":"integer","minimum":0},"wins":{"type":"number","minimum":0},"hitRate":{"type":["number","null"],"minimum":0,"maximum":1},"staked":{"type":"number","minimum":0},"profit":{"type":"number"},"roi":{"type":["number","null"]},"withClosing":{"type":"integer","minimum":0},"avgClv":{"type":["number","null"]},"beatCloseRate":{"type":["number","null"],"minimum":0,"maximum":1},"brier":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierClose":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierCount":{"type":"integer","minimum":0,"default":0},"hitRateCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]}},"required":["picks","settled","pending","voided","wins","hitRate","staked","profit","roi","withClosing","avgClv","beatCloseRate"]},"backfill":{"type":"object","properties":{"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"voided":{"type":"integer","minimum":0},"wins":{"type":"number","minimum":0},"hitRate":{"type":["number","null"],"minimum":0,"maximum":1},"staked":{"type":"number","minimum":0},"profit":{"type":"number"},"roi":{"type":["number","null"]},"withClosing":{"type":"integer","minimum":0},"avgClv":{"type":["number","null"]},"beatCloseRate":{"type":["number","null"],"minimum":0,"maximum":1},"brier":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierClose":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierCount":{"type":"integer","minimum":0,"default":0},"hitRateCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]}},"required":["picks","settled","pending","voided","wins","hitRate","staked","profit","roi","withClosing","avgClv","beatCloseRate"]}},"required":["live","backfill"]},"calibration":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9},"lower":{"type":"number","minimum":0,"maximum":1},"upper":{"type":"number","minimum":0,"maximum":1},"count":{"type":"integer","minimum":0},"predicted":{"type":["number","null"],"minimum":0,"maximum":1},"observed":{"type":["number","null"],"minimum":0,"maximum":1}},"required":["index","lower","upper","count","predicted","observed"]}},"byModel":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string","minLength":1},"stats":{"type":"object","properties":{"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"voided":{"type":"integer","minimum":0},"wins":{"type":"number","minimum":0},"hitRate":{"type":["number","null"],"minimum":0,"maximum":1},"staked":{"type":"number","minimum":0},"profit":{"type":"number"},"roi":{"type":["number","null"]},"withClosing":{"type":"integer","minimum":0},"avgClv":{"type":["number","null"]},"beatCloseRate":{"type":["number","null"],"minimum":0,"maximum":1},"brier":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierClose":{"type":["number","null"],"minimum":0,"maximum":1,"default":null},"brierCount":{"type":"integer","minimum":0,"default":0},"hitRateCi":{"type":["object","null"],"properties":{"lo":{"type":"number","minimum":0,"maximum":1},"hi":{"type":"number","minimum":0,"maximum":1}},"required":["lo","hi"]}},"required":["picks","settled","pending","voided","wins","hitRate","staked","profit","roi","withClosing","avgClv","beatCloseRate"]}},"required":["model","stats"]}},"duplicatesExcluded":{"type":"integer","minimum":0,"default":0},"generatedAt":{"type":"string","format":"date-time"}},"required":["overall","origins","calibration","byModel","generatedAt"]}}}},"401":{"description":"Missing, unknown or revoked key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"The owning account no longer holds api.access","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The key lacks the scope this route needs","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Daily allowance or burst guard exceeded (Retry-After)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/b2b/ledger/verify":{"get":{"tags":["b2b"],"security":[{"bearerAuth":[]}],"summary":"Recompute the hash chain of the public ledger","description":"Bearer `<token>`, scope `ledger:read`.","responses":{"200":{"description":"Chain verification","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"checked":{"type":"integer","minimum":0},"firstBrokenIndex":{"type":["integer","null"],"minimum":0},"firstBrokenId":{"type":["string","null"],"pattern":"^\\d{1,18}$"},"head":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"checkedAt":{"type":"string","format":"date-time"}},"required":["ok","checked","firstBrokenIndex","firstBrokenId","head","checkedAt"]}}}},"401":{"description":"Missing, unknown or revoked key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"The owning account no longer holds api.access","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The key lacks the scope this route needs","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Daily allowance or burst guard exceeded (Retry-After)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/b2b/ledger/head":{"get":{"tags":["b2b"],"security":[{"bearerAuth":[]}],"summary":"Daily signed commitments to the chain head (anchors)","description":"Bearer `<token>`, scope `ledger:read`. The same anchors the public /v1/ledger/head serves (T225).","responses":{"200":{"description":"Anchors","content":{"application/json":{"schema":{"type":"object","properties":{"latest":{"type":["object","null"],"properties":{"day":{"type":"string","format":"date"},"head":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"anchoredAt":{"type":"string","format":"date-time"},"algorithm":{"type":"string","enum":["HMAC-SHA256"]},"signature":{"type":"string","pattern":"^[0-9a-f]{64}$"},"prevSignature":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"}},"required":["day","head","picks","settled","anchoredAt","algorithm","signature","prevSignature"]},"recent":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"head":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"picks":{"type":"integer","minimum":0},"settled":{"type":"integer","minimum":0},"anchoredAt":{"type":"string","format":"date-time"},"algorithm":{"type":"string","enum":["HMAC-SHA256"]},"signature":{"type":"string","pattern":"^[0-9a-f]{64}$"},"prevSignature":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"}},"required":["day","head","picks","settled","anchoredAt","algorithm","signature","prevSignature"]},"maxItems":31},"checkedAt":{"type":"string","format":"date-time"}},"required":["latest","recent","checkedAt"]}}}},"401":{"description":"Missing, unknown or revoked key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"The owning account no longer holds api.access","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The key lacks the scope this route needs","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Daily allowance or burst guard exceeded (Retry-After)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/b2b/models":{"get":{"tags":["b2b"],"security":[{"bearerAuth":[]}],"summary":"Backtest reports of the active model versions","description":"Bearer `<token>`, scope `model:read`. Our own walk-forward numbers, including the log-loss comparison against the closing market.","responses":{"200":{"description":"Model reports","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"sport":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"model":{"type":"string","minLength":1},"trainedAt":{"type":"string","format":"date-time"},"leagues":{"type":"array","items":{"type":"string"}},"matches":{"type":"integer","minimum":0},"logLoss":{"type":"object","properties":{"model":{"type":"number"},"market":{"type":"number"},"blend":{"type":"number"}},"required":["model","market"]},"rps":{"type":"object","properties":{"model":{"type":"number"},"market":{"type":"number"}},"required":["model","market"]},"betting":{"type":"object","properties":{"bets":{"type":"integer","minimum":0},"roi":{"type":"number"},"clvBeatRate":{"type":"number"},"meanClv":{"type":"number"}},"required":["bets","roi","clvBeatRate","meanClv"]},"valueEnabled":{"type":"boolean"},"predictionAgeHours":{"type":"number","minimum":0}},"required":["sport","model","trainedAt","leagues","matches","logLoss","valueEnabled"]}}},"required":["items"]}}}},"401":{"description":"Missing, unknown or revoked key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"The owning account no longer holds api.access","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The key lacks the scope this route needs","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Daily allowance or burst guard exceeded (Retry-After)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/b2b/odds":{"get":{"tags":["b2b"],"security":[{"bearerAuth":[]}],"summary":"Anonymous consensus 1X2 for a set of event ids","description":"Bearer `<token>`, scope `odds:read`. `ids` is a comma-separated list (at most 100). Only the masked consensus is returned (D12); no operator identity or link is ever exposed (D01/D36).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":2000},"required":true,"name":"ids","in":"query"}],"responses":{"200":{"description":"Consensus odds","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","minLength":1},"sport":{"type":"string","enum":["football","tennis","basketball","hockey","handball","esports"]},"league":{"type":"string","minLength":1},"home":{"type":"string","minLength":1},"away":{"type":"string","minLength":1},"kickoff":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["scheduled","live","finished"]},"odds":{"type":"object","properties":{"prices":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"opening":{"type":"object","properties":{"home":{"type":"number","exclusiveMinimum":0},"draw":{"type":"number","exclusiveMinimum":0},"away":{"type":"number","exclusiveMinimum":0}},"required":["home","draw","away"]},"source":{"type":"string","minLength":1},"observedAt":{"type":"string","format":"date-time"}},"required":["prices","source","observedAt"]}},"required":["eventId","sport","league","home","away","kickoff","status","odds"]}},"unavailable":{"type":"array","items":{"type":"string","minLength":1}}},"required":["items","unavailable"]}}}},"400":{"description":"Invalid ids","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Missing, unknown or revoked key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"The owning account no longer holds api.access","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The key lacks the scope this route needs","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Daily allowance or burst guard exceeded (Retry-After)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/api-keys":{"get":{"tags":["account"],"summary":"My API keys (never the secret)","responses":{"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["matches:read","odds:read","model:read","ledger:read"]}},"dailyLimit":{"type":["integer","null"]},"lastUsedAt":{"type":["string","null"],"format":"date-time"},"revokedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","prefix","scopes","dailyLimit","lastUsedAt","revokedAt","createdAt"]}}},"required":["items"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"api.access requires pro","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["account"],"summary":"Create an API key; the token is returned once","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":60},"scopes":{"type":"array","items":{"type":"string","enum":["matches:read","odds:read","model:read","ledger:read"]},"minItems":1,"maxItems":4}},"required":["name","scopes"]}}}},"responses":{"201":{"description":"Created (carries the token once)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"token":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["matches:read","odds:read","model:read","ledger:read"]}},"dailyLimit":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","token","prefix","scopes","dailyLimit","createdAt"]}}}},"400":{"description":"Invalid body or unknown scope","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"api.access requires pro","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"Key limit reached","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/api-keys/{id}":{"delete":{"tags":["account"],"summary":"Revoke a key (row kept for the audit trail)","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Revoked, with the row as stored (revokedAt set)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["matches:read","odds:read","model:read","ledger:read"]}},"dailyLimit":{"type":["integer","null"]},"lastUsedAt":{"type":["string","null"],"format":"date-time"},"revokedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","prefix","scopes","dailyLimit","lastUsedAt","revokedAt","createdAt"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"api.access requires pro","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Key not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/api-keys/{id}/usage":{"get":{"tags":["account"],"summary":"What this key has spent (same counters that enforce the limit)","parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Usage","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"dailyLimit":{"type":"integer"},"usedToday":{"type":"integer","minimum":0},"day":{"type":"string"},"recent":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"requests":{"type":"integer","minimum":0}},"required":["day","requests"]},"maxItems":90},"loggedRequests":{"type":"integer","minimum":0}},"required":["id","dailyLimit","usedToday","day","recent","loggedRequests"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"402":{"description":"api.access requires pro","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"Key not found","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/consent":{"post":{"tags":["account"],"summary":"Record the 18+ declaration and the Terms/Privacy acceptance (accounts created via Google/Apple/link)","description":"Accounts born through Google, Apple or a magic link without the two flags start `consentPending`; their mutations answer 403 `code: CONSENT_REQUIRED` until this call. Idempotent: an attested account gets 200.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ageConfirmed":{"type":"boolean","enum":[true]},"termsAccepted":{"type":"boolean","enum":[true]}},"required":["ageConfirmed","termsAccepted"]}}}},"responses":{"200":{"description":"Attested","content":{"application/json":{"schema":{"type":"object","properties":{"consentPending":{"type":"boolean","enum":[false]}},"required":["consentPending"]}}}},"400":{"description":"Both flags must be true","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Database not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/apple-token":{"post":{"tags":["account"],"summary":"Store a revocable Sign in with Apple token (native iOS)","description":"Send the `authorizationCode` of ASAuthorizationAppleIDCredential right after signing in with Apple. The api exchanges it and keeps the refresh token so that deleting the account revokes it at Apple.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppleTokenRequest"}}}},"responses":{"204":{"description":"Stored"},"400":{"description":"Apple refused the code (expired, used or for another app)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"Sign in required","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"The account has no Sign in with Apple login","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"Sign in with Apple (native) or the database is not configured","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}}},"webhooks":{}}