Skip to main content

API Keys

All API requests require authentication via an API key passed as a Bearer token in the Authorization header.
curl -H "Authorization: Bearer tb_your_api_key_here" \
  https://teambattles.gg/api/v1/matches

Creating an API Key

  1. Go to Settings > Developer
  2. Click “Create API Key”
  3. Enter a descriptive label (e.g., “Production Server”)
  4. Select the permissions your integration needs
  5. Click “Save” - the full API key is shown only once
Copy your API key immediately after creation. It cannot be retrieved later. If you lose it, you must create a new one.

Permission Scopes

Each API key has granular permissions across four categories:
CategoryScopeValuesDescription
Matchesuser_matchesnone, readAccess your match history
Matchesteam_matchesnone, readAccess team match history
Matchesorg_matchesnone, readAccess organization match history
Connectionsdiscord, twitch, github, battlenetnone, enabledAccess linked platform data
Gamescoresnone, writeSubmit scores via API
Gamelifecyclenone, read, read-writeQuery/manage match lifecycle
Webhooksmanagenone, enabledCreate and manage webhook endpoints
Game API permissions (scores, lifecycle) are only available to approved Game Developers. Webhook management requires General Developer access.

Key Prefix

API keys start with tb_ followed by a random string. When viewing your keys in the dashboard, only the prefix is shown for security.

Error Responses

Authentication and API errors return standard HTTP status codes with a consistent format:
{
  "error": "error_code",
  "details": "Additional information (optional)"
}

Common Error Codes

CodeHTTP StatusDescription
error_api_key_required401No API key provided in Authorization header
error_api_key_invalid401API key is invalid or revoked
error_api_key_permission_denied403API key lacks required permission
error_team_membership_required403User is not an active member of the team
error_org_membership_required403User is not an active member of the organization
error_team_not_found404Team ID or slug not found
error_org_not_found404Organization ID or slug not found
error_invalid_request400Request body or parameters are invalid
error_invalid_cursor400Pagination cursor is invalid or expired
error_invalid_limit400Limit must be between 1 and 100
error_invalid_date_format400Date parameter is not valid ISO 8601
error_internal500Internal server error