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