{ "openapi": "3.1.0", "info": { "title": "TeamBattles API", "version": "0.1.0", "description": "Public developer API for TeamBattles. Authenticate with an API key: Authorization: Bearer tb_." }, "servers": [ { "url": "https://teambattles.gg/api/v1", "description": "Production" } ], "paths": { "/game/matches": { "post": { "operationId": "listGameMatches", "tags": [ "Game" ], "summary": "List matches for the developer's approved game", "description": "Returns matches for the API key owner's approved (bound) game, with legacy cursor pagination. Requires the game.lifecycle:read permission.", "security": [ { "ApiKeyAuth": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListGameMatchesBody" } } } }, "responses": { "200": { "description": "Legacy cursor-paginated result. pagination.cursor is null when there are no more pages.", "content": { "application/json": { "schema": { "type": "object", "properties": { "matches": { "type": "array", "items": { "$ref": "#/components/schemas/GameMatch" } }, "count": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "pagination": { "type": "object", "properties": { "cursor": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "hasMore": { "type": "boolean" } }, "required": [ "cursor", "hasMore" ], "additionalProperties": false }, "timestamp": { "type": "string" } }, "required": [ "matches", "count", "pagination", "timestamp" ], "additionalProperties": false } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/game/matches/{matchId}": { "get": { "operationId": "getGameMatch", "tags": [ "Game" ], "summary": "Get a single match's details", "description": "Returns detailed info for one match, validated to belong to the API key owner's approved game. Requires the game.lifecycle:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "matchId", "schema": { "type": "string", "description": "Match ID." }, "required": true, "description": "Match ID." } ], "responses": { "200": { "description": "The requested match plus a response timestamp.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameMatchDetailResponse" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/game/matches/{matchId}/forfeit": { "post": { "operationId": "forfeitGameMatch", "tags": [ "Game" ], "summary": "Forfeit a match on behalf of one participating team", "description": "Forfeits the match for the supplied team; the other participating team wins. Valid only while the match is ACCEPTED, READY, or IN_PROGRESS. Requires the game.lifecycle:read-write permission and a key bound to the match's game. Supports an optional `Idempotency-Key` request header: a retry with the same key and body replays the original response, while the same key with a different body returns 409 error_idempotency_key_conflict.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "matchId", "schema": { "type": "string", "description": "Match ID." }, "required": true, "description": "Match ID." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameForfeitBody" } } } }, "responses": { "200": { "description": "The match was forfeited successfully.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameForfeitResponse" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Conflict.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/game/matches/{matchId}/player-stats": { "post": { "operationId": "submitGamePlayerStats", "tags": [ "Game" ], "summary": "Submit or update player stats for a map", "description": "Sets per-player stats on an existing map score for the given mapIndex. Requires the game.scores:write permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "matchId", "schema": { "type": "string", "description": "Match ID." }, "required": true, "description": "Match ID." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GamePlayerStatsBody" } } } }, "responses": { "200": { "description": "The player stats were updated.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GamePlayerStatsResponse" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/game/matches/{matchId}/rosters": { "get": { "operationId": "getGameMatchRosters", "tags": [ "Game" ], "summary": "Get a match's team rosters", "description": "Returns the creator and accepted team rosters for a match, validated to belong to the API key owner's approved game. Requires the game.lifecycle:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "matchId", "schema": { "type": "string", "description": "Match ID." }, "required": true, "description": "Match ID." } ], "responses": { "200": { "description": "Team rosters grouped by creator and accepted team.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameMatchRostersResponse" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/game/matches/{matchId}/scores": { "get": { "operationId": "getGameScores", "tags": [ "Game" ], "summary": "Read all map scores for a match", "description": "Returns every recorded map score plus the aggregate series tally. Requires the game.scores:write OR game.lifecycle:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "matchId", "schema": { "type": "string", "description": "Match ID." }, "required": true, "description": "Match ID." } ], "responses": { "200": { "description": "All map scores plus the aggregate series tally.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameScoresResponse" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "operationId": "submitGameScores", "tags": [ "Game" ], "summary": "Submit map scores in a batch", "description": "Submits scores for one or more maps; game-developer scores are auto-confirmed. Requires the game.scores:write permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "matchId", "schema": { "type": "string", "description": "Match ID." }, "required": true, "description": "Match ID." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameBatchScoresBody" } } } }, "responses": { "200": { "description": "Per-map submission results. success is true only when every map was confirmed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameBatchScoresResponse" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/game/matches/{matchId}/scores/{mapIndex}": { "post": { "operationId": "submitGameMapScore", "tags": [ "Game" ], "summary": "Submit a single map's score", "description": "Submits the score for one map (mapIndex from the path); game-developer scores are auto-confirmed. Requires the game.scores:write permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "matchId", "schema": { "type": "string", "description": "Match ID." }, "required": true, "description": "Match ID." }, { "in": "path", "name": "mapIndex", "schema": { "type": "string", "description": "Zero-based index of the map within the series." }, "required": true, "description": "Zero-based index of the map within the series." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameSingleMapScoreBody" } } } }, "responses": { "200": { "description": "The map score was submitted and confirmed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameSingleMapScoreResponse" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/game/matches/{matchId}/status": { "patch": { "operationId": "updateGameMatchStatus", "tags": [ "Game" ], "summary": "Update a match's lifecycle status", "description": "Transitions a match between lifecycle states (validated against allowed transitions). Requires the game.lifecycle:read-write permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "matchId", "schema": { "type": "string", "description": "Match ID." }, "required": true, "description": "Match ID." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameStatusUpdateBody" } } } }, "responses": { "200": { "description": "The match status was transitioned successfully.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameStatusUpdateResponse" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Conflict.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/game/matches/batch-scores": { "post": { "operationId": "submitGameBatchMatchScores", "tags": [ "Game" ], "summary": "Submit map scores across multiple matches in one call", "description": "Submits map scores for up to 50 (match, map) items in a single request. Each item is independently scope-checked against the key's bound game; an off-scope or otherwise failing item is rejected in its per-item envelope (status \"failed\", error = bare error_* code) WITHOUT failing the whole request. The response is ALWAYS HTTP 200 - inspect per-item status. Requires the game.scores:write permission. Score submission is naturally idempotent: an unconfirmed map is overwritten on re-submit and an already-confirmed map returns a per-item error_score_already_submitted_by_game, so a retried batch is safe without an Idempotency-Key.", "security": [ { "ApiKeyAuth": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameBatchMatchScoresBody" } } } }, "responses": { "200": { "description": "Per-item submission results. success is true only when every item was confirmed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameBatchMatchScoresResponse" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/game/matches/create": { "post": { "operationId": "createGameMatch", "tags": [ "Game" ], "summary": "Create a two-sided game-originated match", "description": "Creates an ACCEPTED + PUBLISHED match for the API key's bound game between two active teams in that game. Requires the game.lifecycle:read-write permission. Supply an optional `Idempotency-Key` request header to make retries safe: an identical key + body replays the original response, while the same key with a different body returns 409 error_idempotency_key_conflict.", "security": [ { "ApiKeyAuth": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameCreateMatchBody" } } } }, "responses": { "200": { "description": "The created match's ID.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GameCreateMatchResponse" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Conflict.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/leagues": { "post": { "operationId": "discoverLeagues", "tags": [ "Leagues" ], "summary": "Discover public leagues", "description": "Returns a paginated list of public leagues with optional search and game filtering. Requires the leagues.league_public:read permission.", "security": [ { "ApiKeyAuth": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DiscoverLeaguesRequestBody" } } } }, "responses": { "200": { "description": "Legacy offset-paginated result (page/limit based).", "content": { "application/json": { "schema": { "type": "object", "properties": { "leagues": { "type": "array", "items": { "$ref": "#/components/schemas/LeagueSummary" } }, "count": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "pagination": { "type": "object", "properties": { "page": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "limit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "totalPages": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "page", "limit", "total", "totalPages" ], "additionalProperties": false }, "timestamp": { "type": "string" } }, "required": [ "leagues", "count", "pagination", "timestamp" ], "additionalProperties": false } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/leagues/{identifier}": { "post": { "operationId": "getLeagueProfile", "tags": [ "Leagues" ], "summary": "Get a league profile", "description": "Returns the public profile for a single league, resolved by slug. Requires the leagues.league_public:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "identifier", "schema": { "type": "string", "description": "League slug." }, "required": true, "description": "League slug." } ], "responses": { "200": { "description": "The league profile.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeagueProfileResponse" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/leagues/{identifier}/bans": { "post": { "operationId": "getLeagueBans", "tags": [ "Leagues" ], "summary": "Get league team bans", "description": "Returns team bans for a league resolved by slug, with optional status filtering. The API key owner must have a MANAGER+ league role or be TeamBattles staff. Requires the leagues.league_admin:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "identifier", "schema": { "type": "string", "description": "League slug." }, "required": true, "description": "League slug." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BansRequestBody" } } } }, "responses": { "200": { "description": "Team bans for the league.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeagueBans" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/leagues/{identifier}/members": { "post": { "operationId": "getLeagueMembers", "tags": [ "Leagues" ], "summary": "Get league staff members", "description": "Returns staff members for a league resolved by slug. The API key owner must have a MEMBER+ league role or be TeamBattles staff. Requires the leagues.league_admin:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "identifier", "schema": { "type": "string", "description": "League slug." }, "required": true, "description": "League slug." } ], "responses": { "200": { "description": "Staff members of the league.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeagueMembers" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/leagues/{identifier}/penalties": { "post": { "operationId": "getLeaguePenalties", "tags": [ "Leagues" ], "summary": "Get league penalties and cooldowns", "description": "Returns penalties and/or member cooldowns for a league resolved by slug, with optional filtering. The API key owner must have a MANAGER+ league role or be TeamBattles staff. Requires the leagues.league_admin:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "identifier", "schema": { "type": "string", "description": "League slug." }, "required": true, "description": "League slug." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PenaltiesRequestBody" } } } }, "responses": { "200": { "description": "Penalties and cooldowns for the league.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeaguePenalties" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/leagues/{identifier}/rules": { "post": { "operationId": "getLeagueRules", "tags": [ "Leagues" ], "summary": "Get league rules and points config", "description": "Returns the game rules and points configuration for a league + game, resolved by league slug. Requires the leagues.league_public:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "identifier", "schema": { "type": "string", "description": "League slug." }, "required": true, "description": "League slug." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RulesRequestBody" } } } }, "responses": { "200": { "description": "Game rules and points config for the league.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeagueRules" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/leagues/{identifier}/seasons": { "post": { "operationId": "getLeagueSeasons", "tags": [ "Leagues" ], "summary": "Get league seasons", "description": "Returns seasons for a league resolved by slug, with optional game and status filtering. Requires the leagues.league_public:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "identifier", "schema": { "type": "string", "description": "League slug." }, "required": true, "description": "League slug." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeasonsRequestBody" } } } }, "responses": { "200": { "description": "Seasons for the league.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeagueSeasons" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/leagues/{identifier}/standings": { "post": { "operationId": "getLeagueStandings", "tags": [ "Leagues" ], "summary": "Get league standings", "description": "Returns approved teams with their season stats, ranked by standings position, for a league resolved by slug. Requires the leagues.league_public:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "identifier", "schema": { "type": "string", "description": "League slug." }, "required": true, "description": "League slug." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StandingsRequestBody" } } } }, "responses": { "200": { "description": "League standings for the requested season.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeagueStandings" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/matches/{matchId}/scores": { "get": { "operationId": "getMatchScores", "tags": [ "Matches" ], "summary": "Get all map scores", "description": "Retrieve all map scores for a match, including a series score summary. Requires the matches.team_matches:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "matchId", "schema": { "type": "string", "description": "Match id." }, "required": true, "description": "Match id." } ], "responses": { "200": { "description": "All map scores for the match with a series summary.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MapScores" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "patch": { "operationId": "confirmMatchScores", "tags": [ "Matches" ], "summary": "Confirm a map score", "description": "Confirm a map score submitted by the opposing team. Only the opposing team's captain can confirm (cannot confirm own team's submission). Requires the matches.team_matches:read-write permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "matchId", "schema": { "type": "string", "description": "Match id." }, "required": true, "description": "Match id." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConfirmScoreBody" } } } }, "responses": { "200": { "description": "Map score confirmed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScoreSubmissionResult" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "operationId": "submitMatchScores", "tags": [ "Matches" ], "summary": "Submit a map score", "description": "Submit or overwrite a map score for a match. Only team captains can submit. Requires the matches.team_matches:read-write permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "matchId", "schema": { "type": "string", "description": "Match id." }, "required": true, "description": "Match id." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubmitScoreBody" } } } }, "responses": { "200": { "description": "Map score submitted.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScoreSubmissionResult" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/orgs/{identifier}/matches": { "post": { "operationId": "listOrgMatches", "tags": [ "Matches" ], "summary": "List an organization's matches", "description": "Returns matches across all teams in an organization (resolved by id or slug), newest first, with cursor pagination. The authenticated user must be an active member of the organization. Requires the matches.org_matches:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "identifier", "schema": { "type": "string", "description": "Organization id or slug." }, "required": true, "description": "Organization id or slug." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MatchesRequestBody" } } } }, "responses": { "200": { "description": "Cursor-paginated result. continueCursor is non-null even when isDone is true.", "content": { "application/json": { "schema": { "type": "object", "properties": { "page": { "type": "array", "items": { "$ref": "#/components/schemas/UserMatch" } }, "isDone": { "type": "boolean" }, "continueCursor": { "type": "string" } }, "required": [ "page", "isDone", "continueCursor" ], "additionalProperties": false } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/teams/{identifier}/matches": { "post": { "operationId": "listTeamMatches", "tags": [ "Matches" ], "summary": "List a team's matches", "description": "Returns matches for a specific team (resolved by id or slug), newest first, with cursor pagination. The authenticated user must be an active member of the team. Requires the matches.team_matches:read permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "identifier", "schema": { "type": "string", "description": "Team id or slug." }, "required": true, "description": "Team id or slug." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MatchesRequestBody" } } } }, "responses": { "200": { "description": "Cursor-paginated result. continueCursor is non-null even when isDone is true.", "content": { "application/json": { "schema": { "type": "object", "properties": { "page": { "type": "array", "items": { "$ref": "#/components/schemas/UserMatch" } }, "isDone": { "type": "boolean" }, "continueCursor": { "type": "string" } }, "required": [ "page", "isDone", "continueCursor" ], "additionalProperties": false } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/twitch/badges/channel": { "get": { "operationId": "getChannelTwitchBadges", "tags": [ "Twitch" ], "summary": "Get channel-specific Twitch chat badges", "description": "Returns a Twitch channel's chat badge sets. Provide exactly one of the username or id query parameters. The API key owner must have a linked Twitch connection. Requires the connections.twitch permission.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "query", "name": "username", "schema": { "description": "Channel login name (e.g. ninja). Provide exactly one of username or id.", "type": "string" }, "description": "Channel login name (e.g. ninja). Provide exactly one of username or id." }, { "in": "query", "name": "id", "schema": { "description": "Broadcaster id (e.g. 123456789). Provide exactly one of username or id.", "type": "string" }, "description": "Broadcaster id (e.g. 123456789). Provide exactly one of username or id." } ], "responses": { "200": { "description": "Channel-specific Twitch chat badge sets.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TwitchChannelBadges" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/twitch/badges/global": { "get": { "operationId": "getGlobalTwitchBadges", "tags": [ "Twitch" ], "summary": "Get global Twitch chat badges", "description": "Returns Twitch's global chat badge sets. The API key owner must have a linked Twitch connection. Requires the connections.twitch permission.", "security": [ { "ApiKeyAuth": [] } ], "responses": { "200": { "description": "Global Twitch chat badge sets.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TwitchGlobalBadges" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/user/matches": { "post": { "operationId": "listUserMatches", "tags": [ "Matches" ], "summary": "List the authenticated user's matches", "description": "Returns matches the API key owner participates in, newest first, with cursor pagination. Requires the matches.user_matches:read permission.", "security": [ { "ApiKeyAuth": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MatchesRequestBody" } } } }, "responses": { "200": { "description": "Cursor-paginated result. continueCursor is non-null even when isDone is true.", "content": { "application/json": { "schema": { "type": "object", "properties": { "page": { "type": "array", "items": { "$ref": "#/components/schemas/UserMatch" } }, "isDone": { "type": "boolean" }, "continueCursor": { "type": "string" } }, "required": [ "page", "isDone", "continueCursor" ], "additionalProperties": false } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/webhooks": { "get": { "operationId": "listWebhooks", "tags": [ "Webhooks" ], "summary": "List webhook endpoints", "description": "Lists the API key's webhook endpoints within its derived scope. Secret material is never returned. Requires the webhooks.manage permission and the webhooks feature.", "security": [ { "ApiKeyAuth": [] } ], "responses": { "200": { "description": "The caller's webhook endpoints.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookListResponse" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "operationId": "createWebhook", "tags": [ "Webhooks" ], "summary": "Create a webhook endpoint", "description": "Creates a webhook endpoint in the API key's derived scope (personal -> user, developer-app -> game, league-operator -> league). Returns the signing secret ONCE. Requires the webhooks.manage permission and the webhooks feature.", "security": [ { "ApiKeyAuth": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWebhookBody" } } } }, "responses": { "201": { "description": "The created endpoint's id and one-time signing secret.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookSecret" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Conflict.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/webhooks/{id}": { "delete": { "operationId": "deleteWebhook", "tags": [ "Webhooks" ], "summary": "Delete a webhook endpoint", "description": "Deletes a webhook endpoint in the caller's scope, cascading its delivery logs and rate-limit bucket. Requires the webhooks.manage permission and the webhooks feature.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "description": "Webhook endpoint id." }, "required": true, "description": "Webhook endpoint id." } ], "responses": { "200": { "description": "Deletion acknowledged.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookOk" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "get": { "operationId": "getWebhook", "tags": [ "Webhooks" ], "summary": "Get a webhook endpoint", "description": "Returns one webhook endpoint in the caller's scope (no secret material). A scope/owner mismatch is reported as 404. Requires the webhooks.manage permission and the webhooks feature.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "description": "Webhook endpoint id." }, "required": true, "description": "Webhook endpoint id." } ], "responses": { "200": { "description": "The requested webhook endpoint.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEndpoint" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "patch": { "operationId": "updateWebhook", "tags": [ "Webhooks" ], "summary": "Update a webhook endpoint", "description": "Partially updates a webhook endpoint in the caller's scope. Re-enabling or changing the URL resets the failure count. Requires the webhooks.manage permission and the webhooks feature.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "description": "Webhook endpoint id." }, "required": true, "description": "Webhook endpoint id." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWebhookBody" } } } }, "responses": { "200": { "description": "Update acknowledged.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookOk" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/webhooks/{id}/deliveries": { "get": { "operationId": "listWebhookDeliveries", "tags": [ "Webhooks" ], "summary": "List a webhook endpoint's deliveries", "description": "Returns the endpoint's delivery log, newest first, with native cursor pagination. Pass limit (1-100) and cursor query params. Requires the webhooks.manage permission and the webhooks feature.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "description": "Webhook endpoint id." }, "required": true, "description": "Webhook endpoint id." }, { "in": "query", "name": "limit", "schema": { "description": "Page size 1-100 (default 25), enforced by the handler.", "type": "string" }, "description": "Page size 1-100 (default 25), enforced by the handler." }, { "in": "query", "name": "cursor", "schema": { "description": "Opaque continuation cursor from a prior page's continueCursor.", "type": "string" }, "description": "Opaque continuation cursor from a prior page's continueCursor." } ], "responses": { "200": { "description": "Cursor-paginated result. continueCursor is non-null even when isDone is true.", "content": { "application/json": { "schema": { "type": "object", "properties": { "page": { "type": "array", "items": { "$ref": "#/components/schemas/WebhookDelivery" } }, "isDone": { "type": "boolean" }, "continueCursor": { "type": "string" } }, "required": [ "page", "isDone", "continueCursor" ], "additionalProperties": false } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/webhooks/{id}/deliveries/{deliveryId}/replay": { "post": { "operationId": "replayWebhookDelivery", "tags": [ "Webhooks" ], "summary": "Replay a webhook delivery", "description": "Re-queues a dead-lettered delivery for a fresh attempt. Delivered, in-flight, or still-retrying (failed) deliveries cannot be replayed (409). Requires the webhooks.manage permission and the webhooks feature.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "description": "Webhook endpoint id." }, "required": true, "description": "Webhook endpoint id." }, { "in": "path", "name": "deliveryId", "schema": { "type": "string", "description": "Delivery-log row id to replay." }, "required": true, "description": "Delivery-log row id to replay." } ], "responses": { "200": { "description": "Replay re-queued.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookReplayResult" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Conflict.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/webhooks/{id}/rotate-secret": { "post": { "operationId": "rotateWebhookSecret", "tags": [ "Webhooks" ], "summary": "Rotate a webhook signing secret", "description": "Rotates the endpoint's signing secret. The previous secret keeps signing for a 24h grace window so consumers can update without missing deliveries. Returns the new secret ONCE. Requires the webhooks.manage permission and the webhooks feature.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "description": "Webhook endpoint id." }, "required": true, "description": "Webhook endpoint id." } ], "responses": { "200": { "description": "The new one-time signing secret.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookSecret" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/webhooks/{id}/test": { "post": { "operationId": "testWebhook", "tags": [ "Webhooks" ], "summary": "Send a test.ping to a webhook endpoint", "description": "Sends a single signed test.ping delivery (no retries) and logs it. Use it to verify your endpoint and signature handling. Requires the webhooks.manage permission and the webhooks feature.", "security": [ { "ApiKeyAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "description": "Webhook endpoint id." }, "required": true, "description": "Webhook endpoint id." } ], "responses": { "200": { "description": "The test delivery outcome.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookTestResult" } } } }, "400": { "description": "Bad request (invalid body, cursor, limit, or date).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Missing or invalid API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "API key lacks the required permission.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Rate limited.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } }, "webhooks": { "match.accepted": { "post": { "operationId": "webhook_match_accepted", "summary": "match.accepted webhook delivery", "description": "Delivered to a registered endpoint when a match.accepted event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "match.cancelled": { "post": { "operationId": "webhook_match_cancelled", "summary": "match.cancelled webhook delivery", "description": "Delivered to a registered endpoint when a match.cancelled event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "match.completed": { "post": { "operationId": "webhook_match_completed", "summary": "match.completed webhook delivery", "description": "Delivered to a registered endpoint when a match.completed event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "match.created": { "post": { "operationId": "webhook_match_created", "summary": "match.created webhook delivery", "description": "Delivered to a registered endpoint when a match.created event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "match.forfeited": { "post": { "operationId": "webhook_match_forfeited", "summary": "match.forfeited webhook delivery", "description": "Delivered to a registered endpoint when a match.forfeited event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "match.published": { "post": { "operationId": "webhook_match_published", "summary": "match.published webhook delivery", "description": "Delivered to a registered endpoint when a match.published event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "match.ready": { "post": { "operationId": "webhook_match_ready", "summary": "match.ready webhook delivery", "description": "Delivered to a registered endpoint when a match.ready event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "match.started": { "post": { "operationId": "webhook_match_started", "summary": "match.started webhook delivery", "description": "Delivered to a registered endpoint when a match.started event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "player.checked_in": { "post": { "operationId": "webhook_player_checked_in", "summary": "player.checked_in webhook delivery", "description": "Delivered to a registered endpoint when a player.checked_in event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "roster.updated": { "post": { "operationId": "webhook_roster_updated", "summary": "roster.updated webhook delivery", "description": "Delivered to a registered endpoint when a roster.updated event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "score.confirmed": { "post": { "operationId": "webhook_score_confirmed", "summary": "score.confirmed webhook delivery", "description": "Delivered to a registered endpoint when a score.confirmed event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "score.disputed": { "post": { "operationId": "webhook_score_disputed", "summary": "score.disputed webhook delivery", "description": "Delivered to a registered endpoint when a score.disputed event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "score.submitted": { "post": { "operationId": "webhook_score_submitted", "summary": "score.submitted webhook delivery", "description": "Delivered to a registered endpoint when a score.submitted event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "team.joined": { "post": { "operationId": "webhook_team_joined", "summary": "team.joined webhook delivery", "description": "Delivered to a registered endpoint when a team.joined event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } }, "team.left": { "post": { "operationId": "webhook_team_left", "summary": "team.left webhook delivery", "description": "Delivered to a registered endpoint when a team.left event occurs.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEnvelope" } } } }, "responses": { "200": { "description": "Acknowledged. Return 2xx to mark the delivery successful." } } } } }, "components": { "schemas": { "ListGameMatchesBody": { "type": "object", "properties": { "status": { "description": "Optional MatchStatus filter (e.g. IN_PROGRESS).", "type": "string" }, "limit": { "description": "Page size (1-100, enforced by the handler). Defaults to the handler's internal default.", "type": "number" }, "cursor": { "description": "Opaque continuation cursor from a prior page's pagination.cursor.", "type": "string" } }, "description": "Status filter and cursor pagination for listing the bound key's game matches. The game is derived from the developer-app key's bound game (not a body field)." }, "GameForfeitBody": { "type": "object", "properties": { "forfeitingTeamId": { "type": "string", "description": "ID of the team that forfeits. Must be a participant of the match." }, "reason": { "description": "Optional human-readable forfeit reason, recorded on the match.", "type": "string" } }, "required": [ "forfeitingTeamId" ], "description": "Request body for forfeiting a match on behalf of one participating team." }, "GamePlayerStatsBody": { "type": "object", "properties": { "mapIndex": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Zero-based index of the map whose stats are being updated." }, "playerStats": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {}, "description": "Per-player stats keyed by user ID. The map score must already exist." } }, "required": [ "mapIndex", "playerStats" ], "description": "Request body for submitting or updating player stats for an existing map score." }, "GameBatchScoresBody": { "type": "object", "properties": { "maps": { "minItems": 1, "type": "array", "items": { "$ref": "#/components/schemas/GameMapScoreInput" }, "description": "Map scores to submit. Must contain at least one entry." } }, "required": [ "maps" ], "description": "Request body for submitting one or more map scores in a single call." }, "GameMapScoreInput": { "type": "object", "properties": { "mapIndex": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Zero-based index of the map within the series." }, "mapId": { "type": "string", "description": "Identifier of the map that was played." }, "creatorTeamScore": { "type": "number", "minimum": 0, "description": "Score for the creator team (non-negative)." }, "opponentTeamScore": { "type": "number", "minimum": 0, "description": "Score for the opponent (accepted) team (non-negative)." }, "screenshotUrls": { "description": "Optional screenshot URLs supporting the reported score.", "type": "array", "items": { "type": "string" } }, "playerStats": { "description": "Optional per-player stats keyed by user ID.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "mapIndex", "mapId", "creatorTeamScore", "opponentTeamScore" ], "description": "One map's score within a batch submission." }, "GameSingleMapScoreBody": { "type": "object", "properties": { "mapId": { "type": "string", "description": "Identifier of the map that was played." }, "creatorTeamScore": { "type": "number", "minimum": 0, "description": "Score for the creator team (non-negative)." }, "opponentTeamScore": { "type": "number", "minimum": 0, "description": "Score for the opponent (accepted) team (non-negative)." }, "screenshotUrls": { "description": "Optional screenshot URLs supporting the reported score.", "type": "array", "items": { "type": "string" } }, "playerStats": { "description": "Optional per-player stats keyed by user ID.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "mapId", "creatorTeamScore", "opponentTeamScore" ], "description": "Request body for submitting a single map's score (mapIndex comes from the path)." }, "GameStatusUpdateBody": { "type": "object", "properties": { "status": { "type": "string", "description": "Target status. Allowed transitions: READY -> IN_PROGRESS, IN_PROGRESS -> COMPLETED|CANCELLED, ACCEPTED -> CANCELLED. COMPLETED is not accepted directly (matches complete automatically once scores are confirmed)." } }, "required": [ "status" ], "description": "Request body for updating a match's lifecycle status." }, "GameBatchMatchScoresBody": { "type": "object", "properties": { "items": { "minItems": 1, "maxItems": 50, "type": "array", "items": { "$ref": "#/components/schemas/GameMultiMatchScoreItem" }, "description": "Map scores to submit across one or more matches. 1-50 entries." } }, "required": [ "items" ], "description": "Request body for submitting map scores across multiple matches in a single call (capped at 50 items)." }, "GameMultiMatchScoreItem": { "type": "object", "properties": { "matchId": { "type": "string", "description": "ID of the match this map score belongs to." }, "mapIndex": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Zero-based index of the map within the series." }, "mapId": { "type": "string", "description": "Identifier of the map that was played." }, "creatorTeamScore": { "type": "number", "minimum": 0, "description": "Score for the creator team (non-negative)." }, "opponentTeamScore": { "type": "number", "minimum": 0, "description": "Score for the opponent (accepted) team (non-negative)." }, "screenshotUrls": { "description": "Optional screenshot URLs supporting the reported score.", "type": "array", "items": { "type": "string" } }, "playerStats": { "description": "Optional per-player stats keyed by user ID.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "matchId", "mapIndex", "mapId", "creatorTeamScore", "opponentTeamScore" ], "description": "One match's single map score within a multi-match batch submission." }, "GameCreateMatchBody": { "type": "object", "properties": { "creatorTeamId": { "type": "string", "description": "ID of the creating team. Must belong to the key's bound game." }, "acceptedTeamId": { "type": "string", "description": "ID of the opposing team. Required - game-originated matches are two-sided. Must belong to the key's bound game." }, "gameModeId": { "type": "string", "description": "Game mode identifier (e.g. search_and_destroy)." }, "bestOf": { "type": "number", "description": "Number of maps in the series (1, 3, 5, or 7)." }, "teamSize": { "type": "number", "description": "Players per team (validated against the game's min/max)." }, "platform": { "type": "string", "enum": [ "PC", "XBOX", "PLAYSTATION", "CONSOLE_ONLY", "CROSSPLAY" ], "description": "Match platform (e.g. CROSSPLAY)." }, "inputDevice": { "type": "string", "enum": [ "ALL", "CONTROLLER", "KB_M" ], "description": "Allowed input device (e.g. ALL)." }, "region": { "type": "string", "enum": [ "NONE", "NA_EAST", "NA_WEST", "EU", "ASIA", "OCEANIA", "SOUTH_AMERICA", "MIDDLE_EAST", "AFRICA" ], "description": "Match region (e.g. NONE)." }, "mapSelectionType": { "type": "string", "enum": [ "COMPETITIVE", "FLEX" ], "description": "Map selection type (COMPETITIVE or FLEX)." }, "mapPreferenceMode": { "type": "string", "enum": [ "PREFERRED", "VETO", "MANUAL" ], "description": "Map preference mode (PREFERRED, VETO, or MANUAL)." }, "selectedMaps": { "description": "Optional pre-selected map IDs.", "type": "array", "items": { "type": "string" } }, "selectedObjectives": { "description": "Optional pre-selected objective IDs.", "type": "array", "items": { "type": "string" } }, "scheduledAt": { "description": "Optional scheduled start time (epoch ms).", "type": "number" } }, "required": [ "creatorTeamId", "acceptedTeamId", "gameModeId", "bestOf", "teamSize", "platform", "inputDevice", "region", "mapSelectionType", "mapPreferenceMode" ], "description": "Request body for creating a two-sided game-originated match. The match is created ACCEPTED + PUBLISHED for the key's bound game. Supports an optional Idempotency-Key header for safe retries." }, "DiscoverLeaguesRequestBody": { "type": "object", "properties": { "search": { "description": "Free-text search across league names.", "type": "string" }, "gameId": { "description": "Filter to leagues that include this game id.", "type": "string" }, "page": { "default": 1, "description": "1-based page number. Defaults to 1.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "limit": { "default": 12, "description": "Page size (1-50). Defaults to 12.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "description": "Filters and offset pagination for discovering leagues." }, "BansRequestBody": { "type": "object", "properties": { "status": { "description": "Filter bans by computed status. Defaults to all.", "type": "string", "enum": [ "active", "expired", "revoked", "all" ] } }, "description": "Status filter for league team bans." }, "PenaltiesRequestBody": { "type": "object", "properties": { "type": { "default": "all", "description": "Which record kinds to return. Defaults to all.", "type": "string", "enum": [ "penalties", "cooldowns", "all" ] }, "teamId": { "description": "Filter penalties to a specific team id.", "type": "string" }, "gameId": { "description": "Filter penalties to a specific game id.", "type": "string" }, "limit": { "default": 50, "description": "Maximum number of penalties to return (1-100). Defaults to 50.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "description": "Type, team, game, and limit filters for league penalties and cooldowns." }, "RulesRequestBody": { "type": "object", "properties": { "gameId": { "type": "string", "description": "Game id to fetch rules and points config for. Required." } }, "required": [ "gameId" ], "description": "Game selector for league rules and points config." }, "SeasonsRequestBody": { "type": "object", "properties": { "gameId": { "description": "Filter seasons to a specific game id.", "type": "string" }, "status": { "description": "Filter seasons by lifecycle status.", "type": "string", "enum": [ "UPCOMING", "ACTIVE", "COMPLETED" ] } }, "description": "Game and status filters for league seasons." }, "StandingsRequestBody": { "type": "object", "properties": { "seasonId": { "description": "Filter standings to a specific season id.", "type": "string" }, "gameId": { "description": "Filter standings to a specific game id.", "type": "string" }, "limit": { "default": 50, "description": "Maximum number of teams to return (1-100). Defaults to 50.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "description": "Season and game filters for league standings." }, "ConfirmScoreBody": { "type": "object", "properties": { "mapIndex": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Zero-based map index to confirm. Must be a non-negative integer." } }, "required": [ "mapIndex" ], "description": "Confirmation payload identifying the map score to confirm." }, "SubmitScoreBody": { "type": "object", "properties": { "mapIndex": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Zero-based map index. Must be a non-negative integer." }, "mapId": { "type": "string", "description": "Map identifier string (e.g. dust2)." }, "creatorTeamScore": { "type": "number", "minimum": 0, "description": "Creator team score. Must be a non-negative number." }, "opponentTeamScore": { "type": "number", "minimum": 0, "description": "Accepted/opponent team score. Must be a non-negative number." }, "screenshotUrls": { "description": "Optional screenshot URLs for the map result.", "type": "array", "items": { "type": "string" } } }, "required": [ "mapIndex", "mapId", "creatorTeamScore", "opponentTeamScore" ], "description": "Map score submission payload for a single map." }, "MatchesRequestBody": { "type": "object", "properties": { "numItems": { "default": 25, "description": "Page size (1-100). Defaults to 25.", "type": "integer", "minimum": 1, "maximum": 100 }, "cursor": { "description": "Opaque continuation cursor from a prior page's continueCursor.", "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "includeStatuses": { "description": "Only include matches with these MatchStatus codes; unknown values are ignored.", "type": "array", "items": { "type": "string" } }, "excludeStatuses": { "description": "Exclude matches with these MatchStatus codes; unknown values are ignored.", "type": "array", "items": { "type": "string" } }, "gameId": { "description": "Filter to a single game by id.", "type": "string" }, "scheduledAfter": { "description": "ISO 8601; only matches scheduled at or after this time.", "type": "string" }, "scheduledBefore": { "description": "ISO 8601; only matches scheduled at or before this time.", "type": "string" }, "createdAfter": { "description": "ISO 8601; only matches created at or after this time.", "type": "string" }, "createdBefore": { "description": "ISO 8601; only matches created at or before this time.", "type": "string" }, "opponentId": { "description": "Filter to matches against this opponent team (team id or slug).", "type": "string" } }, "description": "Filters and cursor pagination for listing matches." }, "CreateWebhookBody": { "type": "object", "properties": { "url": { "type": "string", "description": "HTTPS endpoint URL. Private/loopback/metadata hosts are rejected." }, "events": { "minItems": 1, "type": "array", "items": { "type": "string" }, "description": "Subscribed event tokens: exact catalog names (e.g. match.completed) or family wildcards (e.g. match.*). At least one required." }, "label": { "description": "Optional human label for the endpoint.", "type": "string" } }, "required": [ "url", "events" ], "description": "Create a webhook endpoint in the caller's scope." }, "UpdateWebhookBody": { "type": "object", "properties": { "url": { "description": "New HTTPS endpoint URL.", "type": "string" }, "events": { "description": "Replacement event token list (at least one when present).", "minItems": 1, "type": "array", "items": { "type": "string" } }, "label": { "description": "New human label.", "type": "string" }, "isActive": { "description": "Enable/disable the endpoint. Re-enabling resets the failure count.", "type": "boolean" } }, "description": "Partial update of a webhook endpoint." }, "WebhookEnvelope": { "type": "object", "properties": { "id": { "type": "string", "description": "Stable delivery id, reused across retries (idempotency key)." }, "event": { "type": "string", "enum": [ "match.created", "match.published", "match.accepted", "match.ready", "match.started", "match.completed", "match.cancelled", "match.forfeited", "score.submitted", "score.confirmed", "score.disputed", "roster.updated", "player.checked_in", "team.joined", "team.left" ], "description": "The event name from the TeamBattles catalog." }, "created_at": { "type": "string", "description": "ISO-8601 timestamp the event was emitted." }, "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "Event-specific payload (generic in this wave; modeled per event in SP-1B)." } }, "required": [ "id", "event", "created_at", "data" ], "description": "Shared envelope for all TeamBattles webhook deliveries." }, "GameMatch": { "type": "object", "properties": { "id": { "type": "string" }, "status": { "$ref": "#/components/schemas/MatchStatus" }, "gameMode": { "type": "string", "description": "Game mode identifier (from the match's gameModeId)." }, "bestOf": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of maps in the series (1, 3, 5, or 7)." }, "creatorTeam": { "anyOf": [ { "$ref": "#/components/schemas/Team" }, { "type": "null" } ] }, "acceptedTeam": { "anyOf": [ { "$ref": "#/components/schemas/Team" }, { "type": "null" } ] }, "creatorTeamScore": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ] }, "acceptedTeamScore": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ] }, "scheduledAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Scheduled start time (ISO 8601)." }, "startedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Actual start time (ISO 8601)." }, "completedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Completion time (ISO 8601)." }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Creation time (ISO 8601)." } }, "required": [ "id", "status", "gameMode", "bestOf", "creatorTeam", "acceptedTeam", "creatorTeamScore", "acceptedTeamScore", "scheduledAt", "startedAt", "completedAt", "createdAt" ], "additionalProperties": false, "description": "Match as returned by the game-developer endpoints (includes scores, omits the game object)." }, "MatchStatus": { "type": "string", "enum": [ "PENDING", "ACCEPTED", "READY", "IN_PROGRESS", "COMPLETED", "CANCELLED", "DISPUTED", "FORFEITED" ], "description": "Lifecycle status of a match." }, "Team": { "type": "object", "properties": { "id": { "type": "string", "description": "Team ID." }, "name": { "type": "string", "description": "Team name." }, "tag": { "type": "string", "description": "Team tag (short identifier)." } }, "required": [ "id", "name", "tag" ], "additionalProperties": false, "description": "A team participating in a match." }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Stable machine-readable error code (e.g. error_api_key_invalid). Treat this, not the message, as the programmatic contract." }, "details": { "description": "Optional human-readable explanation. Often absent on auth/permission errors.", "x-ms-primary-error-message": true, "type": "string" } }, "required": [ "error" ], "additionalProperties": false, "description": "Standard API error response." }, "GameMatchDetailResponse": { "type": "object", "properties": { "match": { "$ref": "#/components/schemas/GameMatchDetail" }, "timestamp": { "type": "string", "description": "Server response time (ISO 8601)." } }, "required": [ "match", "timestamp" ], "additionalProperties": false, "description": "Envelope for GET /game/matches/{matchId}: the match plus a response timestamp." }, "GameMatchDetail": { "type": "object", "properties": { "id": { "type": "string" }, "gameId": { "type": "string", "description": "Game ID the match belongs to." }, "gameMode": { "type": "string", "description": "Game mode identifier (from the match's gameModeId)." }, "status": { "$ref": "#/components/schemas/MatchStatus" }, "bestOf": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of maps in the series (1, 3, 5, or 7)." }, "creatorTeam": { "anyOf": [ { "$ref": "#/components/schemas/GameDetailTeam" }, { "type": "null" } ] }, "acceptedTeam": { "anyOf": [ { "$ref": "#/components/schemas/GameDetailTeam" }, { "type": "null" } ] }, "creatorTeamScore": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ] }, "acceptedTeamScore": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ] }, "winnerTeamId": { "description": "Winning team ID once the match completes.", "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "loserTeamId": { "description": "Losing team ID once the match completes.", "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "scheduledAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Scheduled start time (ISO 8601)." }, "startedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Actual start time (ISO 8601)." }, "completedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Completion time (ISO 8601)." }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Creation time (ISO 8601)." }, "leagueId": { "description": "League this match belongs to, if any (SP-7 league wave).", "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "leagueSeasonId": { "description": "League season this match belongs to, if any.", "anyOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "id", "gameId", "gameMode", "status", "bestOf", "creatorTeam", "acceptedTeam", "creatorTeamScore", "acceptedTeamScore", "scheduledAt", "startedAt", "completedAt", "createdAt" ], "additionalProperties": false, "description": "Detailed match payload returned inside the game-developer match-detail response." }, "GameDetailTeam": { "type": "object", "properties": { "_id": { "type": "string", "description": "Team ID." }, "name": { "type": "string", "description": "Team name." }, "tag": { "type": "string", "description": "Team tag (short identifier)." } }, "required": [ "_id", "name", "tag" ], "additionalProperties": false, "description": "A team as embedded in the game-developer match-detail response ({ _id, name, tag })." }, "GameForfeitResponse": { "type": "object", "properties": { "success": { "type": "boolean", "const": true }, "matchId": { "type": "string", "description": "ID of the forfeited match." }, "forfeitedByTeamId": { "type": "string", "description": "ID of the team that forfeited." }, "timestamp": { "type": "string", "description": "Server response time (ISO 8601)." } }, "required": [ "success", "matchId", "forfeitedByTeamId", "timestamp" ], "additionalProperties": false, "description": "Result of a successful match forfeit." }, "GamePlayerStatsResponse": { "type": "object", "properties": { "success": { "type": "boolean", "const": true }, "mapIndex": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Index of the map whose stats were updated." }, "action": { "type": "string", "description": "Operation performed, always \"updated\" on success." } }, "required": [ "success", "mapIndex", "action" ], "additionalProperties": false, "description": "Result of a successful player-stats update." }, "GameMatchRostersResponse": { "type": "object", "properties": { "creatorTeamId": { "type": "string", "description": "ID of the team that created the match." }, "acceptedTeamId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ID of the team that accepted the match, or null if unaccepted." }, "creatorRoster": { "type": "array", "items": { "$ref": "#/components/schemas/GameRosterPlayer" }, "description": "Players on the creator team." }, "acceptedRoster": { "type": "array", "items": { "$ref": "#/components/schemas/GameRosterPlayer" }, "description": "Players on the accepted team (empty when unaccepted)." }, "timestamp": { "type": "string", "description": "Server response time (ISO 8601)." } }, "required": [ "creatorTeamId", "acceptedTeamId", "creatorRoster", "acceptedRoster", "timestamp" ], "additionalProperties": false, "description": "Team rosters for a match, grouped by creator and accepted team." }, "GameRosterPlayer": { "type": "object", "properties": { "userId": { "type": "string", "description": "Player's user ID." }, "teamId": { "type": "string", "description": "ID of the team the player belongs to." }, "username": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Player's username, or null if unset." }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Player's display name, or null if unset." }, "isCheckedIn": { "type": "boolean", "description": "Whether the player has checked in for the match." } }, "required": [ "userId", "teamId", "username", "name", "isCheckedIn" ], "additionalProperties": false, "description": "A single player entry on a match roster." }, "GameScoresResponse": { "type": "object", "properties": { "scores": { "type": "array", "items": { "$ref": "#/components/schemas/GameScore" }, "description": "All recorded map scores for the match." }, "seriesScore": { "$ref": "#/components/schemas/GameSeriesScore" }, "timestamp": { "type": "string", "description": "Server response time (ISO 8601)." } }, "required": [ "scores", "seriesScore", "timestamp" ], "additionalProperties": false, "description": "All map scores for a match plus the aggregate series tally." }, "GameScore": { "type": "object", "properties": { "mapIndex": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Zero-based index of the map within the series." }, "mapId": { "type": "string", "description": "Identifier of the map that was played." }, "creatorTeamScore": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Score for the creator team." }, "opponentTeamScore": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Score for the opponent (accepted) team." }, "scoreStatus": { "type": "string", "description": "Confirmation state: \"CONFIRMED\" or \"PENDING\"." }, "playerStats": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, { "type": "null" } ], "description": "Per-player stats keyed by user ID, or null when none recorded." }, "submittedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "When the score was submitted (ISO 8601)." }, "confirmedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "When the score was confirmed (ISO 8601)." } }, "required": [ "mapIndex", "mapId", "creatorTeamScore", "opponentTeamScore", "scoreStatus", "playerStats", "submittedAt", "confirmedAt" ], "additionalProperties": false, "description": "A single map score as returned when reading scores." }, "GameSeriesScore": { "type": "object", "properties": { "creatorMapWins": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Confirmed map wins for the creator team." }, "opponentMapWins": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Confirmed map wins for the opponent team." } }, "required": [ "creatorMapWins", "opponentMapWins" ], "additionalProperties": false, "description": "Aggregate map-win tally across the series." }, "GameBatchScoresResponse": { "type": "object", "properties": { "success": { "type": "boolean", "description": "True only when every submitted map score was confirmed." }, "submitted": { "type": "array", "items": { "$ref": "#/components/schemas/GameBatchScoreResult" }, "description": "Per-map results, in submission order." }, "count": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of map scores that were confirmed." } }, "required": [ "success", "submitted", "count" ], "additionalProperties": false, "description": "Result of a batch map-score submission." }, "GameBatchScoreResult": { "type": "object", "properties": { "mapIndex": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Index of the map this result refers to." }, "status": { "type": "string", "description": "Per-map outcome: \"confirmed\" on success, \"failed\" otherwise." }, "error": { "description": "Failure reason, present only when status is failed.", "type": "string" } }, "required": [ "mapIndex", "status" ], "additionalProperties": false, "description": "Outcome for a single submitted map score." }, "GameSingleMapScoreResponse": { "type": "object", "properties": { "success": { "type": "boolean", "const": true }, "mapIndex": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Index of the map that was scored." }, "scoreStatus": { "type": "string", "description": "Confirmation state, always \"CONFIRMED\" on success." } }, "required": [ "success", "mapIndex", "scoreStatus" ], "additionalProperties": false, "description": "Result of submitting a single map score." }, "GameStatusUpdateResponse": { "type": "object", "properties": { "success": { "type": "boolean", "const": true }, "matchId": { "type": "string", "description": "ID of the updated match." }, "previousStatus": { "type": "string", "description": "Match status before the transition." }, "newStatus": { "type": "string", "description": "Match status after the transition." }, "timestamp": { "type": "string", "description": "Server response time (ISO 8601)." } }, "required": [ "success", "matchId", "previousStatus", "newStatus", "timestamp" ], "additionalProperties": false, "description": "Result of a successful match status transition." }, "GameBatchMatchScoresResponse": { "type": "object", "properties": { "success": { "type": "boolean", "description": "True only when every submitted item was confirmed." }, "submitted": { "type": "array", "items": { "$ref": "#/components/schemas/GameBatchMatchScoreResult" }, "description": "Per-item results, in submission order." }, "count": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of items that were confirmed." } }, "required": [ "success", "submitted", "count" ], "additionalProperties": false, "description": "Result of a multi-match batch map-score submission. Always returned with HTTP 200; inspect per-item status." }, "GameBatchMatchScoreResult": { "type": "object", "properties": { "matchId": { "type": "string", "description": "Match ID this result refers to." }, "mapIndex": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Index of the map this result refers to." }, "status": { "type": "string", "description": "Per-item outcome: \"confirmed\" on success, \"failed\" otherwise." }, "error": { "description": "Bare machine-readable error code (e.g. error_game_scope_mismatch), present only when status is failed. Never the raw message.", "type": "string" } }, "required": [ "matchId", "mapIndex", "status" ], "additionalProperties": false, "description": "Outcome for a single (match, map) item in a multi-match batch." }, "GameCreateMatchResponse": { "type": "object", "properties": { "success": { "type": "boolean", "const": true }, "matchId": { "type": "string", "description": "ID of the newly created match." }, "timestamp": { "type": "string", "description": "Server response time (ISO 8601)." } }, "required": [ "success", "matchId", "timestamp" ], "additionalProperties": false, "description": "Result of a successful game-originated match creation." }, "LeagueSummary": { "type": "object", "properties": { "id": { "type": "string", "description": "League ID." }, "name": { "type": "string", "description": "League display name." }, "slug": { "type": "string", "description": "URL-friendly league identifier." }, "description": { "type": "string", "description": "League description." }, "avatarUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "League avatar image URL." }, "bannerUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "League banner image URL." }, "isVerified": { "type": "boolean", "description": "Whether the league is verified." }, "isFeatured": { "type": "boolean", "description": "Whether the league is featured." }, "games": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Games associated with the league." }, "teamCount": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of teams in the league." }, "seasonStatus": { "type": "string", "enum": [ "active", "upcoming", "none" ], "description": "Aggregate season state across the league's games." }, "createdAt": { "type": "number", "description": "Creation timestamp (epoch milliseconds)." }, "status": { "description": "League status.", "type": "string" } }, "required": [ "id", "name", "slug", "description", "avatarUrl", "bannerUrl", "isVerified", "isFeatured", "games", "teamCount", "seasonStatus", "createdAt" ], "additionalProperties": false, "description": "Summary view of a league for discovery results." }, "LeagueProfileResponse": { "type": "object", "properties": { "league": { "$ref": "#/components/schemas/LeagueProfile" }, "timestamp": { "type": "string", "description": "Response generation time (ISO 8601)." } }, "required": [ "league", "timestamp" ], "additionalProperties": false, "description": "League profile response envelope." }, "LeagueProfile": { "type": "object", "properties": { "id": { "type": "string", "description": "League ID." }, "name": { "type": "string", "description": "League display name." }, "slug": { "type": "string", "description": "URL-friendly league identifier." }, "description": { "type": "string", "description": "League description." }, "avatarUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "League avatar image URL." }, "bannerUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "League banner image URL." }, "status": { "type": "string", "description": "League status (e.g. active, inactive)." }, "isVerified": { "type": "boolean", "description": "Whether the league is verified." }, "isFeatured": { "type": "boolean", "description": "Whether the league is featured." }, "teamCount": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of teams in the league." }, "staffCount": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of staff members." }, "games": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Games associated with the league." }, "activeSeasons": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Currently active seasons." }, "socials": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ], "description": "Social media links." }, "createdAt": { "type": "number", "description": "Creation timestamp (epoch milliseconds)." } }, "required": [ "id", "name", "slug", "description", "avatarUrl", "bannerUrl", "status", "isVerified", "isFeatured", "teamCount", "staffCount", "games", "activeSeasons", "socials", "createdAt" ], "additionalProperties": false, "description": "Public profile for a single league." }, "LeagueBans": { "type": "object", "properties": { "bans": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Enriched team ban records with computed status." }, "count": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of bans returned." }, "timestamp": { "type": "string", "description": "Response generation time (ISO 8601)." } }, "required": [ "bans", "count", "timestamp" ], "additionalProperties": false, "description": "Team bans for a league." }, "LeagueMembers": { "type": "object", "properties": { "members": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Enriched league staff member records." }, "count": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of members returned." }, "timestamp": { "type": "string", "description": "Response generation time (ISO 8601)." } }, "required": [ "members", "count", "timestamp" ], "additionalProperties": false, "description": "Staff members of a league." }, "LeaguePenalties": { "type": "object", "properties": { "penalties": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Enriched penalty records (empty when type is cooldowns)." }, "cooldowns": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Enriched member cooldown records (empty when type is penalties)." }, "count": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Combined number of penalties and cooldowns returned." }, "timestamp": { "type": "string", "description": "Response generation time (ISO 8601)." } }, "required": [ "penalties", "cooldowns", "count", "timestamp" ], "additionalProperties": false, "description": "Penalties and cooldowns for a league." }, "LeagueRules": { "type": "object", "properties": { "rules": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ], "description": "Game rules document for the league + game, or null if unset." }, "pointsConfig": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ], "description": "Points configuration document for the league + game, or null if unset." }, "timestamp": { "type": "string", "description": "Response generation time (ISO 8601)." } }, "required": [ "rules", "pointsConfig", "timestamp" ], "additionalProperties": false, "description": "Game rules and points config for a league." }, "LeagueSeasons": { "type": "object", "properties": { "seasons": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Season documents for the league." }, "count": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of seasons returned." }, "timestamp": { "type": "string", "description": "Response generation time (ISO 8601)." } }, "required": [ "seasons", "count", "timestamp" ], "additionalProperties": false, "description": "Seasons for a league." }, "LeagueStandings": { "type": "object", "properties": { "standings": { "type": "array", "items": { "type": "object", "properties": { "rank": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "1-based standings position." } }, "required": [ "rank" ], "additionalProperties": {} }, "description": "Approved teams with season stats, ordered by standings position. Each item is a team-with-stats document plus a computed rank." }, "count": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of teams returned." }, "timestamp": { "type": "string", "description": "Response generation time (ISO 8601)." } }, "required": [ "standings", "count", "timestamp" ], "additionalProperties": false, "description": "League standings for a season." }, "MapScores": { "type": "object", "properties": { "scores": { "type": "array", "items": { "$ref": "#/components/schemas/MapScoreItem" } }, "seriesScore": { "type": "object", "properties": { "creatorMapWins": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "opponentMapWins": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "creatorMapWins", "opponentMapWins" ], "additionalProperties": false }, "timestamp": { "type": "string", "description": "Response timestamp (ISO 8601)." } }, "required": [ "scores", "seriesScore", "timestamp" ], "additionalProperties": false, "description": "All map scores for a match with a series summary." }, "MapScoreItem": { "type": "object", "properties": { "mapIndex": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "mapId": { "type": "string" }, "creatorTeamScore": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "opponentTeamScore": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "screenshotUrls": { "type": "array", "items": { "type": "string" } }, "scoreStatus": { "type": "string", "description": "CONFIRMED or PENDING." }, "submittedBy": { "anyOf": [ { "$ref": "#/components/schemas/ScoreSubmitter" }, { "type": "null" } ] }, "confirmedBy": { "anyOf": [ { "$ref": "#/components/schemas/ScoreConfirmer" }, { "type": "null" } ] }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Creation time (ISO 8601)." } }, "required": [ "mapIndex", "mapId", "creatorTeamScore", "opponentTeamScore", "screenshotUrls", "scoreStatus", "submittedBy", "confirmedBy", "createdAt" ], "additionalProperties": false, "description": "A single map's score entry." }, "ScoreSubmitter": { "type": "object", "properties": { "userId": { "type": "string" }, "teamId": { "type": "string" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "userId", "teamId", "name" ], "additionalProperties": false, "description": "Identity of the captain who submitted a score." }, "ScoreConfirmer": { "type": "object", "properties": { "userId": { "type": "string" }, "teamId": { "type": "string" }, "confirmedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Confirmation time (ISO 8601)." } }, "required": [ "userId", "teamId", "confirmedAt" ], "additionalProperties": false, "description": "Identity of the captain who confirmed a score." }, "ScoreSubmissionResult": { "type": "object", "properties": { "success": { "type": "boolean" }, "action": { "type": "string", "description": "Action performed, e.g. \"submitted\" or \"confirmed\"." }, "mapIndex": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Zero-based map index that was affected." }, "scoreStatus": { "type": "string", "description": "Resulting score status, e.g. PENDING or CONFIRMED." } }, "required": [ "success", "action", "mapIndex", "scoreStatus" ], "additionalProperties": false, "description": "Result of submitting or confirming a map score." }, "UserMatch": { "type": "object", "properties": { "id": { "type": "string" }, "status": { "$ref": "#/components/schemas/MatchStatus" }, "game": { "$ref": "#/components/schemas/Game" }, "gameMode": { "type": "string", "description": "Game mode (e.g. HARDPOINT, SEARCH_AND_DESTROY)." }, "creatorTeam": { "anyOf": [ { "$ref": "#/components/schemas/Team" }, { "type": "null" } ] }, "acceptedTeam": { "anyOf": [ { "$ref": "#/components/schemas/Team" }, { "type": "null" } ] }, "scheduledAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Scheduled start time (ISO 8601)." }, "startedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Actual start time (ISO 8601)." }, "completedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Completion time (ISO 8601)." }, "bestOf": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of maps in the series (1, 3, 5, or 7)." } }, "required": [ "id", "status", "game", "gameMode", "creatorTeam", "acceptedTeam", "scheduledAt", "startedAt", "completedAt", "bestOf" ], "additionalProperties": false, "description": "Match as returned by the user/team/org match-listing endpoints." }, "Game": { "type": "object", "properties": { "id": { "type": "string", "description": "Game ID." }, "nameKey": { "type": "string", "description": "Game name key for i18n lookup." } }, "required": [ "id", "nameKey" ], "additionalProperties": false, "description": "Game definition." }, "TwitchChannelBadges": { "type": "object", "properties": { "broadcaster_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Resolved broadcaster (channel) id." }, "broadcaster_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Resolved broadcaster display name or login." }, "badges": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchBadgeSet" }, "description": "Channel-specific Twitch chat badge sets." }, "timestamp": { "type": "string", "description": "Response generation time (ISO 8601)." } }, "required": [ "broadcaster_id", "broadcaster_name", "badges", "timestamp" ], "additionalProperties": false, "description": "Channel-specific Twitch chat badges." }, "TwitchBadgeSet": { "type": "object", "properties": { "set_id": { "type": "string", "description": "Badge set identifier (e.g. subscriber, moderator)." }, "versions": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchBadgeVersion" }, "description": "Available versions within this badge set." } }, "required": [ "set_id", "versions" ], "additionalProperties": false, "description": "A set of related Twitch chat badge versions." }, "TwitchBadgeVersion": { "type": "object", "properties": { "id": { "type": "string", "description": "Badge version id (e.g. tier level or numeric id)." }, "image_url_1x": { "type": "string", "description": "Badge image URL at 1x resolution." }, "image_url_2x": { "type": "string", "description": "Badge image URL at 2x resolution." }, "image_url_4x": { "type": "string", "description": "Badge image URL at 4x resolution." }, "title": { "type": "string", "description": "Human-readable badge title." }, "description": { "type": "string", "description": "Human-readable badge description." }, "click_action": { "description": "Optional click action identifier.", "type": "string" }, "click_url": { "description": "Optional URL opened when the badge is clicked.", "type": "string" } }, "required": [ "id", "image_url_1x", "image_url_2x", "image_url_4x", "title", "description" ], "additionalProperties": false, "description": "A single version of a Twitch chat badge." }, "TwitchGlobalBadges": { "type": "object", "properties": { "badges": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchBadgeSet" }, "description": "Global Twitch chat badge sets." }, "timestamp": { "type": "string", "description": "Response generation time (ISO 8601)." } }, "required": [ "badges", "timestamp" ], "additionalProperties": false, "description": "Global Twitch chat badges." }, "WebhookListResponse": { "type": "object", "properties": { "webhooks": { "type": "array", "items": { "$ref": "#/components/schemas/WebhookEndpoint" } }, "count": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "timestamp": { "type": "string" } }, "required": [ "webhooks", "count", "timestamp" ], "additionalProperties": false, "description": "List of the caller's webhook endpoints." }, "WebhookEndpoint": { "type": "object", "properties": { "id": { "type": "string", "description": "Webhook endpoint id." }, "scopeType": { "type": "string", "enum": [ "game", "league", "org", "team", "user" ], "description": "The single scope dimension an endpoint is bound to." }, "scopeId": { "type": "string", "description": "Stringified bound scope id." }, "url": { "type": "string", "description": "Delivery URL." }, "secretPrefix": { "type": "string", "description": "First 8 chars of the current signing secret (display only)." }, "events": { "type": "array", "items": { "type": "string" }, "description": "Subscribed event tokens." }, "isActive": { "type": "boolean", "description": "Whether the endpoint receives deliveries." }, "label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Human label, or null." }, "failureCount": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Consecutive dead-lettered deliveries (auto-disables at 50)." }, "lastDeliveredAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "description": "Epoch ms of the last successful delivery, or null." }, "lastFailedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "description": "Epoch ms of the last failed delivery, or null." }, "createdAt": { "type": "number", "description": "Creation epoch ms." }, "updatedAt": { "type": "number", "description": "Last update epoch ms." } }, "required": [ "id", "scopeType", "scopeId", "url", "secretPrefix", "events", "isActive", "label", "failureCount", "lastDeliveredAt", "lastFailedAt", "createdAt", "updatedAt" ], "additionalProperties": false, "description": "A webhook endpoint (no secret material)." }, "WebhookSecret": { "type": "object", "properties": { "id": { "type": "string", "description": "The endpoint id the secret belongs to." }, "signingSecret": { "type": "string", "description": "Plaintext signing secret. Shown ONCE - store it now." }, "secretPrefix": { "type": "string", "description": "First 8 chars of the new signing secret." } }, "required": [ "id", "signingSecret", "secretPrefix" ], "additionalProperties": false, "description": "One-time signing-secret reveal (create/rotate)." }, "WebhookOk": { "type": "object", "properties": { "ok": { "type": "boolean" } }, "required": [ "ok" ], "additionalProperties": false, "description": "Success ack." }, "WebhookDelivery": { "type": "object", "properties": { "id": { "type": "string", "description": "Delivery-log row id." }, "idempotencyId": { "type": "string", "description": "Stable evt_ id, reused across retries (idempotency key)." }, "event": { "type": "string", "description": "The delivered event name." }, "status": { "type": "string", "enum": [ "pending", "delivering", "delivered", "failed", "dead_lettered" ], "description": "Lifecycle status of one logical delivery (endpoint x idempotency id)." }, "attemptCount": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of delivery attempts made." }, "statusCode": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Last HTTP response status, or null." }, "errorMessage": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Last error message, or null." }, "nextAttemptAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "description": "Epoch ms of the next scheduled retry, or null." }, "isTest": { "type": "boolean", "description": "True for test.ping deliveries." }, "createdAt": { "type": "number", "description": "Emit/creation epoch ms (retention key)." }, "updatedAt": { "type": "number", "description": "Last update epoch ms." }, "deliveredAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "description": "Epoch ms of successful delivery, or null." } }, "required": [ "id", "idempotencyId", "event", "status", "attemptCount", "statusCode", "errorMessage", "nextAttemptAt", "isTest", "createdAt", "updatedAt", "deliveredAt" ], "additionalProperties": false, "description": "A single webhook delivery-log row." }, "WebhookReplayResult": { "type": "object", "properties": { "ok": { "type": "boolean" } }, "required": [ "ok" ], "additionalProperties": false, "description": "Replay re-queue acknowledgement." }, "WebhookTestResult": { "type": "object", "properties": { "delivered": { "type": "boolean", "description": "Whether the test.ping returned a 2xx." }, "statusCode": { "description": "HTTP response status, if any.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "error": { "description": "Failure reason, if not delivered.", "type": "string" } }, "required": [ "delivered" ], "additionalProperties": false, "description": "Outcome of a single test.ping delivery." }, "ApiErrorCode": { "type": "string", "enum": [ "error_api_key_invalid", "error_api_key_expired", "error_api_key_muted", "error_api_rate_limited", "error_api_key_permission_denied", "error_api_key_required", "error_api_plan_required", "error_api_feature_required", "error_game_scope_mismatch", "error_league_scope_mismatch", "error_unauthorized", "error_user_banned", "error_invalid_input", "error_invalid_request", "error_invalid_limit", "error_invalid_cursor", "error_league_not_found", "error_internal", "error_webhook_not_found", "error_webhook_url_invalid", "error_webhook_limit_reached", "error_webhook_invalid_events", "error_webhook_delivery_not_found", "error_webhook_replay_not_allowed", "error_webhook_scope_invalid", "error_idempotency_key_conflict" ], "description": "Stable machine-readable API error code (documentation enum)." } }, "securitySchemes": { "ApiKeyAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "API Key", "description": "Send your API key as: Authorization: Bearer tb_" } } } }