Challonge API Docs
  1. API v2.1
Challonge API Docs
  • Guides
    • Welcome
    • Changelog
    • Upgrading
      • Upgrading from v2.0 to v2.1
    • Sample Use Cases
      • Running a Two-Stage Tournament
    • Challonge Connect
      • About
      • Game Integration (beta)
      • Connect Request Signing
  • API v2.1
    • Getting Started
    • Authorization
    • Error Responses
    • Resource Scoping
    • OAuth
      • Scopes
      • Grant Request
      • Token Request
      • Refresh Token Request
      • Device Grant Authorization Request
      • Device Grant Access Token Request
    • Tournament API
      • Tournaments
        • Tournament States
        • List Tournaments
        • Create Tournament
        • Get Tournament
        • Update Tournament
        • Delete Tournament
        • Change Tournament State
      • Participants
        • List Participants
        • Create Participant
        • Get Participant
        • Update Participant
        • Delete Participant
        • Bulk Create Participants
        • Clear All Participants
        • Randomize Participants
        • Register Me
      • Matches
        • List Matches
        • Get Match
        • Update Match
        • Change Match State
      • Match Attachments
        • List Match Attachments
        • Create Match Attachment
        • Delete Match Attachment
    • Race API
      • Races
        • List Races
        • Create Race
        • Get Race
        • Update Race
        • Delete Race
        • Change Race State
      • Rounds
        • List Rounds
        • Get Round
        • Update Round
      • Elapsed Times
        • List Elapsed Times
        • Get Elapsed Time
        • Update Elapsed Time
        • Bulk Update Elapsed Times
    • Get User
      GET
    • List Communities
      GET
    • Schemas
      • MatchAttachmentModel
      • MatchAttachmentInput
      • MatchAttachmentOutput
      • MatchAttachment
      • ParticipantModel
      • ParticipantOutput
      • ParticipantInput
      • ParticipantBulkInput
      • Participant
      • TournamentModel
      • TournamentInput
      • Tournament
      • TournamentStateInput
      • CommunityModel
      • Community
      • MatchModel
      • MatchInput
      • MatchOutput
      • Match
      • MatchStateInput
      • ErrorModel
      • UserModel
      • User
      • ElapsedTimeBulkInput
      • ElapsedTimeWithID
      • ElapsedTimeOutput
      • ElaspedTimeInput
      • Timestamps
      • RelationshipLink
      • RoundOutput
      • RoundStateInput
      • RacingOutput
      • RacingInput
      • RacingStateInput
  • Bracket JSAPI v1.0
    • Getting Started
    • Broadcasted Events
    • API Actions
      • scrollToCoordinates
      • scrollToMatchIdentifier
      • setZoomScale
      • zoomToCoordinate
      • zoomToMatchIdentifier
      • loadTheme
      • filterRounds
      • loadIntegrationData
      • setBracketSettings
  • API v2.0 (deprecated)
    • About
    • Deprecated Endpoints
      • Tournament
        • findTournaments
        • createTournament
        • showTournament
        • updateTournament
        • deleteTournament
        • changeStateTournament
      • Match
        • findMatches
        • showMatch
        • updateMatch
        • changeStateTournament
      • Participant
        • findParticipants
        • createParticipant
        • showParticipant
        • updateParticipant
        • deleteParticipant
        • bulkCreateParticipant
        • clearAllParticipants
        • randomizeParticipants
      • Match Attachment
        • findMatchAttachments
        • createMatchAttachments
        • deleteMatchAttachment
      • Race
        • findRaces
        • createRace
        • showRace
        • updateRace
        • deleteRace
        • changeStateRace
      • Round
        • findRounds
        • showRound
        • updateRound
      • Elapsed Time
        • findElapsedTime
        • showElapsedTime
        • updateElapsedTime
        • bulkUpdateElapsedTime
      • User
        • findUser
        • findCommunities
    • Schemas
      • MatchAttachmentModel
      • MatchAttachmentInput
      • MatchAttachmentOutput
      • MatchAttachment
      • ParticipantModel
      • ParticipantOutput
      • ParticipantInput
      • ParticipantBulkInput
      • Participant
      • TournamentModel
      • TournamentInput
      • Tournament
      • TournamentStateInput
      • CommunityModel
      • Community
      • MatchModel
      • MatchInput
      • MatchOutput
      • Match
      • MatchStateInput
      • ErrorModel
      • UserModel
      • User
      • ElapsedTimeBulkInput
      • ElapsedTimeWithID
      • ElapsedTimeOutput
      • ElaspedTimeInput
      • Timestamps
      • RelationshipLink
      • RoundOutput
      • RoundStateInput
      • RacingOutput
      • RacingInput
      • RacingStateInput
  • API v1 (deprecated)
    • About
    • Deprecated Endpoints
      • Tournaments
        • List tournaments
        • Create a tournament
        • Get a tournament
        • Update a tournament
        • Delete a tournament
        • Process check-in results for a tournament
        • Abort check-in for a tournament
        • Start a tournament
        • Finalize a tournament
        • Reset a tournament
        • Open for predictions
      • Participants
        • List a tournament's participants
        • Create a participant
        • Bulk create participants
        • Get a participant
        • Update a participant
        • Check in a participant
        • Undo check-in for a participant
        • Delete/deactivate a participant
        • Clear/delete all participants
        • Randomize a tournament's participants
      • Matches
        • List a tournament's matches
        • Get a match
        • Update a match
        • Reopen a match
        • Mark a match as underway
        • Unmark a match as underway
      • Match Attachments
        • List a match's attachments
        • Create a match attachment
        • Get a match attachment
        • Update a match attachment
        • Delete a match attachment
  1. API v2.1

