Bumped to version v2.2.0-rc.1
[oweals/peertube.git] / support / doc / api / openapi.yaml
1 openapi: 3.0.0
2 info:
3   title: PeerTube
4   version: 2.2.0-rc.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/videosSearchSort'
1977         - name: search
1978           in: query
1979           required: true
1980           description: String to search
1981           schema:
1982             type: string
1983       responses:
1984         '200':
1985           description: successful operation
1986           content:
1987             application/json:
1988               schema:
1989                 $ref: '#/components/schemas/VideoListResponse'
1990 servers:
1991   - url: 'https://peertube.cpy.re/api/v1'
1992     description: Live Test Server (live data - stable version)
1993   - url: 'https://peertube2.cpy.re/api/v1'
1994     description: Live Test Server (live data - latest nighlty version)
1995   - url: 'https://peertube3.cpy.re/api/v1'
1996     description: Live Test Server (live data - latest RC version)
1997 components:
1998   parameters:
1999     start:
2000       name: start
2001       in: query
2002       required: false
2003       description: Offset
2004       schema:
2005         type: number
2006     count:
2007       name: count
2008       in: query
2009       required: false
2010       description: "Number of items (max: 100)"
2011       schema:
2012         type: number
2013     sort:
2014       name: sort
2015       in: query
2016       required: false
2017       description: Sort column (-createdAt for example)
2018       schema:
2019         type: string
2020     videosSort:
2021       name: sort
2022       in: query
2023       required: false
2024       description: Sort videos by criteria
2025       schema:
2026         type: string
2027         enum:
2028         - -name
2029         - -duration
2030         - -createdAt
2031         - -publishedAt
2032         - -views
2033         - -likes
2034         - -trending
2035     videosSearchSort:
2036       name: sort
2037       in: query
2038       required: false
2039       description: Sort videos by criteria
2040       schema:
2041         type: string
2042         enum:
2043         - -name
2044         - -duration
2045         - -createdAt
2046         - -publishedAt
2047         - -views
2048         - -likes
2049         - -match
2050     commentsSort:
2051       name: sort
2052       in: query
2053       required: false
2054       description: Sort comments by criteria
2055       schema:
2056         type: string
2057         enum:
2058         - -createdAt
2059         - -totalReplies
2060     blacklistsSort:
2061       name: sort
2062       in: query
2063       required: false
2064       description: Sort blacklists by criteria
2065       schema:
2066         type: string
2067         enum:
2068         - -id
2069         - -name
2070         - -duration
2071         - -views
2072         - -likes
2073         - -dislikes
2074         - -uuid
2075         - -createdAt
2076     usersSort:
2077       name: sort
2078       in: query
2079       required: false
2080       description: Sort users by criteria
2081       schema:
2082         type: string
2083         enum:
2084         - -id
2085         - -username
2086         - -createdAt
2087     abusesSort:
2088       name: sort
2089       in: query
2090       required: false
2091       description: Sort abuses by criteria
2092       schema:
2093         type: string
2094         enum:
2095         - -id
2096         - -createdAt
2097         - -state
2098     name:
2099       name: name
2100       in: path
2101       required: true
2102       description: >-
2103         The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
2104         example)
2105       schema:
2106         type: string
2107     id:
2108       name: id
2109       in: path
2110       required: true
2111       description: The user id
2112       schema:
2113         type: number
2114     idOrUUID:
2115       name: id
2116       in: path
2117       required: true
2118       description: The object id or uuid
2119       schema:
2120         type: string
2121     playlistElementId:
2122       name: playlistElementId
2123       in: path
2124       required: true
2125       description: Playlist element id
2126       schema:
2127         type: number
2128     abuseId:
2129       name: abuseId
2130       in: path
2131       required: true
2132       description: Video abuse id
2133       schema:
2134         type: number
2135     captionLanguage:
2136       name: captionLanguage
2137       in: path
2138       required: true
2139       description: The caption language
2140       schema:
2141         type: string
2142     channelHandle:
2143       name: channelHandle
2144       in: path
2145       required: true
2146       description: "The video channel handle (example: 'my_username@example.com' or 'my_username')"
2147       schema:
2148         type: string
2149     subscriptionHandle:
2150       name: subscriptionHandle
2151       in: path
2152       required: true
2153       description: "The subscription handle (example: 'my_username@example.com' or 'my_username')"
2154       schema:
2155         type: string
2156     threadId:
2157       name: threadId
2158       in: path
2159       required: true
2160       description: The thread id (root comment id)
2161       schema:
2162         type: number
2163     commentId:
2164       name: commentId
2165       in: path
2166       required: true
2167       description: The comment id
2168       schema:
2169         type: number
2170     categoryOneOf:
2171       name: categoryOneOf
2172       in: query
2173       required: false
2174       description: category id of the video (see /videos/categories)
2175       schema:
2176         oneOf:
2177         - type: number
2178         - type: array
2179           items:
2180             type: number
2181       style: form
2182       explode: false
2183     tagsOneOf:
2184       name: tagsOneOf
2185       in: query
2186       required: false
2187       description: tag(s) of the video
2188       schema:
2189         oneOf:
2190         - type: string
2191         - type: array
2192           items:
2193             type: string
2194       style: form
2195       explode: false
2196     tagsAllOf:
2197       name: tagsAllOf
2198       in: query
2199       required: false
2200       description: tag(s) of the video, where all should be present in the video
2201       schema:
2202         oneOf:
2203         - type: string
2204         - type: array
2205           items:
2206             type: string
2207       style: form
2208       explode: false
2209     languageOneOf:
2210       name: languageOneOf
2211       in: query
2212       required: false
2213       description: language id of the video (see /videos/languages). Use _unknown to filter on videos that don't have a video language
2214       schema:
2215         oneOf:
2216         - type: string
2217         - type: array
2218           items:
2219             type: string
2220       style: form
2221       explode: false
2222     licenceOneOf:
2223       name: licenceOneOf
2224       in: query
2225       required: false
2226       description: licence id of the video (see /videos/licences)
2227       schema:
2228         oneOf:
2229         - type: number
2230         - type: array
2231           items:
2232             type: number
2233       style: form
2234       explode: false
2235     skipCount:
2236       name: skipCount
2237       in: query
2238       required: false
2239       description: if you don't need the `total` in the response
2240       schema:
2241         type: string
2242         enum:
2243           - 'true'
2244           - 'false'
2245     nsfw:
2246       name: nsfw
2247       in: query
2248       required: false
2249       description: whether to include nsfw videos, if any
2250       schema:
2251         type: string
2252         enum:
2253         - 'true'
2254         - 'false'
2255     filter:
2256       name: filter
2257       in: query
2258       required: false
2259       description: >
2260         Special filters (local for instance) which might require special rights:
2261          * `local` - only videos local to the instance
2262          * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
2263       schema:
2264         type: string
2265         enum:
2266         - local
2267         - all-local
2268     subscriptionsUris:
2269       name: uris
2270       in: query
2271       required: true
2272       description: list of uris to check if each is part of the user subscriptions
2273       schema:
2274         type: array
2275         items:
2276           type: string
2277   securitySchemes:
2278     OAuth2:
2279       description: >
2280         In the header: *Authorization: Bearer <token\>*
2281
2282
2283         Authenticating via OAuth requires the following steps:
2284
2285
2286         - Have an account with sufficient authorization levels
2287
2288         - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
2289         Bearer Token
2290
2291         - Make Authenticated Requests
2292       type: oauth2
2293       flows:
2294         password:
2295           tokenUrl: 'https://peertube.example.com/api/v1/users/token'
2296           scopes:
2297             admin: Admin scope
2298             moderator: Moderator scope
2299             user: User scope
2300   schemas:
2301     VideoConstantNumber:
2302       properties:
2303         id:
2304           type: number
2305         label:
2306           type: string
2307     VideoConstantString:
2308       properties:
2309         id:
2310           type: string
2311         label:
2312           type: string
2313
2314     VideoPlaylistPrivacySet:
2315       type: integer
2316       enum:
2317         - 1
2318         - 2
2319         - 3
2320       description: 'The video playlist privacy (Public = 1, Unlisted = 2, Private = 3)'
2321     VideoPlaylistPrivacyConstant:
2322       properties:
2323         id:
2324           $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2325         label:
2326           type: string
2327
2328     VideoPlaylistTypeSet:
2329       type: integer
2330       enum:
2331         - 1
2332         - 2
2333       description: 'The video playlist type (Regular = 1, Watch Later = 2)'
2334     VideoPlaylistTypeConstant:
2335       properties:
2336         id:
2337           $ref: '#/components/schemas/VideoPlaylistTypeSet'
2338         label:
2339           type: string
2340
2341     VideoPrivacySet:
2342       type: integer
2343       enum:
2344         - 1
2345         - 2
2346         - 3
2347         - 4
2348       description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3, Internal = 4)'
2349     VideoPrivacyConstant:
2350       properties:
2351         id:
2352           $ref: '#/components/schemas/VideoPrivacySet'
2353         label:
2354           type: string
2355
2356     NSFWPolicy:
2357       type: string
2358       enum:
2359         - display
2360         - blur
2361         - do_not_list
2362
2363     UserRole:
2364       type: number
2365       enum:
2366         - 0
2367         - 1
2368         - 2
2369       description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2370
2371     VideoStateConstant:
2372       properties:
2373         id:
2374           type: integer
2375           enum:
2376             - 1
2377             - 2
2378             - 3
2379           description: 'The video state (Published = 1, to transcode = 2, to import = 3)'
2380         label:
2381           type: string
2382
2383     VideoAbuseStateSet:
2384       type: integer
2385       enum:
2386         - 1
2387         - 2
2388         - 3
2389       description: 'The video playlist privacy (Pending = 1, Rejected = 2, Accepted = 3)'
2390     VideoAbuseStateConstant:
2391       properties:
2392         id:
2393           $ref: '#/components/schemas/VideoAbuseStateSet'
2394         label:
2395           type: string
2396
2397     VideoResolutionConstant:
2398       properties:
2399         id:
2400           type: integer
2401           description: 'Video resolution (240, 360, 720 ...)'
2402         label:
2403           type: string
2404     VideoScheduledUpdate:
2405       properties:
2406         privacy:
2407           $ref: '#/components/schemas/VideoPrivacySet'
2408         updateAt:
2409           type: string
2410           format: date
2411           description: When to update the video
2412       required:
2413         - updateAt
2414     AccountSummary:
2415       properties:
2416         id:
2417           type: number
2418         name:
2419           type: string
2420         displayName:
2421           type: string
2422         url:
2423           type: string
2424         host:
2425           type: string
2426         avatar:
2427           nullable: true
2428           allOf:
2429             - $ref: '#/components/schemas/Avatar'
2430     VideoChannelSummary:
2431       properties:
2432         id:
2433           type: number
2434         name:
2435           type: string
2436         displayName:
2437           type: string
2438         url:
2439           type: string
2440         host:
2441           type: string
2442         avatar:
2443           nullable: true
2444           allOf:
2445             - $ref: '#/components/schemas/Avatar'
2446     PlaylistElement:
2447       properties:
2448         position:
2449           type: number
2450         startTimestamp:
2451           type: number
2452         stopTimestamp:
2453           type: number
2454         video:
2455           nullable: true
2456           allOf:
2457             - $ref: '#/components/schemas/Video'
2458     VideoFile:
2459       properties:
2460         magnetUri:
2461           type: string
2462         resolution:
2463           $ref: '#/components/schemas/VideoResolutionConstant'
2464         size:
2465           type: number
2466           description: 'Video file size in bytes'
2467         torrentUrl:
2468           type: string
2469         torrentDownloadUrl:
2470           type: string
2471         fileUrl:
2472           type: string
2473         fileDownloadUrl:
2474           type: string
2475         fps:
2476           type: number
2477         metadataUrl:
2478           type: string
2479     VideoStreamingPlaylists:
2480       properties:
2481         id:
2482           type: number
2483         type:
2484           type: number
2485           enum:
2486             - 1
2487           description: 'Playlist type (HLS = 1)'
2488         playlistUrl:
2489           type: string
2490         segmentsSha256Url:
2491           type: string
2492         files:
2493           type: array
2494           items:
2495             $ref: '#/components/schemas/VideoFile'
2496         redundancies:
2497           type: array
2498           items:
2499             type: object
2500             properties:
2501               baseUrl:
2502                 type: string
2503     Video:
2504       properties:
2505         id:
2506           type: number
2507         uuid:
2508           type: string
2509         createdAt:
2510           type: string
2511         publishedAt:
2512           type: string
2513         updatedAt:
2514           type: string
2515         originallyPublishedAt:
2516           type: string
2517         category:
2518           $ref: '#/components/schemas/VideoConstantNumber'
2519         licence:
2520           $ref: '#/components/schemas/VideoConstantNumber'
2521         language:
2522           $ref: '#/components/schemas/VideoConstantString'
2523         privacy:
2524           $ref: '#/components/schemas/VideoPrivacyConstant'
2525         description:
2526           type: string
2527         duration:
2528           type: number
2529         isLocal:
2530           type: boolean
2531         name:
2532           type: string
2533         thumbnailPath:
2534           type: string
2535         previewPath:
2536           type: string
2537         embedPath:
2538           type: string
2539         views:
2540           type: number
2541         likes:
2542           type: number
2543         dislikes:
2544           type: number
2545         nsfw:
2546           type: boolean
2547         waitTranscoding:
2548           type: boolean
2549           nullable: true
2550         state:
2551           $ref: '#/components/schemas/VideoStateConstant'
2552         scheduledUpdate:
2553           nullable: true
2554           allOf:
2555             - $ref: '#/components/schemas/VideoScheduledUpdate'
2556         blacklisted:
2557           nullable: true
2558           type: boolean
2559         blacklistedReason:
2560           nullable: true
2561           type: string
2562         account:
2563           $ref: '#/components/schemas/AccountSummary'
2564         channel:
2565           $ref: '#/components/schemas/VideoChannelSummary'
2566         userHistory:
2567           nullable: true
2568           type: object
2569           properties:
2570             currentTime:
2571               type: number
2572     VideoDetails:
2573       allOf:
2574         - $ref: '#/components/schemas/Video'
2575         - type: object
2576           properties:
2577             descriptionPath:
2578               type: string
2579             support:
2580               type: string
2581             channel:
2582               $ref: '#/components/schemas/VideoChannel'
2583             account:
2584               $ref: '#/components/schemas/Account'
2585             tags:
2586               type: array
2587               items:
2588                 type: string
2589             files:
2590               type: array
2591               items:
2592                 $ref: '#/components/schemas/VideoFile'
2593             commentsEnabled:
2594               type: boolean
2595             downloadEnabled:
2596               type: boolean
2597             trackerUrls:
2598               type: array
2599               items:
2600                 type: string
2601             streamingPlaylists:
2602               type: array
2603               items:
2604                 $ref: '#/components/schemas/VideoStreamingPlaylists'
2605     VideoImportStateConstant:
2606       properties:
2607         id:
2608           type: integer
2609           enum:
2610             - 1
2611             - 2
2612             - 3
2613           description: 'The video import state (Pending = 1, Success = 2, Failed = 3)'
2614         label:
2615           type: string
2616     VideoImport:
2617       properties:
2618         id:
2619           type: number
2620         targetUrl:
2621           type: string
2622         magnetUri:
2623           type: string
2624         torrentName:
2625           type: string
2626         state:
2627           type: object
2628           properties:
2629             id:
2630               $ref: '#/components/schemas/VideoImportStateConstant'
2631             label:
2632               type: string
2633         error:
2634           type: string
2635         createdAt:
2636           type: string
2637         updatedAt:
2638           type: string
2639         video:
2640           $ref: '#/components/schemas/Video'
2641     VideoAbuse:
2642       properties:
2643         id:
2644           type: number
2645         reason:
2646           type: string
2647         reporterAccount:
2648           $ref: '#/components/schemas/Account'
2649         state:
2650           $ref: '#/components/schemas/VideoAbuseStateConstant'
2651         moderationComment:
2652           type: string
2653         video:
2654           type: object
2655           properties:
2656             id:
2657               type: number
2658             name:
2659               type: string
2660             uuid:
2661               type: string
2662         createdAt:
2663           type: string
2664     VideoBlacklist:
2665       properties:
2666         id:
2667           type: number
2668         videoId:
2669           type: number
2670         createdAt:
2671           type: string
2672         updatedAt:
2673           type: string
2674         name:
2675           type: string
2676         uuid:
2677           type: string
2678         description:
2679           type: string
2680         duration:
2681           type: number
2682         views:
2683           type: number
2684         likes:
2685           type: number
2686         dislikes:
2687           type: number
2688         nsfw:
2689           type: boolean
2690     VideoChannel:
2691       properties:
2692         displayName:
2693           type: string
2694         description:
2695           type: string
2696         isLocal:
2697           type: boolean
2698         ownerAccount:
2699           type: object
2700           properties:
2701             id:
2702               type: number
2703             uuid:
2704               type: string
2705     VideoPlaylist:
2706       properties:
2707         id:
2708           type: number
2709         createdAt:
2710           type: string
2711         updatedAt:
2712           type: string
2713         description:
2714           type: string
2715         uuid:
2716           type: string
2717         displayName:
2718           type: string
2719         isLocal:
2720           type: boolean
2721         videoLength:
2722           type: number
2723         thumbnailPath:
2724           type: string
2725         privacy:
2726           $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
2727         type:
2728           $ref: '#/components/schemas/VideoPlaylistTypeConstant'
2729         ownerAccount:
2730           $ref: '#/components/schemas/AccountSummary'
2731         videoChannel:
2732           $ref: '#/components/schemas/VideoChannelSummary'
2733     VideoComment:
2734       properties:
2735         id:
2736           type: number
2737         url:
2738           type: string
2739         text:
2740           type: string
2741         threadId:
2742           type: number
2743         inReplyToCommentId:
2744           type: number
2745         videoId:
2746           type: number
2747         createdAt:
2748           type: string
2749         updatedAt:
2750           type: string
2751         totalRepliesFromVideoAuthor:
2752           type: number
2753         totalReplies:
2754           type: number
2755         account:
2756           $ref: '#/components/schemas/Account'
2757     VideoCommentThreadTree:
2758       properties:
2759         comment:
2760           $ref: '#/components/schemas/VideoComment'
2761         children:
2762           type: array
2763           items:
2764             $ref: '#/components/schemas/VideoCommentThreadTree'
2765     VideoCaption:
2766       properties:
2767         language:
2768           $ref: '#/components/schemas/VideoConstantString'
2769         captionPath:
2770           type: string
2771     Avatar:
2772       properties:
2773         path:
2774           type: string
2775         createdAt:
2776           type: string
2777         updatedAt:
2778           type: string
2779     Actor:
2780       properties:
2781         id:
2782           type: number
2783         url:
2784           type: string
2785         name:
2786           type: string
2787         host:
2788           type: string
2789         followingCount:
2790           type: number
2791         followersCount:
2792           type: number
2793         createdAt:
2794           type: string
2795         updatedAt:
2796           type: string
2797         avatar:
2798           $ref: '#/components/schemas/Avatar'
2799     Account:
2800       allOf:
2801         - $ref: '#/components/schemas/Actor'
2802         - properties:
2803             userId:
2804               type: string
2805             displayName:
2806               type: string
2807             description:
2808               type: string
2809     User:
2810       properties:
2811         id:
2812           type: number
2813         username:
2814           type: string
2815         email:
2816           type: string
2817         theme:
2818           type: string
2819           description: 'Theme enabled by this user'
2820         emailVerified:
2821           type: boolean
2822           description: 'Is email verified?'
2823         nsfwPolicy:
2824           $ref: '#/components/schemas/NSFWPolicy'
2825         webtorrentEnabled:
2826           type: boolean
2827         autoPlayVideo:
2828           type: boolean
2829         role:
2830           $ref: '#/components/schemas/UserRole'
2831         roleLabel:
2832           type: string
2833           enum:
2834             - User
2835             - Moderator
2836             - Administrator
2837         videoQuota:
2838           type: number
2839         videoQuotaDaily:
2840           type: number
2841         videosCount:
2842           type: number
2843         videoAbusesCount:
2844           type: number
2845         videoAbusesAcceptedCount:
2846           type: number
2847         videoAbusesCreatedCount:
2848           type: number
2849         videoCommentsCount:
2850           type: number
2851         noInstanceConfigWarningModal:
2852           type: boolean
2853         noWelcomeModal:
2854           type: boolean
2855         blocked:
2856           type: boolean
2857         blockedReason:
2858           type: string
2859         createdAt:
2860           type: string
2861         account:
2862           $ref: '#/components/schemas/Account'
2863         videoChannels:
2864           type: array
2865           items:
2866             $ref: '#/components/schemas/VideoChannel'
2867     UserWatchingVideo:
2868       properties:
2869         currentTime:
2870           type: number
2871     ServerConfig:
2872       properties:
2873         instance:
2874           type: object
2875           properties:
2876             name:
2877               type: string
2878             shortDescription:
2879               type: string
2880             defaultClientRoute:
2881               type: string
2882             isNSFW:
2883               type: boolean
2884             defaultNSFWPolicy:
2885               type: string
2886             customizations:
2887               type: object
2888               properties:
2889                 javascript:
2890                   type: string
2891                 css:
2892                   type: string
2893         search:
2894           type: object
2895           properties:
2896             remoteUri:
2897               type: object
2898               properties:
2899                 users:
2900                   type: boolean
2901                 anonymous:
2902                   type: boolean
2903         plugin:
2904           type: object
2905           properties:
2906             registered:
2907               type: array
2908               items:
2909                 type: string
2910         theme:
2911           type: object
2912           properties:
2913             registered:
2914               type: array
2915               items:
2916                 type: string
2917         email:
2918           type: object
2919           properties:
2920             enabled:
2921               type: boolean
2922         contactForm:
2923           type: object
2924           properties:
2925             enabled:
2926               type: boolean
2927         serverVersion:
2928           type: string
2929         serverCommit:
2930           type: string
2931         signup:
2932           type: object
2933           properties:
2934             allowed:
2935               type: boolean
2936             allowedForCurrentIP:
2937               type: boolean
2938             requiresEmailVerification:
2939               type: boolean
2940         transcoding:
2941           type: object
2942           properties:
2943             hls:
2944               type: object
2945               properties:
2946                 enabled:
2947                   type: boolean
2948             webtorrent:
2949               type: object
2950               properties:
2951                 enabled:
2952                   type: boolean
2953             enabledResolutions:
2954               type: array
2955               items:
2956                 type: number
2957         import:
2958           type: object
2959           properties:
2960             videos:
2961               type: object
2962               properties:
2963                 http:
2964                   type: object
2965                   properties:
2966                     enabled:
2967                       type: boolean
2968                 torrent:
2969                   type: object
2970                   properties:
2971                     enabled:
2972                       type: boolean
2973         autoBlacklist:
2974           type: object
2975           properties:
2976             videos:
2977               type: object
2978               properties:
2979                 ofUsers:
2980                   type: object
2981                   properties:
2982                     enabled:
2983                       type: boolean
2984         avatar:
2985           type: object
2986           properties:
2987             file:
2988               type: object
2989               properties:
2990                 size:
2991                   type: object
2992                   properties:
2993                     max:
2994                       type: number
2995             extensions:
2996               type: array
2997               items:
2998                 type: string
2999         video:
3000           type: object
3001           properties:
3002             image:
3003               type: object
3004               properties:
3005                 extensions:
3006                   type: array
3007                   items:
3008                     type: string
3009                 size:
3010                   type: object
3011                   properties:
3012                     max:
3013                       type: number
3014             file:
3015               type: object
3016               properties:
3017                 extensions:
3018                   type: array
3019                   items:
3020                     type: string
3021         videoCaption:
3022           type: object
3023           properties:
3024             file:
3025               type: object
3026               properties:
3027                 size:
3028                   type: object
3029                   properties:
3030                     max:
3031                       type: number
3032                 extensions:
3033                   type: array
3034                   items:
3035                     type: string
3036         user:
3037           type: object
3038           properties:
3039             videoQuota:
3040               type: number
3041             videoQuotaDaily:
3042               type: number
3043         trending:
3044           type: object
3045           properties:
3046             videos:
3047               type: object
3048               properties:
3049                 intervalDays:
3050                   type: number
3051         tracker:
3052           type: object
3053           properties:
3054             enabled:
3055               type: boolean
3056         followings:
3057           type: object
3058           properties:
3059             instance:
3060               type: object
3061               properties:
3062                 autoFollowIndex:
3063                   type: object
3064                   properties:
3065                     indexUrl:
3066                       type: string
3067     ServerConfigAbout:
3068       properties:
3069         instance:
3070           type: object
3071           properties:
3072             name:
3073               type: string
3074             shortDescription:
3075               type: string
3076             description:
3077               type: string
3078             terms:
3079               type: string
3080     ServerConfigCustom:
3081       properties:
3082         instance:
3083           type: object
3084           properties:
3085             name:
3086               type: string
3087             shortDescription:
3088               type: string
3089             description:
3090               type: string
3091             terms:
3092               type: string
3093             defaultClientRoute:
3094               type: string
3095             isNSFW:
3096               type: boolean
3097             defaultNSFWPolicy:
3098               type: string
3099             customizations:
3100               type: object
3101               properties:
3102                 javascript:
3103                   type: string
3104                 css:
3105                   type: string
3106         theme:
3107           type: object
3108           properties:
3109             default:
3110               type: string
3111         services:
3112           type: object
3113           properties:
3114             twitter:
3115               type: object
3116               properties:
3117                 username:
3118                   type: string
3119                 whitelisted:
3120                   type: boolean
3121         cache:
3122           type: object
3123           properties:
3124             previews:
3125               type: object
3126               properties:
3127                 size:
3128                   type: number
3129             captions:
3130               type: object
3131               properties:
3132                 size:
3133                   type: number
3134         signup:
3135           type: object
3136           properties:
3137             enabled:
3138               type: boolean
3139             limit:
3140               type: number
3141             requiresEmailVerification:
3142               type: boolean
3143         admin:
3144           type: object
3145           properties:
3146             email:
3147               type: string
3148         contactForm:
3149           type: object
3150           properties:
3151             enabled:
3152               type: boolean
3153         user:
3154           type: object
3155           properties:
3156             videoQuota:
3157               type: number
3158             videoQuotaDaily:
3159               type: number
3160         transcoding:
3161           type: object
3162           properties:
3163             enabled:
3164               type: boolean
3165             allowAdditionalExtensions:
3166               type: boolean
3167             allowAudioFiles:
3168               type: boolean
3169             threads:
3170               type: number
3171             resolutions:
3172               type: object
3173               properties:
3174                 240p:
3175                   type: boolean
3176                 360p:
3177                   type: boolean
3178                 480p:
3179                   type: boolean
3180                 720p:
3181                   type: boolean
3182                 1080p:
3183                   type: boolean
3184                 2160p:
3185                   type: boolean
3186             hls:
3187               type: object
3188               properties:
3189                 enabled:
3190                   type: boolean
3191         import:
3192           type: object
3193           properties:
3194             videos:
3195               type: object
3196               properties:
3197                 http:
3198                   type: object
3199                   properties:
3200                     enabled:
3201                       type: boolean
3202                 torrent:
3203                   type: object
3204                   properties:
3205                     enabled:
3206                       type: boolean
3207         autoBlacklist:
3208           type: object
3209           properties:
3210             videos:
3211               type: object
3212               properties:
3213                 ofUsers:
3214                   type: object
3215                   properties:
3216                     enabled:
3217                       type: boolean
3218         followers:
3219           type: object
3220           properties:
3221             instance:
3222               type: object
3223               properties:
3224                 enabled:
3225                   type: boolean
3226                 manualApproval:
3227                   type: boolean
3228     Follow:
3229       properties:
3230         id:
3231           type: number
3232         follower:
3233           $ref: '#/components/schemas/Actor'
3234         following:
3235           $ref: '#/components/schemas/Actor'
3236         score:
3237           type: number
3238         state:
3239           type: string
3240           enum:
3241             - pending
3242             - accepted
3243         createdAt:
3244           type: string
3245         updatedAt:
3246           type: string
3247     Job:
3248       properties:
3249         id:
3250           type: number
3251         state:
3252           type: string
3253           enum:
3254             - pending
3255             - processing
3256             - error
3257             - success
3258         category:
3259           type: string
3260           enum:
3261             - transcoding
3262             - activitypub-http
3263         handlerName:
3264           type: string
3265         handlerInputData:
3266           type: string
3267         createdAt:
3268           type: string
3269         updatedAt:
3270           type: string
3271     AddUserResponse:
3272       properties:
3273         id:
3274           type: number
3275         uuid:
3276           type: string
3277     VideoUploadResponse:
3278       properties:
3279         video:
3280           type: object
3281           properties:
3282             id:
3283               type: number
3284             uuid:
3285               type: string
3286     CommentThreadResponse:
3287       properties:
3288         total:
3289           type: number
3290         data:
3291           type: array
3292           items:
3293             $ref: '#/components/schemas/VideoComment'
3294     CommentThreadPostResponse:
3295       properties:
3296         comment:
3297           $ref: '#/components/schemas/VideoComment'
3298     VideoListResponse:
3299       properties:
3300         total:
3301           type: number
3302         data:
3303           type: array
3304           items:
3305             $ref: '#/components/schemas/Video'
3306     AddUser:
3307       properties:
3308         username:
3309           type: string
3310           description: 'The user username '
3311         password:
3312           type: string
3313           description: 'The user password. If the smtp server is configured, you can leave empty and an email will be sent '
3314         email:
3315           type: string
3316           description: 'The user email '
3317         videoQuota:
3318           type: string
3319           description: 'The user videoQuota '
3320         videoQuotaDaily:
3321           type: string
3322           description: 'The user daily video quota '
3323         role:
3324           $ref: '#/components/schemas/UserRole'
3325       required:
3326         - username
3327         - password
3328         - email
3329         - videoQuota
3330         - videoQuotaDaily
3331         - role
3332     UpdateUser:
3333       properties:
3334         id:
3335           type: string
3336           description: 'The user id '
3337         email:
3338           type: string
3339           description: 'The updated email of the user '
3340         videoQuota:
3341           type: string
3342           description: 'The updated videoQuota of the user '
3343         videoQuotaDaily:
3344           type: string
3345           description: 'The updated daily video quota of the user '
3346         role:
3347           $ref: '#/components/schemas/UserRole'
3348       required:
3349         - id
3350         - email
3351         - videoQuota
3352         - videoQuotaDaily
3353         - role
3354     UpdateMe:
3355       properties:
3356         password:
3357           type: string
3358           description: 'Your new password '
3359         email:
3360           type: string
3361           description: 'Your new email '
3362         displayNSFW:
3363           type: string
3364           description: 'Your new displayNSFW '
3365         autoPlayVideo:
3366           type: string
3367           description: 'Your new autoPlayVideo '
3368       required:
3369         - password
3370         - email
3371         - displayNSFW
3372         - autoPlayVideo
3373     GetMeVideoRating:
3374       properties:
3375         id:
3376           type: string
3377           description: 'Id of the video '
3378         rating:
3379           type: number
3380           description: 'Rating of the video '
3381       required:
3382         - id
3383         - rating
3384     VideoRating:
3385       properties:
3386         video:
3387           $ref: '#/components/schemas/Video'
3388         rating:
3389           type: number
3390           description: 'Rating of the video'
3391       required:
3392         - video
3393         - rating
3394     RegisterUser:
3395       properties:
3396         username:
3397           type: string
3398           description: 'The username of the user '
3399         password:
3400           type: string
3401           description: 'The password of the user '
3402         email:
3403           type: string
3404           description: 'The email of the user '
3405         displayName:
3406           type: string
3407           description: 'The user display name'
3408         channel:
3409           type: object
3410           properties:
3411             name:
3412               type: string
3413               description: 'The default channel name'
3414             displayName:
3415               type: string
3416               description: 'The default channel display name'
3417
3418       required:
3419         - username
3420         - password
3421         - email
3422     VideoChannelCreate:
3423       properties:
3424         name:
3425           type: string
3426         displayName:
3427           type: string
3428         description:
3429           type: string
3430         support:
3431           type: string
3432       required:
3433         - name
3434         - displayName
3435     VideoChannelUpdate:
3436       properties:
3437         displayName:
3438           type: string
3439         description:
3440           type: string
3441         support:
3442           type: string
3443         bulkVideosSupportUpdate:
3444           type: boolean
3445           description: 'Update all videos support field of this channel'
3446