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