Skip to main content
POST
/
leagues
/
{identifier}
/
rules
curl -X POST https://teambattles.gg/api/v1/leagues/my-league/rules \
  -H "Authorization: Bearer tb_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"gameId": "call_of_duty"}'
{
  "rules": {},
  "pointsConfig": {},
  "timestamp": "2023-11-07T05:31:56Z"
}
curl -X POST https://teambattles.gg/api/v1/leagues/my-league/rules \
  -H "Authorization: Bearer tb_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"gameId": "call_of_duty"}'

Permission Required

This endpoint requires the leagues.league_public permission on your API key.

League Identifier

The {identifier} path parameter accepts the league slug - the URL-friendly league name (e.g., my-league).

What’s Returned

Returns the game rules and points configuration for a specific league and game. The response includes two objects:
  • rules - The game-specific rules configured for this league (maps, modes, restrictions, etc.)
  • pointsConfig - The points system configuration (points per win, loss, draw, bonus multipliers, etc.)

Request Body

ParameterTypeRequiredDescription
gameIdstringYesThe game ID to fetch rules for
The gameId parameter is required. You must specify which game’s rules you want to retrieve.

Common Use Cases

Get Rules for a Specific Game

{
	"gameId": "call_of_duty"
}

Display League Rules on a Third-Party Site

const { rules, pointsConfig } = await response.json();

// Display game rules
if (rules) {
	console.log("Allowed maps:", rules.maps);
	console.log("Allowed modes:", rules.modes);
}

// Display points breakdown
if (pointsConfig) {
	console.log("Win points:", pointsConfig.winPoints);
	console.log("Loss points:", pointsConfig.lossPoints);
}

Authorizations

Authorization
string
header
required

API key authentication. Generate an API key from Settings > Developer in the TeamBattles app. Format: tb_xxxxxxxx...

Path Parameters

identifier
string
required

League slug

Body

application/json

Game ID to fetch rules for (required)

gameId
string
required

The game ID to fetch rules for (required)

Response

Successful response

rules
object

Game-specific rules configuration

pointsConfig
object

Points system configuration

timestamp
string<date-time>

Response timestamp (ISO 8601)