aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc
diff options
context:
space:
mode:
Diffstat (limited to 'support/doc')
-rw-r--r--support/doc/api/openapi.yaml1209
1 files changed, 1209 insertions, 0 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
new file mode 100644
index 000000000..e6d2f51d8
--- /dev/null
+++ b/support/doc/api/openapi.yaml
@@ -0,0 +1,1209 @@
1swagger: '2.0'
2info:
3 title: peertube
4 version: 0.0.13-alpha
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
734 post:
735 tags:
736 - VideoComment
737 consumes:
738 - application/json
739 produces:
740 - application/json
741 parameters:
742 - name: videoId
743 in: path
744 required: true
745 type: string
746 description: 'The video id '
747 responses:
748 '200':
749 description: successful operation
750 "/video/{videoId}/comment-threads/{threadId}":
751 get:
752 tags:
753 - VideoComment
754 consumes:
755 - application/json
756 produces:
757 - application/json
758 parameters:
759 - name: videoId
760 in: path
761 required: true
762 type: string
763 description: 'The video id '
764 - name: threadId
765 in: path
766 required: true
767 type: string
768 description: 'The thread id '
769 responses:
770 '200':
771 description: successful operation
772 "/video/{videoId}/comments/{commentId}":
773 post:
774 tags:
775 - VideoComment
776 consumes:
777 - application/json
778 produces:
779 - application/json
780 parameters:
781 - name: videoId
782 in: path
783 required: true
784 type: string
785 description: 'The video id '
786 - name: commentId
787 in: path
788 required: true
789 type: string
790 description: 'The comment id '
791 responses:
792 '200':
793 description: successful operation
794 delete:
795 tags:
796 - VideoComment
797 consumes:
798 - application/json
799 produces:
800 - application/json
801 parameters:
802 - name: videoId
803 in: path
804 required: true
805 type: string
806 description: 'The video id '
807 - name: commentId
808 in: path
809 required: true
810 type: string
811 description: 'The comment id '
812 responses:
813 '204':
814 description: successful operation
815 "/video/{id}/rate":
816 put:
817 tags:
818 - VideoRate
819 consumes:
820 - application/json
821 produces:
822 - application/json
823 parameters:
824 - name: id
825 in: path
826 required: true
827 type: string
828 description: 'The video id '
829 responses:
830 '204':
831 description: successful operation
832definitions:
833 Video:
834 properties:
835 id:
836 type: number
837 uuid:
838 type: string
839 accountName:
840 type: string
841 createdAt:
842 type: string
843 updatedAt:
844 type: string
845 categoryLabel:
846 type: string
847 category:
848 type: number
849 licenceLabel:
850 type: string
851 licence:
852 type: number
853 languageLabel:
854 type: string
855 language:
856 type: number
857 description:
858 type: string
859 duration:
860 type: number
861 isLocal:
862 type: boolean
863 name:
864 type: string
865 serverHost:
866 type: string
867 thumbnailPath:
868 type: string
869 previewPath:
870 type: string
871 embedPath:
872 type: string
873 views:
874 type: number
875 likes:
876 type: number
877 dislikes:
878 type: number
879 nsfw:
880 type: boolean
881 VideoAbuse:
882 properties:
883 id:
884 type: number
885 reason:
886 type: string
887 reporterUsername:
888 type: string
889 reporterServerHost:
890 type: string
891 videoId:
892 type: number
893 videoUUID:
894 type: string
895 videoName:
896 type: string
897 createdAt:
898 type: string
899 VideoBlacklist:
900 properties:
901 id:
902 type: number
903 videoId:
904 type: number
905 createdAt:
906 type: string
907 updatedAt:
908 type: string
909 name:
910 type: string
911 uuid:
912 type: string
913 description:
914 type: string
915 duration:
916 type: number
917 views:
918 type: number
919 likes:
920 type: number
921 dislikes:
922 type: number
923 nsfw:
924 type: boolean
925 VideoChannel:
926 properties:
927 displayName:
928 type: string
929 description:
930 type: string
931 isLocal:
932 type: boolean
933 owner:
934 type: object
935 properties:
936 name:
937 type: string
938 uuid:
939 type: string
940 videos:
941 type: array
942 items:
943 $ref: "#/definitions/Video"
944 VideoComment:
945 properties:
946 id:
947 type: number
948 url:
949 type: string
950 text:
951 type: string
952 threadId:
953 type: number
954 inReplyToCommentId:
955 type: number
956 videoId:
957 type: number
958 createdAt:
959 type: string
960 updatedAt:
961 type: string
962 totalReplies:
963 type: number
964 account:
965 $ref: "#/definitions/Account"
966 Avatar:
967 properties:
968 path:
969 type: string
970 createdAt:
971 type: string
972 updatedAt:
973 type: string
974 Actor:
975 properties:
976 id:
977 type: number
978 uuid:
979 type: string
980 url:
981 type: string
982 name:
983 type: string
984 host:
985 type: string
986 followingCount:
987 type: number
988 followersCount:
989 type: number
990 createdAt:
991 type: string
992 updatedAt:
993 type: string
994 avatar:
995 $ref: "#/definitions/Avatar"
996 Account:
997 allOf:
998 - $ref: "#/definitions/Actor"
999 - properties:
1000 displayName:
1001 type: string
1002 User:
1003 properties:
1004 id:
1005 type: number
1006 username:
1007 type: string
1008 email:
1009 type: string
1010 displayNSFW:
1011 type: boolean
1012 autoPlayVideo:
1013 type: boolean
1014 role:
1015 type: string
1016 enum: [User, Moderator, Administrator]
1017 videoQuota:
1018 type: number
1019 createdAt:
1020 type: string
1021 account:
1022 $ref: "#/definitions/Account"
1023 videoChannels:
1024 type: array
1025 items:
1026 $ref: "#/definitions/VideoChannel"
1027 ServerConfig:
1028 properties:
1029 signup:
1030 type: object
1031 properties:
1032 allowed:
1033 type: boolean
1034 transcoding:
1035 type: object
1036 properties:
1037 enabledResolutions:
1038 type: array
1039 items:
1040 type: number
1041 avatar:
1042 type: object
1043 properties:
1044 file:
1045 type: object
1046 properties:
1047 size:
1048 type: object
1049 properties:
1050 max:
1051 type: number
1052 extensions:
1053 type: array
1054 items:
1055 type: string
1056 video:
1057 type: object
1058 properties:
1059 file:
1060 type: object
1061 properties:
1062 extensions:
1063 type: array
1064 items:
1065 type: string
1066 Follow:
1067 properties:
1068 id:
1069 type: number
1070 follower:
1071 $ref: "#/definitions/Actor"
1072 following:
1073 $ref: "#/definitions/Actor"
1074 score:
1075 type: number
1076 state:
1077 type: string
1078 enum: [pending, accepted]
1079 createdAt:
1080 type: string
1081 updatedAt:
1082 type: string
1083 Job:
1084 properties:
1085 id:
1086 type: number
1087 state:
1088 type: string
1089 enum: [pending, processing, error, success]
1090 category:
1091 type: string
1092 enum: [transcoding, activitypub-http]
1093 handlerName:
1094 type: string
1095 handlerInputData:
1096 type: string
1097 createdAt:
1098 type: string
1099 updatedAt:
1100 type: string
1101
1102#Api responses
1103 AddUserResponse:
1104 properties:
1105 id:
1106 type: number
1107 uuid:
1108 type: string
1109 VideoUploadResponse:
1110 properties:
1111 id:
1112 type: number
1113 uuid:
1114 type: string
1115
1116#input bodies
1117 AddUser:
1118 properties:
1119 username:
1120 type: string
1121 description: 'The user username '
1122 password:
1123 type: string
1124 description: 'The user password '
1125 email:
1126 type: string
1127 description: 'The user email '
1128 videoQuota:
1129 type: string
1130 description: 'The user videoQuota '
1131 role:
1132 type: string
1133 description: 'The user role '
1134 required:
1135 - username
1136 - password
1137 - email
1138 - videoQuota
1139 - role
1140 UpdateUser:
1141 properties:
1142 id:
1143 type: string
1144 description: 'The user id '
1145 email:
1146 type: string
1147 description: 'The updated email of the user '
1148 videoQuota:
1149 type: string
1150 description: 'The updated videoQuota of the user '
1151 role:
1152 type: string
1153 description: 'The updated role of the user '
1154 required:
1155 - id
1156 - email
1157 - videoQuota
1158 - role
1159 UpdateMe:
1160 properties:
1161 password:
1162 type: string
1163 description: 'Your new password '
1164 email:
1165 type: string
1166 description: 'Your new email '
1167 displayNSFW:
1168 type: string
1169 description: 'Your new displayNSFW '
1170 autoPlayVideo:
1171 type: string
1172 description: 'Your new autoPlayVideo '
1173 required:
1174 - password
1175 - email
1176 - displayNSFW
1177 - autoPlayVideo
1178 GetMeVideoRating:
1179 properties:
1180 id:
1181 type: string
1182 description: 'Id of the video '
1183 rating:
1184 type: number
1185 description: 'Rating of the video '
1186 required:
1187 - id
1188 - rating
1189 RegisterUser:
1190 properties:
1191 username:
1192 type: string
1193 description: 'The username of the user '
1194 password:
1195 type: string
1196 description: 'The password of the user '
1197 email:
1198 type: string
1199 description: 'The email of the user '
1200 required:
1201 - username
1202 - password
1203 - email
1204 VideoChannelInput:
1205 properties:
1206 name:
1207 type: string
1208 description:
1209 type: string