# Tournament Tool API

Tournament organizer integrations use the public REST API plus HMAC-signed
webhooks.

## Bracket Creation

`POST /api/v2/tournament/{tournamentId}/bracket`

- Scope: `v2:tournament:write`
- Bracket types: `single-elimination`, `double-elimination`, `round-robin`
- Rate limit: 100 requests per app per minute
- Response includes `bracketId`, `seededPlayerIds`, and `createdAtUnixSeconds`

## Result Reporting

`POST /api/v2/tournament/{tournamentId}/result`

Result reporting requires `matchId`, `winnerPlayerId`, `loserPlayerId`, and
`replayId`. Accepted reports queue leaderboard ingest and
`tournament.match-ended` webhook delivery.

## Leaderboard Ingest

`POST /api/v2/leaderboard/ingest`

Trusted TO tools can ingest seasonal or event leaderboard rows. Ingest is
deduplicated in a 300-second window and tied to the authenticated developer app.

## Webhooks

`POST /api/v2/webhook/tournament/match-end`

Webhooks require HTTPS targets. Deliveries use `hmac-sha256`, include request
IDs for reconciliation, and retry with exponential backoff for 24 hours.
