API

Public API endpoints for tournament data, pick/bans, and leaderboard integration.

GET /api/tournament/[id]

Returns a tournament by its ID.

{
  "id": "string",
  "name": "string",
  "description": "string | null",
  "date": "string | null",
  "playersPerTeam": "number",
  "brackets": [
    {
      "id": "string",
      "name": "string",
      "rounds": [
        {
          "id": "string",
          "name": "string",
          "format": "string | null",
          "notes": "string | null",
          "scorePrefix": "string | null",
          "linkedBracketId": "string | null",
          "advance": "winner | loser | null",
          "matches": [
            {
              "id": "string",
              "teams": [
                {
                  "id": "string",
                  "name": "string",
                  "score": "number"
                },
                {
                  "id": "string",
                  "name": "string",
                  "score": "number"
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "createdAt": "string"
}

Returns 404 with {"error":"not found"} if the tournament does not exist.

GET /api/tournament/[id]/teams

Returns all accepted (approved) teams registered for a tournament.

[
  {
    "id": "string",
    "name": "string",
    "captainId": "string",
    "createdAt": "string",
    "members": [
      {
        "id": "string",
        "userId": "string | null",
        "discordId": "string | null",
        "embarkid": "string | null",
        "isSub": "boolean",
        "joinedAt": "string | null"
      }
    ]
  }
]

Returns 404 with {"error":"not found"} if the tournament does not exist.

GET /api/pick-bans/[id]

Returns the pick/ban (veto) state for a match series.

{
  "title": "string",
  "status": "pending | active | completed",
  "teams": [
    "string",
    "string"
  ],
  "picks": [
    {
      "map": "string",
      "by": "string"
    }
  ],
  "bans": [
    {
      "map": "string",
      "by": "string"
    }
  ],
  "available": [
    "string",
    "..."
  ],
  "decider": "string | null"
}

Returns 404 with {"error":"Match not found"} if the match does not exist.

Leaderboards

Competitive rankings are sourced from the independent leaderboard API.

api.the-finals-leaderboard.com