Skip to main content

Upgrade to Bot Account

Bot accounts must be used with API access tokens and cannot play using the web interface.

POST /api/bot/account/upgrade

Upgrade your account to a bot account. Once upgraded, the account can:
  • Play games using the Bot API
  • Connect to the event stream for incoming challenges
  • Make moves programmatically via API
This action is irreversible. Bot accounts:
  • Cannot play games via the web interface
  • Cannot participate in tournaments (unless specifically for bots)
  • Cannot join teams after upgrading
  • Will be automatically withdrawn from all tournaments and Swiss events

Authentication

Requires OAuth token with bot:play scope.

Request

Response

boolean
Success status

What Happens on Upgrade

  1. Tournament Withdrawal: Automatically withdraws from all active tournaments
  2. Swiss Withdrawal: Withdraws from all Swiss tournaments
  3. Streamer Status: Removes streamer status if present
  4. Team Membership: Existing team memberships remain, but cannot join new teams
  5. Preferences: Bot-specific preferences are applied
  6. User Cache: Light user cache is invalidated

Get Bot Account Info

GET /api/account

Get the profile information for the authenticated bot account.
Avoid polling this endpoint. Use GET /api/stream/event instead to receive real-time updates.

Authentication

Requires OAuth token with any scope.

Request

Response

string
User ID (lowercase username)
string
Display username
string
User title (will be “BOT” for bot accounts)
boolean
Whether the user is currently online
object
Performance ratings for each game variant and time control
integer
Account creation timestamp (milliseconds since epoch)
object
User profile information

Best Practices

Bot Account Guidelines

  1. Fair Play: Ensure your bot follows Lichess Terms of Service
  2. Engine Attribution: Clearly state which engine your bot uses in the profile
  3. Rate Limiting: Respect API rate limits to avoid being throttled
  4. Connection Management: Use persistent connections for event streams
  5. Graceful Shutdown: Handle disconnections and reconnect appropriately

Error Handling

Always check response status codes:
  • 200 - Success
  • 400 - Bad request (e.g., managed account cannot be bot)
  • 401 - Unauthorized (invalid or missing token)
  • 429 - Too many requests (rate limited)

Example: Complete Bot Setup


See Also