Skip to main content
POST
/
game
/
matches
/
{matchId}
/
player-stats
curl -X POST https://teambattles.gg/api/v1/game/matches/match_abc/player-stats \
  -H "Authorization: Bearer tb_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"mapIndex":0,"playerStats":{"user_123":{"kills":24,"deaths":11}}}'
{
  "success": true,
  "mapIndex": 0,
  "action": "<string>"
}

Permission Required

This endpoint requires the game.scores permission with write access. (game.scores is a write-level permission - its levels are none or write, not read-write.) Your API key must be a game-developer key bound to a game. The binding asserts the match belongs to your bound game before the handler runs: a key bound to a different game, or a non-developer key, receives a 403 error_game_scope_mismatch.

Access / Membership Rules

The map score for the given mapIndex must already exist - submit the score first via the scores endpoints, then attach player stats here. mapIndex must be a non-negative integer. An unknown match returns 404 error_match_not_found.

What’s Returned

Returns { "success": true, mapIndex, action }, where action is always updated on success.

Request Body

FieldTypeRequiredDescription
mapIndexnumberYesZero-based index of the map whose stats are being set.
playerStatsobjectYesPer-player stats keyed by user ID. The map score must already exist.
curl -X POST https://teambattles.gg/api/v1/game/matches/match_abc/player-stats \
  -H "Authorization: Bearer tb_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"mapIndex":0,"playerStats":{"user_123":{"kills":24,"deaths":11}}}'

Authorizations

Authorization
string
header
required

Send your API key as: Authorization: Bearer tb_

Path Parameters

matchId
string
required

Match ID.

Body

application/json

Request body for submitting or updating player stats for an existing map score.

mapIndex
integer
required

Zero-based index of the map whose stats are being updated.

Required range: 0 <= x <= 9007199254740991
playerStats
object
required

Per-player stats keyed by user ID. The map score must already exist.

Response

The player stats were updated.

Result of a successful player-stats update.

success
boolean
required
mapIndex
integer
required

Index of the map whose stats were updated.

Required range: -9007199254740991 <= x <= 9007199254740991
action
string
required

Operation performed, always "updated" on success.