Video channel API routes refractor
[oweals/peertube.git] / support / doc / api / openapi.yaml
1 swagger: '2.0'
2 info:
3   title: PeerTube
4   version: 1.0.0-beta
5   description: Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.
6 host: peertube.example.com
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
15 basePath: '/api/v1'
16 schemes:
17   - https
18 paths:
19   '/accounts/{id}':
20     get:
21       tags:
22         - Accounts
23       consumes:
24         - application/json
25       produces:
26         - application/json
27       parameters:
28         - name: id
29           in: path
30           required: true
31           type: string
32           description: 'The id of the account'
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
42           description: 'stopping page'
43         - name: sort
44           in: query
45           required: false
46           type: number
47           description: 'sorting'
48       responses:
49         '200':
50           description: successful operation
51           schema:
52             $ref: '#/definitions/Account'
53   '/accounts/{id}/videos':
54     get:
55       tags:
56         - Accounts
57       consumes:
58         - application/json
59       produces:
60         - application/json
61       parameters:
62         - name: id
63           in: path
64           required: true
65           type: string
66           description: 'The id of the account'
67       responses:
68         '200':
69           description: successful operation
70           schema:
71             $ref: '#/definitions/Video'
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:
99             $ref: '#/definitions/ServerConfig'
100   /feeds/videos.{format}:
101     get:
102       tags:
103         - Feeds
104       produces:
105         - application/atom+xml
106         - application/rss+xml
107         - application/json
108       parameters:
109         - name: format
110           in: path
111           required: true
112           type: string
113           enum: [ 'xml', 'atom', 'json']
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
129   /jobs:
130     get:
131       security:
132         - OAuth2: [ ]
133       tags:
134         - Job
135       consumes:
136         - application/json
137       produces:
138         - application/json
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'
160       responses:
161         '200':
162           description: successful operation
163           schema:
164             type: array
165             items:
166               $ref: '#/definitions/Job'
167   '/server/following/{host}':
168     delete:
169       security:
170         - OAuth2: [ ]
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
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
204           description: 'stopping page'
205         - name: sort
206           in: query
207           required: false
208           type: number
209           description: 'sorting'
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
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
235           description: 'stopping page'
236         - name: sort
237           in: query
238           required: false
239           type: number
240           description: 'sorting'
241       responses:
242         '200':
243           description: successful operation
244           schema:
245             type: array
246             items:
247               $ref: '#/definitions/Follow'
248     post:
249       security:
250         - OAuth2: [ ]
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:
267       security:
268         - OAuth2: [ ]
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
279           description: 'User to create'
280           schema:
281             $ref: '#/definitions/AddUser'
282       responses:
283         '200':
284           description: successful operation
285           schema:
286             $ref: '#/definitions/AddUserResponse'
287     get:
288       security:
289         - OAuth2: [ ]
290       tags:
291         - User
292       consumes:
293         - application/json
294       produces:
295         - application/json
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
306           description: 'stopping page'
307         - name: sort
308           in: query
309           required: false
310           type: number
311           description: 'sorting'
312       responses:
313         '200':
314           description: successful operation
315           schema:
316             type: array
317             items:
318               $ref: '#/definitions/User'
319   '/users/{id}':
320     delete:
321       security:
322         - OAuth2: [ ]
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:
339       security:
340         - OAuth2: [ ]
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:
359       security:
360         - OAuth2: [ ]
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:
383       security:
384         - OAuth2: [ ]
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:
399       security:
400         - OAuth2: [ ]
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:
418       security:
419         - OAuth2: [ ]
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:
434       security:
435         - OAuth2: [ ]
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:
455       security:
456         - OAuth2: [ ]
457       tags:
458         - User
459       consumes:
460         - application/json
461       produces:
462         - application/json
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
473           description: 'stopping page'
474         - name: sort
475           in: query
476           required: false
477           type: number
478           description: 'sorting'
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:
505       security:
506         - OAuth2: [ ]
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'
523   /videos:
524     get:
525       tags:
526         - Video
527       consumes:
528         - application/json
529       produces:
530         - application/json
531       parameters:
532         - name: start
533           in: query
534           required: false
535           type: number
536           description: 'starting page'
537         - name: stop
538           in: query
539           required: false
540           type: number
541           description: 'stopping page'
542         - name: sort
543           in: query
544           required: false
545           type: number
546           description: 'sorting'
547       responses:
548         '200':
549           description: successful operation
550           schema:
551             type: array
552             items:
553               $ref: '#/definitions/Video'
554   /videos/categories:
555     get:
556       tags:
557         - Video
558       consumes:
559         - application/json
560       produces:
561         - application/json
562       responses:
563         '200':
564           description: successful operation
565           schema:
566             type: array
567             items:
568               type: string
569   /videos/licences:
570     get:
571       tags:
572         - Video
573       consumes:
574         - application/json
575       produces:
576         - application/json
577       responses:
578         '200':
579           description: successful operation
580           schema:
581             type: array
582             items:
583               type: string
584   /videos/languages:
585     get:
586       tags:
587         - Video
588       consumes:
589         - application/json
590       produces:
591         - application/json
592       responses:
593         '200':
594           description: successful operation
595           schema:
596             type: array
597             items:
598               type: string
599   /videos/privacies:
600     get:
601       tags:
602         - Video
603       consumes:
604         - application/json
605       produces:
606         - application/json
607       responses:
608         '200':
609           description: successful operation
610           schema:
611             type: array
612             items:
613               type: string
614   /videos/search:
615     get:
616       tags:
617         - Video
618       consumes:
619         - application/json
620       produces:
621         - application/json
622       parameters:
623         - name: start
624           in: query
625           required: false
626           type: number
627           description: 'starting page'
628         - name: stop
629           in: query
630           required: false
631           type: number
632           description: 'stopping page'
633         - name: sort
634           in: query
635           required: false
636           type: number
637           description: 'sorting'
638       responses:
639         '200':
640           description: successful operation
641           schema:
642             type: array
643             items:
644               $ref: '#/definitions/Video'
645   "/videos/{id}":
646     put:
647       security:
648         - OAuth2: [ ]
649       tags:
650         - Video
651       consumes:
652         - multipart/form-data
653       produces:
654         - application/json
655       parameters:
656         - name: id
657           in: path
658           required: true
659           type: string
660           description: 'The video id'
661         - name: thumbnailfile
662           in: formData
663           type: file
664           description: 'Video thumbnail file'
665         - name: previewfile
666           in: formData
667           type: file
668           description: 'Video preview file'
669         - name: category
670           in: formData
671           type: number
672           description: 'Video category'
673         - name: licence
674           in: formData
675           type: number
676           description: 'Video licence'
677         - name: language
678           in: formData
679           type: string
680           description: 'Video language'
681         - name: description
682           in: formData
683           type: string
684           description: 'Video description'
685         - name: support
686           in: formData
687           type: string
688           description: 'Text describing how to support the video uploader'
689         - name: nsfw
690           in: formData
691           type: boolean
692           description: 'Whether or not this video contains sensitive content'
693         - name: name
694           in: formData
695           type: string
696           description: 'Video name'
697         - name: tags
698           in: formData
699           type: string[]
700           description: 'Video tags'
701         - name: commentsEnabled
702           in: formData
703           type: boolean
704           description: 'Enable or disable comments for this video'
705         - name: privacy
706           in: formData
707           type: string
708           enum: [Public, Unlisted]
709           description: 'Video privacy'
710       responses:
711         '200':
712           description: successful operation
713           schema:
714             $ref: '#/definitions/Video'
715     get:
716       tags:
717         - Video
718       consumes:
719         - application/json
720       produces:
721         - application/json
722       parameters:
723         - name: id
724           in: path
725           required: true
726           type: string
727           description: 'The video id '
728       responses:
729         '200':
730           description: successful operation
731           schema:
732             $ref: '#/definitions/Video'
733     delete:
734       security:
735         - OAuth2: [ ]
736       tags:
737         - Video
738       consumes:
739         - application/json
740       produces:
741         - application/json
742       parameters:
743         - name: id
744           in: path
745           required: true
746           type: string
747           description: 'The video id '
748       responses:
749         '204':
750           description: successful operation
751   "/videos/{id}/description":
752     get:
753       tags:
754         - Video
755       consumes:
756         - application/json
757       produces:
758         - application/json
759       parameters:
760         - name: id
761           in: path
762           required: true
763           type: string
764           description: 'The video id '
765       responses:
766         '200':
767           description: successful operation
768           schema:
769             type: string
770   "/videos/{id}/views":
771     post:
772       tags:
773         - Video
774       consumes:
775         - application/json
776       produces:
777         - application/json
778       parameters:
779         - name: id
780           in: path
781           required: true
782           type: string
783           description: 'The video id '
784       responses:
785         '204':
786           description: successful operation
787   /videos/upload:
788     post:
789       security:
790         - OAuth2: [ ]
791       tags:
792         - Video
793       consumes:
794         - multipart/form-data
795       produces:
796         - application/json
797       parameters:
798         - name: videofile
799           in: formData
800           type: file
801           required: true
802           description: 'Video file'
803         - name: thumbnailfile
804           in: formData
805           type: file
806           required: true
807           description: 'Video thumbnail file'
808         - name: previewfile
809           in: formData
810           type: file
811           required: true
812           description: 'Video preview file'
813         - name: category
814           in: formData
815           type: number
816           description: 'Video category'
817         - name: licence
818           in: formData
819           type: number
820           description: 'Video licence'
821         - name: language
822           in: formData
823           type: string
824           description: 'Video language'
825         - name: description
826           in: formData
827           type: string
828           description: 'Video description'
829         - name: support
830           in: formData
831           type: string
832           description: 'Text describing how to support the video uploader'
833         - name: channelId
834           in: formData
835           required: true
836           type: number
837           description: 'Channel id that will contain this video'
838         - name: nsfw
839           in: formData
840           required: true
841           type: boolean
842           description: 'Whether or not this video contains sensitive content'
843         - name: name
844           in: formData
845           required: true
846           type: string
847           description: 'Video name'
848         - name: tags
849           in: formData
850           type: string[]
851           description: 'Video tags'
852         - name: commentsEnabled
853           in: formData
854           type: boolean
855           description: 'Enable or disable comments for this video'
856         - name: privacy
857           in: formData
858           required: true
859           type: string
860           enum: [Public, Unlisted, Private]
861           description: 'Video privacy'
862       responses:
863         '200':
864           description: successful operation
865           schema:
866             $ref: '#/definitions/VideoUploadResponse'
867   /videos/abuse:
868     get:
869       security:
870         - OAuth2: [ ]
871       tags:
872         - VideoAbuse
873       consumes:
874         - application/json
875       produces:
876         - application/json
877       parameters:
878         - name: start
879           in: query
880           required: false
881           type: number
882           description: 'starting page'
883         - name: stop
884           in: query
885           required: false
886           type: number
887           description: 'stopping page'
888         - name: sort
889           in: query
890           required: false
891           type: number
892           description: 'sorting'
893       responses:
894         '200':
895           description: successful operation
896           schema:
897             type: array
898             items:
899               $ref: '#/definitions/VideoAbuse'
900   "/videos/{id}/abuse":
901     post:
902       security:
903         - OAuth2: [ ]
904       tags:
905         - VideoAbuse
906       consumes:
907         - application/json
908       produces:
909         - application/json
910       parameters:
911         - name: id
912           in: path
913           required: true
914           type: string
915           description: 'The video id '
916       responses:
917         '204':
918           description: successful operation
919   "/videos/{videoId}/blacklist":
920     post:
921       security:
922         - OAuth2: [ ]
923       tags:
924         - VideoBlacklist
925       consumes:
926         - application/json
927       produces:
928         - application/json
929       parameters:
930         - name: videoId
931           in: path
932           required: true
933           type: string
934           description: 'The video id '
935       responses:
936         '204':
937           description: successful operation
938     delete:
939       security:
940         - OAuth2: [ ]
941       tags:
942         - VideoBlacklist
943       consumes:
944         - application/json
945       produces:
946         - application/json
947       parameters:
948         - name: videoId
949           in: path
950           required: true
951           type: string
952           description: 'The video id '
953       responses:
954         '204':
955           description: successful operation
956   /videos/blacklist:
957     get:
958       security:
959         - OAuth2: [ ]
960       tags:
961         - VideoBlacklist
962       consumes:
963         - application/json
964       produces:
965         - application/json
966       parameters:
967         - name: start
968           in: query
969           required: false
970           type: number
971           description: 'starting page'
972         - name: stop
973           in: query
974           required: false
975           type: number
976           description: 'stopping page'
977         - name: sort
978           in: query
979           required: false
980           type: number
981           description: 'sorting'
982       responses:
983         '200':
984           description: successful operation
985           schema:
986             type: array
987             items:
988               $ref: '#/definitions/VideoBlacklist'
989   /video-channels:
990     get:
991       tags:
992         - VideoChannel
993       consumes:
994         - application/json
995       produces:
996         - application/json
997       parameters:
998         - name: start
999           in: query
1000           required: false
1001           type: number
1002           description: 'starting page'
1003         - name: stop
1004           in: query
1005           required: false
1006           type: number
1007           description: 'stopping page'
1008         - name: sort
1009           in: query
1010           required: false
1011           type: number
1012           description: 'sorting'
1013       responses:
1014         '200':
1015           description: successful operation
1016           schema:
1017             type: array
1018             items:
1019               $ref: '#/definitions/VideoChannel'
1020   /accounts/{accountId}/video-channels:
1021     get:
1022       tags:
1023         - VideoChannel
1024       consumes:
1025         - application/json
1026       produces:
1027         - application/json
1028       parameters:
1029         - name: accountId
1030           in: path
1031           required: true
1032           type: string
1033           description: 'The account id '
1034       responses:
1035         '200':
1036           description: successful operation
1037           schema:
1038             type: array
1039             items:
1040               $ref: '#/definitions/VideoChannel'
1041     post:
1042       security:
1043         - OAuth2: [ ]
1044       tags:
1045         - VideoChannel
1046       consumes:
1047         - application/json
1048       produces:
1049         - application/json
1050       parameters:
1051         - name: accountId
1052           in: path
1053           required: true
1054           type: string
1055           description: 'The account id '
1056         - in: body
1057           name: body
1058           schema:
1059             $ref: '#/definitions/VideoChannelInput'
1060       responses:
1061         '204':
1062           description: successful operation
1063   "/account/{accountId}/video-channels/{id}":
1064     get:
1065       tags:
1066         - VideoChannel
1067       consumes:
1068         - application/json
1069       produces:
1070         - application/json
1071       parameters:
1072         - name: accountId
1073           in: path
1074           required: true
1075           type: string
1076           description: 'The account id '
1077         - name: id
1078           in: path
1079           required: true
1080           type: string
1081           description: 'The video channel id '
1082       responses:
1083         '200':
1084           description: successful operation
1085           schema:
1086             $ref: '#/definitions/VideoChannel'
1087     put:
1088       security:
1089         - OAuth2: [ ]
1090       tags:
1091         - VideoChannel
1092       consumes:
1093         - application/json
1094       produces:
1095         - application/json
1096       parameters:
1097         - name: accountId
1098           in: path
1099           required: true
1100           type: string
1101           description: 'The account id '
1102         - name: id
1103           in: path
1104           required: true
1105           type: string
1106           description: 'The video channel id '
1107         - in: body
1108           name: body
1109           schema:
1110             $ref: '#/definitions/VideoChannelInput'
1111       responses:
1112         '204':
1113           description: successful operation
1114     delete:
1115       security:
1116         - OAuth2: [ ]
1117       tags:
1118         - VideoChannel
1119       consumes:
1120         - application/json
1121       produces:
1122         - application/json
1123       parameters:
1124         - name: accountId
1125           in: path
1126           required: true
1127           type: string
1128           description: 'The account id '
1129         - name: id
1130           in: path
1131           required: true
1132           type: string
1133           description: 'The video channel id '
1134       responses:
1135         '204':
1136           description: successful operation
1137   "/account/{accountId}/video-channels/{id}/videos":
1138     get:
1139       tags:
1140         - VideoChannel
1141       consumes:
1142         - application/json
1143       produces:
1144         - application/json
1145       parameters:
1146         - name: accountId
1147           in: path
1148           required: true
1149           type: string
1150           description: 'The account id '
1151         - name: id
1152           in: path
1153           required: true
1154           type: string
1155           description: 'The video channel id '
1156       responses:
1157         '200':
1158           description: successful operation
1159           schema:
1160             $ref: '#/definitions/Video'
1161   "/videos/{videoId}/comment-threads":
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 '
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
1184           description: 'stopping page'
1185         - name: sort
1186           in: query
1187           required: false
1188           type: number
1189           description: 'sorting'
1190       responses:
1191         '200':
1192           description: successful operation
1193           schema:
1194             $ref: '#/definitions/CommentThreadResponse'
1195     post:
1196       security:
1197         - OAuth2: [ ]
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
1213           schema:
1214             $ref: '#/definitions/CommentThreadPostResponse'
1215   "/videos/{videoId}/comment-threads/{threadId}":
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
1237           schema:
1238             $ref: '#/definitions/VideoCommentThreadTree'
1239   "/videos/{videoId}/comments/{commentId}":
1240     post:
1241       security:
1242         - OAuth2: [ ]
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
1263           schema:
1264             $ref: '#/definitions/CommentThreadPostResponse'
1265     delete:
1266       security:
1267         - OAuth2: [ ]
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
1288   "/videos/{id}/rate":
1289     put:
1290       security:
1291         - OAuth2: [ ]
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
1307 definitions:
1308   VideoConstantNumber:
1309     properties:
1310       id:
1311         type: number
1312       label:
1313         type: string
1314   VideoConstantString:
1315     properties:
1316       id:
1317         type: string
1318       label:
1319         type: string
1320   VideoPrivacy:
1321     type: string
1322     enum: [Public, Unlisted, Private]
1323   Video:
1324     properties:
1325       id:
1326         type: number
1327       uuid:
1328         type: string
1329       createdAt:
1330         type: string
1331       publishedAt:
1332         type: string
1333       updatedAt:
1334         type: string
1335       category:
1336         $ref: "#/definitions/VideoConstantNumber"
1337       licence:
1338         $ref: "#/definitions/VideoConstantNumber"
1339       language:
1340         $ref: "#/definitions/VideoConstantString"
1341       privacy:
1342         $ref: "#/definitions/VideoPrivacy"
1343       description:
1344         type: string
1345       duration:
1346         type: number
1347       isLocal:
1348         type: boolean
1349       name:
1350         type: string
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
1365       account:
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"
1378   VideoAbuse:
1379     properties:
1380       id:
1381         type: number
1382       reason:
1383         type: string
1384       reporterAccount:
1385         $ref: "#/definitions/Account"
1386       video:
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
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
1433       ownerAccount:
1434         type: object
1435         properties:
1436           id:
1437             type: number
1438           uuid:
1439             type: string
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"
1462   VideoCommentThreadTree:
1463     properties:
1464       comment:
1465         $ref: "#/definitions/VideoComment"
1466       children:
1467         type: array
1468         items:
1469           $ref: "#/definitions/VideoCommentThreadTree"
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
1520         enum: [User, Moderator, Administrator]
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:
1533       signup:
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
1556           extensions:
1557             type: array
1558             items:
1559               type: string
1560       video:
1561         type: object
1562         properties:
1563           file:
1564             type: object
1565             properties:
1566               extensions:
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
1606 # Api responses
1607   AddUserResponse:
1608     properties:
1609       id:
1610         type: number
1611       uuid:
1612         type: string
1613   VideoUploadResponse:
1614     properties:
1615       video:
1616         type: object
1617         properties:
1618           id:
1619             type: number
1620           uuid:
1621             type: string
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"
1634
1635 # Request bodies
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