]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/api/openapi.yaml
(quickfix) loosening CSP
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
CommitLineData
1569a818
DG
1swagger: '2.0'
2info:
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 6host: peertube.example.com
94ff4c23
C
7securityDefinitions:
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
15basePath: '/api/v1'
16schemes:
17 - https
1569a818 18paths:
ad9e39fb 19 '/accounts/{name}':
1569a818
DG
20 get:
21 tags:
22 - Accounts
23 consumes:
24 - application/json
25 produces:
26 - application/json
27 parameters:
ad9e39fb 28 - name: name
1569a818
DG
29 in: path
30 required: true
31 type: string
ad9e39fb 32 description: 'The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for example)'
44cb3b85
DG
33 - name: start
34 in: query
35 required: false
36 type: number
37 description: 'starting page'
38 - name: stop
39 in: query
40 required: false
41 type: number
61b66b36 42 description: 'stopping page'
44cb3b85
DG
43 - name: sort
44 in: query
45 required: false
46 type: number
47 description: 'sorting'
1569a818
DG
48 responses:
49 '200':
50 description: successful operation
51 schema:
52 $ref: '#/definitions/Account'
ad9e39fb 53 '/accounts/{name}/videos':
6b738c7a
C
54 get:
55 tags:
56 - Accounts
57 consumes:
58 - application/json
59 produces:
60 - application/json
61 parameters:
ad9e39fb 62 - name: name
6b738c7a
C
63 in: path
64 required: true
65 type: string
ad9e39fb 66 description: 'The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for example)'
6b738c7a
C
67 responses:
68 '200':
69 description: successful operation
70 schema:
71 $ref: '#/definitions/Video'
1569a818
DG
72 /accounts:
73 get:
74 tags:
75 - Accounts
76 consumes:
77 - application/json
78 produces:
79 - application/json
80 responses:
81 '200':
82 description: successful operation
83 schema:
84 type: array
85 items:
86 $ref: '#/definitions/Account'
87 /config:
88 get:
89 tags:
90 - Config
91 consumes:
92 - application/json
93 produces:
94 - application/json
95 responses:
96 '200':
97 description: successful operation
98 schema:
5d00a3d7 99 $ref: '#/definitions/ServerConfig'
244e76a5
RK
100 /feeds/videos.{format}:
101 get:
102 tags:
103 - Feeds
244e76a5 104 produces:
9d3ef9fe
C
105 - application/atom+xml
106 - application/rss+xml
244e76a5
RK
107 - application/json
108 parameters:
109 - name: format
110 in: path
111 required: true
112 type: string
48dce1c9 113 enum: [ 'xml', 'atom', 'json']
244e76a5
RK
114 default: 'xml'
115 description: 'The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and json to JSON FEED 1.0'
116 - name: accountId
117 in: query
118 required: false
119 type: number
120 description: 'The id of the local account to filter to (beware, users IDs and not actors IDs which will return empty feeds'
121 - name: accountName
122 in: query
123 required: false
124 type: string
125 description: 'The name of the local account to filter to'
126 responses:
127 '200':
128 description: successful operation
1569a818
DG
129 /jobs:
130 get:
94ff4c23
C
131 security:
132 - OAuth2: [ ]
1569a818
DG
133 tags:
134 - Job
135 consumes:
136 - application/json
137 produces:
138 - application/json
44cb3b85
DG
139 parameters:
140 - name: state
141 in: path
142 required: true
143 type: string
144 description: 'The id of the account'
145 - name: start
146 in: query
147 required: false
148 type: number
149 description: 'starting page'
150 - name: count
151 in: query
152 required: false
153 type: number
154 description: ''
155 - name: sort
156 in: query
157 required: false
158 type: number
159 description: 'sorting'
1569a818
DG
160 responses:
161 '200':
162 description: successful operation
163 schema:
164 type: array
165 items:
5d00a3d7 166 $ref: '#/definitions/Job'
1569a818
DG
167 '/server/following/{host}':
168 delete:
94ff4c23
C
169 security:
170 - OAuth2: [ ]
1569a818
DG
171 tags:
172 - ServerFollowing
173 consumes:
174 - application/json
175 produces:
176 - application/json
177 parameters:
178 - name: host
179 in: path
180 required: true
181 type: string
182 description: 'The host to unfollow '
183 responses:
184 '201':
185 description: successful operation
186 /server/followers:
187 get:
188 tags:
189 - ServerFollowing
190 consumes:
191 - application/json
192 produces:
193 - application/json
44cb3b85
DG
194 parameters:
195 - name: start
196 in: query
197 required: false
198 type: number
199 description: 'starting page'
200 - name: stop
201 in: query
202 required: false
203 type: number
61b66b36 204 description: 'stopping page'
44cb3b85
DG
205 - name: sort
206 in: query
207 required: false
208 type: number
209 description: 'sorting'
1569a818
DG
210 responses:
211 '200':
212 description: successful operation
213 schema:
214 type: array
215 items:
216 $ref: '#/definitions/Follow'
217 /server/following:
218 get:
219 tags:
220 - ServerFollowing
221 consumes:
222 - application/json
223 produces:
224 - application/json
44cb3b85
DG
225 parameters:
226 - name: start
227 in: query
228 required: false
229 type: number
230 description: 'starting page'
231 - name: stop
232 in: query
233 required: false
234 type: number
61b66b36 235 description: 'stopping page'
44cb3b85
DG
236 - name: sort
237 in: query
238 required: false
239 type: number
240 description: 'sorting'
1569a818
DG
241 responses:
242 '200':
243 description: successful operation
244 schema:
245 type: array
246 items:
247 $ref: '#/definitions/Follow'
248 post:
94ff4c23
C
249 security:
250 - OAuth2: [ ]
1569a818
DG
251 tags:
252 - ServerFollowing
253 consumes:
254 - application/json
255 produces:
256 - application/json
257 parameters:
258 - in: body
259 name: body
260 schema:
261 $ref: '#/definitions/Follow'
262 responses:
263 '204':
264 description: successful operation
265 /users:
266 post:
94ff4c23
C
267 security:
268 - OAuth2: [ ]
1569a818
DG
269 tags:
270 - User
271 consumes:
272 - application/json
273 produces:
274 - application/json
275 parameters:
276 - in: body
277 name: body
278 required: true
61b66b36 279 description: 'User to create'
1569a818
DG
280 schema:
281 $ref: '#/definitions/AddUser'
282 responses:
283 '200':
284 description: successful operation
285 schema:
286 $ref: '#/definitions/AddUserResponse'
287 get:
94ff4c23
C
288 security:
289 - OAuth2: [ ]
1569a818
DG
290 tags:
291 - User
292 consumes:
293 - application/json
294 produces:
295 - application/json
44cb3b85
DG
296 parameters:
297 - name: start
298 in: query
299 required: false
300 type: number
301 description: 'starting page'
302 - name: stop
303 in: query
304 required: false
305 type: number
61b66b36 306 description: 'stopping page'
44cb3b85
DG
307 - name: sort
308 in: query
309 required: false
310 type: number
311 description: 'sorting'
1569a818
DG
312 responses:
313 '200':
314 description: successful operation
315 schema:
316 type: array
317 items:
318 $ref: '#/definitions/User'
319 '/users/{id}':
320 delete:
94ff4c23
C
321 security:
322 - OAuth2: [ ]
1569a818
DG
323 tags:
324 - User
325 consumes:
326 - application/json
327 produces:
328 - application/json
329 parameters:
330 - name: id
331 in: path
332 required: true
333 type: string
334 description: 'The user id '
335 responses:
336 '204':
337 description: successful operation
338 get:
94ff4c23
C
339 security:
340 - OAuth2: [ ]
1569a818
DG
341 tags:
342 - User
343 consumes:
344 - application/json
345 produces:
346 - application/json
347 parameters:
348 - name: id
349 in: path
350 required: true
351 type: string
352 description: 'The user id '
353 responses:
354 '200':
355 description: successful operation
356 schema:
357 $ref: '#/definitions/User'
358 put:
94ff4c23
C
359 security:
360 - OAuth2: [ ]
1569a818
DG
361 tags:
362 - User
363 consumes:
364 - application/json
365 produces:
366 - application/json
367 parameters:
368 - name: id
369 in: path
370 required: true
371 type: string
372 description: 'The user id '
373 - in: body
374 name: body
375 required: true
376 schema:
377 $ref: '#/definitions/UpdateUser'
378 responses:
379 '204':
380 description: successful operation
381 /users/me:
382 get:
94ff4c23
C
383 security:
384 - OAuth2: [ ]
1569a818
DG
385 tags:
386 - User
387 consumes:
388 - application/json
389 produces:
390 - application/json
391 responses:
392 '200':
393 description: successful operation
394 schema:
395 type: array
396 items:
397 $ref: '#/definitions/User'
398 put:
94ff4c23
C
399 security:
400 - OAuth2: [ ]
1569a818
DG
401 tags:
402 - User
403 consumes:
404 - application/json
405 produces:
406 - application/json
407 parameters:
408 - in: body
409 name: body
410 required: true
411 schema:
412 $ref: '#/definitions/UpdateMe'
413 responses:
414 '204':
415 description: successful operation
416 /users/me/video-quota-used:
417 get:
94ff4c23
C
418 security:
419 - OAuth2: [ ]
1569a818
DG
420 tags:
421 - User
422 consumes:
423 - application/json
424 produces:
425 - application/json
426 parameters: []
427 responses:
428 '200':
429 description: successful operation
430 schema:
431 type: number
432 '/users/me/videos/{videoId}/rating':
433 get:
94ff4c23
C
434 security:
435 - OAuth2: [ ]
1569a818
DG
436 tags:
437 - User
438 consumes:
439 - application/json
440 produces:
441 - application/json
442 parameters:
443 - name: videoId
444 in: path
445 required: true
446 type: string
447 description: 'The video id '
448 responses:
449 '200':
450 description: successful operation
451 schema:
452 $ref: '#/definitions/GetMeVideoRating'
453 /users/me/videos:
454 get:
94ff4c23
C
455 security:
456 - OAuth2: [ ]
1569a818
DG
457 tags:
458 - User
459 consumes:
460 - application/json
461 produces:
462 - application/json
44cb3b85
DG
463 parameters:
464 - name: start
465 in: query
466 required: false
467 type: number
468 description: 'starting page'
469 - name: stop
470 in: query
471 required: false
472 type: number
61b66b36 473 description: 'stopping page'
44cb3b85
DG
474 - name: sort
475 in: query
476 required: false
477 type: number
478 description: 'sorting'
1569a818
DG
479 responses:
480 '200':
481 description: successful operation
482 schema:
483 type: array
484 items:
485 $ref: '#/definitions/Video'
486 /users/register:
487 post:
488 tags:
489 - User
490 consumes:
491 - application/json
492 produces:
493 - application/json
494 parameters:
495 - in: body
496 name: body
497 required: true
498 schema:
499 $ref: '#/definitions/RegisterUser'
500 responses:
501 '204':
502 description: successful operation
503 /users/me/avatar/pick:
504 post:
94ff4c23
C
505 security:
506 - OAuth2: [ ]
1569a818
DG
507 tags:
508 - User
509 consumes:
510 - multipart/form-data
511 produces:
512 - application/json
513 parameters:
514 - in: formData
515 name: avatarfile
516 type: file
517 description: The file to upload.
518 responses:
519 '200':
520 description: successful operation
521 schema:
522 $ref: '#/definitions/Avatar'
c360c494 523 /videos:
1569a818
DG
524 get:
525 tags:
526 - Video
527 consumes:
528 - application/json
529 produces:
530 - application/json
44cb3b85 531 parameters:
61b909b9
P
532 - name: category
533 in: query
534 required: false
535 type: number
536 description: category id of the video
44cb3b85
DG
537 - name: start
538 in: query
539 required: false
540 type: number
541 description: 'starting page'
542 - name: stop
543 in: query
544 required: false
545 type: number
61b66b36 546 description: 'stopping page'
44cb3b85
DG
547 - name: sort
548 in: query
549 required: false
550 type: number
551 description: 'sorting'
1569a818
DG
552 responses:
553 '200':
554 description: successful operation
555 schema:
556 type: array
557 items:
558 $ref: '#/definitions/Video'
c360c494 559 /videos/categories:
1569a818
DG
560 get:
561 tags:
562 - Video
563 consumes:
564 - application/json
565 produces:
566 - application/json
567 responses:
568 '200':
569 description: successful operation
570 schema:
571 type: array
572 items:
573 type: string
c360c494 574 /videos/licences:
1569a818
DG
575 get:
576 tags:
577 - Video
578 consumes:
579 - application/json
580 produces:
581 - application/json
582 responses:
583 '200':
584 description: successful operation
585 schema:
586 type: array
587 items:
588 type: string
c360c494 589 /videos/languages:
1569a818
DG
590 get:
591 tags:
592 - Video
593 consumes:
594 - application/json
595 produces:
596 - application/json
597 responses:
598 '200':
599 description: successful operation
600 schema:
601 type: array
602 items:
603 type: string
c360c494 604 /videos/privacies:
1569a818
DG
605 get:
606 tags:
607 - Video
608 consumes:
609 - application/json
610 produces:
611 - application/json
612 responses:
613 '200':
614 description: successful operation
615 schema:
616 type: array
617 items:
618 type: string
c360c494 619 /videos/search:
1569a818
DG
620 get:
621 tags:
622 - Video
623 consumes:
624 - application/json
625 produces:
626 - application/json
44cb3b85
DG
627 parameters:
628 - name: start
629 in: query
630 required: false
631 type: number
632 description: 'starting page'
633 - name: stop
634 in: query
635 required: false
636 type: number
61b66b36 637 description: 'stopping page'
44cb3b85
DG
638 - name: sort
639 in: query
640 required: false
641 type: number
642 description: 'sorting'
1569a818
DG
643 responses:
644 '200':
645 description: successful operation
646 schema:
647 type: array
648 items:
649 $ref: '#/definitions/Video'
c360c494 650 "/videos/{id}":
1569a818 651 put:
94ff4c23
C
652 security:
653 - OAuth2: [ ]
1569a818
DG
654 tags:
655 - Video
656 consumes:
61b66b36 657 - multipart/form-data
1569a818
DG
658 produces:
659 - application/json
660 parameters:
661 - name: id
662 in: path
663 required: true
664 type: string
61b66b36
C
665 description: 'The video id'
666 - name: thumbnailfile
667 in: formData
668 type: file
669 description: 'Video thumbnail file'
670 - name: previewfile
671 in: formData
672 type: file
673 description: 'Video preview file'
674 - name: category
675 in: formData
676 type: number
677 description: 'Video category'
678 - name: licence
679 in: formData
680 type: number
681 description: 'Video licence'
682 - name: language
683 in: formData
9d3ef9fe 684 type: string
61b66b36
C
685 description: 'Video language'
686 - name: description
687 in: formData
688 type: string
689 description: 'Video description'
2186386c
C
690 - name: waitTranscoding
691 in: formData
692 type: boolean
693 description: 'Whether or not we wait transcoding before publish the video'
61b66b36
C
694 - name: support
695 in: formData
696 type: string
697 description: 'Text describing how to support the video uploader'
698 - name: nsfw
699 in: formData
700 type: boolean
701 description: 'Whether or not this video contains sensitive content'
702 - name: name
703 in: formData
704 type: string
705 description: 'Video name'
706 - name: tags
707 in: formData
708 type: string[]
709 description: 'Video tags'
710 - name: commentsEnabled
711 in: formData
712 type: boolean
713 description: 'Enable or disable comments for this video'
714 - name: privacy
715 in: formData
716 type: string
97ea2404 717 enum: [Public, Unlisted]
61b66b36 718 description: 'Video privacy'
bbe0f064
C
719 - name: scheduleUpdate
720 in: formData
721 required: false
722 description: 'Schedule an update at a specific datetime'
723 type:
724 $ref: '#/definitions/ScheduleVideoUpdate'
1569a818
DG
725 responses:
726 '200':
727 description: successful operation
728 schema:
729 $ref: '#/definitions/Video'
730 get:
731 tags:
732 - Video
733 consumes:
734 - application/json
735 produces:
736 - application/json
737 parameters:
738 - name: id
739 in: path
740 required: true
741 type: string
742 description: 'The video id '
743 responses:
744 '200':
745 description: successful operation
746 schema:
747 $ref: '#/definitions/Video'
748 delete:
94ff4c23
C
749 security:
750 - OAuth2: [ ]
1569a818
DG
751 tags:
752 - Video
753 consumes:
754 - application/json
755 produces:
756 - application/json
757 parameters:
758 - name: id
759 in: path
760 required: true
761 type: string
762 description: 'The video id '
763 responses:
764 '204':
765 description: successful operation
c360c494 766 "/videos/{id}/description":
1569a818
DG
767 get:
768 tags:
769 - Video
770 consumes:
771 - application/json
772 produces:
773 - application/json
774 parameters:
775 - name: id
776 in: path
777 required: true
778 type: string
779 description: 'The video id '
780 responses:
781 '200':
782 description: successful operation
783 schema:
784 type: string
c360c494 785 "/videos/{id}/views":
1569a818
DG
786 post:
787 tags:
788 - Video
789 consumes:
790 - application/json
791 produces:
792 - application/json
793 parameters:
794 - name: id
795 in: path
796 required: true
797 type: string
798 description: 'The video id '
799 responses:
800 '204':
801 description: successful operation
c360c494 802 /videos/upload:
1569a818 803 post:
94ff4c23
C
804 security:
805 - OAuth2: [ ]
1569a818
DG
806 tags:
807 - Video
808 consumes:
809 - multipart/form-data
810 produces:
811 - application/json
812 parameters:
61b66b36
C
813 - name: videofile
814 in: formData
1569a818 815 type: file
61b66b36
C
816 required: true
817 description: 'Video file'
818 - name: thumbnailfile
819 in: formData
820 type: file
821 required: true
822 description: 'Video thumbnail file'
823 - name: previewfile
824 in: formData
825 type: file
826 required: true
827 description: 'Video preview file'
828 - name: category
829 in: formData
830 type: number
831 description: 'Video category'
2186386c
C
832 - name: waitTranscoding
833 in: formData
834 type: boolean
835 description: 'Whether or not we wait transcoding before publish the video'
61b66b36
C
836 - name: licence
837 in: formData
838 type: number
839 description: 'Video licence'
840 - name: language
841 in: formData
9d3ef9fe 842 type: string
61b66b36
C
843 description: 'Video language'
844 - name: description
845 in: formData
846 type: string
847 description: 'Video description'
848 - name: support
849 in: formData
850 type: string
851 description: 'Text describing how to support the video uploader'
852 - name: channelId
853 in: formData
854 required: true
855 type: number
856 description: 'Channel id that will contain this video'
857 - name: nsfw
858 in: formData
859 required: true
860 type: boolean
861 description: 'Whether or not this video contains sensitive content'
862 - name: name
863 in: formData
864 required: true
865 type: string
866 description: 'Video name'
867 - name: tags
868 in: formData
869 type: string[]
870 description: 'Video tags'
871 - name: commentsEnabled
872 in: formData
873 type: boolean
874 description: 'Enable or disable comments for this video'
875 - name: privacy
876 in: formData
877 required: true
bbe0f064
C
878 type:
879 $ref: '#/definitions/VideoPrivacy'
61b66b36 880 description: 'Video privacy'
bbe0f064
C
881 - name: scheduleUpdate
882 in: formData
883 required: false
884 description: 'Schedule an update at a specific datetime'
885 type:
886 $ref: '#/definitions/ScheduleVideoUpdate'
1569a818
DG
887 responses:
888 '200':
889 description: successful operation
890 schema:
891 $ref: '#/definitions/VideoUploadResponse'
c360c494 892 /videos/abuse:
1569a818 893 get:
94ff4c23
C
894 security:
895 - OAuth2: [ ]
1569a818
DG
896 tags:
897 - VideoAbuse
898 consumes:
899 - application/json
900 produces:
901 - application/json
44cb3b85
DG
902 parameters:
903 - name: start
904 in: query
905 required: false
906 type: number
907 description: 'starting page'
908 - name: stop
909 in: query
910 required: false
911 type: number
61b66b36 912 description: 'stopping page'
44cb3b85
DG
913 - name: sort
914 in: query
915 required: false
916 type: number
917 description: 'sorting'
1569a818
DG
918 responses:
919 '200':
920 description: successful operation
921 schema:
922 type: array
923 items:
924 $ref: '#/definitions/VideoAbuse'
c360c494 925 "/videos/{id}/abuse":
1569a818 926 post:
94ff4c23
C
927 security:
928 - OAuth2: [ ]
1569a818
DG
929 tags:
930 - VideoAbuse
931 consumes:
932 - application/json
933 produces:
934 - application/json
935 parameters:
936 - name: id
937 in: path
938 required: true
939 type: string
940 description: 'The video id '
941 responses:
942 '204':
943 description: successful operation
c360c494 944 "/videos/{videoId}/blacklist":
1569a818 945 post:
94ff4c23
C
946 security:
947 - OAuth2: [ ]
1569a818
DG
948 tags:
949 - VideoBlacklist
950 consumes:
951 - application/json
952 produces:
953 - application/json
954 parameters:
955 - name: videoId
956 in: path
957 required: true
958 type: string
959 description: 'The video id '
960 responses:
961 '204':
962 description: successful operation
963 delete:
94ff4c23
C
964 security:
965 - OAuth2: [ ]
1569a818
DG
966 tags:
967 - VideoBlacklist
968 consumes:
969 - application/json
970 produces:
971 - application/json
972 parameters:
973 - name: videoId
974 in: path
975 required: true
976 type: string
977 description: 'The video id '
978 responses:
979 '204':
980 description: successful operation
c360c494 981 /videos/blacklist:
1569a818 982 get:
94ff4c23
C
983 security:
984 - OAuth2: [ ]
1569a818
DG
985 tags:
986 - VideoBlacklist
987 consumes:
988 - application/json
989 produces:
990 - application/json
44cb3b85
DG
991 parameters:
992 - name: start
993 in: query
994 required: false
995 type: number
996 description: 'starting page'
997 - name: stop
998 in: query
999 required: false
1000 type: number
61b66b36 1001 description: 'stopping page'
44cb3b85
DG
1002 - name: sort
1003 in: query
1004 required: false
1005 type: number
1006 description: 'sorting'
1569a818
DG
1007 responses:
1008 '200':
1009 description: successful operation
1010 schema:
1011 type: array
1012 items:
1013 $ref: '#/definitions/VideoBlacklist'
48dce1c9 1014 /video-channels:
1569a818
DG
1015 get:
1016 tags:
1017 - VideoChannel
1018 consumes:
1019 - application/json
1020 produces:
1021 - application/json
44cb3b85
DG
1022 parameters:
1023 - name: start
1024 in: query
1025 required: false
1026 type: number
1027 description: 'starting page'
1028 - name: stop
1029 in: query
1030 required: false
1031 type: number
61b66b36 1032 description: 'stopping page'
44cb3b85
DG
1033 - name: sort
1034 in: query
1035 required: false
1036 type: number
1037 description: 'sorting'
1569a818
DG
1038 responses:
1039 '200':
1040 description: successful operation
1041 schema:
1042 type: array
1043 items:
1044 $ref: '#/definitions/VideoChannel'
1045 post:
94ff4c23
C
1046 security:
1047 - OAuth2: [ ]
1569a818
DG
1048 tags:
1049 - VideoChannel
1050 consumes:
1051 - application/json
1052 produces:
1053 - application/json
1054 parameters:
1055 - in: body
1056 name: body
1057 schema:
1058 $ref: '#/definitions/VideoChannelInput'
1059 responses:
1060 '204':
1061 description: successful operation
cc918ac3 1062 "/video-channels/{id}":
1569a818
DG
1063 get:
1064 tags:
1065 - VideoChannel
1066 consumes:
1067 - application/json
1068 produces:
1069 - application/json
1070 parameters:
1071 - name: id
1072 in: path
1073 required: true
1074 type: string
48dce1c9 1075 description: 'The video channel id '
1569a818
DG
1076 responses:
1077 '200':
1078 description: successful operation
1079 schema:
1080 $ref: '#/definitions/VideoChannel'
1081 put:
94ff4c23
C
1082 security:
1083 - OAuth2: [ ]
1569a818
DG
1084 tags:
1085 - VideoChannel
1086 consumes:
1087 - application/json
1088 produces:
1089 - application/json
1090 parameters:
1091 - name: id
1092 in: path
1093 required: true
1094 type: string
48dce1c9 1095 description: 'The video channel id '
1569a818
DG
1096 - in: body
1097 name: body
1098 schema:
1099 $ref: '#/definitions/VideoChannelInput'
1100 responses:
1101 '204':
1102 description: successful operation
1103 delete:
94ff4c23
C
1104 security:
1105 - OAuth2: [ ]
1569a818
DG
1106 tags:
1107 - VideoChannel
1108 consumes:
1109 - application/json
1110 produces:
1111 - application/json
1112 parameters:
cc918ac3 1113 - name: id
1569a818
DG
1114 in: path
1115 required: true
1116 type: string
cc918ac3
C
1117 description: 'The video channel id '
1118 responses:
1119 '204':
1120 description: successful operation
1121 "/video-channels/{id}/videos":
1122 get:
1123 tags:
1124 - VideoChannel
1125 consumes:
1126 - application/json
1127 produces:
1128 - application/json
1129 parameters:
48dce1c9 1130 - name: id
1569a818
DG
1131 in: path
1132 required: true
1133 type: string
48dce1c9 1134 description: 'The video channel id '
1569a818 1135 responses:
cc918ac3 1136 '200':
1569a818 1137 description: successful operation
cc918ac3
C
1138 schema:
1139 $ref: '#/definitions/Video'
ad9e39fb 1140 /accounts/{name}/video-channels:
6b738c7a
C
1141 get:
1142 tags:
1143 - VideoChannel
1144 consumes:
1145 - application/json
1146 produces:
1147 - application/json
1148 parameters:
ad9e39fb 1149 - name: name
6b738c7a
C
1150 in: path
1151 required: true
1152 type: string
ad9e39fb 1153 description: 'The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for example)'
6b738c7a
C
1154 responses:
1155 '200':
1156 description: successful operation
1157 schema:
cc918ac3
C
1158 type: array
1159 items:
1160 $ref: '#/definitions/VideoChannel'
c360c494 1161 "/videos/{videoId}/comment-threads":
1569a818
DG
1162 get:
1163 tags:
1164 - VideoComment
1165 consumes:
1166 - application/json
1167 produces:
1168 - application/json
1169 parameters:
1170 - name: videoId
1171 in: path
1172 required: true
1173 type: string
1174 description: 'The video id '
44cb3b85
DG
1175 - name: start
1176 in: query
1177 required: false
1178 type: number
1179 description: 'starting page'
1180 - name: stop
1181 in: query
1182 required: false
1183 type: number
61b66b36 1184 description: 'stopping page'
44cb3b85
DG
1185 - name: sort
1186 in: query
1187 required: false
1188 type: number
1189 description: 'sorting'
1569a818
DG
1190 responses:
1191 '200':
1192 description: successful operation
5e1c08eb 1193 schema:
c360c494 1194 $ref: '#/definitions/CommentThreadResponse'
1569a818 1195 post:
94ff4c23
C
1196 security:
1197 - OAuth2: [ ]
1569a818
DG
1198 tags:
1199 - VideoComment
1200 consumes:
1201 - application/json
1202 produces:
1203 - application/json
1204 parameters:
1205 - name: videoId
1206 in: path
1207 required: true
1208 type: string
1209 description: 'The video id '
1210 responses:
1211 '200':
1212 description: successful operation
c360c494
DG
1213 schema:
1214 $ref: '#/definitions/CommentThreadPostResponse'
1215 "/videos/{videoId}/comment-threads/{threadId}":
1569a818
DG
1216 get:
1217 tags:
1218 - VideoComment
1219 consumes:
1220 - application/json
1221 produces:
1222 - application/json
1223 parameters:
1224 - name: videoId
1225 in: path
1226 required: true
1227 type: string
1228 description: 'The video id '
1229 - name: threadId
1230 in: path
1231 required: true
1232 type: string
1233 description: 'The thread id '
1234 responses:
1235 '200':
1236 description: successful operation
5e1c08eb
C
1237 schema:
1238 $ref: '#/definitions/VideoCommentThreadTree'
c360c494 1239 "/videos/{videoId}/comments/{commentId}":
1569a818 1240 post:
94ff4c23
C
1241 security:
1242 - OAuth2: [ ]
1569a818
DG
1243 tags:
1244 - VideoComment
1245 consumes:
1246 - application/json
1247 produces:
1248 - application/json
1249 parameters:
1250 - name: videoId
1251 in: path
1252 required: true
1253 type: string
1254 description: 'The video id '
1255 - name: commentId
1256 in: path
1257 required: true
1258 type: string
1259 description: 'The comment id '
1260 responses:
1261 '200':
1262 description: successful operation
c360c494
DG
1263 schema:
1264 $ref: '#/definitions/CommentThreadPostResponse'
1569a818 1265 delete:
94ff4c23
C
1266 security:
1267 - OAuth2: [ ]
1569a818
DG
1268 tags:
1269 - VideoComment
1270 consumes:
1271 - application/json
1272 produces:
1273 - application/json
1274 parameters:
1275 - name: videoId
1276 in: path
1277 required: true
1278 type: string
1279 description: 'The video id '
1280 - name: commentId
1281 in: path
1282 required: true
1283 type: string
1284 description: 'The comment id '
1285 responses:
1286 '204':
1287 description: successful operation
c360c494 1288 "/videos/{id}/rate":
1569a818 1289 put:
94ff4c23
C
1290 security:
1291 - OAuth2: [ ]
1569a818
DG
1292 tags:
1293 - VideoRate
1294 consumes:
1295 - application/json
1296 produces:
1297 - application/json
1298 parameters:
1299 - name: id
1300 in: path
1301 required: true
1302 type: string
1303 description: 'The video id '
1304 responses:
1305 '204':
1306 description: successful operation
1307definitions:
9d3ef9fe 1308 VideoConstantNumber:
5d00a3d7
C
1309 properties:
1310 id:
1311 type: number
1312 label:
1313 type: string
9d3ef9fe
C
1314 VideoConstantString:
1315 properties:
1316 id:
1317 type: string
1318 label:
1319 type: string
61b66b36
C
1320 VideoPrivacy:
1321 type: string
1322 enum: [Public, Unlisted, Private]
1569a818
DG
1323 Video:
1324 properties:
1325 id:
1326 type: number
1327 uuid:
1328 type: string
1569a818
DG
1329 createdAt:
1330 type: string
61b66b36
C
1331 publishedAt:
1332 type: string
1569a818
DG
1333 updatedAt:
1334 type: string
1569a818 1335 category:
9d3ef9fe 1336 $ref: "#/definitions/VideoConstantNumber"
1569a818 1337 licence:
9d3ef9fe 1338 $ref: "#/definitions/VideoConstantNumber"
1569a818 1339 language:
9d3ef9fe 1340 $ref: "#/definitions/VideoConstantString"
61b66b36
C
1341 privacy:
1342 $ref: "#/definitions/VideoPrivacy"
1569a818
DG
1343 description:
1344 type: string
1345 duration:
1346 type: number
1347 isLocal:
1348 type: boolean
1349 name:
1350 type: string
1569a818
DG
1351 thumbnailPath:
1352 type: string
1353 previewPath:
1354 type: string
1355 embedPath:
1356 type: string
1357 views:
1358 type: number
1359 likes:
1360 type: number
1361 dislikes:
1362 type: number
1363 nsfw:
1364 type: boolean
b64c950a 1365 account:
61b66b36
C
1366 type: object
1367 properties:
1368 name:
1369 type: string
1370 displayName:
1371 type: string
1372 url:
1373 type: string
1374 host:
1375 type: string
1376 avatar:
1377 $ref: "#/definitions/Avatar"
1569a818
DG
1378 VideoAbuse:
1379 properties:
1380 id:
1381 type: number
1382 reason:
1383 type: string
19a3b914
C
1384 reporterAccount:
1385 $ref: "#/definitions/Account"
1386 video:
61b66b36
C
1387 type: object
1388 properties:
1389 id:
1390 type: number
1391 name:
1392 type: string
1393 uuid:
1394 type: string
1395 url:
1396 type: string
1569a818
DG
1397 createdAt:
1398 type: string
1399 VideoBlacklist:
1400 properties:
1401 id:
1402 type: number
1403 videoId:
1404 type: number
1405 createdAt:
1406 type: string
1407 updatedAt:
1408 type: string
1409 name:
1410 type: string
1411 uuid:
1412 type: string
1413 description:
1414 type: string
1415 duration:
1416 type: number
1417 views:
1418 type: number
1419 likes:
1420 type: number
1421 dislikes:
1422 type: number
1423 nsfw:
1424 type: boolean
1425 VideoChannel:
1426 properties:
1427 displayName:
1428 type: string
1429 description:
1430 type: string
1431 isLocal:
1432 type: boolean
6b738c7a 1433 ownerAccount:
1569a818 1434 type: object
5d00a3d7 1435 properties:
6b738c7a
C
1436 id:
1437 type: number
5d00a3d7 1438 uuid:
1569a818 1439 type: string
1569a818
DG
1440 VideoComment:
1441 properties:
1442 id:
1443 type: number
1444 url:
1445 type: string
1446 text:
1447 type: string
1448 threadId:
1449 type: number
1450 inReplyToCommentId:
1451 type: number
1452 videoId:
1453 type: number
1454 createdAt:
1455 type: string
1456 updatedAt:
1457 type: string
1458 totalReplies:
1459 type: number
1460 account:
1461 $ref: "#/definitions/Account"
5e1c08eb
C
1462 VideoCommentThreadTree:
1463 properties:
1464 comment:
1465 $ref: "#/definitions/VideoComment"
1466 children:
1467 type: array
1468 items:
1469 $ref: "#/definitions/VideoCommentThreadTree"
1569a818
DG
1470 Avatar:
1471 properties:
1472 path:
1473 type: string
1474 createdAt:
1475 type: string
1476 updatedAt:
1477 type: string
1478 Actor:
1479 properties:
1480 id:
1481 type: number
1482 uuid:
1483 type: string
1484 url:
1485 type: string
1486 name:
1487 type: string
1488 host:
1489 type: string
1490 followingCount:
1491 type: number
1492 followersCount:
1493 type: number
1494 createdAt:
1495 type: string
1496 updatedAt:
1497 type: string
1498 avatar:
1499 $ref: "#/definitions/Avatar"
1500 Account:
1501 allOf:
1502 - $ref: "#/definitions/Actor"
1503 - properties:
1504 displayName:
1505 type: string
1506 User:
1507 properties:
1508 id:
1509 type: number
1510 username:
1511 type: string
1512 email:
1513 type: string
1514 displayNSFW:
1515 type: boolean
1516 autoPlayVideo:
1517 type: boolean
1518 role:
1519 type: string
5d00a3d7 1520 enum: [User, Moderator, Administrator]
1569a818
DG
1521 videoQuota:
1522 type: number
1523 createdAt:
1524 type: string
1525 account:
1526 $ref: "#/definitions/Account"
1527 videoChannels:
1528 type: array
1529 items:
1530 $ref: "#/definitions/VideoChannel"
1531 ServerConfig:
1532 properties:
5d00a3d7 1533 signup:
1569a818
DG
1534 type: object
1535 properties:
1536 allowed:
1537 type: boolean
1538 transcoding:
1539 type: object
1540 properties:
1541 enabledResolutions:
1542 type: array
1543 items:
1544 type: number
1545 avatar:
1546 type: object
1547 properties:
1548 file:
1549 type: object
1550 properties:
1551 size:
1552 type: object
1553 properties:
1554 max:
1555 type: number
5d00a3d7 1556 extensions:
1569a818
DG
1557 type: array
1558 items:
1559 type: string
1560 video:
1561 type: object
1562 properties:
1563 file:
1564 type: object
5d00a3d7
C
1565 properties:
1566 extensions:
1569a818
DG
1567 type: array
1568 items:
1569 type: string
1570 Follow:
1571 properties:
1572 id:
1573 type: number
1574 follower:
1575 $ref: "#/definitions/Actor"
1576 following:
1577 $ref: "#/definitions/Actor"
1578 score:
1579 type: number
1580 state:
1581 type: string
1582 enum: [pending, accepted]
1583 createdAt:
1584 type: string
1585 updatedAt:
1586 type: string
1587 Job:
1588 properties:
1589 id:
1590 type: number
1591 state:
1592 type: string
1593 enum: [pending, processing, error, success]
1594 category:
1595 type: string
1596 enum: [transcoding, activitypub-http]
1597 handlerName:
1598 type: string
1599 handlerInputData:
1600 type: string
1601 createdAt:
1602 type: string
1603 updatedAt:
1604 type: string
1605
61b66b36 1606# Api responses
1569a818
DG
1607 AddUserResponse:
1608 properties:
1609 id:
1610 type: number
1611 uuid:
1612 type: string
1613 VideoUploadResponse:
1614 properties:
61b66b36
C
1615 video:
1616 type: object
1617 properties:
1618 id:
1619 type: number
1620 uuid:
1621 type: string
c360c494
DG
1622 CommentThreadResponse:
1623 properties:
1624 total:
1625 type: number
1626 data:
1627 type: array
1628 items:
1629 $ref: "#/definitions/VideoComment"
1630 CommentThreadPostResponse:
1631 properties:
1632 comment:
1633 $ref: "#/definitions/VideoComment"
1569a818 1634
61b66b36 1635# Request bodies
1569a818
DG
1636 AddUser:
1637 properties:
1638 username:
1639 type: string
1640 description: 'The user username '
1641 password:
1642 type: string
1643 description: 'The user password '
1644 email:
1645 type: string
1646 description: 'The user email '
1647 videoQuota:
1648 type: string
1649 description: 'The user videoQuota '
1650 role:
1651 type: string
1652 description: 'The user role '
1653 required:
1654 - username
1655 - password
1656 - email
1657 - videoQuota
1658 - role
1659 UpdateUser:
1660 properties:
1661 id:
1662 type: string
1663 description: 'The user id '
1664 email:
1665 type: string
1666 description: 'The updated email of the user '
1667 videoQuota:
1668 type: string
1669 description: 'The updated videoQuota of the user '
1670 role:
1671 type: string
1672 description: 'The updated role of the user '
1673 required:
1674 - id
1675 - email
1676 - videoQuota
1677 - role
1678 UpdateMe:
1679 properties:
1680 password:
1681 type: string
1682 description: 'Your new password '
1683 email:
1684 type: string
1685 description: 'Your new email '
1686 displayNSFW:
1687 type: string
1688 description: 'Your new displayNSFW '
1689 autoPlayVideo:
1690 type: string
1691 description: 'Your new autoPlayVideo '
1692 required:
1693 - password
1694 - email
1695 - displayNSFW
1696 - autoPlayVideo
1697 GetMeVideoRating:
1698 properties:
1699 id:
1700 type: string
1701 description: 'Id of the video '
1702 rating:
1703 type: number
1704 description: 'Rating of the video '
1705 required:
1706 - id
1707 - rating
1708 RegisterUser:
1709 properties:
1710 username:
1711 type: string
1712 description: 'The username of the user '
1713 password:
1714 type: string
1715 description: 'The password of the user '
1716 email:
1717 type: string
1718 description: 'The email of the user '
1719 required:
1720 - username
1721 - password
1722 - email
1723 VideoChannelInput:
1724 properties:
1725 name:
1726 type: string
1727 description:
1728 type: string
bbe0f064
C
1729 ScheduleVideoUpdate:
1730 properties:
1731 updateAt:
1732 type: dateTime
1733 description: 'When to update the video'
1734 required: true
1735 privacy:
1736 $ref: '#/definitions/VideoPrivacy'
1737 required: false