{"openapi":"3.0.0","tags":[{"name":"circuit"},{"name":"season"},{"name":"circuit_seasons"},{"name":"circuit_api"}],"info":{"title":"Seasons","termsOfService":"https:\/\/developer.toornament.com\/terms-guidelines","version":"1.0.1","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\/circuit\/v2"}],"paths":{"\/seasons":{"get":{"tags":["circuit_seasons"],"summary":"Retrieve all seasons from your circuits.","description":"Returns all seasons from your circuits.","parameters":[{"$ref":"#\/components\/parameters\/seasonRange"},{"$ref":"#\/components\/parameters\/circuitIds"},{"$ref":"#\/components\/parameters\/seasonIds"},{"$ref":"#\/components\/parameters\/seasonMachineNames"},{"$ref":"#\/components\/parameters\/seasonBefore"},{"$ref":"#\/components\/parameters\/seasonAfter"}],"responses":{"206":{"description":"Seasons retrieved.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/SeasonDetailed"}}}}}},"security":[{"apiKey":[],"oAuth2":["organizer:circuit"]}]},"post":{"tags":["circuit_circuits"],"summary":"Create a new season.","description":"Creates a new season in the identified circuit.","requestBody":{"description":"Season data","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SeasonCreate"}}}},"responses":{"201":{"description":"Season created.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SeasonDetailed"}}}}},"security":[{"apiKey":[],"oAuth2":["organizer:circuit"]}]}},"\/seasons\/{id}":{"get":{"tags":["circuit_seasons"],"summary":"Retrieve a single season.","description":"Returns a season identified by the given id.","parameters":[{"$ref":"#\/components\/parameters\/seasonId"}],"responses":{"200":{"description":"Season retrieved","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SeasonDetailed"}}}}},"security":[{"apiKey":[],"oAuth2":["organizer:circuit"]}]},"patch":{"tags":["circuit_seasons"],"summary":"Update a season.","description":"Updates a season identified by the given id.","parameters":[{"$ref":"#\/components\/parameters\/seasonId"}],"requestBody":{"description":"Season data.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SeasonUpdate"}}}},"responses":{"200":{"description":"Season update.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SeasonDetailed"}}}}},"security":[{"apiKey":[],"oAuth2":["organizer:circuit"]}]},"delete":{"tags":["circuit_seasons"],"summary":"Delete a season.","description":"Deletes a season identified by the given id.","parameters":[{"$ref":"#\/components\/parameters\/seasonId"}],"responses":{"204":{"description":"Success"}},"security":[{"apiKey":[],"oAuth2":["organizer:circuit"]}]}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"X-Api-Key","in":"header"},"oAuth2":{"type":"oauth2","description":"Access token with \u0027organizer:circuit\u0027 scope (see (Authorization)[https:\/\/developer.toornament.com\/v2\/security\/authorization])","flows":{"clientCredentials":{"tokenUrl":"https:\/\/api.toornament.com\/oauth\/v2\/token","scopes":{"organizer:circuit":"Grants the ability to manage circuit and settings."}},"authorizationCode":{"authorizationUrl":"https:\/\/account.toornament.com\/oauth2\/authorize","tokenUrl":"https:\/\/api.toornament.com\/oauth\/v2\/token","scopes":{"organizer:circuit":"Grants the ability to manage circuit and settings."}}}}},"parameters":{"seasonRange":{"name":"Range","in":"header","required":true,"schema":{"type":"string","example":"seasons=0-49"},"description":"A range of requested items using the \u0027seasons\u0027 unit. The size of the range can not exceed 50. (see [Pagination](https:\/\/developer.toornament.com\/v2\/overview\/pagination))"},"seasonId":{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The id of the season."},"seasonIds":{"name":"season_ids","in":"query","required":false,"explode":false,"style":"form","schema":{"type":"array","items":{"type":"string"},"example":"5617559294676615168,5629045554450325504"},"description":"Only return seasons for the given list of ids."},"seasonMachineNames":{"name":"season_machine_names","in":"query","required":false,"explode":false,"style":"form","schema":{"type":"array","items":{"type":"string"},"example":"season_1,season_3"},"description":"One or several machine name of seasons to filter."},"seasonBefore":{"name":"season_before","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"An ISO 8601 date (only the date part, with YYYY-MM-DD pattern) to include all seasons scheduled to take place before or at the date."},"seasonAfter":{"name":"season_after","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"An ISO 8601 date (only the date part, with YYYY-MM-DD pattern) to include all seasons scheduled to take place after or at the date."},"circuitIds":{"name":"circuit_ids","in":"query","required":false,"explode":false,"style":"form","schema":{"type":"array","items":{"type":"string"},"example":"5617559294676615168,5629045554450325504"},"description":"Only return circuits for the given list of ids."}},"schemas":{"SeasonBase":{"type":"object","properties":{"name":{"description":"The name of the season.","type":"string","maxLength":40,"example":"Open Winter 2022"},"date_start":{"description":"A starting date in ISO 8601 format (only the date part, with YYYY-MM-DD pattern).","type":"string","nullable":true,"format":"date","example":"2022-01-03"},"date_end":{"description":"An ending date in ISO 8601 format (only the date part, with YYYY-MM-DD pattern).","type":"string","nullable":true,"format":"date","example":"2022-04-08"}}},"SeasonCircuit":{"type":"object","properties":{"circuit_id":{"description":"The id of the circuit that contains this season.","type":"string","example":"5629045554450325504"}}},"SeasonMachineName":{"type":"object","properties":{"machine_name":{"description":"A name used to identify a season for computing purposes.","type":"string","pattern":"^[a-z0-9_]+$","maxLength":40,"example":"open_winter_2022"}}},"SeasonUpdate":{"allOf":[{"$ref":"#\/components\/schemas\/SeasonBase"}]},"SeasonCreate":{"allOf":[{"$ref":"#\/components\/schemas\/SeasonBase"},{"$ref":"#\/components\/schemas\/SeasonCircuit"},{"$ref":"#\/components\/schemas\/SeasonMachineName"},{"type":"object","required":["circuit_id","name","date_start","date_end","machine_name"]}]},"SeasonDetailed":{"allOf":[{"$ref":"#\/components\/schemas\/SeasonBase"},{"$ref":"#\/components\/schemas\/SeasonCircuit"},{"$ref":"#\/components\/schemas\/SeasonMachineName"},{"type":"object","required":["id","circuit_id","name","date_start","date_end","machine_name"],"properties":{"id":{"description":"The unique identifier of the season.","type":"string","example":"5629088936350867456"}}}]}}}}