Skip to main content
The C# SDK is published to NuGet as TeamBattles.Sdk. It is generated from the OpenAPI spec with Microsoft Kiota and regenerates on every API change.

Install

dotnet add package TeamBattles.Sdk

Authenticated first call

using TeamBattles.Sdk;

var client = TeamBattlesClientFactory.Create(Environment.GetEnvironmentVariable("TEAMBATTLES_API_KEY")!);

// List the authenticated user's matches (requires matches.user_matches: read)
var result = await client.User.Matches.PostAsync(new MatchesRequestBody { NumItems = 25 });
foreach (var match in result?.Page ?? [])
{
    Console.WriteLine($"{match.Id} {match.Status}");
}

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.