|
| 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