Studies

Import PGN into a study

Changed on

Imports arbitrary PGN into an existing study. Creates a new chapter in the study. If the PGN contains multiple games (separated by 2 or more newlines) then multiple chapters will be created within the study. Note that a study can contain at most 64 chapters.

post/api/study/{studyId}/import-pgn

Request

  • Base URL
    https://lichess.org
  • URL
    https://lichess.org/api/study/{studyId}/import-pgn
  • Auth
    OAuth 2
    Authorization code: https://lichess.org/oauth
    Token URL: https://lichess.org/api/token scopes: study:write

Path parameters

studyIdstring required

ID of the study

Request body application/x-www-form-urlencoded

pgnstring required

PGN to import. Can contain multiple games separated by 2 or more newlines.

namestring

Name of the new chapter. If not specified, or if multiple chapters are created, the names will be inferred from the PGN tags.

orientation'white' | 'black'

Board orientation. If not specified, the orientation is automatically determined.

variant'standard' | 'chess960' | 'crazyhouse' | 'antichess' | 'atomic' | 'horde' | 'kingOfTheHill' | 'racingKings' | 'threeCheck' | 'fromPosition'
mode'practice' | 'conceal' | 'gamebook'

Analysis mode. If not specified, Normal analysis.

  • practice - Practise with Computer
  • conceal - Hide next moves
  • gamebook - Interactive lesson

Response

The chapters that were created.

errorstring nullable

An error message, if some of the games could not be imported.

Changes