82b8191b2545e7dafbed9e774c09305f7c8b7f4c
[oweals/peertube.git] / support / doc / api / openapi.yaml
1 openapi: 3.0.0
2 info:
3   title: PeerTube
4   version: 2.2.0
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. The spec API is fully compatible with
19     [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
20     which generates a client SDK in the language of your choice - we generate some client SDKs automatically:
21
22     - [Python](https://framagit.org/framasoft/peertube/clients/python)
23     - [Go](https://framagit.org/framasoft/peertube/clients/go)
24     - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin)
25
26     See the [Quick Start guide](https://docs.joinpeertube.org/#/api-rest-getting-started) so you can play with the PeerTube API.
27
28     # Authentication
29
30     When you sign up for an account, you are given the possibility to generate
31     sessions, and authenticate using this session token. One session token can
32     currently be used at a time.
33
34     # Errors
35
36     The API uses standard HTTP status codes to indicate the success or failure
37     of the API call. The body of the response will be JSON in the following
38     format.
39
40     ```
41     {
42       "code": "unauthorized_request", // example inner error code
43       "error": "Token is invalid." // example exposed error message
44     }
45     ```
46 externalDocs:
47   url: https://docs.joinpeertube.org/api-rest-reference.html
48 tags:
49   - name: Accounts
50     description: >
51       Using some features of PeerTube require authentication, for which Accounts
52       provide different levels of permission as well as associated user
53       information. Accounts also encompass remote accounts discovered across the federation.
54   - name: Config
55     description: >
56       Each server exposes public information regarding supported videos and
57       options.
58   - name: Job
59     description: >
60       Jobs are long-running tasks enqueued and processed by the instance
61       itself. No additional worker registration is currently available.
62   - name: Instance Follows
63     description: >
64       Managing servers which the instance interacts with is crucial to the
65       concept of federation in PeerTube and external video indexation. The PeerTube
66       server then deals with inter-server ActivityPub operations and propagates
67       information across its social graph by posting activities to actors' inbox
68       endpoints.
69   - name: Instance Redundancy
70     description: >
71       Redundancy is part of the inter-server solidarity that PeerTube fosters.
72       Manage the list of instances you wish to help by seeding their videos according
73       to the policy of video selection of your choice. Note that you have a similar functionality
74       to mirror individual videos, see `Video Mirroring`.
75   - name: Plugins
76     description: >
77       Managign plugins installed from a local path or from NPM.
78   - name: Video Abuses
79     description: |
80       Video abuses deal with reports of local or remote videos alike.
81   - name: Video
82     description: |
83       Operations dealing with listing, uploading, fetching or modifying videos.
84   - name: Search
85     description: |
86       The search helps to find _videos_ or _channels_ from within the instance and beyond.
87       Videos from other instances federated by the instance (that is, instances
88       followed by the instance) can be found via keywords and other criteria of
89       the advanced search.
90
91       Administrators can also enable the use of a remote search system, indexing
92       videos and channels not could be not federated by the instance.
93   - name: Video Comments
94     description: >
95       Operations dealing with comments to a video. Comments are organized in
96       threads.
97   - name: Video Playlists
98     description: >
99       Operations dealing with playlists of videos. Playlists are bound to users
100       and/or channels.
101   - name: Video Channels
102     description: >
103       Operations dealing with the creation, modification and listing of videos within a channel.
104   - name: Video Blocks
105     description: >
106       Operations dealing with blocking videos (removing them from view and
107       preventing interactions).
108   - name: Video Rates
109     description: >
110       Like/dislike a video.
111   - name: Feeds
112     description: >
113       Server syndication feeds
114 x-tagGroups:
115   - name: Accounts
116     tags:
117       - Accounts
118       - Users
119       - My User
120       - My Subscriptions
121       - My Notifications
122   - name: Videos
123     tags:
124       - Video
125       - Video Captions
126       - Video Channels
127       - Video Comments
128       - Video Rates
129       - Video Playlists
130       - Video Ownership Change
131       - Video Mirroring
132       - Feeds
133   - name: Search
134     tags:
135       - Search
136   - name: Moderation
137     tags:
138       - Video Abuses
139       - Video Blocks
140       - Account Blocks
141       - Server Blocks
142   - name: Instance Configuration
143     tags:
144       - Config
145       - Instance Follows
146       - Instance Redundancy
147       - Plugins
148   - name: Jobs
149     tags:
150       - Job
151 paths:
152   '/accounts/{name}':
153     get:
154       tags:
155         - Accounts
156       summary: Get an account
157       parameters:
158         - $ref: '#/components/parameters/name'
159       responses:
160         '200':
161           description: successful operation
162           content:
163             application/json:
164               schema:
165                 $ref: '#/components/schemas/Account'
166         '404':
167           description: account not found
168   '/accounts/{name}/videos':
169     get:
170       tags:
171         - Accounts
172         - Video
173       summary: 'List videos of an account'
174       parameters:
175         - $ref: '#/components/parameters/name'
176         - $ref: '#/components/parameters/categoryOneOf'
177         - $ref: '#/components/parameters/tagsOneOf'
178         - $ref: '#/components/parameters/tagsAllOf'
179         - $ref: '#/components/parameters/licenceOneOf'
180         - $ref: '#/components/parameters/languageOneOf'
181         - $ref: '#/components/parameters/nsfw'
182         - $ref: '#/components/parameters/filter'
183         - $ref: '#/components/parameters/skipCount'
184         - $ref: '#/components/parameters/start'
185         - $ref: '#/components/parameters/count'
186         - $ref: '#/components/parameters/videosSort'
187       responses:
188         '200':
189           description: successful operation
190           content:
191             application/json:
192               schema:
193                 $ref: '#/components/schemas/VideoListResponse'
194       x-code-samples:
195         - lang: JavaScript
196           source: |
197             fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
198             .then(function(response) {
199               return response.json()
200             }).then(function(data) {
201               console.log(data)
202             })
203         - lang: Shell
204           source: |
205             # pip install httpie
206             http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
207         - lang: Ruby
208           source: |
209             require 'net/http'
210             require 'json'
211
212             uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
213
214             http = Net::HTTP.new(uri.host, uri.port)
215             http.use_ssl = true
216
217             response = http.get(uri.request_uri)
218
219             puts JSON.parse(response.read_body)
220         - lang: Python
221           source: |
222             import requests
223
224             r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
225             json = r.json()
226
227             print(json)
228   /accounts:
229     get:
230       tags:
231         - Accounts
232       summary: List accounts
233       parameters:
234         - $ref: '#/components/parameters/start'
235         - $ref: '#/components/parameters/count'
236         - $ref: '#/components/parameters/sort'
237       responses:
238         '200':
239           description: successful operation
240           content:
241             'application/json':
242               schema:
243                 type: array
244                 items:
245                   $ref: '#/components/schemas/Account'
246   /config:
247     get:
248       tags:
249         - Config
250       summary: Get instance public configuration
251       responses:
252         '200':
253           description: successful operation
254           content:
255             application/json:
256               schema:
257                 $ref: '#/components/schemas/ServerConfig'
258   /config/about:
259     get:
260       summary: Get instance "About" information
261       tags:
262         - Config
263       responses:
264         '200':
265           description: successful operation
266           content:
267             application/json:
268               schema:
269                 $ref: '#/components/schemas/ServerConfigAbout'
270   /config/custom:
271     get:
272       summary: Get instance runtime configuration
273       tags:
274         - Config
275       security:
276         - OAuth2:
277             - admin
278       responses:
279         '200':
280           description: successful operation
281           content:
282             application/json:
283               schema:
284                 $ref: '#/components/schemas/ServerConfigCustom'
285     put:
286       summary: Set instance runtime configuration
287       tags:
288         - Config
289       security:
290         - OAuth2:
291             - admin
292       responses:
293         '200':
294           description: successful operation
295     delete:
296       summary: Delete instance runtime configuration
297       tags:
298         - Config
299       security:
300         - OAuth2:
301             - admin
302       responses:
303         '200':
304           description: successful operation
305   /jobs/{state}:
306     get:
307       summary: List instance jobs
308       security:
309         - OAuth2:
310             - admin
311       tags:
312         - Job
313       parameters:
314         - name: state
315           in: path
316           required: true
317           description: The state of the job
318           schema:
319             type: string
320             enum:
321               - active
322               - completed
323               - failed
324               - waiting
325               - delayed
326         - $ref: '#/components/parameters/start'
327         - $ref: '#/components/parameters/count'
328         - $ref: '#/components/parameters/sort'
329       responses:
330         '200':
331           description: successful operation
332           content:
333             application/json:
334               schema:
335                 type: array
336                 items:
337                   $ref: '#/components/schemas/Job'
338   '/server/following/{host}':
339     delete:
340       security:
341         - OAuth2:
342           - admin
343       tags:
344         - Instance Follows
345       summary: Unfollow a server
346       parameters:
347         - name: host
348           in: path
349           required: true
350           description: 'The host to unfollow '
351           schema:
352             type: string
353       responses:
354         '201':
355           description: successful operation
356   /server/followers:
357     get:
358       tags:
359         - Instance Follows
360       summary: List instance followers
361       parameters:
362         - $ref: '#/components/parameters/start'
363         - $ref: '#/components/parameters/count'
364         - $ref: '#/components/parameters/sort'
365       responses:
366         '200':
367           description: successful operation
368           content:
369             application/json:
370               schema:
371                 type: array
372                 items:
373                   $ref: '#/components/schemas/Follow'
374   /server/following:
375     get:
376       tags:
377         - Instance Follows
378       summary: List instances followed by the server
379       parameters:
380         - name: state
381           in: query
382           schema:
383             type: string
384             enum:
385               - pending
386               - accepted
387         - name: actorType
388           in: query
389           schema:
390             type: string
391             enum:
392               - Person
393               - Application
394               - Group
395               - Service
396               - Organization
397         - $ref: '#/components/parameters/start'
398         - $ref: '#/components/parameters/count'
399         - $ref: '#/components/parameters/sort'
400       responses:
401         '200':
402           description: successful operation
403           content:
404             application/json:
405               schema:
406                 type: array
407                 items:
408                   $ref: '#/components/schemas/Follow'
409     post:
410       security:
411         - OAuth2:
412             - admin
413       tags:
414         - Instance Follows
415       summary: Follow a server
416       responses:
417         '204':
418           description: successful operation
419         '500':
420           description: cannot follow a non-HTTPS server
421       requestBody:
422         content:
423           application/json:
424             schema:
425               type: object
426               properties:
427                 hosts:
428                   type: array
429                   items:
430                     type: string
431                   uniqueItems: true
432   /users:
433     post:
434       summary: Create a user
435       security:
436         - OAuth2:
437             - admin
438       tags:
439         - Users
440       responses:
441         '200':
442           description: successful operation
443           content:
444             application/json:
445               schema:
446                 $ref: '#/components/schemas/AddUserResponse'
447       requestBody:
448         content:
449           application/json:
450             schema:
451               $ref: '#/components/schemas/AddUser'
452         description: User to create
453         required: true
454     get:
455       summary: List users
456       security:
457         - OAuth2: []
458       tags:
459         - Users
460       parameters:
461         - $ref: '#/components/parameters/start'
462         - $ref: '#/components/parameters/count'
463         - $ref: '#/components/parameters/usersSort'
464       responses:
465         '200':
466           description: successful operation
467           content:
468             application/json:
469               schema:
470                 type: array
471                 items:
472                   $ref: '#/components/schemas/User'
473   '/users/{id}':
474     delete:
475       summary: Delete a user
476       security:
477         - OAuth2:
478             - admin
479       tags:
480         - Users
481       parameters:
482         - $ref: '#/components/parameters/id'
483       responses:
484         '204':
485           description: successful operation
486     get:
487       summary: Get a user
488       security:
489         - OAuth2: []
490       tags:
491         - Users
492       parameters:
493         - $ref: '#/components/parameters/id'
494       responses:
495         '200':
496           description: successful operation
497           content:
498             application/json:
499               schema:
500                 $ref: '#/components/schemas/User'
501     put:
502       summary: Update a user
503       security:
504         - OAuth2: []
505       tags:
506         - Users
507       parameters:
508         - $ref: '#/components/parameters/id'
509       responses:
510         '204':
511           description: successful operation
512       requestBody:
513         content:
514           application/json:
515             schema:
516               $ref: '#/components/schemas/UpdateUser'
517         required: true
518   /users/register:
519     post:
520       summary: Register a user
521       tags:
522         - Users
523       responses:
524         '204':
525           description: successful operation
526       requestBody:
527         content:
528           application/json:
529             schema:
530               $ref: '#/components/schemas/RegisterUser'
531         required: true
532   /users/me:
533     get:
534       summary: Get my user information
535       security:
536         - OAuth2:
537           - user
538       tags:
539         - My User
540       responses:
541         '200':
542           description: successful operation
543           content:
544             application/json:
545               schema:
546                 type: array
547                 items:
548                   $ref: '#/components/schemas/User'
549     put:
550       summary: Update my user information
551       security:
552         - OAuth2:
553           - user
554       tags:
555         - My User
556       responses:
557         '204':
558           description: successful operation
559       requestBody:
560         content:
561           application/json:
562             schema:
563               $ref: '#/components/schemas/UpdateMe'
564         required: true
565   /users/me/videos/imports:
566     get:
567       summary: Get video imports of my user
568       security:
569         - OAuth2:
570             - user
571       tags:
572         - Videos
573         - My User
574       parameters:
575         - $ref: '#/components/parameters/start'
576         - $ref: '#/components/parameters/count'
577         - $ref: '#/components/parameters/sort'
578       responses:
579         '200':
580           description: successful operation
581           content:
582             application/json:
583               schema:
584                 $ref: '#/components/schemas/VideoImport'
585   /users/me/video-quota-used:
586     get:
587       summary: Get my user used quota
588       security:
589         - OAuth2:
590           - user
591       tags:
592         - My User
593       responses:
594         '200':
595           description: successful operation
596           content:
597             application/json:
598               schema:
599                 type: number
600   '/users/me/videos/{videoId}/rating':
601     get:
602       summary: Get rate of my user for a video
603       security:
604         - OAuth2: []
605       tags:
606         - My User
607         - Video Rates
608       parameters:
609         - name: videoId
610           in: path
611           required: true
612           description: 'The video id '
613           schema:
614             type: string
615       responses:
616         '200':
617           description: successful operation
618           content:
619             application/json:
620               schema:
621                 $ref: '#/components/schemas/GetMeVideoRating'
622   /users/me/videos:
623     get:
624       summary: Get videos of my user
625       security:
626         - OAuth2:
627           - user
628       tags:
629         - My User
630         - Videos
631       parameters:
632         - $ref: '#/components/parameters/start'
633         - $ref: '#/components/parameters/count'
634         - $ref: '#/components/parameters/sort'
635       responses:
636         '200':
637           description: successful operation
638           content:
639             application/json:
640               schema:
641                 $ref: '#/components/schemas/VideoListResponse'
642   /users/me/subscriptions:
643     get:
644       summary: Get my user subscriptions
645       security:
646         - OAuth2:
647             - user
648       tags:
649         - My Subscriptions
650       parameters:
651         - $ref: '#/components/parameters/start'
652         - $ref: '#/components/parameters/count'
653         - $ref: '#/components/parameters/sort'
654       responses:
655         '200':
656           description: successful operation
657     post:
658       summary: Add subscription to my user
659       security:
660         - OAuth2:
661             - user
662       tags:
663         - My Subscriptions
664       responses:
665         '200':
666           description: successful operation
667   /users/me/subscriptions/exist:
668     get:
669       summary: Get if subscriptions exist for my user
670       security:
671         - OAuth2:
672             - user
673       tags:
674         - My Subscriptions
675       parameters:
676         - $ref: '#/components/parameters/subscriptionsUris'
677       responses:
678         '200':
679           description: successful operation
680           content:
681             application/json:
682               schema:
683                 type: object
684   /users/me/subscriptions/videos:
685     get:
686       summary: List videos of subscriptions of my user
687       security:
688         - OAuth2:
689           - user
690       tags:
691         - My Subscriptions
692         - Videos
693       parameters:
694         - $ref: '#/components/parameters/categoryOneOf'
695         - $ref: '#/components/parameters/tagsOneOf'
696         - $ref: '#/components/parameters/tagsAllOf'
697         - $ref: '#/components/parameters/licenceOneOf'
698         - $ref: '#/components/parameters/languageOneOf'
699         - $ref: '#/components/parameters/nsfw'
700         - $ref: '#/components/parameters/filter'
701         - $ref: '#/components/parameters/skipCount'
702         - $ref: '#/components/parameters/start'
703         - $ref: '#/components/parameters/count'
704         - $ref: '#/components/parameters/videosSort'
705       responses:
706         '200':
707           description: successful operation
708           content:
709             application/json:
710               schema:
711                 $ref: '#/components/schemas/VideoListResponse'
712   '/users/me/subscriptions/{subscriptionHandle}':
713     get:
714       summary: Get subscription of my user
715       security:
716         - OAuth2:
717             - user
718       tags:
719         - My Subscriptions
720       parameters:
721         - $ref: '#/components/parameters/subscriptionHandle'
722       responses:
723         '200':
724           description: successful operation
725           content:
726             application/json:
727               schema:
728                 $ref: '#/components/schemas/VideoChannel'
729     delete:
730       summary: Delete subscription of my user
731       security:
732         - OAuth2:
733             - user
734       tags:
735         - My Subscriptions
736       parameters:
737         - $ref: '#/components/parameters/subscriptionHandle'
738       responses:
739         '200':
740           description: successful operation
741   /users/me/notifications:
742     get:
743       summary: List my notifications
744       security:
745         - OAuth2: []
746       tags:
747         - My Notifications
748       parameters:
749         - name: unread
750           in: query
751           description: only list unread notifications
752           schema:
753             type: boolean
754         - $ref: '#/components/parameters/start'
755         - $ref: '#/components/parameters/count'
756         - $ref: '#/components/parameters/sort'
757       responses:
758         '200':
759           description: successful operation
760           content:
761             application/json:
762               schema:
763                 $ref: '#/components/schemas/NotificationListResponse'
764   /users/me/notifications/read:
765     post:
766       summary: Mark notifications as read by their id
767       security:
768         - OAuth2: []
769       tags:
770         - My Notifications
771       requestBody:
772         content:
773           multipart/form-data:
774             schema:
775               type: object
776               properties:
777                 ids:
778                   type: array
779                   description: ids of the notifications to mark as read
780                   items:
781                     type: integer
782               required:
783                 - ids
784       responses:
785         '204':
786           description: successful operation
787   /users/me/notifications/read-all:
788     post:
789       summary: Mark all my notification as read
790       security:
791         - OAuth2: []
792       tags:
793         - My Notifications
794       responses:
795         '204':
796           description: successful operation
797   /users/me/notification-settings:
798     put:
799       summary: Update my notification settings
800       security:
801         - OAuth2: []
802       tags:
803         - My Notifications
804       requestBody:
805         content:
806           multipart/form-data:
807             schema:
808               type: object
809               properties:
810                 newVideoFromSubscription:
811                   $ref: '#/components/schemas/NotificationSettingValue'
812                 newCommentOnMyVideo:
813                   $ref: '#/components/schemas/NotificationSettingValue'
814                 videoAbuseAsModerator:
815                   $ref: '#/components/schemas/NotificationSettingValue'
816                 videoAutoBlacklistAsModerator:
817                   $ref: '#/components/schemas/NotificationSettingValue'
818                 blacklistOnMyVideo:
819                   $ref: '#/components/schemas/NotificationSettingValue'
820                 myVideoPublished:
821                   $ref: '#/components/schemas/NotificationSettingValue'
822                 myVideoImportFinished:
823                   $ref: '#/components/schemas/NotificationSettingValue'
824                 newFollow:
825                   $ref: '#/components/schemas/NotificationSettingValue'
826                 newUserRegistration:
827                   $ref: '#/components/schemas/NotificationSettingValue'
828                 commentMention:
829                   $ref: '#/components/schemas/NotificationSettingValue'
830                 newInstanceFollower:
831                   $ref: '#/components/schemas/NotificationSettingValue'
832                 autoInstanceFollowing:
833                   $ref: '#/components/schemas/NotificationSettingValue'
834       responses:
835         '204':
836           description: successful operation
837   /users/me/avatar/pick:
838     post:
839       summary: Update my user avatar
840       security:
841         - OAuth2: []
842       tags:
843         - My User
844       responses:
845         '200':
846           description: successful operation
847           content:
848             application/json:
849               schema:
850                 $ref: '#/components/schemas/Avatar'
851       requestBody:
852         content:
853           multipart/form-data:
854             schema:
855               type: object
856               properties:
857                 avatarfile:
858                   description: The file to upload.
859                   type: string
860                   format: binary
861             encoding:
862               avatarfile:
863                 contentType: image/png, image/jpeg
864   /videos/ownership:
865     get:
866       summary: List video ownership changes
867       tags:
868         - Video Ownership Change
869       security:
870         - OAuth2: []
871       responses:
872         '200':
873           description: successful operation
874   '/videos/ownership/{id}/accept':
875     post:
876       summary: Accept ownership change request
877       tags:
878         - Video Ownership Change
879       security:
880         - OAuth2: []
881       parameters:
882         - $ref: '#/components/parameters/idOrUUID'
883       responses:
884         '204':
885           description: successful operation
886         '403':
887           description: cannot terminate an ownership change of another user
888         '404':
889           description: video owneship change not found
890   '/videos/ownership/{id}/refuse':
891     post:
892       summary: Refuse ownership change request
893       tags:
894         - Video Ownership Change
895       security:
896         - OAuth2: []
897       parameters:
898         - $ref: '#/components/parameters/idOrUUID'
899       responses:
900         '204':
901           description: successful operation
902         '403':
903           description: cannot terminate an ownership change of another user
904         '404':
905           description: video owneship change not found
906   '/videos/{id}/give-ownership':
907     post:
908       summary: Request ownership change
909       tags:
910         - Video Ownership Change
911       security:
912         - OAuth2: []
913       parameters:
914         - $ref: '#/components/parameters/idOrUUID'
915       requestBody:
916         required: true
917         content:
918           application/x-www-form-urlencoded:
919             schema:
920               type: object
921               properties:
922                 username:
923                   type: string
924               required:
925                 - username
926       responses:
927         '204':
928           description: successful operation
929         '400':
930           description: changing video ownership to a remote account is not supported yet
931         '404':
932           description: video not found
933   /videos:
934     get:
935       summary: List videos
936       tags:
937         - Video
938       parameters:
939         - $ref: '#/components/parameters/categoryOneOf'
940         - $ref: '#/components/parameters/tagsOneOf'
941         - $ref: '#/components/parameters/tagsAllOf'
942         - $ref: '#/components/parameters/licenceOneOf'
943         - $ref: '#/components/parameters/languageOneOf'
944         - $ref: '#/components/parameters/nsfw'
945         - $ref: '#/components/parameters/filter'
946         - $ref: '#/components/parameters/skipCount'
947         - $ref: '#/components/parameters/start'
948         - $ref: '#/components/parameters/count'
949         - $ref: '#/components/parameters/videosSort'
950       responses:
951         '200':
952           description: successful operation
953           content:
954             application/json:
955               schema:
956                 $ref: '#/components/schemas/VideoListResponse'
957   /videos/categories:
958     get:
959       summary: List available video categories
960       tags:
961         - Video
962       responses:
963         '200':
964           description: successful operation
965           content:
966             application/json:
967               schema:
968                 type: array
969                 items:
970                   type: string
971   /videos/licences:
972     get:
973       summary: List available video licences
974       tags:
975         - Video
976       responses:
977         '200':
978           description: successful operation
979           content:
980             application/json:
981               schema:
982                 type: array
983                 items:
984                   type: string
985   /videos/languages:
986     get:
987       summary: List available video languages
988       tags:
989         - Video
990       responses:
991         '200':
992           description: successful operation
993           content:
994             application/json:
995               schema:
996                 type: array
997                 items:
998                   type: string
999   /videos/privacies:
1000     get:
1001       summary: List available video privacies
1002       tags:
1003         - Video
1004       responses:
1005         '200':
1006           description: successful operation
1007           content:
1008             application/json:
1009               schema:
1010                 type: array
1011                 items:
1012                   type: string
1013   '/videos/{id}':
1014     put:
1015       summary: Update a video
1016       security:
1017         - OAuth2: []
1018       tags:
1019         - Video
1020       parameters:
1021         - $ref: '#/components/parameters/idOrUUID'
1022       responses:
1023         '204':
1024           description: successful operation
1025       requestBody:
1026         content:
1027           multipart/form-data:
1028             schema:
1029               type: object
1030               properties:
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                 category:
1040                   description: Video category
1041                   type: string
1042                 licence:
1043                   description: Video licence
1044                   type: string
1045                 language:
1046                   description: Video language
1047                   type: string
1048                 privacy:
1049                   $ref: '#/components/schemas/VideoPrivacySet'
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             encoding:
1084               thumbnailfile:
1085                 contentType: image/jpeg
1086               previewfile:
1087                 contentType: image/jpeg
1088     get:
1089       summary: Get a video
1090       tags:
1091         - Video
1092       parameters:
1093         - $ref: '#/components/parameters/idOrUUID'
1094       responses:
1095         '200':
1096           description: successful operation
1097           content:
1098             application/json:
1099               schema:
1100                 $ref: '#/components/schemas/VideoDetails'
1101     delete:
1102       summary: Delete a video
1103       security:
1104         - OAuth2: []
1105       tags:
1106         - Video
1107       parameters:
1108         - $ref: '#/components/parameters/idOrUUID'
1109       responses:
1110         '204':
1111           description: successful operation
1112   '/videos/{id}/description':
1113     get:
1114       summary: Get complete video description
1115       tags:
1116         - Video
1117       parameters:
1118         - $ref: '#/components/parameters/idOrUUID'
1119       responses:
1120         '200':
1121           description: successful operation
1122           content:
1123             application/json:
1124               schema:
1125                 type: string
1126   '/videos/{id}/views':
1127     post:
1128       summary: Add a view to a video
1129       tags:
1130         - Video
1131       parameters:
1132         - $ref: '#/components/parameters/idOrUUID'
1133       responses:
1134         '204':
1135           description: successful operation
1136   '/videos/{id}/watching':
1137     put:
1138       summary: Set watching progress of a video
1139       tags:
1140         - Video
1141       security:
1142         - OAuth2: []
1143       parameters:
1144         - $ref: '#/components/parameters/idOrUUID'
1145       requestBody:
1146         content:
1147           application/json:
1148             schema:
1149               $ref: '#/components/schemas/UserWatchingVideo'
1150         required: true
1151       responses:
1152         '204':
1153           description: successful operation
1154   /videos/upload:
1155     post:
1156       summary: Upload a video
1157       security:
1158         - OAuth2: []
1159       tags:
1160         - Video
1161       responses:
1162         '200':
1163           description: successful operation
1164           content:
1165             application/json:
1166               schema:
1167                 $ref: '#/components/schemas/VideoUploadResponse'
1168         '403':
1169           description: 'The user video quota is exceeded with this video.'
1170         '408':
1171           description: 'Upload has timed out'
1172         '422':
1173           description: 'Invalid input file.'
1174       requestBody:
1175         content:
1176           multipart/form-data:
1177             schema:
1178               type: object
1179               properties:
1180                 videofile:
1181                   description: Video file
1182                   type: string
1183                   format: binary
1184                 channelId:
1185                   description: Channel id that will contain this video
1186                   type: integer
1187                 thumbnailfile:
1188                   description: Video thumbnail file
1189                   type: string
1190                   format: binary
1191                 previewfile:
1192                   description: Video preview file
1193                   type: string
1194                   format: binary
1195                 privacy:
1196                   $ref: '#/components/schemas/VideoPrivacySet'
1197                 category:
1198                   description: Video category
1199                   type: string
1200                 licence:
1201                   description: Video licence
1202                   type: string
1203                 language:
1204                   description: Video language
1205                   type: string
1206                 description:
1207                   description: Video description
1208                   type: string
1209                 waitTranscoding:
1210                   description: Whether or not we wait transcoding before publish the video
1211                   type: string
1212                 support:
1213                   description: Text describing how to support the video uploader
1214                   type: string
1215                 nsfw:
1216                   description: Whether or not this video contains sensitive content
1217                   type: string
1218                 name:
1219                   description: Video name
1220                   type: string
1221                 tags:
1222                   description: Video tags (maximum 5 tags each between 2 and 30 characters)
1223                   type: array
1224                   minItems: 1
1225                   maxItems: 5
1226                   uniqueItems: true
1227                   items:
1228                     type: string
1229                     minLength: 2
1230                     maxLength: 30
1231                 commentsEnabled:
1232                   description: Enable or disable comments for this video
1233                   type: string
1234                 originallyPublishedAt:
1235                   description: Date when the content was originally published
1236                   type: string
1237                   format: date-time
1238                 scheduleUpdate:
1239                   $ref: '#/components/schemas/VideoScheduledUpdate'
1240               required:
1241                 - videofile
1242                 - channelId
1243                 - name
1244             encoding:
1245               videofile:
1246                 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
1247               thumbnailfile:
1248                 contentType: image/jpeg
1249               previewfile:
1250                 contentType: image/jpeg
1251       x-code-samples:
1252         - lang: Shell
1253           source: |
1254             ## DEPENDENCIES: httpie, jq
1255             # pip install httpie
1256             USERNAME="<your_username>"
1257             PASSWORD="<your_password>"
1258             FILE_PATH="<your_file_path>"
1259             CHANNEL_ID="<your_channel_id>"
1260             NAME="<video_name>"
1261
1262             API_PATH="https://peertube2.cpy.re/api/v1"
1263             ## AUTH
1264             client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1265             client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1266             token=$(http -b --form POST "$API_PATH/users/token" \
1267               client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
1268               username=$USERNAME \
1269               password=$PASSWORD \
1270               | jq -r ".access_token")
1271             ## VIDEO UPLOAD
1272             http -b --form POST "$API_PATH/videos/upload" \
1273               videofile@$FILE_PATH \
1274               channelId=$CHANNEL_ID \
1275               name=$NAME \
1276               "Authorization:Bearer $token"
1277   /videos/imports:
1278     post:
1279       summary: Import a video
1280       description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
1281       security:
1282         - OAuth2: []
1283       tags:
1284         - Video
1285       requestBody:
1286         content:
1287           multipart/form-data:
1288             schema:
1289               type: object
1290               properties:
1291                 torrentfile:
1292                   description: Torrent File
1293                   type: string
1294                   format: binary
1295                 targetUrl:
1296                   description: HTTP target URL
1297                   type: string
1298                 magnetUri:
1299                   description: Magnet URI
1300                   type: string
1301                 channelId:
1302                   description: Channel id that will contain this video
1303                   type: integer
1304                 thumbnailfile:
1305                   description: Video thumbnail file
1306                   type: string
1307                   format: binary
1308                 previewfile:
1309                   description: Video preview file
1310                   type: string
1311                   format: binary
1312                 privacy:
1313                   $ref: '#/components/schemas/VideoPrivacySet'
1314                 category:
1315                   description: Video category
1316                   type: string
1317                 licence:
1318                   description: Video licence
1319                   type: string
1320                 language:
1321                   description: Video language
1322                   type: string
1323                 description:
1324                   description: Video description
1325                   type: string
1326                 waitTranscoding:
1327                   description: Whether or not we wait transcoding before publish the video
1328                   type: string
1329                 support:
1330                   description: Text describing how to support the video uploader
1331                   type: string
1332                 nsfw:
1333                   description: Whether or not this video contains sensitive content
1334                   type: string
1335                 name:
1336                   description: Video name
1337                   type: string
1338                 tags:
1339                   description: Video tags (maximum 5 tags each between 2 and 30 characters)
1340                   type: array
1341                   minItems: 1
1342                   maxItems: 5
1343                   items:
1344                     type: string
1345                     minLength: 2
1346                     maxLength: 30
1347                 commentsEnabled:
1348                   description: Enable or disable comments for this video
1349                   type: string
1350                 scheduleUpdate:
1351                   $ref: '#/components/schemas/VideoScheduledUpdate'
1352               required:
1353                 - channelId
1354                 - name
1355             encoding:
1356               torrentfile:
1357                 contentType: application/x-bittorrent
1358               thumbnailfile:
1359                 contentType: image/jpeg
1360               previewfile:
1361                 contentType: image/jpeg
1362       responses:
1363         '200':
1364           description: successful operation
1365           content:
1366             application/json:
1367               schema:
1368                 $ref: '#/components/schemas/VideoUploadResponse'
1369         '409':
1370           description: HTTP or Torrent/magnetURI import not enabled
1371         '400':
1372           description: '`magnetUri` or `targetUrl` or a torrent file missing'
1373   /videos/abuse:
1374     get:
1375       summary: List video abuses
1376       security:
1377         - OAuth2:
1378           - admin
1379           - moderator
1380       tags:
1381         - Video Abuses
1382       parameters:
1383         - $ref: '#/components/parameters/start'
1384         - $ref: '#/components/parameters/count'
1385         - $ref: '#/components/parameters/abusesSort'
1386       responses:
1387         '200':
1388           description: successful operation
1389           content:
1390             application/json:
1391               schema:
1392                 type: array
1393                 items:
1394                   $ref: '#/components/schemas/VideoAbuse'
1395   '/videos/{id}/abuse':
1396     post:
1397       summary: Report an abuse
1398       security:
1399         - OAuth2: []
1400       tags:
1401         - Video Abuses
1402         - Videos
1403       parameters:
1404         - $ref: '#/components/parameters/idOrUUID'
1405       requestBody:
1406         required: true
1407         content:
1408           application/json:
1409             schema:
1410               type: object
1411               properties:
1412                 reason:
1413                   description: Reason why the user reports this video
1414                   type: string
1415                 predefinedReasons:
1416                   description: Reason categories that help triage reports
1417                   type: array
1418                   items:
1419                     type: string
1420                     enum:
1421                     - violentOrAbusive
1422                     - hatefulOrAbusive
1423                     - spamOrMisleading
1424                     - privacy
1425                     - rights
1426                     - serverRules
1427                     - thumbnails
1428                     - captions
1429                 startAt:
1430                   type: integer
1431                   description: Timestamp in the video that marks the beginning of the report
1432                 endAt:
1433                   type: integer
1434                   description: Timestamp in the video that marks the ending of the report
1435               required:
1436                 - reason
1437       responses:
1438         '204':
1439           description: successful operation
1440   '/videos/{id}/abuse/{abuseId}':
1441     put:
1442       summary: Update an abuse
1443       security:
1444         - OAuth2:
1445           - admin
1446           - moderator
1447       tags:
1448         - Video Abuses
1449       responses:
1450         '204':
1451           description: successful operation
1452         '404':
1453           description: video abuse not found
1454       parameters:
1455         - $ref: '#/components/parameters/idOrUUID'
1456         - $ref: '#/components/parameters/abuseId'
1457       requestBody:
1458         content:
1459           application/json:
1460             schema:
1461               type: object
1462               properties:
1463                 state:
1464                   $ref: '#/components/schemas/VideoAbuseStateSet'
1465                 moderationComment:
1466                   type: string
1467                   description: 'Update the comment of the video abuse for other admin/moderators'
1468     delete:
1469       summary: Delete an abuse
1470       security:
1471         - OAuth2:
1472             - admin
1473             - moderator
1474       tags:
1475         - Video Abuses
1476       responses:
1477         '204':
1478           description: successful operation
1479         '404':
1480           description: block not found
1481       parameters:
1482         - $ref: '#/components/parameters/idOrUUID'
1483         - $ref: '#/components/parameters/abuseId'
1484
1485   '/videos/{id}/blacklist':
1486     post:
1487       summary: Block a video
1488       security:
1489         - OAuth2:
1490             - admin
1491             - moderator
1492       tags:
1493         - Video Blocks
1494       parameters:
1495         - $ref: '#/components/parameters/idOrUUID'
1496       responses:
1497         '204':
1498           description: successful operation
1499     delete:
1500       summary: Unblock a video by its id
1501       security:
1502         - OAuth2:
1503             - admin
1504             - moderator
1505       tags:
1506         - Video Blocks
1507       parameters:
1508         - $ref: '#/components/parameters/idOrUUID'
1509       responses:
1510         '204':
1511           description: successful operation
1512         '404':
1513           description: block not found
1514   /videos/blacklist:
1515     get:
1516       tags:
1517         - Video Blocks
1518       summary: List video blocks
1519       security:
1520         - OAuth2:
1521             - admin
1522             - moderator
1523       parameters:
1524         - $ref: '#/components/parameters/start'
1525         - $ref: '#/components/parameters/count'
1526         - $ref: '#/components/parameters/blacklistsSort'
1527       responses:
1528         '200':
1529           description: successful operation
1530           content:
1531             application/json:
1532               schema:
1533                 type: array
1534                 items:
1535                   $ref: '#/components/schemas/VideoBlacklist'
1536   /videos/{id}/captions:
1537     get:
1538       summary: List captions of a video
1539       tags:
1540         - Video Captions
1541       parameters:
1542         - $ref: '#/components/parameters/idOrUUID'
1543       responses:
1544         '200':
1545           description: successful operation
1546           content:
1547             application/json:
1548               schema:
1549                 type: object
1550                 properties:
1551                   total:
1552                     type: integer
1553                   data:
1554                     type: array
1555                     items:
1556                       $ref: '#/components/schemas/VideoCaption'
1557   /videos/{id}/captions/{captionLanguage}:
1558     put:
1559       summary: Add or replace a video caption
1560       tags:
1561         - Video Captions
1562       parameters:
1563         - $ref: '#/components/parameters/idOrUUID'
1564         - $ref: '#/components/parameters/captionLanguage'
1565       requestBody:
1566         content:
1567           multipart/form-data:
1568             schema:
1569               type: object
1570               properties:
1571                 captionfile:
1572                   description: The file to upload.
1573                   type: string
1574                   format: binary
1575             encoding:
1576               captionfile:
1577                 contentType: text/vtt, application/x-subrip, text/plain
1578       responses:
1579         '204':
1580           description: successful operation
1581         '404':
1582           description: video or language not found
1583     delete:
1584       summary: Delete a video caption
1585       tags:
1586         - Video Captions
1587       parameters:
1588         - $ref: '#/components/parameters/idOrUUID'
1589         - $ref: '#/components/parameters/captionLanguage'
1590       responses:
1591         '204':
1592           description: successful operation
1593         '404':
1594           description: video or language or caption for that language not found
1595   /video-channels:
1596     get:
1597       summary: List video channels
1598       tags:
1599         - Video Channels
1600       parameters:
1601         - $ref: '#/components/parameters/start'
1602         - $ref: '#/components/parameters/count'
1603         - $ref: '#/components/parameters/sort'
1604       responses:
1605         '200':
1606           description: successful operation
1607           content:
1608             application/json:
1609               schema:
1610                 type: array
1611                 items:
1612                   $ref: '#/components/schemas/VideoChannel'
1613     post:
1614       summary: Create a video channel
1615       security:
1616         - OAuth2: []
1617       tags:
1618         - Video Channels
1619       responses:
1620         '204':
1621           description: successful operation
1622       requestBody:
1623         content:
1624           application/json:
1625             schema:
1626               $ref: '#/components/schemas/VideoChannelCreate'
1627   '/video-channels/{channelHandle}':
1628     get:
1629       summary: Get a video channel
1630       tags:
1631         - Video Channels
1632       parameters:
1633         - $ref: '#/components/parameters/channelHandle'
1634       responses:
1635         '200':
1636           description: successful operation
1637           content:
1638             application/json:
1639               schema:
1640                 $ref: '#/components/schemas/VideoChannel'
1641     put:
1642       summary: Update a video channel
1643       security:
1644         - OAuth2: []
1645       tags:
1646         - Video Channels
1647       parameters:
1648         - $ref: '#/components/parameters/channelHandle'
1649       responses:
1650         '204':
1651           description: successful operation
1652       requestBody:
1653         content:
1654           application/json:
1655             schema:
1656               $ref: '#/components/schemas/VideoChannelUpdate'
1657     delete:
1658       summary: Delete a video channel
1659       security:
1660         - OAuth2: []
1661       tags:
1662         - Video Channels
1663       parameters:
1664         - $ref: '#/components/parameters/channelHandle'
1665       responses:
1666         '204':
1667           description: successful operation
1668   '/video-channels/{channelHandle}/videos':
1669     get:
1670       summary: List videos of a video channel
1671       tags:
1672         - Video
1673         - Video Channels
1674       parameters:
1675         - $ref: '#/components/parameters/channelHandle'
1676         - $ref: '#/components/parameters/categoryOneOf'
1677         - $ref: '#/components/parameters/tagsOneOf'
1678         - $ref: '#/components/parameters/tagsAllOf'
1679         - $ref: '#/components/parameters/licenceOneOf'
1680         - $ref: '#/components/parameters/languageOneOf'
1681         - $ref: '#/components/parameters/nsfw'
1682         - $ref: '#/components/parameters/filter'
1683         - $ref: '#/components/parameters/skipCount'
1684         - $ref: '#/components/parameters/start'
1685         - $ref: '#/components/parameters/count'
1686         - $ref: '#/components/parameters/videosSort'
1687       responses:
1688         '200':
1689           description: successful operation
1690           content:
1691             application/json:
1692               schema:
1693                 $ref: '#/components/schemas/VideoListResponse'
1694
1695   /video-playlists/privacies:
1696     get:
1697       summary: List available playlist privacies
1698       tags:
1699         - Video Playlists
1700       responses:
1701         '200':
1702           description: successful operation
1703           content:
1704             application/json:
1705               schema:
1706                 type: array
1707                 items:
1708                   type: string
1709
1710   /video-playlists:
1711     get:
1712       summary: List video playlists
1713       tags:
1714         - Video Playlists
1715       parameters:
1716         - $ref: '#/components/parameters/start'
1717         - $ref: '#/components/parameters/count'
1718         - $ref: '#/components/parameters/sort'
1719       responses:
1720         '200':
1721           description: successful operation
1722           content:
1723             application/json:
1724               schema:
1725                 type: array
1726                 items:
1727                   $ref: '#/components/schemas/VideoPlaylist'
1728     post:
1729       summary: Create a video playlist
1730       description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
1731       security:
1732         - OAuth2: []
1733       tags:
1734         - Video Playlists
1735       responses:
1736         '200':
1737           description: successful operation
1738           content:
1739             application/json:
1740               schema:
1741                 type: object
1742                 properties:
1743                   videoPlaylist:
1744                     type: object
1745                     properties:
1746                       id:
1747                         type: integer
1748                       uuid:
1749                         type: string
1750       requestBody:
1751         content:
1752           multipart/form-data:
1753             schema:
1754               type: object
1755               properties:
1756                 displayName:
1757                   description: Video playlist display name
1758                   type: string
1759                 thumbnailfile:
1760                   description: Video playlist thumbnail file
1761                   type: string
1762                   format: binary
1763                 privacy:
1764                   $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1765                 description:
1766                   description: Video playlist description
1767                   type: string
1768                 videoChannelId:
1769                   description: Video channel in which the playlist will be published
1770                   type: integer
1771               required:
1772                 - displayName
1773
1774   /video-playlists/{id}:
1775     get:
1776       summary: Get a video playlist
1777       tags:
1778         - Video Playlists
1779       parameters:
1780         - $ref: '#/components/parameters/idOrUUID'
1781       responses:
1782         '200':
1783           description: successful operation
1784           content:
1785             application/json:
1786               schema:
1787                 $ref: '#/components/schemas/VideoPlaylist'
1788     put:
1789       summary: Update a video playlist
1790       description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
1791       security:
1792         - OAuth2: []
1793       tags:
1794         - Video Playlists
1795       responses:
1796         '204':
1797           description: successful operation
1798       parameters:
1799         - $ref: '#/components/parameters/idOrUUID'
1800       requestBody:
1801         content:
1802           multipart/form-data:
1803             schema:
1804               type: object
1805               properties:
1806                 displayName:
1807                   description: Video playlist display name
1808                   type: string
1809                 thumbnailfile:
1810                   description: Video playlist thumbnail file
1811                   type: string
1812                   format: binary
1813                 privacy:
1814                   $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1815                 description:
1816                   description: Video playlist description
1817                   type: string
1818                 videoChannelId:
1819                   description: Video channel in which the playlist will be published
1820                   type: integer
1821     delete:
1822       summary: Delete a video playlist
1823       security:
1824         - OAuth2: []
1825       tags:
1826         - Video Playlists
1827       parameters:
1828         - $ref: '#/components/parameters/idOrUUID'
1829       responses:
1830         '204':
1831           description: successful operation
1832
1833   /video-playlists/{id}/videos:
1834     get:
1835       summary: 'List videos of a playlist'
1836       tags:
1837         - Videos
1838         - Video Playlists
1839       parameters:
1840         - $ref: '#/components/parameters/idOrUUID'
1841       responses:
1842         '200':
1843           description: successful operation
1844           content:
1845             application/json:
1846               schema:
1847                 $ref: '#/components/schemas/VideoListResponse'
1848     post:
1849       summary: 'Add a video in a playlist'
1850       security:
1851         - OAuth2: []
1852       tags:
1853         - Videos
1854         - Video Playlists
1855       parameters:
1856         - $ref: '#/components/parameters/idOrUUID'
1857       responses:
1858         '200':
1859           description: successful operation
1860           content:
1861             application/json:
1862               schema:
1863                 type: object
1864                 properties:
1865                   videoPlaylistElement:
1866                     type: object
1867                     properties:
1868                       id:
1869                         type: integer
1870       requestBody:
1871         content:
1872           application/json:
1873             schema:
1874               type: object
1875               properties:
1876                 videoId:
1877                   type: integer
1878                   description: 'Video to add in the playlist'
1879                 startTimestamp:
1880                   type: integer
1881                   description: 'Start the video at this specific timestamp (in seconds)'
1882                 stopTimestamp:
1883                   type: integer
1884                   description: 'Stop the video at this specific timestamp (in seconds)'
1885               required:
1886                 - videoId
1887
1888   /video-playlists/{id}/videos/reorder:
1889     post:
1890       summary: 'Reorder a playlist'
1891       security:
1892         - OAuth2: []
1893       tags:
1894         - Video Playlists
1895       parameters:
1896         - $ref: '#/components/parameters/idOrUUID'
1897       responses:
1898         '204':
1899           description: successful operation
1900       requestBody:
1901         content:
1902           application/json:
1903             schema:
1904               type: object
1905               properties:
1906                 startPosition:
1907                   type: integer
1908                   description: 'Start position of the element to reorder'
1909                   minimum: 1
1910                 insertAfterPosition:
1911                   type: integer
1912                   description: 'New position for the block to reorder, to add the block before the first element'
1913                   minimum: 0
1914                 reorderLength:
1915                   type: integer
1916                   description: 'How many element from `startPosition` to reorder'
1917                   minimum: 1
1918               required:
1919                 - startPosition
1920                 - insertAfterPosition
1921
1922   /video-playlists/{id}/videos/{playlistElementId}:
1923     put:
1924       summary: 'Update a playlist element'
1925       security:
1926         - OAuth2: []
1927       tags:
1928         - Video Playlists
1929       parameters:
1930         - $ref: '#/components/parameters/idOrUUID'
1931         - $ref: '#/components/parameters/playlistElementId'
1932       responses:
1933         '204':
1934           description: successful operation
1935       requestBody:
1936         content:
1937           application/json:
1938             schema:
1939               type: object
1940               properties:
1941                 startTimestamp:
1942                   type: integer
1943                   description: 'Start the video at this specific timestamp (in seconds)'
1944                 stopTimestamp:
1945                   type: integer
1946                   description: 'Stop the video at this specific timestamp (in seconds)'
1947     delete:
1948       summary: 'Delete an element from a playlist'
1949       security:
1950         - OAuth2: []
1951       tags:
1952         - Video Playlists
1953       parameters:
1954         - $ref: '#/components/parameters/idOrUUID'
1955         - $ref: '#/components/parameters/playlistElementId'
1956       responses:
1957         '204':
1958           description: successful operation
1959
1960   '/users/me/video-playlists/videos-exist':
1961     get:
1962       summary: 'Check video exists in my playlists'
1963       security:
1964         - OAuth2: []
1965       tags:
1966         - Video Playlists
1967       parameters:
1968         - name: videoIds
1969           in: query
1970           required: true
1971           description: The video ids to check
1972           schema:
1973             type: array
1974             items:
1975               type: integer
1976       responses:
1977         '200':
1978           description: successful operation
1979           content:
1980             application/json:
1981               schema:
1982                 type: object
1983                 properties:
1984                   videoId:
1985                     type: array
1986                     items:
1987                       type: object
1988                       properties:
1989                         playlistElementId:
1990                           type: integer
1991                         playlistId:
1992                           type: integer
1993                         startTimestamp:
1994                           type: integer
1995                         stopTimestamp:
1996                           type: integer
1997
1998   '/accounts/{name}/video-channels':
1999     get:
2000       summary: List video channels of an account
2001       tags:
2002         - Video Channels
2003         - Accounts
2004       parameters:
2005         - $ref: '#/components/parameters/name'
2006       responses:
2007         '200':
2008           description: successful operation
2009           content:
2010             application/json:
2011               schema:
2012                 type: array
2013                 items:
2014                   $ref: '#/components/schemas/VideoChannel'
2015   '/accounts/{name}/ratings':
2016     get:
2017       summary: List ratings of an account
2018       security:
2019         - OAuth2: []
2020       tags:
2021         - Accounts
2022       parameters:
2023         - $ref: '#/components/parameters/name'
2024         - $ref: '#/components/parameters/start'
2025         - $ref: '#/components/parameters/count'
2026         - $ref: '#/components/parameters/sort'
2027         - name: rating
2028           in: query
2029           required: false
2030           description: Optionally filter which ratings to retrieve
2031           schema:
2032             type: string
2033             enum:
2034               - like
2035               - dislike
2036       responses:
2037         '200':
2038           description: successful operation
2039           content:
2040             application/json:
2041               schema:
2042                 type: array
2043                 items:
2044                   $ref: '#/components/schemas/VideoRating'
2045   '/videos/{id}/comment-threads':
2046     get:
2047       summary: List threads of a video
2048       tags:
2049         - Video Comments
2050       parameters:
2051         - $ref: '#/components/parameters/idOrUUID'
2052         - $ref: '#/components/parameters/start'
2053         - $ref: '#/components/parameters/count'
2054         - $ref: '#/components/parameters/commentsSort'
2055       responses:
2056         '200':
2057           description: successful operation
2058           content:
2059             application/json:
2060               schema:
2061                 $ref: '#/components/schemas/CommentThreadResponse'
2062     post:
2063       summary: Create a thread
2064       security:
2065         - OAuth2: []
2066       tags:
2067         - Video Comments
2068       parameters:
2069         - $ref: '#/components/parameters/idOrUUID'
2070       responses:
2071         '200':
2072           description: successful operation
2073           content:
2074             application/json:
2075               schema:
2076                 $ref: '#/components/schemas/CommentThreadPostResponse'
2077       requestBody:
2078         content:
2079           application/json:
2080             schema:
2081               type: object
2082               properties:
2083                 text:
2084                   type: string
2085                   description: 'Text comment'
2086               required:
2087                 - text
2088
2089   '/videos/{id}/comment-threads/{threadId}':
2090     get:
2091       summary: Get a thread
2092       tags:
2093         - Video Comments
2094       parameters:
2095         - $ref: '#/components/parameters/idOrUUID'
2096         - $ref: '#/components/parameters/threadId'
2097       responses:
2098         '200':
2099           description: successful operation
2100           content:
2101             application/json:
2102               schema:
2103                 $ref: '#/components/schemas/VideoCommentThreadTree'
2104   '/videos/{id}/comments/{commentId}':
2105     post:
2106       summary: Reply to a thread of a video
2107       security:
2108         - OAuth2: []
2109       tags:
2110         - Video Comments
2111       parameters:
2112         - $ref: '#/components/parameters/idOrUUID'
2113         - $ref: '#/components/parameters/commentId'
2114       responses:
2115         '200':
2116           description: successful operation
2117           content:
2118             application/json:
2119               schema:
2120                 $ref: '#/components/schemas/CommentThreadPostResponse'
2121       requestBody:
2122         content:
2123           application/json:
2124             schema:
2125               type: object
2126               properties:
2127                 text:
2128                   type: string
2129                   description: 'Text comment'
2130               required:
2131                 - text
2132
2133     delete:
2134       summary: Delete a comment or a reply
2135       security:
2136         - OAuth2: []
2137       tags:
2138         - Video Comments
2139       parameters:
2140         - $ref: '#/components/parameters/idOrUUID'
2141         - $ref: '#/components/parameters/commentId'
2142       responses:
2143         '204':
2144           description: successful operation
2145   '/videos/{id}/rate':
2146     put:
2147       summary: Like/dislike a video
2148       security:
2149         - OAuth2: []
2150       tags:
2151         - Video Rates
2152       parameters:
2153         - $ref: '#/components/parameters/idOrUUID'
2154       responses:
2155         '204':
2156           description: successful operation
2157   /search/videos:
2158     get:
2159       tags:
2160         - Search
2161       summary: Search videos
2162       parameters:
2163         - $ref: '#/components/parameters/categoryOneOf'
2164         - $ref: '#/components/parameters/tagsOneOf'
2165         - $ref: '#/components/parameters/tagsAllOf'
2166         - $ref: '#/components/parameters/licenceOneOf'
2167         - $ref: '#/components/parameters/languageOneOf'
2168         - $ref: '#/components/parameters/nsfw'
2169         - $ref: '#/components/parameters/filter'
2170         - $ref: '#/components/parameters/skipCount'
2171         - $ref: '#/components/parameters/start'
2172         - $ref: '#/components/parameters/count'
2173         - $ref: '#/components/parameters/searchTarget'
2174         - $ref: '#/components/parameters/videosSearchSort'
2175         - name: search
2176           in: query
2177           required: true
2178           description: >
2179             String to search. If the user can make a remote URI search, and the string is an URI then the
2180             PeerTube instance will fetch the remote object and add it to its database. Then,
2181             you can use the REST API to fetch the complete video information and interact with it.
2182           schema:
2183             type: string
2184         - name: startDate
2185           in: query
2186           required: true
2187           description: Get videos that are published after this date
2188           schema:
2189             type: string
2190             format: date-time
2191         - name: endDate
2192           in: query
2193           required: true
2194           description: Get videos that are published before this date
2195           schema:
2196             type: string
2197             format: date-time
2198         - name: originallyPublishedStartDate
2199           in: query
2200           required: true
2201           description: Get videos that are originally published after this date
2202           schema:
2203             type: string
2204             format: date-time
2205         - name: originallyPublishedEndDate
2206           in: query
2207           required: true
2208           description: Get videos that are originally published before this date
2209           schema:
2210             type: string
2211             format: date-time
2212         - name: durationMin
2213           in: query
2214           required: true
2215           description: Get videos that have this minimum duration
2216           schema:
2217             type: integer
2218         - name: durationMax
2219           in: query
2220           required: true
2221           description: Get videos that have this maximum duration
2222           schema:
2223             type: integer
2224       responses:
2225         '200':
2226           description: successful operation
2227           content:
2228             application/json:
2229               schema:
2230                 $ref: '#/components/schemas/VideoListResponse'
2231   /search/video-channels:
2232     get:
2233       tags:
2234         - Search
2235       summary: Search channels
2236       parameters:
2237         - $ref: '#/components/parameters/start'
2238         - $ref: '#/components/parameters/count'
2239         - $ref: '#/components/parameters/searchTarget'
2240         - $ref: '#/components/parameters/sort'
2241         - name: search
2242           in: query
2243           required: true
2244           description: >
2245             String to search. If the user can make a remote URI search, and the string is an URI then the
2246             PeerTube instance will fetch the remote object and add it to its database. Then,
2247             you can use the REST API to fetch the complete channel information and interact with it.
2248           schema:
2249             type: string
2250       responses:
2251         '200':
2252           description: successful operation
2253           content:
2254             application/json:
2255               schema:
2256                 type: array
2257                 items:
2258                   $ref: '#/components/schemas/VideoChannel'
2259   /blocklist/accounts:
2260     get:
2261       tags:
2262         - Account Blocks
2263       summary: List account blocks
2264       security:
2265         - OAuth2:
2266           - admin
2267       parameters:
2268         - $ref: '#/components/parameters/start'
2269         - $ref: '#/components/parameters/count'
2270         - $ref: '#/components/parameters/sort'
2271       responses:
2272         '200':
2273           description: successful operation
2274     post:
2275       tags:
2276         - Account Blocks
2277       summary: Block an account
2278       security:
2279         - OAuth2:
2280           - admin
2281       requestBody:
2282         content:
2283           application/json:
2284             schema:
2285               type: object
2286               properties:
2287                 accountName:
2288                   type: string
2289                   description: account to block, in the form `username@domain`
2290               required:
2291                 - accountName
2292       responses:
2293         '200':
2294           description: successful operation
2295         '409':
2296           description: self-blocking forbidden
2297   '/blocklist/accounts/{accountName}':
2298     delete:
2299       tags:
2300         - Account Blocks
2301       summary: Unblock an account by its handle
2302       security:
2303         - OAuth2:
2304           - admin
2305       parameters:
2306         - name: accountName
2307           in: path
2308           required: true
2309           description: account to unblock, in the form `username@domain`
2310           schema:
2311             type: string
2312       responses:
2313         '201':
2314           description: successful operation
2315         '404':
2316           description: account or account block does not exist
2317   /blocklist/servers:
2318     get:
2319       tags:
2320         - Server Blocks
2321       summary: List server blocks
2322       security:
2323         - OAuth2:
2324           - admin
2325       parameters:
2326         - $ref: '#/components/parameters/start'
2327         - $ref: '#/components/parameters/count'
2328         - $ref: '#/components/parameters/sort'
2329       responses:
2330         '200':
2331           description: successful operation
2332     post:
2333       tags:
2334         - Server Blocks
2335       summary: Block a server
2336       security:
2337         - OAuth2:
2338           - admin
2339       requestBody:
2340         content:
2341           application/json:
2342             schema:
2343               type: object
2344               properties:
2345                 accountName:
2346                   type: string
2347                   description: server domain to block
2348               required:
2349                 - accountName
2350       responses:
2351         '200':
2352           description: successful operation
2353         '409':
2354           description: self-blocking forbidden
2355   '/blocklist/servers/{host}':
2356     delete:
2357       tags:
2358         - Server Blocks
2359       summary: Unblock a server by its domain
2360       security:
2361         - OAuth2:
2362           - admin
2363       parameters:
2364         - name: host
2365           in: path
2366           required: true
2367           description: server domain to unblock
2368           schema:
2369             type: string
2370       responses:
2371         '201':
2372           description: successful operation
2373         '404':
2374           description: account block does not exist
2375   /redundancy/{host}:
2376     put:
2377       tags:
2378         - Instance Redundancy
2379       summary: Update a server redundancy policy
2380       security:
2381         - OAuth2:
2382           - admin
2383       parameters:
2384         - name: host
2385           in: path
2386           required: true
2387           description: server domain to mirror
2388           schema:
2389             type: string
2390       requestBody:
2391         content:
2392           application/json:
2393             schema:
2394               type: object
2395               properties:
2396                 redundancyAllowed:
2397                   type: boolean
2398                   description: allow mirroring of the host's local videos
2399               required:
2400                 - redundancyAllowed
2401       responses:
2402         '204':
2403           description: successful operation
2404         '404':
2405           description: server is not already known
2406   /redundancy/videos:
2407     get:
2408       tags:
2409         - Video Mirroring
2410       summary: List videos being mirrored
2411       security:
2412         - OAuth2:
2413           - admin
2414       parameters:
2415         - name: target
2416           in: query
2417           required: true
2418           description: direction of the mirror
2419           schema:
2420             type: string
2421             enum:
2422               - my-videos
2423               - remote-videos
2424         - $ref: '#/components/parameters/start'
2425         - $ref: '#/components/parameters/count'
2426         - $ref: '#/components/parameters/videoRedundanciesSort'
2427       responses:
2428         '200':
2429           description: successful operation
2430           content:
2431             application/json:
2432               schema:
2433                 type: array
2434                 items:
2435                   $ref: '#/components/schemas/VideoRedundancy'
2436     post:
2437       tags:
2438         - Video Mirroring
2439       summary: Mirror a video
2440       security:
2441         - OAuth2:
2442           - admin
2443       requestBody:
2444         content:
2445           application/json:
2446             schema:
2447               type: object
2448               properties:
2449                 videoId:
2450                   type: string
2451               required:
2452                 - videoId
2453       responses:
2454         '204':
2455           description: successful operation
2456         '400':
2457           description: cannot mirror a local video
2458         '404':
2459           description: video does not exist
2460         '409':
2461           description: video is already mirrored
2462   /redundancy/videos/{redundancyId}:
2463     delete:
2464       tags:
2465         - Video Mirroring
2466       summary: Delete a mirror done on a video
2467       security:
2468         - OAuth2:
2469           - admin
2470       parameters:
2471         - name: redundancyId
2472           in: path
2473           required: true
2474           description: id of an existing redundancy on a video
2475           schema:
2476             type: string
2477       responses:
2478         '204':
2479           description: successful operation
2480         '404':
2481           description: video redundancy not found
2482   '/feeds/video-comments.{format}':
2483     get:
2484       tags:
2485         - Feeds
2486       summary: List comments on videos
2487       servers:
2488         - url: 'https://peertube2.cpy.re'
2489           description: Live Test Server (live data - latest nightly version)
2490         - url: 'https://peertube3.cpy.re'
2491           description: Live Test Server (live data - latest RC version)
2492         - url: 'https://peertube.cpy.re'
2493           description: Live Test Server (live data - stable version)
2494       parameters:
2495         - name: format
2496           in: path
2497           required: true
2498           description: 'format expected (we focus on making `rss` the most featureful ; it serves Media RSS)'
2499           schema:
2500             type: string
2501             enum:
2502               - xml
2503               - rss
2504               - rss2
2505               - atom
2506               - atom1
2507               - json
2508               - json1
2509         - name: videoId
2510           in: query
2511           description: 'limit listing to a specific video'
2512           schema:
2513             type: string
2514       responses:
2515         '204':
2516           description: successful operation
2517           headers:
2518             Cache-Control:
2519               schema:
2520                 type: string
2521                 default: 'max-age=900' # 15 min cache
2522           content:
2523             application/xml:
2524               schema:
2525                 $ref: '#/components/schemas/VideoCommentsForXML'
2526             application/rss+xml:
2527               schema:
2528                 $ref: '#/components/schemas/VideoCommentsForXML'
2529             text/xml:
2530               schema:
2531                 $ref: '#/components/schemas/VideoCommentsForXML'
2532             application/atom+xml:
2533               schema:
2534                 $ref: '#/components/schemas/VideoCommentsForXML'
2535             application/json:
2536               schema:
2537                 type: object
2538         '406':
2539           description: accept header unsupported
2540   '/feeds/videos.{format}':
2541     get:
2542       tags:
2543         - Feeds
2544       summary: List videos
2545       servers:
2546         - url: 'https://peertube2.cpy.re'
2547           description: Live Test Server (live data - latest nightly version)
2548         - url: 'https://peertube3.cpy.re'
2549           description: Live Test Server (live data - latest RC version)
2550         - url: 'https://peertube.cpy.re'
2551           description: Live Test Server (live data - stable version)
2552       parameters:
2553         - name: format
2554           in: path
2555           required: true
2556           description: 'format expected (we focus on making `rss` the most featureful ; it serves Media RSS)'
2557           schema:
2558             type: string
2559             enum:
2560               - xml
2561               - rss
2562               - rss2
2563               - atom
2564               - atom1
2565               - json
2566               - json1
2567         - name: accountId
2568           in: query
2569           description: 'limit listing to a specific account'
2570           schema:
2571             type: string
2572         - name: accountName
2573           in: query
2574           description: 'limit listing to a specific account'
2575           schema:
2576             type: string
2577         - name: videoChannelId
2578           in: query
2579           description: 'limit listing to a specific video channel'
2580           schema:
2581             type: string
2582         - name: videoChannelName
2583           in: query
2584           description: 'limit listing to a specific video channel'
2585           schema:
2586             type: string
2587       responses:
2588         '204':
2589           description: successful operation
2590           headers:
2591             Cache-Control:
2592               schema:
2593                 type: string
2594                 default: 'max-age=900' # 15 min cache
2595           content:
2596             application/xml:
2597               schema:
2598                 $ref: '#/components/schemas/VideosForXML'
2599             application/rss+xml:
2600               schema:
2601                 $ref: '#/components/schemas/VideosForXML'
2602             text/xml:
2603               schema:
2604                 $ref: '#/components/schemas/VideosForXML'
2605             application/atom+xml:
2606               schema:
2607                 $ref: '#/components/schemas/VideosForXML'
2608             application/json:
2609               schema:
2610                 type: object
2611         '406':
2612           description: accept header unsupported
2613   /plugins:
2614     get:
2615       tags:
2616         - Plugins
2617       summary: List plugins
2618       security:
2619         - OAuth2:
2620           - admin
2621       parameters:
2622         - name: pluginType
2623           in: query
2624           schema:
2625             type: integer
2626         - name: uninstalled
2627           in: query
2628           schema:
2629             type: boolean
2630         - $ref: '#/components/parameters/start'
2631         - $ref: '#/components/parameters/count'
2632         - $ref: '#/components/parameters/sort'
2633       responses:
2634         '200':
2635           description: successful operation
2636           content:
2637             application/json:
2638               schema:
2639                 $ref: '#/components/schemas/PluginResponse'
2640   /plugins/available:
2641     get:
2642       tags:
2643         - Plugins
2644       summary: List available plugins
2645       security:
2646         - OAuth2:
2647           - admin
2648       parameters:
2649         - name: search
2650           in: query
2651           schema:
2652             type: string
2653         - name: pluginType
2654           in: query
2655           schema:
2656             type: integer
2657         - name: currentPeerTubeEngine
2658           in: query
2659           schema:
2660             type: string
2661         - $ref: '#/components/parameters/start'
2662         - $ref: '#/components/parameters/count'
2663         - $ref: '#/components/parameters/sort'
2664       responses:
2665         '200':
2666           description: successful operation
2667           content:
2668             application/json:
2669               schema:
2670                 $ref: '#/components/schemas/PluginResponse'
2671         '503':
2672           description: plugin index unavailable
2673   /plugins/install:
2674     post:
2675       tags:
2676         - Plugins
2677       summary: Install a plugin
2678       security:
2679         - OAuth2:
2680           - admin
2681       requestBody:
2682         content:
2683           application/json:
2684             schema:
2685               oneOf:
2686                 - type: object
2687                   properties:
2688                     npmName:
2689                       type: string
2690                   required:
2691                     - npmName
2692                   additionalProperties: false
2693                 - type: object
2694                   properties:
2695                     path:
2696                       type: string
2697                   required:
2698                     - path
2699                   additionalProperties: false
2700       responses:
2701         '204':
2702           description: successful operation
2703         '400':
2704           description: should have either `npmName` or `path` set
2705   /plugins/update:
2706     post:
2707       tags:
2708         - Plugins
2709       summary: Update a plugin
2710       security:
2711         - OAuth2:
2712           - admin
2713       requestBody:
2714         content:
2715           application/json:
2716             schema:
2717               oneOf:
2718                 - type: object
2719                   properties:
2720                     npmName:
2721                       type: string
2722                   required:
2723                     - npmName
2724                   additionalProperties: false
2725                 - type: object
2726                   properties:
2727                     path:
2728                       type: string
2729                   required:
2730                     - path
2731                   additionalProperties: false
2732       responses:
2733         '204':
2734           description: successful operation
2735         '400':
2736           description: should have either `npmName` or `path` set
2737         '404':
2738           description: existing plugin not found
2739   /plugins/uninstall:
2740     post:
2741       tags:
2742         - Plugins
2743       summary: Uninstall a plugin
2744       security:
2745         - OAuth2:
2746           - admin
2747       requestBody:
2748         content:
2749           application/json:
2750             schema:
2751               type: object
2752               properties:
2753                 npmName:
2754                   type: string
2755               required:
2756                 - npmName
2757       responses:
2758         '204':
2759           description: successful operation
2760         '404':
2761           description: existing plugin not found
2762   /plugins/{npmName}:
2763     get:
2764       tags:
2765         - Plugins
2766       summary: Get a plugin
2767       security:
2768         - OAuth2:
2769           - admin
2770       parameters:
2771         - name: npmName
2772           in: path
2773           required: true
2774           schema:
2775             type: string
2776       responses:
2777         '200':
2778           description: successful operation
2779           content:
2780             application/json:
2781               schema:
2782                 $ref: '#/components/schemas/Plugin'
2783         '404':
2784           description: plugin not found
2785   /plugins/{npmName}/settings:
2786     put:
2787       tags:
2788         - Plugins
2789       summary: Set a plugin's settings
2790       security:
2791         - OAuth2:
2792           - admin
2793       parameters:
2794         - name: npmName
2795           in: path
2796           required: true
2797           schema:
2798             type: string
2799       requestBody:
2800         content:
2801           application/json:
2802             schema:
2803               type: object
2804               properties:
2805                 settings:
2806                   type: object
2807                   additionalProperties: true
2808       responses:
2809         '204':
2810           description: successful operation
2811         '404':
2812           description: plugin not found
2813   /plugins/{npmName}/public-settings:
2814     get:
2815       tags:
2816         - Plugins
2817       summary: Get a plugin's public settings
2818       parameters:
2819         - name: npmName
2820           in: path
2821           required: true
2822           schema:
2823             type: string
2824       responses:
2825         '200':
2826           description: successful operation
2827           content:
2828             application/json:
2829               schema:
2830                 type: object
2831                 additionalProperties: true
2832         '404':
2833           description: plugin not found
2834   /plugins/{npmName}/registered-settings:
2835     get:
2836       tags:
2837         - Plugins
2838       summary: Get a plugin's registered settings
2839       security:
2840         - OAuth2:
2841           - admin
2842       parameters:
2843         - name: npmName
2844           in: path
2845           required: true
2846           schema:
2847             type: string
2848       responses:
2849         '200':
2850           description: successful operation
2851           content:
2852             application/json:
2853               schema:
2854                 type: object
2855                 additionalProperties: true
2856         '404':
2857           description: plugin not found
2858 servers:
2859   - url: 'https://peertube2.cpy.re/api/v1'
2860     description: Live Test Server (live data - latest nightly version)
2861   - url: 'https://peertube3.cpy.re/api/v1'
2862     description: Live Test Server (live data - latest RC version)
2863   - url: 'https://peertube.cpy.re/api/v1'
2864     description: Live Test Server (live data - stable version)
2865 components:
2866   parameters:
2867     start:
2868       name: start
2869       in: query
2870       required: false
2871       description: Offset used to paginate results
2872       schema:
2873         type: integer
2874     count:
2875       name: count
2876       in: query
2877       required: false
2878       description: "Number of items to return"
2879       schema:
2880         type: integer
2881         maximum: 100
2882         minimum: 1
2883     sort:
2884       name: sort
2885       in: query
2886       required: false
2887       description: Sort column (`-createdAt` for example)
2888       schema:
2889         type: string
2890     searchTarget:
2891       name: searchTarget
2892       in: query
2893       required: false
2894       description: >
2895         If the administrator enabled search index support, you can override the default search target.
2896
2897
2898         **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
2899         It means the instance may not know the objects you fetched. If you want to load video/channel information:
2900           * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
2901           then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
2902           After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
2903           * If the current user has not the ability to make a remote URI search, then redirect the user on the origin instance or fetch
2904           the data from the origin instance API
2905       schema:
2906         type: string
2907         enum:
2908           - 'local'
2909           - 'search-index'
2910     videosSort:
2911       name: sort
2912       in: query
2913       required: false
2914       description: Sort videos by criteria
2915       schema:
2916         type: string
2917         enum:
2918         - name
2919         - -duration
2920         - -createdAt
2921         - -publishedAt
2922         - -views
2923         - -likes
2924         - -trending
2925     videosSearchSort:
2926       name: sort
2927       in: query
2928       required: false
2929       description: Sort videos by criteria
2930       schema:
2931         type: string
2932         enum:
2933         - name
2934         - -duration
2935         - -createdAt
2936         - -publishedAt
2937         - -views
2938         - -likes
2939         - -match
2940     commentsSort:
2941       name: sort
2942       in: query
2943       required: false
2944       description: Sort comments by criteria
2945       schema:
2946         type: string
2947         enum:
2948         - -createdAt
2949         - -totalReplies
2950     blacklistsSort:
2951       name: sort
2952       in: query
2953       required: false
2954       description: Sort blacklists by criteria
2955       schema:
2956         type: string
2957         enum:
2958         - -id
2959         - name
2960         - -duration
2961         - -views
2962         - -likes
2963         - -dislikes
2964         - -uuid
2965         - -createdAt
2966     usersSort:
2967       name: sort
2968       in: query
2969       required: false
2970       description: Sort users by criteria
2971       schema:
2972         type: string
2973         enum:
2974         - -id
2975         - -username
2976         - -createdAt
2977     abusesSort:
2978       name: sort
2979       in: query
2980       required: false
2981       description: Sort abuses by criteria
2982       schema:
2983         type: string
2984         enum:
2985         - -id
2986         - -createdAt
2987         - -state
2988     videoRedundanciesSort:
2989       name: sort
2990       in: query
2991       required: false
2992       description: Sort abuses by criteria
2993       schema:
2994         type: string
2995         enum:
2996         - name
2997     name:
2998       name: name
2999       in: path
3000       required: true
3001       description: >-
3002         The name of the account (`chocobozzz` or `chocobozzz@example.org` for
3003         example)
3004       schema:
3005         type: string
3006     id:
3007       name: id
3008       in: path
3009       required: true
3010       description: The user id
3011       schema:
3012         type: integer
3013     idOrUUID:
3014       name: id
3015       in: path
3016       required: true
3017       description: The object id or uuid
3018       schema:
3019         type: string
3020     playlistElementId:
3021       name: playlistElementId
3022       in: path
3023       required: true
3024       description: Playlist element id
3025       schema:
3026         type: integer
3027     abuseId:
3028       name: abuseId
3029       in: path
3030       required: true
3031       description: Video abuse id
3032       schema:
3033         type: integer
3034     captionLanguage:
3035       name: captionLanguage
3036       in: path
3037       required: true
3038       description: The caption language
3039       schema:
3040         type: string
3041     channelHandle:
3042       name: channelHandle
3043       in: path
3044       required: true
3045       description: "The video channel handle (example: 'my_username@example.com' or 'my_username')"
3046       schema:
3047         type: string
3048     subscriptionHandle:
3049       name: subscriptionHandle
3050       in: path
3051       required: true
3052       description: "The subscription handle (example: 'my_username@example.com' or 'my_username')"
3053       schema:
3054         type: string
3055     threadId:
3056       name: threadId
3057       in: path
3058       required: true
3059       description: The thread id (root comment id)
3060       schema:
3061         type: integer
3062     commentId:
3063       name: commentId
3064       in: path
3065       required: true
3066       description: The comment id
3067       schema:
3068         type: integer
3069     categoryOneOf:
3070       name: categoryOneOf
3071       in: query
3072       required: false
3073       description: category id of the video (see /videos/categories)
3074       schema:
3075         oneOf:
3076         - type: integer
3077         - type: array
3078           items:
3079             type: integer
3080       style: form
3081       explode: false
3082     tagsOneOf:
3083       name: tagsOneOf
3084       in: query
3085       required: false
3086       description: tag(s) of the video
3087       schema:
3088         oneOf:
3089         - type: string
3090         - type: array
3091           items:
3092             type: string
3093       style: form
3094       explode: false
3095     tagsAllOf:
3096       name: tagsAllOf
3097       in: query
3098       required: false
3099       description: tag(s) of the video, where all should be present in the video
3100       schema:
3101         oneOf:
3102         - type: string
3103         - type: array
3104           items:
3105             type: string
3106       style: form
3107       explode: false
3108     languageOneOf:
3109       name: languageOneOf
3110       in: query
3111       required: false
3112       description: language id of the video (see /videos/languages). Use `_unknown` to filter on videos that don't have a video language
3113       schema:
3114         oneOf:
3115         - type: string
3116         - type: array
3117           items:
3118             type: string
3119       style: form
3120       explode: false
3121     licenceOneOf:
3122       name: licenceOneOf
3123       in: query
3124       required: false
3125       description: licence id of the video (see /videos/licences)
3126       schema:
3127         oneOf:
3128         - type: integer
3129         - type: array
3130           items:
3131             type: integer
3132       style: form
3133       explode: false
3134     skipCount:
3135       name: skipCount
3136       in: query
3137       required: false
3138       description: if you don't need the `total` in the response
3139       schema:
3140         type: string
3141         enum:
3142           - 'true'
3143           - 'false'
3144         default: 'false'
3145     nsfw:
3146       name: nsfw
3147       in: query
3148       required: false
3149       description: whether to include nsfw videos, if any
3150       schema:
3151         type: string
3152         enum:
3153         - 'true'
3154         - 'false'
3155     filter:
3156       name: filter
3157       in: query
3158       required: false
3159       description: >
3160         Special filters (local for instance) which might require special rights:
3161          * `local` - only videos local to the instance
3162          * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
3163       schema:
3164         type: string
3165         enum:
3166         - local
3167         - all-local
3168     subscriptionsUris:
3169       name: uris
3170       in: query
3171       required: true
3172       description: list of uris to check if each is part of the user subscriptions
3173       schema:
3174         type: array
3175         items:
3176           type: string
3177   securitySchemes:
3178     OAuth2:
3179       description: >
3180         In the header: *Authorization: Bearer <token\>*
3181
3182
3183         Authenticating via OAuth requires the following steps:
3184
3185
3186         - Have an account with sufficient authorization levels
3187
3188         - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
3189         Bearer Token
3190
3191         - Make Authenticated Requests
3192       type: oauth2
3193       flows:
3194         password:
3195           tokenUrl: 'https://peertube.example.com/api/v1/users/token'
3196           scopes:
3197             admin: Admin scope
3198             moderator: Moderator scope
3199             user: User scope
3200   schemas:
3201     VideoConstantNumber:
3202       properties:
3203         id:
3204           type: integer
3205         label:
3206           type: string
3207     VideoConstantString:
3208       properties:
3209         id:
3210           type: string
3211         label:
3212           type: string
3213
3214     VideoPlaylistPrivacySet:
3215       type: integer
3216       enum:
3217         - 1
3218         - 2
3219         - 3
3220       description: 'The video playlist privacy (Public = `1`, Unlisted = `2`, Private = `3`)'
3221     VideoPlaylistPrivacyConstant:
3222       properties:
3223         id:
3224           $ref: '#/components/schemas/VideoPlaylistPrivacySet'
3225         label:
3226           type: string
3227
3228     VideoPlaylistTypeSet:
3229       type: integer
3230       enum:
3231         - 1
3232         - 2
3233       description: 'The video playlist type (Regular = `1`, Watch Later = `2`)'
3234     VideoPlaylistTypeConstant:
3235       properties:
3236         id:
3237           $ref: '#/components/schemas/VideoPlaylistTypeSet'
3238         label:
3239           type: string
3240
3241     VideoPrivacySet:
3242       type: integer
3243       enum:
3244         - 1
3245         - 2
3246         - 3
3247         - 4
3248       description: 'The video privacy (Public = `1`, Unlisted = `2`, Private = `3`, Internal = `4`)'
3249     VideoPrivacyConstant:
3250       properties:
3251         id:
3252           $ref: '#/components/schemas/VideoPrivacySet'
3253         label:
3254           type: string
3255
3256     NSFWPolicy:
3257       type: string
3258       enum:
3259         - display
3260         - blur
3261         - do_not_list
3262
3263     UserRole:
3264       type: integer
3265       enum:
3266         - 0
3267         - 1
3268         - 2
3269       description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
3270
3271     VideoStateConstant:
3272       properties:
3273         id:
3274           type: integer
3275           enum:
3276             - 1
3277             - 2
3278             - 3
3279           description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
3280         label:
3281           type: string
3282
3283     VideoAbuseStateSet:
3284       type: integer
3285       enum:
3286         - 1
3287         - 2
3288         - 3
3289       description: 'The video playlist privacy (Pending = `1`, Rejected = `2`, Accepted = `3`)'
3290     VideoAbuseStateConstant:
3291       properties:
3292         id:
3293           $ref: '#/components/schemas/VideoAbuseStateSet'
3294         label:
3295           type: string
3296     VideoAbusePredefinedReasons:
3297       type: array
3298       items:
3299         type: string
3300         enum:
3301         - violentOrAbusive
3302         - hatefulOrAbusive
3303         - spamOrMisleading
3304         - privacy
3305         - rights
3306         - serverRules
3307         - thumbnails
3308         - captions
3309
3310     VideoResolutionConstant:
3311       properties:
3312         id:
3313           type: integer
3314           description: 'Video resolution (240, 360, 720 ...)'
3315         label:
3316           type: string
3317     VideoScheduledUpdate:
3318       properties:
3319         privacy:
3320           $ref: '#/components/schemas/VideoPrivacySet'
3321         updateAt:
3322           type: string
3323           format: date
3324           description: When to update the video
3325       required:
3326         - updateAt
3327     AccountSummary:
3328       properties:
3329         id:
3330           type: integer
3331         name:
3332           type: string
3333         displayName:
3334           type: string
3335         url:
3336           type: string
3337         host:
3338           type: string
3339         avatar:
3340           nullable: true
3341           allOf:
3342             - $ref: '#/components/schemas/Avatar'
3343     VideoChannelSummary:
3344       properties:
3345         id:
3346           type: integer
3347         name:
3348           type: string
3349         displayName:
3350           type: string
3351         url:
3352           type: string
3353         host:
3354           type: string
3355         avatar:
3356           nullable: true
3357           allOf:
3358             - $ref: '#/components/schemas/Avatar'
3359     PlaylistElement:
3360       properties:
3361         position:
3362           type: integer
3363         startTimestamp:
3364           type: integer
3365         stopTimestamp:
3366           type: integer
3367         video:
3368           nullable: true
3369           allOf:
3370             - $ref: '#/components/schemas/Video'
3371     VideoFile:
3372       properties:
3373         magnetUri:
3374           type: string
3375         resolution:
3376           $ref: '#/components/schemas/VideoResolutionConstant'
3377         size:
3378           type: integer
3379           description: 'Video file size in bytes'
3380         torrentUrl:
3381           type: string
3382         torrentDownloadUrl:
3383           type: string
3384         fileUrl:
3385           type: string
3386         fileDownloadUrl:
3387           type: string
3388         fps:
3389           type: number
3390         metadataUrl:
3391           type: string
3392     VideoStreamingPlaylists:
3393       properties:
3394         id:
3395           type: integer
3396         type:
3397           type: integer
3398           enum:
3399             - 1
3400           description: 'Playlist type (HLS = `1`)'
3401         playlistUrl:
3402           type: string
3403         segmentsSha256Url:
3404           type: string
3405         files:
3406           type: array
3407           items:
3408             $ref: '#/components/schemas/VideoFile'
3409         redundancies:
3410           type: array
3411           items:
3412             type: object
3413             properties:
3414               baseUrl:
3415                 type: string
3416     VideoInfo:
3417       properties:
3418         id:
3419           type: integer
3420         uuid:
3421           type: string
3422         name:
3423           type: string
3424     Video:
3425       properties:
3426         id:
3427           type: integer
3428         uuid:
3429           type: string
3430         createdAt:
3431           type: string
3432         publishedAt:
3433           type: string
3434         updatedAt:
3435           type: string
3436         originallyPublishedAt:
3437           type: string
3438         category:
3439           $ref: '#/components/schemas/VideoConstantNumber'
3440         licence:
3441           $ref: '#/components/schemas/VideoConstantNumber'
3442         language:
3443           $ref: '#/components/schemas/VideoConstantString'
3444         privacy:
3445           $ref: '#/components/schemas/VideoPrivacyConstant'
3446         description:
3447           type: string
3448         duration:
3449           type: integer
3450         isLocal:
3451           type: boolean
3452         name:
3453           type: string
3454         thumbnailPath:
3455           type: string
3456         previewPath:
3457           type: string
3458         embedPath:
3459           type: string
3460         views:
3461           type: integer
3462         likes:
3463           type: integer
3464         dislikes:
3465           type: integer
3466         nsfw:
3467           type: boolean
3468         waitTranscoding:
3469           type: boolean
3470           nullable: true
3471         state:
3472           $ref: '#/components/schemas/VideoStateConstant'
3473         scheduledUpdate:
3474           nullable: true
3475           allOf:
3476             - $ref: '#/components/schemas/VideoScheduledUpdate'
3477         blacklisted:
3478           nullable: true
3479           type: boolean
3480         blacklistedReason:
3481           nullable: true
3482           type: string
3483         account:
3484           $ref: '#/components/schemas/AccountSummary'
3485         channel:
3486           $ref: '#/components/schemas/VideoChannelSummary'
3487         userHistory:
3488           nullable: true
3489           type: object
3490           properties:
3491             currentTime:
3492               type: integer
3493     VideoDetails:
3494       allOf:
3495         - $ref: '#/components/schemas/Video'
3496         - type: object
3497           properties:
3498             descriptionPath:
3499               type: string
3500             support:
3501               type: string
3502             channel:
3503               $ref: '#/components/schemas/VideoChannel'
3504             account:
3505               $ref: '#/components/schemas/Account'
3506             tags:
3507               type: array
3508               items:
3509                 type: string
3510             files:
3511               type: array
3512               items:
3513                 $ref: '#/components/schemas/VideoFile'
3514             commentsEnabled:
3515               type: boolean
3516             downloadEnabled:
3517               type: boolean
3518             trackerUrls:
3519               type: array
3520               items:
3521                 type: string
3522             streamingPlaylists:
3523               type: array
3524               items:
3525                 $ref: '#/components/schemas/VideoStreamingPlaylists'
3526     FileRedundancyInformation:
3527       properties:
3528         id:
3529           type: integer
3530         fileUrl:
3531           type: string
3532         strategy:
3533           type: string
3534         size:
3535           type: integer
3536         createdAt:
3537           type: string
3538           format: date-time
3539         updatedAt:
3540           type: string
3541           format: date-time
3542         expiresOn:
3543           type: string
3544           format: date-time
3545     VideoRedundancy:
3546       properties:
3547         id:
3548           type: integer
3549         name:
3550           type: string
3551         url:
3552           type: string
3553         uuid:
3554           type: string
3555         redundancies:
3556           type: object
3557           properties:
3558             files:
3559               type: array
3560               items:
3561                 $ref: '#/components/schemas/FileRedundancyInformation' 
3562             streamingPlaylists:
3563               type: array
3564               items:
3565                 $ref: '#/components/schemas/FileRedundancyInformation' 
3566     VideoImportStateConstant:
3567       properties:
3568         id:
3569           type: integer
3570           enum:
3571             - 1
3572             - 2
3573             - 3
3574           description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
3575         label:
3576           type: string
3577     VideoImport:
3578       properties:
3579         id:
3580           type: integer
3581         targetUrl:
3582           type: string
3583         magnetUri:
3584           type: string
3585         torrentName:
3586           type: string
3587         state:
3588           type: object
3589           properties:
3590             id:
3591               $ref: '#/components/schemas/VideoImportStateConstant'
3592             label:
3593               type: string
3594         error:
3595           type: string
3596         createdAt:
3597           type: string
3598         updatedAt:
3599           type: string
3600         video:
3601           $ref: '#/components/schemas/Video'
3602     VideoAbuse:
3603       properties:
3604         id:
3605           type: integer
3606         reason:
3607           type: string
3608         predefinedReasons:
3609           $ref: '#/components/schemas/VideoAbusePredefinedReasons'
3610         reporterAccount:
3611           $ref: '#/components/schemas/Account'
3612         state:
3613           $ref: '#/components/schemas/VideoAbuseStateConstant'
3614         moderationComment:
3615           type: string
3616         video:
3617           type: object
3618           properties:
3619             id:
3620               type: integer
3621             name:
3622               type: string
3623             uuid:
3624               type: string
3625         createdAt:
3626           type: string
3627     VideoBlacklist:
3628       properties:
3629         id:
3630           type: integer
3631         videoId:
3632           type: integer
3633         createdAt:
3634           type: string
3635         updatedAt:
3636           type: string
3637         name:
3638           type: string
3639         uuid:
3640           type: string
3641         description:
3642           type: string
3643         duration:
3644           type: integer
3645         views:
3646           type: integer
3647         likes:
3648           type: integer
3649         dislikes:
3650           type: integer
3651         nsfw:
3652           type: boolean
3653     VideoChannel:
3654       properties:
3655         displayName:
3656           type: string
3657         description:
3658           type: string
3659         isLocal:
3660           type: boolean
3661         ownerAccount:
3662           type: object
3663           properties:
3664             id:
3665               type: integer
3666             uuid:
3667               type: string
3668     VideoPlaylist:
3669       properties:
3670         id:
3671           type: integer
3672         createdAt:
3673           type: string
3674         updatedAt:
3675           type: string
3676         description:
3677           type: string
3678         uuid:
3679           type: string
3680         displayName:
3681           type: string
3682         isLocal:
3683           type: boolean
3684         videoLength:
3685           type: integer
3686         thumbnailPath:
3687           type: string
3688         privacy:
3689           $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
3690         type:
3691           $ref: '#/components/schemas/VideoPlaylistTypeConstant'
3692         ownerAccount:
3693           $ref: '#/components/schemas/AccountSummary'
3694         videoChannel:
3695           $ref: '#/components/schemas/VideoChannelSummary'
3696     VideoComment:
3697       properties:
3698         id:
3699           type: integer
3700         url:
3701           type: string
3702         text:
3703           type: string
3704         threadId:
3705           type: integer
3706         inReplyToCommentId:
3707           type: integer
3708         videoId:
3709           type: integer
3710         createdAt:
3711           type: string
3712         updatedAt:
3713           type: string
3714         totalRepliesFromVideoAuthor:
3715           type: integer
3716         totalReplies:
3717           type: integer
3718         account:
3719           $ref: '#/components/schemas/Account'
3720     VideoCommentThreadTree:
3721       properties:
3722         comment:
3723           $ref: '#/components/schemas/VideoComment'
3724         children:
3725           type: array
3726           items:
3727             $ref: '#/components/schemas/VideoCommentThreadTree'
3728     VideoCaption:
3729       properties:
3730         language:
3731           $ref: '#/components/schemas/VideoConstantString'
3732         captionPath:
3733           type: string
3734     Avatar:
3735       properties:
3736         path:
3737           type: string
3738         createdAt:
3739           type: string
3740         updatedAt:
3741           type: string
3742     ActorInfo:
3743       properties:
3744         id:
3745           type: integer
3746         name:
3747           type: string
3748         displayName:
3749           type: string
3750         host:
3751           type: string
3752         avatar:
3753           nullable: true
3754           type: object
3755           properties:
3756             path:
3757               type: string
3758     Actor:
3759       properties:
3760         id:
3761           type: integer
3762         url:
3763           type: string
3764         name:
3765           type: string
3766         host:
3767           type: string
3768         followingCount:
3769           type: integer
3770         followersCount:
3771           type: integer
3772         createdAt:
3773           type: string
3774         updatedAt:
3775           type: string
3776         avatar:
3777           $ref: '#/components/schemas/Avatar'
3778     Account:
3779       allOf:
3780         - $ref: '#/components/schemas/Actor'
3781         - properties:
3782             userId:
3783               type: string
3784             displayName:
3785               type: string
3786             description:
3787               type: string
3788     User:
3789       properties:
3790         id:
3791           type: integer
3792         username:
3793           type: string
3794         email:
3795           type: string
3796         theme:
3797           type: string
3798           description: 'Theme enabled by this user'
3799         emailVerified:
3800           type: boolean
3801           description: 'Has the user confirmed their email address?'
3802         nsfwPolicy:
3803           $ref: '#/components/schemas/NSFWPolicy'
3804         webtorrentEnabled:
3805           type: boolean
3806         autoPlayVideo:
3807           type: boolean
3808           description: 'Automatically start playing the video on the watch page'
3809         role:
3810           $ref: '#/components/schemas/UserRole'
3811         roleLabel:
3812           type: string
3813           enum:
3814             - User
3815             - Moderator
3816             - Administrator
3817         videoQuota:
3818           type: integer
3819         videoQuotaDaily:
3820           type: integer
3821         videosCount:
3822           type: integer
3823         videoAbusesCount:
3824           type: integer
3825         videoAbusesAcceptedCount:
3826           type: integer
3827         videoAbusesCreatedCount:
3828           type: integer
3829         videoCommentsCount:
3830           type: integer
3831         noInstanceConfigWarningModal:
3832           type: boolean
3833         noWelcomeModal:
3834           type: boolean
3835         blocked:
3836           type: boolean
3837         blockedReason:
3838           type: string
3839         createdAt:
3840           type: string
3841         account:
3842           $ref: '#/components/schemas/Account'
3843         videoChannels:
3844           type: array
3845           items:
3846             $ref: '#/components/schemas/VideoChannel'
3847     UserWatchingVideo:
3848       properties:
3849         currentTime:
3850           type: integer
3851     ServerConfig:
3852       properties:
3853         instance:
3854           type: object
3855           properties:
3856             name:
3857               type: string
3858             shortDescription:
3859               type: string
3860             defaultClientRoute:
3861               type: string
3862             isNSFW:
3863               type: boolean
3864             defaultNSFWPolicy:
3865               type: string
3866             customizations:
3867               type: object
3868               properties:
3869                 javascript:
3870                   type: string
3871                 css:
3872                   type: string
3873         search:
3874           type: object
3875           properties:
3876             remoteUri:
3877               type: object
3878               properties:
3879                 users:
3880                   type: boolean
3881                 anonymous:
3882                   type: boolean
3883         plugin:
3884           type: object
3885           properties:
3886             registered:
3887               type: array
3888               items:
3889                 type: string
3890         theme:
3891           type: object
3892           properties:
3893             registered:
3894               type: array
3895               items:
3896                 type: string
3897         email:
3898           type: object
3899           properties:
3900             enabled:
3901               type: boolean
3902         contactForm:
3903           type: object
3904           properties:
3905             enabled:
3906               type: boolean
3907         serverVersion:
3908           type: string
3909         serverCommit:
3910           type: string
3911         signup:
3912           type: object
3913           properties:
3914             allowed:
3915               type: boolean
3916             allowedForCurrentIP:
3917               type: boolean
3918             requiresEmailVerification:
3919               type: boolean
3920         transcoding:
3921           type: object
3922           properties:
3923             hls:
3924               type: object
3925               properties:
3926                 enabled:
3927                   type: boolean
3928             webtorrent:
3929               type: object
3930               properties:
3931                 enabled:
3932                   type: boolean
3933             enabledResolutions:
3934               type: array
3935               items:
3936                 type: integer
3937         import:
3938           type: object
3939           properties:
3940             videos:
3941               type: object
3942               properties:
3943                 http:
3944                   type: object
3945                   properties:
3946                     enabled:
3947                       type: boolean
3948                 torrent:
3949                   type: object
3950                   properties:
3951                     enabled:
3952                       type: boolean
3953         autoBlacklist:
3954           type: object
3955           properties:
3956             videos:
3957               type: object
3958               properties:
3959                 ofUsers:
3960                   type: object
3961                   properties:
3962                     enabled:
3963                       type: boolean
3964         avatar:
3965           type: object
3966           properties:
3967             file:
3968               type: object
3969               properties:
3970                 size:
3971                   type: object
3972                   properties:
3973                     max:
3974                       type: integer
3975             extensions:
3976               type: array
3977               items:
3978                 type: string
3979         video:
3980           type: object
3981           properties:
3982             image:
3983               type: object
3984               properties:
3985                 extensions:
3986                   type: array
3987                   items:
3988                     type: string
3989                 size:
3990                   type: object
3991                   properties:
3992                     max:
3993                       type: integer
3994             file:
3995               type: object
3996               properties:
3997                 extensions:
3998                   type: array
3999                   items:
4000                     type: string
4001         videoCaption:
4002           type: object
4003           properties:
4004             file:
4005               type: object
4006               properties:
4007                 size:
4008                   type: object
4009                   properties:
4010                     max:
4011                       type: integer
4012                 extensions:
4013                   type: array
4014                   items:
4015                     type: string
4016         user:
4017           type: object
4018           properties:
4019             videoQuota:
4020               type: integer
4021             videoQuotaDaily:
4022               type: integer
4023         trending:
4024           type: object
4025           properties:
4026             videos:
4027               type: object
4028               properties:
4029                 intervalDays:
4030                   type: integer
4031         tracker:
4032           type: object
4033           properties:
4034             enabled:
4035               type: boolean
4036         followings:
4037           type: object
4038           properties:
4039             instance:
4040               type: object
4041               properties:
4042                 autoFollowIndex:
4043                   type: object
4044                   properties:
4045                     indexUrl:
4046                       type: string
4047     ServerConfigAbout:
4048       properties:
4049         instance:
4050           type: object
4051           properties:
4052             name:
4053               type: string
4054             shortDescription:
4055               type: string
4056             description:
4057               type: string
4058             terms:
4059               type: string
4060     ServerConfigCustom:
4061       properties:
4062         instance:
4063           type: object
4064           properties:
4065             name:
4066               type: string
4067             shortDescription:
4068               type: string
4069             description:
4070               type: string
4071             terms:
4072               type: string
4073             defaultClientRoute:
4074               type: string
4075             isNSFW:
4076               type: boolean
4077             defaultNSFWPolicy:
4078               type: string
4079             customizations:
4080               type: object
4081               properties:
4082                 javascript:
4083                   type: string
4084                 css:
4085                   type: string
4086         theme:
4087           type: object
4088           properties:
4089             default:
4090               type: string
4091         services:
4092           type: object
4093           properties:
4094             twitter:
4095               type: object
4096               properties:
4097                 username:
4098                   type: string
4099                 whitelisted:
4100                   type: boolean
4101         cache:
4102           type: object
4103           properties:
4104             previews:
4105               type: object
4106               properties:
4107                 size:
4108                   type: integer
4109             captions:
4110               type: object
4111               properties:
4112                 size:
4113                   type: integer
4114         signup:
4115           type: object
4116           properties:
4117             enabled:
4118               type: boolean
4119             limit:
4120               type: integer
4121             requiresEmailVerification:
4122               type: boolean
4123         admin:
4124           type: object
4125           properties:
4126             email:
4127               type: string
4128         contactForm:
4129           type: object
4130           properties:
4131             enabled:
4132               type: boolean
4133         user:
4134           type: object
4135           properties:
4136             videoQuota:
4137               type: integer
4138             videoQuotaDaily:
4139               type: integer
4140         transcoding:
4141           type: object
4142           properties:
4143             enabled:
4144               type: boolean
4145             allowAdditionalExtensions:
4146               type: boolean
4147             allowAudioFiles:
4148               type: boolean
4149             threads:
4150               type: integer
4151             resolutions:
4152               type: object
4153               properties:
4154                 240p:
4155                   type: boolean
4156                 360p:
4157                   type: boolean
4158                 480p:
4159                   type: boolean
4160                 720p:
4161                   type: boolean
4162                 1080p:
4163                   type: boolean
4164                 2160p:
4165                   type: boolean
4166             hls:
4167               type: object
4168               properties:
4169                 enabled:
4170                   type: boolean
4171         import:
4172           type: object
4173           properties:
4174             videos:
4175               type: object
4176               properties:
4177                 http:
4178                   type: object
4179                   properties:
4180                     enabled:
4181                       type: boolean
4182                 torrent:
4183                   type: object
4184                   properties:
4185                     enabled:
4186                       type: boolean
4187         autoBlacklist:
4188           type: object
4189           properties:
4190             videos:
4191               type: object
4192               properties:
4193                 ofUsers:
4194                   type: object
4195                   properties:
4196                     enabled:
4197                       type: boolean
4198         followers:
4199           type: object
4200           properties:
4201             instance:
4202               type: object
4203               properties:
4204                 enabled:
4205                   type: boolean
4206                 manualApproval:
4207                   type: boolean
4208     Follow:
4209       properties:
4210         id:
4211           type: integer
4212         follower:
4213           $ref: '#/components/schemas/Actor'
4214         following:
4215           $ref: '#/components/schemas/Actor'
4216         score:
4217           type: number
4218           description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
4219         state:
4220           type: string
4221           enum:
4222             - pending
4223             - accepted
4224         createdAt:
4225           type: string
4226         updatedAt:
4227           type: string
4228     Job:
4229       properties:
4230         id:
4231           type: integer
4232         state:
4233           type: string
4234           enum:
4235             - pending
4236             - processing
4237             - error
4238             - success
4239         category:
4240           type: string
4241           enum:
4242             - transcoding
4243             - activitypub-http
4244         handlerName:
4245           type: string
4246         handlerInputData:
4247           type: string
4248         createdAt:
4249           type: string
4250         updatedAt:
4251           type: string
4252     AddUserResponse:
4253       properties:
4254         id:
4255           type: integer
4256         uuid:
4257           type: string
4258     VideoUploadResponse:
4259       properties:
4260         video:
4261           type: object
4262           properties:
4263             id:
4264               type: integer
4265             uuid:
4266               type: string
4267     CommentThreadResponse:
4268       properties:
4269         total:
4270           type: integer
4271         data:
4272           type: array
4273           items:
4274             $ref: '#/components/schemas/VideoComment'
4275     CommentThreadPostResponse:
4276       properties:
4277         comment:
4278           $ref: '#/components/schemas/VideoComment'
4279     VideoListResponse:
4280       properties:
4281         total:
4282           type: integer
4283         data:
4284           type: array
4285           items:
4286             $ref: '#/components/schemas/Video'
4287     AddUser:
4288       properties:
4289         username:
4290           type: string
4291           description: 'The user username'
4292           minLength: 1
4293           maxLength: 50
4294         password:
4295           type: string
4296           description: 'The user password. If the smtp server is configured, you can leave empty and an email will be sent'
4297           minLength: 6
4298           maxLength: 255
4299         email:
4300           type: string
4301           description: 'The user email. MUST be in the format of an email address.'
4302         videoQuota:
4303           type: string
4304           description: 'The user video quota'
4305         videoQuotaDaily:
4306           type: string
4307           description: 'The user daily video quota'
4308         role:
4309           $ref: '#/components/schemas/UserRole'
4310       required:
4311         - username
4312         - password
4313         - email
4314         - videoQuota
4315         - videoQuotaDaily
4316         - role
4317     UpdateUser:
4318       properties:
4319         id:
4320           type: string
4321           description: 'The user id'
4322         email:
4323           type: string
4324           description: 'The updated email of the user'
4325         videoQuota:
4326           type: string
4327           description: 'The updated video quota of the user'
4328         videoQuotaDaily:
4329           type: string
4330           description: 'The updated daily video quota of the user'
4331         role:
4332           $ref: '#/components/schemas/UserRole'
4333       required:
4334         - id
4335         - email
4336         - videoQuota
4337         - videoQuotaDaily
4338         - role
4339     UpdateMe:
4340       properties:
4341         password:
4342           type: string
4343           description: 'Your new password'
4344         email:
4345           type: string
4346           description: 'Your new email'
4347         displayNSFW:
4348           type: string
4349           description: 'Your new displayNSFW'
4350         autoPlayVideo:
4351           type: string
4352           description: 'Your new autoPlayVideo'
4353       required:
4354         - password
4355         - email
4356         - displayNSFW
4357         - autoPlayVideo
4358     GetMeVideoRating:
4359       properties:
4360         id:
4361           type: string
4362           description: 'Id of the video'
4363         rating:
4364           type: number
4365           description: 'Rating of the video'
4366       required:
4367         - id
4368         - rating
4369     VideoRating:
4370       properties:
4371         video:
4372           $ref: '#/components/schemas/Video'
4373         rating:
4374           type: number
4375           description: 'Rating of the video'
4376       required:
4377         - video
4378         - rating
4379     RegisterUser:
4380       properties:
4381         username:
4382           type: string
4383           description: 'The username of the user'
4384         password:
4385           type: string
4386           description: 'The password of the user'
4387         email:
4388           type: string
4389           description: 'The email of the user'
4390         displayName:
4391           type: string
4392           description: 'The user display name'
4393         channel:
4394           type: object
4395           properties:
4396             name:
4397               type: string
4398               description: 'The name for the default channel'
4399             displayName:
4400               type: string
4401               description: 'The display name for the default channel'
4402
4403       required:
4404         - username
4405         - password
4406         - email
4407     VideoChannelCreate:
4408       properties:
4409         name:
4410           type: string
4411         displayName:
4412           type: string
4413         description:
4414           type: string
4415         support:
4416           type: string
4417           description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
4418       required:
4419         - name
4420         - displayName
4421     VideoChannelUpdate:
4422       properties:
4423         displayName:
4424           type: string
4425         description:
4426           type: string
4427         support:
4428           type: string
4429           description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
4430         bulkVideosSupportUpdate:
4431           type: boolean
4432           description: 'Update the support field for all videos of this channel'
4433
4434     MRSSPeerLink:
4435       type: object
4436       xml:
4437         name: 'media:peerLink'
4438       properties:
4439         href:
4440           type: string
4441           xml:
4442             attribute: true
4443         type:
4444           type: string
4445           enum:
4446             - application/x-bittorrent
4447           xml:
4448             attribute: true
4449     MRSSGroupContent:
4450       type: object
4451       xml:
4452         name: 'media:content'
4453       properties:
4454         url:
4455           type: string
4456           xml:
4457             attribute: true
4458         fileSize:
4459           type: integer
4460           xml:
4461             attribute: true
4462         type:
4463           type: string
4464           xml:
4465             attribute: true
4466         framerate:
4467           type: integer
4468           xml:
4469             attribute: true
4470         duration:
4471           type: integer
4472           xml:
4473             attribute: true
4474         height:
4475           type: integer
4476           xml:
4477             attribute: true
4478         lang:
4479           type: string
4480           xml:
4481             attribute: true
4482     VideoCommentsForXML:
4483       type: array
4484       xml:
4485         wrapped: true
4486         name: 'channel'
4487       items:
4488         type: object
4489         xml:
4490           name: 'item'
4491         properties:
4492           link:
4493             type: string
4494           guid:
4495             type: string
4496           pubDate:
4497             type: string
4498             format: date-time
4499           'content:encoded':
4500             type: string
4501           'dc:creator':
4502             type: string
4503     VideosForXML:
4504       type: array
4505       xml:
4506         wrapped: true
4507         name: 'channel'
4508       items:
4509         type: object
4510         xml:
4511           name: 'item'
4512         properties:
4513           link:
4514             type: string
4515             description: video watch page URL
4516           guid:
4517             type: string
4518             description: video canonical URL
4519           pubDate:
4520             type: string
4521             format: date-time
4522             description: video publication date
4523           description:
4524             type: string
4525             description: video description
4526           'content:encoded':
4527             type: string
4528             description: video description
4529           'dc:creator':
4530             type: string
4531             description: publisher user name
4532           'media:category':
4533             type: integer
4534             description: video category (MRSS)
4535           'media:community':
4536             type: object
4537             description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
4538             properties:
4539               'media:statistics':
4540                 type: object
4541                 properties:
4542                   views:
4543                     type: integer
4544                     xml:
4545                       attribute: true
4546           'media:embed':
4547             type: object
4548             properties:
4549               url:
4550                 type: string
4551                 description: video embed path, relative to the canonical URL domain (MRSS)
4552                 xml:
4553                   attribute: true
4554           'media:player':
4555             type: object
4556             properties:
4557               url:
4558                 type: string
4559                 description: video watch path, relative to the canonical URL domain (MRSS)
4560                 xml:
4561                   attribute: true
4562           'media:thumbnail':
4563             type: object
4564             properties:
4565               url:
4566                 type: string
4567                 xml:
4568                   attribute: true
4569               height:
4570                 type: integer
4571                 xml:
4572                   attribute: true
4573               width:
4574                 type: integer
4575                 xml:
4576                   attribute: true
4577           'media:title':
4578             type: string
4579             description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
4580           'media:description':
4581             type: string
4582           'media:rating':
4583             type: string
4584             enum:
4585               - nonadult
4586               - adult
4587             description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
4588           'enclosure':
4589             type: object
4590             description: main streamable file for the video
4591             properties:
4592               url:
4593                 type: string
4594                 xml:
4595                   attribute: true
4596               type:
4597                 type: string
4598                 enum:
4599                   - application/x-bittorrent
4600                 xml:
4601                   attribute: true
4602               length:
4603                 type: integer
4604                 xml:
4605                   attribute: true
4606           'media:group':
4607             type: array
4608             description: list of streamable files for the video. see [media:peerLink](https://www.rssboard.org/media-rss#media-peerlink) and [media:content](https://www.rssboard.org/media-rss#media-content) or  (MRSS)
4609             items:
4610               anyOf:
4611                 - $ref: '#/components/schemas/MRSSPeerLink'
4612                 - $ref: '#/components/schemas/MRSSGroupContent'
4613     NotificationSettingValue:
4614       type: integer
4615       description: >
4616         Notification type
4617         - `0` NONE
4618         - `1` WEB
4619         - `2` EMAIL
4620       enum:
4621         - 0
4622         - 1
4623         - 3
4624     Notification:
4625       properties:
4626         id:
4627           type: integer
4628         type:
4629           type: integer
4630           description: >
4631             Notification type, following the `UserNotificationType` enum:
4632             - `1` NEW_VIDEO_FROM_SUBSCRIPTION
4633             - `2` NEW_COMMENT_ON_MY_VIDEO
4634             - `3` NEW_VIDEO_ABUSE_FOR_MODERATORS
4635             - `4` BLACKLIST_ON_MY_VIDEO
4636             - `5` UNBLACKLIST_ON_MY_VIDEO
4637             - `6` MY_VIDEO_PUBLISHED
4638             - `7` MY_VIDEO_IMPORT_SUCCESS
4639             - `8` MY_VIDEO_IMPORT_ERROR
4640             - `9` NEW_USER_REGISTRATION
4641             - `10` NEW_FOLLOW
4642             - `11` COMMENT_MENTION
4643             - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
4644             - `13` NEW_INSTANCE_FOLLOWER
4645             - `14` AUTO_INSTANCE_FOLLOWING
4646         read:
4647           type: boolean
4648         video:
4649           nullable: true
4650           allOf:
4651             - $ref: '#/components/schemas/VideoInfo'
4652             - type: object
4653               properties:
4654                 channel:
4655                   $ref: '#/components/schemas/ActorInfo'
4656         videoImport:
4657           nullable: true
4658           type: object
4659           properties:
4660             id:
4661               type: integer
4662             video:
4663               nullable: true
4664               $ref: '#/components/schemas/VideoInfo'
4665             torrentName:
4666               type: string
4667               nullable: true
4668             magnetUri:
4669               type: string
4670               nullable: true
4671             targetUri:
4672               type: string
4673               nullable: true
4674         comment:
4675           nullable: true
4676           type: object
4677           properties:
4678             id:
4679               type: integer
4680             threadId:
4681               type: integer
4682             video:
4683               $ref: '#/components/schemas/VideoInfo'
4684             account:
4685               $ref: '#/components/schemas/ActorInfo'
4686         videoAbuse:
4687           nullable: true
4688           type: object
4689           properties:
4690             id:
4691               type: integer
4692             video:
4693               allOf:
4694                 - $ref: '#/components/schemas/VideoInfo'
4695         videoBlacklist:
4696           nullable: true
4697           type: object
4698           properties:
4699             id:
4700               type: integer
4701             video:
4702               allOf:
4703                 - $ref: '#/components/schemas/VideoInfo'
4704         account:
4705           nullable: true
4706           allOf:
4707             - $ref: '#/components/schemas/ActorInfo'
4708         actorFollow:
4709           type: object
4710           nullable: true
4711           properties:
4712             id:
4713               type: integer
4714             follower:
4715               $ref: '#/components/schemas/ActorInfo'
4716             state:
4717               type: string
4718               enum:
4719                 - pending
4720                 - accepted
4721             following:
4722               type: object
4723               properties:
4724                 type:
4725                   type: string
4726                   enum:
4727                     - account
4728                     - channel
4729                     - instance
4730                 name:
4731                   type: string
4732                 displayName:
4733                   type: string
4734                 host:
4735                   type: string
4736         createdAt:
4737           type: string
4738           format: date-time
4739         updatedAt:
4740           type: string
4741           format: date-time
4742     NotificationListResponse:
4743       properties:
4744         total:
4745           type: integer
4746         data:
4747           type: array
4748           items:
4749             $ref: '#/components/schemas/Notification'
4750     Plugin:
4751       properties:
4752         name:
4753           type: string
4754         type:
4755           type: integer
4756           enum:
4757             - 1
4758             - 2
4759         latestVersion:
4760           type: string
4761         version:
4762           type: string
4763         enabled:
4764           type: boolean
4765         uninstalled:
4766           type: boolean
4767         peertubeEngine:
4768           type: string
4769         description:
4770           type: string
4771         homepage:
4772           type: string
4773         settings:
4774           type: object
4775           additionalProperties: true
4776         createdAt:
4777           type: string
4778           format: date-time
4779         updatedAt:
4780           type: string
4781           format: date-time
4782     PluginResponse:
4783       properties:
4784         total:
4785           type: integer
4786         data:
4787           type: array
4788           items:
4789             $ref: '#/components/schemas/Plugin'