Skip to main content
The Ruby SDK is published to RubyGems as teambattles_sdk. It is generated from the OpenAPI spec with Microsoft Kiota and regenerates on every API change.
Ruby is a preview SDK - its Kiota serialization runtime is partially released. See SDKs overview for maturity details.

Install

gem install teambattles_sdk

Authenticated first call

require "teambattles_sdk"

client = TeamBattlesSdk.create_client(ENV.fetch("TEAMBATTLES_API_KEY"))

# List the authenticated user's matches (requires matches.user_matches: read)
body = TeamBattlesSdk::Models::MatchesRequestBody.new
body.num_items = 25
result = client.user.matches.post(body)
(result.page || []).each do |match|
  puts "#{match.id} #{match.status}"
end

Authentication

The factory wires an Authorization: Bearer tb_<your-key> header on every request. Create keys at Settings > Developer and review scopes in the authentication guide. Treat the error machine code in error responses - not the details message - as the stable programmatic contract.