{"openapi":"3.1.0","info":{"title":"MakeReady API","version":"1.103","description":"Open scoring platform for practical shooting. JSON in and out; errors are `{ \"error\": \"…\" }` (401/403/404/409/422/429), zod validation errors add `issues`. Full narrative in /docs/api and /docs/club-portal-integration. Live scoreboards use a WebSocket at /live/matches/{matchId} (see /docs/live-scoreboard)."},"servers":[{"url":"https://makeready.be"}],"tags":[{"name":"Accounts"},{"name":"Clubs"},{"name":"Matches"},{"name":"Stages"},{"name":"Squads"},{"name":"Competitors"},{"name":"Results"},{"name":"Shootoff"},{"name":"Sync","description":"Tablets (staff)"},{"name":"Rules","description":"Central, versioned discipline rules"},{"name":"Admin","description":"MakeReady admin"},{"name":"Integrations","description":"Club portals with an API key"},{"name":"Public","description":"No authentication; public events only"}],"components":{"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"mkr_session","description":"Web portal session (POST /api/v1/auth/login)"},"deviceToken":{"type":"http","scheme":"bearer","description":"Tablet device token (POST /api/v1/auth/device/login)"},"apiKey":{"type":"http","scheme":"bearer","description":"Club API key mkr_… with scopes"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"issues":{"type":"array","items":{"type":"object"}}},"required":["error"]},"Credentials":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string"}},"required":["email","password"]},"User":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"platformAdmin":{"type":"boolean"},"emailVerified":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"}}},"Membership":{"type":"object","properties":{"clubId":{"type":"string"},"role":{"type":"string","enum":["admin","staff","member"]},"clubName":{"type":"string"}}},"Device":{"type":"object","properties":{"deviceId":{"type":"string","format":"uuid"},"name":{"type":"string"},"platform":{"type":"string"},"appVersion":{"type":"string"}},"required":["deviceId","name","platform","appVersion"]},"ScoringProfile":{"type":"object","description":"See docs/scoring.md","properties":{"method":{"type":"string","enum":["comstock","time_plus","shootoff"]},"ranking":{"type":"string","enum":["stage_points","total_time","time_percentage","bracket"]},"zones":{"type":"object"},"steelHit":{"type":"number"},"penalties":{"type":"object"},"timePenalties":{"type":"object"},"pointsPerRound":{"type":"number"},"allowMajor":{"type":"boolean"},"dnfTimeSeconds":{"type":"number"}}},"Division":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"forcedPowerFactor":{"type":"string","enum":["major","minor"]}},"required":["code","name"]},"Category":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]},"Match":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"clubId":{"type":"string","nullable":true},"clubName":{"type":"string"},"createdBy":{"type":"string"},"createdByName":{"type":"string","description":"Name of the user who created the event"},"rulesVersion":{"type":"integer"},"name":{"type":"string"},"discipline":{"$ref":"#/components/schemas/Discipline"},"scoring":{"$ref":"#/components/schemas/ScoringProfile"},"divisions":{"type":"array","items":{"$ref":"#/components/schemas/Division"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"visibility":{"type":"string","enum":["public","club","private"]},"status":{"type":"string","enum":["draft","registration","live","finished","archived"]},"kind":{"type":"string","enum":["match","training"]},"externalId":{"type":"string"},"registrationSource":{"type":"string","nullable":true},"updatedAt":{"type":"string","format":"date-time"}}},"Discipline":{"type":"string","enum":["ipsc_handgun","fds","lvr","multigun","brutality","shootoff"]},"MatchInput":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Optional id chosen by the creator (tablets that created the event offline); 409 when taken"},"clubId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":2,"maxLength":120},"discipline":{"$ref":"#/components/schemas/Discipline"},"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"visibility":{"type":"string","enum":["public","club","private"],"default":"club"},"kind":{"type":"string","enum":["match","training"],"default":"match"},"divisions":{"type":"array","items":{"$ref":"#/components/schemas/Division"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"externalId":{"type":"string"}},"required":["name","discipline","startDate","endDate"]},"MatchPatch":{"type":"object","properties":{"name":{"type":"string"},"visibility":{"type":"string","enum":["public","club","private"]},"status":{"type":"string","enum":["draft","registration","live","finished","archived"]},"kind":{"type":"string","enum":["match","training"]},"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"divisions":{"type":"array","items":{"$ref":"#/components/schemas/Division"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"clubId":{"type":"string","nullable":true,"description":"null releases the event; a club id claims or transfers it (staff of that club)"},"discipline":{"$ref":"#/components/schemas/Discipline","description":"Only while no approved score or decided bout exists"},"dnfTimeSeconds":{"type":"number","nullable":true,"description":"Time plus: fixed DNF time of the match"}}},"Target":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["paper","popper","plate","disappearing","bonus","time_bonus","bonus_target","objective","procedural"],"description":"popper and plate are hit or miss. Time-based disciplines only: time_bonus is a bonus (label = name, seconds taken off every time it is awarded), bonus_target has to be hit requiredHits times (seconds off per hit, missSeconds added per missing hit), objective adds its seconds when it is not met, procedural is a procedural error of this stage alone (label = description, seconds added every time it is given)"},"requiredHits":{"type":"integer"},"noShoots":{"type":"integer"},"label":{"type":"string"},"seconds":{"type":"number"},"missSeconds":{"type":"number"}},"required":["id","kind","requiredHits"]},"StageInput":{"type":"object","properties":{"number":{"type":"integer"},"name":{"type":"string"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/Target"}},"parTimeSeconds":{"type":"number"},"dnfTimeSeconds":{"type":"number"},"briefing":{"type":"string"},"active":{"type":"boolean","default":true},"kind":{"type":"string","enum":["regular","drill"],"description":"drill: a training stage shot in `strings` strings, evaluated side by side (trainings only)"},"strings":{"type":"integer","minimum":1,"maximum":50}},"required":["number","name","targets"]},"Stage":{"allOf":[{"$ref":"#/components/schemas/StageInput"},{"type":"object","properties":{"id":{"type":"string"},"matchId":{"type":"string"},"type":{"type":"string","enum":["comstock","time_plus"]},"roundCount":{"type":"integer"},"updatedAt":{"type":"string"}}}]},"SquadInput":{"type":"object","properties":{"name":{"type":"string"},"startsAt":{"type":"string","format":"date-time"}},"required":["name"]},"CompetitorInput":{"type":"object","properties":{"squadId":{"type":"string","nullable":true},"userEmail":{"type":"string","format":"email","description":"Links the registration to a MakeReady account"},"externalId":{"type":"string"},"number":{"type":"integer"},"firstName":{"type":"string"},"lastName":{"type":"string"},"club":{"type":"string"},"division":{"type":"string"},"categories":{"type":"array","items":{"type":"string"},"default":[]},"powerFactor":{"type":"string","enum":["major","minor"],"default":"minor","description":"Optional; minor when the club portal does not know it"},"team":{"type":"string","description":"Team name for the team standings"}},"required":["firstName","lastName","division"]},"Competitor":{"allOf":[{"$ref":"#/components/schemas/CompetitorInput"},{"type":"object","properties":{"id":{"type":"string"},"matchId":{"type":"string"},"userId":{"type":"string","nullable":true},"disqualified":{"type":"boolean"},"dqReason":{"type":"string"},"overrides":{"type":"array","items":{"type":"string","enum":["number","club","team","division","powerFactor","categories","squadId"]},"description":"Club-portal registrations: fields corrected in MakeReady, kept on later syncs"},"updatedAt":{"type":"string"}}}]},"TargetHits":{"type":"object","properties":{"targetId":{"type":"string"},"A":{"type":"integer"},"C":{"type":"integer"},"D":{"type":"integer"},"M":{"type":"integer"},"NS":{"type":"integer","maximum":2},"hit":{"type":"integer","minimum":0,"maximum":10,"description":"popper, plate and objective: 1 = hit or met, 0 = not. time_bonus: the number of times it was awarded. bonus_target: the number of hits. procedural: the number of times it was given"}},"required":["targetId"]},"StageScore":{"type":"object","description":"Append-only: every correction is a new revision per (competitor, stage).","properties":{"id":{"type":"string","format":"uuid"},"matchId":{"type":"string"},"stageId":{"type":"string"},"competitorId":{"type":"string"},"revision":{"type":"integer","minimum":1},"timeSeconds":{"type":"number"},"shotTimes":{"type":"array","items":{"type":"number"}},"hits":{"type":"array","items":{"$ref":"#/components/schemas/TargetHits"}},"procedurals":{"type":"integer"},"strings":{"type":"array","description":"Drill stages: every string (time, shot times, hits, procedurals); the fields above hold the best string","items":{"type":"object","properties":{"timeSeconds":{"type":"number"},"shotTimes":{"type":"array","items":{"type":"number"}},"hits":{"type":"array","items":{"$ref":"#/components/schemas/TargetHits"}},"procedurals":{"type":"integer"}}}},"proceduralReasons":{"type":"array","items":{"type":"string"}},"dnf":{"type":"boolean"},"dq":{"type":"boolean"},"approvedAt":{"type":"string","format":"date-time","nullable":true},"approvedByCompetitor":{"type":"boolean"},"signature":{"type":"string","description":"\"W,H|x,y x,y|…\" drawn on the tablet"},"roUserId":{"type":"string"},"deviceId":{"type":"string"},"timerSource":{"type":"string","description":"sg_timer:<id>, amg_commander:<id>, manual or portal_correction"},"createdAt":{"type":"string","format":"date-time"},"notes":{"type":"string"}},"required":["id","matchId","stageId","competitorId","revision","hits","procedurals","dnf","dq","approvedAt","approvedByCompetitor","roUserId","deviceId","timerSource","createdAt"]},"SyncPush":{"type":"object","properties":{"deviceId":{"type":"string","format":"uuid"},"matchId":{"type":"string"},"scores":{"type":"array","items":{"$ref":"#/components/schemas/StageScore"}}},"required":["deviceId","matchId","scores"]},"SyncPushResult":{"type":"object","properties":{"accepted":{"type":"array","items":{"type":"string"}},"ignored":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string"}}}},"serverTime":{"type":"string"}}},"Bundle":{"type":"object","properties":{"match":{"$ref":"#/components/schemas/Match"},"stages":{"type":"array","items":{"$ref":"#/components/schemas/Stage"}},"squads":{"type":"array","items":{"type":"object"}},"competitors":{"type":"array","items":{"$ref":"#/components/schemas/Competitor"}},"scores":{"type":"array","items":{"$ref":"#/components/schemas/StageScore"}},"bracket":{"type":"object","nullable":true},"serverTime":{"type":"string"}}},"ResultRow":{"type":"object","properties":{"rank":{"type":"integer"},"competitorId":{"type":"string"},"name":{"type":"string"},"division":{"type":"string"},"club":{"type":"string"},"total":{"type":"number"},"percent":{"type":"number"},"stagesScored":{"type":"integer"},"disqualified":{"type":"boolean"}}},"Results":{"type":"object","properties":{"match":{"type":"object"},"results":{"type":"object","description":"ALL plus one key per division","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/ResultRow"}}},"categories":{"type":"object","description":"One key per category with registered competitors","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/ResultRow"}}},"generatedAt":{"type":"string"}}},"DetailedResults":{"type":"object","properties":{"match":{"type":"object"},"stages":{"type":"array","items":{"type":"object"}},"rows":{"type":"array","items":{"type":"object","description":"rank, competitor, total, percent, stagesScored, disqualified, stages: { [stageId]: stage line with time, hits breakdown, penalties, hit factor, stage points, rank, revision, approvedByCompetitor, shotTimes }"}},"teams":{"type":"array","items":{"type":"object","description":"team, rank, total, percent, counted[], others[]"}},"generatedAt":{"type":"string"}}},"BracketFormat":{"type":"object","properties":{"lives":{"type":"integer","enum":[1,2,3],"default":2},"bestOf":{"type":"integer","enum":[1,3,5],"default":1},"finalBestOf":{"type":"integer","enum":[1,3,5],"default":1},"pairing":{"type":"string","enum":["ends","halves"],"default":"ends","description":"ends: 1 against the last; halves: 1 against the first of the second half"},"firstRoundSecondChance":{"type":"boolean","description":"Single elimination: the losers of round 1 get one more bout"}}},"Seeding":{"type":"object","properties":{"mode":{"type":"string","enum":["manual","competition"]},"competitionId":{"type":"string","nullable":true},"division":{"type":"string","nullable":true,"description":"Division of the competition whose ranking counts; empty = overall"},"order":{"type":"array","items":{"type":"string"},"description":"Manual: every competitor id, best first"}},"required":["mode"]},"BoutResult":{"type":"object","properties":{"boutId":{"type":"string"},"winnerId":{"type":"string","nullable":true},"heats":{"type":"array","items":{"type":"string"}},"decidedAt":{"type":"string","format":"date-time"},"deviceId":{"type":"string"},"roUserId":{"type":"string"}},"required":["boutId","winnerId","decidedAt","deviceId"]},"DisciplineRules":{"type":"object","properties":{"discipline":{"$ref":"#/components/schemas/Discipline"},"version":{"type":"integer"},"name":{"type":"string"},"scoring":{"$ref":"#/components/schemas/ScoringProfile"},"divisions":{"type":"array","items":{"$ref":"#/components/schemas/Division"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"notes":{"type":"string"},"updatedAt":{"type":"string"}}},"Club":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"website":{"type":"string"},"updatedAt":{"type":"string"}}},"Registration":{"allOf":[{"$ref":"#/components/schemas/CompetitorInput"},{"type":"object","properties":{"squad":{"type":"string","description":"Squad name; created when missing"}}}]},"Ok":{"type":"object","properties":{"ok":{"type":"boolean"}}}}},"paths":{"/api/v1/auth/register":{"post":{"summary":"Create an account","tags":["Accounts"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Credentials"},{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"}}}]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"userId":{"type":"string"},"verificationSent":{"type":"boolean"}}}}}},"409":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/login":{"post":{"summary":"Web sign-in (sets the session cookie)","tags":["Accounts"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Credentials"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 10 failures per address and per IP in 15 minutes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/logout":{"post":{"summary":"Sign out","tags":["Accounts"],"security":[{"session":[]},{"deviceToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/auth/device/login":{"post":{"summary":"Tablet sign-in: long-lived Bearer device token","tags":["Accounts"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Credentials"},{"type":"object","properties":{"device":{"$ref":"#/components/schemas/Device"}},"required":["device"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expiresAt":{"type":"string"},"user":{"$ref":"#/components/schemas/User"},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/Membership"}}}}}}}}}},"/api/v1/auth/me":{"get":{"summary":"Profile and club roles","tags":["Accounts"],"security":[{"session":[]},{"deviceToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/Membership"}}}}}}}}},"patch":{"summary":"Edit own name","tags":["Accounts"],"security":[{"session":[]},{"deviceToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/auth/me/password":{"post":{"summary":"Change own password (other sessions revoked)","tags":["Accounts"],"security":[{"session":[]},{"deviceToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"currentPassword":{"type":"string"},"newPassword":{"type":"string"}},"required":["currentPassword","newPassword"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/auth/me/results":{"get":{"summary":"Events in which this account is a competitor","tags":["Accounts"],"security":[{"session":[]},{"deviceToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object"}}}}}}}}}},"/api/v1/auth/password/forgot":{"post":{"summary":"Request a password reset link by e-mail (always OK)","tags":["Accounts"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"}},"required":["email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"mailed":{"type":"boolean"}}}}}}}}},"/api/v1/auth/password/reset":{"post":{"summary":"Set a new password from a reset link","tags":["Accounts"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"password":{"type":"string"}},"required":["token","password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Invalid or expired link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/verify/send":{"post":{"summary":"(Re)send the e-mail verification mail","tags":["Accounts"],"security":[{"session":[]},{"deviceToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"mailed":{"type":"boolean"},"verified":{"type":"boolean"}}}}}},"503":{"description":"E-mail not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/verify":{"post":{"summary":"Confirm the e-mail address","tags":["Accounts"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/clubs":{"get":{"summary":"Clubs","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"clubs":{"type":"array","items":{"$ref":"#/components/schemas/Club"}}}}}}}}},"post":{"summary":"Create a club (the creator becomes admin)","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"country":{"type":"string"},"website":{"type":"string"}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Club"}}}}}}},"/api/v1/clubs/{clubId}":{"get":{"summary":"One club (id or slug) with the caller’s role","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"club":{"$ref":"#/components/schemas/Club"},"role":{"type":"string","nullable":true}}}}}}}},"patch":{"summary":"Edit a club (club admin)","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"country":{"type":"string"},"website":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/clubs/{clubId}/members":{"get":{"summary":"Members and roles","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"put":{"summary":"Add or change a member by e-mail (club admin)","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string","enum":["admin","staff","member"]}},"required":["email","role"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/clubs/{clubId}/members/{userId}":{"delete":{"summary":"Remove a member (club admin)","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/clubs/{clubId}/api-keys":{"get":{"summary":"API keys of the club (club admin)","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"summary":"Create an API key; the key is shown once","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["registrations:write","registrations:read","results:read","matches:read","matches:write","*"]}}},"required":["name","scopes"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"}}}}}}}}},"/api/v1/clubs/{clubId}/api-keys/{keyId}":{"delete":{"summary":"Revoke an API key","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}},{"name":"keyId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/clubs/{clubId}/integrations":{"get":{"summary":"Webhooks of the club","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"summary":"Register a webhook; the HMAC secret is shown once","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}}},"required":["url","events"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string"}}}}}}}}},"/api/v1/clubs/{clubId}/roster":{"get":{"summary":"Competitor directory of the club (staff)","tags":["Clubs"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"},"description":"Name filter"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/matches":{"get":{"summary":"Events the caller may see","tags":["Matches"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"clubId","in":"query","schema":{"type":"string"},"description":"Only this club"},{"name":"kind","in":"query","schema":{"type":"string"},"description":"match or training"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"matches":{"type":"array","items":{"$ref":"#/components/schemas/Match"}}}}}}}}},"post":{"summary":"Create a match or training","tags":["Matches"],"security":[{"session":[]},{"deviceToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}}}}}},"401":{"description":"Not signed in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No rights","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"id already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/matches/{matchId}":{"get":{"summary":"One event","tags":["Matches"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"match":{"$ref":"#/components/schemas/Match"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Edit settings (match admin)","tags":["Matches"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchPatch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"409":{"description":"Discipline locked by recorded scores","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete with everything in it (match admin)","tags":["Matches"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/matches/{matchId}/log":{"get":{"summary":"Change log of the event (staff): every change and score revision with who and when, newest first","tags":["Matches"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":1000}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"createdBy":{"type":"string","nullable":true},"entries":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"actor":{"type":"string","nullable":true},"action":{"type":"string"},"text":{"type":"string"},"device":{"type":"string"}}}}}}}}}}}},"/api/v1/matches/{matchId}/role":{"get":{"summary":"The caller’s role on the event","tags":["Matches"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","nullable":true,"enum":["platform","owner","admin","staff","member",null]}}}}}}}}},"/api/v1/matches/{matchId}/claim":{"post":{"summary":"A club claims a club-less event (staff of that club)","tags":["Matches"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clubId":{"type":"string"}},"required":["clubId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/matches/{matchId}/rules/reapply":{"post":{"summary":"Copy the current central rules into an event without approved scores","tags":["Matches"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rulesVersion":{"type":"integer"}}}}}}}}},"/api/v1/matches/{matchId}/stages":{"get":{"summary":"Stages","tags":["Stages"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"stages":{"type":"array","items":{"$ref":"#/components/schemas/Stage"}}}}}}}}}},"/api/v1/matches/{matchId}/stages/{stageId}":{"put":{"summary":"Create or replace a stage (match admin); stageId is a UUID chosen by the client. Once a competitor has a score on the stage only `active` can change","tags":["Stages"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stageId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StageInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"roundCount":{"type":"integer"}}}}}},"409":{"description":"The stage has scores and the request changes more than active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a stage without scores","tags":["Stages"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stageId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/matches/{matchId}/squads":{"get":{"summary":"Squads","tags":["Squads"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/matches/{matchId}/squads/{squadId}":{"put":{"summary":"Create or change a squad (match admin). On a club-portal event a club squad keeps its external id and a changed name or start time becomes an override kept on syncs","tags":["Squads"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"squadId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SquadInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a squad (competitors stay, without squad); not for a club-portal squad","tags":["Squads"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"squadId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"409":{"description":"A squad of the club portal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/matches/{matchId}/competitors":{"get":{"summary":"Competitors","tags":["Competitors"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"competitors":{"type":"array","items":{"$ref":"#/components/schemas/Competitor"}}}}}}}}}},"/api/v1/matches/{matchId}/competitors/{competitorId}":{"put":{"summary":"Create or replace a competitor (match admin); the name is remembered for the club’s autocomplete. On a club-portal event a registration keeps its name and the changed match-day fields become overrides; new competitors are walk-ins","tags":["Competitors"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"competitorId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompetitorInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}}}}}}}},"delete":{"summary":"Remove a competitor without scores (on a club-portal event only walk-ins)","tags":["Competitors"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"competitorId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"409":{"description":"Has scores, or a registration of the club portal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/matches/{matchId}/squads/{squadId}/overrides":{"delete":{"summary":"Club-portal squad: forget the name or start time changed in MakeReady (the next sync applies the club portal’s values)","tags":["Squads"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"squadId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/matches/{matchId}/competitors/{competitorId}/overrides":{"delete":{"summary":"Club-portal registration: forget the corrections made in MakeReady (the next sync applies the club portal’s values)","tags":["Competitors"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"competitorId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/matches/{matchId}/competitors/suggest":{"get":{"summary":"Autocomplete from the club’s (or organiser’s) earlier registrations (staff)","tags":["Competitors"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"},"description":"At least two characters"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"suggestions":{"type":"array","items":{"type":"object"}}}}}}}}}},"/api/v1/matches/{matchId}/results":{"get":{"summary":"Standings overall, per division and per category","tags":["Results"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Results"}}}}}}},"/api/v1/matches/{matchId}/results/detail":{"get":{"summary":"Standings with the result per stage, shot times and team standings","tags":["Results"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"division","in":"query","schema":{"type":"string"},"description":"Division code or ALL"},{"name":"category","in":"query","schema":{"type":"string"},"description":"Category code"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetailedResults"}}}}}}},"/api/v1/matches/{matchId}/export.psc":{"get":{"summary":"The whole hit-factor event as a .psc file: ZIP with match_def.json and match_scores.json (format of the PractiScore apps); staff only","tags":["Results"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":".psc (ZIP)","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"422":{"description":"Time-plus event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/matches/{matchId}/results.csv":{"get":{"summary":"The same standings as CSV (semicolon separated, UTF-8 with BOM)","tags":["Results"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"division","in":"query","schema":{"type":"string"},"description":"Division code or ALL"},{"name":"category","in":"query","schema":{"type":"string"},"description":"Category code"}],"responses":{"200":{"description":"CSV","content":{"text/csv":{"schema":{"type":"string"}}}}}}},"/api/v1/matches/{matchId}/bundle":{"get":{"summary":"Everything for tablets and dashboards","tags":["Results"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bundle"}}}}}}},"/api/v1/matches/{matchId}/live/refresh":{"post":{"summary":"Recalculate and push the live standings (staff)","tags":["Results"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/matches/{matchId}/bracket":{"get":{"summary":"Shootoff bracket with the resolved view","tags":["Shootoff"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"delete":{"summary":"Remove the bracket while no bout is decided (admin)","tags":["Shootoff"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/matches/{matchId}/bracket/seeding":{"get":{"summary":"Shootoff: the order of the entrants with their place in the linked competition (staff)","tags":["Shootoff"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"put":{"summary":"Shootoff: set the order by hand or by the ranking of a competition; the competitor numbers follow it (staff)","tags":["Shootoff"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seeding"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/matches/{matchId}/bracket/start":{"post":{"summary":"Generate the bracket once (staff)","tags":["Shootoff"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BracketFormat"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/matches/{matchId}/bracket/restart":{"post":{"summary":"Regenerate the bracket, discarding all decisions (admin)","tags":["Shootoff"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BracketFormat"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/matches/{matchId}/bracket/results":{"post":{"summary":"Bout decisions (staff); latest per bout wins","tags":["Shootoff"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BoutResult"}}},"required":["results"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"array","items":{"type":"string"}},"rejected":{"type":"array","items":{"type":"object"}},"bracket":{"type":"object"}}}}}}}}},"/api/v1/sync/matches":{"get":{"summary":"Events this user may score or manage","tags":["Sync"],"security":[{"session":[]},{"deviceToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"matches":{"type":"array","items":{"type":"object"}}}}}}}}}},"/api/v1/sync/matches/{matchId}":{"get":{"summary":"Bundle, incremental with ?since=","tags":["Sync"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"since","in":"query","schema":{"type":"string"},"description":"serverTime of the previous pull"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bundle"}}}}}}},"/api/v1/sync/push":{"post":{"summary":"Push approved scores (append-only revisions)","tags":["Sync"],"security":[{"session":[]},{"deviceToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncPush"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncPushResult"}}}}}}},"/api/v1/rules":{"get":{"summary":"All discipline rules with a versions map","tags":["Rules"],"security":[{"session":[]},{"deviceToken":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/DisciplineRules"}},"versions":{"type":"object"}}}}}}}}},"/api/v1/rules/{discipline}":{"get":{"summary":"Rules of one discipline","tags":["Rules"],"security":[{"session":[]},{"deviceToken":[]}],"parameters":[{"name":"discipline","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"$ref":"#/components/schemas/DisciplineRules"}}}}}}}},"put":{"summary":"Replace (parts of) the rules; bumps the version (MakeReady admin)","tags":["Rules"],"security":[{"session":[]}],"parameters":[{"name":"discipline","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"scoring":{"$ref":"#/components/schemas/ScoringProfile"},"divisions":{"type":"array","items":{"$ref":"#/components/schemas/Division"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"notes":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"$ref":"#/components/schemas/DisciplineRules"}}}}}}}}},"/api/v1/admin/users":{"get":{"summary":"All users with memberships (MakeReady admin)","tags":["Admin"],"security":[{"session":[]}],"parameters":[{"name":"q","in":"query","schema":{"type":"string"},"description":"Name or e-mail filter"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/admin/users/{userId}":{"patch":{"summary":"platformAdmin, active, name (MakeReady admin)","tags":["Admin"],"security":[{"session":[]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platformAdmin":{"type":"boolean"},"active":{"type":"boolean"},"firstName":{"type":"string"},"lastName":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}},"delete":{"summary":"Delete a deactivated account for good (MakeReady admin). The account is erased; the record itself is removed unless it created events, API keys or rules. ?anonymiseRegistrations=1 also removes the name from its registrations","tags":["Admin"],"security":[{"session":[]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"anonymiseRegistrations","in":"query","schema":{"type":"string"},"description":"1 = also anonymise the registrations"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"keptFor":{"type":"array","items":{"type":"string"}},"registrations":{"type":"integer"}}}}}},"409":{"description":"Account still active, yourself, or an admin by configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/users/{userId}/password":{"post":{"summary":"Set a password (sessions revoked)","tags":["Admin"],"security":[{"session":[]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"}},"required":["password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/admin/users/{userId}/reset-link":{"post":{"summary":"Password reset link valid for two hours","tags":["Admin"],"security":[{"session":[]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"link":{"type":"string"},"expiresInHours":{"type":"integer"}}}}}}}}},"/api/v1/admin/users/{userId}/memberships/{clubId}":{"put":{"summary":"Set a role in any club","tags":["Admin"],"security":[{"session":[]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin","staff","member"]}},"required":["role"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}},"delete":{"summary":"Remove the membership","tags":["Admin"],"security":[{"session":[]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"clubId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/integrations/matches":{"get":{"summary":"All events of the club (matches:read)","tags":["Integrations"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"matches":{"type":"array","items":{"$ref":"#/components/schemas/Match"}}}}}}}}},"post":{"summary":"Create an event for the club, idempotent on externalId (matches:write)","tags":["Integrations"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"discipline":{"$ref":"#/components/schemas/Discipline"},"kind":{"type":"string","enum":["match","training"],"default":"training"},"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"visibility":{"type":"string","enum":["public","club","private"],"default":"club"},"externalId":{"type":"string"},"createdByName":{"type":"string","description":"Who created the event in the club portal; shown as \"created by\" (\"N/A\" when left out)"}},"required":["name","discipline","startDate","externalId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"match":{"$ref":"#/components/schemas/Match"},"created":{"type":"boolean"}}}}}}}}},"/api/v1/integrations/matches/{ref}":{"get":{"summary":"One event by MakeReady id or externalId (matches:read)","tags":["Integrations"],"security":[{"apiKey":[]}],"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string"},"description":"MakeReady id or externalId"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"match":{"$ref":"#/components/schemas/Match"}}}}}}}},"patch":{"summary":"name, startDate, endDate, visibility, status, externalId, createdByName (matches:write)","tags":["Integrations"],"security":[{"apiKey":[]}],"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}},"/api/v1/integrations/matches/{ref}/registrations":{"put":{"summary":"Replace the registration list (registrations:write); squads are created by name","tags":["Integrations"],"security":[{"apiKey":[]}],"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"registrations":{"type":"array","items":{"$ref":"#/components/schemas/Registration"}}},"required":["registrations"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"get":{"summary":"Registrations (registrations:read)","tags":["Integrations"],"security":[{"apiKey":[]}],"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"competitors":{"type":"array","items":{"$ref":"#/components/schemas/Competitor"}}}}}}}}}},"/api/v1/integrations/matches/{ref}/results":{"get":{"summary":"Results per competitor (registration id of the club portal, place overall and in the division, result per stage), compact standings and all raw score revisions (results:read)","tags":["Integrations"],"security":[{"apiKey":[]}],"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"match":{"type":"object"},"stages":{"type":"array","items":{"type":"object"}},"competitors":{"type":"array","items":{"type":"object"}},"results":{"type":"object"},"scores":{"type":"array","items":{"$ref":"#/components/schemas/StageScore"}}}}}}}}}},"/api/public/matches":{"get":{"summary":"Public events","tags":["Public"],"security":[],"parameters":[{"name":"kind","in":"query","schema":{"type":"string"},"description":"match or training"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"matches":{"type":"array","items":{"type":"object"}}}}}}}}}},"/api/public/matches/{matchId}/results":{"get":{"summary":"Standings of a public event (overall, per division, per category)","tags":["Public"],"security":[],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Results"}}}}}}},"/api/public/matches/{matchId}/results.csv":{"get":{"summary":"CSV export of a public event","tags":["Public"],"security":[],"parameters":[{"name":"matchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"division","in":"query","schema":{"type":"string"},"description":"Division code"},{"name":"category","in":"query","schema":{"type":"string"},"description":"Category code"}],"responses":{"200":{"description":"CSV","content":{"text/csv":{"schema":{"type":"string"}}}}}}},"/api/v1/version":{"get":{"summary":"Portal and app versions","tags":["Public"],"security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/health":{"get":{"summary":"Health check","tags":["Public"],"security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}