Skip to main content
POST
/
leagues
/
{identifier}
curl -X POST https://teambattles.gg/api/v1/leagues/my-league \
  -H "Authorization: Bearer tb_your_api_key" \
  -H "Content-Type: application/json"
{
  "league": {
    "id": "<string>",
    "name": "<string>",
    "slug": "<string>",
    "description": "<string>",
    "avatarUrl": "<string>",
    "bannerUrl": "<string>",
    "status": "<string>",
    "isVerified": true,
    "isFeatured": true,
    "teamCount": 123,
    "staffCount": 123,
    "games": [
      {}
    ],
    "activeSeasons": [
      {}
    ],
    "socials": {},
    "createdAt": "2023-11-07T05:31:56Z"
  },
  "timestamp": "2023-11-07T05:31:56Z"
}
curl -X POST https://teambattles.gg/api/v1/leagues/my-league \
  -H "Authorization: Bearer tb_your_api_key" \
  -H "Content-Type: application/json"

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 public profile for a specific league, including metadata, team and staff counts, associated games, active seasons, and social links.

Response Fields

FieldTypeDescription
idstringLeague ID
namestringLeague display name
slugstringURL-friendly league identifier
descriptionstringLeague description
avatarUrlstringLeague avatar image URL
bannerUrlstringLeague banner image URL
statusstringLeague status (e.g., active, inactive)
isVerifiedbooleanWhether the league is verified
isFeaturedbooleanWhether the league is featured
teamCountnumberNumber of teams in the league
staffCountnumberNumber of staff members
gamesarrayGames associated with the league
activeSeasonsarrayCurrently active seasons
socialsobjectSocial media links
createdAtstringCreation timestamp (ISO 8601)

Common Use Cases

Get a League’s Public Profile

curl -X POST https://teambattles.gg/api/v1/leagues/pro-cod-league \
  -H "Authorization: Bearer tb_your_api_key"

Check League Status and Team Count

const { league } = await response.json();

if (league.status === "active") {
	console.log(`${league.name} has ${league.teamCount} teams`);
}

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

Response

Successful response

league
object
timestamp
string<date-time>

Response timestamp (ISO 8601)