---
title: "Refresh team player season stats"
method: POST
path: "/api/admin/teams/{teamId}/season-stats/refresh"
tags: ["Admin", "Teams"]
---

# Refresh team player season stats

`POST /api/admin/teams/{teamId}/season-stats/refresh`

## Request

- Base URL: `https://app.d-sports.org`
- URL: `https://app.d-sports.org/api/admin/teams/{teamId}/season-stats/refresh`
- Auth: HTTP bearer

Team managers (canManageTeam: platform admin, or the team's owner/editor/legacy admin). Recomputes PlayerSeasonStat rows for one season from every final game of the team in its API-Sports league (regular season and playoffs; friendlies excluded): derives games nobody viewed, links null-playerId stat rows (exact name, else the team's unique initial+surname row), and upserts one row per active roster player and per linked player with stats. Never writes overrides. Idempotent. teamId is an id or slug. 400 when the team has no API-Sports id or no resolvable league (pass leagueVendorId).

## Path parameters

- `teamId` string, required

## Request body

- object
  - `season` integer
  - `leagueVendorId` integer

## Response `200`

{ success, data: { teamId, season, leagueVendorId, gamesCounted, derivedGames, relinkedRows, players } }

- object
  - `success` boolean
  - `data` object
    - `teamId` string, required
    - `season` integer, required
    - `leagueVendorId` integer, required
    - `gamesCounted` integer, required
    - `derivedGames` integer, required
    - `relinkedRows` integer, required
    - `players` integer, required

## Other responses

- `400`: { success: false, error, code: VALIDATION_ERROR }
- `401`: { success: false, error, code: UNAUTHORIZED }
- `403`: { success: false, error, code: FORBIDDEN }
- `404`: Team or player not found

## Changes

- **2026-11-18** `6de639c52609`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/changes/api/admin/teams/:teamId/season-stats/refresh/post.md)

---

[API](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api.md) - [All operations](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/llms.txt) - [OpenAPI document](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/revisions/63735cf90a04?raw)
