]>
Commit | Line | Data |
---|---|---|
1569a818 DG |
1 | swagger: '2.0' |
2 | info: | |
5e1c08eb | 3 | title: PeerTube |
164e6c87 | 4 | version: 1.0.0-beta |
1569a818 | 5 | description: Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular. |
ea65a476 | 6 | host: peertube.example.com |
94ff4c23 C |
7 | securityDefinitions: |
8 | OAuth2: | |
9 | description: 'In the header: *Authorization: Bearer mytoken*' | |
10 | type: oauth2 | |
11 | flow: password | |
12 | # Not implemented yet | |
13 | # authorizationUrl: https://example.com/oauth/authorize | |
14 | tokenUrl: https://peertube.example.com/api/v1/users/token | |
ea65a476 C |
15 | basePath: '/api/v1' |
16 | schemes: | |
17 | - https | |
1569a818 | 18 | paths: |
ad9e39fb | 19 | '/accounts/{name}': |
1569a818 DG |
20 | get: |
21 | tags: | |
22 | - Accounts | |
23 | consumes: | |
24 | - application/json | |
25 | produces: | |
26 | - application/json | |
27 | parameters: | |
330eaf12 C |
28 | - $ref: "accounts.yaml#/parameters/name" |
29 | - $ref: "commons.yaml#/parameters/start" | |
30 | - $ref: "commons.yaml#/parameters/count" | |
31 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
32 | responses: |
33 | '200': | |
34 | description: successful operation | |
35 | schema: | |
36 | $ref: '#/definitions/Account' | |
ad9e39fb | 37 | '/accounts/{name}/videos': |
6b738c7a C |
38 | get: |
39 | tags: | |
40 | - Accounts | |
41 | consumes: | |
42 | - application/json | |
43 | produces: | |
44 | - application/json | |
45 | parameters: | |
330eaf12 | 46 | - $ref: "accounts.yaml#/parameters/name" |
6b738c7a C |
47 | responses: |
48 | '200': | |
49 | description: successful operation | |
50 | schema: | |
51 | $ref: '#/definitions/Video' | |
1569a818 DG |
52 | /accounts: |
53 | get: | |
54 | tags: | |
55 | - Accounts | |
56 | consumes: | |
57 | - application/json | |
58 | produces: | |
59 | - application/json | |
60 | responses: | |
61 | '200': | |
62 | description: successful operation | |
63 | schema: | |
64 | type: array | |
65 | items: | |
66 | $ref: '#/definitions/Account' | |
67 | /config: | |
68 | get: | |
69 | tags: | |
70 | - Config | |
71 | consumes: | |
72 | - application/json | |
73 | produces: | |
74 | - application/json | |
75 | responses: | |
76 | '200': | |
77 | description: successful operation | |
78 | schema: | |
5d00a3d7 | 79 | $ref: '#/definitions/ServerConfig' |
244e76a5 RK |
80 | /feeds/videos.{format}: |
81 | get: | |
82 | tags: | |
83 | - Feeds | |
244e76a5 | 84 | produces: |
9d3ef9fe C |
85 | - application/atom+xml |
86 | - application/rss+xml | |
244e76a5 RK |
87 | - application/json |
88 | parameters: | |
89 | - name: format | |
90 | in: path | |
91 | required: true | |
92 | type: string | |
48dce1c9 | 93 | enum: [ 'xml', 'atom', 'json'] |
244e76a5 RK |
94 | default: 'xml' |
95 | description: 'The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and json to JSON FEED 1.0' | |
96 | - name: accountId | |
97 | in: query | |
98 | required: false | |
99 | type: number | |
100 | description: 'The id of the local account to filter to (beware, users IDs and not actors IDs which will return empty feeds' | |
101 | - name: accountName | |
102 | in: query | |
103 | required: false | |
104 | type: string | |
105 | description: 'The name of the local account to filter to' | |
106 | responses: | |
107 | '200': | |
108 | description: successful operation | |
1569a818 DG |
109 | /jobs: |
110 | get: | |
94ff4c23 C |
111 | security: |
112 | - OAuth2: [ ] | |
1569a818 DG |
113 | tags: |
114 | - Job | |
115 | consumes: | |
116 | - application/json | |
117 | produces: | |
118 | - application/json | |
44cb3b85 DG |
119 | parameters: |
120 | - name: state | |
121 | in: path | |
122 | required: true | |
123 | type: string | |
330eaf12 C |
124 | description: 'The state of the job' |
125 | - $ref: "commons.yaml#/parameters/start" | |
126 | - $ref: "commons.yaml#/parameters/count" | |
127 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
128 | responses: |
129 | '200': | |
130 | description: successful operation | |
131 | schema: | |
132 | type: array | |
133 | items: | |
5d00a3d7 | 134 | $ref: '#/definitions/Job' |
1569a818 DG |
135 | '/server/following/{host}': |
136 | delete: | |
94ff4c23 C |
137 | security: |
138 | - OAuth2: [ ] | |
1569a818 DG |
139 | tags: |
140 | - ServerFollowing | |
141 | consumes: | |
142 | - application/json | |
143 | produces: | |
144 | - application/json | |
145 | parameters: | |
146 | - name: host | |
147 | in: path | |
148 | required: true | |
149 | type: string | |
150 | description: 'The host to unfollow ' | |
151 | responses: | |
152 | '201': | |
153 | description: successful operation | |
154 | /server/followers: | |
155 | get: | |
156 | tags: | |
157 | - ServerFollowing | |
158 | consumes: | |
159 | - application/json | |
160 | produces: | |
161 | - application/json | |
44cb3b85 | 162 | parameters: |
330eaf12 C |
163 | - $ref: "commons.yaml#/parameters/start" |
164 | - $ref: "commons.yaml#/parameters/count" | |
165 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
166 | responses: |
167 | '200': | |
168 | description: successful operation | |
169 | schema: | |
170 | type: array | |
171 | items: | |
172 | $ref: '#/definitions/Follow' | |
173 | /server/following: | |
174 | get: | |
175 | tags: | |
176 | - ServerFollowing | |
177 | consumes: | |
178 | - application/json | |
179 | produces: | |
180 | - application/json | |
44cb3b85 | 181 | parameters: |
330eaf12 C |
182 | - $ref: "commons.yaml#/parameters/start" |
183 | - $ref: "commons.yaml#/parameters/count" | |
184 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
185 | responses: |
186 | '200': | |
187 | description: successful operation | |
188 | schema: | |
189 | type: array | |
190 | items: | |
191 | $ref: '#/definitions/Follow' | |
192 | post: | |
94ff4c23 C |
193 | security: |
194 | - OAuth2: [ ] | |
1569a818 DG |
195 | tags: |
196 | - ServerFollowing | |
197 | consumes: | |
198 | - application/json | |
199 | produces: | |
200 | - application/json | |
201 | parameters: | |
202 | - in: body | |
203 | name: body | |
204 | schema: | |
205 | $ref: '#/definitions/Follow' | |
206 | responses: | |
207 | '204': | |
330eaf12 | 208 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 DG |
209 | /users: |
210 | post: | |
94ff4c23 C |
211 | security: |
212 | - OAuth2: [ ] | |
1569a818 DG |
213 | tags: |
214 | - User | |
215 | consumes: | |
216 | - application/json | |
217 | produces: | |
218 | - application/json | |
219 | parameters: | |
220 | - in: body | |
221 | name: body | |
222 | required: true | |
61b66b36 | 223 | description: 'User to create' |
1569a818 DG |
224 | schema: |
225 | $ref: '#/definitions/AddUser' | |
226 | responses: | |
227 | '200': | |
228 | description: successful operation | |
229 | schema: | |
230 | $ref: '#/definitions/AddUserResponse' | |
231 | get: | |
94ff4c23 C |
232 | security: |
233 | - OAuth2: [ ] | |
1569a818 DG |
234 | tags: |
235 | - User | |
236 | consumes: | |
237 | - application/json | |
238 | produces: | |
239 | - application/json | |
44cb3b85 | 240 | parameters: |
330eaf12 C |
241 | - $ref: "commons.yaml#/parameters/start" |
242 | - $ref: "commons.yaml#/parameters/count" | |
243 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
244 | responses: |
245 | '200': | |
246 | description: successful operation | |
247 | schema: | |
248 | type: array | |
249 | items: | |
250 | $ref: '#/definitions/User' | |
251 | '/users/{id}': | |
252 | delete: | |
94ff4c23 C |
253 | security: |
254 | - OAuth2: [ ] | |
1569a818 DG |
255 | tags: |
256 | - User | |
257 | consumes: | |
258 | - application/json | |
259 | produces: | |
260 | - application/json | |
261 | parameters: | |
330eaf12 | 262 | - $ref: "users.yaml#/parameters/id" |
1569a818 DG |
263 | responses: |
264 | '204': | |
330eaf12 | 265 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 | 266 | get: |
94ff4c23 C |
267 | security: |
268 | - OAuth2: [ ] | |
1569a818 DG |
269 | tags: |
270 | - User | |
271 | consumes: | |
272 | - application/json | |
273 | produces: | |
274 | - application/json | |
275 | parameters: | |
330eaf12 | 276 | - $ref: "users.yaml#/parameters/id" |
1569a818 DG |
277 | responses: |
278 | '200': | |
279 | description: successful operation | |
280 | schema: | |
281 | $ref: '#/definitions/User' | |
282 | put: | |
94ff4c23 C |
283 | security: |
284 | - OAuth2: [ ] | |
1569a818 DG |
285 | tags: |
286 | - User | |
287 | consumes: | |
288 | - application/json | |
289 | produces: | |
290 | - application/json | |
291 | parameters: | |
330eaf12 | 292 | - $ref: "users.yaml#/parameters/id" |
1569a818 DG |
293 | - in: body |
294 | name: body | |
295 | required: true | |
296 | schema: | |
297 | $ref: '#/definitions/UpdateUser' | |
298 | responses: | |
299 | '204': | |
330eaf12 | 300 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 DG |
301 | /users/me: |
302 | get: | |
94ff4c23 C |
303 | security: |
304 | - OAuth2: [ ] | |
1569a818 DG |
305 | tags: |
306 | - User | |
307 | consumes: | |
308 | - application/json | |
309 | produces: | |
310 | - application/json | |
311 | responses: | |
312 | '200': | |
313 | description: successful operation | |
314 | schema: | |
315 | type: array | |
316 | items: | |
317 | $ref: '#/definitions/User' | |
318 | put: | |
94ff4c23 C |
319 | security: |
320 | - OAuth2: [ ] | |
1569a818 DG |
321 | tags: |
322 | - User | |
323 | consumes: | |
324 | - application/json | |
325 | produces: | |
326 | - application/json | |
327 | parameters: | |
328 | - in: body | |
329 | name: body | |
330 | required: true | |
331 | schema: | |
332 | $ref: '#/definitions/UpdateMe' | |
333 | responses: | |
334 | '204': | |
330eaf12 | 335 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 DG |
336 | /users/me/video-quota-used: |
337 | get: | |
94ff4c23 C |
338 | security: |
339 | - OAuth2: [ ] | |
1569a818 DG |
340 | tags: |
341 | - User | |
342 | consumes: | |
343 | - application/json | |
344 | produces: | |
345 | - application/json | |
346 | parameters: [] | |
347 | responses: | |
348 | '200': | |
349 | description: successful operation | |
350 | schema: | |
351 | type: number | |
352 | '/users/me/videos/{videoId}/rating': | |
353 | get: | |
94ff4c23 C |
354 | security: |
355 | - OAuth2: [ ] | |
1569a818 DG |
356 | tags: |
357 | - User | |
358 | consumes: | |
359 | - application/json | |
360 | produces: | |
361 | - application/json | |
362 | parameters: | |
363 | - name: videoId | |
364 | in: path | |
365 | required: true | |
366 | type: string | |
367 | description: 'The video id ' | |
368 | responses: | |
369 | '200': | |
370 | description: successful operation | |
371 | schema: | |
372 | $ref: '#/definitions/GetMeVideoRating' | |
373 | /users/me/videos: | |
374 | get: | |
94ff4c23 C |
375 | security: |
376 | - OAuth2: [ ] | |
1569a818 DG |
377 | tags: |
378 | - User | |
379 | consumes: | |
380 | - application/json | |
381 | produces: | |
382 | - application/json | |
44cb3b85 | 383 | parameters: |
330eaf12 C |
384 | - $ref: "commons.yaml#/parameters/start" |
385 | - $ref: "commons.yaml#/parameters/count" | |
386 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
387 | responses: |
388 | '200': | |
389 | description: successful operation | |
390 | schema: | |
391 | type: array | |
392 | items: | |
393 | $ref: '#/definitions/Video' | |
394 | /users/register: | |
395 | post: | |
396 | tags: | |
397 | - User | |
398 | consumes: | |
399 | - application/json | |
400 | produces: | |
401 | - application/json | |
402 | parameters: | |
403 | - in: body | |
404 | name: body | |
405 | required: true | |
406 | schema: | |
407 | $ref: '#/definitions/RegisterUser' | |
408 | responses: | |
409 | '204': | |
330eaf12 | 410 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 DG |
411 | /users/me/avatar/pick: |
412 | post: | |
94ff4c23 C |
413 | security: |
414 | - OAuth2: [ ] | |
1569a818 DG |
415 | tags: |
416 | - User | |
417 | consumes: | |
418 | - multipart/form-data | |
419 | produces: | |
420 | - application/json | |
421 | parameters: | |
422 | - in: formData | |
423 | name: avatarfile | |
424 | type: file | |
425 | description: The file to upload. | |
426 | responses: | |
427 | '200': | |
428 | description: successful operation | |
429 | schema: | |
430 | $ref: '#/definitions/Avatar' | |
c360c494 | 431 | /videos: |
1569a818 DG |
432 | get: |
433 | tags: | |
434 | - Video | |
435 | consumes: | |
436 | - application/json | |
437 | produces: | |
438 | - application/json | |
44cb3b85 | 439 | parameters: |
61b909b9 P |
440 | - name: category |
441 | in: query | |
442 | required: false | |
443 | type: number | |
444 | description: category id of the video | |
330eaf12 C |
445 | - $ref: "commons.yaml#/parameters/start" |
446 | - $ref: "commons.yaml#/parameters/count" | |
447 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
448 | responses: |
449 | '200': | |
450 | description: successful operation | |
451 | schema: | |
452 | type: array | |
453 | items: | |
454 | $ref: '#/definitions/Video' | |
c360c494 | 455 | /videos/categories: |
1569a818 DG |
456 | get: |
457 | tags: | |
458 | - Video | |
459 | consumes: | |
460 | - application/json | |
461 | produces: | |
462 | - application/json | |
463 | responses: | |
464 | '200': | |
465 | description: successful operation | |
466 | schema: | |
467 | type: array | |
468 | items: | |
469 | type: string | |
c360c494 | 470 | /videos/licences: |
1569a818 DG |
471 | get: |
472 | tags: | |
473 | - Video | |
474 | consumes: | |
475 | - application/json | |
476 | produces: | |
477 | - application/json | |
478 | responses: | |
479 | '200': | |
480 | description: successful operation | |
481 | schema: | |
482 | type: array | |
483 | items: | |
484 | type: string | |
c360c494 | 485 | /videos/languages: |
1569a818 DG |
486 | get: |
487 | tags: | |
488 | - Video | |
489 | consumes: | |
490 | - application/json | |
491 | produces: | |
492 | - application/json | |
493 | responses: | |
494 | '200': | |
495 | description: successful operation | |
496 | schema: | |
497 | type: array | |
498 | items: | |
499 | type: string | |
c360c494 | 500 | /videos/privacies: |
1569a818 DG |
501 | get: |
502 | tags: | |
503 | - Video | |
504 | consumes: | |
505 | - application/json | |
506 | produces: | |
507 | - application/json | |
508 | responses: | |
509 | '200': | |
510 | description: successful operation | |
511 | schema: | |
512 | type: array | |
513 | items: | |
514 | type: string | |
c360c494 | 515 | /videos/search: |
1569a818 DG |
516 | get: |
517 | tags: | |
518 | - Video | |
519 | consumes: | |
520 | - application/json | |
521 | produces: | |
522 | - application/json | |
44cb3b85 | 523 | parameters: |
330eaf12 C |
524 | - $ref: "commons.yaml#/parameters/start" |
525 | - $ref: "commons.yaml#/parameters/count" | |
526 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
527 | responses: |
528 | '200': | |
529 | description: successful operation | |
530 | schema: | |
531 | type: array | |
532 | items: | |
533 | $ref: '#/definitions/Video' | |
c360c494 | 534 | "/videos/{id}": |
1569a818 | 535 | put: |
94ff4c23 C |
536 | security: |
537 | - OAuth2: [ ] | |
1569a818 DG |
538 | tags: |
539 | - Video | |
540 | consumes: | |
61b66b36 | 541 | - multipart/form-data |
1569a818 DG |
542 | produces: |
543 | - application/json | |
544 | parameters: | |
330eaf12 C |
545 | - $ref: "videos.yaml#/parameters/id" |
546 | - $ref: "videos.yaml#/parameters/thumbnailfile" | |
547 | - $ref: "videos.yaml#/parameters/previewfile" | |
548 | - $ref: "videos.yaml#/parameters/category" | |
549 | - $ref: "videos.yaml#/parameters/licence" | |
550 | - $ref: "videos.yaml#/parameters/language" | |
551 | - $ref: "videos.yaml#/parameters/description" | |
552 | - $ref: "videos.yaml#/parameters/waitTranscoding" | |
553 | - $ref: "videos.yaml#/parameters/support" | |
554 | - $ref: "videos.yaml#/parameters/nsfw" | |
555 | - $ref: "videos.yaml#/parameters/name" | |
556 | - $ref: "videos.yaml#/parameters/tags" | |
557 | - $ref: "videos.yaml#/parameters/commentsEnabled" | |
558 | - $ref: "videos.yaml#/parameters/privacy" | |
559 | - $ref: "videos.yaml#/parameters/scheduleUpdate" | |
1569a818 DG |
560 | responses: |
561 | '200': | |
562 | description: successful operation | |
563 | schema: | |
564 | $ref: '#/definitions/Video' | |
565 | get: | |
566 | tags: | |
567 | - Video | |
568 | consumes: | |
569 | - application/json | |
570 | produces: | |
571 | - application/json | |
572 | parameters: | |
330eaf12 | 573 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
574 | responses: |
575 | '200': | |
576 | description: successful operation | |
577 | schema: | |
578 | $ref: '#/definitions/Video' | |
579 | delete: | |
94ff4c23 C |
580 | security: |
581 | - OAuth2: [ ] | |
1569a818 DG |
582 | tags: |
583 | - Video | |
584 | consumes: | |
585 | - application/json | |
586 | produces: | |
587 | - application/json | |
588 | parameters: | |
330eaf12 | 589 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
590 | responses: |
591 | '204': | |
330eaf12 | 592 | $ref: "commons.yaml#/responses/emptySuccess" |
c360c494 | 593 | "/videos/{id}/description": |
1569a818 DG |
594 | get: |
595 | tags: | |
596 | - Video | |
597 | consumes: | |
598 | - application/json | |
599 | produces: | |
600 | - application/json | |
601 | parameters: | |
330eaf12 | 602 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
603 | responses: |
604 | '200': | |
605 | description: successful operation | |
606 | schema: | |
607 | type: string | |
c360c494 | 608 | "/videos/{id}/views": |
1569a818 DG |
609 | post: |
610 | tags: | |
611 | - Video | |
612 | consumes: | |
613 | - application/json | |
614 | produces: | |
615 | - application/json | |
616 | parameters: | |
330eaf12 | 617 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
618 | responses: |
619 | '204': | |
330eaf12 | 620 | $ref: "commons.yaml#/responses/emptySuccess" |
c360c494 | 621 | /videos/upload: |
1569a818 | 622 | post: |
94ff4c23 C |
623 | security: |
624 | - OAuth2: [ ] | |
1569a818 DG |
625 | tags: |
626 | - Video | |
627 | consumes: | |
628 | - multipart/form-data | |
629 | produces: | |
630 | - application/json | |
631 | parameters: | |
61b66b36 C |
632 | - name: videofile |
633 | in: formData | |
1569a818 | 634 | type: file |
61b66b36 C |
635 | required: true |
636 | description: 'Video file' | |
61b66b36 C |
637 | - name: channelId |
638 | in: formData | |
639 | required: true | |
640 | type: number | |
641 | description: 'Channel id that will contain this video' | |
330eaf12 C |
642 | - $ref: "videos.yaml#/parameters/thumbnailfile" |
643 | - $ref: "videos.yaml#/parameters/previewfile" | |
644 | - $ref: "videos.yaml#/parameters/category" | |
645 | - $ref: "videos.yaml#/parameters/licence" | |
646 | - $ref: "videos.yaml#/parameters/language" | |
647 | - $ref: "videos.yaml#/parameters/description" | |
648 | - $ref: "videos.yaml#/parameters/waitTranscoding" | |
649 | - $ref: "videos.yaml#/parameters/support" | |
650 | - $ref: "videos.yaml#/parameters/nsfw" | |
651 | - $ref: "videos.yaml#/parameters/name" | |
652 | - $ref: "videos.yaml#/parameters/tags" | |
653 | - $ref: "videos.yaml#/parameters/commentsEnabled" | |
654 | - $ref: "videos.yaml#/parameters/privacy" | |
655 | - $ref: "videos.yaml#/parameters/scheduleUpdate" | |
1569a818 DG |
656 | responses: |
657 | '200': | |
658 | description: successful operation | |
659 | schema: | |
660 | $ref: '#/definitions/VideoUploadResponse' | |
c360c494 | 661 | /videos/abuse: |
1569a818 | 662 | get: |
94ff4c23 C |
663 | security: |
664 | - OAuth2: [ ] | |
1569a818 DG |
665 | tags: |
666 | - VideoAbuse | |
667 | consumes: | |
668 | - application/json | |
669 | produces: | |
670 | - application/json | |
44cb3b85 | 671 | parameters: |
330eaf12 C |
672 | - $ref: "commons.yaml#/parameters/start" |
673 | - $ref: "commons.yaml#/parameters/count" | |
674 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
675 | responses: |
676 | '200': | |
677 | description: successful operation | |
678 | schema: | |
679 | type: array | |
680 | items: | |
681 | $ref: '#/definitions/VideoAbuse' | |
c360c494 | 682 | "/videos/{id}/abuse": |
1569a818 | 683 | post: |
94ff4c23 C |
684 | security: |
685 | - OAuth2: [ ] | |
1569a818 DG |
686 | tags: |
687 | - VideoAbuse | |
688 | consumes: | |
689 | - application/json | |
690 | produces: | |
691 | - application/json | |
692 | parameters: | |
330eaf12 | 693 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
694 | responses: |
695 | '204': | |
330eaf12 C |
696 | $ref: "commons.yaml#/responses/emptySuccess" |
697 | "/videos/{id}/blacklist": | |
1569a818 | 698 | post: |
94ff4c23 C |
699 | security: |
700 | - OAuth2: [ ] | |
1569a818 DG |
701 | tags: |
702 | - VideoBlacklist | |
703 | consumes: | |
704 | - application/json | |
705 | produces: | |
706 | - application/json | |
707 | parameters: | |
330eaf12 | 708 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
709 | responses: |
710 | '204': | |
330eaf12 | 711 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 | 712 | delete: |
94ff4c23 C |
713 | security: |
714 | - OAuth2: [ ] | |
1569a818 DG |
715 | tags: |
716 | - VideoBlacklist | |
717 | consumes: | |
718 | - application/json | |
719 | produces: | |
720 | - application/json | |
721 | parameters: | |
330eaf12 | 722 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
723 | responses: |
724 | '204': | |
330eaf12 | 725 | $ref: "commons.yaml#/responses/emptySuccess" |
c360c494 | 726 | /videos/blacklist: |
1569a818 | 727 | get: |
94ff4c23 C |
728 | security: |
729 | - OAuth2: [ ] | |
1569a818 DG |
730 | tags: |
731 | - VideoBlacklist | |
732 | consumes: | |
733 | - application/json | |
734 | produces: | |
735 | - application/json | |
44cb3b85 | 736 | parameters: |
330eaf12 C |
737 | - $ref: "commons.yaml#/parameters/start" |
738 | - $ref: "commons.yaml#/parameters/count" | |
739 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
740 | responses: |
741 | '200': | |
742 | description: successful operation | |
743 | schema: | |
744 | type: array | |
745 | items: | |
746 | $ref: '#/definitions/VideoBlacklist' | |
48dce1c9 | 747 | /video-channels: |
1569a818 DG |
748 | get: |
749 | tags: | |
750 | - VideoChannel | |
751 | consumes: | |
752 | - application/json | |
753 | produces: | |
754 | - application/json | |
44cb3b85 | 755 | parameters: |
330eaf12 C |
756 | - $ref: "commons.yaml#/parameters/start" |
757 | - $ref: "commons.yaml#/parameters/count" | |
758 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
759 | responses: |
760 | '200': | |
761 | description: successful operation | |
762 | schema: | |
763 | type: array | |
764 | items: | |
765 | $ref: '#/definitions/VideoChannel' | |
766 | post: | |
94ff4c23 C |
767 | security: |
768 | - OAuth2: [ ] | |
1569a818 DG |
769 | tags: |
770 | - VideoChannel | |
771 | consumes: | |
772 | - application/json | |
773 | produces: | |
774 | - application/json | |
775 | parameters: | |
776 | - in: body | |
777 | name: body | |
778 | schema: | |
779 | $ref: '#/definitions/VideoChannelInput' | |
780 | responses: | |
781 | '204': | |
330eaf12 | 782 | $ref: "commons.yaml#/responses/emptySuccess" |
cc918ac3 | 783 | "/video-channels/{id}": |
1569a818 DG |
784 | get: |
785 | tags: | |
786 | - VideoChannel | |
787 | consumes: | |
788 | - application/json | |
789 | produces: | |
790 | - application/json | |
791 | parameters: | |
330eaf12 | 792 | - $ref: "video-channels.yaml#/parameters/id" |
1569a818 DG |
793 | responses: |
794 | '200': | |
795 | description: successful operation | |
796 | schema: | |
797 | $ref: '#/definitions/VideoChannel' | |
798 | put: | |
94ff4c23 C |
799 | security: |
800 | - OAuth2: [ ] | |
1569a818 DG |
801 | tags: |
802 | - VideoChannel | |
803 | consumes: | |
804 | - application/json | |
805 | produces: | |
806 | - application/json | |
807 | parameters: | |
330eaf12 | 808 | - $ref: "video-channels.yaml#/parameters/id" |
1569a818 DG |
809 | - in: body |
810 | name: body | |
811 | schema: | |
812 | $ref: '#/definitions/VideoChannelInput' | |
813 | responses: | |
814 | '204': | |
330eaf12 | 815 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 | 816 | delete: |
94ff4c23 C |
817 | security: |
818 | - OAuth2: [ ] | |
1569a818 DG |
819 | tags: |
820 | - VideoChannel | |
821 | consumes: | |
822 | - application/json | |
823 | produces: | |
824 | - application/json | |
825 | parameters: | |
330eaf12 | 826 | - $ref: "video-channels.yaml#/parameters/id" |
cc918ac3 C |
827 | responses: |
828 | '204': | |
330eaf12 | 829 | $ref: "commons.yaml#/responses/emptySuccess" |
cc918ac3 C |
830 | "/video-channels/{id}/videos": |
831 | get: | |
832 | tags: | |
833 | - VideoChannel | |
834 | consumes: | |
835 | - application/json | |
836 | produces: | |
837 | - application/json | |
838 | parameters: | |
330eaf12 | 839 | - $ref: "video-channels.yaml#/parameters/id" |
1569a818 | 840 | responses: |
cc918ac3 | 841 | '200': |
1569a818 | 842 | description: successful operation |
cc918ac3 C |
843 | schema: |
844 | $ref: '#/definitions/Video' | |
ad9e39fb | 845 | /accounts/{name}/video-channels: |
6b738c7a C |
846 | get: |
847 | tags: | |
848 | - VideoChannel | |
849 | consumes: | |
850 | - application/json | |
851 | produces: | |
852 | - application/json | |
853 | parameters: | |
330eaf12 | 854 | - $ref: "accounts.yaml#/parameters/name" |
6b738c7a C |
855 | responses: |
856 | '200': | |
857 | description: successful operation | |
858 | schema: | |
cc918ac3 C |
859 | type: array |
860 | items: | |
861 | $ref: '#/definitions/VideoChannel' | |
330eaf12 | 862 | "/videos/{id}/comment-threads": |
1569a818 DG |
863 | get: |
864 | tags: | |
865 | - VideoComment | |
866 | consumes: | |
867 | - application/json | |
868 | produces: | |
869 | - application/json | |
870 | parameters: | |
330eaf12 C |
871 | - $ref: "videos.yaml#/parameters/id" |
872 | - $ref: "commons.yaml#/parameters/start" | |
873 | - $ref: "commons.yaml#/parameters/count" | |
874 | - $ref: "commons.yaml#/parameters/sort" | |
1569a818 DG |
875 | responses: |
876 | '200': | |
877 | description: successful operation | |
5e1c08eb | 878 | schema: |
c360c494 | 879 | $ref: '#/definitions/CommentThreadResponse' |
1569a818 | 880 | post: |
94ff4c23 C |
881 | security: |
882 | - OAuth2: [ ] | |
1569a818 DG |
883 | tags: |
884 | - VideoComment | |
885 | consumes: | |
886 | - application/json | |
887 | produces: | |
888 | - application/json | |
889 | parameters: | |
330eaf12 | 890 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
891 | responses: |
892 | '200': | |
893 | description: successful operation | |
c360c494 DG |
894 | schema: |
895 | $ref: '#/definitions/CommentThreadPostResponse' | |
330eaf12 | 896 | "/videos/{id}/comment-threads/{threadId}": |
1569a818 DG |
897 | get: |
898 | tags: | |
899 | - VideoComment | |
900 | consumes: | |
901 | - application/json | |
902 | produces: | |
903 | - application/json | |
904 | parameters: | |
330eaf12 C |
905 | - $ref: "videos.yaml#/parameters/id" |
906 | - $ref: "video-comments.yaml#/parameters/threadId" | |
1569a818 DG |
907 | responses: |
908 | '200': | |
909 | description: successful operation | |
5e1c08eb C |
910 | schema: |
911 | $ref: '#/definitions/VideoCommentThreadTree' | |
330eaf12 | 912 | "/videos/{id}/comments/{commentId}": |
1569a818 | 913 | post: |
94ff4c23 C |
914 | security: |
915 | - OAuth2: [ ] | |
1569a818 DG |
916 | tags: |
917 | - VideoComment | |
918 | consumes: | |
919 | - application/json | |
920 | produces: | |
921 | - application/json | |
922 | parameters: | |
330eaf12 C |
923 | - $ref: "videos.yaml#/parameters/id" |
924 | - $ref: "video-comments.yaml#/parameters/commentId" | |
1569a818 DG |
925 | responses: |
926 | '200': | |
927 | description: successful operation | |
c360c494 DG |
928 | schema: |
929 | $ref: '#/definitions/CommentThreadPostResponse' | |
1569a818 | 930 | delete: |
94ff4c23 C |
931 | security: |
932 | - OAuth2: [ ] | |
1569a818 DG |
933 | tags: |
934 | - VideoComment | |
935 | consumes: | |
936 | - application/json | |
937 | produces: | |
938 | - application/json | |
939 | parameters: | |
330eaf12 C |
940 | - $ref: "videos.yaml#/parameters/id" |
941 | - $ref: "video-comments.yaml#/parameters/commentId" | |
1569a818 DG |
942 | responses: |
943 | '204': | |
330eaf12 | 944 | $ref: "commons.yaml#/responses/emptySuccess" |
c360c494 | 945 | "/videos/{id}/rate": |
1569a818 | 946 | put: |
94ff4c23 C |
947 | security: |
948 | - OAuth2: [ ] | |
1569a818 DG |
949 | tags: |
950 | - VideoRate | |
951 | consumes: | |
952 | - application/json | |
953 | produces: | |
954 | - application/json | |
955 | parameters: | |
330eaf12 | 956 | - $ref: "videos.yaml#/parameters/id" |
1569a818 DG |
957 | responses: |
958 | '204': | |
330eaf12 | 959 | $ref: "commons.yaml#/responses/emptySuccess" |
1569a818 | 960 | definitions: |
9d3ef9fe | 961 | VideoConstantNumber: |
5d00a3d7 C |
962 | properties: |
963 | id: | |
964 | type: number | |
965 | label: | |
966 | type: string | |
9d3ef9fe C |
967 | VideoConstantString: |
968 | properties: | |
969 | id: | |
970 | type: string | |
971 | label: | |
972 | type: string | |
61b66b36 C |
973 | VideoPrivacy: |
974 | type: string | |
975 | enum: [Public, Unlisted, Private] | |
1569a818 DG |
976 | Video: |
977 | properties: | |
978 | id: | |
979 | type: number | |
980 | uuid: | |
981 | type: string | |
1569a818 DG |
982 | createdAt: |
983 | type: string | |
61b66b36 C |
984 | publishedAt: |
985 | type: string | |
1569a818 DG |
986 | updatedAt: |
987 | type: string | |
1569a818 | 988 | category: |
9d3ef9fe | 989 | $ref: "#/definitions/VideoConstantNumber" |
1569a818 | 990 | licence: |
9d3ef9fe | 991 | $ref: "#/definitions/VideoConstantNumber" |
1569a818 | 992 | language: |
9d3ef9fe | 993 | $ref: "#/definitions/VideoConstantString" |
61b66b36 C |
994 | privacy: |
995 | $ref: "#/definitions/VideoPrivacy" | |
1569a818 DG |
996 | description: |
997 | type: string | |
998 | duration: | |
999 | type: number | |
1000 | isLocal: | |
1001 | type: boolean | |
1002 | name: | |
1003 | type: string | |
1569a818 DG |
1004 | thumbnailPath: |
1005 | type: string | |
1006 | previewPath: | |
1007 | type: string | |
1008 | embedPath: | |
1009 | type: string | |
1010 | views: | |
1011 | type: number | |
1012 | likes: | |
1013 | type: number | |
1014 | dislikes: | |
1015 | type: number | |
1016 | nsfw: | |
1017 | type: boolean | |
b64c950a | 1018 | account: |
61b66b36 C |
1019 | type: object |
1020 | properties: | |
1021 | name: | |
1022 | type: string | |
1023 | displayName: | |
1024 | type: string | |
1025 | url: | |
1026 | type: string | |
1027 | host: | |
1028 | type: string | |
1029 | avatar: | |
1030 | $ref: "#/definitions/Avatar" | |
1569a818 DG |
1031 | VideoAbuse: |
1032 | properties: | |
1033 | id: | |
1034 | type: number | |
1035 | reason: | |
1036 | type: string | |
19a3b914 C |
1037 | reporterAccount: |
1038 | $ref: "#/definitions/Account" | |
1039 | video: | |
61b66b36 C |
1040 | type: object |
1041 | properties: | |
1042 | id: | |
1043 | type: number | |
1044 | name: | |
1045 | type: string | |
1046 | uuid: | |
1047 | type: string | |
1048 | url: | |
1049 | type: string | |
1569a818 DG |
1050 | createdAt: |
1051 | type: string | |
1052 | VideoBlacklist: | |
1053 | properties: | |
1054 | id: | |
1055 | type: number | |
1056 | videoId: | |
1057 | type: number | |
1058 | createdAt: | |
1059 | type: string | |
1060 | updatedAt: | |
1061 | type: string | |
1062 | name: | |
1063 | type: string | |
1064 | uuid: | |
1065 | type: string | |
1066 | description: | |
1067 | type: string | |
1068 | duration: | |
1069 | type: number | |
1070 | views: | |
1071 | type: number | |
1072 | likes: | |
1073 | type: number | |
1074 | dislikes: | |
1075 | type: number | |
1076 | nsfw: | |
1077 | type: boolean | |
1078 | VideoChannel: | |
1079 | properties: | |
1080 | displayName: | |
1081 | type: string | |
1082 | description: | |
1083 | type: string | |
1084 | isLocal: | |
1085 | type: boolean | |
6b738c7a | 1086 | ownerAccount: |
1569a818 | 1087 | type: object |
5d00a3d7 | 1088 | properties: |
6b738c7a C |
1089 | id: |
1090 | type: number | |
5d00a3d7 | 1091 | uuid: |
1569a818 | 1092 | type: string |
1569a818 DG |
1093 | VideoComment: |
1094 | properties: | |
1095 | id: | |
1096 | type: number | |
1097 | url: | |
1098 | type: string | |
1099 | text: | |
1100 | type: string | |
1101 | threadId: | |
1102 | type: number | |
1103 | inReplyToCommentId: | |
1104 | type: number | |
1105 | videoId: | |
1106 | type: number | |
1107 | createdAt: | |
1108 | type: string | |
1109 | updatedAt: | |
1110 | type: string | |
1111 | totalReplies: | |
1112 | type: number | |
1113 | account: | |
1114 | $ref: "#/definitions/Account" | |
5e1c08eb C |
1115 | VideoCommentThreadTree: |
1116 | properties: | |
1117 | comment: | |
1118 | $ref: "#/definitions/VideoComment" | |
1119 | children: | |
1120 | type: array | |
1121 | items: | |
1122 | $ref: "#/definitions/VideoCommentThreadTree" | |
1569a818 DG |
1123 | Avatar: |
1124 | properties: | |
1125 | path: | |
1126 | type: string | |
1127 | createdAt: | |
1128 | type: string | |
1129 | updatedAt: | |
1130 | type: string | |
1131 | Actor: | |
1132 | properties: | |
1133 | id: | |
1134 | type: number | |
1135 | uuid: | |
1136 | type: string | |
1137 | url: | |
1138 | type: string | |
1139 | name: | |
1140 | type: string | |
1141 | host: | |
1142 | type: string | |
1143 | followingCount: | |
1144 | type: number | |
1145 | followersCount: | |
1146 | type: number | |
1147 | createdAt: | |
1148 | type: string | |
1149 | updatedAt: | |
1150 | type: string | |
1151 | avatar: | |
1152 | $ref: "#/definitions/Avatar" | |
1153 | Account: | |
1154 | allOf: | |
1155 | - $ref: "#/definitions/Actor" | |
1156 | - properties: | |
1157 | displayName: | |
1158 | type: string | |
1159 | User: | |
1160 | properties: | |
1161 | id: | |
1162 | type: number | |
1163 | username: | |
1164 | type: string | |
1165 | email: | |
1166 | type: string | |
1167 | displayNSFW: | |
1168 | type: boolean | |
1169 | autoPlayVideo: | |
1170 | type: boolean | |
1171 | role: | |
1172 | type: string | |
5d00a3d7 | 1173 | enum: [User, Moderator, Administrator] |
1569a818 DG |
1174 | videoQuota: |
1175 | type: number | |
1176 | createdAt: | |
1177 | type: string | |
1178 | account: | |
1179 | $ref: "#/definitions/Account" | |
1180 | videoChannels: | |
1181 | type: array | |
1182 | items: | |
1183 | $ref: "#/definitions/VideoChannel" | |
1184 | ServerConfig: | |
1185 | properties: | |
5d00a3d7 | 1186 | signup: |
1569a818 DG |
1187 | type: object |
1188 | properties: | |
1189 | allowed: | |
1190 | type: boolean | |
1191 | transcoding: | |
1192 | type: object | |
1193 | properties: | |
1194 | enabledResolutions: | |
1195 | type: array | |
1196 | items: | |
1197 | type: number | |
1198 | avatar: | |
1199 | type: object | |
1200 | properties: | |
1201 | file: | |
1202 | type: object | |
1203 | properties: | |
1204 | size: | |
1205 | type: object | |
1206 | properties: | |
1207 | max: | |
1208 | type: number | |
5d00a3d7 | 1209 | extensions: |
1569a818 DG |
1210 | type: array |
1211 | items: | |
1212 | type: string | |
1213 | video: | |
1214 | type: object | |
1215 | properties: | |
1216 | file: | |
1217 | type: object | |
5d00a3d7 C |
1218 | properties: |
1219 | extensions: | |
1569a818 DG |
1220 | type: array |
1221 | items: | |
1222 | type: string | |
1223 | Follow: | |
1224 | properties: | |
1225 | id: | |
1226 | type: number | |
1227 | follower: | |
1228 | $ref: "#/definitions/Actor" | |
1229 | following: | |
1230 | $ref: "#/definitions/Actor" | |
1231 | score: | |
1232 | type: number | |
1233 | state: | |
1234 | type: string | |
1235 | enum: [pending, accepted] | |
1236 | createdAt: | |
1237 | type: string | |
1238 | updatedAt: | |
1239 | type: string | |
1240 | Job: | |
1241 | properties: | |
1242 | id: | |
1243 | type: number | |
1244 | state: | |
1245 | type: string | |
1246 | enum: [pending, processing, error, success] | |
1247 | category: | |
1248 | type: string | |
1249 | enum: [transcoding, activitypub-http] | |
1250 | handlerName: | |
1251 | type: string | |
1252 | handlerInputData: | |
1253 | type: string | |
1254 | createdAt: | |
1255 | type: string | |
1256 | updatedAt: | |
1257 | type: string | |
1258 | ||
61b66b36 | 1259 | # Api responses |
1569a818 DG |
1260 | AddUserResponse: |
1261 | properties: | |
1262 | id: | |
1263 | type: number | |
1264 | uuid: | |
1265 | type: string | |
1266 | VideoUploadResponse: | |
1267 | properties: | |
61b66b36 C |
1268 | video: |
1269 | type: object | |
1270 | properties: | |
1271 | id: | |
1272 | type: number | |
1273 | uuid: | |
1274 | type: string | |
c360c494 DG |
1275 | CommentThreadResponse: |
1276 | properties: | |
1277 | total: | |
1278 | type: number | |
1279 | data: | |
1280 | type: array | |
1281 | items: | |
1282 | $ref: "#/definitions/VideoComment" | |
1283 | CommentThreadPostResponse: | |
1284 | properties: | |
1285 | comment: | |
1286 | $ref: "#/definitions/VideoComment" | |
1569a818 | 1287 | |
61b66b36 | 1288 | # Request bodies |
1569a818 DG |
1289 | AddUser: |
1290 | properties: | |
1291 | username: | |
1292 | type: string | |
1293 | description: 'The user username ' | |
1294 | password: | |
1295 | type: string | |
1296 | description: 'The user password ' | |
1297 | email: | |
1298 | type: string | |
1299 | description: 'The user email ' | |
1300 | videoQuota: | |
1301 | type: string | |
1302 | description: 'The user videoQuota ' | |
1303 | role: | |
1304 | type: string | |
1305 | description: 'The user role ' | |
1306 | required: | |
1307 | - username | |
1308 | - password | |
1309 | ||
1310 | - videoQuota | |
1311 | - role | |
1312 | UpdateUser: | |
1313 | properties: | |
1314 | id: | |
1315 | type: string | |
1316 | description: 'The user id ' | |
1317 | email: | |
1318 | type: string | |
1319 | description: 'The updated email of the user ' | |
1320 | videoQuota: | |
1321 | type: string | |
1322 | description: 'The updated videoQuota of the user ' | |
1323 | role: | |
1324 | type: string | |
1325 | description: 'The updated role of the user ' | |
1326 | required: | |
1327 | - id | |
1328 | ||
1329 | - videoQuota | |
1330 | - role | |
1331 | UpdateMe: | |
1332 | properties: | |
1333 | password: | |
1334 | type: string | |
1335 | description: 'Your new password ' | |
1336 | email: | |
1337 | type: string | |
1338 | description: 'Your new email ' | |
1339 | displayNSFW: | |
1340 | type: string | |
1341 | description: 'Your new displayNSFW ' | |
1342 | autoPlayVideo: | |
1343 | type: string | |
1344 | description: 'Your new autoPlayVideo ' | |
1345 | required: | |
1346 | - password | |
1347 | ||
1348 | - displayNSFW | |
1349 | - autoPlayVideo | |
1350 | GetMeVideoRating: | |
1351 | properties: | |
1352 | id: | |
1353 | type: string | |
1354 | description: 'Id of the video ' | |
1355 | rating: | |
1356 | type: number | |
1357 | description: 'Rating of the video ' | |
1358 | required: | |
1359 | - id | |
1360 | - rating | |
1361 | RegisterUser: | |
1362 | properties: | |
1363 | username: | |
1364 | type: string | |
1365 | description: 'The username of the user ' | |
1366 | password: | |
1367 | type: string | |
1368 | description: 'The password of the user ' | |
1369 | email: | |
1370 | type: string | |
1371 | description: 'The email of the user ' | |
1372 | required: | |
1373 | - username | |
1374 | - password | |
1375 | ||
1376 | VideoChannelInput: | |
1377 | properties: | |
1378 | name: | |
1379 | type: string | |
1380 | description: | |
330eaf12 | 1381 | type: string |