Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions doc/specs/lichess-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ tags:
Works with normal Lichess accounts. Engine play or assistance is [forbidden](https://lichess.org/page/fair-play).

### Features
- [Stream incoming chess moves](#tag/board/get/apiboardgamestreamgameid)
- [Play chess moves](#tag/board/post/apiboardgamegameidmovemove)
- [Read](#tag/board/get/apiboardgamestreamgameid) and [write](#tag/board/post/apiboardgamegameidchat) in the player and spectator chats
- [Receive](#tag/board/get/apistreamevent), [create](#tag/challenges/post/apichallengeusername) and [accept](#tag/challenges/post/apichallengechallengeidaccept) (or [decline](#tag/challenges/post/apichallengechallengeiddecline)) challenges
- [Abort](#tag/board/post/apiboardgamegameidabort) and [resign](#tag/board/post/apiboardgamegameidresign) games
- [Stream incoming chess moves](#tag/board/GET/api/board/game/stream/{gameId})
- [Play chess moves](#tag/board/POST/api/board/game/{gameId}/move/{move})
- [Read](#tag/board/GET/api/board/game/stream/{gameId}) and [write](#tag/board/POST/api/board/game/{gameId}/chat) in the player and spectator chats
- [Receive](#tag/board/GET/api/stream/event), [create](#tag/challenges/POST/api/challenge/{username}) and [accept](#tag/challenges/POST/api/challenge/{challengeId}/accept) (or [decline](#tag/challenges/POST/api/challenge/{challengeId}/decline)) challenges
- [Abort](#tag/board/POST/api/board/game/{gameId}/abort) and [resign](#tag/board/POST/api/board/game/{gameId}/resign) games
- Compatible with normal Lichess accounts

### Restrictions
Expand All @@ -141,14 +141,14 @@ tags:
Play on Lichess as a bot. Allows engine play.
Read the [blog post announcement of lichess bots](https://lichess.org/blog/WvDNticAAMu_mHKP/welcome-lichess-bots).

Only works with [Bot accounts](#tag/bot/post/apibotaccountupgrade).
Only works with [Bot accounts](#tag/bot/POST/api/bot/account/upgrade).

### Features
- [Stream incoming chess moves](#tag/bot/get/apibotgamestreamgameid)
- [Play chess moves](#tag/bot/post/apibotgamegameidmovemove)
- [Read](#tag/bot/get/apibotgamestreamgameid) and [write](#tag/bot/post/apibotgamegameidchat) in the player and spectator chats
- [Receive](#tag/bot/get/apistreamevent), [create](#tag/challenges/post/apichallengeusername) and [accept](#tag/challenges/post/apichallengechallengeidaccept) (or [decline](#tag/challenges/post/apichallengechallengeiddecline)) challenges
- [Abort](#tag/bot/post/apibotgamegameidabort) and [resign](#tag/bot/post/apibotgamegameidresign) games
- [Stream incoming chess moves](#tag/bot/GET/api/bot/game/stream/{gameId})
- [Play chess moves](#tag/bot/POST/api/bot/game/{gameId}/move/{move})
- [Read](#tag/bot/GET/api/bot/game/stream/{gameId}) and [write](#tag/bot/POST/api/bot/game/{gameId}/chat) in the player and spectator chats
- [Receive](#tag/bot/GET/api/stream/event), [create](#tag/challenges/POST/api/challenge/{username}) and [accept](#tag/challenges/POST/api/challenge/{challengeId}/accept) (or [decline](#tag/challenges/POST/api/challenge/{challengeId}/decline)) challenges
- [Abort](#tag/bot/POST/api/bot/game/{gameId}/abort) and [resign](#tag/bot/POST/api/bot/game/{gameId}/resign) games
- Engine assistance is [allowed](https://lichess.org/page/fair-play)
### Restrictions
- Bots can only play challenge games: pools and tournaments are off-limits
Expand All @@ -173,7 +173,7 @@ tags:
[Official broadcasts](https://lichess.org/broadcast) are maintained by Lichess,
but you can [create your own broadcasts](https://lichess.org/broadcast/new) to cover any live game or chess event.
You will need to publish PGN on a public URL so that Lichess can pull updates from it.
Alternatively, you can push PGN updates to Lichess using [this API endpoint](#tag/Broadcasts/operation/broadcastPush).
Alternatively, you can push PGN updates to Lichess using [this API endpoint](#tag/broadcasts/POST/api/broadcast/round/{broadcastRoundId}/push).

Broadcasts are organized in tournaments, which have several rounds, which have several games.
You must first create a tournament, then you can add rounds to them.
Expand All @@ -186,7 +186,7 @@ tags:
description: |
Send and receive challenges to play.

To create a lot of challenges, consider [bulk pairing](#tag/bulk-pairings/post/apibulk-pairing) instead.
To create a lot of challenges, consider [bulk pairing](#tag/bulk-pairings/POST/api/bulk-pairing) instead.
- name: External engine
description: |
**This API is in alpha and subject to change.**
Expand Down Expand Up @@ -802,5 +802,5 @@ components:
"follow:write": Follow and unfollow other players
"msg:write": Send private messages to other players
"board:play": Play with the Board API
"bot:play": Play with the Bot API. Only for [Bot accounts](#tag/bot/post/apibotaccountupgrade)
"bot:play": Play with the Bot API. Only for [Bot accounts](#tag/bot/POST/api/bot/account/upgrade)
"web:mod": Use moderator tools (within the bounds of your permissions)
2 changes: 1 addition & 1 deletion doc/specs/schemas/ExternalEngine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ properties:
type: string
description: |
A secret token that can be used to
[*request* analysis](#tag/External-engine/operation/apiExternalEngineAnalyse)
[*request* analysis](#tag/external-engine/POST/api/external-engine/{id}/analyse)
from this external engine.
userId:
type: string
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/schemas/ExternalEngineRegistration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ properties:
type: string
description: |
A random token that can be used to
[wait for analysis requests](#tag/External-engine/operation/apiExternalEngineAcquire)
[wait for analysis requests](#tag/external-engine/POST/api/external-engine/work)
and provide analysis.

The engine provider should securely generate a random string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ post:
summary: Join an Arena tournament
description: |
Join an Arena tournament, possibly with a password and/or a team.
Also unpauses if you had previously [paused](#tag/arena-tournaments/post/apitournamentidwithdraw) the tournament.
Also unpauses if you had previously [paused](#tag/arena-tournaments/POST/api/tournament/{id}/withdraw) the tournament.
tags:
- "Tournaments (Arena)"
security:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ post:
summary: Update a team battle
description: |
Set the teams and number of leaders of a team battle.
To update the other attributes of a team battle, use the [tournament update endpoint](#tag/arena-tournaments/post/apitournamentid).
To update the other attributes of a team battle, use the [tournament update endpoint](#tag/arena-tournaments/POST/api/tournament/{id}).
tags:
- "Tournaments (Arena)"
security:
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/tags/arenatournaments/api-tournament.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ post:
type: string
description: |
Set the ID of a team you lead to create a team battle.
The other teams can be added using the [team battle edit endpoint](#tag/arena-tournaments/post/apitournamentteam-battleid).
The other teams can be added using the [team battle edit endpoint](#tag/arena-tournaments/POST/api/tournament/team-battle/{id}).
conditions.teamMember.teamId:
type: string
description: |
Expand Down
4 changes: 2 additions & 2 deletions doc/specs/tags/board/api-board-seek.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ post:
If the client closes the connection, the seek is canceled. This way, if the client terminates, the user won't be paired in a game they wouldn't play.
When the seek is accepted, or expires, the server closes the connection.

**Make sure to also have an [Event stream](#tag/board/get/apiboardgamestreamgameid) open**, to be notified when a game starts.
We recommend opening the [Event stream](#tag/board/get/apiboardgamestreamgameid) first, then the seek stream. This way,
**Make sure to also have an [Event stream](#tag/board/GET/api/board/game/stream/{gameId}) open**, to be notified when a game starts.
We recommend opening the [Event stream](#tag/board/GET/api/board/game/stream/{gameId}) first, then the seek stream. This way,
you won't miss the game event if the seek is accepted immediately.

### Correspondence seek
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/tags/bot/api-bot-account-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ post:
To upgrade an account to Bot, use the [official lichess-bot client](https://github.com/lichess-bot-devs/lichess-bot), or follow these steps:
- Create an [API access token](https://lichess.org/account/oauth/token/create?scopes[]=bot:play) with "Play bot moves" permission.
- `curl -d '' https://lichess.org/api/bot/account/upgrade -H "Authorization: Bearer <yourTokenHere>"`
To know if an account has already been upgraded, use the [Get my profile API](#tag/account/get/apiaccount):
To know if an account has already been upgraded, use the [Get my profile API](#tag/account/GET/api/account):
the `title` field should be set to `BOT`.
tags:
- Bot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ get:
Download all games of all rounds of a broadcast in PGN format.
If a `study:read` [OAuth token](#tag/OAuth) is provided,
the private rounds where the user is a contributor will be available.
You may want to [download only the games of a single round](#tag/broadcasts/get/apibroadcastroundbroadcastroundidpgn) instead.
You may want to [download only the games of a single round](#tag/broadcasts/GET/api/broadcast/round/{broadcastRoundId}.pgn) instead.
tags:
- Broadcasts
security:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ get:
Download all games of a single round of a broadcast tournament in PGN format.
You *could* poll this endpoint to get updates about a tournament, but it would be slow,
and very inefficient.
Instead, consider [streaming the tournament](#tag/broadcasts/get/apistreambroadcastroundbroadcastroundidpgn) to get
Instead, consider [streaming the tournament](#tag/broadcasts/GET/api/stream/broadcast/round/{broadcastRoundId}.pgn) to get
a new PGN every time a game is updated, in real-time.
tags:
- Broadcasts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ post:
Create a new broadcast round to relay external games.
This endpoint accepts the same form data as the web form.

Choose one between `syncUrl`, `syncUrls`, `syncIds` and `syncUsers`, if it is missing, the broadcast needs to be fed by [pushing PGN to it](#tag/broadcasts/post/apibroadcastroundbroadcastroundidpush)
Choose one between `syncUrl`, `syncUrls`, `syncIds` and `syncUsers`, if it is missing, the broadcast needs to be fed by [pushing PGN to it](#tag/broadcasts/POST/api/broadcast/round/{broadcastRoundId}/push)
tags:
- Broadcasts
security:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ get:
name: playerId
description: |
The unique player ID within the broadcast. This is usually their fideId.
If the player does not have a fideId, it is their name. Consult the [list of players for the broadcast](#tag/Broadcasts/operation/broadcastPlayersGet) for which ID to use.
If the player does not have a fideId, it is their name. Consult the [list of players for the broadcast](#tag/broadcasts/GET/broadcast/{broadcastTournamentId}/players) for which ID to use.
required: true
schema:
type: string
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/tags/challenges/api-challenge-ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ post:
summary: Challenge the AI
description: |
Start a game with Lichess AI.
You will be notified on the [event stream](#tag/board/get/apiboardgamestreamgameid) that a new game has started.
You will be notified on the [event stream](#tag/board/GET/api/board/game/stream/{gameId}) that a new game has started.
tags:
- Challenges
security:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ post:
summary: Accept a challenge
description: |
Accept an incoming challenge.
You should receive a `gameStart` event on the [incoming events stream](#tag/board/get/apiboardgamestreamgameid).
You should receive a `gameStart` event on the [incoming events stream](#tag/board/GET/api/board/game/stream/{gameId}).
tags:
- Challenges
security:
Expand Down
4 changes: 2 additions & 2 deletions doc/specs/tags/challenges/api-challenge-open.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ post:
instead of the main challenge URL.
Open challenges expire after 24h.
If the challenge creation is [authenticated with OAuth2](/#description/authentication),
then you can use the [challenge cancel endpoint](#tag/challenges/post/apichallengechallengeidcancel) to cancel it.
To directly pair 2 known players, use [this endpoint](#tag/bulk-pairings/get/apibulk-pairing) instead.
then you can use the [challenge cancel endpoint](#tag/challenges/POST/api/challenge/{challengeId}/cancel) to cancel it.
To directly pair 2 known players, use [this endpoint](#tag/bulk-pairings/GET/api/bulk-pairing) instead.
tags:
- Challenges
security: []
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/tags/challenges/api-challenge-username.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ post:
summary: Create a challenge
description: |
Challenge someone to play. The targeted player can choose to accept or decline.
If the challenge is accepted, you will be notified on the [event stream](#tag/board/get/apiboardgamestreamgameid)
If the challenge is accepted, you will be notified on the [event stream](#tag/board/GET/api/board/game/stream/{gameId})
that a new game has started. The game ID will be the same as the challenge ID.
Challenges for realtime games (not correspondence) expire after 20s if not accepted.
To prevent that, use the `keepAliveStream` flag described below.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ post:
have been registered with the given `secret`.
Uses long polling.
After acquiring a request, the provider should immediately
[start streaming the results](#tag/External-engine/operation/apiExternalEngineSubmit).
[start streaming the results](#tag/external-engine/POST/api/external-engine/workid).
requestBody:
description: Provider credentials.
required: true
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/tags/games/api-import.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ post:
description: |
Import a game from PGN. See <https://lichess.org/paste>.
Rate limiting: 200 games per hour for OAuth requests, 100 games per hour for anonymous requests.
To broadcast ongoing games, consider [pushing to a broadcast instead](#tag/broadcasts/post/apibroadcastroundbroadcastroundidpush).
To broadcast ongoing games, consider [pushing to a broadcast instead](#tag/broadcasts/POST/api/broadcast/round/{broadcastRoundId}/push).
To analyse a position or a line, just construct an analysis board URL (most standard tags supported if URL-encoded):
[https://lichess.org/analysis/pgn/e4_e5_Nf3_Nc6_Bc4_Bc5_Bxf7+](https://lichess.org/analysis/pgn/e4_e5_Nf3_Nc6_Bc4_Bc5_Bxf7+)
tags:
Expand Down
4 changes: 2 additions & 2 deletions doc/specs/tags/games/api-stream-games-streamId-add.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ post:
operationId: gamesByIdsAdd
summary: Add game IDs to stream
description: |
Add new game IDs for [an existing stream](#tag/games/post/apistreamgamesstreamid) to watch.
Add new game IDs for [an existing stream](#tag/games/POST/api/stream/games/{streamId}) to watch.
The stream will immediately outputs the games that already exists, then emit an event each time a game is started or finished.
tags:
- Games
Expand All @@ -12,7 +12,7 @@ post:
name: streamId
schema:
type: string
description: The stream ID you used to [create the stream](#tag/games/post/apistreamgamesstreamid).
description: The stream ID you used to [create the stream](#tag/games/POST/api/stream/games/{streamId}).
example: "myAppName-someRandomId"
required: true
requestBody:
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/tags/games/api-stream-games-streamId.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ post:
The stream first outputs the games that already exists, then emits an event each time a game is started or finished.
Games are streamed as [ndjson](#description/streaming-with-nd-json).
Maximum number of games: 500 for anonymous requests, or 1000 for [OAuth2 authenticated](/#description/authentication) requests.
While the stream is open, it is possible to [add new game IDs to watch](#tag/games/post/apistreamgamesstreamidAdd).
While the stream is open, it is possible to [add new game IDs to watch](#tag/games/POST/api/stream/games/{streamId}/add).
tags:
- Games
security: []
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/tags/oauth/oauth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ get:
returned `state` matches the `state` you originally generated.

Finally, continue by using the authorization code to
[obtain an access token](#tag/oauth/post/apitoken).
[obtain an access token](#tag/oauth/POST/api/token).
parameters:
- in: query
name: response_type
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/tags/puzzles/api-puzzle-batch-angle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ post:
description: |
When > 0, the response includes a new puzzle batch with that many puzzles.

This is equivalent to calling [/api/puzzle/batch/{angle}](#tag/Puzzles/operation/apiPuzzleBatchSelect),
This is equivalent to calling [/api/puzzle/batch/{angle}](#tag/puzzles/GET/api/puzzle/batch/{angle}),
and can sometimes save a request.
schema:
type: integer
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/tags/swisstournaments/api-swiss-id-edit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ post:
type: integer
description: |
How long to wait between each round, in seconds.
Set to 99999999 to manually schedule each round from the tournament UI, or [with the API](#tag/Swiss-tournaments/operation/apiSwissScheduleNextRound).
Set to 99999999 to manually schedule each round from the tournament UI, or [with the API](#tag/tournaments-swiss/POST/api/swiss/{id}/schedule-next-round).
If empty or -1, a sensible value is picked automatically.
enum:
- -1
Expand Down