Skip to main content

Overview

TeamBattles supports two score submission flows:
  1. Captain Score Submission - Team captains submit scores on behalf of their team
  2. Game Developer Score Submission - Game servers submit verified scores directly
Both flows use the same base endpoint but differ in authentication and auto-confirmation behavior.

Captain Score Submission

Captains submit scores for their team. The opposing team must confirm the score.

Submit Score

POST /api/v1/matches/{matchId}/scores
Headers:
Authorization: Bearer tb_your_api_key
Content-Type: application/json
Body:
{
  "mapIndex": 0,
  "mapId": "dust2",
  "creatorTeamScore": 13,
  "opponentTeamScore": 7,
  "screenshotUrls": ["https://example.com/screenshot.png"]
}
FieldTypeRequiredDescription
mapIndexnumberYesZero-based map index
mapIdstringYesMap identifier string
creatorTeamScorenumberYesCreator team’s score (>= 0)
opponentTeamScorenumberYesAccepted team’s score (>= 0)
screenshotUrlsstring[]NoArray of screenshot URLs
Response:
{
  "success": true,
  "action": "submitted",
  "mapIndex": 0,
  "scoreStatus": "PENDING"
}

Confirm Score

The opposing team’s captain confirms a submitted score using PATCH on the same endpoint.
PATCH /api/v1/matches/{matchId}/scores
Body:
{
  "mapIndex": 0
}
Response:
{
  "success": true,
  "action": "confirmed",
  "mapIndex": 0,
  "scoreStatus": "CONFIRMED"
}

Get Scores

Retrieve all map scores for a match, including series score summary.
GET /api/v1/matches/{matchId}/scores
Response:
{
  "scores": [
    {
      "mapIndex": 0,
      "mapId": "dust2",
      "creatorTeamScore": 13,
      "opponentTeamScore": 7,
      "screenshotUrls": [],
      "scoreStatus": "CONFIRMED",
      "submittedBy": { "userId": "...", "teamId": "...", "name": "Player" },
      "confirmedBy": { "userId": "...", "teamId": "...", "confirmedAt": "..." },
      "createdAt": "2024-01-15T12:00:00.000Z"
    }
  ],
  "seriesScore": {
    "creatorMapWins": 1,
    "opponentMapWins": 0
  },
  "timestamp": "2024-01-15T12:30:00.000Z"
}

Game Developer Score Submission

Requires Game Developer approval for the specific game. Scores submitted via this endpoint are automatically confirmed.

Submit Verified Score

POST /api/v1/game/matches/{matchId}/scores
Headers:
Authorization: Bearer tb_your_game_api_key
Content-Type: application/json
Body:
{
  "scores": {
    "team_123": 250,
    "team_456": 180
  },
  "metadata": {
    "map": "dust2",
    "duration": 2400,
    "rounds": 24
  }
}
Response:
{
  "success": true,
  "scoreId": "score_789",
  "status": "CONFIRMED",
  "autoConfirmed": true
}

Key Differences

FeatureCaptain SubmissionGame Developer Submission
AuthenticationUser API keyGame developer API key
Auto-confirmationNo (requires opponent)Yes
Metadata supportNoYes
Game scopeAnyApproved games only
Permission requiredmatches.team_matches: read-writegame.scores: write