# V2 Public API Reference

Base path: `/api/v2`

Authentication uses developer portal bearer tokens with route-scoped OAuth2 PKCE
grants. All responses include `x-ratelimit-limit`, `x-ratelimit-window-seconds`,
`x-request-id`, `x-v2-api-version`, and `x-v2-app-id`.

## Read APIs

- `GET /player/{playerId}/stats`: rank, league, win-rate, per-fighter stats,
  per-stage stats, faction info, Crown points, and public visibility.
- `GET /player/{playerId}/history`: account-public-flag-gated match history.
- `GET /replay/{replayId}`: replay metadata and short-lived stream URL.
- `GET /discord-bot/template`: command manifest for `/v2-rank`,
  `/v2-friend-list`, and `/v2-tournament-bracket`.

## Write APIs

- `POST /match/{matchId}/coach-stream`: frame data, opponent move list,
  signature moves, and coach annotations with `gameplayAuthority: false`.
- `POST /notification/subscribe`: APNS, FCM, and Web Push subscriptions for
  tournament invites, friend matches, party invites, Twitch Drops earned, daily
  challenges, and Battle Pass updates.
- `POST /tournament/{tournamentId}/bracket`: single-elimination,
  double-elimination, or round-robin bracket creation.
- `POST /tournament/{tournamentId}/result`: result reporting with replay
  evidence, leaderboard ingest queueing, and match-end webhook queueing.
- `POST /leaderboard/ingest`: authenticated server-to-server leaderboard rows.
- `POST /webhook/tournament/match-end`: HMAC-SHA256 callback registration.
- `POST /micro-game/result`: HMAC-signed Companion and Web Hub micro-game reward
  validation.

## Scopes

- `v2:public:read`
- `v2:player:read_private`
- `v2:replay:read`
- `v2:coach-stream:write`
- `v2:notifications:write`
- `v2:tournament:write`
- `v2:leaderboard:write`
- `v2:webhook:write`
- `v2:developer:read`
- `v2:micro-game:write`
