{"openapi":"3.1.0","info":{"title":"Sicko Fantasy API","version":"1.0.0","summary":"Custom fantasy football scoring, leagues and lineup optimization.","description":"Build any scoring system, run a league under it, and read the boards it produces. Free keys manage the native ecosystem: systems, leagues, rosters, lineups, claims and trades. Pro keys add the analysis: rankings with positional value, balance scorecards, system comparisons and the lineup optimizer. See https://sicko-fantasy.com/developers.","contact":{"name":"Sicko Fantasy","url":"https://sicko-fantasy.com/developers"}},"servers":[{"url":"https://sicko-fantasy.com/api/v1","description":"Production"}],"tags":[{"name":"meta","description":"The key, the plan, and this document."},{"name":"systems","description":"Scoring systems: the rules a season is scored under."},{"name":"players","description":"Players and team defenses."},{"name":"leagues","description":"Leagues, standings and matchups."},{"name":"teams","description":"Rosters and lineups."},{"name":"waivers","description":"Waiver claims."},{"name":"trades","description":"Trades between two teams."},{"name":"analysis","description":"Pro: rankings, balance, comparison and the optimizer."}],"security":[{"apiKey":[]}],"paths":{"/openapi.json":{"get":{"operationId":"getOpenApi","summary":"This document.","description":"The only endpoint that takes no key: a client cannot read the manual only after authenticating.","tags":["meta"],"security":[],"responses":{"200":{"description":"The OpenAPI 3.1 description of this API.","content":{"application/json":{"schema":{"type":"object"}}}}},"x-plan":"public"}},"/me":{"get":{"operationId":"getMe","summary":"Who this key is, what plan it is on, and how much of the minute is left.","tags":["meta"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"plan":{"type":"string","enum":["free","pro"]},"key":{"$ref":"#/components/schemas/ApiKey"},"rateLimit":{"$ref":"#/components/schemas/RateLimit"}},"required":["userId","plan","key","rateLimit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/systems":{"get":{"operationId":"listSystems","summary":"The scoring systems this key can see: the builtin templates plus your own.","tags":["systems"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"systems":{"type":"array","items":{"$ref":"#/components/schemas/ScoringSystem"}}},"required":["systems"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"},"post":{"operationId":"createSystem","summary":"Create a scoring system from a rules object.","tags":["systems"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"rules":{"$ref":"#/components/schemas/ScoringRules"}},"required":["name","rules"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"system":{"$ref":"#/components/schemas/ScoringSystem"}},"required":["system"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/systems/{id}":{"get":{"operationId":"getSystem","summary":"One scoring system, with its rules. Reading any system is open.","tags":["systems"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Scoring system id."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"system":{"$ref":"#/components/schemas/ScoringSystem"}},"required":["system"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"},"patch":{"operationId":"updateSystem","summary":"Rename, redescribe or re-rule a system you own. Builtins refuse an edit from everyone.","tags":["systems"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Scoring system id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"rules":{"$ref":"#/components/schemas/ScoringRules"}},"required":[]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"system":{"$ref":"#/components/schemas/ScoringSystem"}},"required":["system"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"},"delete":{"operationId":"deleteSystem","summary":"Delete a system you own. A system a league is playing under cannot be deleted.","tags":["systems"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Scoring system id."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"string"}},"required":["deleted"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/players":{"get":{"operationId":"searchPlayers","summary":"Search players and team defenses, optionally scored under a system.","tags":["players"],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Case-insensitive substring of the name."},{"name":"pos","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PosGroup"},"description":"One position group."},{"name":"season","in":"query","required":false,"schema":{"type":"integer"},"description":"Defaults to the newest season the lab holds stats for."},{"name":"system","in":"query","required":false,"schema":{"type":"string"},"description":"Scoring system id. With it, every row carries that system's season total and ppg."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"1..100, default 25."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"season":{"type":"integer"},"systemId":{"type":"string","nullable":true},"total":{"type":"integer"},"players":{"type":"array","items":{"$ref":"#/components/schemas/PlayerSeason"}}},"required":["season","systemId","total","players"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues":{"get":{"operationId":"listLeagues","summary":"The leagues this key is in: the ones it created, and the ones it runs a team in.","tags":["leagues"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leagues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/League"},{"type":"object","properties":{"teamIds":{"type":"array","items":{"type":"string","description":"Teams you run in this league."}}},"required":["teamIds"]}]}}},"required":["leagues"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"},"post":{"operationId":"createLeague","summary":"Create a league, its teams and a regular-season schedule.","tags":["leagues"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Optional slug; a UUID is generated otherwise."},"name":{"type":"string"},"season":{"type":"integer"},"scoringSystemId":{"type":"string"},"teamCount":{"type":"integer","description":"4..16, default 10; the same range the creation wizard offers."},"rosterConfig":{"$ref":"#/components/schemas/RosterConfig"},"acquisitionMode":{"type":"string","enum":["fcfs","waivers"]},"teamNames":{"type":"array","items":{"type":"string","description":"Optional names in draft order, applied as a rename; the rest stay `Team N`."}}},"required":["name","season","scoringSystemId"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"league":{"$ref":"#/components/schemas/League"},"teams":{"type":"array","items":{"$ref":"#/components/schemas/Team"}},"schedule":{"type":"object","properties":{"weeks":{"type":"integer"},"games":{"type":"integer"}},"required":["weeks","games"]}},"required":["league","teams","schedule"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/import/sleeper":{"post":{"operationId":"importSleeperLeague","summary":"Import a Sleeper league, or preview what an import would create.","description":"A second import of the same Sleeper league by the same account fills its rosters in place rather than creating a duplicate. The created league is linked: its rosters mirror Sleeper.","tags":["leagues"],"parameters":[{"name":"preview","in":"query","required":false,"schema":{"type":"integer"},"description":"1 to describe the import and write nothing."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leagueId":{"type":"string","description":"A Sleeper league id, or a sleeper.com URL."}},"required":["leagueId"]}}}},"responses":{"200":{"description":"The preview, when `?preview=1`.","content":{"application/json":{"schema":{"type":"object","properties":{"preview":{"type":"object"}},"required":["preview"]}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"imported":{"type":"object"}},"required":["imported"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}":{"get":{"operationId":"getLeague","summary":"A league, its teams, its standings, the week it is on and its playoff bracket.","description":"`playoffs` is null until a bracket has been drawn, and carries only the rounds that exist -- `playoffs.config.rounds` says how many there will be. Playoff weeks are never in `weeks` or in `standings`: the regular season is weeks 1 to `startWeek - 1`, and it is the only thing the table counts.","tags":["leagues"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"league":{"$ref":"#/components/schemas/League"},"teams":{"type":"array","items":{"$ref":"#/components/schemas/Team"}},"standings":{"type":"array","items":{"$ref":"#/components/schemas/Standing"}},"weeks":{"type":"array","items":{"type":"integer"}},"currentWeek":{"type":"integer","nullable":true},"playoffs":{"$ref":"#/components/schemas/Playoffs","nullable":true}},"required":["league","teams","standings","weeks","currentWeek","playoffs"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}/matchups":{"get":{"operationId":"getMatchups","summary":"A league's scored games. A bye has a null away side and no winner.","tags":["leagues"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"week","in":"query","required":false,"schema":{"type":"integer"},"description":"One week; absent returns every scheduled week."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leagueId":{"type":"string"},"week":{"type":"integer","nullable":true},"weeks":{"type":"array","items":{"type":"integer"}},"matchups":{"type":"array","items":{"$ref":"#/components/schemas/Matchup"}}},"required":["leagueId","week","weeks","matchups"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}/sync":{"post":{"operationId":"syncSleeperLeague","summary":"Pull a linked league back into line with Sleeper.","description":"The commissioner, or any manager running a team in the league.","tags":["leagues"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leagueId":{"type":"string"},"leagueName":{"type":"string"},"report":{"type":"object"}},"required":["leagueId","leagueName","report"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}/teams/{teamId}":{"get":{"operationId":"getTeam","summary":"A team's roster and its lineup for a week.","tags":["teams"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"teamId","in":"path","required":true,"schema":{"type":"string"},"description":"Team id, which must be a team in the league in the path."},{"name":"week","in":"query","required":false,"schema":{"type":"integer"},"description":"Defaults to the week the league is on."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"league":{"$ref":"#/components/schemas/League"},"team":{"$ref":"#/components/schemas/Team"},"week":{"type":"integer"},"roster":{"type":"array","items":{"$ref":"#/components/schemas/RosterSpot"}},"lineup":{"type":"array","items":{"$ref":"#/components/schemas/LineupSlot"}},"bench":{"type":"array","items":{"$ref":"#/components/schemas/Player"}}},"required":["league","team","week","roster","lineup","bench"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}/teams/{teamId}/lineup":{"put":{"operationId":"setLineup","summary":"Set who starts: the whole card, or one slot at a time.","description":"Lock-aware. In a league playing the current real season a player whose game has kicked off can neither be taken out of a lineup nor put into one.","tags":["teams"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"teamId","in":"path","required":true,"schema":{"type":"string"},"description":"Team id, which must be a team in the league in the path."},{"name":"week","in":"query","required":true,"schema":{"type":"integer"},"description":"The week to write."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"slots":{"type":"array","items":{"type":"string","description":"Player id, or null for an empty slot.","nullable":true}}},"required":["slots"]},{"type":"object","properties":{"assignments":{"type":"array","items":{"type":"object","properties":{"slotIndex":{"type":"integer"},"playerId":{"type":"string","nullable":true}},"required":["slotIndex","playerId"]}}},"required":["assignments"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string"},"week":{"type":"integer"},"lineup":{"type":"array","items":{"$ref":"#/components/schemas/LineupSlot"}}},"required":["teamId","week","lineup"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}/teams/{teamId}/lineup/best":{"post":{"operationId":"setBestLineup","summary":"Start the best legal lineup for a week, by what those players actually scored.","description":"Locked slots are pinned rather than refused. Not available on a league mirroring Sleeper.","tags":["teams"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"teamId","in":"path","required":true,"schema":{"type":"string"},"description":"Team id, which must be a team in the league in the path."},{"name":"week","in":"query","required":true,"schema":{"type":"integer"},"description":"The week to solve."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string"},"week":{"type":"integer"},"filled":{"type":"integer"},"slots":{"type":"integer"},"lineup":{"type":"array","items":{"$ref":"#/components/schemas/LineupSlot"}}},"required":["teamId","week","filled","slots","lineup"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}/teams/{teamId}/roster":{"post":{"operationId":"changeRoster","summary":"Sign a free agent, drop a player, or swap one for another.","description":"`swap` is a single transaction: either both halves happen or neither does. Signing needs a league on first come, first served; a league on waivers takes a claim instead.","tags":["teams"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"teamId","in":"path","required":true,"schema":{"type":"string"},"description":"Team id, which must be a team in the league in the path."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["add"]},"playerId":{"type":"string"}},"required":["action","playerId"]},{"type":"object","properties":{"action":{"type":"string","enum":["drop"]},"playerId":{"type":"string"}},"required":["action","playerId"]},{"type":"object","properties":{"action":{"type":"string","enum":["swap"]},"dropPlayerId":{"type":"string"},"addPlayerId":{"type":"string"}},"required":["action","dropPlayerId","addPlayerId"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string"},"action":{"type":"string"},"roster":{"type":"array","items":{"$ref":"#/components/schemas/RosterSpot"}}},"required":["teamId","action","roster"]}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string"},"action":{"type":"string"},"roster":{"type":"array","items":{"$ref":"#/components/schemas/RosterSpot"}}},"required":["teamId","action","roster"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}/teams/{teamId}/waivers":{"get":{"operationId":"listTeamClaims","summary":"This team's waiver claims, newest first.","tags":["waivers"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"teamId","in":"path","required":true,"schema":{"type":"string"},"description":"Team id, which must be a team in the league in the path."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","won","lost","cancelled"]},"description":"Absent returns all."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"1..200, default 50."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string"},"claims":{"type":"array","items":{"$ref":"#/components/schemas/WaiverClaim"}}},"required":["teamId","claims"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"},"post":{"operationId":"fileClaim","summary":"File a waiver claim. The league has to be on waivers.","description":"Whether the claim wins is decided by the daily run, in waiver-priority order. Everything knowable at filing time is checked at filing time.","tags":["waivers"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"teamId","in":"path","required":true,"schema":{"type":"string"},"description":"Team id, which must be a team in the league in the path."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"addPlayerId":{"type":"string"},"dropPlayerId":{"type":"string","description":"Required when the roster is full."}},"required":["addPlayerId"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"claim":{"$ref":"#/components/schemas/WaiverClaim"}},"required":["claim"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}/teams/{teamId}/bench-points":{"get":{"operationId":"getBenchPoints","summary":"What the bench was worth: actual against the best legal lineup of the same roster. Pro.","tags":["analysis"],"security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"teamId","in":"path","required":true,"schema":{"type":"string"},"description":"Team id, which must be a team in the league in the path."},{"name":"week","in":"query","required":true,"schema":{"type":"integer"},"description":"The week to measure."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leagueId":{"type":"string"},"teamId":{"type":"string"},"week":{"type":"integer"},"actual":{"type":"number"},"best":{"type":"number"},"left":{"type":"number","description":"`best - actual`: the points that sat on the bench."},"optimal":{"type":"boolean"},"starters":{"type":"array","items":{"$ref":"#/components/schemas/SlotScore"}},"bench":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"posGroup":{"$ref":"#/components/schemas/PosGroup","nullable":true},"team":{"type":"string","nullable":true},"points":{"type":"number"}},"required":["id","name","posGroup","team","points"]}}},"required":["leagueId","teamId","week","actual","best","left","optimal","starters","bench"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/ProPlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"pro"}},"/leagues/{id}/waivers":{"get":{"operationId":"listLeagueClaims","summary":"Every waiver claim in a league, newest first. The transactions list, as data.","tags":["waivers"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","won","lost","cancelled"]},"description":"Absent returns all."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"1..200, default 50."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leagueId":{"type":"string"},"acquisitionMode":{"type":"string"},"claims":{"type":"array","items":{"$ref":"#/components/schemas/WaiverClaim"}}},"required":["leagueId","acquisitionMode","claims"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}/waivers/{claimId}":{"delete":{"operationId":"cancelClaim","summary":"Withdraw a pending claim. It is cancelled, not deleted.","tags":["waivers"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"claimId","in":"path","required":true,"schema":{"type":"string"},"description":"Waiver claim id."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"claim":{"$ref":"#/components/schemas/WaiverClaim"}},"required":["claim"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}/trades":{"get":{"operationId":"listTrades","summary":"A league's trades, newest first.","tags":["trades"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","accepted","rejected","cancelled"]},"description":"Absent returns all."},{"name":"teamId","in":"query","required":false,"schema":{"type":"string"},"description":"Only trades this team is on either side of."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"1..200, default 50."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leagueId":{"type":"string"},"trades":{"type":"array","items":{"$ref":"#/components/schemas/Trade"}}},"required":["leagueId","trades"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"},"post":{"operationId":"proposeTrade","summary":"Offer a trade. Both sides must be non-empty.","description":"Gated on the offering team. Legality is evaluated when it is accepted, not now.","tags":["trades"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fromTeamId":{"type":"string"},"toTeamId":{"type":"string"},"fromPlayerIds":{"type":"array","items":{"type":"string"}},"toPlayerIds":{"type":"array","items":{"type":"string"}}},"required":["fromTeamId","toTeamId","fromPlayerIds","toPlayerIds"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"trade":{"$ref":"#/components/schemas/Trade"}},"required":["trade"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/leagues/{id}/trades/{tradeId}":{"get":{"operationId":"getTrade","summary":"One trade.","tags":["trades"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"tradeId","in":"path","required":true,"schema":{"type":"string"},"description":"Trade id."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"trade":{"$ref":"#/components/schemas/Trade"}},"required":["trade"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"},"post":{"operationId":"answerTrade","summary":"Accept, reject or cancel a trade.","description":"Accept and reject belong to the team the trade was offered to; cancel belongs to the proposing team and the commissioner. Accepting moves both rosters in one transaction.","tags":["trades"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"League id: a slug or a UUID."},{"name":"tradeId","in":"path","required":true,"schema":{"type":"string"},"description":"Trade id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["accept","reject","cancel"]}},"required":["action"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"trade":{"$ref":"#/components/schemas/Trade"}},"required":["trade"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"free"}},"/analysis/rankings":{"get":{"operationId":"getRankings","summary":"A ranked board under any scoring system, with positional value. Pro.","tags":["analysis"],"parameters":[{"name":"system","in":"query","required":true,"schema":{"type":"string"},"description":"Scoring system id."},{"name":"season","in":"query","required":false,"schema":{"type":"integer"},"description":"Defaults to the newest season the lab holds."},{"name":"pos","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PosGroup"},"description":"One position group."},{"name":"min","in":"query","required":false,"schema":{"type":"integer"},"description":"Minimum games played, default 8."},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["total","ppg","paa"]},"description":"Default total."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"1..500, default 100."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"systemId":{"type":"string"},"season":{"type":"integer"},"pos":{"$ref":"#/components/schemas/PosGroup","nullable":true},"minGames":{"type":"integer"},"sort":{"type":"string"},"total":{"type":"integer"},"players":{"type":"array","items":{"$ref":"#/components/schemas/RankedPlayer"}}},"required":["systemId","season","pos","minGames","sort","total","players"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/ProPlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"pro"}},"/analysis/balance":{"get":{"operationId":"getBalance","summary":"Is a scoring system balanced across positions? Pro.","description":"A balanced system shows a similar outlier premium at every position: beating startable at tight end is worth what beating it at wide receiver is worth.","tags":["analysis"],"parameters":[{"name":"system","in":"query","required":true,"schema":{"type":"string"},"description":"Scoring system id."},{"name":"season","in":"query","required":false,"schema":{"type":"integer"},"description":"Defaults to the newest season the lab holds."},{"name":"min","in":"query","required":false,"schema":{"type":"integer"},"description":"Minimum games played for a player to count, default 8."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"systemId":{"type":"string"},"season":{"type":"integer"},"minGames":{"type":"integer"},"ranks":{"type":"array","items":{"type":"integer","description":"The board positions `ppgAtRanks` is aligned to."}},"positions":{"type":"array","items":{"type":"object","properties":{"pos":{"$ref":"#/components/schemas/PosGroup"},"starters":{"type":"integer"},"count":{"type":"integer"},"baseline":{"type":"number"},"ppgAtRanks":{"type":"array","items":{"type":"number","nullable":true}},"outlierPremium":{"type":"number","nullable":true}},"required":["pos","starters","count","baseline","ppgAtRanks","outlierPremium"]}}},"required":["systemId","season","minGames","ranks","positions"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/ProPlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"pro"}},"/analysis/compare":{"get":{"operationId":"compareSystems","summary":"The same players ranked under two scoring systems. Pro.","tags":["analysis"],"parameters":[{"name":"a","in":"query","required":true,"schema":{"type":"string"},"description":"The system on the left."},{"name":"b","in":"query","required":true,"schema":{"type":"string"},"description":"The system on the right."},{"name":"season","in":"query","required":false,"schema":{"type":"integer"},"description":"Defaults to the newest season the lab holds."},{"name":"pos","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PosGroup"},"description":"One position group."},{"name":"min","in":"query","required":false,"schema":{"type":"integer"},"description":"Minimum games played, default 8."},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["rankA","rankB","delta"]},"description":"Default rankB."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"1..500, default 100."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"systemA":{"type":"string"},"systemB":{"type":"string"},"season":{"type":"integer"},"pos":{"$ref":"#/components/schemas/PosGroup","nullable":true},"minGames":{"type":"integer"},"sort":{"type":"string"},"total":{"type":"integer"},"players":{"type":"array","items":{"type":"object"}}},"required":["systemA","systemB","season","pos","minGames","sort","total","players"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/ProPlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"pro"}},"/optimize":{"post":{"operationId":"optimizeLineup","summary":"The best legal lineup for a set of players. Pro.","description":"Exact, not greedy. Name a league team to take its roster, rules, season and slots; or send players, a system (stored or inline) and a roster config and optimize anything at all.","tags":["analysis"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"week":{"type":"integer"},"leagueId":{"type":"string","description":"With `teamId`: take the roster, rules, season and slots from this league."},"teamId":{"type":"string"},"systemId":{"type":"string","description":"A stored scoring system."},"system":{"$ref":"#/components/schemas/ScoringRules"},"season":{"type":"integer"},"players":{"type":"array","items":{"type":"string","description":"Entity ids: gsis ids or `DST_<TEAM>`."}},"slots":{"$ref":"#/components/schemas/RosterConfig"}},"required":["week"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"leagueId":{"type":"string","nullable":true},"teamId":{"type":"string","nullable":true},"systemId":{"type":"string","nullable":true}},"required":["leagueId","teamId","systemId"]},{"$ref":"#/components/schemas/OptimizedLineup"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/ProPlanRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-plan":"pro"}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key, `sk_sicko_...`, made at https://sicko-fantasy.com/account. The secret is shown once. A key acts as the account that made it and never as an admin."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","enum":["unauthorized","forbidden","pro_plan_required","rate_limited","not_found","invalid_request","conflict","locked","method_not_allowed","server_error"],"description":"Stable machine code."},"message":{"type":"string","description":"The sentence a person reads. May be reworded at any time."}},"required":["error","message"]},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"integer","description":"Unix epoch milliseconds."},"lastUsedAt":{"type":"integer","description":"Unix epoch milliseconds; written at most once a minute.","nullable":true},"revokedAt":{"type":"integer","description":"Unix epoch milliseconds; null while the key works.","nullable":true}},"required":["id","name","createdAt","lastUsedAt","revokedAt"]},"RateLimit":{"type":"object","properties":{"limit":{"type":"integer","description":"Requests allowed this minute."},"remaining":{"type":"integer"},"used":{"type":"integer"},"resetAt":{"type":"integer","description":"Unix epoch milliseconds the window ends at."}},"required":["limit","remaining","used","resetAt"]},"PosGroup":{"type":"string","enum":["QB","RB","WR","TE","K","DL","LB","DB","DST","OTHER"],"description":"Position group. `DST` is a team defense, whose ids look like `DST_SF`."},"ScoringRules":{"type":"object","description":"A scoring system's rules: global weights and brackets, plus per-position overrides. Every stat key must be one of the catalog's; see docs/scoring.md.","properties":{"global":{"type":"object","properties":{"weights":{"type":"object","additionalProperties":{"type":"number"},"description":"Points per unit of a stat."},"brackets":{"type":"array","items":{"type":"object"}}},"required":["weights"]},"positionOverrides":{"type":"object","additionalProperties":{"type":"object"}}},"required":["global"]},"RosterConfig":{"type":"object","properties":{"slots":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"string","description":"Display name, e.g. `FLEX`. Not an identifier: two slots may share one."},"eligible":{"type":"array","items":{"$ref":"#/components/schemas/PosGroup"}}},"required":["slot","eligible"]}},"bench":{"type":"integer","description":"Bench spots, which have no eligibility rule of their own."}},"required":["slots","bench"]},"ScoringSystem":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"builtin":{"type":"boolean","description":"A shipped template. Cannot be edited or deleted by anyone; clone it instead."},"mine":{"type":"boolean","description":"Owned by the account this key acts as."},"rules":{"$ref":"#/components/schemas/ScoringRules"},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"}},"required":["id","name","description","builtin","mine","rules","createdAt","updatedAt"]},"Player":{"type":"object","properties":{"id":{"type":"string","description":"nflverse gsis id, or `DST_<TEAM>` for a team defense."},"name":{"type":"string"},"position":{"type":"string","nullable":true},"posGroup":{"$ref":"#/components/schemas/PosGroup"},"team":{"type":"string","description":"NFL team abbreviation.","nullable":true}},"required":["id","name","position","posGroup","team"]},"PlayerSeason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"string","nullable":true},"posGroup":{"$ref":"#/components/schemas/PosGroup"},"team":{"type":"string","nullable":true},"season":{"type":"integer"},"gamesPlayed":{"type":"integer","description":"Null when no scoring system was named.","nullable":true},"totalPoints":{"type":"number","nullable":true},"ppg":{"type":"number","nullable":true}},"required":["id","name","position","posGroup","team","season","gamesPlayed","totalPoints","ppg"]},"RankedPlayer":{"type":"object","properties":{"rank":{"type":"integer","description":"1-based, assigned after the games-played filter."},"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"string","nullable":true},"posGroup":{"$ref":"#/components/schemas/PosGroup"},"team":{"type":"string","nullable":true},"season":{"type":"integer"},"gamesPlayed":{"type":"integer"},"totalPoints":{"type":"number"},"ppg":{"type":"number"},"posRank":{"type":"integer","description":"1-based rank inside the player's own position group, by ppg."},"posCount":{"type":"integer","description":"Size of the qualified pool at that position."},"baseline":{"type":"number","description":"Mean ppg of the position's top N, N being how many a league starts."},"paa":{"type":"number","description":"Points above average starter: ppg minus baseline."},"posPercentile":{"type":"number","description":"Share of the position's pool at or below this player, 0..1."}},"required":["rank","id","name","position","posGroup","team","season","gamesPlayed","totalPoints","ppg","posRank","posCount","baseline","paa","posPercentile"]},"League":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"season":{"type":"integer","description":"The season the league is played in. Every score and lineup is read against it."},"scoringSystemId":{"type":"string"},"rosterConfig":{"$ref":"#/components/schemas/RosterConfig"},"acquisitionMode":{"type":"string","enum":["fcfs","waivers"]},"sleeperLeagueId":{"type":"string","description":"Non-null means the rosters mirror Sleeper and nothing is acquired here.","nullable":true},"sleeperSettingsDrift":{"type":"boolean","description":"Sleeper's scoring settings have moved since this league was mapped."},"commissioner":{"type":"boolean","description":"Does this key's account own the league?"},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"}},"required":["id","name","season","scoringSystemId","rosterConfig","acquisitionMode","sleeperLeagueId","sleeperSettingsDrift","commissioner","createdAt","updatedAt"]},"Team":{"type":"object","properties":{"id":{"type":"string"},"leagueId":{"type":"string"},"name":{"type":"string"},"managerName":{"type":"string"},"draftPosition":{"type":"integer","nullable":true},"waiverPriority":{"type":"integer","description":"1 claims first; null when no order has been drawn.","nullable":true},"claimed":{"type":"boolean","description":"Has anybody claimed this team through the league's invite link?"},"mine":{"type":"boolean","description":"Is it this key's account that runs it?"}},"required":["id","leagueId","name","managerName","draftPosition","waiverPriority","claimed","mine"]},"Standing":{"type":"object","properties":{"rank":{"type":"integer"},"team":{"$ref":"#/components/schemas/Team"},"wins":{"type":"integer"},"losses":{"type":"integer"},"ties":{"type":"integer"},"games":{"type":"integer","description":"Played games. A bye is not a game."},"pointsFor":{"type":"number"},"pointsAgainst":{"type":"number"}},"required":["rank","team","wins","losses","ties","games","pointsFor","pointsAgainst"]},"Matchup":{"type":"object","properties":{"week":{"type":"integer"},"home":{"type":"object","properties":{"team":{"$ref":"#/components/schemas/Team"},"total":{"type":"number"}},"required":["team","total"]},"away":{"type":"object","properties":{"team":{"$ref":"#/components/schemas/Team"},"total":{"type":"number"}},"required":["team","total"],"nullable":true},"winner":{"type":"string","enum":["home","away","tie"],"nullable":true}},"required":["week","home","away","winner"]},"PlayoffSide":{"type":"object","properties":{"seed":{"type":"integer","description":"1-based playoff seed, from the regular-season standings."},"team":{"$ref":"#/components/schemas/Team"},"total":{"type":"number","description":"The lineup total. Null for a bye, and null for a week not yet played.","nullable":true}},"required":["seed","team","total"]},"PlayoffGame":{"type":"object","properties":{"round":{"type":"integer","description":"1-based. Round 1 is the first week of the postseason."},"week":{"type":"integer"},"home":{"$ref":"#/components/schemas/PlayoffSide"},"away":{"$ref":"#/components/schemas/PlayoffSide","nullable":true},"winner":{"type":"string","enum":["home","away"],"description":"`home` for a bye; null while the game is undecided. There are no ties.","nullable":true},"tiebreak":{"type":"boolean","description":"The totals were level and the better seed took it."}},"required":["round","week","home","away","winner","tiebreak"]},"PlayoffRound":{"type":"object","properties":{"round":{"type":"integer"},"week":{"type":"integer"},"name":{"type":"string","description":"`Final`, `Semifinals`, `Quarterfinals`, `Wild card`."},"games":{"type":"array","items":{"$ref":"#/components/schemas/PlayoffGame"}}},"required":["round","week","name","games"]},"Playoffs":{"type":"object","properties":{"config":{"type":"object","properties":{"teams":{"type":"integer","description":"Bracket size: 2, 4, 6 or 8."},"startWeek":{"type":"integer","description":"The first postseason week. Weeks 1 to this minus one are the regular season."},"rounds":{"type":"integer","description":"Rounds the bracket runs in total, drawn or not."},"weeks":{"type":"array","items":{"type":"integer","description":"The weeks those rounds are played in, ascending."}}},"required":["teams","startWeek","rounds","weeks"]},"rounds":{"type":"array","items":{"$ref":"#/components/schemas/PlayoffRound"}},"champion":{"$ref":"#/components/schemas/Team","nullable":true},"championSeed":{"type":"integer","nullable":true}},"required":["config","rounds","champion","championSeed"]},"RosterSpot":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"posGroup":{"$ref":"#/components/schemas/PosGroup","nullable":true},"team":{"type":"string","nullable":true},"acquiredAt":{"type":"integer","description":"Unix epoch milliseconds. A drafted roster reads back in pick order."}},"required":["id","name","posGroup","team","acquiredAt"]},"LineupSlot":{"type":"object","properties":{"slotIndex":{"type":"integer","description":"Index into the league's roster config slots. Lineups are keyed by it."},"slot":{"type":"string"},"eligible":{"type":"array","items":{"$ref":"#/components/schemas/PosGroup"}},"player":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"posGroup":{"$ref":"#/components/schemas/PosGroup","nullable":true},"team":{"type":"string","nullable":true}},"required":["id","name","posGroup","team"],"nullable":true}},"required":["slotIndex","slot","eligible","player"]},"SlotScore":{"type":"object","properties":{"slotIndex":{"type":"integer"},"slot":{"type":"string"},"eligible":{"type":"array","items":{"$ref":"#/components/schemas/PosGroup"}},"player":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"posGroup":{"$ref":"#/components/schemas/PosGroup","nullable":true},"team":{"type":"string","nullable":true}},"required":["id","name","posGroup","team"],"nullable":true},"points":{"type":"number","description":"What the player in this slot scored that week; 0 for an empty slot."}},"required":["slotIndex","slot","eligible","player","points"]},"WaiverClaim":{"type":"object","properties":{"id":{"type":"string"},"leagueId":{"type":"string"},"teamId":{"type":"string"},"addPlayerId":{"type":"string"},"dropPlayerId":{"type":"string","nullable":true},"status":{"type":"string","enum":["pending","won","lost","cancelled"]},"createdAt":{"type":"integer","description":"The tie-break inside one waiver priority: first filed, first run."},"processedAt":{"type":"integer","nullable":true},"note":{"type":"string","description":"Why it lost, in the words a manager reads.","nullable":true}},"required":["id","leagueId","teamId","addPlayerId","dropPlayerId","status","createdAt","processedAt","note"]},"Trade":{"type":"object","properties":{"id":{"type":"string"},"leagueId":{"type":"string"},"fromTeamId":{"type":"string","description":"The team that proposed it, and may cancel it."},"toTeamId":{"type":"string","description":"The team it was offered to, and the only one that may accept or reject it."},"status":{"type":"string","enum":["pending","accepted","rejected","cancelled"]},"fromPlayerIds":{"type":"array","items":{"type":"string"}},"toPlayerIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"integer"},"resolvedAt":{"type":"integer","nullable":true}},"required":["id","leagueId","fromTeamId","toTeamId","status","fromPlayerIds","toPlayerIds","createdAt","resolvedAt"]},"OptimizedLineup":{"type":"object","properties":{"season":{"type":"integer"},"week":{"type":"integer"},"slots":{"type":"array","items":{"type":"object","properties":{"slotIndex":{"type":"integer"},"slot":{"type":"string"},"eligible":{"type":"array","items":{"$ref":"#/components/schemas/PosGroup"}},"playerId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"posGroup":{"$ref":"#/components/schemas/PosGroup","nullable":true},"team":{"type":"string","nullable":true},"points":{"type":"number"}},"required":["slotIndex","slot","eligible","playerId","name","posGroup","team","points"]}},"total":{"type":"number","description":"The sum of the slots, to two decimals."},"bench":{"type":"array","items":{"type":"object","properties":{"playerId":{"type":"string"},"name":{"type":"string"},"posGroup":{"$ref":"#/components/schemas/PosGroup"},"team":{"type":"string","nullable":true},"points":{"type":"number"}},"required":["playerId","name","posGroup","team","points"]}},"unknownPlayerIds":{"type":"array","items":{"type":"string","description":"Ids that resolved to no player and no team defense."}}},"required":["season","week","slots","total","bench","unknownPlayerIds"]}},"responses":{"BadRequest":{"description":"The request itself is wrong: a missing field, a bad type, invalid rules.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"No key, an unknown key, or a revoked one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ProPlanRequired":{"description":"A free key on a pro endpoint. The body's `error` is `pro_plan_required`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"A good key with no right to the thing it named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"No such league, team, system, player, trade or claim.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"The league's state refuses it: a full roster, a duplicate signing, a game that has kicked off.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"More than the plan's requests in one 60s window (free 60, pro 600). Carries `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}