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