Overview
Bots can create challenges to other players, and receive and respond to challenges from other players. Challenges are received through the event stream.Accept a Challenge
POST /api/challenge//accept
Accept an incoming challenge.Authentication
Requires OAuth token withchallenge:write, bot:play, or board:play scope.
Parameters
The challenge ID received from the event stream
Accept the challenge and request a specific color:
white or black. If not specified, color is random.Request
Response
Success status
Rate Limits
Bots can accept challenges but are subject to:- Maximum concurrent games (typically 5 for bots)
- Opponent-specific limits to prevent spam
Decline a Challenge
POST /api/challenge//decline
Decline an incoming challenge.Authentication
Requires OAuth token withchallenge:write, bot:play, or board:play scope.
Parameters
The challenge ID to decline
Reason for declining. Options:
generic- No specific reasonlater- Will play latertooFast- Time control too fasttooSlow- Time control too slowtimeControl- Don’t like the time controlrated- Don’t want to play ratedcasual- Don’t want to play casualstandard- Only play standard chessvariant- Don’t play this variantnoBot- Don’t play with botsonlyBot- Only play with bots
Request
Response
Success status
Cancel a Challenge
POST /api/challenge//cancel
Cancel a challenge that you created.Authentication
Requires OAuth token withchallenge:write, bot:play, or board:play scope.
Parameters
The challenge ID to cancel
OAuth token of the opponent (only needed for special cases)
Request
Response
Create a Challenge
POST /api/challenge/
Challenge another player to a game.Authentication
Requires OAuth token withchallenge:write, bot:play, or board:play scope.
Parameters
Username of the player to challenge
Whether the game should be rated
Clock initial time in seconds (for real-time games)
Clock increment in seconds (for real-time games)
Days per turn (for correspondence games, 1-15)
Your color:
white, black, or randomChess variant:
standardchess960crazyhouseantichessatomichordekingOfTheHillracingKingsthreeCheck
Custom initial position in FEN notation
Keep the stream open to receive challenge status updates
Game rules/modifiers:
noAbort- Players cannot abort the gamenoRematch- Players cannot offer a rematchnoGiveTime- Players cannot give extra timenoClaimWin- Players cannot claim victory when opponent is disconnectednoEarlyDraw- Players cannot offer draw before ply 40
OAuth token of the opponent for instant acceptance
Request
Response
The created challenge
Open Challenge
POST /api/challenge/open
Create an open challenge that anyone can accept. Generates unique URLs for white and black.Open challenges are useful for creating challenge links that can be shared publicly or embedded on websites.
Authentication
Requires OAuth token withchallenge:write scope, or anonymous access for verified users.
Parameters
Same parameters as Create a Challenge, except nousername is needed.
Whether the game should be rated
Clock initial time in seconds
Clock increment in seconds
Days per turn (for correspondence, 1-15)
Chess variant
Custom initial position in FEN
Optional challenge name/description
Game rules (same as regular challenges)
Request
Response
The created challenge
URL for accepting as white
URL for accepting as black
Get Challenge Info
GET /api/challenge//show
Get information about a challenge.Authentication
Requires OAuth token withchallenge:read scope.
Request
List Challenges
GET /api/challenge
List all challenges created by or targeted at the authenticated user.Authentication
Requires OAuth token.Request
Response
Challenges received
Challenges sent
Challenge Handling Best Practices
Auto-Accept Logic
Rate Limiting
Be aware of rate limits:- Bot concurrent games: Typically 5 active games maximum
- Challenge creation: Limited to prevent spam
- Challenge to specific user: Higher rate limit for friends, lower for strangers
Error Handling
Common errors when creating challenges:"No such user"- Username doesn’t exist"User does not follow you"- Required for non-friends in some cases"Cannot challenge yourself"- Self-explanatory"This user does not accept challenges"- User has disabled challenges"Too many requests"- Rate limited
See Also
- Bot Account - Account setup
- Playing Games - Game streaming and moves
- Event Stream - Receive challenge notifications

