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