{"openapi":"3.1.0","info":{"title":"23pools API","version":"0.0.1","description":"Pools for the 23 estate. Auth: Zitadel bearer token (project 23-platform)."},"servers":[{"url":"https://api.23pools.com/v1"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Zitadel access token from https://auth.23groups.com; aud must include the 23-platform project."}},"schemas":{"User":{"type":"object","properties":{"sub":{"type":"string"},"handle":{"type":"string","nullable":true},"displayName":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true}},"required":["sub","handle","displayName","avatarUrl"]},"Membership":{"type":"object","properties":{"groupId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"propertyId":{"type":"string"},"role":{"type":"string","enum":["owner","admin","moderator","member"]}},"required":["groupId","name","slug","propertyId","role"]},"Pool":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"blurb":{"type":"string","nullable":true},"scope":{"type":"string"},"groupId":{"type":"string","nullable":true},"groupName":{"type":"string","nullable":true},"visibility":{"type":"string"},"hasJoinCode":{"type":"boolean"},"joinCode":{"type":"string","nullable":true},"maxEntrants":{"type":"number","nullable":true},"maxEntriesPerUser":{"type":"number"},"picksOpenAt":{"type":"string"},"picksCloseAt":{"type":"string"},"picksVisibility":{"type":"string"},"state":{"type":"string"},"phase":{"type":"string"},"config":{"type":"object","additionalProperties":{"nullable":true}},"tiebreakerActual":{"anyOf":[{"type":"integer"},{"type":"string","maxLength":80},{"nullable":true}],"description":"a whole number for `number` tiebreakers, text for `text` ones; null clears"},"eventId":{"type":"string","nullable":true},"eventName":{"type":"string","nullable":true},"eventSlug":{"type":"string","nullable":true},"createdBy":{"type":"object","nullable":true,"properties":{"sub":{"type":"string"},"handle":{"type":"string","nullable":true},"displayName":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true}},"required":["sub","handle","displayName","avatarUrl"]},"createdAt":{"type":"string"},"publishedAt":{"type":"string","nullable":true},"finalizedAt":{"type":"string","nullable":true},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"seed":{"type":"number"},"name":{"type":"string"},"position":{"type":"number"}},"required":["id","seed","name","position"]}},"results":{"type":"object","additionalProperties":{"type":"object","properties":{"winnerOptionId":{"type":"string"},"scoreA":{"type":"number","nullable":true},"scoreB":{"type":"number","nullable":true}},"required":["winnerOptionId","scoreA","scoreB"]}},"entrantCount":{"type":"number"},"entryCount":{"type":"number"},"resultCount":{"type":"number"},"pickableCount":{"type":"number"},"allowCopy":{"type":"boolean","description":"others may copy this pool; always true for lobby pools"},"copiedFrom":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"scope":{"type":"string"},"phase":{"type":"string"}},"required":["id","slug","name","scope","phase"],"description":"the original this pool was copied from; results flow from it"},"viewer":{"type":"object","properties":{"isManager":{"type":"boolean"},"canEnter":{"type":"boolean"},"cannotEnterReason":{"type":"string","nullable":true},"myEntryIds":{"type":"array","items":{"type":"string"}},"picksVisible":{"type":"boolean"},"canCopy":{"type":"boolean"}},"required":["isManager","canEnter","cannotEnterReason","myEntryIds","picksVisible","canCopy"]},"managers":{"type":"array","items":{"type":"object","properties":{"user":{"type":"object","nullable":true,"properties":{"sub":{"type":"string"},"handle":{"type":"string","nullable":true},"displayName":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true}},"required":["sub","handle","displayName","avatarUrl"]},"role":{"type":"string"}},"required":["user","role"]}}},"required":["id","type","name","slug","blurb","scope","groupId","groupName","visibility","hasJoinCode","maxEntrants","maxEntriesPerUser","picksOpenAt","picksCloseAt","picksVisibility","state","phase","config","tiebreakerActual","eventId","eventName","eventSlug","createdBy","createdAt","publishedAt","finalizedAt","options","results","entrantCount","entryCount","resultCount","pickableCount","allowCopy","copiedFrom","viewer"]},"PoolInput":{"type":"object","properties":{"type":{"type":"string","enum":["bracket","pickem","survivor","guess","baby","squares"]},"name":{"type":"string","minLength":2,"maxLength":60},"blurb":{"type":"string","nullable":true,"maxLength":280},"scope":{"type":"string","enum":["lobby","group"]},"groupId":{"type":"string","nullable":true},"visibility":{"type":"string","enum":["public","unlisted"]},"picksOpenAt":{"type":"string","format":"date-time"},"picksCloseAt":{"type":"string","format":"date-time"},"picksVisibility":{"type":"string","enum":["after_close","never"]},"maxEntrants":{"type":"integer","nullable":true},"maxEntriesPerUser":{"type":"integer"},"config":{"type":"object","additionalProperties":{"nullable":true},"description":"type-specific: bracket {seeded, scoring, tiebreaker}; pickem {games[{id,label,options[],points,spread?}], confidence, league?, tiebreaker}; survivor {teams[], weeks[{id,label,closesAt}], lives, allowRepeats, league?, tiebreaker}; guess/baby {questions[], tiebreaker}; squares {homeTeam, awayTeam, periods[], maxSquaresPerUser}. tiebreaker = {kind: none|number|text, label}. league (nfl|nba|wnba|mlb|nhl|mls) matches option labels to /objects; the server fills config.refs {label: objectId}"},"options":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"seed":{"type":"integer","minimum":1,"maximum":128}},"required":["name"]},"maxItems":128,"description":"required unless eventId is given"},"eventId":{"type":"string","nullable":true,"description":"base the pool on a shared event"},"publish":{"type":"boolean"},"allowCopy":{"type":"boolean","description":"group pools: let members copy the setup (default true); lobby pools are always copyable"}},"required":["name","scope","picksOpenAt","picksCloseAt"]},"PoolPatch":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":60},"blurb":{"type":"string","nullable":true,"maxLength":280},"visibility":{"type":"string","enum":["public","unlisted"]},"picksOpenAt":{"type":"string","format":"date-time"},"picksCloseAt":{"type":"string","format":"date-time"},"picksVisibility":{"type":"string","enum":["after_close","never"]},"maxEntrants":{"type":"integer","nullable":true},"maxEntriesPerUser":{"type":"integer"},"config":{"type":"object","additionalProperties":{"nullable":true},"description":"type-specific: bracket {seeded, scoring, tiebreaker}; pickem {games[{id,label,options[],points,spread?}], confidence, league?, tiebreaker}; survivor {teams[], weeks[{id,label,closesAt}], lives, allowRepeats, league?, tiebreaker}; guess/baby {questions[], tiebreaker}; squares {homeTeam, awayTeam, periods[], maxSquaresPerUser}. tiebreaker = {kind: none|number|text, label}. league (nfl|nba|wnba|mlb|nhl|mls) matches option labels to /objects; the server fills config.refs {label: objectId}"},"allowCopy":{"type":"boolean","description":"group pools: let members copy the setup (default true); lobby pools are always copyable"}}},"CopyInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":60},"scope":{"type":"string","enum":["lobby","group"],"description":"default lobby"},"groupId":{"type":"string","nullable":true},"publish":{"type":"boolean","description":"default false: the copy is a draft you adjust in settings"}}},"Entry":{"type":"object","properties":{"id":{"type":"string"},"poolId":{"type":"string"},"user":{"type":"object","nullable":true,"properties":{"sub":{"type":"string"},"handle":{"type":"string","nullable":true},"displayName":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true}},"required":["sub","handle","displayName","avatarUrl"]},"label":{"type":"string","nullable":true},"complete":{"type":"boolean"},"submittedAt":{"type":"string","nullable":true},"updatedAt":{"type":"string"},"points":{"type":"number"},"maxPossible":{"type":"number"},"rank":{"type":"number","nullable":true},"correctByRound":{"type":"array","items":{"type":"number"}},"picks":{"nullable":true},"detail":{"nullable":true},"tiebreaker":{"anyOf":[{"type":"integer"},{"type":"string","maxLength":80},{"nullable":true}],"description":"a whole number for `number` tiebreakers, text for `text` ones; null clears"},"picked":{"type":"number"},"pickable":{"type":"number"},"isMine":{"type":"boolean"}},"required":["id","poolId","user","label","complete","submittedAt","updatedAt","points","maxPossible","rank","correctByRound","isMine"]},"Event":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"blurb":{"type":"string","nullable":true},"seeded":{"type":"boolean"},"visibility":{"type":"string"},"state":{"type":"string"},"createdBy":{"type":"object","nullable":true,"properties":{"sub":{"type":"string"},"handle":{"type":"string","nullable":true},"displayName":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true}},"required":["sub","handle","displayName","avatarUrl"]},"createdAt":{"type":"string"},"finalizedAt":{"type":"string","nullable":true},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"seed":{"type":"number"},"name":{"type":"string"},"position":{"type":"number"}},"required":["id","seed","name","position"]}},"results":{"type":"object","additionalProperties":{"type":"object","properties":{"winnerOptionId":{"type":"string"},"scoreA":{"type":"number","nullable":true},"scoreB":{"type":"number","nullable":true}},"required":["winnerOptionId","scoreA","scoreB"]}},"resultCount":{"type":"number"},"pickableCount":{"type":"number"},"attachedPools":{"type":"number"},"viewer":{"type":"object","properties":{"isOwner":{"type":"boolean"}},"required":["isOwner"]}},"required":["id","type","name","slug","blurb","seeded","visibility","state","createdBy","createdAt","finalizedAt","options","results","resultCount","pickableCount","attachedPools","viewer"]},"EventInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":60},"blurb":{"type":"string","nullable":true,"maxLength":280},"seeded":{"type":"boolean"},"visibility":{"type":"string","enum":["public","unlisted"]},"options":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"seed":{"type":"integer","minimum":1,"maximum":128}},"required":["name"]},"minItems":2,"maxItems":128}},"required":["name","options"]},"RefObject":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"league":{"type":"string","nullable":true},"label":{"type":"string"},"shortLabel":{"type":"string"},"abbr":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"link":{"type":"string","nullable":true,"description":"reference page (Wikipedia)"},"photo":{"type":"string","nullable":true,"description":"logo URL"},"website":{"type":"string","nullable":true,"description":"official site"},"source":{"type":"string","enum":["builtin","custom"]}},"required":["id","kind","league","label","shortLabel","abbr","city","link","photo","website","source"]},"RefObjectInput":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":60,"description":"slug; derived from league + label when omitted"},"kind":{"type":"string","enum":["team"]},"league":{"type":"string","nullable":true,"maxLength":16},"label":{"type":"string","minLength":2,"maxLength":80},"shortLabel":{"type":"string","nullable":true,"maxLength":80},"abbr":{"type":"string","nullable":true,"maxLength":8},"city":{"type":"string","nullable":true,"maxLength":40},"link":{"type":"string","nullable":true,"maxLength":500},"photo":{"type":"string","nullable":true,"maxLength":500},"website":{"type":"string","nullable":true,"maxLength":500}},"required":["label"]}},"parameters":{}},"paths":{"/health":{"get":{"tags":["meta"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"version":{"type":"string"},"issuer":{"type":"string"}},"required":["ok","version","issuer"]}}}}}}},"/me":{"get":{"tags":["me"],"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"roles":{"type":"array","items":{"type":"string"}},"isPlatformAdmin":{"type":"boolean"}},"required":["user","roles","isPlatformAdmin"]}}}}}}},"/me/groups":{"get":{"tags":["me"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["1"]},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"memberships":{"type":"array","items":{"$ref":"#/components/schemas/Membership"}},"checkedAt":{"type":"string"},"stale":{"type":"boolean"}},"required":["memberships","checkedAt","stale"]}}}}}}},"/lobby":{"get":{"tags":["pools"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"max pools returned (default 50), newest close first"},"required":false,"description":"max pools returned (default 50), newest close first","name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pools":{"type":"array","items":{"$ref":"#/components/schemas/Pool"}}},"required":["pools"]}}}}}}},"/groups/{gid}/pools":{"get":{"tags":["pools"],"security":[{"bearer":[]}],"description":"Pools of a 23groups group (members only). `23pools` is the main group: every public lobby pool, no login needed.","parameters":[{"schema":{"type":"string"},"required":true,"name":"gid","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"max pools returned (default 50), newest close first"},"required":false,"description":"max pools returned (default 50), newest close first","name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pools":{"type":"array","items":{"$ref":"#/components/schemas/Pool"}}},"required":["pools"]}}}}}}},"/me/pools":{"get":{"tags":["me"],"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"managed":{"type":"array","items":{"$ref":"#/components/schemas/Pool"}},"entered":{"type":"array","items":{"$ref":"#/components/schemas/Pool"}}},"required":["managed","entered"]}}}}}}},"/pools":{"post":{"tags":["pools"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}":{"get":{"tags":["pools"],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}},"patch":{"tags":["pools"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolPatch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/options":{"put":{"tags":["pools"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"options":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"seed":{"type":"integer","minimum":1,"maximum":128}},"required":["name"]},"minItems":2,"maxItems":128}},"required":["options"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/publish":{"post":{"tags":["pools"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/lock":{"post":{"tags":["pools"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/reopen":{"post":{"tags":["pools"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/finalize":{"post":{"tags":["pools"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/archive":{"post":{"tags":["pools"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/copy":{"post":{"tags":["pools"],"security":[{"bearer":[]}],"description":"Copy a pool you can see into a new draft of your own (setup only: type, options, scoring, limits). Lobby pools are always copyable; group pools when the commissioner allows it. Results then flow from the original into the copy until it is detached.","parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopyInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/detach":{"post":{"tags":["pools"],"security":[{"bearer":[]}],"description":"Stop following the original: results are entered by hand from then on.","parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/join-code":{"post":{"tags":["pools"],"security":[{"bearer":[]}],"description":"Optional JSON body {clear: true} removes the code.","parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/managers":{"post":{"tags":["pools"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"maxLength":40}},"required":["handle"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/managers/{sub}":{"delete":{"tags":["pools"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"sub","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}}},"/pools/{id}/entries":{"post":{"tags":["entries"],"security":[{"bearer":[]}],"description":"Optional JSON body {label?, joinCode?}.","parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entry"}}}}}},"get":{"tags":["entries"],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/Entry"}}},"required":["entries"]}}}}}}},"/entries/{eid}":{"get":{"tags":["entries"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"eid","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entry"}}}}}},"delete":{"tags":["entries"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"eid","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/entries/{eid}/picks":{"put":{"tags":["entries"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"eid","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"picks":{"nullable":true,"description":"bracket: {matchId: optionId}; pickem: {picks: {gameId: option}, confidence?: {gameId: n}}; survivor: {weekId: team} (closed weeks are kept as they are); guess/baby: {questionId: answer}; squares: {squares: [index…]}"},"tiebreaker":{"anyOf":[{"type":"integer"},{"type":"string","maxLength":80},{"nullable":true}],"description":"a whole number for `number` tiebreakers, text for `text` ones; null clears"},"label":{"type":"string","nullable":true,"maxLength":40}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entry"}}}}}}},"/entries/{id}/mirror":{"post":{"tags":["entries"],"security":[{"bearer":[]}],"description":"Enter this entry's picks in the pool it was copied from (a main-lobby original that is still open). Creates your entry there when needed.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"$ref":"#/components/schemas/Entry"},"pool":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]}},"required":["entry","pool"]}}}}}}},"/pools/{id}/results":{"get":{"tags":["results"],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"object","additionalProperties":{"type":"object","properties":{"winnerOptionId":{"type":"string"},"scoreA":{"type":"number","nullable":true},"scoreB":{"type":"number","nullable":true}},"required":["winnerOptionId","scoreA","scoreB"]}},"tiebreakerActual":{"anyOf":[{"type":"integer"},{"type":"string","maxLength":80},{"nullable":true}],"description":"a whole number for `number` tiebreakers, text for `text` ones; null clears"},"events":{"type":"array","items":{"type":"object","properties":{"matchId":{"type":"string"},"winnerOptionId":{"type":"string","nullable":true},"enteredBy":{"type":"string"},"at":{"type":"string"}},"required":["matchId","winnerOptionId","enteredBy","at"]}}},"required":["results","tiebreakerActual","events"]}}}}}},"post":{"tags":["results"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"winnerOptionId":{"type":"string","nullable":true,"description":"bracket: winning option id (null clears)"},"value":{"type":"string","nullable":true,"description":"guess/baby: the actual answer; pickem: winning option or \"push\"; survivor (key weekId:Team): win | loss | tie; squares: \"home-away\" score (null clears)"},"scoreA":{"type":"integer","nullable":true},"scoreB":{"type":"integer","nullable":true},"matchId":{"type":"string"}},"required":["matchId"]},"maxItems":127}},"required":["results"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"changed":{"type":"array","items":{"type":"string"}}},"required":["changed"]}}}}}}},"/pools/{id}/results/{matchId}":{"put":{"tags":["results"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"matchId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"winnerOptionId":{"type":"string","nullable":true,"description":"bracket: winning option id (null clears)"},"value":{"type":"string","nullable":true,"description":"guess/baby: the actual answer; pickem: winning option or \"push\"; survivor (key weekId:Team): win | loss | tie; squares: \"home-away\" score (null clears)"},"scoreA":{"type":"integer","nullable":true},"scoreB":{"type":"integer","nullable":true}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"changed":{"type":"array","items":{"type":"string"}}},"required":["changed"]}}}}}}},"/pools/{id}/tiebreaker":{"put":{"tags":["results"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"anyOf":[{"type":"integer"},{"type":"string","maxLength":80},{"nullable":true}],"description":"a whole number for `number` tiebreakers, text for `text` ones; null clears"}},"required":["value"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/pools/{id}/standings":{"get":{"tags":["results"],"parameters":[{"schema":{"type":"string","description":"pool id or slug"},"required":true,"description":"pool id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"phase":{"type":"string"},"rounds":{"type":"array","items":{"type":"string"}},"standings":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"number","nullable":true},"entry":{"$ref":"#/components/schemas/Entry"},"tbDiff":{"type":"number","nullable":true}},"required":["rank","entry","tbDiff"]}}},"required":["phase","rounds","standings"]}}}}}}},"/join/{code}":{"get":{"tags":["pools"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}}}},"post":{"tags":["entries"],"security":[{"bearer":[]}],"description":"Enter the pool this invite code belongs to (optional JSON body {label}).","parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entry"}}}}}}},"/admin/pools":{"get":{"tags":["admin"],"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pools":{"type":"array","items":{"$ref":"#/components/schemas/Pool"}}},"required":["pools"]}}}}}}},"/events":{"get":{"tags":["events"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}},"required":["events"]}}}}}},"post":{"tags":["events"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}}}}},"/events/{id}":{"get":{"tags":["events"],"parameters":[{"schema":{"type":"string","description":"event id or slug"},"required":true,"description":"event id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}}}},"patch":{"tags":["events"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"event id or slug"},"required":true,"description":"event id or slug","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":60},"blurb":{"type":"string","nullable":true,"maxLength":280},"visibility":{"type":"string","enum":["public","unlisted"]},"state":{"type":"string","enum":["open","final","archived"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}}}}},"/events/{id}/results/{matchId}":{"put":{"tags":["events"],"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","description":"event id or slug"},"required":true,"description":"event id or slug","name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"matchId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"winnerOptionId":{"type":"string","nullable":true},"scoreA":{"type":"integer","nullable":true},"scoreB":{"type":"integer","nullable":true}},"required":["winnerOptionId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"changed":{"type":"array","items":{"type":"string"}},"pools":{"type":"number"}},"required":["changed","pools"]}}}}}}},"/events/{id}/pools":{"get":{"tags":["events"],"parameters":[{"schema":{"type":"string","description":"event id or slug"},"required":true,"description":"event id or slug","name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pools":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"phase":{"type":"string"},"entryCount":{"type":"number"}},"required":["id","name","slug","phase","entryCount"]}}},"required":["pools"]}}}}}}},"/leagues":{"get":{"tags":["objects"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leagues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"teamCount":{"type":"number"}},"required":["id","label","teamCount"]}}},"required":["leagues"]}}}}}}},"/objects":{"get":{"tags":["objects"],"description":"Reference objects picks can point at. Built in: every club in the NFL, NBA, WNBA, MLB, NHL and MLS.","parameters":[{"schema":{"type":"string"},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string"},"required":false,"name":"league","in":"query"},{"schema":{"type":"string","maxLength":60,"description":"matches label, nickname or abbreviation"},"required":false,"description":"matches label, nickname or abbreviation","name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"objects":{"type":"array","items":{"$ref":"#/components/schemas/RefObject"}}},"required":["objects"]}}}}}},"post":{"tags":["objects"],"security":[{"bearer":[]}],"description":"Platform admins only. Adds an object the catalog lacks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefObjectInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefObject"}}}}}}},"/objects/{id}":{"get":{"tags":["objects"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefObject"}}}}}},"patch":{"tags":["objects"],"security":[{"bearer":[]}],"description":"Platform admins only.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":3,"maxLength":60,"description":"slug; derived from league + label when omitted"},"kind":{"type":"string","enum":["team"]},"league":{"type":"string","nullable":true,"maxLength":16},"label":{"type":"string","minLength":2,"maxLength":80},"shortLabel":{"type":"string","nullable":true,"maxLength":80},"abbr":{"type":"string","nullable":true,"maxLength":8},"city":{"type":"string","nullable":true,"maxLength":40},"link":{"type":"string","nullable":true,"maxLength":500},"photo":{"type":"string","nullable":true,"maxLength":500},"website":{"type":"string","nullable":true,"maxLength":500}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefObject"}}}}}}}}}