Skip to content

Commit a0f9747

Browse files
committed
document study creation endpoint
1 parent 092a46d commit a0f9747

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed

doc/specs/lichess-api.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,9 @@ paths:
463463
/api/study/{studyId}.pgn:
464464
$ref: "./tags/studies/api-study-studyId.pgn.yaml"
465465

466+
/api/study:
467+
$ref: "./tags/studies/api-study.yaml"
468+
466469
/api/study/{studyId}/import-pgn:
467470
$ref: "./tags/studies/api-study-studyId-import-pgn.yaml"
468471

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type: string
2+
enum:
3+
- nobody
4+
- owner
5+
- contributor
6+
- member
7+
- everyone
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
post:
2+
operationId: apiStudyPost
3+
summary: Create a new Study
4+
description: |
5+
Create a [study](https://lichess.org/study), and a new empty chapter within it.
6+
tags:
7+
- Studies
8+
security:
9+
- OAuth2: ["study:write"]
10+
requestBody:
11+
description: Parameters of the study
12+
required: true
13+
content:
14+
application/x-www-form-urlencoded:
15+
schema:
16+
type: object
17+
properties:
18+
name:
19+
type: string
20+
description: The study name.
21+
minLength: 2
22+
maxLength: 100
23+
visibility:
24+
type: string
25+
enum: [public, unlisted, private]
26+
default: unlisted
27+
description: |
28+
Who can view the study.
29+
* `public`: Default. Anyone can view the study, it appears on public listings
30+
* `unlisted`: Only people with the link can view the study, it doesn't appear on public listings
31+
* `private`: Only the study members can view the study
32+
computer:
33+
$ref: "../../schemas/StudyUserSelection.yaml"
34+
explorer:
35+
$ref: "../../schemas/StudyUserSelection.yaml"
36+
cloneable:
37+
$ref: "../../schemas/StudyUserSelection.yaml"
38+
shareable:
39+
$ref: "../../schemas/StudyUserSelection.yaml"
40+
chat:
41+
$ref: "../../schemas/StudyUserSelection.yaml"
42+
sticky:
43+
type: string
44+
enum: ["true", "false"]
45+
default: "true"
46+
description: Keep everyone on the same chapter and position
47+
required:
48+
- name
49+
- visibility
50+
- computer
51+
- explorer
52+
- cloneable
53+
- shareable
54+
- chat
55+
responses:
56+
"200":
57+
description: The Study has been successfully created.
58+
headers:
59+
Access-Control-Allow-Origin:
60+
schema:
61+
type: string
62+
default: "'*'"
63+
content:
64+
application/json:
65+
schema:
66+
type: object
67+
properties:
68+
id:
69+
type: string
70+
examples:
71+
default:
72+
value: { "id": "9kze56XR" }
73+
"400":
74+
description: The creation of the Study failed.
75+
content:
76+
application/json:
77+
schema:
78+
$ref: "../../schemas/Error.yaml"

0 commit comments

Comments
 (0)