]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/doc/api/openapi.yaml
Openapi consistency
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
1 openapi: 3.0.0
2 info:
3 title: PeerTube
4 version: 2.1.1
5 contact:
6 name: PeerTube Community
7 url: 'https://joinpeertube.org'
8 license:
9 name: AGPLv3.0
10 url: 'https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE'
11 x-logo:
12 url: 'https://joinpeertube.org/img/brand.png'
13 altText: PeerTube Project Homepage
14 description: |
15 # Introduction
16
17 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite
18 HTTP/REST library for your programming language to use PeerTube. No official
19 SDK is currently provided, but the spec API is fully compatible with
20 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
21 which generates a client SDK in the language of your choice.
22
23 See the [Quick Start guide](https://docs.joinpeertube.org/#/api-rest-getting-started) so you can play with the PeerTube API.
24
25 # Authentication
26
27 When you sign up for an account, you are given the possibility to generate
28 sessions, and authenticate using this session token. One session token can
29 currently be used at a time.
30
31 # Errors
32
33 The API uses standard HTTP status codes to indicate the success or failure
34 of the API call. The body of the response will be JSON in the following
35 format.
36
37 ```
38 {
39 "code": "unauthorized_request", // example inner error code
40 "error": "Token is invalid." // example exposed error message
41 }
42 ```
43 externalDocs:
44 url: https://docs.joinpeertube.org/api-rest-reference.html
45 tags:
46 - name: Accounts
47 description: >
48 Using some features of PeerTube require authentication, for which Accounts
49 provide different levels of permission as well as associated user
50 information. Accounts also encompass remote accounts discovered across the federation.
51 - name: Config
52 description: >
53 Each server exposes public information regarding supported videos and
54 options.
55 - name: Job
56 description: >
57 Jobs are long-running tasks enqueued and processed by the instance
58 itself. No additional worker registration is currently available.
59 - name: Instance Follows
60 description: >
61 Managing servers which the instance interacts with is crucial to the
62 concept of federation in PeerTube and external video indexation. The PeerTube
63 server then deals with inter-server ActivityPub operations and propagates
64 information across its social graph by posting activities to actors' inbox
65 endpoints.
66 - name: Video Abuse
67 description: |
68 Video abuses deal with reports of local or remote videos alike.
69 - name: Video
70 description: |
71 Operations dealing with listing, uploading, fetching or modifying videos.
72 - name: Search
73 description: |
74 The search helps to find _videos_ from within the instance and beyond.
75 Videos from other instances federated by the instance (that is, instances
76 followed by the instance) can be found via keywords and other criteria of
77 the advanced search.
78 - name: Video Comments
79 description: >
80 Operations dealing with comments to a video. Comments are organized in
81 threads.
82 - name: Video Playlists
83 description: >
84 Operations dealing with playlists of videos. Playlists are bound to users
85 and/or channels.
86 - name: Video Channels
87 description: >
88 Operations dealing with creation, modification and video listing of a
89 user's channels.
90 - name: Video Blacklist
91 description: >
92 Operations dealing with blacklisting videos (removing them from view and
93 preventing interactions).
94 - name: Video Rates
95 description: >
96 Like/dislike a video.
97 x-tagGroups:
98 - name: Accounts
99 tags:
100 - Accounts
101 - Users
102 - My User
103 - My Subscriptions
104 - name: Videos
105 tags:
106 - Video
107 - Video Caption
108 - Video Channels
109 - Video Comments
110 - Video Following
111 - Video Rates
112 - Video Playlists
113 - Video Ownership Change
114 - name: Search
115 tags:
116 - Search
117 - name: Moderation
118 tags:
119 - Video Abuse
120 - Video Blacklist
121 - name: Instance Configuration
122 tags:
123 - Config
124 - Instance Follows
125 - name: Jobs
126 tags:
127 - Job
128 paths:
129 '/accounts/{name}':
130 get:
131 tags:
132 - Accounts
133 summary: Get an account
134 parameters:
135 - $ref: '#/components/parameters/name'
136 responses:
137 '200':
138 description: successful operation
139 content:
140 application/json:
141 schema:
142 $ref: '#/components/schemas/Account'
143 '/accounts/{name}/videos':
144 get:
145 tags:
146 - Accounts
147 - Video
148 summary: 'List videos of an account'
149 parameters:
150 - $ref: '#/components/parameters/name'
151 responses:
152 '200':
153 description: successful operation
154 content:
155 application/json:
156 schema:
157 $ref: '#/components/schemas/VideoListResponse'
158 x-code-samples:
159 - lang: JavaScript
160 source: |
161 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
162 .then(function(response) {
163 return response.json()
164 }).then(function(data) {
165 console.log(data)
166 })
167 - lang: Shell
168 source: |
169 # pip install httpie
170 http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
171 - lang: Ruby
172 source: |
173 require 'net/http'
174 require 'json'
175
176 uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
177
178 http = Net::HTTP.new(uri.host, uri.port)
179 http.use_ssl = true
180
181 response = http.get(uri.request_uri)
182
183 puts JSON.parse(response.read_body)
184 - lang: Python
185 source: |
186 import requests
187
188 r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
189 json = r.json()
190
191 print(json)
192 /accounts:
193 get:
194 tags:
195 - Accounts
196 summary: List accounts
197 parameters:
198 - $ref: '#/components/parameters/start'
199 - $ref: '#/components/parameters/count'
200 - $ref: '#/components/parameters/sort'
201 responses:
202 '200':
203 description: successful operation
204 content:
205 'application/json':
206 schema:
207 type: array
208 items:
209 $ref: '#/components/schemas/Account'
210 /config:
211 get:
212 tags:
213 - Config
214 summary: Get instance public configuration
215 responses:
216 '200':
217 description: successful operation
218 content:
219 application/json:
220 schema:
221 $ref: '#/components/schemas/ServerConfig'
222 /config/about:
223 get:
224 summary: Get instance "About" information
225 tags:
226 - Config
227 responses:
228 '200':
229 description: successful operation
230 content:
231 application/json:
232 schema:
233 $ref: '#/components/schemas/ServerConfigAbout'
234 /config/custom:
235 get:
236 summary: Get instance runtime configuration
237 tags:
238 - Config
239 security:
240 - OAuth2:
241 - admin
242 responses:
243 '200':
244 description: successful operation
245 content:
246 application/json:
247 schema:
248 $ref: '#/components/schemas/ServerConfigCustom'
249 put:
250 summary: Set instance runtime configuration
251 tags:
252 - Config
253 security:
254 - OAuth2:
255 - admin
256 responses:
257 '200':
258 description: successful operation
259 delete:
260 summary: Delete instance runtime configuration
261 tags:
262 - Config
263 security:
264 - OAuth2:
265 - admin
266 responses:
267 '200':
268 description: successful operation
269 /jobs/{state}:
270 get:
271 summary: List instance jobs
272 security:
273 - OAuth2:
274 - admin
275 tags:
276 - Job
277 parameters:
278 - name: state
279 in: path
280 required: true
281 description: The state of the job
282 schema:
283 type: string
284 enum:
285 - active
286 - completed
287 - failed
288 - waiting
289 - delayed
290 - $ref: '#/components/parameters/start'
291 - $ref: '#/components/parameters/count'
292 - $ref: '#/components/parameters/sort'
293 responses:
294 '200':
295 description: successful operation
296 content:
297 application/json:
298 schema:
299 type: array
300 items:
301 $ref: '#/components/schemas/Job'
302 '/server/following/{host}':
303 delete:
304 security:
305 - OAuth2:
306 - admin
307 tags:
308 - Instance Follows
309 summary: Unfollow a server
310 parameters:
311 - name: host
312 in: path
313 required: true
314 description: 'The host to unfollow '
315 schema:
316 type: string
317 responses:
318 '201':
319 description: successful operation
320 /server/followers:
321 get:
322 tags:
323 - Instance Follows
324 summary: List instance followers
325 parameters:
326 - $ref: '#/components/parameters/start'
327 - $ref: '#/components/parameters/count'
328 - $ref: '#/components/parameters/sort'
329 responses:
330 '200':
331 description: successful operation
332 content:
333 application/json:
334 schema:
335 type: array
336 items:
337 $ref: '#/components/schemas/Follow'
338 /server/following:
339 get:
340 tags:
341 - Instance Follows
342 summary: List instance followings
343 parameters:
344 - $ref: '#/components/parameters/start'
345 - $ref: '#/components/parameters/count'
346 - $ref: '#/components/parameters/sort'
347 responses:
348 '200':
349 description: successful operation
350 content:
351 application/json:
352 schema:
353 type: array
354 items:
355 $ref: '#/components/schemas/Follow'
356 post:
357 security:
358 - OAuth2:
359 - admin
360 tags:
361 - Instance Follows
362 summary: Follow a server
363 responses:
364 '204':
365 $ref: '#/paths/~1users~1me/put/responses/204'
366 requestBody:
367 content:
368 application/json:
369 schema:
370 $ref: '#/components/schemas/Follow'
371 /users:
372 post:
373 summary: Create a user
374 security:
375 - OAuth2:
376 - admin
377 tags:
378 - Users
379 responses:
380 '200':
381 description: successful operation
382 content:
383 application/json:
384 schema:
385 $ref: '#/components/schemas/AddUserResponse'
386 requestBody:
387 content:
388 application/json:
389 schema:
390 $ref: '#/components/schemas/AddUser'
391 description: User to create
392 required: true
393 get:
394 summary: List users
395 security:
396 - OAuth2: []
397 tags:
398 - Users
399 parameters:
400 - $ref: '#/components/parameters/start'
401 - $ref: '#/components/parameters/count'
402 - $ref: '#/components/parameters/usersSort'
403 responses:
404 '200':
405 description: successful operation
406 content:
407 application/json:
408 schema:
409 type: array
410 items:
411 $ref: '#/components/schemas/User'
412 '/users/{id}':
413 delete:
414 summary: Delete a user
415 security:
416 - OAuth2:
417 - admin
418 tags:
419 - Users
420 parameters:
421 - $ref: '#/components/parameters/id'
422 responses:
423 '204':
424 $ref: '#/paths/~1users~1me/put/responses/204'
425 get:
426 summary: Get a user
427 security:
428 - OAuth2: []
429 tags:
430 - Users
431 parameters:
432 - $ref: '#/components/parameters/id'
433 responses:
434 '200':
435 description: successful operation
436 content:
437 application/json:
438 schema:
439 $ref: '#/components/schemas/User'
440 put:
441 summary: Update a user
442 security:
443 - OAuth2: []
444 tags:
445 - Users
446 parameters:
447 - $ref: '#/components/parameters/id'
448 responses:
449 '204':
450 $ref: '#/paths/~1users~1me/put/responses/204'
451 requestBody:
452 content:
453 application/json:
454 schema:
455 $ref: '#/components/schemas/UpdateUser'
456 required: true
457 /users/register:
458 post:
459 summary: Register a user
460 tags:
461 - Users
462 responses:
463 '204':
464 $ref: '#/paths/~1users~1me/put/responses/204'
465 requestBody:
466 content:
467 application/json:
468 schema:
469 $ref: '#/components/schemas/RegisterUser'
470 required: true
471 /users/me:
472 get:
473 summary: Get my user information
474 security:
475 - OAuth2:
476 - user
477 tags:
478 - My User
479 responses:
480 '200':
481 description: successful operation
482 content:
483 application/json:
484 schema:
485 type: array
486 items:
487 $ref: '#/components/schemas/User'
488 put:
489 summary: Update my user information
490 security:
491 - OAuth2:
492 - user
493 tags:
494 - My User
495 responses:
496 '204':
497 description: successful operation
498 requestBody:
499 content:
500 application/json:
501 schema:
502 $ref: '#/components/schemas/UpdateMe'
503 required: true
504 /users/me/videos/imports:
505 get:
506 summary: Get video imports of my user
507 security:
508 - OAuth2:
509 - user
510 tags:
511 - Videos
512 - My User
513 parameters:
514 - $ref: '#/components/parameters/start'
515 - $ref: '#/components/parameters/count'
516 - $ref: '#/components/parameters/sort'
517 responses:
518 '200':
519 description: successful operation
520 content:
521 application/json:
522 schema:
523 $ref: '#/components/schemas/VideoImport'
524 /users/me/video-quota-used:
525 get:
526 summary: Get my user used quota
527 security:
528 - OAuth2:
529 - user
530 tags:
531 - My User
532 responses:
533 '200':
534 description: successful operation
535 content:
536 application/json:
537 schema:
538 type: number
539 '/users/me/videos/{videoId}/rating':
540 get:
541 summary: Get rate of my user of a video
542 security:
543 - OAuth2: []
544 tags:
545 - My User
546 - Video Rates
547 parameters:
548 - name: videoId
549 in: path
550 required: true
551 description: 'The video id '
552 schema:
553 type: string
554 responses:
555 '200':
556 description: successful operation
557 content:
558 application/json:
559 schema:
560 $ref: '#/components/schemas/GetMeVideoRating'
561 /users/me/videos:
562 get:
563 summary: Get videos of my user
564 security:
565 - OAuth2:
566 - user
567 tags:
568 - My User
569 - Videos
570 parameters:
571 - $ref: '#/components/parameters/start'
572 - $ref: '#/components/parameters/count'
573 - $ref: '#/components/parameters/sort'
574 responses:
575 '200':
576 description: successful operation
577 content:
578 application/json:
579 schema:
580 $ref: '#/components/schemas/VideoListResponse'
581 /users/me/subscriptions:
582 get:
583 summary: Get my user subscriptions
584 security:
585 - OAuth2:
586 - user
587 tags:
588 - My Subscriptions
589 parameters:
590 - $ref: '#/components/parameters/start'
591 - $ref: '#/components/parameters/count'
592 - $ref: '#/components/parameters/sort'
593 responses:
594 '200':
595 description: successful operation
596 post:
597 summary: Add subscription to my user
598 security:
599 - OAuth2:
600 - user
601 tags:
602 - My Subscriptions
603 responses:
604 '200':
605 description: successful operation
606 /users/me/subscriptions/exist:
607 get:
608 summary: Get if subscriptions exist for my user
609 security:
610 - OAuth2:
611 - user
612 tags:
613 - My Subscriptions
614 parameters:
615 - $ref: '#/components/parameters/subscriptionsUris'
616 responses:
617 '200':
618 description: successful operation
619 content:
620 application/json:
621 schema:
622 type: object
623 /users/me/subscriptions/videos:
624 get:
625 summary: List videos of subscriptions of my user
626 security:
627 - OAuth2:
628 - user
629 tags:
630 - My Subscriptions
631 - Videos
632 parameters:
633 - $ref: '#/components/parameters/start'
634 - $ref: '#/components/parameters/count'
635 - $ref: '#/components/parameters/sort'
636 responses:
637 '200':
638 description: successful operation
639 content:
640 application/json:
641 schema:
642 $ref: '#/components/schemas/VideoListResponse'
643 '/users/me/subscriptions/{subscriptionHandle}':
644 get:
645 summary: Get subscription of my user
646 security:
647 - OAuth2:
648 - user
649 tags:
650 - My Subscriptions
651 parameters:
652 - $ref: '#/components/parameters/subscriptionHandle'
653 responses:
654 '200':
655 description: successful operation
656 content:
657 application/json:
658 schema:
659 $ref: '#/components/schemas/VideoChannel'
660 delete:
661 summary: Delete subscription of my user
662 security:
663 - OAuth2:
664 - user
665 tags:
666 - My Subscriptions
667 parameters:
668 - $ref: '#/components/parameters/subscriptionHandle'
669 responses:
670 '200':
671 description: successful operation
672 /users/me/avatar/pick:
673 post:
674 summary: Update my user avatar
675 security:
676 - OAuth2: []
677 tags:
678 - My User
679 responses:
680 '200':
681 description: successful operation
682 content:
683 application/json:
684 schema:
685 $ref: '#/components/schemas/Avatar'
686 requestBody:
687 content:
688 multipart/form-data:
689 schema:
690 type: object
691 properties:
692 avatarfile:
693 description: The file to upload.
694 type: string
695 format: binary
696 encoding:
697 avatarfile:
698 contentType: image/png, image/jpeg
699 /videos/ownership:
700 get:
701 summary: List video ownership changes
702 tags:
703 - Video Ownership Change
704 security:
705 - OAuth2: []
706 responses:
707 '200':
708 description: successful operation
709 '/videos/ownership/{id}/accept':
710 post:
711 summary: Accept ownership change request
712 tags:
713 - Video Ownership Change
714 security:
715 - OAuth2: []
716 parameters:
717 - $ref: '#/components/parameters/idOrUUID'
718 responses:
719 '204':
720 $ref: '#/paths/~1users~1me/put/responses/204'
721 '/videos/ownership/{id}/refuse':
722 post:
723 summary: Refuse ownership change request
724 tags:
725 - Video Ownership Change
726 security:
727 - OAuth2: []
728 parameters:
729 - $ref: '#/components/parameters/idOrUUID'
730 responses:
731 '204':
732 $ref: '#/paths/~1users~1me/put/responses/204'
733 '/videos/{id}/give-ownership':
734 post:
735 summary: Request ownership change
736 tags:
737 - Video Ownership Change
738 security:
739 - OAuth2: []
740 parameters:
741 - $ref: '#/components/parameters/idOrUUID'
742 requestBody:
743 required: true
744 content:
745 application/x-www-form-urlencoded:
746 schema:
747 type: object
748 properties:
749 username:
750 type: string
751 required:
752 - username
753 responses:
754 '204':
755 $ref: '#/paths/~1users~1me/put/responses/204'
756 '400':
757 description: 'Changing video ownership to a remote account is not supported yet'
758 /videos:
759 get:
760 summary: List videos
761 tags:
762 - Video
763 parameters:
764 - $ref: '#/components/parameters/categoryOneOf'
765 - $ref: '#/components/parameters/tagsOneOf'
766 - $ref: '#/components/parameters/tagsAllOf'
767 - $ref: '#/components/parameters/licenceOneOf'
768 - $ref: '#/components/parameters/languageOneOf'
769 - $ref: '#/components/parameters/nsfw'
770 - $ref: '#/components/parameters/filter'
771 - $ref: '#/components/parameters/start'
772 - $ref: '#/components/parameters/count'
773 - $ref: '#/components/parameters/videosSort'
774 responses:
775 '200':
776 description: successful operation
777 content:
778 application/json:
779 schema:
780 $ref: '#/components/schemas/VideoListResponse'
781 /videos/categories:
782 get:
783 summary: List available video categories
784 tags:
785 - Video
786 responses:
787 '200':
788 description: successful operation
789 content:
790 application/json:
791 schema:
792 type: array
793 items:
794 type: string
795 /videos/licences:
796 get:
797 summary: List available video licences
798 tags:
799 - Video
800 responses:
801 '200':
802 description: successful operation
803 content:
804 application/json:
805 schema:
806 type: array
807 items:
808 type: string
809 /videos/languages:
810 get:
811 summary: List available video languages
812 tags:
813 - Video
814 responses:
815 '200':
816 description: successful operation
817 content:
818 application/json:
819 schema:
820 type: array
821 items:
822 type: string
823 /videos/privacies:
824 get:
825 summary: List available video privacies
826 tags:
827 - Video
828 responses:
829 '200':
830 description: successful operation
831 content:
832 application/json:
833 schema:
834 type: array
835 items:
836 type: string
837 '/videos/{id}':
838 put:
839 summary: Update a video
840 security:
841 - OAuth2: []
842 tags:
843 - Video
844 parameters:
845 - $ref: '#/components/parameters/idOrUUID'
846 responses:
847 '204':
848 description: successful operation
849 requestBody:
850 content:
851 multipart/form-data:
852 schema:
853 type: object
854 properties:
855 thumbnailfile:
856 description: Video thumbnail file
857 type: string
858 format: binary
859 previewfile:
860 description: Video preview file
861 type: string
862 format: binary
863 category:
864 description: Video category
865 type: string
866 licence:
867 description: Video licence
868 type: string
869 language:
870 description: Video language
871 type: string
872 description:
873 description: Video description
874 type: string
875 waitTranscoding:
876 description: Whether or not we wait transcoding before publish the video
877 type: string
878 support:
879 description: Text describing how to support the video uploader
880 type: string
881 nsfw:
882 description: Whether or not this video contains sensitive content
883 type: string
884 name:
885 description: Video name
886 type: string
887 tags:
888 description: Video tags (maximum 5 tags each between 2 and 30 characters)
889 type: array
890 minItems: 1
891 maxItems: 5
892 items:
893 type: string
894 minLength: 2
895 maxLength: 30
896 commentsEnabled:
897 description: Enable or disable comments for this video
898 type: string
899 originallyPublishedAt:
900 description: Date when the content was originally published
901 type: string
902 format: date-time
903 scheduleUpdate:
904 $ref: '#/components/schemas/VideoScheduledUpdate'
905 encoding:
906 thumbnailfile:
907 contentType: image/jpeg
908 previewfile:
909 contentType: image/jpeg
910 get:
911 summary: Get a video
912 tags:
913 - Video
914 parameters:
915 - $ref: '#/components/parameters/idOrUUID'
916 responses:
917 '200':
918 description: successful operation
919 content:
920 application/json:
921 schema:
922 $ref: '#/components/schemas/VideoDetails'
923 delete:
924 summary: Delete a video
925 security:
926 - OAuth2: []
927 tags:
928 - Video
929 parameters:
930 - $ref: '#/components/parameters/idOrUUID'
931 responses:
932 '204':
933 $ref: '#/paths/~1users~1me/put/responses/204'
934 '/videos/{id}/description':
935 get:
936 summary: Get complete video description
937 tags:
938 - Video
939 parameters:
940 - $ref: '#/components/parameters/idOrUUID'
941 responses:
942 '200':
943 description: successful operation
944 content:
945 application/json:
946 schema:
947 type: string
948 '/videos/{id}/views':
949 post:
950 summary: Add a view to a video
951 tags:
952 - Video
953 parameters:
954 - $ref: '#/components/parameters/idOrUUID'
955 responses:
956 '204':
957 $ref: '#/paths/~1users~1me/put/responses/204'
958 '/videos/{id}/watching':
959 put:
960 summary: Set watching progress of a video
961 tags:
962 - Video
963 security:
964 - OAuth2: []
965 parameters:
966 - $ref: '#/components/parameters/idOrUUID'
967 requestBody:
968 content:
969 application/json:
970 schema:
971 $ref: '#/components/schemas/UserWatchingVideo'
972 required: true
973 responses:
974 '204':
975 $ref: '#/paths/~1users~1me/put/responses/204'
976 /videos/upload:
977 post:
978 summary: Upload a video
979 security:
980 - OAuth2: []
981 tags:
982 - Video
983 responses:
984 '200':
985 description: successful operation
986 content:
987 application/json:
988 schema:
989 $ref: '#/components/schemas/VideoUploadResponse'
990 '403':
991 description: 'The user video quota is exceeded with this video.'
992 '408':
993 description: 'Upload has timed out'
994 '422':
995 description: 'Invalid input file.'
996 requestBody:
997 content:
998 multipart/form-data:
999 schema:
1000 type: object
1001 properties:
1002 videofile:
1003 description: Video file
1004 type: string
1005 format: binary
1006 channelId:
1007 description: Channel id that will contain this video
1008 type: number
1009 thumbnailfile:
1010 description: Video thumbnail file
1011 type: string
1012 format: binary
1013 previewfile:
1014 description: Video preview file
1015 type: string
1016 format: binary
1017 privacy:
1018 $ref: '#/components/schemas/VideoPrivacySet'
1019 category:
1020 description: Video category
1021 type: string
1022 licence:
1023 description: Video licence
1024 type: string
1025 language:
1026 description: Video language
1027 type: string
1028 description:
1029 description: Video description
1030 type: string
1031 waitTranscoding:
1032 description: Whether or not we wait transcoding before publish the video
1033 type: string
1034 support:
1035 description: Text describing how to support the video uploader
1036 type: string
1037 nsfw:
1038 description: Whether or not this video contains sensitive content
1039 type: string
1040 name:
1041 description: Video name
1042 type: string
1043 tags:
1044 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1045 type: array
1046 minItems: 1
1047 maxItems: 5
1048 items:
1049 type: string
1050 minLength: 2
1051 maxLength: 30
1052 commentsEnabled:
1053 description: Enable or disable comments for this video
1054 type: string
1055 originallyPublishedAt:
1056 description: Date when the content was originally published
1057 type: string
1058 format: date-time
1059 scheduleUpdate:
1060 $ref: '#/components/schemas/VideoScheduledUpdate'
1061 required:
1062 - videofile
1063 - channelId
1064 - name
1065 encoding:
1066 videofile:
1067 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
1068 thumbnailfile:
1069 contentType: image/jpeg
1070 previewfile:
1071 contentType: image/jpeg
1072 x-code-samples:
1073 - lang: Shell
1074 source: |
1075 ## DEPENDENCIES: httpie, jq
1076 # pip install httpie
1077 USERNAME="<your_username>"
1078 PASSWORD="<your_password>"
1079 FILE_PATH="<your_file_path>"
1080 CHANNEL_ID="<your_channel_id>"
1081 NAME="<video_name>"
1082
1083 API_PATH="https://peertube2.cpy.re/api/v1"
1084 ## AUTH
1085 client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1086 client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1087 token=$(http -b --form POST "$API_PATH/users/token" \
1088 client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
1089 username=$USERNAME \
1090 password=$PASSWORD \
1091 | jq -r ".access_token")
1092 ## VIDEO UPLOAD
1093 http -b --form POST "$API_PATH/videos/upload" \
1094 videofile@$FILE_PATH \
1095 channelId=$CHANNEL_ID \
1096 name=$NAME \
1097 "Authorization:Bearer $token"
1098 /videos/imports:
1099 post:
1100 summary: Import a video
1101 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
1102 security:
1103 - OAuth2: []
1104 tags:
1105 - Video
1106 responses:
1107 '200':
1108 description: successful operation
1109 content:
1110 application/json:
1111 schema:
1112 $ref: '#/components/schemas/VideoUploadResponse'
1113 requestBody:
1114 content:
1115 multipart/form-data:
1116 schema:
1117 type: object
1118 properties:
1119 torrentfile:
1120 description: Torrent File
1121 type: string
1122 format: binary
1123 targetUrl:
1124 description: HTTP target URL
1125 type: string
1126 magnetUri:
1127 description: Magnet URI
1128 type: string
1129 channelId:
1130 description: Channel id that will contain this video
1131 type: number
1132 thumbnailfile:
1133 description: Video thumbnail file
1134 type: string
1135 format: binary
1136 previewfile:
1137 description: Video preview file
1138 type: string
1139 format: binary
1140 privacy:
1141 $ref: '#/components/schemas/VideoPrivacySet'
1142 category:
1143 description: Video category
1144 type: string
1145 licence:
1146 description: Video licence
1147 type: string
1148 language:
1149 description: Video language
1150 type: string
1151 description:
1152 description: Video description
1153 type: string
1154 waitTranscoding:
1155 description: Whether or not we wait transcoding before publish the video
1156 type: string
1157 support:
1158 description: Text describing how to support the video uploader
1159 type: string
1160 nsfw:
1161 description: Whether or not this video contains sensitive content
1162 type: string
1163 name:
1164 description: Video name
1165 type: string
1166 tags:
1167 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1168 type: array
1169 minItems: 1
1170 maxItems: 5
1171 items:
1172 type: string
1173 minLength: 2
1174 maxLength: 30
1175 commentsEnabled:
1176 description: Enable or disable comments for this video
1177 type: string
1178 scheduleUpdate:
1179 $ref: '#/components/schemas/VideoScheduledUpdate'
1180 required:
1181 - channelId
1182 - name
1183 encoding:
1184 torrentfile:
1185 contentType: application/x-bittorrent
1186 thumbnailfile:
1187 contentType: image/jpeg
1188 previewfile:
1189 contentType: image/jpeg
1190 /videos/abuse:
1191 get:
1192 summary: List video abuses
1193 security:
1194 - OAuth2:
1195 - admin
1196 - moderator
1197 tags:
1198 - Video Abuse
1199 parameters:
1200 - $ref: '#/components/parameters/start'
1201 - $ref: '#/components/parameters/count'
1202 - $ref: '#/components/parameters/abusesSort'
1203 responses:
1204 '200':
1205 description: successful operation
1206 content:
1207 application/json:
1208 schema:
1209 type: array
1210 items:
1211 $ref: '#/components/schemas/VideoAbuse'
1212 '/videos/{id}/abuse':
1213 post:
1214 summary: Report an abuse
1215 security:
1216 - OAuth2: []
1217 tags:
1218 - Video Abuse
1219 parameters:
1220 - $ref: '#/components/parameters/idOrUUID'
1221 responses:
1222 '204':
1223 $ref: '#/paths/~1users~1me/put/responses/204'
1224 '/videos/{id}/blacklist':
1225 post:
1226 summary: Blacklist a video
1227 security:
1228 - OAuth2:
1229 - admin
1230 - moderator
1231 tags:
1232 - Video Blacklist
1233 parameters:
1234 - $ref: '#/components/parameters/idOrUUID'
1235 responses:
1236 '204':
1237 $ref: '#/paths/~1users~1me/put/responses/204'
1238 delete:
1239 summary: Delete an entry of the blacklist of a video by its id
1240 security:
1241 - OAuth2:
1242 - admin
1243 - moderator
1244 tags:
1245 - Video Blacklist
1246 parameters:
1247 - $ref: '#/components/parameters/idOrUUID'
1248 responses:
1249 '204':
1250 $ref: '#/paths/~1users~1me/put/responses/204'
1251 /videos/blacklist:
1252 get:
1253 summary: List blacklisted videos
1254 security:
1255 - OAuth2:
1256 - admin
1257 - moderator
1258 tags:
1259 - Video Blacklist
1260 parameters:
1261 - $ref: '#/components/parameters/start'
1262 - $ref: '#/components/parameters/count'
1263 - $ref: '#/components/parameters/blacklistsSort'
1264 responses:
1265 '200':
1266 description: successful operation
1267 content:
1268 application/json:
1269 schema:
1270 type: array
1271 items:
1272 $ref: '#/components/schemas/VideoBlacklist'
1273 /videos/{id}/captions:
1274 get:
1275 summary: List captions of a video
1276 tags:
1277 - Video Caption
1278 parameters:
1279 - $ref: '#/components/parameters/idOrUUID'
1280 responses:
1281 '200':
1282 description: successful operation
1283 content:
1284 application/json:
1285 schema:
1286 type: object
1287 properties:
1288 total:
1289 type: integer
1290 data:
1291 type: array
1292 items:
1293 $ref: '#/components/schemas/VideoCaption'
1294 /videos/{id}/captions/{captionLanguage}:
1295 put:
1296 summary: Add or replace a video caption
1297 tags:
1298 - Video Caption
1299 parameters:
1300 - $ref: '#/components/parameters/idOrUUID'
1301 - $ref: '#/components/parameters/captionLanguage'
1302 requestBody:
1303 content:
1304 multipart/form-data:
1305 schema:
1306 type: object
1307 properties:
1308 captionfile:
1309 description: The file to upload.
1310 type: string
1311 format: binary
1312 encoding:
1313 captionfile:
1314 contentType: text/vtt, application/x-subrip, text/plain
1315 responses:
1316 '204':
1317 $ref: '#/paths/~1users~1me/put/responses/204'
1318 delete:
1319 summary: Delete a video caption
1320 tags:
1321 - Video Caption
1322 parameters:
1323 - $ref: '#/components/parameters/idOrUUID'
1324 - $ref: '#/components/parameters/captionLanguage'
1325 responses:
1326 '204':
1327 $ref: '#/paths/~1users~1me/put/responses/204'
1328 /video-channels:
1329 get:
1330 summary: List video channels
1331 tags:
1332 - Video Channels
1333 parameters:
1334 - $ref: '#/components/parameters/start'
1335 - $ref: '#/components/parameters/count'
1336 - $ref: '#/components/parameters/sort'
1337 responses:
1338 '200':
1339 description: successful operation
1340 content:
1341 application/json:
1342 schema:
1343 type: array
1344 items:
1345 $ref: '#/components/schemas/VideoChannel'
1346 post:
1347 summary: Create a video channel
1348 security:
1349 - OAuth2: []
1350 tags:
1351 - Video Channels
1352 responses:
1353 '204':
1354 $ref: '#/paths/~1users~1me/put/responses/204'
1355 requestBody:
1356 content:
1357 application/json:
1358 schema:
1359 $ref: '#/components/schemas/VideoChannelCreate'
1360 '/video-channels/{channelHandle}':
1361 get:
1362 summary: Get a video channel
1363 tags:
1364 - Video Channels
1365 parameters:
1366 - $ref: '#/components/parameters/channelHandle'
1367 responses:
1368 '200':
1369 description: successful operation
1370 content:
1371 application/json:
1372 schema:
1373 $ref: '#/components/schemas/VideoChannel'
1374 put:
1375 summary: Update a video channel
1376 security:
1377 - OAuth2: []
1378 tags:
1379 - Video Channels
1380 parameters:
1381 - $ref: '#/components/parameters/channelHandle'
1382 responses:
1383 '204':
1384 $ref: '#/paths/~1users~1me/put/responses/204'
1385 requestBody:
1386 content:
1387 application/json:
1388 schema:
1389 $ref: '#/components/schemas/VideoChannelUpdate'
1390 delete:
1391 summary: Delete a video channel
1392 security:
1393 - OAuth2: []
1394 tags:
1395 - Video Channels
1396 parameters:
1397 - $ref: '#/components/parameters/channelHandle'
1398 responses:
1399 '204':
1400 $ref: '#/paths/~1users~1me/put/responses/204'
1401 '/video-channels/{channelHandle}/videos':
1402 get:
1403 summary: List videos of a video channel
1404 tags:
1405 - Video
1406 - Video Channels
1407 parameters:
1408 - $ref: '#/components/parameters/channelHandle'
1409 responses:
1410 '200':
1411 description: successful operation
1412 content:
1413 application/json:
1414 schema:
1415 $ref: '#/components/schemas/VideoListResponse'
1416 /video-playlists:
1417 get:
1418 summary: List video playlists
1419 tags:
1420 - Video Playlists
1421 parameters:
1422 - $ref: '#/components/parameters/start'
1423 - $ref: '#/components/parameters/count'
1424 - $ref: '#/components/parameters/sort'
1425 responses:
1426 '200':
1427 description: successful operation
1428 content:
1429 application/json:
1430 schema:
1431 type: array
1432 items:
1433 $ref: '#/components/schemas/VideoPlaylist'
1434 '/accounts/{name}/video-channels':
1435 get:
1436 summary: List video channels of an account
1437 tags:
1438 - Video Channels
1439 - Accounts
1440 parameters:
1441 - $ref: '#/components/parameters/name'
1442 responses:
1443 '200':
1444 description: successful operation
1445 content:
1446 application/json:
1447 schema:
1448 type: array
1449 items:
1450 $ref: '#/components/schemas/VideoChannel'
1451 '/accounts/{name}/ratings':
1452 get:
1453 summary: List ratings of an account
1454 security:
1455 - OAuth2: []
1456 tags:
1457 - Accounts
1458 parameters:
1459 - $ref: '#/components/parameters/name'
1460 - $ref: '#/components/parameters/start'
1461 - $ref: '#/components/parameters/count'
1462 - $ref: '#/components/parameters/sort'
1463 - name: rating
1464 in: query
1465 required: false
1466 description: Optionally filter which ratings to retrieve
1467 schema:
1468 type: string
1469 enum:
1470 - like
1471 - dislike
1472 responses:
1473 '200':
1474 description: successful operation
1475 content:
1476 application/json:
1477 schema:
1478 type: array
1479 items:
1480 $ref: '#/components/schemas/VideoRating'
1481 '/videos/{id}/comment-threads':
1482 get:
1483 summary: List threads of a video
1484 tags:
1485 - Video Comments
1486 parameters:
1487 - $ref: '#/components/parameters/idOrUUID'
1488 - $ref: '#/components/parameters/start'
1489 - $ref: '#/components/parameters/count'
1490 - $ref: '#/components/parameters/commentsSort'
1491 responses:
1492 '200':
1493 description: successful operation
1494 content:
1495 application/json:
1496 schema:
1497 $ref: '#/components/schemas/CommentThreadResponse'
1498 post:
1499 summary: Create a thread
1500 security:
1501 - OAuth2: []
1502 tags:
1503 - Video Comments
1504 parameters:
1505 - $ref: '#/components/parameters/idOrUUID'
1506 responses:
1507 '200':
1508 description: successful operation
1509 content:
1510 application/json:
1511 schema:
1512 $ref: '#/components/schemas/CommentThreadPostResponse'
1513 '/videos/{id}/comment-threads/{threadId}':
1514 get:
1515 summary: Get a thread
1516 tags:
1517 - Video Comments
1518 parameters:
1519 - $ref: '#/components/parameters/idOrUUID'
1520 - $ref: '#/components/parameters/threadId'
1521 responses:
1522 '200':
1523 description: successful operation
1524 content:
1525 application/json:
1526 schema:
1527 $ref: '#/components/schemas/VideoCommentThreadTree'
1528 '/videos/{id}/comments/{commentId}':
1529 post:
1530 summary: Reply to a thread of a video
1531 security:
1532 - OAuth2: []
1533 tags:
1534 - Video Comments
1535 parameters:
1536 - $ref: '#/components/parameters/idOrUUID'
1537 - $ref: '#/components/parameters/commentId'
1538 responses:
1539 '200':
1540 description: successful operation
1541 content:
1542 application/json:
1543 schema:
1544 $ref: '#/components/schemas/CommentThreadPostResponse'
1545 delete:
1546 summary: Delete a comment or a reply
1547 security:
1548 - OAuth2: []
1549 tags:
1550 - Video Comments
1551 parameters:
1552 - $ref: '#/components/parameters/idOrUUID'
1553 - $ref: '#/components/parameters/commentId'
1554 responses:
1555 '204':
1556 $ref: '#/paths/~1users~1me/put/responses/204'
1557 '/videos/{id}/rate':
1558 put:
1559 summary: Like/dislike a video
1560 security:
1561 - OAuth2: []
1562 tags:
1563 - Video Rates
1564 parameters:
1565 - $ref: '#/components/parameters/idOrUUID'
1566 responses:
1567 '204':
1568 $ref: '#/paths/~1users~1me/put/responses/204'
1569 /search/videos:
1570 get:
1571 tags:
1572 - Search
1573 summary: Search videos
1574 parameters:
1575 - $ref: '#/components/parameters/start'
1576 - $ref: '#/components/parameters/count'
1577 - $ref: '#/components/parameters/videosSearchSort'
1578 - name: search
1579 in: query
1580 required: true
1581 description: String to search
1582 schema:
1583 type: string
1584 responses:
1585 '200':
1586 description: successful operation
1587 content:
1588 application/json:
1589 schema:
1590 $ref: '#/components/schemas/VideoListResponse'
1591 servers:
1592 - url: 'https://peertube.cpy.re/api/v1'
1593 description: Live Test Server (live data - stable version)
1594 - url: 'https://peertube2.cpy.re/api/v1'
1595 description: Live Test Server (live data - latest nighlty version)
1596 - url: 'https://peertube3.cpy.re/api/v1'
1597 description: Live Test Server (live data - latest RC version)
1598 components:
1599 parameters:
1600 start:
1601 name: start
1602 in: query
1603 required: false
1604 description: Offset
1605 schema:
1606 type: number
1607 count:
1608 name: count
1609 in: query
1610 required: false
1611 description: Number of items
1612 schema:
1613 type: number
1614 sort:
1615 name: sort
1616 in: query
1617 required: false
1618 description: Sort column (-createdAt for example)
1619 schema:
1620 type: string
1621 videosSort:
1622 name: sort
1623 in: query
1624 required: false
1625 description: Sort videos by criteria
1626 schema:
1627 type: string
1628 enum:
1629 - -name
1630 - -duration
1631 - -createdAt
1632 - -publishedAt
1633 - -views
1634 - -likes
1635 - -trending
1636 videosSearchSort:
1637 name: sort
1638 in: query
1639 required: false
1640 description: Sort videos by criteria
1641 schema:
1642 type: string
1643 enum:
1644 - -name
1645 - -duration
1646 - -createdAt
1647 - -publishedAt
1648 - -views
1649 - -likes
1650 - -match
1651 commentsSort:
1652 name: sort
1653 in: query
1654 required: false
1655 description: Sort comments by criteria
1656 schema:
1657 type: string
1658 enum:
1659 - -createdAt
1660 - -totalReplies
1661 blacklistsSort:
1662 name: sort
1663 in: query
1664 required: false
1665 description: Sort blacklists by criteria
1666 schema:
1667 type: string
1668 enum:
1669 - -id
1670 - -name
1671 - -duration
1672 - -views
1673 - -likes
1674 - -dislikes
1675 - -uuid
1676 - -createdAt
1677 usersSort:
1678 name: sort
1679 in: query
1680 required: false
1681 description: Sort users by criteria
1682 schema:
1683 type: string
1684 enum:
1685 - -id
1686 - -username
1687 - -createdAt
1688 abusesSort:
1689 name: sort
1690 in: query
1691 required: false
1692 description: Sort abuses by criteria
1693 schema:
1694 type: string
1695 enum:
1696 - -id
1697 - -createdAt
1698 - -state
1699 name:
1700 name: name
1701 in: path
1702 required: true
1703 description: >-
1704 The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
1705 example)
1706 schema:
1707 type: string
1708 id:
1709 name: id
1710 in: path
1711 required: true
1712 description: The user id
1713 schema:
1714 type: number
1715 idOrUUID:
1716 name: id
1717 in: path
1718 required: true
1719 description: The video id or uuid
1720 schema:
1721 type: string
1722 captionLanguage:
1723 name: captionLanguage
1724 in: path
1725 required: true
1726 description: The caption language
1727 schema:
1728 type: string
1729 channelHandle:
1730 name: channelHandle
1731 in: path
1732 required: true
1733 description: "The video channel handle (example: 'my_username@example.com' or 'my_username')"
1734 schema:
1735 type: string
1736 subscriptionHandle:
1737 name: subscriptionHandle
1738 in: path
1739 required: true
1740 description: "The subscription handle (example: 'my_username@example.com' or 'my_username')"
1741 schema:
1742 type: string
1743 threadId:
1744 name: threadId
1745 in: path
1746 required: true
1747 description: The thread id (root comment id)
1748 schema:
1749 type: number
1750 commentId:
1751 name: commentId
1752 in: path
1753 required: true
1754 description: The comment id
1755 schema:
1756 type: number
1757 categoryOneOf:
1758 name: categoryOneOf
1759 in: query
1760 required: false
1761 description: category id of the video
1762 schema:
1763 oneOf:
1764 - type: number
1765 - type: array
1766 items:
1767 type: number
1768 style: form
1769 explode: false
1770 tagsOneOf:
1771 name: tagsOneOf
1772 in: query
1773 required: false
1774 description: tag(s) of the video
1775 schema:
1776 oneOf:
1777 - type: string
1778 - type: array
1779 items:
1780 type: string
1781 style: form
1782 explode: false
1783 tagsAllOf:
1784 name: tagsAllOf
1785 in: query
1786 required: false
1787 description: tag(s) of the video, where all should be present in the video
1788 schema:
1789 oneOf:
1790 - type: string
1791 - type: array
1792 items:
1793 type: string
1794 style: form
1795 explode: false
1796 languageOneOf:
1797 name: languageOneOf
1798 in: query
1799 required: false
1800 description: language id of the video
1801 schema:
1802 oneOf:
1803 - type: string
1804 - type: array
1805 items:
1806 type: string
1807 style: form
1808 explode: false
1809 licenceOneOf:
1810 name: licenceOneOf
1811 in: query
1812 required: false
1813 description: licence id of the video
1814 schema:
1815 oneOf:
1816 - type: number
1817 - type: array
1818 items:
1819 type: number
1820 style: form
1821 explode: false
1822 nsfw:
1823 name: nsfw
1824 in: query
1825 required: false
1826 description: whether to include nsfw videos, if any
1827 schema:
1828 type: string
1829 enum:
1830 - 'true'
1831 - 'false'
1832 filter:
1833 name: filter
1834 in: query
1835 required: false
1836 description: >
1837 Special filters (local for instance) which might require special rights:
1838 * `local` - only videos local to the instance
1839 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
1840 schema:
1841 type: string
1842 enum:
1843 - local
1844 - all-local
1845 subscriptionsUris:
1846 name: uris
1847 in: query
1848 required: true
1849 description: list of uris to check if each is part of the user subscriptions
1850 schema:
1851 type: array
1852 items:
1853 type: string
1854 securitySchemes:
1855 OAuth2:
1856 description: >
1857 In the header: *Authorization: Bearer <token\>*
1858
1859
1860 Authenticating via OAuth requires the following steps:
1861
1862
1863 - Have an account with sufficient authorization levels
1864
1865 - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
1866 Bearer Token
1867
1868 - Make Authenticated Requests
1869 type: oauth2
1870 flows:
1871 password:
1872 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
1873 scopes:
1874 admin: Admin scope
1875 moderator: Moderator scope
1876 user: User scope
1877 schemas:
1878 VideoConstantNumber:
1879 properties:
1880 id:
1881 type: number
1882 label:
1883 type: string
1884 VideoConstantString:
1885 properties:
1886 id:
1887 type: string
1888 label:
1889 type: string
1890 VideoPrivacySet:
1891 type: integer
1892 enum:
1893 - 1
1894 - 2
1895 - 3
1896 description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3)'
1897 VideoPrivacyConstant:
1898 properties:
1899 id:
1900 type: integer
1901 enum:
1902 - 1
1903 - 2
1904 - 3
1905 label:
1906 type: string
1907 VideoStateConstant:
1908 properties:
1909 id:
1910 type: integer
1911 enum:
1912 - 1
1913 - 2
1914 - 3
1915 description: 'The video state (Published = 1, to transcode = 2, to import = 3)'
1916 label:
1917 type: string
1918 VideoResolutionConstant:
1919 properties:
1920 id:
1921 type: integer
1922 description: 'Video resolution (240, 360, 720 ...)'
1923 label:
1924 type: string
1925 VideoScheduledUpdate:
1926 properties:
1927 privacy:
1928 $ref: '#/components/schemas/VideoPrivacySet'
1929 description: Video privacy target
1930 updateAt:
1931 type: string
1932 format: date
1933 description: When to update the video
1934 required:
1935 - updateAt
1936 VideoAccountSummary:
1937 properties:
1938 id:
1939 type: number
1940 name:
1941 type: string
1942 displayName:
1943 type: string
1944 url:
1945 type: string
1946 host:
1947 type: string
1948 avatar:
1949 nullable: true
1950 $ref: '#/components/schemas/Avatar'
1951 VideoChannelSummary:
1952 properties:
1953 id:
1954 type: number
1955 name:
1956 type: string
1957 displayName:
1958 type: string
1959 url:
1960 type: string
1961 host:
1962 type: string
1963 avatar:
1964 nullable: true
1965 $ref: '#/components/schemas/Avatar'
1966 PlaylistElement:
1967 properties:
1968 position:
1969 type: number
1970 startTimestamp:
1971 type: number
1972 stopTimestamp:
1973 type: number
1974 video:
1975 nullable: true
1976 $ref: '#/components/schemas/Video'
1977 VideoFile:
1978 properties:
1979 magnetUri:
1980 type: string
1981 resolution:
1982 $ref: '#/components/schemas/VideoResolutionConstant'
1983 size:
1984 type: number
1985 description: 'Video file size in bytes'
1986 torrentUrl:
1987 type: string
1988 torrentDownloadUrl:
1989 type: string
1990 fileUrl:
1991 type: string
1992 fileDownloadUrl:
1993 type: string
1994 fps:
1995 type: number
1996 VideoStreamingPlaylists:
1997 properties:
1998 id:
1999 type: number
2000 type:
2001 type: number
2002 enum:
2003 - 1
2004 description: 'Playlist type (HLS = 1)'
2005 playlistUrl:
2006 type: string
2007 segmentsSha256Url:
2008 type: string
2009 redundancies:
2010 type: array
2011 items:
2012 type: object
2013 properties:
2014 baseUrl:
2015 type: string
2016 Video:
2017 properties:
2018 id:
2019 type: number
2020 uuid:
2021 type: string
2022 createdAt:
2023 type: string
2024 publishedAt:
2025 type: string
2026 updatedAt:
2027 type: string
2028 originallyPublishedAt:
2029 type: string
2030 category:
2031 $ref: '#/components/schemas/VideoConstantNumber'
2032 licence:
2033 $ref: '#/components/schemas/VideoConstantNumber'
2034 language:
2035 $ref: '#/components/schemas/VideoConstantString'
2036 privacy:
2037 $ref: '#/components/schemas/VideoPrivacyConstant'
2038 description:
2039 type: string
2040 duration:
2041 type: number
2042 isLocal:
2043 type: boolean
2044 name:
2045 type: string
2046 thumbnailPath:
2047 type: string
2048 previewPath:
2049 type: string
2050 embedPath:
2051 type: string
2052 views:
2053 type: number
2054 likes:
2055 type: number
2056 dislikes:
2057 type: number
2058 nsfw:
2059 type: boolean
2060 waitTranscoding:
2061 type: boolean
2062 nullable: true
2063 state:
2064 $ref: '#/components/schemas/VideoStateConstant'
2065 scheduledUpdate:
2066 nullable: true
2067 $ref: '#/components/schemas/VideoScheduledUpdate'
2068 blacklisted:
2069 nullable: true
2070 type: boolean
2071 blacklistedReason:
2072 nullable: true
2073 type: string
2074 account:
2075 $ref: '#/components/schemas/VideoAccountSummary'
2076 channel:
2077 $ref: '#/components/schemas/VideoChannelSummary'
2078 userHistory:
2079 nullable: true
2080 type: object
2081 properties:
2082 currentTime:
2083 type: number
2084 VideoDetails:
2085 allOf:
2086 - $ref: '#/components/schemas/Video'
2087 - type: object
2088 properties:
2089 descriptionPath:
2090 type: string
2091 support:
2092 type: string
2093 channel:
2094 $ref: '#/components/schemas/VideoChannel'
2095 account:
2096 $ref: '#/components/schemas/Account'
2097 tags:
2098 type: array
2099 items:
2100 type: string
2101 files:
2102 type: array
2103 items:
2104 $ref: '#/components/schemas/VideoFile'
2105 commentsEnabled:
2106 type: boolean
2107 downloadEnabled:
2108 type: boolean
2109 trackerUrls:
2110 type: array
2111 items:
2112 type: string
2113 streamingPlaylists:
2114 type: array
2115 items:
2116 $ref: '#/components/schemas/VideoStreamingPlaylists'
2117 VideoImportStateConstant:
2118 properties:
2119 id:
2120 type: integer
2121 enum:
2122 - 1
2123 - 2
2124 - 3
2125 description: 'The video import state (Pending = 1, Success = 2, Failed = 3)'
2126 label:
2127 type: string
2128 VideoImport:
2129 properties:
2130 id:
2131 type: number
2132 targetUrl:
2133 type: string
2134 magnetUri:
2135 type: string
2136 torrentName:
2137 type: string
2138 state:
2139 type: object
2140 properties:
2141 id:
2142 $ref: '#/components/schemas/VideoImportStateConstant'
2143 label:
2144 type: string
2145 error:
2146 type: string
2147 createdAt:
2148 type: string
2149 updatedAt:
2150 type: string
2151 video:
2152 $ref: '#/components/schemas/Video'
2153 VideoAbuse:
2154 properties:
2155 id:
2156 type: number
2157 reason:
2158 type: string
2159 reporterAccount:
2160 $ref: '#/components/schemas/Account'
2161 video:
2162 type: object
2163 properties:
2164 id:
2165 type: number
2166 name:
2167 type: string
2168 uuid:
2169 type: string
2170 url:
2171 type: string
2172 createdAt:
2173 type: string
2174 VideoBlacklist:
2175 properties:
2176 id:
2177 type: number
2178 videoId:
2179 type: number
2180 createdAt:
2181 type: string
2182 updatedAt:
2183 type: string
2184 name:
2185 type: string
2186 uuid:
2187 type: string
2188 description:
2189 type: string
2190 duration:
2191 type: number
2192 views:
2193 type: number
2194 likes:
2195 type: number
2196 dislikes:
2197 type: number
2198 nsfw:
2199 type: boolean
2200 VideoChannel:
2201 properties:
2202 displayName:
2203 type: string
2204 description:
2205 type: string
2206 isLocal:
2207 type: boolean
2208 ownerAccount:
2209 type: object
2210 properties:
2211 id:
2212 type: number
2213 uuid:
2214 type: string
2215 VideoPlaylist:
2216 properties:
2217 id:
2218 type: number
2219 createdAt:
2220 type: string
2221 updatedAt:
2222 type: string
2223 description:
2224 type: string
2225 uuid:
2226 type: string
2227 displayName:
2228 type: string
2229 isLocal:
2230 type: boolean
2231 videoLength:
2232 type: number
2233 thumbnailPath:
2234 type: string
2235 privacy:
2236 type: object
2237 properties:
2238 id:
2239 type: number
2240 label:
2241 type: string
2242 type:
2243 type: object
2244 properties:
2245 id:
2246 type: number
2247 label:
2248 type: string
2249 ownerAccount:
2250 type: object
2251 properties:
2252 id:
2253 type: number
2254 name:
2255 type: string
2256 displayName:
2257 type: string
2258 url:
2259 type: string
2260 host:
2261 type: string
2262 VideoComment:
2263 properties:
2264 id:
2265 type: number
2266 url:
2267 type: string
2268 text:
2269 type: string
2270 threadId:
2271 type: number
2272 inReplyToCommentId:
2273 type: number
2274 videoId:
2275 type: number
2276 createdAt:
2277 type: string
2278 updatedAt:
2279 type: string
2280 totalRepliesFromVideoAuthor:
2281 type: number
2282 totalReplies:
2283 type: number
2284 account:
2285 $ref: '#/components/schemas/Account'
2286 VideoCommentThreadTree:
2287 properties:
2288 comment:
2289 $ref: '#/components/schemas/VideoComment'
2290 children:
2291 type: array
2292 items:
2293 $ref: '#/components/schemas/VideoCommentThreadTree'
2294 VideoCaption:
2295 properties:
2296 language:
2297 $ref: '#/components/schemas/VideoConstantString'
2298 captionPath:
2299 type: string
2300 Avatar:
2301 properties:
2302 path:
2303 type: string
2304 createdAt:
2305 type: string
2306 updatedAt:
2307 type: string
2308 Actor:
2309 properties:
2310 id:
2311 type: number
2312 url:
2313 type: string
2314 name:
2315 type: string
2316 host:
2317 type: string
2318 followingCount:
2319 type: number
2320 followersCount:
2321 type: number
2322 createdAt:
2323 type: string
2324 updatedAt:
2325 type: string
2326 avatar:
2327 $ref: '#/components/schemas/Avatar'
2328 Account:
2329 allOf:
2330 - $ref: '#/components/schemas/Actor'
2331 - properties:
2332 userId:
2333 type: string
2334 displayName:
2335 type: string
2336 description:
2337 type: string
2338 User:
2339 properties:
2340 id:
2341 type: number
2342 username:
2343 type: string
2344 email:
2345 type: string
2346 displayNSFW:
2347 type: boolean
2348 autoPlayVideo:
2349 type: boolean
2350 role:
2351 type: integer
2352 enum:
2353 - 0
2354 - 1
2355 - 2
2356 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2357 roleLabel:
2358 type: string
2359 enum:
2360 - User
2361 - Moderator
2362 - Administrator
2363 videoQuota:
2364 type: number
2365 videoQuotaDaily:
2366 type: number
2367 createdAt:
2368 type: string
2369 account:
2370 $ref: '#/components/schemas/Account'
2371 videoChannels:
2372 type: array
2373 items:
2374 $ref: '#/components/schemas/VideoChannel'
2375 UserWatchingVideo:
2376 properties:
2377 currentTime:
2378 type: number
2379 ServerConfig:
2380 properties:
2381 instance:
2382 type: object
2383 properties:
2384 name:
2385 type: string
2386 shortDescription:
2387 type: string
2388 defaultClientRoute:
2389 type: string
2390 isNSFW:
2391 type: boolean
2392 defaultNSFWPolicy:
2393 type: string
2394 customizations:
2395 type: object
2396 properties:
2397 javascript:
2398 type: string
2399 css:
2400 type: string
2401 search:
2402 type: object
2403 properties:
2404 remoteUri:
2405 type: object
2406 properties:
2407 users:
2408 type: boolean
2409 anonymous:
2410 type: boolean
2411 plugin:
2412 type: object
2413 properties:
2414 registered:
2415 type: array
2416 items:
2417 type: string
2418 theme:
2419 type: object
2420 properties:
2421 registered:
2422 type: array
2423 items:
2424 type: string
2425 email:
2426 type: object
2427 properties:
2428 enabled:
2429 type: boolean
2430 contactForm:
2431 type: object
2432 properties:
2433 enabled:
2434 type: boolean
2435 serverVersion:
2436 type: string
2437 serverCommit:
2438 type: string
2439 signup:
2440 type: object
2441 properties:
2442 allowed:
2443 type: boolean
2444 allowedForCurrentIP:
2445 type: boolean
2446 requiresEmailVerification:
2447 type: boolean
2448 transcoding:
2449 type: object
2450 properties:
2451 hls:
2452 type: object
2453 properties:
2454 enabled:
2455 type: boolean
2456 webtorrent:
2457 type: object
2458 properties:
2459 enabled:
2460 type: boolean
2461 enabledResolutions:
2462 type: array
2463 items:
2464 type: number
2465 import:
2466 type: object
2467 properties:
2468 videos:
2469 type: object
2470 properties:
2471 http:
2472 type: object
2473 properties:
2474 enabled:
2475 type: boolean
2476 torrent:
2477 type: object
2478 properties:
2479 enabled:
2480 type: boolean
2481 autoBlacklist:
2482 type: object
2483 properties:
2484 videos:
2485 type: object
2486 properties:
2487 ofUsers:
2488 type: object
2489 properties:
2490 enabled:
2491 type: boolean
2492 avatar:
2493 type: object
2494 properties:
2495 file:
2496 type: object
2497 properties:
2498 size:
2499 type: object
2500 properties:
2501 max:
2502 type: number
2503 extensions:
2504 type: array
2505 items:
2506 type: string
2507 video:
2508 type: object
2509 properties:
2510 image:
2511 type: object
2512 properties:
2513 extensions:
2514 type: array
2515 items:
2516 type: string
2517 size:
2518 type: object
2519 properties:
2520 max:
2521 type: number
2522 file:
2523 type: object
2524 properties:
2525 extensions:
2526 type: array
2527 items:
2528 type: string
2529 videoCaption:
2530 type: object
2531 properties:
2532 file:
2533 type: object
2534 properties:
2535 size:
2536 type: object
2537 properties:
2538 max:
2539 type: number
2540 extensions:
2541 type: array
2542 items:
2543 type: string
2544 user:
2545 type: object
2546 properties:
2547 videoQuota:
2548 type: number
2549 videoQuotaDaily:
2550 type: number
2551 trending:
2552 type: object
2553 properties:
2554 videos:
2555 type: object
2556 properties:
2557 intervalDays:
2558 type: number
2559 tracker:
2560 type: object
2561 properties:
2562 enabled:
2563 type: boolean
2564 followings:
2565 type: object
2566 properties:
2567 instance:
2568 type: object
2569 properties:
2570 autoFollowIndex:
2571 type: object
2572 properties:
2573 indexUrl:
2574 type: string
2575 ServerConfigAbout:
2576 properties:
2577 instance:
2578 type: object
2579 properties:
2580 name:
2581 type: string
2582 shortDescription:
2583 type: string
2584 description:
2585 type: string
2586 terms:
2587 type: string
2588 ServerConfigCustom:
2589 properties:
2590 instance:
2591 type: object
2592 properties:
2593 name:
2594 type: string
2595 shortDescription:
2596 type: string
2597 description:
2598 type: string
2599 terms:
2600 type: string
2601 defaultClientRoute:
2602 type: string
2603 isNSFW:
2604 type: boolean
2605 defaultNSFWPolicy:
2606 type: string
2607 customizations:
2608 type: object
2609 properties:
2610 javascript:
2611 type: string
2612 css:
2613 type: string
2614 theme:
2615 type: object
2616 properties:
2617 default:
2618 type: string
2619 services:
2620 type: object
2621 properties:
2622 twitter:
2623 type: object
2624 properties:
2625 username:
2626 type: string
2627 whitelisted:
2628 type: boolean
2629 cache:
2630 type: object
2631 properties:
2632 previews:
2633 type: object
2634 properties:
2635 size:
2636 type: number
2637 captions:
2638 type: object
2639 properties:
2640 size:
2641 type: number
2642 signup:
2643 type: object
2644 properties:
2645 enabled:
2646 type: boolean
2647 limit:
2648 type: number
2649 requiresEmailVerification:
2650 type: boolean
2651 admin:
2652 type: object
2653 properties:
2654 email:
2655 type: string
2656 contactForm:
2657 type: object
2658 properties:
2659 enabled:
2660 type: boolean
2661 user:
2662 type: object
2663 properties:
2664 videoQuota:
2665 type: number
2666 videoQuotaDaily:
2667 type: number
2668 transcoding:
2669 type: object
2670 properties:
2671 enabled:
2672 type: boolean
2673 allowAdditionalExtensions:
2674 type: boolean
2675 allowAudioFiles:
2676 type: boolean
2677 threads:
2678 type: number
2679 resolutions:
2680 type: object
2681 properties:
2682 240p:
2683 type: boolean
2684 360p:
2685 type: boolean
2686 480p:
2687 type: boolean
2688 720p:
2689 type: boolean
2690 1080p:
2691 type: boolean
2692 2160p:
2693 type: boolean
2694 hls:
2695 type: object
2696 properties:
2697 enabled:
2698 type: boolean
2699 import:
2700 type: object
2701 properties:
2702 videos:
2703 type: object
2704 properties:
2705 http:
2706 type: object
2707 properties:
2708 enabled:
2709 type: boolean
2710 torrent:
2711 type: object
2712 properties:
2713 enabled:
2714 type: boolean
2715 autoBlacklist:
2716 type: object
2717 properties:
2718 videos:
2719 type: object
2720 properties:
2721 ofUsers:
2722 type: object
2723 properties:
2724 enabled:
2725 type: boolean
2726 followers:
2727 type: object
2728 properties:
2729 instance:
2730 type: object
2731 properties:
2732 enabled:
2733 type: boolean
2734 manualApproval:
2735 type: boolean
2736 Follow:
2737 properties:
2738 id:
2739 type: number
2740 follower:
2741 $ref: '#/components/schemas/Actor'
2742 following:
2743 $ref: '#/components/schemas/Actor'
2744 score:
2745 type: number
2746 state:
2747 type: string
2748 enum:
2749 - pending
2750 - accepted
2751 createdAt:
2752 type: string
2753 updatedAt:
2754 type: string
2755 Job:
2756 properties:
2757 id:
2758 type: number
2759 state:
2760 type: string
2761 enum:
2762 - pending
2763 - processing
2764 - error
2765 - success
2766 category:
2767 type: string
2768 enum:
2769 - transcoding
2770 - activitypub-http
2771 handlerName:
2772 type: string
2773 handlerInputData:
2774 type: string
2775 createdAt:
2776 type: string
2777 updatedAt:
2778 type: string
2779 AddUserResponse:
2780 properties:
2781 id:
2782 type: number
2783 uuid:
2784 type: string
2785 VideoUploadResponse:
2786 properties:
2787 video:
2788 type: object
2789 properties:
2790 id:
2791 type: number
2792 uuid:
2793 type: string
2794 CommentThreadResponse:
2795 properties:
2796 total:
2797 type: number
2798 data:
2799 type: array
2800 items:
2801 $ref: '#/components/schemas/VideoComment'
2802 CommentThreadPostResponse:
2803 properties:
2804 comment:
2805 $ref: '#/components/schemas/VideoComment'
2806 VideoListResponse:
2807 properties:
2808 total:
2809 type: number
2810 data:
2811 type: array
2812 items:
2813 $ref: '#/components/schemas/Video'
2814 AddUser:
2815 properties:
2816 username:
2817 type: string
2818 description: 'The user username '
2819 password:
2820 type: string
2821 description: 'The user password. If the smtp server is configured, you can leave empty and an email will be sent '
2822 email:
2823 type: string
2824 description: 'The user email '
2825 videoQuota:
2826 type: string
2827 description: 'The user videoQuota '
2828 videoQuotaDaily:
2829 type: string
2830 description: 'The user daily video quota '
2831 role:
2832 type: integer
2833 enum:
2834 - 0
2835 - 1
2836 - 2
2837 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2838 required:
2839 - username
2840 - password
2841 - email
2842 - videoQuota
2843 - videoQuotaDaily
2844 - role
2845 UpdateUser:
2846 properties:
2847 id:
2848 type: string
2849 description: 'The user id '
2850 email:
2851 type: string
2852 description: 'The updated email of the user '
2853 videoQuota:
2854 type: string
2855 description: 'The updated videoQuota of the user '
2856 videoQuotaDaily:
2857 type: string
2858 description: 'The updated daily video quota of the user '
2859 role:
2860 type: integer
2861 enum:
2862 - 0
2863 - 1
2864 - 2
2865 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2866 required:
2867 - id
2868 - email
2869 - videoQuota
2870 - videoQuotaDaily
2871 - role
2872 UpdateMe:
2873 properties:
2874 password:
2875 type: string
2876 description: 'Your new password '
2877 email:
2878 type: string
2879 description: 'Your new email '
2880 displayNSFW:
2881 type: string
2882 description: 'Your new displayNSFW '
2883 autoPlayVideo:
2884 type: string
2885 description: 'Your new autoPlayVideo '
2886 required:
2887 - password
2888 - email
2889 - displayNSFW
2890 - autoPlayVideo
2891 GetMeVideoRating:
2892 properties:
2893 id:
2894 type: string
2895 description: 'Id of the video '
2896 rating:
2897 type: number
2898 description: 'Rating of the video '
2899 required:
2900 - id
2901 - rating
2902 VideoRating:
2903 properties:
2904 video:
2905 $ref: '#/components/schemas/Video'
2906 rating:
2907 type: number
2908 description: 'Rating of the video'
2909 required:
2910 - video
2911 - rating
2912 RegisterUser:
2913 properties:
2914 username:
2915 type: string
2916 description: 'The username of the user '
2917 password:
2918 type: string
2919 description: 'The password of the user '
2920 email:
2921 type: string
2922 description: 'The email of the user '
2923 displayName:
2924 type: string
2925 description: 'The user display name'
2926 channel:
2927 type: object
2928 properties:
2929 name:
2930 type: string
2931 description: 'The default channel name'
2932 displayName:
2933 type: string
2934 description: 'The default channel display name'
2935
2936 required:
2937 - username
2938 - password
2939 - email
2940 VideoChannelCreate:
2941 properties:
2942 name:
2943 type: string
2944 displayName:
2945 type: string
2946 description:
2947 type: string
2948 support:
2949 type: string
2950 required:
2951 - name
2952 - displayName
2953 VideoChannelUpdate:
2954 properties:
2955 displayName:
2956 type: string
2957 description:
2958 type: string
2959 support:
2960 type: string
2961 bulkVideosSupportUpdate:
2962 type: boolean
2963 description: 'Update all videos support field of this channel'
2964