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