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