Authorization

A big change from version 1 of our API is the addition of OAuth. This allows you to build an application that can perform actions on behalf of a Challonge user. You can fetch their tournaments, create tournaments on their behalf, report scores for them, etc. Best of all, we support OAuth flows that accommodate just about any application.

Option 1: OAuth#

Once you optain an access token using one of the OAuth flows below, use the following headers with your API requests:
image.png

Option 2: API v1 Key#

If you’re migrating from API v1 or only need authorization on behalf of your own account, you can consider using an API v1 key. To issue an APIv1 key, go to https://challonge.com/settings/developer
For v1 authorization, set the Authorization-Type header to v1, and the Authorization header to your APIv1 key:
image.png

OAuth Flows#

1. Authorization Code Flow#

grant_type = "authorization_code"
The OAuth authorization code flow is a secure method for a client application to access a user's protected resources by first getting an authorization code and then exchanging it for an access token. This allows you to perform actions on behalf of another user (e.g. create a tournament with the user as the organizer).
💡 Use case: for websites or apps on platforms with web browsers - gain authorization from Challonge users to make requests on their behalf. This is akin to signing in to a service with Facebook or Discord.
The following diagram illustrates the OAuth Authorization Code Flow with Challonge:
+--------+                                           +---------------+
|        |--(A)------- Authorization Grant --------->|               |
|        |                                           |               |
|        |<-(B)----------- Access Token -------------|               |
|        |               & Refresh Token             |               |
|        |                                           |               |
|        |                            +----------+   |               |
|        |--(C)---- Access Token ---->|          |   |               |
|        |                            |          |   |               |
| Your   |<-(D)- Protected Resource --| Challonge|   |  Challonge    |
| Server |                            | Resource |   |  Auth Server  |
|        |--(E)---- Access Token ---->| Server   |   |               |
|        |                            |          |   |               |
|        |<-(F)- Invalid Token Error -|          |   |               |
|        |                            +----------+   |               |
|        |                                           |               |
|        |--(G)----------- Refresh Token ----------->|               |
|        |                                           |               |
|        |<-(H)----------- Access Token -------------|               |
+--------+           & Optional Refresh Token        +---------------+
Challonge access tokens have a 1-week expiration, but refresh tokens are supported. After authorizing with OAuth (/oauth/authorize) and getting a code, use that code to request a token (/oauth/token). The token response will include both an access token and a refresh token similar to this format:
{
  "access_token"=>"accesstokenhere",
  "token_type"=>"Bearer",
  "expires_in"=>604800,
  "refresh_token"=>"refreshtokenhere",
  "scope"=>"me tournaments:read tournaments:write matches:read matches:write participants:read participants:write",
  "created_at"=>1623246724
}
So, you'll need to store both tokens to avoid having to authorize again. Once your access token fails, you can use the refresh token to get a new access token (/oauth/token with these params: {"grant_type": "refresh_token", refresh_token: "your_refresh_token"}).
The following Ruby script demonstrates how to authorize, request tokens (grant type "authorization_code"), and request new tokens using a refresh token (grant type "refresh_token"):

2. Device Authorization Grant Flow#

grant_type = "device_code"
The OAuth device authorization grant (formerly known as the Device Flow) is an OAuth 2.0 extension that enables devices with no browser or limited input capability to obtain an access token. This is commonly seen on TV apps.
💡 Use case: for a video game or physical console like an electronic dart board, prompt the user to scan a QR code to have them sign in to Challonge from their phone. Once signed in and authorized to share access to your app, make API requests on their behalf to populate UIs within your system.
This flow involves requesting a device code and polling for an access token while waiting for the user to authenticate from a phone or PC. Here's an in-game example that illustrates the process:
image.png
Once the user signs in from their phone or other web browser, your game is issued an access token for that user. As shown below, the game gets an access token and displays the user’s information. The game UI can then show the user’s tournaments, allow them to start tournaments, and even automatically report scores to facilitate the tournaments.
image.png

3. Client Credentials Flow#

Examples:
Manage tournaments organized by the application's owner or a community owned by the application's owner.
Fetch all tournaments created by users of your application (created via the Authorization Code flow above), publish validated match results for your game.
With OAuth, once someone gives you permission to create tournaments on their behalf, you'll likely want a way to aggregate all of those tournaments. A common use case is in a game. Imagine you created a Challonge developer application for use in the game. Users can create tournaments in-game once they complete OAuth with your developer application. While these tournaments will all have different organizers, they maintain a link to your developer application. If you want to list all of these tournaments in-game, you'll need to use the client credentials flow to gain access to application-scoped API routes (e.g. /application/tournaments.json).
Modified at 2025-11-03 21:51:31
Previous
Getting Started
Next
Error Responses
Built with