Skip to main content
POST
/
leagues
/
{identifier}
/
bans
/
create
curl -X POST https://teambattles.gg/api/v1/leagues/my-league/bans/create \
  -H "Authorization: Bearer tb_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"teamId": "jh7team123", "reason": "Repeated no-shows", "isPermanent": true}'
{
  "success": true,
  "banId": "<string>",
  "timestamp": "<string>"
}

Permission Required

This endpoint requires a league-operator API key bound to this league with the bans league capability, plus the leagueOperatorApi plan feature (api_pro or higher). A free key receives 403 error_api_feature_required.

Access / Membership Rules

You must have a MANAGER or higher role in the league (or be a TeamBattles staff member) to ban a team. If you lack the required access, you’ll receive a 403 error. The {identifier} path parameter is the league slug - the URL-friendly league name (e.g., my-league).

What’s Returned

Bans a team from the league and removes it from active and pending league participation. On success the response is { "success": true, "banId": "<id>", "timestamp": "<ISO 8601>" }.

Request Body

ParameterTypeRequiredDescription
teamIdstringYesTeam ID to ban from the league.
reasonstringYesReason for the ban (1-500 characters).
isPermanentbooleanYesWhether the ban never expires.
expiresAtnumberNoExpiration timestamp for temporary bans, in epoch milliseconds.
curl -X POST https://teambattles.gg/api/v1/leagues/my-league/bans/create \
  -H "Authorization: Bearer tb_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"teamId": "jh7team123", "reason": "Repeated no-shows", "isPermanent": true}'

Authorizations

Authorization
string
header
required

Send your API key as: Authorization: Bearer tb_

Path Parameters

identifier
string
required

League slug or Convex league ID.

Body

application/json

Creates a league team ban.

teamId
string
required

Team ID to ban from the league.

Minimum string length: 1
reason
string
required

Reason for the ban.

Required string length: 1 - 500
isPermanent
boolean
required

Whether the ban never expires.

expiresAt
number

Expiration timestamp for temporary bans, in epoch milliseconds.

Response

The league ban was created.

success
boolean
required
banId
string
required

Created league ban ID.

timestamp
string
required

Response generation time (ISO 8601).