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