{"openapi":"3.0.0","tags":[{"name":"organizer"},{"name":"match_game"},{"name":"organizer_match_games"},{"name":"match_api"}],"info":{"title":"Match games","termsOfService":"https:\/\/developer.toornament.com\/terms-guidelines","version":"2.2.0","description":"The Toornament platform connects your website and application with the eSports tournaments around the world.","contact":{"name":"Toornament Developer","url":"https:\/\/developer.toornament.com","email":"contact@toornament.com"}},"servers":[{"url":"https:\/\/api.toornament.com\/organizer\/v2"}],"paths":{"\/matches\/{match_id}\/games":{"get":{"tags":["organizer_match_games"],"summary":"Retrieve the games of one match.","description":"Returns the games of the given match. If the game type is \u0022ffa\u0022, this list is limited to the first 4 opponents ordered by their position.","parameters":[{"$ref":"#\/components\/parameters\/matchId"},{"$ref":"#\/components\/parameters\/gameRange"}],"responses":{"206":{"description":"Success","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/MatchGame"}}}}}},"security":[{"apiKey":[],"oAuth2":["organizer:result"]}]}},"\/matches\/{match_id}\/games\/{number}":{"get":{"tags":["organizer_match_games"],"summary":"Get detailed information about one match game.","description":"Returns detailed information about one match game.","parameters":[{"$ref":"#\/components\/parameters\/matchId"},{"$ref":"#\/components\/parameters\/gameNumber"}],"responses":{"200":{"description":"Success","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MatchGame"}}}}},"security":[{"apiKey":[],"oAuth2":["organizer:result"]}]},"patch":{"tags":["organizer_match_games"],"summary":"Update information and outcome of a game.","description":"Updates a single game of the given match. A game is limited to 2 participants in \u0022duel\u0022 type, and 100 participants in \u0022ffa\u0022 type.","parameters":[{"$ref":"#\/components\/parameters\/matchId"},{"$ref":"#\/components\/parameters\/gameNumber"}],"requestBody":{"description":"Match game data","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MatchGameBase"}}}},"responses":{"200":{"description":"Success","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MatchGame"}}}}},"security":[{"apiKey":[],"oAuth2":["organizer:result"]}]}},"\/tournaments\/{tournament_id}\/matches\/{match_id}\/games":{"get":{"deprecated":true,"tags":["organizer_match_games"],"summary":"Retrieve the games of a match.","description":"Returns the games of the given match. If the match type is \u0022ffa\u0022, only the first 4 opponents, ordered by position, are listed in each game.","parameters":[{"$ref":"#\/components\/parameters\/tournamentId"},{"$ref":"#\/components\/parameters\/matchId"},{"$ref":"#\/components\/parameters\/gameRange"}],"responses":{"206":{"description":"Success","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/MatchGame"}}}}}},"security":[{"apiKey":[],"oAuth2":["organizer:result"]}]}},"\/tournaments\/{tournament_id}\/matches\/{match_id}\/games\/{number}":{"get":{"deprecated":true,"tags":["organizer_match_games"],"summary":"Retrieve a single game from a match.","description":"Returns a single game of the given match. A game is limited to 2 participants in \u0022duel\u0022 type, and 100 participants in \u0022ffa\u0022 type.","parameters":[{"$ref":"#\/components\/parameters\/tournamentId"},{"$ref":"#\/components\/parameters\/matchId"},{"$ref":"#\/components\/parameters\/gameNumber"}],"responses":{"200":{"description":"Success","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MatchGame"}}}}},"security":[{"apiKey":[],"oAuth2":["organizer:result"]}]},"patch":{"deprecated":true,"tags":["organizer_match_games"],"summary":"Update information and outcome of a game.","description":"Updates a single game of the given match. A game is limited to 2 participants in \u0022duel\u0022 type, and 100 participants in \u0022ffa\u0022 type.","parameters":[{"$ref":"#\/components\/parameters\/tournamentId"},{"$ref":"#\/components\/parameters\/matchId"},{"$ref":"#\/components\/parameters\/gameNumber"}],"requestBody":{"description":"Match game data","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MatchGameBase"}}}},"responses":{"200":{"description":"Success","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MatchGame"}}}}},"security":[{"apiKey":[],"oAuth2":["organizer:result"]}]}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"X-Api-Key","in":"header"},"oAuth2":{"type":"oauth2","description":"Access token with \u0027organizer:result\u0027 scope (see (Authorization)[https:\/\/developer.toornament.com\/v2\/security\/authorization]).","flows":{"clientCredentials":{"tokenUrl":"https:\/\/api.toornament.com\/oauth\/v2\/token","scopes":{"organizer:result":"Grants the ability to edit information and referee results."}},"authorizationCode":{"authorizationUrl":"https:\/\/account.toornament.com\/oauth2\/authorize","tokenUrl":"https:\/\/api.toornament.com\/oauth\/v2\/token","scopes":{"organizer:result":"Grants the ability to edit information and referee results."}}}}},"parameters":{"gameRange":{"name":"Range","in":"header","required":true,"schema":{"type":"string","example":"games=0-49"},"description":"A range of requested items using the \u0027games\u0027 unit. The size of the range can not exceed 50. (see [Pagination](https:\/\/developer.toornament.com\/v2\/overview\/pagination))"},"tournamentId":{"name":"tournament_id","in":"path","required":true,"schema":{"type":"string"},"description":"The id of the tournament."},"matchId":{"name":"match_id","in":"path","required":true,"schema":{"type":"string"},"description":"The id of the match."},"gameNumber":{"name":"number","in":"path","required":true,"schema":{"type":"string"},"description":"The relative identifier of the match game to retrieve."}},"schemas":{"MatchGameBase":{"properties":{"status":{"description":"The status of the game, set to NULL for an automatic update of the status.","type":"string","enum":["pending","running","completed"],"nullable":true,"example":"completed"},"opponents":{"description":"List of the opponents involved in this match-game.","type":"array","items":{"$ref":"#\/components\/schemas\/MatchGameOpponentBase"}},"properties":{"type":"object","description":"Discipline features that define the specifics of the match game."}}},"MatchGame":{"allOf":[{"$ref":"#\/components\/schemas\/MatchGameBase"},{"type":"object","required":["number","status","opponents","properties"],"properties":{"number":{"description":"A relative identifier between 1 and the total number of games, to identify the game within the match.","type":"integer","example":1},"status":{"description":"The status of the match game. \u0022Pending\u0022 means the game has not started yet. \u0022Running\u0022 means the game is ongoing. \u0022Completed\u0022 means the game is over.","type":"string","enum":["pending","running","completed"],"nullable":false,"example":"completed"},"opponents":{"description":"List of the opponents involved in this match-game.","type":"array","items":{"$ref":"#\/components\/schemas\/MatchGameOpponent"}}}}]},"MatchGameOpponentBase":{"type":"object","properties":{"number":{"description":"The match-game opponent number (a relative identifier within a match).","type":"integer","example":1},"position":{"description":"The match-game opponent position (calculate by internal processes).","type":"integer","example":1},"result":{"description":"The match-game result of the opponent.","type":"string","enum":["win","draw","loss"],"nullable":true,"example":"win"},"rank":{"description":"The match rank of the opponent.","type":"integer","nullable":true,"example":3},"forfeit":{"description":"Whether the opponent is forfeit.","type":"boolean","example":false},"score":{"description":"The score of the opponent.","type":"integer","nullable":true,"example":15},"properties":{"description":"Features of the game played by the opponent.","type":"object"}}},"MatchGameOpponent":{"allOf":[{"$ref":"#\/components\/schemas\/MatchGameOpponentBase"},{"type":"object","required":["number","position","result","rank","forfeit","score","properties"]}]}}}}