Fix playlist element param in api doc
[oweals/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 Abuses
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 Abuses
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         - $ref: '#/components/parameters/categoryOneOf'
152         - $ref: '#/components/parameters/tagsOneOf'
153         - $ref: '#/components/parameters/tagsAllOf'
154         - $ref: '#/components/parameters/licenceOneOf'
155         - $ref: '#/components/parameters/languageOneOf'
156         - $ref: '#/components/parameters/nsfw'
157         - $ref: '#/components/parameters/filter'
158         - $ref: '#/components/parameters/skipCount'
159         - $ref: '#/components/parameters/start'
160         - $ref: '#/components/parameters/count'
161         - $ref: '#/components/parameters/videosSort'
162       responses:
163         '200':
164           description: successful operation
165           content:
166             application/json:
167               schema:
168                 $ref: '#/components/schemas/VideoListResponse'
169       x-code-samples:
170         - lang: JavaScript
171           source: |
172             fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
173             .then(function(response) {
174               return response.json()
175             }).then(function(data) {
176               console.log(data)
177             })
178         - lang: Shell
179           source: |
180             # pip install httpie
181             http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
182         - lang: Ruby
183           source: |
184             require 'net/http'
185             require 'json'
186
187             uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
188
189             http = Net::HTTP.new(uri.host, uri.port)
190             http.use_ssl = true
191
192             response = http.get(uri.request_uri)
193
194             puts JSON.parse(response.read_body)
195         - lang: Python
196           source: |
197             import requests
198
199             r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
200             json = r.json()
201
202             print(json)
203   /accounts:
204     get:
205       tags:
206         - Accounts
207       summary: List accounts
208       parameters:
209         - $ref: '#/components/parameters/start'
210         - $ref: '#/components/parameters/count'
211         - $ref: '#/components/parameters/sort'
212       responses:
213         '200':
214           description: successful operation
215           content:
216             'application/json':
217               schema:
218                 type: array
219                 items:
220                   $ref: '#/components/schemas/Account'
221   /config:
222     get:
223       tags:
224         - Config
225       summary: Get instance public configuration
226       responses:
227         '200':
228           description: successful operation
229           content:
230             application/json:
231               schema:
232                 $ref: '#/components/schemas/ServerConfig'
233   /config/about:
234     get:
235       summary: Get instance "About" information
236       tags:
237         - Config
238       responses:
239         '200':
240           description: successful operation
241           content:
242             application/json:
243               schema:
244                 $ref: '#/components/schemas/ServerConfigAbout'
245   /config/custom:
246     get:
247       summary: Get instance runtime configuration
248       tags:
249         - Config
250       security:
251         - OAuth2:
252             - admin
253       responses:
254         '200':
255           description: successful operation
256           content:
257             application/json:
258               schema:
259                 $ref: '#/components/schemas/ServerConfigCustom'
260     put:
261       summary: Set instance runtime configuration
262       tags:
263         - Config
264       security:
265         - OAuth2:
266             - admin
267       responses:
268         '200':
269           description: successful operation
270     delete:
271       summary: Delete instance runtime configuration
272       tags:
273         - Config
274       security:
275         - OAuth2:
276             - admin
277       responses:
278         '200':
279           description: successful operation
280   /jobs/{state}:
281     get:
282       summary: List instance jobs
283       security:
284         - OAuth2:
285             - admin
286       tags:
287         - Job
288       parameters:
289         - name: state
290           in: path
291           required: true
292           description: The state of the job
293           schema:
294             type: string
295             enum:
296               - active
297               - completed
298               - failed
299               - waiting
300               - delayed
301         - $ref: '#/components/parameters/start'
302         - $ref: '#/components/parameters/count'
303         - $ref: '#/components/parameters/sort'
304       responses:
305         '200':
306           description: successful operation
307           content:
308             application/json:
309               schema:
310                 type: array
311                 items:
312                   $ref: '#/components/schemas/Job'
313   '/server/following/{host}':
314     delete:
315       security:
316         - OAuth2:
317             - admin
318       tags:
319         - Instance Follows
320       summary: Unfollow a server
321       parameters:
322         - name: host
323           in: path
324           required: true
325           description: 'The host to unfollow '
326           schema:
327             type: string
328       responses:
329         '201':
330           description: successful operation
331   /server/followers:
332     get:
333       tags:
334         - Instance Follows
335       summary: List instance followers
336       parameters:
337         - $ref: '#/components/parameters/start'
338         - $ref: '#/components/parameters/count'
339         - $ref: '#/components/parameters/sort'
340       responses:
341         '200':
342           description: successful operation
343           content:
344             application/json:
345               schema:
346                 type: array
347                 items:
348                   $ref: '#/components/schemas/Follow'
349   /server/following:
350     get:
351       tags:
352         - Instance Follows
353       summary: List instance followings
354       parameters:
355         - $ref: '#/components/parameters/start'
356         - $ref: '#/components/parameters/count'
357         - $ref: '#/components/parameters/sort'
358       responses:
359         '200':
360           description: successful operation
361           content:
362             application/json:
363               schema:
364                 type: array
365                 items:
366                   $ref: '#/components/schemas/Follow'
367     post:
368       security:
369         - OAuth2:
370             - admin
371       tags:
372         - Instance Follows
373       summary: Follow a server
374       responses:
375         '204':
376           description: successful operation
377       requestBody:
378         content:
379           application/json:
380             schema:
381               $ref: '#/components/schemas/Follow'
382   /users:
383     post:
384       summary: Create a user
385       security:
386         - OAuth2:
387             - admin
388       tags:
389         - Users
390       responses:
391         '200':
392           description: successful operation
393           content:
394             application/json:
395               schema:
396                 $ref: '#/components/schemas/AddUserResponse'
397       requestBody:
398         content:
399           application/json:
400             schema:
401               $ref: '#/components/schemas/AddUser'
402         description: User to create
403         required: true
404     get:
405       summary: List users
406       security:
407         - OAuth2: []
408       tags:
409         - Users
410       parameters:
411         - $ref: '#/components/parameters/start'
412         - $ref: '#/components/parameters/count'
413         - $ref: '#/components/parameters/usersSort'
414       responses:
415         '200':
416           description: successful operation
417           content:
418             application/json:
419               schema:
420                 type: array
421                 items:
422                   $ref: '#/components/schemas/User'
423   '/users/{id}':
424     delete:
425       summary: Delete a user
426       security:
427         - OAuth2:
428             - admin
429       tags:
430         - Users
431       parameters:
432         - $ref: '#/components/parameters/id'
433       responses:
434         '204':
435           description: successful operation
436     get:
437       summary: Get a user
438       security:
439         - OAuth2: []
440       tags:
441         - Users
442       parameters:
443         - $ref: '#/components/parameters/id'
444       responses:
445         '200':
446           description: successful operation
447           content:
448             application/json:
449               schema:
450                 $ref: '#/components/schemas/User'
451     put:
452       summary: Update a user
453       security:
454         - OAuth2: []
455       tags:
456         - Users
457       parameters:
458         - $ref: '#/components/parameters/id'
459       responses:
460         '204':
461           description: successful operation
462       requestBody:
463         content:
464           application/json:
465             schema:
466               $ref: '#/components/schemas/UpdateUser'
467         required: true
468   /users/register:
469     post:
470       summary: Register a user
471       tags:
472         - Users
473       responses:
474         '204':
475           description: successful operation
476       requestBody:
477         content:
478           application/json:
479             schema:
480               $ref: '#/components/schemas/RegisterUser'
481         required: true
482   /users/me:
483     get:
484       summary: Get my user information
485       security:
486         - OAuth2:
487           - user
488       tags:
489         - My User
490       responses:
491         '200':
492           description: successful operation
493           content:
494             application/json:
495               schema:
496                 type: array
497                 items:
498                   $ref: '#/components/schemas/User'
499     put:
500       summary: Update my user information
501       security:
502         - OAuth2:
503           - user
504       tags:
505         - My User
506       responses:
507         '204':
508           description: successful operation
509       requestBody:
510         content:
511           application/json:
512             schema:
513               $ref: '#/components/schemas/UpdateMe'
514         required: true
515   /users/me/videos/imports:
516     get:
517       summary: Get video imports of my user
518       security:
519         - OAuth2:
520             - user
521       tags:
522         - Videos
523         - My User
524       parameters:
525         - $ref: '#/components/parameters/start'
526         - $ref: '#/components/parameters/count'
527         - $ref: '#/components/parameters/sort'
528       responses:
529         '200':
530           description: successful operation
531           content:
532             application/json:
533               schema:
534                 $ref: '#/components/schemas/VideoImport'
535   /users/me/video-quota-used:
536     get:
537       summary: Get my user used quota
538       security:
539         - OAuth2:
540           - user
541       tags:
542         - My User
543       responses:
544         '200':
545           description: successful operation
546           content:
547             application/json:
548               schema:
549                 type: number
550   '/users/me/videos/{videoId}/rating':
551     get:
552       summary: Get rate of my user for a video
553       security:
554         - OAuth2: []
555       tags:
556         - My User
557         - Video Rates
558       parameters:
559         - name: videoId
560           in: path
561           required: true
562           description: 'The video id '
563           schema:
564             type: string
565       responses:
566         '200':
567           description: successful operation
568           content:
569             application/json:
570               schema:
571                 $ref: '#/components/schemas/GetMeVideoRating'
572   /users/me/videos:
573     get:
574       summary: Get videos of my user
575       security:
576         - OAuth2:
577           - user
578       tags:
579         - My User
580         - Videos
581       parameters:
582         - $ref: '#/components/parameters/start'
583         - $ref: '#/components/parameters/count'
584         - $ref: '#/components/parameters/sort'
585       responses:
586         '200':
587           description: successful operation
588           content:
589             application/json:
590               schema:
591                 $ref: '#/components/schemas/VideoListResponse'
592   /users/me/subscriptions:
593     get:
594       summary: Get my user subscriptions
595       security:
596         - OAuth2:
597             - user
598       tags:
599         - My Subscriptions
600       parameters:
601         - $ref: '#/components/parameters/start'
602         - $ref: '#/components/parameters/count'
603         - $ref: '#/components/parameters/sort'
604       responses:
605         '200':
606           description: successful operation
607     post:
608       summary: Add subscription to my user
609       security:
610         - OAuth2:
611             - user
612       tags:
613         - My Subscriptions
614       responses:
615         '200':
616           description: successful operation
617   /users/me/subscriptions/exist:
618     get:
619       summary: Get if subscriptions exist for my user
620       security:
621         - OAuth2:
622             - user
623       tags:
624         - My Subscriptions
625       parameters:
626         - $ref: '#/components/parameters/subscriptionsUris'
627       responses:
628         '200':
629           description: successful operation
630           content:
631             application/json:
632               schema:
633                 type: object
634   /users/me/subscriptions/videos:
635     get:
636       summary: List videos of subscriptions of my user
637       security:
638         - OAuth2:
639           - user
640       tags:
641         - My Subscriptions
642         - Videos
643       parameters:
644         - $ref: '#/components/parameters/categoryOneOf'
645         - $ref: '#/components/parameters/tagsOneOf'
646         - $ref: '#/components/parameters/tagsAllOf'
647         - $ref: '#/components/parameters/licenceOneOf'
648         - $ref: '#/components/parameters/languageOneOf'
649         - $ref: '#/components/parameters/nsfw'
650         - $ref: '#/components/parameters/filter'
651         - $ref: '#/components/parameters/skipCount'
652         - $ref: '#/components/parameters/start'
653         - $ref: '#/components/parameters/count'
654         - $ref: '#/components/parameters/videosSort'
655       responses:
656         '200':
657           description: successful operation
658           content:
659             application/json:
660               schema:
661                 $ref: '#/components/schemas/VideoListResponse'
662   '/users/me/subscriptions/{subscriptionHandle}':
663     get:
664       summary: Get subscription of my user
665       security:
666         - OAuth2:
667             - user
668       tags:
669         - My Subscriptions
670       parameters:
671         - $ref: '#/components/parameters/subscriptionHandle'
672       responses:
673         '200':
674           description: successful operation
675           content:
676             application/json:
677               schema:
678                 $ref: '#/components/schemas/VideoChannel'
679     delete:
680       summary: Delete subscription of my user
681       security:
682         - OAuth2:
683             - user
684       tags:
685         - My Subscriptions
686       parameters:
687         - $ref: '#/components/parameters/subscriptionHandle'
688       responses:
689         '200':
690           description: successful operation
691   /users/me/avatar/pick:
692     post:
693       summary: Update my user avatar
694       security:
695         - OAuth2: []
696       tags:
697         - My User
698       responses:
699         '200':
700           description: successful operation
701           content:
702             application/json:
703               schema:
704                 $ref: '#/components/schemas/Avatar'
705       requestBody:
706         content:
707           multipart/form-data:
708             schema:
709               type: object
710               properties:
711                 avatarfile:
712                   description: The file to upload.
713                   type: string
714                   format: binary
715             encoding:
716               avatarfile:
717                 contentType: image/png, image/jpeg
718   /videos/ownership:
719     get:
720       summary: List video ownership changes
721       tags:
722         - Video Ownership Change
723       security:
724         - OAuth2: []
725       responses:
726         '200':
727           description: successful operation
728   '/videos/ownership/{id}/accept':
729     post:
730       summary: Accept ownership change request
731       tags:
732         - Video Ownership Change
733       security:
734         - OAuth2: []
735       parameters:
736         - $ref: '#/components/parameters/idOrUUID'
737       responses:
738         '204':
739           description: successful operation
740   '/videos/ownership/{id}/refuse':
741     post:
742       summary: Refuse ownership change request
743       tags:
744         - Video Ownership Change
745       security:
746         - OAuth2: []
747       parameters:
748         - $ref: '#/components/parameters/idOrUUID'
749       responses:
750         '204':
751           description: successful operation
752   '/videos/{id}/give-ownership':
753     post:
754       summary: Request ownership change
755       tags:
756         - Video Ownership Change
757       security:
758         - OAuth2: []
759       parameters:
760         - $ref: '#/components/parameters/idOrUUID'
761       requestBody:
762         required: true
763         content:
764           application/x-www-form-urlencoded:
765             schema:
766               type: object
767               properties:
768                 username:
769                   type: string
770               required:
771                 - username
772       responses:
773         '204':
774           description: successful operation
775         '400':
776           description: 'Changing video ownership to a remote account is not supported yet'
777   /videos:
778     get:
779       summary: List videos
780       tags:
781         - Video
782       parameters:
783         - $ref: '#/components/parameters/categoryOneOf'
784         - $ref: '#/components/parameters/tagsOneOf'
785         - $ref: '#/components/parameters/tagsAllOf'
786         - $ref: '#/components/parameters/licenceOneOf'
787         - $ref: '#/components/parameters/languageOneOf'
788         - $ref: '#/components/parameters/nsfw'
789         - $ref: '#/components/parameters/filter'
790         - $ref: '#/components/parameters/skipCount'
791         - $ref: '#/components/parameters/start'
792         - $ref: '#/components/parameters/count'
793         - $ref: '#/components/parameters/videosSort'
794       responses:
795         '200':
796           description: successful operation
797           content:
798             application/json:
799               schema:
800                 $ref: '#/components/schemas/VideoListResponse'
801   /videos/categories:
802     get:
803       summary: List available video categories
804       tags:
805         - Video
806       responses:
807         '200':
808           description: successful operation
809           content:
810             application/json:
811               schema:
812                 type: array
813                 items:
814                   type: string
815   /videos/licences:
816     get:
817       summary: List available video licences
818       tags:
819         - Video
820       responses:
821         '200':
822           description: successful operation
823           content:
824             application/json:
825               schema:
826                 type: array
827                 items:
828                   type: string
829   /videos/languages:
830     get:
831       summary: List available video languages
832       tags:
833         - Video
834       responses:
835         '200':
836           description: successful operation
837           content:
838             application/json:
839               schema:
840                 type: array
841                 items:
842                   type: string
843   /videos/privacies:
844     get:
845       summary: List available video privacies
846       tags:
847         - Video
848       responses:
849         '200':
850           description: successful operation
851           content:
852             application/json:
853               schema:
854                 type: array
855                 items:
856                   type: string
857   '/videos/{id}':
858     put:
859       summary: Update a video
860       security:
861         - OAuth2: []
862       tags:
863         - Video
864       parameters:
865         - $ref: '#/components/parameters/idOrUUID'
866       responses:
867         '204':
868           description: successful operation
869       requestBody:
870         content:
871           multipart/form-data:
872             schema:
873               type: object
874               properties:
875                 thumbnailfile:
876                   description: Video thumbnail file
877                   type: string
878                   format: binary
879                 previewfile:
880                   description: Video preview file
881                   type: string
882                   format: binary
883                 category:
884                   description: Video category
885                   type: string
886                 licence:
887                   description: Video licence
888                   type: string
889                 language:
890                   description: Video language
891                   type: string
892                 privacy:
893                   $ref: '#/components/schemas/VideoPrivacySet'
894                 description:
895                   description: Video description
896                   type: string
897                 waitTranscoding:
898                   description: Whether or not we wait transcoding before publish the video
899                   type: string
900                 support:
901                   description: Text describing how to support the video uploader
902                   type: string
903                 nsfw:
904                   description: Whether or not this video contains sensitive content
905                   type: string
906                 name:
907                   description: Video name
908                   type: string
909                 tags:
910                   description: Video tags (maximum 5 tags each between 2 and 30 characters)
911                   type: array
912                   minItems: 1
913                   maxItems: 5
914                   items:
915                     type: string
916                     minLength: 2
917                     maxLength: 30
918                 commentsEnabled:
919                   description: Enable or disable comments for this video
920                   type: string
921                 originallyPublishedAt:
922                   description: Date when the content was originally published
923                   type: string
924                   format: date-time
925                 scheduleUpdate:
926                   $ref: '#/components/schemas/VideoScheduledUpdate'
927             encoding:
928               thumbnailfile:
929                 contentType: image/jpeg
930               previewfile:
931                 contentType: image/jpeg
932     get:
933       summary: Get a video
934       tags:
935         - Video
936       parameters:
937         - $ref: '#/components/parameters/idOrUUID'
938       responses:
939         '200':
940           description: successful operation
941           content:
942             application/json:
943               schema:
944                 $ref: '#/components/schemas/VideoDetails'
945     delete:
946       summary: Delete a video
947       security:
948         - OAuth2: []
949       tags:
950         - Video
951       parameters:
952         - $ref: '#/components/parameters/idOrUUID'
953       responses:
954         '204':
955           description: successful operation
956   '/videos/{id}/description':
957     get:
958       summary: Get complete video description
959       tags:
960         - Video
961       parameters:
962         - $ref: '#/components/parameters/idOrUUID'
963       responses:
964         '200':
965           description: successful operation
966           content:
967             application/json:
968               schema:
969                 type: string
970   '/videos/{id}/views':
971     post:
972       summary: Add a view to a video
973       tags:
974         - Video
975       parameters:
976         - $ref: '#/components/parameters/idOrUUID'
977       responses:
978         '204':
979           description: successful operation
980   '/videos/{id}/watching':
981     put:
982       summary: Set watching progress of a video
983       tags:
984         - Video
985       security:
986         - OAuth2: []
987       parameters:
988         - $ref: '#/components/parameters/idOrUUID'
989       requestBody:
990         content:
991           application/json:
992             schema:
993               $ref: '#/components/schemas/UserWatchingVideo'
994         required: true
995       responses:
996         '204':
997           description: successful operation
998   /videos/upload:
999     post:
1000       summary: Upload a video
1001       security:
1002         - OAuth2: []
1003       tags:
1004         - Video
1005       responses:
1006         '200':
1007           description: successful operation
1008           content:
1009             application/json:
1010               schema:
1011                 $ref: '#/components/schemas/VideoUploadResponse'
1012         '403':
1013           description: 'The user video quota is exceeded with this video.'
1014         '408':
1015           description: 'Upload has timed out'
1016         '422':
1017           description: 'Invalid input file.'
1018       requestBody:
1019         content:
1020           multipart/form-data:
1021             schema:
1022               type: object
1023               properties:
1024                 videofile:
1025                   description: Video file
1026                   type: string
1027                   format: binary
1028                 channelId:
1029                   description: Channel id that will contain this video
1030                   type: number
1031                 thumbnailfile:
1032                   description: Video thumbnail file
1033                   type: string
1034                   format: binary
1035                 previewfile:
1036                   description: Video preview file
1037                   type: string
1038                   format: binary
1039                 privacy:
1040                   $ref: '#/components/schemas/VideoPrivacySet'
1041                 category:
1042                   description: Video category
1043                   type: string
1044                 licence:
1045                   description: Video licence
1046                   type: string
1047                 language:
1048                   description: Video language
1049                   type: string
1050                 description:
1051                   description: Video description
1052                   type: string
1053                 waitTranscoding:
1054                   description: Whether or not we wait transcoding before publish the video
1055                   type: string
1056                 support:
1057                   description: Text describing how to support the video uploader
1058                   type: string
1059                 nsfw:
1060                   description: Whether or not this video contains sensitive content
1061                   type: string
1062                 name:
1063                   description: Video name
1064                   type: string
1065                 tags:
1066                   description: Video tags (maximum 5 tags each between 2 and 30 characters)
1067                   type: array
1068                   minItems: 1
1069                   maxItems: 5
1070                   items:
1071                     type: string
1072                     minLength: 2
1073                     maxLength: 30
1074                 commentsEnabled:
1075                   description: Enable or disable comments for this video
1076                   type: string
1077                 originallyPublishedAt:
1078                   description: Date when the content was originally published
1079                   type: string
1080                   format: date-time
1081                 scheduleUpdate:
1082                   $ref: '#/components/schemas/VideoScheduledUpdate'
1083               required:
1084                 - videofile
1085                 - channelId
1086                 - name
1087             encoding:
1088               videofile:
1089                 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
1090               thumbnailfile:
1091                 contentType: image/jpeg
1092               previewfile:
1093                 contentType: image/jpeg
1094       x-code-samples:
1095         - lang: Shell
1096           source: |
1097             ## DEPENDENCIES: httpie, jq
1098             # pip install httpie
1099             USERNAME="<your_username>"
1100             PASSWORD="<your_password>"
1101             FILE_PATH="<your_file_path>"
1102             CHANNEL_ID="<your_channel_id>"
1103             NAME="<video_name>"
1104
1105             API_PATH="https://peertube2.cpy.re/api/v1"
1106             ## AUTH
1107             client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1108             client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1109             token=$(http -b --form POST "$API_PATH/users/token" \
1110               client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
1111               username=$USERNAME \
1112               password=$PASSWORD \
1113               | jq -r ".access_token")
1114             ## VIDEO UPLOAD
1115             http -b --form POST "$API_PATH/videos/upload" \
1116               videofile@$FILE_PATH \
1117               channelId=$CHANNEL_ID \
1118               name=$NAME \
1119               "Authorization:Bearer $token"
1120   /videos/imports:
1121     post:
1122       summary: Import a video
1123       description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
1124       security:
1125         - OAuth2: []
1126       tags:
1127         - Video
1128       responses:
1129         '200':
1130           description: successful operation
1131           content:
1132             application/json:
1133               schema:
1134                 $ref: '#/components/schemas/VideoUploadResponse'
1135       requestBody:
1136         content:
1137           multipart/form-data:
1138             schema:
1139               type: object
1140               properties:
1141                 torrentfile:
1142                   description: Torrent File
1143                   type: string
1144                   format: binary
1145                 targetUrl:
1146                   description: HTTP target URL
1147                   type: string
1148                 magnetUri:
1149                   description: Magnet URI
1150                   type: string
1151                 channelId:
1152                   description: Channel id that will contain this video
1153                   type: number
1154                 thumbnailfile:
1155                   description: Video thumbnail file
1156                   type: string
1157                   format: binary
1158                 previewfile:
1159                   description: Video preview file
1160                   type: string
1161                   format: binary
1162                 privacy:
1163                   $ref: '#/components/schemas/VideoPrivacySet'
1164                 category:
1165                   description: Video category
1166                   type: string
1167                 licence:
1168                   description: Video licence
1169                   type: string
1170                 language:
1171                   description: Video language
1172                   type: string
1173                 description:
1174                   description: Video description
1175                   type: string
1176                 waitTranscoding:
1177                   description: Whether or not we wait transcoding before publish the video
1178                   type: string
1179                 support:
1180                   description: Text describing how to support the video uploader
1181                   type: string
1182                 nsfw:
1183                   description: Whether or not this video contains sensitive content
1184                   type: string
1185                 name:
1186                   description: Video name
1187                   type: string
1188                 tags:
1189                   description: Video tags (maximum 5 tags each between 2 and 30 characters)
1190                   type: array
1191                   minItems: 1
1192                   maxItems: 5
1193                   items:
1194                     type: string
1195                     minLength: 2
1196                     maxLength: 30
1197                 commentsEnabled:
1198                   description: Enable or disable comments for this video
1199                   type: string
1200                 scheduleUpdate:
1201                   $ref: '#/components/schemas/VideoScheduledUpdate'
1202               required:
1203                 - channelId
1204                 - name
1205             encoding:
1206               torrentfile:
1207                 contentType: application/x-bittorrent
1208               thumbnailfile:
1209                 contentType: image/jpeg
1210               previewfile:
1211                 contentType: image/jpeg
1212   /videos/abuse:
1213     get:
1214       summary: List video abuses
1215       security:
1216         - OAuth2:
1217             - admin
1218             - moderator
1219       tags:
1220         - Video Abuses
1221       parameters:
1222         - $ref: '#/components/parameters/start'
1223         - $ref: '#/components/parameters/count'
1224         - $ref: '#/components/parameters/abusesSort'
1225       responses:
1226         '200':
1227           description: successful operation
1228           content:
1229             application/json:
1230               schema:
1231                 type: array
1232                 items:
1233                   $ref: '#/components/schemas/VideoAbuse'
1234   '/videos/{id}/abuse':
1235     post:
1236       summary: Report an abuse
1237       security:
1238         - OAuth2: []
1239       tags:
1240         - Video Abuses
1241         - Videos
1242       parameters:
1243         - $ref: '#/components/parameters/idOrUUID'
1244       requestBody:
1245         content:
1246           application/json:
1247             schema:
1248               type: object
1249               properties:
1250                 reason:
1251                   description: Reason why the user reports this video
1252                   type: string
1253       responses:
1254         '204':
1255           description: successful operation
1256   '/videos/{id}/abuse/{abuseId}':
1257     put:
1258       summary: Update an abuse
1259       security:
1260         - OAuth2:
1261           - admin
1262           - moderator
1263       tags:
1264         - Video Abuses
1265       responses:
1266         '204':
1267           description: successful operation
1268       parameters:
1269         - $ref: '#/components/parameters/idOrUUID'
1270         - $ref: '#/components/parameters/abuseId'
1271       requestBody:
1272         content:
1273           application/json:
1274             schema:
1275               type: object
1276               properties:
1277                 state:
1278                   $ref: '#/components/schemas/VideoAbuseStateSet'
1279                 moderationComment:
1280                   type: string
1281                   description: 'Update the comment of the video abuse for other admin/moderators'
1282     delete:
1283       summary: Delete an abuse
1284       security:
1285         - OAuth2:
1286             - admin
1287             - moderator
1288       tags:
1289         - Video Abuses
1290       responses:
1291         '204':
1292           description: successful operation
1293       parameters:
1294         - $ref: '#/components/parameters/idOrUUID'
1295         - $ref: '#/components/parameters/abuseId'
1296
1297   '/videos/{id}/blacklist':
1298     post:
1299       summary: Blacklist a video
1300       security:
1301         - OAuth2:
1302             - admin
1303             - moderator
1304       tags:
1305         - Video Blacklist
1306       parameters:
1307         - $ref: '#/components/parameters/idOrUUID'
1308       responses:
1309         '204':
1310           description: successful operation
1311     delete:
1312       summary: Delete an entry of the blacklist of a video by its id
1313       security:
1314         - OAuth2:
1315             - admin
1316             - moderator
1317       tags:
1318         - Video Blacklist
1319       parameters:
1320         - $ref: '#/components/parameters/idOrUUID'
1321       responses:
1322         '204':
1323           description: successful operation
1324   /videos/blacklist:
1325     get:
1326       summary: List blacklisted videos
1327       security:
1328         - OAuth2:
1329             - admin
1330             - moderator
1331       tags:
1332         - Video Blacklist
1333       parameters:
1334         - $ref: '#/components/parameters/start'
1335         - $ref: '#/components/parameters/count'
1336         - $ref: '#/components/parameters/blacklistsSort'
1337       responses:
1338         '200':
1339           description: successful operation
1340           content:
1341             application/json:
1342               schema:
1343                 type: array
1344                 items:
1345                   $ref: '#/components/schemas/VideoBlacklist'
1346   /videos/{id}/captions:
1347     get:
1348       summary: List captions of a video
1349       tags:
1350         - Video Caption
1351       parameters:
1352         - $ref: '#/components/parameters/idOrUUID'
1353       responses:
1354         '200':
1355           description: successful operation
1356           content:
1357             application/json:
1358               schema:
1359                 type: object
1360                 properties:
1361                   total:
1362                     type: integer
1363                   data:
1364                     type: array
1365                     items:
1366                       $ref: '#/components/schemas/VideoCaption'
1367   /videos/{id}/captions/{captionLanguage}:
1368     put:
1369       summary: Add or replace a video caption
1370       tags:
1371         - Video Caption
1372       parameters:
1373         - $ref: '#/components/parameters/idOrUUID'
1374         - $ref: '#/components/parameters/captionLanguage'
1375       requestBody:
1376         content:
1377           multipart/form-data:
1378             schema:
1379               type: object
1380               properties:
1381                 captionfile:
1382                   description: The file to upload.
1383                   type: string
1384                   format: binary
1385             encoding:
1386               captionfile:
1387                 contentType: text/vtt, application/x-subrip, text/plain
1388       responses:
1389         '204':
1390           description: successful operation
1391     delete:
1392       summary: Delete a video caption
1393       tags:
1394         - Video Caption
1395       parameters:
1396         - $ref: '#/components/parameters/idOrUUID'
1397         - $ref: '#/components/parameters/captionLanguage'
1398       responses:
1399         '204':
1400           description: successful operation
1401   /video-channels:
1402     get:
1403       summary: List video channels
1404       tags:
1405         - Video Channels
1406       parameters:
1407         - $ref: '#/components/parameters/start'
1408         - $ref: '#/components/parameters/count'
1409         - $ref: '#/components/parameters/sort'
1410       responses:
1411         '200':
1412           description: successful operation
1413           content:
1414             application/json:
1415               schema:
1416                 type: array
1417                 items:
1418                   $ref: '#/components/schemas/VideoChannel'
1419     post:
1420       summary: Create a video channel
1421       security:
1422         - OAuth2: []
1423       tags:
1424         - Video Channels
1425       responses:
1426         '204':
1427           description: successful operation
1428       requestBody:
1429         content:
1430           application/json:
1431             schema:
1432               $ref: '#/components/schemas/VideoChannelCreate'
1433   '/video-channels/{channelHandle}':
1434     get:
1435       summary: Get a video channel
1436       tags:
1437         - Video Channels
1438       parameters:
1439         - $ref: '#/components/parameters/channelHandle'
1440       responses:
1441         '200':
1442           description: successful operation
1443           content:
1444             application/json:
1445               schema:
1446                 $ref: '#/components/schemas/VideoChannel'
1447     put:
1448       summary: Update a video channel
1449       security:
1450         - OAuth2: []
1451       tags:
1452         - Video Channels
1453       parameters:
1454         - $ref: '#/components/parameters/channelHandle'
1455       responses:
1456         '204':
1457           description: successful operation
1458       requestBody:
1459         content:
1460           application/json:
1461             schema:
1462               $ref: '#/components/schemas/VideoChannelUpdate'
1463     delete:
1464       summary: Delete a video channel
1465       security:
1466         - OAuth2: []
1467       tags:
1468         - Video Channels
1469       parameters:
1470         - $ref: '#/components/parameters/channelHandle'
1471       responses:
1472         '204':
1473           description: successful operation
1474   '/video-channels/{channelHandle}/videos':
1475     get:
1476       summary: List videos of a video channel
1477       tags:
1478         - Video
1479         - Video Channels
1480       parameters:
1481         - $ref: '#/components/parameters/channelHandle'
1482         - $ref: '#/components/parameters/categoryOneOf'
1483         - $ref: '#/components/parameters/tagsOneOf'
1484         - $ref: '#/components/parameters/tagsAllOf'
1485         - $ref: '#/components/parameters/licenceOneOf'
1486         - $ref: '#/components/parameters/languageOneOf'
1487         - $ref: '#/components/parameters/nsfw'
1488         - $ref: '#/components/parameters/filter'
1489         - $ref: '#/components/parameters/skipCount'
1490         - $ref: '#/components/parameters/start'
1491         - $ref: '#/components/parameters/count'
1492         - $ref: '#/components/parameters/videosSort'
1493       responses:
1494         '200':
1495           description: successful operation
1496           content:
1497             application/json:
1498               schema:
1499                 $ref: '#/components/schemas/VideoListResponse'
1500
1501   /video-playlists/privacies:
1502     get:
1503       summary: List available playlist privacies
1504       tags:
1505         - Video Playlists
1506       responses:
1507         '200':
1508           description: successful operation
1509           content:
1510             application/json:
1511               schema:
1512                 type: array
1513                 items:
1514                   type: string
1515
1516   /video-playlists:
1517     get:
1518       summary: List video playlists
1519       tags:
1520         - Video Playlists
1521       parameters:
1522         - $ref: '#/components/parameters/start'
1523         - $ref: '#/components/parameters/count'
1524         - $ref: '#/components/parameters/sort'
1525       responses:
1526         '200':
1527           description: successful operation
1528           content:
1529             application/json:
1530               schema:
1531                 type: array
1532                 items:
1533                   $ref: '#/components/schemas/VideoPlaylist'
1534     post:
1535       summary: Create a video playlist
1536       description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
1537       security:
1538         - OAuth2: []
1539       tags:
1540         - Video Playlists
1541       responses:
1542         '200':
1543           description: successful operation
1544           content:
1545             application/json:
1546               schema:
1547                 type: object
1548                 properties:
1549                   videoPlaylist:
1550                     type: object
1551                     properties:
1552                       id:
1553                         type: number
1554                       uuid:
1555                         type: string
1556       requestBody:
1557         content:
1558           multipart/form-data:
1559             schema:
1560               type: object
1561               properties:
1562                 displayName:
1563                   description: Video playlist display name
1564                   type: string
1565                 thumbnailfile:
1566                   description: Video playlist thumbnail file
1567                   type: string
1568                   format: binary
1569                 privacy:
1570                   $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1571                 description:
1572                   description: Video playlist description
1573                   type: string
1574                 videoChannelId:
1575                   description: Video channel in which the playlist will be published
1576                   type: number
1577               required:
1578                 - displayName
1579
1580   /video-playlists/{id}:
1581     get:
1582       summary: Get a video playlist
1583       tags:
1584         - Video Playlists
1585       parameters:
1586         - $ref: '#/components/parameters/idOrUUID'
1587       responses:
1588         '200':
1589           description: successful operation
1590           content:
1591             application/json:
1592               schema:
1593                 $ref: '#/components/schemas/VideoPlaylist'
1594     put:
1595       summary: Update a video playlist
1596       description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
1597       security:
1598         - OAuth2: []
1599       tags:
1600         - Video Playlists
1601       responses:
1602         '204':
1603           description: successful operation
1604       parameters:
1605         - $ref: '#/components/parameters/idOrUUID'
1606       requestBody:
1607         content:
1608           multipart/form-data:
1609             schema:
1610               type: object
1611               properties:
1612                 displayName:
1613                   description: Video playlist display name
1614                   type: string
1615                 thumbnailfile:
1616                   description: Video playlist thumbnail file
1617                   type: string
1618                   format: binary
1619                 privacy:
1620                   $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1621                 description:
1622                   description: Video playlist description
1623                   type: string
1624                 videoChannelId:
1625                   description: Video channel in which the playlist will be published
1626                   type: number
1627     delete:
1628       summary: Delete a video playlist
1629       security:
1630         - OAuth2: []
1631       tags:
1632         - Video Playlists
1633       parameters:
1634         - $ref: '#/components/parameters/idOrUUID'
1635       responses:
1636         '204':
1637           description: successful operation
1638
1639   /video-playlists/{id}/videos:
1640     get:
1641       summary: 'List videos of a playlist'
1642       tags:
1643         - Videos
1644         - Video Playlists
1645       parameters:
1646         - $ref: '#/components/parameters/idOrUUID'
1647       responses:
1648         '200':
1649           description: successful operation
1650           content:
1651             application/json:
1652               schema:
1653                 $ref: '#/components/schemas/VideoListResponse'
1654     post:
1655       summary: 'Add a video in a playlist'
1656       security:
1657         - OAuth2: []
1658       tags:
1659         - Videos
1660         - Video Playlists
1661       parameters:
1662         - $ref: '#/components/parameters/idOrUUID'
1663       responses:
1664         '200':
1665           description: successful operation
1666           content:
1667             application/json:
1668               schema:
1669                 type: object
1670                 properties:
1671                   videoPlaylistElement:
1672                     type: object
1673                     properties:
1674                       id:
1675                         type: number
1676       requestBody:
1677         content:
1678           application/json:
1679             schema:
1680               type: object
1681               properties:
1682                 videoId:
1683                   type: number
1684                   description: 'Video to add in the playlist'
1685                 startTimestamp:
1686                   type: number
1687                   description: 'Start the video at this specific timestamp (in seconds)'
1688                 stopTimestamp:
1689                   type: number
1690                   description: 'Stop the video at this specific timestamp (in seconds)'
1691               required:
1692                 - videoId
1693
1694   /video-playlists/{id}/videos/reorder:
1695     post:
1696       summary: 'Reorder a playlist'
1697       security:
1698         - OAuth2: []
1699       tags:
1700         - Video Playlists
1701       parameters:
1702         - $ref: '#/components/parameters/idOrUUID'
1703       responses:
1704         '204':
1705           description: successful operation
1706       requestBody:
1707         content:
1708           application/json:
1709             schema:
1710               type: object
1711               properties:
1712                 startPosition:
1713                   type: number
1714                   description: 'Start position of the element to reorder (starts from 1)'
1715                 insertAfterPosition:
1716                   type: number
1717                   description: 'New position for the block to reorder (starts from 0, to add the block before the first element)'
1718                 reorderLength:
1719                   type: number
1720                   description: 'How many element from startPosition to reorder (minimum length is 1)'
1721               required:
1722                 - startPosition
1723                 - insertAfterPosition
1724
1725   /video-playlists/{id}/videos/{playlistElementId}:
1726     put:
1727       summary: 'Update a playlist element'
1728       security:
1729         - OAuth2: []
1730       tags:
1731         - Video Playlists
1732       parameters:
1733         - $ref: '#/components/parameters/idOrUUID'
1734         - $ref: '#/components/parameters/playlistElementId'
1735       responses:
1736         '204':
1737           description: successful operation
1738       requestBody:
1739         content:
1740           application/json:
1741             schema:
1742               type: object
1743               properties:
1744                 startTimestamp:
1745                   type: number
1746                   description: 'Start the video at this specific timestamp (in seconds)'
1747                 stopTimestamp:
1748                   type: number
1749                   description: 'Stop the video at this specific timestamp (in seconds)'
1750     delete:
1751       summary: 'Delete an element from a playlist'
1752       security:
1753         - OAuth2: []
1754       tags:
1755         - Video Playlists
1756       parameters:
1757         - $ref: '#/components/parameters/idOrUUID'
1758         - $ref: '#/components/parameters/playlistElementId'
1759       responses:
1760         '204':
1761           description: successful operation
1762
1763   '/users/me/video-playlists/videos-exist':
1764     get:
1765       summary: 'Check video exists in my playlists'
1766       security:
1767         - OAuth2: []
1768       tags:
1769         - Video Playlists
1770       parameters:
1771         - name: videoIds
1772           in: query
1773           required: true
1774           description: The video ids to check
1775           schema:
1776             type: array
1777             items:
1778               type: number
1779       responses:
1780         '200':
1781           description: successful operation
1782           content:
1783             application/json:
1784               schema:
1785                 type: object
1786                 properties:
1787                   videoId:
1788                     type: array
1789                     items:
1790                       type: object
1791                       properties:
1792                         playlistElementId:
1793                           type: number
1794                         playlistId:
1795                           type: number
1796                         startTimestamp:
1797                           type: number
1798                         stopTimestamp:
1799                           type: number
1800
1801   '/accounts/{name}/video-channels':
1802     get:
1803       summary: List video channels of an account
1804       tags:
1805         - Video Channels
1806         - Accounts
1807       parameters:
1808         - $ref: '#/components/parameters/name'
1809       responses:
1810         '200':
1811           description: successful operation
1812           content:
1813             application/json:
1814               schema:
1815                 type: array
1816                 items:
1817                   $ref: '#/components/schemas/VideoChannel'
1818   '/accounts/{name}/ratings':
1819     get:
1820       summary: List ratings of an account
1821       security:
1822         - OAuth2: []
1823       tags:
1824         - Accounts
1825       parameters:
1826         - $ref: '#/components/parameters/name'
1827         - $ref: '#/components/parameters/start'
1828         - $ref: '#/components/parameters/count'
1829         - $ref: '#/components/parameters/sort'
1830         - name: rating
1831           in: query
1832           required: false
1833           description: Optionally filter which ratings to retrieve
1834           schema:
1835             type: string
1836             enum:
1837               - like
1838               - dislike
1839       responses:
1840         '200':
1841           description: successful operation
1842           content:
1843             application/json:
1844               schema:
1845                 type: array
1846                 items:
1847                   $ref: '#/components/schemas/VideoRating'
1848   '/videos/{id}/comment-threads':
1849     get:
1850       summary: List threads of a video
1851       tags:
1852         - Video Comments
1853       parameters:
1854         - $ref: '#/components/parameters/idOrUUID'
1855         - $ref: '#/components/parameters/start'
1856         - $ref: '#/components/parameters/count'
1857         - $ref: '#/components/parameters/commentsSort'
1858       responses:
1859         '200':
1860           description: successful operation
1861           content:
1862             application/json:
1863               schema:
1864                 $ref: '#/components/schemas/CommentThreadResponse'
1865     post:
1866       summary: Create a thread
1867       security:
1868         - OAuth2: []
1869       tags:
1870         - Video Comments
1871       parameters:
1872         - $ref: '#/components/parameters/idOrUUID'
1873       responses:
1874         '200':
1875           description: successful operation
1876           content:
1877             application/json:
1878               schema:
1879                 $ref: '#/components/schemas/CommentThreadPostResponse'
1880       requestBody:
1881         content:
1882           application/json:
1883             schema:
1884               type: object
1885               properties:
1886                 text:
1887                   type: string
1888                   description: 'Text comment'
1889               required:
1890                 - text
1891
1892   '/videos/{id}/comment-threads/{threadId}':
1893     get:
1894       summary: Get a thread
1895       tags:
1896         - Video Comments
1897       parameters:
1898         - $ref: '#/components/parameters/idOrUUID'
1899         - $ref: '#/components/parameters/threadId'
1900       responses:
1901         '200':
1902           description: successful operation
1903           content:
1904             application/json:
1905               schema:
1906                 $ref: '#/components/schemas/VideoCommentThreadTree'
1907   '/videos/{id}/comments/{commentId}':
1908     post:
1909       summary: Reply to a thread of a video
1910       security:
1911         - OAuth2: []
1912       tags:
1913         - Video Comments
1914       parameters:
1915         - $ref: '#/components/parameters/idOrUUID'
1916         - $ref: '#/components/parameters/commentId'
1917       responses:
1918         '200':
1919           description: successful operation
1920           content:
1921             application/json:
1922               schema:
1923                 $ref: '#/components/schemas/CommentThreadPostResponse'
1924       requestBody:
1925         content:
1926           application/json:
1927             schema:
1928               type: object
1929               properties:
1930                 text:
1931                   type: string
1932                   description: 'Text comment'
1933               required:
1934                 - text
1935
1936     delete:
1937       summary: Delete a comment or a reply
1938       security:
1939         - OAuth2: []
1940       tags:
1941         - Video Comments
1942       parameters:
1943         - $ref: '#/components/parameters/idOrUUID'
1944         - $ref: '#/components/parameters/commentId'
1945       responses:
1946         '204':
1947           description: successful operation
1948   '/videos/{id}/rate':
1949     put:
1950       summary: Like/dislike a video
1951       security:
1952         - OAuth2: []
1953       tags:
1954         - Video Rates
1955       parameters:
1956         - $ref: '#/components/parameters/idOrUUID'
1957       responses:
1958         '204':
1959           description: successful operation
1960   /search/videos:
1961     get:
1962       tags:
1963         - Search
1964       summary: Search videos
1965       parameters:
1966         - $ref: '#/components/parameters/categoryOneOf'
1967         - $ref: '#/components/parameters/tagsOneOf'
1968         - $ref: '#/components/parameters/tagsAllOf'
1969         - $ref: '#/components/parameters/licenceOneOf'
1970         - $ref: '#/components/parameters/languageOneOf'
1971         - $ref: '#/components/parameters/nsfw'
1972         - $ref: '#/components/parameters/filter'
1973         - $ref: '#/components/parameters/skipCount'
1974         - $ref: '#/components/parameters/start'
1975         - $ref: '#/components/parameters/count'
1976         - $ref: '#/components/parameters/videosSort'
1977         - $ref: '#/components/parameters/videosSearchSort'
1978         - name: search
1979           in: query
1980           required: true
1981           description: String to search
1982           schema:
1983             type: string
1984       responses:
1985         '200':
1986           description: successful operation
1987           content:
1988             application/json:
1989               schema:
1990                 $ref: '#/components/schemas/VideoListResponse'
1991 servers:
1992   - url: 'https://peertube.cpy.re/api/v1'
1993     description: Live Test Server (live data - stable version)
1994   - url: 'https://peertube2.cpy.re/api/v1'
1995     description: Live Test Server (live data - latest nighlty version)
1996   - url: 'https://peertube3.cpy.re/api/v1'
1997     description: Live Test Server (live data - latest RC version)
1998 components:
1999   parameters:
2000     start:
2001       name: start
2002       in: query
2003       required: false
2004       description: Offset
2005       schema:
2006         type: number
2007     count:
2008       name: count
2009       in: query
2010       required: false
2011       description: Number of items
2012       schema:
2013         type: number
2014     sort:
2015       name: sort
2016       in: query
2017       required: false
2018       description: Sort column (-createdAt for example)
2019       schema:
2020         type: string
2021     videosSort:
2022       name: sort
2023       in: query
2024       required: false
2025       description: Sort videos by criteria
2026       schema:
2027         type: string
2028         enum:
2029         - -name
2030         - -duration
2031         - -createdAt
2032         - -publishedAt
2033         - -views
2034         - -likes
2035         - -trending
2036     videosSearchSort:
2037       name: sort
2038       in: query
2039       required: false
2040       description: Sort videos by criteria
2041       schema:
2042         type: string
2043         enum:
2044         - -name
2045         - -duration
2046         - -createdAt
2047         - -publishedAt
2048         - -views
2049         - -likes
2050         - -match
2051     commentsSort:
2052       name: sort
2053       in: query
2054       required: false
2055       description: Sort comments by criteria
2056       schema:
2057         type: string
2058         enum:
2059         - -createdAt
2060         - -totalReplies
2061     blacklistsSort:
2062       name: sort
2063       in: query
2064       required: false
2065       description: Sort blacklists by criteria
2066       schema:
2067         type: string
2068         enum:
2069         - -id
2070         - -name
2071         - -duration
2072         - -views
2073         - -likes
2074         - -dislikes
2075         - -uuid
2076         - -createdAt
2077     usersSort:
2078       name: sort
2079       in: query
2080       required: false
2081       description: Sort users by criteria
2082       schema:
2083         type: string
2084         enum:
2085         - -id
2086         - -username
2087         - -createdAt
2088     abusesSort:
2089       name: sort
2090       in: query
2091       required: false
2092       description: Sort abuses by criteria
2093       schema:
2094         type: string
2095         enum:
2096         - -id
2097         - -createdAt
2098         - -state
2099     name:
2100       name: name
2101       in: path
2102       required: true
2103       description: >-
2104         The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
2105         example)
2106       schema:
2107         type: string
2108     id:
2109       name: id
2110       in: path
2111       required: true
2112       description: The user id
2113       schema:
2114         type: number
2115     idOrUUID:
2116       name: id
2117       in: path
2118       required: true
2119       description: The object id or uuid
2120       schema:
2121         type: string
2122     playlistElementId:
2123       name: playlistElementId
2124       in: path
2125       required: true
2126       description: Playlist element id
2127       schema:
2128         type: number
2129     abuseId:
2130       name: abuseId
2131       in: path
2132       required: true
2133       description: Video abuse id
2134       schema:
2135         type: number
2136     captionLanguage:
2137       name: captionLanguage
2138       in: path
2139       required: true
2140       description: The caption language
2141       schema:
2142         type: string
2143     channelHandle:
2144       name: channelHandle
2145       in: path
2146       required: true
2147       description: "The video channel handle (example: 'my_username@example.com' or 'my_username')"
2148       schema:
2149         type: string
2150     subscriptionHandle:
2151       name: subscriptionHandle
2152       in: path
2153       required: true
2154       description: "The subscription handle (example: 'my_username@example.com' or 'my_username')"
2155       schema:
2156         type: string
2157     threadId:
2158       name: threadId
2159       in: path
2160       required: true
2161       description: The thread id (root comment id)
2162       schema:
2163         type: number
2164     commentId:
2165       name: commentId
2166       in: path
2167       required: true
2168       description: The comment id
2169       schema:
2170         type: number
2171     categoryOneOf:
2172       name: categoryOneOf
2173       in: query
2174       required: false
2175       description: category id of the video (see /videos/categories)
2176       schema:
2177         oneOf:
2178         - type: number
2179         - type: array
2180           items:
2181             type: number
2182       style: form
2183       explode: false
2184     tagsOneOf:
2185       name: tagsOneOf
2186       in: query
2187       required: false
2188       description: tag(s) of the video
2189       schema:
2190         oneOf:
2191         - type: string
2192         - type: array
2193           items:
2194             type: string
2195       style: form
2196       explode: false
2197     tagsAllOf:
2198       name: tagsAllOf
2199       in: query
2200       required: false
2201       description: tag(s) of the video, where all should be present in the video
2202       schema:
2203         oneOf:
2204         - type: string
2205         - type: array
2206           items:
2207             type: string
2208       style: form
2209       explode: false
2210     languageOneOf:
2211       name: languageOneOf
2212       in: query
2213       required: false
2214       description: language id of the video (see /videos/languages). Use _unknown to filter on videos that don't have a video language
2215       schema:
2216         oneOf:
2217         - type: string
2218         - type: array
2219           items:
2220             type: string
2221       style: form
2222       explode: false
2223     licenceOneOf:
2224       name: licenceOneOf
2225       in: query
2226       required: false
2227       description: licence id of the video (see /videos/licences)
2228       schema:
2229         oneOf:
2230         - type: number
2231         - type: array
2232           items:
2233             type: number
2234       style: form
2235       explode: false
2236     skipCount:
2237       name: skipCount
2238       in: query
2239       required: false
2240       description: if you don't need the `total` in the response
2241       schema:
2242         type: string
2243         enum:
2244           - 'true'
2245           - 'false'
2246     nsfw:
2247       name: nsfw
2248       in: query
2249       required: false
2250       description: whether to include nsfw videos, if any
2251       schema:
2252         type: string
2253         enum:
2254         - 'true'
2255         - 'false'
2256     filter:
2257       name: filter
2258       in: query
2259       required: false
2260       description: >
2261         Special filters (local for instance) which might require special rights:
2262          * `local` - only videos local to the instance
2263          * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
2264       schema:
2265         type: string
2266         enum:
2267         - local
2268         - all-local
2269     subscriptionsUris:
2270       name: uris
2271       in: query
2272       required: true
2273       description: list of uris to check if each is part of the user subscriptions
2274       schema:
2275         type: array
2276         items:
2277           type: string
2278   securitySchemes:
2279     OAuth2:
2280       description: >
2281         In the header: *Authorization: Bearer <token\>*
2282
2283
2284         Authenticating via OAuth requires the following steps:
2285
2286
2287         - Have an account with sufficient authorization levels
2288
2289         - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
2290         Bearer Token
2291
2292         - Make Authenticated Requests
2293       type: oauth2
2294       flows:
2295         password:
2296           tokenUrl: 'https://peertube.example.com/api/v1/users/token'
2297           scopes:
2298             admin: Admin scope
2299             moderator: Moderator scope
2300             user: User scope
2301   schemas:
2302     VideoConstantNumber:
2303       properties:
2304         id:
2305           type: number
2306         label:
2307           type: string
2308     VideoConstantString:
2309       properties:
2310         id:
2311           type: string
2312         label:
2313           type: string
2314
2315     VideoPlaylistPrivacySet:
2316       type: integer
2317       enum:
2318         - 1
2319         - 2
2320         - 3
2321       description: 'The video playlist privacy (Public = 1, Unlisted = 2, Private = 3)'
2322     VideoPlaylistPrivacyConstant:
2323       properties:
2324         id:
2325           $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2326         label:
2327           type: string
2328
2329     VideoPlaylistTypeSet:
2330       type: integer
2331       enum:
2332         - 1
2333         - 2
2334       description: 'The video playlist type (Regular = 1, Watch Later = 2)'
2335     VideoPlaylistTypeConstant:
2336       properties:
2337         id:
2338           $ref: '#/components/schemas/VideoPlaylistTypeSet'
2339         label:
2340           type: string
2341
2342     VideoPrivacySet:
2343       type: integer
2344       enum:
2345         - 1
2346         - 2
2347         - 3
2348         - 4
2349       description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3, Internal = 4)'
2350     VideoPrivacyConstant:
2351       properties:
2352         id:
2353           $ref: '#/components/schemas/VideoPrivacySet'
2354         label:
2355           type: string
2356
2357     NSFWPolicy:
2358       type: string
2359       enum:
2360         - display
2361         - blur
2362         - do_not_list
2363
2364     UserRole:
2365       type: number
2366       enum:
2367         - 0
2368         - 1
2369         - 2
2370       description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2371
2372     VideoStateConstant:
2373       properties:
2374         id:
2375           type: integer
2376           enum:
2377             - 1
2378             - 2
2379             - 3
2380           description: 'The video state (Published = 1, to transcode = 2, to import = 3)'
2381         label:
2382           type: string
2383
2384     VideoAbuseStateSet:
2385       type: integer
2386       enum:
2387         - 1
2388         - 2
2389         - 3
2390       description: 'The video playlist privacy (Pending = 1, Rejected = 2, Accepted = 3)'
2391     VideoAbuseStateConstant:
2392       properties:
2393         id:
2394           $ref: '#/components/schemas/VideoAbuseStateSet'
2395         label:
2396           type: string
2397
2398     VideoResolutionConstant:
2399       properties:
2400         id:
2401           type: integer
2402           description: 'Video resolution (240, 360, 720 ...)'
2403         label:
2404           type: string
2405     VideoScheduledUpdate:
2406       properties:
2407         privacy:
2408           $ref: '#/components/schemas/VideoPrivacySet'
2409         updateAt:
2410           type: string
2411           format: date
2412           description: When to update the video
2413       required:
2414         - updateAt
2415     AccountSummary:
2416       properties:
2417         id:
2418           type: number
2419         name:
2420           type: string
2421         displayName:
2422           type: string
2423         url:
2424           type: string
2425         host:
2426           type: string
2427         avatar:
2428           nullable: true
2429           allOf:
2430             - $ref: '#/components/schemas/Avatar'
2431     VideoChannelSummary:
2432       properties:
2433         id:
2434           type: number
2435         name:
2436           type: string
2437         displayName:
2438           type: string
2439         url:
2440           type: string
2441         host:
2442           type: string
2443         avatar:
2444           nullable: true
2445           allOf:
2446             - $ref: '#/components/schemas/Avatar'
2447     PlaylistElement:
2448       properties:
2449         position:
2450           type: number
2451         startTimestamp:
2452           type: number
2453         stopTimestamp:
2454           type: number
2455         video:
2456           nullable: true
2457           allOf:
2458             - $ref: '#/components/schemas/Video'
2459     VideoFile:
2460       properties:
2461         magnetUri:
2462           type: string
2463         resolution:
2464           $ref: '#/components/schemas/VideoResolutionConstant'
2465         size:
2466           type: number
2467           description: 'Video file size in bytes'
2468         torrentUrl:
2469           type: string
2470         torrentDownloadUrl:
2471           type: string
2472         fileUrl:
2473           type: string
2474         fileDownloadUrl:
2475           type: string
2476         fps:
2477           type: number
2478     VideoStreamingPlaylists:
2479       properties:
2480         id:
2481           type: number
2482         type:
2483           type: number
2484           enum:
2485             - 1
2486           description: 'Playlist type (HLS = 1)'
2487         playlistUrl:
2488           type: string
2489         segmentsSha256Url:
2490           type: string
2491         redundancies:
2492           type: array
2493           items:
2494             type: object
2495             properties:
2496               baseUrl:
2497                 type: string
2498     Video:
2499       properties:
2500         id:
2501           type: number
2502         uuid:
2503           type: string
2504         createdAt:
2505           type: string
2506         publishedAt:
2507           type: string
2508         updatedAt:
2509           type: string
2510         originallyPublishedAt:
2511           type: string
2512         category:
2513           $ref: '#/components/schemas/VideoConstantNumber'
2514         licence:
2515           $ref: '#/components/schemas/VideoConstantNumber'
2516         language:
2517           $ref: '#/components/schemas/VideoConstantString'
2518         privacy:
2519           $ref: '#/components/schemas/VideoPrivacyConstant'
2520         description:
2521           type: string
2522         duration:
2523           type: number
2524         isLocal:
2525           type: boolean
2526         name:
2527           type: string
2528         thumbnailPath:
2529           type: string
2530         previewPath:
2531           type: string
2532         embedPath:
2533           type: string
2534         views:
2535           type: number
2536         likes:
2537           type: number
2538         dislikes:
2539           type: number
2540         nsfw:
2541           type: boolean
2542         waitTranscoding:
2543           type: boolean
2544           nullable: true
2545         state:
2546           $ref: '#/components/schemas/VideoStateConstant'
2547         scheduledUpdate:
2548           nullable: true
2549           allOf:
2550             - $ref: '#/components/schemas/VideoScheduledUpdate'
2551         blacklisted:
2552           nullable: true
2553           type: boolean
2554         blacklistedReason:
2555           nullable: true
2556           type: string
2557         account:
2558           $ref: '#/components/schemas/AccountSummary'
2559         channel:
2560           $ref: '#/components/schemas/VideoChannelSummary'
2561         userHistory:
2562           nullable: true
2563           type: object
2564           properties:
2565             currentTime:
2566               type: number
2567     VideoDetails:
2568       allOf:
2569         - $ref: '#/components/schemas/Video'
2570         - type: object
2571           properties:
2572             descriptionPath:
2573               type: string
2574             support:
2575               type: string
2576             channel:
2577               $ref: '#/components/schemas/VideoChannel'
2578             account:
2579               $ref: '#/components/schemas/Account'
2580             tags:
2581               type: array
2582               items:
2583                 type: string
2584             files:
2585               type: array
2586               items:
2587                 $ref: '#/components/schemas/VideoFile'
2588             commentsEnabled:
2589               type: boolean
2590             downloadEnabled:
2591               type: boolean
2592             trackerUrls:
2593               type: array
2594               items:
2595                 type: string
2596             streamingPlaylists:
2597               type: array
2598               items:
2599                 $ref: '#/components/schemas/VideoStreamingPlaylists'
2600     VideoImportStateConstant:
2601       properties:
2602         id:
2603           type: integer
2604           enum:
2605             - 1
2606             - 2
2607             - 3
2608           description: 'The video import state (Pending = 1, Success = 2, Failed = 3)'
2609         label:
2610           type: string
2611     VideoImport:
2612       properties:
2613         id:
2614           type: number
2615         targetUrl:
2616           type: string
2617         magnetUri:
2618           type: string
2619         torrentName:
2620           type: string
2621         state:
2622           type: object
2623           properties:
2624             id:
2625               $ref: '#/components/schemas/VideoImportStateConstant'
2626             label:
2627               type: string
2628         error:
2629           type: string
2630         createdAt:
2631           type: string
2632         updatedAt:
2633           type: string
2634         video:
2635           $ref: '#/components/schemas/Video'
2636     VideoAbuse:
2637       properties:
2638         id:
2639           type: number
2640         reason:
2641           type: string
2642         reporterAccount:
2643           $ref: '#/components/schemas/Account'
2644         state:
2645           $ref: '#/components/schemas/VideoAbuseStateConstant'
2646         moderationComment:
2647           type: string
2648         video:
2649           type: object
2650           properties:
2651             id:
2652               type: number
2653             name:
2654               type: string
2655             uuid:
2656               type: string
2657         createdAt:
2658           type: string
2659     VideoBlacklist:
2660       properties:
2661         id:
2662           type: number
2663         videoId:
2664           type: number
2665         createdAt:
2666           type: string
2667         updatedAt:
2668           type: string
2669         name:
2670           type: string
2671         uuid:
2672           type: string
2673         description:
2674           type: string
2675         duration:
2676           type: number
2677         views:
2678           type: number
2679         likes:
2680           type: number
2681         dislikes:
2682           type: number
2683         nsfw:
2684           type: boolean
2685     VideoChannel:
2686       properties:
2687         displayName:
2688           type: string
2689         description:
2690           type: string
2691         isLocal:
2692           type: boolean
2693         ownerAccount:
2694           type: object
2695           properties:
2696             id:
2697               type: number
2698             uuid:
2699               type: string
2700     VideoPlaylist:
2701       properties:
2702         id:
2703           type: number
2704         createdAt:
2705           type: string
2706         updatedAt:
2707           type: string
2708         description:
2709           type: string
2710         uuid:
2711           type: string
2712         displayName:
2713           type: string
2714         isLocal:
2715           type: boolean
2716         videoLength:
2717           type: number
2718         thumbnailPath:
2719           type: string
2720         privacy:
2721           $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
2722         type:
2723           $ref: '#/components/schemas/VideoPlaylistTypeConstant'
2724         ownerAccount:
2725           $ref: '#/components/schemas/AccountSummary'
2726         videoChannel:
2727           $ref: '#/components/schemas/VideoChannelSummary'
2728     VideoComment:
2729       properties:
2730         id:
2731           type: number
2732         url:
2733           type: string
2734         text:
2735           type: string
2736         threadId:
2737           type: number
2738         inReplyToCommentId:
2739           type: number
2740         videoId:
2741           type: number
2742         createdAt:
2743           type: string
2744         updatedAt:
2745           type: string
2746         totalRepliesFromVideoAuthor:
2747           type: number
2748         totalReplies:
2749           type: number
2750         account:
2751           $ref: '#/components/schemas/Account'
2752     VideoCommentThreadTree:
2753       properties:
2754         comment:
2755           $ref: '#/components/schemas/VideoComment'
2756         children:
2757           type: array
2758           items:
2759             $ref: '#/components/schemas/VideoCommentThreadTree'
2760     VideoCaption:
2761       properties:
2762         language:
2763           $ref: '#/components/schemas/VideoConstantString'
2764         captionPath:
2765           type: string
2766     Avatar:
2767       properties:
2768         path:
2769           type: string
2770         createdAt:
2771           type: string
2772         updatedAt:
2773           type: string
2774     Actor:
2775       properties:
2776         id:
2777           type: number
2778         url:
2779           type: string
2780         name:
2781           type: string
2782         host:
2783           type: string
2784         followingCount:
2785           type: number
2786         followersCount:
2787           type: number
2788         createdAt:
2789           type: string
2790         updatedAt:
2791           type: string
2792         avatar:
2793           $ref: '#/components/schemas/Avatar'
2794     Account:
2795       allOf:
2796         - $ref: '#/components/schemas/Actor'
2797         - properties:
2798             userId:
2799               type: string
2800             displayName:
2801               type: string
2802             description:
2803               type: string
2804     User:
2805       properties:
2806         id:
2807           type: number
2808         username:
2809           type: string
2810         email:
2811           type: string
2812         theme:
2813           type: string
2814           description: 'Theme enabled by this user'
2815         emailVerified:
2816           type: boolean
2817           description: 'Is email verified?'
2818         nsfwPolicy:
2819           $ref: '#/components/schemas/NSFWPolicy'
2820         webtorrentEnabled:
2821           type: boolean
2822         autoPlayVideo:
2823           type: boolean
2824         role:
2825           $ref: '#/components/schemas/UserRole'
2826         roleLabel:
2827           type: string
2828           enum:
2829             - User
2830             - Moderator
2831             - Administrator
2832         videoQuota:
2833           type: number
2834         videoQuotaDaily:
2835           type: number
2836         videosCount:
2837           type: number
2838         videoAbusesCount:
2839           type: number
2840         videoAbusesAcceptedCount:
2841           type: number
2842         videoAbusesCreatedCount:
2843           type: number
2844         videoCommentsCount:
2845           type: number
2846         noInstanceConfigWarningModal:
2847           type: boolean
2848         noWelcomeModal:
2849           type: boolean
2850         blocked:
2851           type: boolean
2852         blockedReason:
2853           type: string
2854         createdAt:
2855           type: string
2856         account:
2857           $ref: '#/components/schemas/Account'
2858         videoChannels:
2859           type: array
2860           items:
2861             $ref: '#/components/schemas/VideoChannel'
2862     UserWatchingVideo:
2863       properties:
2864         currentTime:
2865           type: number
2866     ServerConfig:
2867       properties:
2868         instance:
2869           type: object
2870           properties:
2871             name:
2872               type: string
2873             shortDescription:
2874               type: string
2875             defaultClientRoute:
2876               type: string
2877             isNSFW:
2878               type: boolean
2879             defaultNSFWPolicy:
2880               type: string
2881             customizations:
2882               type: object
2883               properties:
2884                 javascript:
2885                   type: string
2886                 css:
2887                   type: string
2888         search:
2889           type: object
2890           properties:
2891             remoteUri:
2892               type: object
2893               properties:
2894                 users:
2895                   type: boolean
2896                 anonymous:
2897                   type: boolean
2898         plugin:
2899           type: object
2900           properties:
2901             registered:
2902               type: array
2903               items:
2904                 type: string
2905         theme:
2906           type: object
2907           properties:
2908             registered:
2909               type: array
2910               items:
2911                 type: string
2912         email:
2913           type: object
2914           properties:
2915             enabled:
2916               type: boolean
2917         contactForm:
2918           type: object
2919           properties:
2920             enabled:
2921               type: boolean
2922         serverVersion:
2923           type: string
2924         serverCommit:
2925           type: string
2926         signup:
2927           type: object
2928           properties:
2929             allowed:
2930               type: boolean
2931             allowedForCurrentIP:
2932               type: boolean
2933             requiresEmailVerification:
2934               type: boolean
2935         transcoding:
2936           type: object
2937           properties:
2938             hls:
2939               type: object
2940               properties:
2941                 enabled:
2942                   type: boolean
2943             webtorrent:
2944               type: object
2945               properties:
2946                 enabled:
2947                   type: boolean
2948             enabledResolutions:
2949               type: array
2950               items:
2951                 type: number
2952         import:
2953           type: object
2954           properties:
2955             videos:
2956               type: object
2957               properties:
2958                 http:
2959                   type: object
2960                   properties:
2961                     enabled:
2962                       type: boolean
2963                 torrent:
2964                   type: object
2965                   properties:
2966                     enabled:
2967                       type: boolean
2968         autoBlacklist:
2969           type: object
2970           properties:
2971             videos:
2972               type: object
2973               properties:
2974                 ofUsers:
2975                   type: object
2976                   properties:
2977                     enabled:
2978                       type: boolean
2979         avatar:
2980           type: object
2981           properties:
2982             file:
2983               type: object
2984               properties:
2985                 size:
2986                   type: object
2987                   properties:
2988                     max:
2989                       type: number
2990             extensions:
2991               type: array
2992               items:
2993                 type: string
2994         video:
2995           type: object
2996           properties:
2997             image:
2998               type: object
2999               properties:
3000                 extensions:
3001                   type: array
3002                   items:
3003                     type: string
3004                 size:
3005                   type: object
3006                   properties:
3007                     max:
3008                       type: number
3009             file:
3010               type: object
3011               properties:
3012                 extensions:
3013                   type: array
3014                   items:
3015                     type: string
3016         videoCaption:
3017           type: object
3018           properties:
3019             file:
3020               type: object
3021               properties:
3022                 size:
3023                   type: object
3024                   properties:
3025                     max:
3026                       type: number
3027                 extensions:
3028                   type: array
3029                   items:
3030                     type: string
3031         user:
3032           type: object
3033           properties:
3034             videoQuota:
3035               type: number
3036             videoQuotaDaily:
3037               type: number
3038         trending:
3039           type: object
3040           properties:
3041             videos:
3042               type: object
3043               properties:
3044                 intervalDays:
3045                   type: number
3046         tracker:
3047           type: object
3048           properties:
3049             enabled:
3050               type: boolean
3051         followings:
3052           type: object
3053           properties:
3054             instance:
3055               type: object
3056               properties:
3057                 autoFollowIndex:
3058                   type: object
3059                   properties:
3060                     indexUrl:
3061                       type: string
3062     ServerConfigAbout:
3063       properties:
3064         instance:
3065           type: object
3066           properties:
3067             name:
3068               type: string
3069             shortDescription:
3070               type: string
3071             description:
3072               type: string
3073             terms:
3074               type: string
3075     ServerConfigCustom:
3076       properties:
3077         instance:
3078           type: object
3079           properties:
3080             name:
3081               type: string
3082             shortDescription:
3083               type: string
3084             description:
3085               type: string
3086             terms:
3087               type: string
3088             defaultClientRoute:
3089               type: string
3090             isNSFW:
3091               type: boolean
3092             defaultNSFWPolicy:
3093               type: string
3094             customizations:
3095               type: object
3096               properties:
3097                 javascript:
3098                   type: string
3099                 css:
3100                   type: string
3101         theme:
3102           type: object
3103           properties:
3104             default:
3105               type: string
3106         services:
3107           type: object
3108           properties:
3109             twitter:
3110               type: object
3111               properties:
3112                 username:
3113                   type: string
3114                 whitelisted:
3115                   type: boolean
3116         cache:
3117           type: object
3118           properties:
3119             previews:
3120               type: object
3121               properties:
3122                 size:
3123                   type: number
3124             captions:
3125               type: object
3126               properties:
3127                 size:
3128                   type: number
3129         signup:
3130           type: object
3131           properties:
3132             enabled:
3133               type: boolean
3134             limit:
3135               type: number
3136             requiresEmailVerification:
3137               type: boolean
3138         admin:
3139           type: object
3140           properties:
3141             email:
3142               type: string
3143         contactForm:
3144           type: object
3145           properties:
3146             enabled:
3147               type: boolean
3148         user:
3149           type: object
3150           properties:
3151             videoQuota:
3152               type: number
3153             videoQuotaDaily:
3154               type: number
3155         transcoding:
3156           type: object
3157           properties:
3158             enabled:
3159               type: boolean
3160             allowAdditionalExtensions:
3161               type: boolean
3162             allowAudioFiles:
3163               type: boolean
3164             threads:
3165               type: number
3166             resolutions:
3167               type: object
3168               properties:
3169                 240p:
3170                   type: boolean
3171                 360p:
3172                   type: boolean
3173                 480p:
3174                   type: boolean
3175                 720p:
3176                   type: boolean
3177                 1080p:
3178                   type: boolean
3179                 2160p:
3180                   type: boolean
3181             hls:
3182               type: object
3183               properties:
3184                 enabled:
3185                   type: boolean
3186         import:
3187           type: object
3188           properties:
3189             videos:
3190               type: object
3191               properties:
3192                 http:
3193                   type: object
3194                   properties:
3195                     enabled:
3196                       type: boolean
3197                 torrent:
3198                   type: object
3199                   properties:
3200                     enabled:
3201                       type: boolean
3202         autoBlacklist:
3203           type: object
3204           properties:
3205             videos:
3206               type: object
3207               properties:
3208                 ofUsers:
3209                   type: object
3210                   properties:
3211                     enabled:
3212                       type: boolean
3213         followers:
3214           type: object
3215           properties:
3216             instance:
3217               type: object
3218               properties:
3219                 enabled:
3220                   type: boolean
3221                 manualApproval:
3222                   type: boolean
3223     Follow:
3224       properties:
3225         id:
3226           type: number
3227         follower:
3228           $ref: '#/components/schemas/Actor'
3229         following:
3230           $ref: '#/components/schemas/Actor'
3231         score:
3232           type: number
3233         state:
3234           type: string
3235           enum:
3236             - pending
3237             - accepted
3238         createdAt:
3239           type: string
3240         updatedAt:
3241           type: string
3242     Job:
3243       properties:
3244         id:
3245           type: number
3246         state:
3247           type: string
3248           enum:
3249             - pending
3250             - processing
3251             - error
3252             - success
3253         category:
3254           type: string
3255           enum:
3256             - transcoding
3257             - activitypub-http
3258         handlerName:
3259           type: string
3260         handlerInputData:
3261           type: string
3262         createdAt:
3263           type: string
3264         updatedAt:
3265           type: string
3266     AddUserResponse:
3267       properties:
3268         id:
3269           type: number
3270         uuid:
3271           type: string
3272     VideoUploadResponse:
3273       properties:
3274         video:
3275           type: object
3276           properties:
3277             id:
3278               type: number
3279             uuid:
3280               type: string
3281     CommentThreadResponse:
3282       properties:
3283         total:
3284           type: number
3285         data:
3286           type: array
3287           items:
3288             $ref: '#/components/schemas/VideoComment'
3289     CommentThreadPostResponse:
3290       properties:
3291         comment:
3292           $ref: '#/components/schemas/VideoComment'
3293     VideoListResponse:
3294       properties:
3295         total:
3296           type: number
3297         data:
3298           type: array
3299           items:
3300             $ref: '#/components/schemas/Video'
3301     AddUser:
3302       properties:
3303         username:
3304           type: string
3305           description: 'The user username '
3306         password:
3307           type: string
3308           description: 'The user password. If the smtp server is configured, you can leave empty and an email will be sent '
3309         email:
3310           type: string
3311           description: 'The user email '
3312         videoQuota:
3313           type: string
3314           description: 'The user videoQuota '
3315         videoQuotaDaily:
3316           type: string
3317           description: 'The user daily video quota '
3318         role:
3319           $ref: '#/components/schemas/UserRole'
3320       required:
3321         - username
3322         - password
3323         - email
3324         - videoQuota
3325         - videoQuotaDaily
3326         - role
3327     UpdateUser:
3328       properties:
3329         id:
3330           type: string
3331           description: 'The user id '
3332         email:
3333           type: string
3334           description: 'The updated email of the user '
3335         videoQuota:
3336           type: string
3337           description: 'The updated videoQuota of the user '
3338         videoQuotaDaily:
3339           type: string
3340           description: 'The updated daily video quota of the user '
3341         role:
3342           $ref: '#/components/schemas/UserRole'
3343       required:
3344         - id
3345         - email
3346         - videoQuota
3347         - videoQuotaDaily
3348         - role
3349     UpdateMe:
3350       properties:
3351         password:
3352           type: string
3353           description: 'Your new password '
3354         email:
3355           type: string
3356           description: 'Your new email '
3357         displayNSFW:
3358           type: string
3359           description: 'Your new displayNSFW '
3360         autoPlayVideo:
3361           type: string
3362           description: 'Your new autoPlayVideo '
3363       required:
3364         - password
3365         - email
3366         - displayNSFW
3367         - autoPlayVideo
3368     GetMeVideoRating:
3369       properties:
3370         id:
3371           type: string
3372           description: 'Id of the video '
3373         rating:
3374           type: number
3375           description: 'Rating of the video '
3376       required:
3377         - id
3378         - rating
3379     VideoRating:
3380       properties:
3381         video:
3382           $ref: '#/components/schemas/Video'
3383         rating:
3384           type: number
3385           description: 'Rating of the video'
3386       required:
3387         - video
3388         - rating
3389     RegisterUser:
3390       properties:
3391         username:
3392           type: string
3393           description: 'The username of the user '
3394         password:
3395           type: string
3396           description: 'The password of the user '
3397         email:
3398           type: string
3399           description: 'The email of the user '
3400         displayName:
3401           type: string
3402           description: 'The user display name'
3403         channel:
3404           type: object
3405           properties:
3406             name:
3407               type: string
3408               description: 'The default channel name'
3409             displayName:
3410               type: string
3411               description: 'The default channel display name'
3412
3413       required:
3414         - username
3415         - password
3416         - email
3417     VideoChannelCreate:
3418       properties:
3419         name:
3420           type: string
3421         displayName:
3422           type: string
3423         description:
3424           type: string
3425         support:
3426           type: string
3427       required:
3428         - name
3429         - displayName
3430     VideoChannelUpdate:
3431       properties:
3432         displayName:
3433           type: string
3434         description:
3435           type: string
3436         support:
3437           type: string
3438         bulkVideosSupportUpdate:
3439           type: boolean
3440           description: 'Update all videos support field of this channel'
3441