]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/doc/api/openapi.yaml
373b17ddf25cc8642c7e01d7834e8b3616e4bad5
[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 tags:
1230 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1231 type: array
1232 minItems: 1
1233 maxItems: 5
1234 items:
1235 type: string
1236 minLength: 2
1237 maxLength: 30
1238 commentsEnabled:
1239 description: Enable or disable comments for this video
1240 type: boolean
1241 originallyPublishedAt:
1242 description: Date when the content was originally published
1243 type: string
1244 format: date-time
1245 scheduleUpdate:
1246 $ref: '#/components/schemas/VideoScheduledUpdate'
1247 encoding:
1248 thumbnailfile:
1249 contentType: image/jpeg
1250 previewfile:
1251 contentType: image/jpeg
1252 get:
1253 summary: Get a video
1254 tags:
1255 - Video
1256 parameters:
1257 - $ref: '#/components/parameters/idOrUUID'
1258 responses:
1259 '200':
1260 description: successful operation
1261 content:
1262 application/json:
1263 schema:
1264 $ref: '#/components/schemas/VideoDetails'
1265 delete:
1266 summary: Delete a video
1267 security:
1268 - OAuth2: []
1269 tags:
1270 - Video
1271 parameters:
1272 - $ref: '#/components/parameters/idOrUUID'
1273 responses:
1274 '204':
1275 description: successful operation
1276 '/videos/{id}/description':
1277 get:
1278 summary: Get complete video description
1279 tags:
1280 - Video
1281 parameters:
1282 - $ref: '#/components/parameters/idOrUUID'
1283 responses:
1284 '200':
1285 description: successful operation
1286 content:
1287 application/json:
1288 schema:
1289 type: string
1290 '/videos/{id}/views':
1291 post:
1292 summary: Add a view to a video
1293 tags:
1294 - Video
1295 parameters:
1296 - $ref: '#/components/parameters/idOrUUID'
1297 responses:
1298 '204':
1299 description: successful operation
1300 '/videos/{id}/watching':
1301 put:
1302 summary: Set watching progress of a video
1303 tags:
1304 - Video
1305 security:
1306 - OAuth2: []
1307 parameters:
1308 - $ref: '#/components/parameters/idOrUUID'
1309 requestBody:
1310 content:
1311 application/json:
1312 schema:
1313 $ref: '#/components/schemas/UserWatchingVideo'
1314 required: true
1315 responses:
1316 '204':
1317 description: successful operation
1318 /videos/upload:
1319 post:
1320 summary: Upload a video
1321 security:
1322 - OAuth2: []
1323 tags:
1324 - Video
1325 responses:
1326 '200':
1327 description: successful operation
1328 content:
1329 application/json:
1330 schema:
1331 $ref: '#/components/schemas/VideoUploadResponse'
1332 '400':
1333 description: invalid file field, schedule date or parameter
1334 '403':
1335 description: video didn't pass upload filter
1336 '408':
1337 description: upload has timed out
1338 '413':
1339 description: video file too large, due to quota or max body size limit set by the reverse-proxy
1340 headers:
1341 X-File-Maximum-Size:
1342 schema:
1343 type: string
1344 format: Nginx size
1345 description: Maximum file size for the video
1346 '415':
1347 description: video type unsupported
1348 '422':
1349 description: video unreadable
1350 requestBody:
1351 content:
1352 multipart/form-data:
1353 schema:
1354 type: object
1355 properties:
1356 videofile:
1357 description: Video file
1358 type: string
1359 format: binary
1360 channelId:
1361 description: Channel id that will contain this video
1362 type: integer
1363 thumbnailfile:
1364 description: Video thumbnail file
1365 type: string
1366 format: binary
1367 previewfile:
1368 description: Video preview file
1369 type: string
1370 format: binary
1371 privacy:
1372 $ref: '#/components/schemas/VideoPrivacySet'
1373 category:
1374 description: Video category
1375 type: integer
1376 example: 4
1377 licence:
1378 description: Video licence
1379 type: integer
1380 example: 2
1381 language:
1382 description: Video language
1383 type: string
1384 description:
1385 description: Video description
1386 type: string
1387 waitTranscoding:
1388 description: Whether or not we wait transcoding before publish the video
1389 type: boolean
1390 support:
1391 description: A text tell the audience how to support the video creator
1392 example: Please support my work on <insert crowdfunding plateform>! <3
1393 type: string
1394 nsfw:
1395 description: Whether or not this video contains sensitive content
1396 type: boolean
1397 name:
1398 description: Video name
1399 type: string
1400 tags:
1401 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1402 type: array
1403 minItems: 1
1404 maxItems: 5
1405 uniqueItems: true
1406 items:
1407 type: string
1408 minLength: 2
1409 maxLength: 30
1410 commentsEnabled:
1411 description: Enable or disable comments for this video
1412 type: boolean
1413 downloadEnabled:
1414 description: Enable or disable downloading for this video
1415 type: boolean
1416 originallyPublishedAt:
1417 description: Date when the content was originally published
1418 type: string
1419 format: date-time
1420 scheduleUpdate:
1421 $ref: '#/components/schemas/VideoScheduledUpdate'
1422 required:
1423 - videofile
1424 - channelId
1425 - name
1426 encoding:
1427 videofile:
1428 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
1429 thumbnailfile:
1430 contentType: image/jpeg
1431 previewfile:
1432 contentType: image/jpeg
1433 x-code-samples:
1434 - lang: Shell
1435 source: |
1436 ## DEPENDENCIES: jq
1437 USERNAME="<your_username>"
1438 PASSWORD="<your_password>"
1439 FILE_PATH="<your_file_path>"
1440 CHANNEL_ID="<your_channel_id>"
1441 NAME="<video_name>"
1442
1443 API_PATH="https://peertube2.cpy.re/api/v1"
1444 ## AUTH
1445 client_id=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1446 client_secret=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1447 token=$(curl -s "$API_PATH/users/token" \
1448 --data client_id="$client_id" \
1449 --data client_secret="$client_secret" \
1450 --data grant_type=password \
1451 --data response_type=code \
1452 --data username="$USERNAME" \
1453 --data password="$PASSWORD" \
1454 | jq -r ".access_token")
1455 ## VIDEO UPLOAD
1456 curl -s "$API_PATH/videos/upload" \
1457 -H "Authorization: Bearer $token" \
1458 --max-time 600 \
1459 --form videofile=@"$FILE_PATH" \
1460 --form channelId=$CHANNEL_ID \
1461 --form name="$NAME"
1462 /videos/imports:
1463 post:
1464 summary: Import a video
1465 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
1466 security:
1467 - OAuth2: []
1468 tags:
1469 - Video
1470 requestBody:
1471 content:
1472 multipart/form-data:
1473 schema:
1474 type: object
1475 properties:
1476 torrentfile:
1477 description: Torrent File
1478 type: string
1479 format: binary
1480 targetUrl:
1481 description: HTTP target URL
1482 type: string
1483 magnetUri:
1484 description: Magnet URI
1485 type: string
1486 channelId:
1487 description: Channel id that will contain this video
1488 type: integer
1489 thumbnailfile:
1490 description: Video thumbnail file
1491 type: string
1492 format: binary
1493 previewfile:
1494 description: Video preview file
1495 type: string
1496 format: binary
1497 privacy:
1498 $ref: '#/components/schemas/VideoPrivacySet'
1499 category:
1500 description: Video category
1501 type: integer
1502 example: 4
1503 licence:
1504 description: Video licence
1505 type: integer
1506 example: 2
1507 language:
1508 description: Video language
1509 type: string
1510 description:
1511 description: Video description
1512 type: string
1513 waitTranscoding:
1514 description: Whether or not we wait transcoding before publish the video
1515 type: boolean
1516 support:
1517 description: A text tell the audience how to support the video creator
1518 example: Please support my work on <insert crowdfunding plateform>! <3
1519 type: string
1520 nsfw:
1521 description: Whether or not this video contains sensitive content
1522 type: boolean
1523 name:
1524 description: Video name
1525 type: string
1526 tags:
1527 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1528 type: array
1529 minItems: 1
1530 maxItems: 5
1531 items:
1532 type: string
1533 minLength: 2
1534 maxLength: 30
1535 commentsEnabled:
1536 description: Enable or disable comments for this video
1537 type: boolean
1538 downloadEnabled:
1539 description: Enable or disable downloading for this video
1540 type: boolean
1541 scheduleUpdate:
1542 $ref: '#/components/schemas/VideoScheduledUpdate'
1543 required:
1544 - channelId
1545 - name
1546 encoding:
1547 torrentfile:
1548 contentType: application/x-bittorrent
1549 thumbnailfile:
1550 contentType: image/jpeg
1551 previewfile:
1552 contentType: image/jpeg
1553 responses:
1554 '200':
1555 description: successful operation
1556 content:
1557 application/json:
1558 schema:
1559 $ref: '#/components/schemas/VideoUploadResponse'
1560 '400':
1561 description: '`magnetUri` or `targetUrl` or a torrent file missing'
1562 '403':
1563 description: video didn't pass pre-import filter
1564 '409':
1565 description: HTTP or Torrent/magnetURI import not enabled
1566
1567 /videos/live:
1568 post:
1569 summary: Create a live
1570 security:
1571 - OAuth2: []
1572 tags:
1573 - Live Videos
1574 - Video
1575 responses:
1576 '200':
1577 description: successful operation
1578 content:
1579 application/json:
1580 schema:
1581 $ref: '#/components/schemas/VideoUploadResponse'
1582 '403':
1583 description: Live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded
1584 requestBody:
1585 content:
1586 multipart/form-data:
1587 schema:
1588 type: object
1589 properties:
1590 channelId:
1591 description: Channel id that will contain this live video
1592 type: integer
1593 saveReplay:
1594 type: boolean
1595 permanentLive:
1596 description: User can stream multiple times in a permanent live
1597 type: boolean
1598 thumbnailfile:
1599 description: Live video/replay thumbnail file
1600 type: string
1601 format: binary
1602 previewfile:
1603 description: Live video/replay preview file
1604 type: string
1605 format: binary
1606 privacy:
1607 $ref: '#/components/schemas/VideoPrivacySet'
1608 category:
1609 description: Live video/replay category
1610 type: string
1611 licence:
1612 description: Live video/replay licence
1613 type: string
1614 language:
1615 description: Live video/replay language
1616 type: string
1617 description:
1618 description: Live video/replay description
1619 type: string
1620 support:
1621 description: A text tell the audience how to support the creator
1622 example: Please support my work on <insert crowdfunding plateform>! <3
1623 type: string
1624 nsfw:
1625 description: Whether or not this live video/replay contains sensitive content
1626 type: boolean
1627 name:
1628 description: Live video/replay name
1629 type: string
1630 tags:
1631 description: Live video/replay tags (maximum 5 tags each between 2 and 30 characters)
1632 type: array
1633 minItems: 1
1634 maxItems: 5
1635 items:
1636 type: string
1637 minLength: 2
1638 maxLength: 30
1639 commentsEnabled:
1640 description: Enable or disable comments for this live video/replay
1641 type: boolean
1642 downloadEnabled:
1643 description: Enable or disable downloading for the replay of this live
1644 type: boolean
1645 required:
1646 - channelId
1647 - name
1648 encoding:
1649 thumbnailfile:
1650 contentType: image/jpeg
1651 previewfile:
1652 contentType: image/jpeg
1653
1654 /videos/live/{id}:
1655 get:
1656 summary: Get a live information
1657 security:
1658 - OAuth2: []
1659 tags:
1660 - Live Videos
1661 - Video
1662 parameters:
1663 - $ref: '#/components/parameters/idOrUUID'
1664 responses:
1665 '200':
1666 description: successful operation
1667 content:
1668 application/json:
1669 schema:
1670 $ref: '#/components/schemas/LiveVideoResponse'
1671 put:
1672 summary: Update a live information
1673 security:
1674 - OAuth2: []
1675 tags:
1676 - Live Videos
1677 - Video
1678 parameters:
1679 - $ref: '#/components/parameters/idOrUUID'
1680 requestBody:
1681 content:
1682 application/json:
1683 schema:
1684 $ref: '#/components/schemas/LiveVideoUpdate'
1685 responses:
1686 '204':
1687 description: Successful operation
1688 '400':
1689 description: Bad parameters or trying to update a live that has already started
1690 '403':
1691 description: Trying to save replay of the live but saving replay is not enabled on the instance
1692
1693 /users/me/abuses:
1694 get:
1695 summary: List my abuses
1696 security:
1697 - OAuth2: []
1698 tags:
1699 - Abuses
1700 - My User
1701 parameters:
1702 - name: id
1703 in: query
1704 description: only list the report with this id
1705 schema:
1706 type: integer
1707 - name: state
1708 in: query
1709 schema:
1710 $ref: '#/components/schemas/AbuseStateSet'
1711 - $ref: '#/components/parameters/start'
1712 - $ref: '#/components/parameters/count'
1713 - $ref: '#/components/parameters/abusesSort'
1714 responses:
1715 '200':
1716 description: successful operation
1717 content:
1718 application/json:
1719 schema:
1720 type: array
1721 items:
1722 $ref: '#/components/schemas/Abuse'
1723
1724 /abuses:
1725 get:
1726 summary: List abuses
1727 security:
1728 - OAuth2:
1729 - admin
1730 - moderator
1731 tags:
1732 - Abuses
1733 parameters:
1734 - name: id
1735 in: query
1736 description: only list the report with this id
1737 schema:
1738 type: integer
1739 - name: predefinedReason
1740 in: query
1741 description: predefined reason the listed reports should contain
1742 schema:
1743 $ref: '#/components/schemas/PredefinedAbuseReasons'
1744 - name: search
1745 in: query
1746 description: plain search that will match with video titles, reporter names and more
1747 schema:
1748 type: string
1749 - name: state
1750 in: query
1751 schema:
1752 $ref: '#/components/schemas/AbuseStateSet'
1753 - name: searchReporter
1754 in: query
1755 description: only list reports of a specific reporter
1756 schema:
1757 type: string
1758 - name: searchReportee
1759 description: only list reports of a specific reportee
1760 in: query
1761 schema:
1762 type: string
1763 - name: searchVideo
1764 in: query
1765 description: only list reports of a specific video
1766 schema:
1767 type: string
1768 - name: searchVideoChannel
1769 in: query
1770 description: only list reports of a specific video channel
1771 schema:
1772 type: string
1773 - name: videoIs
1774 in: query
1775 description: only list blacklisted or deleted videos
1776 schema:
1777 type: string
1778 enum:
1779 - 'deleted'
1780 - 'blacklisted'
1781 - name: filter
1782 in: query
1783 description: only list account, comment or video reports
1784 schema:
1785 type: string
1786 enum:
1787 - 'video'
1788 - 'comment'
1789 - 'account'
1790 - $ref: '#/components/parameters/start'
1791 - $ref: '#/components/parameters/count'
1792 - $ref: '#/components/parameters/abusesSort'
1793 responses:
1794 '200':
1795 description: successful operation
1796 content:
1797 application/json:
1798 schema:
1799 type: array
1800 items:
1801 $ref: '#/components/schemas/Abuse'
1802
1803 post:
1804 summary: Report an abuse
1805 security:
1806 - OAuth2: []
1807 tags:
1808 - Abuses
1809 requestBody:
1810 required: true
1811 content:
1812 application/json:
1813 schema:
1814 type: object
1815 properties:
1816 reason:
1817 description: Reason why the user reports this video
1818 type: string
1819 minLength: 4
1820 predefinedReasons:
1821 $ref: '#/components/schemas/PredefinedAbuseReasons'
1822
1823 video:
1824 type: object
1825 properties:
1826 id:
1827 description: Video id to report
1828 type: number
1829 startAt:
1830 type: integer
1831 description: Timestamp in the video that marks the beginning of the report
1832 minimum: 0
1833 endAt:
1834 type: integer
1835 description: Timestamp in the video that marks the ending of the report
1836 minimum: 0
1837 comment:
1838 type: object
1839 properties:
1840 id:
1841 description: Comment id to report
1842 type: number
1843 account:
1844 type: object
1845 properties:
1846 id:
1847 description: Account id to report
1848 type: number
1849 required:
1850 - reason
1851 responses:
1852 '204':
1853 description: successful operation
1854 '400':
1855 description: incorrect request parameters
1856 '/abuses/{abuseId}':
1857 put:
1858 summary: Update an abuse
1859 security:
1860 - OAuth2:
1861 - admin
1862 - moderator
1863 tags:
1864 - Abuses
1865 parameters:
1866 - $ref: '#/components/parameters/abuseId'
1867 requestBody:
1868 content:
1869 application/json:
1870 schema:
1871 type: object
1872 properties:
1873 state:
1874 $ref: '#/components/schemas/AbuseStateSet'
1875 moderationComment:
1876 type: string
1877 description: Update the report comment visible only to the moderation team
1878 responses:
1879 '204':
1880 description: successful operation
1881 '404':
1882 description: abuse not found
1883 delete:
1884 tags:
1885 - Abuses
1886 summary: Delete an abuse
1887 security:
1888 - OAuth2:
1889 - admin
1890 - moderator
1891 parameters:
1892 - $ref: '#/components/parameters/abuseId'
1893 responses:
1894 '204':
1895 description: successful operation
1896 '404':
1897 description: block not found
1898 '/abuses/{abuseId}/messages':
1899 get:
1900 summary: List messages of an abuse
1901 security:
1902 - OAuth2: []
1903 tags:
1904 - Abuses
1905 parameters:
1906 - $ref: '#/components/parameters/abuseId'
1907 responses:
1908 '200':
1909 description: successful operation
1910 content:
1911 application/json:
1912 schema:
1913 type: array
1914 items:
1915 $ref: '#/components/schemas/AbuseMessage'
1916
1917 post:
1918 summary: Add message to an abuse
1919 security:
1920 - OAuth2: []
1921 tags:
1922 - Abuses
1923 parameters:
1924 - $ref: '#/components/parameters/abuseId'
1925 requestBody:
1926 required: true
1927 content:
1928 application/json:
1929 schema:
1930 type: object
1931 properties:
1932 message:
1933 description: Message to send
1934 type: string
1935 required:
1936 - message
1937 responses:
1938 '200':
1939 description: successful operation
1940 '400':
1941 description: incorrect request parameters
1942 '/abuses/{abuseId}/messages/{abuseMessageId}':
1943 delete:
1944 summary: Delete an abuse message
1945 security:
1946 - OAuth2: []
1947 tags:
1948 - Abuses
1949 parameters:
1950 - $ref: '#/components/parameters/abuseId'
1951 - $ref: '#/components/parameters/abuseMessageId'
1952 responses:
1953 '204':
1954 description: successful operation
1955
1956 '/videos/{id}/blacklist':
1957 post:
1958 summary: Block a video
1959 security:
1960 - OAuth2:
1961 - admin
1962 - moderator
1963 tags:
1964 - Video Blocks
1965 parameters:
1966 - $ref: '#/components/parameters/idOrUUID'
1967 responses:
1968 '204':
1969 description: successful operation
1970 delete:
1971 summary: Unblock a video by its id
1972 security:
1973 - OAuth2:
1974 - admin
1975 - moderator
1976 tags:
1977 - Video Blocks
1978 parameters:
1979 - $ref: '#/components/parameters/idOrUUID'
1980 responses:
1981 '204':
1982 description: successful operation
1983 '404':
1984 description: block not found
1985 /videos/blacklist:
1986 get:
1987 tags:
1988 - Video Blocks
1989 summary: List video blocks
1990 security:
1991 - OAuth2:
1992 - admin
1993 - moderator
1994 parameters:
1995 - name: type
1996 in: query
1997 description: >
1998 list only blocks that match this type:
1999
2000 - `1`: manual block
2001
2002 - `2`: automatic block that needs review
2003 schema:
2004 type: integer
2005 enum:
2006 - 1
2007 - 2
2008 - name: search
2009 in: query
2010 description: plain search that will match with video titles, and more
2011 schema:
2012 type: string
2013 - $ref: '#/components/parameters/start'
2014 - $ref: '#/components/parameters/count'
2015 - $ref: '#/components/parameters/blacklistsSort'
2016 responses:
2017 '200':
2018 description: successful operation
2019 content:
2020 application/json:
2021 schema:
2022 type: object
2023 properties:
2024 total:
2025 type: integer
2026 example: 1
2027 data:
2028 type: array
2029 items:
2030 $ref: '#/components/schemas/VideoBlacklist'
2031 /videos/{id}/captions:
2032 get:
2033 summary: List captions of a video
2034 tags:
2035 - Video Captions
2036 parameters:
2037 - $ref: '#/components/parameters/idOrUUID'
2038 responses:
2039 '200':
2040 description: successful operation
2041 content:
2042 application/json:
2043 schema:
2044 type: object
2045 properties:
2046 total:
2047 type: integer
2048 example: 1
2049 data:
2050 type: array
2051 items:
2052 $ref: '#/components/schemas/VideoCaption'
2053 /videos/{id}/captions/{captionLanguage}:
2054 put:
2055 summary: Add or replace a video caption
2056 security:
2057 - OAuth2:
2058 - user
2059 tags:
2060 - Video Captions
2061 parameters:
2062 - $ref: '#/components/parameters/idOrUUID'
2063 - $ref: '#/components/parameters/captionLanguage'
2064 requestBody:
2065 content:
2066 multipart/form-data:
2067 schema:
2068 type: object
2069 properties:
2070 captionfile:
2071 description: The file to upload.
2072 type: string
2073 format: binary
2074 encoding:
2075 captionfile:
2076 contentType: text/vtt, application/x-subrip, text/plain
2077 responses:
2078 '204':
2079 description: successful operation
2080 '404':
2081 description: video or language not found
2082 delete:
2083 summary: Delete a video caption
2084 security:
2085 - OAuth2:
2086 - user
2087 tags:
2088 - Video Captions
2089 parameters:
2090 - $ref: '#/components/parameters/idOrUUID'
2091 - $ref: '#/components/parameters/captionLanguage'
2092 responses:
2093 '204':
2094 description: successful operation
2095 '404':
2096 description: video or language or caption for that language not found
2097 /video-channels:
2098 get:
2099 summary: List video channels
2100 tags:
2101 - Video Channels
2102 parameters:
2103 - $ref: '#/components/parameters/start'
2104 - $ref: '#/components/parameters/count'
2105 - $ref: '#/components/parameters/sort'
2106 responses:
2107 '200':
2108 description: successful operation
2109 content:
2110 application/json:
2111 schema:
2112 type: object
2113 properties:
2114 total:
2115 type: integer
2116 example: 1
2117 data:
2118 type: array
2119 items:
2120 $ref: '#/components/schemas/VideoChannel'
2121 post:
2122 summary: Create a video channel
2123 security:
2124 - OAuth2: []
2125 tags:
2126 - Video Channels
2127 responses:
2128 '204':
2129 description: successful operation
2130 requestBody:
2131 content:
2132 application/json:
2133 schema:
2134 $ref: '#/components/schemas/VideoChannelCreate'
2135 '/video-channels/{channelHandle}':
2136 get:
2137 summary: Get a video channel
2138 tags:
2139 - Video Channels
2140 parameters:
2141 - $ref: '#/components/parameters/channelHandle'
2142 responses:
2143 '200':
2144 description: successful operation
2145 content:
2146 application/json:
2147 schema:
2148 $ref: '#/components/schemas/VideoChannel'
2149 put:
2150 summary: Update a video channel
2151 security:
2152 - OAuth2: []
2153 tags:
2154 - Video Channels
2155 parameters:
2156 - $ref: '#/components/parameters/channelHandle'
2157 responses:
2158 '204':
2159 description: successful operation
2160 requestBody:
2161 content:
2162 application/json:
2163 schema:
2164 $ref: '#/components/schemas/VideoChannelUpdate'
2165 delete:
2166 summary: Delete a video channel
2167 security:
2168 - OAuth2: []
2169 tags:
2170 - Video Channels
2171 parameters:
2172 - $ref: '#/components/parameters/channelHandle'
2173 responses:
2174 '204':
2175 description: successful operation
2176 '/video-channels/{channelHandle}/videos':
2177 get:
2178 summary: List videos of a video channel
2179 tags:
2180 - Video
2181 - Video Channels
2182 parameters:
2183 - $ref: '#/components/parameters/channelHandle'
2184 - $ref: '#/components/parameters/categoryOneOf'
2185 - $ref: '#/components/parameters/tagsOneOf'
2186 - $ref: '#/components/parameters/tagsAllOf'
2187 - $ref: '#/components/parameters/licenceOneOf'
2188 - $ref: '#/components/parameters/languageOneOf'
2189 - $ref: '#/components/parameters/nsfw'
2190 - $ref: '#/components/parameters/filter'
2191 - $ref: '#/components/parameters/skipCount'
2192 - $ref: '#/components/parameters/start'
2193 - $ref: '#/components/parameters/count'
2194 - $ref: '#/components/parameters/videosSort'
2195 responses:
2196 '200':
2197 description: successful operation
2198 content:
2199 application/json:
2200 schema:
2201 $ref: '#/components/schemas/VideoListResponse'
2202 '/video-channels/{channelHandle}/avatar/pick':
2203 post:
2204 summary: Update channel avatar
2205 security:
2206 - OAuth2: []
2207 tags:
2208 - Video Channels
2209 parameters:
2210 - $ref: '#/components/parameters/channelHandle'
2211 responses:
2212 '200':
2213 description: successful operation
2214 content:
2215 application/json:
2216 schema:
2217 type: object
2218 properties:
2219 avatar:
2220 $ref: '#/components/schemas/ActorImage'
2221 '413':
2222 description: image file too large
2223 headers:
2224 X-File-Maximum-Size:
2225 schema:
2226 type: string
2227 format: Nginx size
2228 description: Maximum file size for the avatar
2229 requestBody:
2230 content:
2231 multipart/form-data:
2232 schema:
2233 type: object
2234 properties:
2235 avatarfile:
2236 description: The file to upload.
2237 type: string
2238 format: binary
2239 encoding:
2240 avatarfile:
2241 contentType: image/png, image/jpeg
2242 '/video-channels/{channelHandle}/avatar':
2243 delete:
2244 summary: Delete channel avatar
2245 security:
2246 - OAuth2: []
2247 tags:
2248 - Video Channels
2249 parameters:
2250 - $ref: '#/components/parameters/channelHandle'
2251 responses:
2252 '204':
2253 description: successful operation
2254
2255
2256 '/video-channels/{channelHandle}/banner/pick':
2257 post:
2258 summary: Update channel banner
2259 security:
2260 - OAuth2: []
2261 tags:
2262 - Video Channels
2263 parameters:
2264 - $ref: '#/components/parameters/channelHandle'
2265 responses:
2266 '200':
2267 description: successful operation
2268 content:
2269 application/json:
2270 schema:
2271 type: object
2272 properties:
2273 banner:
2274 $ref: '#/components/schemas/ActorImage'
2275 '413':
2276 description: image file too large
2277 headers:
2278 X-File-Maximum-Size:
2279 schema:
2280 type: string
2281 format: Nginx size
2282 description: Maximum file size for the banner
2283 requestBody:
2284 content:
2285 multipart/form-data:
2286 schema:
2287 type: object
2288 properties:
2289 bannerfile:
2290 description: The file to upload.
2291 type: string
2292 format: binary
2293 encoding:
2294 bannerfile:
2295 contentType: image/png, image/jpeg
2296 '/video-channels/{channelHandle}/banner':
2297 delete:
2298 summary: Delete channel banner
2299 security:
2300 - OAuth2: []
2301 tags:
2302 - Video Channels
2303 parameters:
2304 - $ref: '#/components/parameters/channelHandle'
2305 responses:
2306 '204':
2307 description: successful operation
2308
2309 /video-playlists/privacies:
2310 get:
2311 summary: List available playlist privacies
2312 tags:
2313 - Video Playlists
2314 responses:
2315 '200':
2316 description: successful operation
2317 content:
2318 application/json:
2319 schema:
2320 type: array
2321 items:
2322 type: string
2323 examples:
2324 nightly:
2325 externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies
2326
2327 /video-playlists:
2328 get:
2329 summary: List video playlists
2330 tags:
2331 - Video Playlists
2332 parameters:
2333 - $ref: '#/components/parameters/start'
2334 - $ref: '#/components/parameters/count'
2335 - $ref: '#/components/parameters/sort'
2336 responses:
2337 '200':
2338 description: successful operation
2339 content:
2340 application/json:
2341 schema:
2342 type: object
2343 properties:
2344 total:
2345 type: integer
2346 example: 1
2347 data:
2348 type: array
2349 items:
2350 $ref: '#/components/schemas/VideoPlaylist'
2351 post:
2352 summary: Create a video playlist
2353 description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
2354 security:
2355 - OAuth2: []
2356 tags:
2357 - Video Playlists
2358 responses:
2359 '200':
2360 description: successful operation
2361 content:
2362 application/json:
2363 schema:
2364 type: object
2365 properties:
2366 videoPlaylist:
2367 type: object
2368 properties:
2369 id:
2370 type: integer
2371 uuid:
2372 type: string
2373 requestBody:
2374 content:
2375 multipart/form-data:
2376 schema:
2377 type: object
2378 properties:
2379 displayName:
2380 description: Video playlist display name
2381 type: string
2382 thumbnailfile:
2383 description: Video playlist thumbnail file
2384 type: string
2385 format: binary
2386 privacy:
2387 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2388 description:
2389 description: Video playlist description
2390 type: string
2391 videoChannelId:
2392 description: Video channel in which the playlist will be published
2393 type: integer
2394 required:
2395 - displayName
2396 encoding:
2397 thumbnailfile:
2398 contentType: image/jpeg
2399
2400 /video-playlists/{id}:
2401 get:
2402 summary: Get a video playlist
2403 tags:
2404 - Video Playlists
2405 parameters:
2406 - $ref: '#/components/parameters/idOrUUID'
2407 responses:
2408 '200':
2409 description: successful operation
2410 content:
2411 application/json:
2412 schema:
2413 $ref: '#/components/schemas/VideoPlaylist'
2414 put:
2415 summary: Update a video playlist
2416 description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
2417 security:
2418 - OAuth2: []
2419 tags:
2420 - Video Playlists
2421 responses:
2422 '204':
2423 description: successful operation
2424 parameters:
2425 - $ref: '#/components/parameters/idOrUUID'
2426 requestBody:
2427 content:
2428 multipart/form-data:
2429 schema:
2430 type: object
2431 properties:
2432 displayName:
2433 description: Video playlist display name
2434 type: string
2435 thumbnailfile:
2436 description: Video playlist thumbnail file
2437 type: string
2438 format: binary
2439 privacy:
2440 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2441 description:
2442 description: Video playlist description
2443 type: string
2444 videoChannelId:
2445 description: Video channel in which the playlist will be published
2446 type: integer
2447 encoding:
2448 thumbnailfile:
2449 contentType: image/jpeg
2450 delete:
2451 summary: Delete a video playlist
2452 security:
2453 - OAuth2: []
2454 tags:
2455 - Video Playlists
2456 parameters:
2457 - $ref: '#/components/parameters/idOrUUID'
2458 responses:
2459 '204':
2460 description: successful operation
2461
2462 /video-playlists/{id}/videos:
2463 get:
2464 summary: 'List videos of a playlist'
2465 tags:
2466 - Videos
2467 - Video Playlists
2468 parameters:
2469 - $ref: '#/components/parameters/idOrUUID'
2470 responses:
2471 '200':
2472 description: successful operation
2473 content:
2474 application/json:
2475 schema:
2476 $ref: '#/components/schemas/VideoListResponse'
2477 post:
2478 summary: 'Add a video in a playlist'
2479 security:
2480 - OAuth2: []
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 type: object
2493 properties:
2494 videoPlaylistElement:
2495 type: object
2496 properties:
2497 id:
2498 type: integer
2499 requestBody:
2500 content:
2501 application/json:
2502 schema:
2503 type: object
2504 properties:
2505 videoId:
2506 type: integer
2507 description: 'Video to add in the playlist'
2508 startTimestamp:
2509 type: integer
2510 description: 'Start the video at this specific timestamp (in seconds)'
2511 stopTimestamp:
2512 type: integer
2513 description: 'Stop the video at this specific timestamp (in seconds)'
2514 required:
2515 - videoId
2516
2517 /video-playlists/{id}/videos/reorder:
2518 post:
2519 summary: 'Reorder a playlist'
2520 security:
2521 - OAuth2: []
2522 tags:
2523 - Video Playlists
2524 parameters:
2525 - $ref: '#/components/parameters/idOrUUID'
2526 responses:
2527 '204':
2528 description: successful operation
2529 requestBody:
2530 content:
2531 application/json:
2532 schema:
2533 type: object
2534 properties:
2535 startPosition:
2536 type: integer
2537 description: 'Start position of the element to reorder'
2538 minimum: 1
2539 insertAfterPosition:
2540 type: integer
2541 description: 'New position for the block to reorder, to add the block before the first element'
2542 minimum: 0
2543 reorderLength:
2544 type: integer
2545 description: 'How many element from `startPosition` to reorder'
2546 minimum: 1
2547 required:
2548 - startPosition
2549 - insertAfterPosition
2550
2551 /video-playlists/{id}/videos/{playlistElementId}:
2552 put:
2553 summary: 'Update a playlist element'
2554 security:
2555 - OAuth2: []
2556 tags:
2557 - Video Playlists
2558 parameters:
2559 - $ref: '#/components/parameters/idOrUUID'
2560 - $ref: '#/components/parameters/playlistElementId'
2561 responses:
2562 '204':
2563 description: successful operation
2564 requestBody:
2565 content:
2566 application/json:
2567 schema:
2568 type: object
2569 properties:
2570 startTimestamp:
2571 type: integer
2572 description: 'Start the video at this specific timestamp (in seconds)'
2573 stopTimestamp:
2574 type: integer
2575 description: 'Stop the video at this specific timestamp (in seconds)'
2576 delete:
2577 summary: 'Delete an element from a playlist'
2578 security:
2579 - OAuth2: []
2580 tags:
2581 - Video Playlists
2582 parameters:
2583 - $ref: '#/components/parameters/idOrUUID'
2584 - $ref: '#/components/parameters/playlistElementId'
2585 responses:
2586 '204':
2587 description: successful operation
2588
2589 '/users/me/video-playlists/videos-exist':
2590 get:
2591 summary: 'Check video exists in my playlists'
2592 security:
2593 - OAuth2: []
2594 tags:
2595 - Video Playlists
2596 parameters:
2597 - name: videoIds
2598 in: query
2599 required: true
2600 description: The video ids to check
2601 schema:
2602 type: array
2603 items:
2604 type: integer
2605 responses:
2606 '200':
2607 description: successful operation
2608 content:
2609 application/json:
2610 schema:
2611 type: object
2612 properties:
2613 videoId:
2614 type: array
2615 items:
2616 type: object
2617 properties:
2618 playlistElementId:
2619 type: integer
2620 playlistId:
2621 type: integer
2622 startTimestamp:
2623 type: integer
2624 stopTimestamp:
2625 type: integer
2626
2627 '/accounts/{name}/video-channels':
2628 get:
2629 summary: List video channels of an account
2630 tags:
2631 - Video Channels
2632 - Accounts
2633 parameters:
2634 - $ref: '#/components/parameters/name'
2635 - name: withStats
2636 in: query
2637 description: include view statistics for the last 30 days (only if authentified as the account user)
2638 schema:
2639 type: boolean
2640 - $ref: '#/components/parameters/start'
2641 - $ref: '#/components/parameters/count'
2642 - $ref: '#/components/parameters/sort'
2643 responses:
2644 '200':
2645 description: successful operation
2646 content:
2647 application/json:
2648 schema:
2649 properties:
2650 total:
2651 type: integer
2652 example: 1
2653 data:
2654 type: array
2655 items:
2656 $ref: '#/components/schemas/VideoChannel'
2657 '/accounts/{name}/ratings':
2658 get:
2659 summary: List ratings of an account
2660 security:
2661 - OAuth2: []
2662 tags:
2663 - Accounts
2664 parameters:
2665 - $ref: '#/components/parameters/name'
2666 - $ref: '#/components/parameters/start'
2667 - $ref: '#/components/parameters/count'
2668 - $ref: '#/components/parameters/sort'
2669 - name: rating
2670 in: query
2671 required: false
2672 description: Optionally filter which ratings to retrieve
2673 schema:
2674 type: string
2675 enum:
2676 - like
2677 - dislike
2678 responses:
2679 '200':
2680 description: successful operation
2681 content:
2682 application/json:
2683 schema:
2684 type: array
2685 items:
2686 $ref: '#/components/schemas/VideoRating'
2687 '/videos/{id}/comment-threads':
2688 get:
2689 summary: List threads of a video
2690 tags:
2691 - Video Comments
2692 parameters:
2693 - $ref: '#/components/parameters/idOrUUID'
2694 - $ref: '#/components/parameters/start'
2695 - $ref: '#/components/parameters/count'
2696 - $ref: '#/components/parameters/commentsSort'
2697 responses:
2698 '200':
2699 description: successful operation
2700 content:
2701 application/json:
2702 schema:
2703 $ref: '#/components/schemas/CommentThreadResponse'
2704 post:
2705 summary: Create a thread
2706 security:
2707 - OAuth2: []
2708 tags:
2709 - Video Comments
2710 parameters:
2711 - $ref: '#/components/parameters/idOrUUID'
2712 responses:
2713 '200':
2714 description: successful operation
2715 content:
2716 application/json:
2717 schema:
2718 $ref: '#/components/schemas/CommentThreadPostResponse'
2719 '404':
2720 description: video does not exist
2721 requestBody:
2722 content:
2723 application/json:
2724 schema:
2725 type: object
2726 properties:
2727 text:
2728 type: string
2729 description: 'Text comment'
2730 required:
2731 - text
2732
2733 '/videos/{id}/comment-threads/{threadId}':
2734 get:
2735 summary: Get a thread
2736 tags:
2737 - Video Comments
2738 parameters:
2739 - $ref: '#/components/parameters/idOrUUID'
2740 - $ref: '#/components/parameters/threadId'
2741 responses:
2742 '200':
2743 description: successful operation
2744 content:
2745 application/json:
2746 schema:
2747 $ref: '#/components/schemas/VideoCommentThreadTree'
2748 '/videos/{id}/comments/{commentId}':
2749 post:
2750 summary: Reply to a thread of a video
2751 security:
2752 - OAuth2: []
2753 tags:
2754 - Video Comments
2755 parameters:
2756 - $ref: '#/components/parameters/idOrUUID'
2757 - $ref: '#/components/parameters/commentId'
2758 responses:
2759 '200':
2760 description: successful operation
2761 content:
2762 application/json:
2763 schema:
2764 $ref: '#/components/schemas/CommentThreadPostResponse'
2765 '404':
2766 description: thread or video does not exist
2767 requestBody:
2768 content:
2769 application/json:
2770 schema:
2771 type: object
2772 properties:
2773 text:
2774 type: string
2775 description: 'Text comment'
2776 required:
2777 - text
2778
2779 delete:
2780 summary: Delete a comment or a reply
2781 security:
2782 - OAuth2: []
2783 tags:
2784 - Video Comments
2785 parameters:
2786 - $ref: '#/components/parameters/idOrUUID'
2787 - $ref: '#/components/parameters/commentId'
2788 responses:
2789 '204':
2790 description: successful operation
2791 '403':
2792 description: cannot remove comment of another user
2793 '404':
2794 description: comment or video does not exist
2795 '409':
2796 description: comment is already deleted
2797 '/videos/{id}/rate':
2798 put:
2799 summary: Like/dislike a video
2800 security:
2801 - OAuth2: []
2802 tags:
2803 - Video Rates
2804 parameters:
2805 - $ref: '#/components/parameters/idOrUUID'
2806 responses:
2807 '204':
2808 description: successful operation
2809 '404':
2810 description: video does not exist
2811 /search/videos:
2812 get:
2813 tags:
2814 - Search
2815 summary: Search videos
2816 parameters:
2817 - name: search
2818 in: query
2819 required: true
2820 allowEmptyValue: false
2821 description: >
2822 String to search. If the user can make a remote URI search, and the string is an URI then the
2823 PeerTube instance will fetch the remote object and add it to its database. Then,
2824 you can use the REST API to fetch the complete video information and interact with it.
2825 schema:
2826 type: string
2827 - $ref: '#/components/parameters/categoryOneOf'
2828 - $ref: '#/components/parameters/tagsOneOf'
2829 - $ref: '#/components/parameters/tagsAllOf'
2830 - $ref: '#/components/parameters/licenceOneOf'
2831 - $ref: '#/components/parameters/languageOneOf'
2832 - $ref: '#/components/parameters/nsfw'
2833 - $ref: '#/components/parameters/filter'
2834 - $ref: '#/components/parameters/skipCount'
2835 - $ref: '#/components/parameters/start'
2836 - $ref: '#/components/parameters/count'
2837 - $ref: '#/components/parameters/searchTarget'
2838 - $ref: '#/components/parameters/videosSearchSort'
2839 - name: startDate
2840 in: query
2841 description: Get videos that are published after this date
2842 schema:
2843 type: string
2844 format: date-time
2845 - name: endDate
2846 in: query
2847 description: Get videos that are published before this date
2848 schema:
2849 type: string
2850 format: date-time
2851 - name: originallyPublishedStartDate
2852 in: query
2853 description: Get videos that are originally published after this date
2854 schema:
2855 type: string
2856 format: date-time
2857 - name: originallyPublishedEndDate
2858 in: query
2859 description: Get videos that are originally published before this date
2860 schema:
2861 type: string
2862 format: date-time
2863 - name: durationMin
2864 in: query
2865 description: Get videos that have this minimum duration
2866 schema:
2867 type: integer
2868 - name: durationMax
2869 in: query
2870 description: Get videos that have this maximum duration
2871 schema:
2872 type: integer
2873 callbacks:
2874 'searchTarget === search-index':
2875 $ref: '#/components/callbacks/searchIndex'
2876 responses:
2877 '200':
2878 description: successful operation
2879 content:
2880 application/json:
2881 schema:
2882 $ref: '#/components/schemas/VideoListResponse'
2883 '500':
2884 description: search index unavailable
2885 /search/video-channels:
2886 get:
2887 tags:
2888 - Search
2889 summary: Search channels
2890 parameters:
2891 - name: search
2892 in: query
2893 required: true
2894 description: >
2895 String to search. If the user can make a remote URI search, and the string is an URI then the
2896 PeerTube instance will fetch the remote object and add it to its database. Then,
2897 you can use the REST API to fetch the complete channel information and interact with it.
2898 schema:
2899 type: string
2900 - $ref: '#/components/parameters/start'
2901 - $ref: '#/components/parameters/count'
2902 - $ref: '#/components/parameters/searchTarget'
2903 - $ref: '#/components/parameters/sort'
2904 callbacks:
2905 'searchTarget === search-index':
2906 $ref: '#/components/callbacks/searchIndex'
2907 responses:
2908 '200':
2909 description: successful operation
2910 content:
2911 application/json:
2912 schema:
2913 type: array
2914 items:
2915 $ref: '#/components/schemas/VideoChannel'
2916 '500':
2917 description: search index unavailable
2918 /blocklist/accounts:
2919 get:
2920 tags:
2921 - Account Blocks
2922 summary: List account blocks
2923 security:
2924 - OAuth2:
2925 - admin
2926 parameters:
2927 - $ref: '#/components/parameters/start'
2928 - $ref: '#/components/parameters/count'
2929 - $ref: '#/components/parameters/sort'
2930 responses:
2931 '200':
2932 description: successful operation
2933 post:
2934 tags:
2935 - Account Blocks
2936 summary: Block an account
2937 security:
2938 - OAuth2:
2939 - admin
2940 requestBody:
2941 content:
2942 application/json:
2943 schema:
2944 type: object
2945 properties:
2946 accountName:
2947 type: string
2948 example: chocobozzz@example.org
2949 description: account to block, in the form `username@domain`
2950 required:
2951 - accountName
2952 responses:
2953 '200':
2954 description: successful operation
2955 '409':
2956 description: self-blocking forbidden
2957 '/blocklist/accounts/{accountName}':
2958 delete:
2959 tags:
2960 - Account Blocks
2961 summary: Unblock an account by its handle
2962 security:
2963 - OAuth2:
2964 - admin
2965 parameters:
2966 - name: accountName
2967 in: path
2968 required: true
2969 description: account to unblock, in the form `username@domain`
2970 schema:
2971 type: string
2972 responses:
2973 '201':
2974 description: successful operation
2975 '404':
2976 description: account or account block does not exist
2977 /blocklist/servers:
2978 get:
2979 tags:
2980 - Server Blocks
2981 summary: List server blocks
2982 security:
2983 - OAuth2:
2984 - admin
2985 parameters:
2986 - $ref: '#/components/parameters/start'
2987 - $ref: '#/components/parameters/count'
2988 - $ref: '#/components/parameters/sort'
2989 responses:
2990 '200':
2991 description: successful operation
2992 post:
2993 tags:
2994 - Server Blocks
2995 summary: Block a server
2996 security:
2997 - OAuth2:
2998 - admin
2999 requestBody:
3000 content:
3001 application/json:
3002 schema:
3003 type: object
3004 properties:
3005 host:
3006 type: string
3007 format: hostname
3008 description: server domain to block
3009 required:
3010 - host
3011 responses:
3012 '200':
3013 description: successful operation
3014 '409':
3015 description: self-blocking forbidden
3016 '/blocklist/servers/{host}':
3017 delete:
3018 tags:
3019 - Server Blocks
3020 summary: Unblock a server by its domain
3021 security:
3022 - OAuth2:
3023 - admin
3024 parameters:
3025 - name: host
3026 in: path
3027 required: true
3028 description: server domain to unblock
3029 schema:
3030 type: string
3031 format: hostname
3032 responses:
3033 '201':
3034 description: successful operation
3035 '404':
3036 description: account block does not exist
3037 /redundancy/{host}:
3038 put:
3039 tags:
3040 - Instance Redundancy
3041 summary: Update a server redundancy policy
3042 security:
3043 - OAuth2:
3044 - admin
3045 parameters:
3046 - name: host
3047 in: path
3048 required: true
3049 description: server domain to mirror
3050 schema:
3051 type: string
3052 format: hostname
3053 requestBody:
3054 content:
3055 application/json:
3056 schema:
3057 type: object
3058 properties:
3059 redundancyAllowed:
3060 type: boolean
3061 description: allow mirroring of the host's local videos
3062 required:
3063 - redundancyAllowed
3064 responses:
3065 '204':
3066 description: successful operation
3067 '404':
3068 description: server is not already known
3069 /redundancy/videos:
3070 get:
3071 tags:
3072 - Video Mirroring
3073 summary: List videos being mirrored
3074 security:
3075 - OAuth2:
3076 - admin
3077 parameters:
3078 - name: target
3079 in: query
3080 required: true
3081 description: direction of the mirror
3082 schema:
3083 type: string
3084 enum:
3085 - my-videos
3086 - remote-videos
3087 - $ref: '#/components/parameters/start'
3088 - $ref: '#/components/parameters/count'
3089 - $ref: '#/components/parameters/videoRedundanciesSort'
3090 responses:
3091 '200':
3092 description: successful operation
3093 content:
3094 application/json:
3095 schema:
3096 type: array
3097 items:
3098 $ref: '#/components/schemas/VideoRedundancy'
3099 post:
3100 tags:
3101 - Video Mirroring
3102 summary: Mirror a video
3103 security:
3104 - OAuth2:
3105 - admin
3106 requestBody:
3107 content:
3108 application/json:
3109 schema:
3110 type: object
3111 properties:
3112 videoId:
3113 type: integer
3114 required:
3115 - videoId
3116 responses:
3117 '204':
3118 description: successful operation
3119 '400':
3120 description: cannot mirror a local video
3121 '404':
3122 description: video does not exist
3123 '409':
3124 description: video is already mirrored
3125 /redundancy/videos/{redundancyId}:
3126 delete:
3127 tags:
3128 - Video Mirroring
3129 summary: Delete a mirror done on a video
3130 security:
3131 - OAuth2:
3132 - admin
3133 parameters:
3134 - name: redundancyId
3135 in: path
3136 required: true
3137 description: id of an existing redundancy on a video
3138 schema:
3139 type: string
3140 responses:
3141 '204':
3142 description: successful operation
3143 '404':
3144 description: video redundancy not found
3145 '/feeds/video-comments.{format}':
3146 get:
3147 tags:
3148 - Feeds
3149 summary: List comments on videos
3150 servers:
3151 - url: 'https://peertube2.cpy.re'
3152 description: Live Test Server (live data - latest nightly version)
3153 - url: 'https://peertube3.cpy.re'
3154 description: Live Test Server (live data - latest RC version)
3155 - url: 'https://peertube.cpy.re'
3156 description: Live Test Server (live data - stable version)
3157 parameters:
3158 - name: format
3159 in: path
3160 required: true
3161 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
3162 schema:
3163 type: string
3164 enum:
3165 - xml
3166 - rss
3167 - rss2
3168 - atom
3169 - atom1
3170 - json
3171 - json1
3172 - name: videoId
3173 in: query
3174 description: 'limit listing to a specific video'
3175 schema:
3176 type: string
3177 - name: accountId
3178 in: query
3179 description: 'limit listing to a specific account'
3180 schema:
3181 type: string
3182 - name: accountName
3183 in: query
3184 description: 'limit listing to a specific account'
3185 schema:
3186 type: string
3187 - name: videoChannelId
3188 in: query
3189 description: 'limit listing to a specific video channel'
3190 schema:
3191 type: string
3192 - name: videoChannelName
3193 in: query
3194 description: 'limit listing to a specific video channel'
3195 schema:
3196 type: string
3197 responses:
3198 '204':
3199 description: successful operation
3200 headers:
3201 Cache-Control:
3202 schema:
3203 type: string
3204 default: 'max-age=900' # 15 min cache
3205 content:
3206 application/xml:
3207 schema:
3208 $ref: '#/components/schemas/VideoCommentsForXML'
3209 application/rss+xml:
3210 schema:
3211 $ref: '#/components/schemas/VideoCommentsForXML'
3212 text/xml:
3213 schema:
3214 $ref: '#/components/schemas/VideoCommentsForXML'
3215 application/atom+xml:
3216 schema:
3217 $ref: '#/components/schemas/VideoCommentsForXML'
3218 application/json:
3219 schema:
3220 type: object
3221 '400':
3222 x-summary: field inconsistencies
3223 description: >
3224 Arises when:
3225 - videoId filter is mixed with a channel filter
3226 '404':
3227 description: video, video channel or account not found
3228 '406':
3229 description: accept header unsupported
3230 '/feeds/videos.{format}':
3231 get:
3232 tags:
3233 - Feeds
3234 summary: List videos
3235 servers:
3236 - url: 'https://peertube2.cpy.re'
3237 description: Live Test Server (live data - latest nightly version)
3238 - url: 'https://peertube3.cpy.re'
3239 description: Live Test Server (live data - latest RC version)
3240 - url: 'https://peertube.cpy.re'
3241 description: Live Test Server (live data - stable version)
3242 parameters:
3243 - name: format
3244 in: path
3245 required: true
3246 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
3247 schema:
3248 type: string
3249 enum:
3250 - xml
3251 - rss
3252 - rss2
3253 - atom
3254 - atom1
3255 - json
3256 - json1
3257 - name: accountId
3258 in: query
3259 description: 'limit listing to a specific account'
3260 schema:
3261 type: string
3262 - name: accountName
3263 in: query
3264 description: 'limit listing to a specific account'
3265 schema:
3266 type: string
3267 - name: videoChannelId
3268 in: query
3269 description: 'limit listing to a specific video channel'
3270 schema:
3271 type: string
3272 - name: videoChannelName
3273 in: query
3274 description: 'limit listing to a specific video channel'
3275 schema:
3276 type: string
3277 - $ref: '#/components/parameters/sort'
3278 - $ref: '#/components/parameters/nsfw'
3279 - $ref: '#/components/parameters/filter'
3280 responses:
3281 '204':
3282 description: successful operation
3283 headers:
3284 Cache-Control:
3285 schema:
3286 type: string
3287 default: 'max-age=900' # 15 min cache
3288 content:
3289 application/xml:
3290 schema:
3291 $ref: '#/components/schemas/VideosForXML'
3292 examples:
3293 nightly:
3294 externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
3295 application/rss+xml:
3296 schema:
3297 $ref: '#/components/schemas/VideosForXML'
3298 text/xml:
3299 schema:
3300 $ref: '#/components/schemas/VideosForXML'
3301 application/atom+xml:
3302 schema:
3303 $ref: '#/components/schemas/VideosForXML'
3304 application/json:
3305 schema:
3306 type: object
3307 '404':
3308 description: video channel or account not found
3309 '406':
3310 description: accept header unsupported
3311 /plugins:
3312 get:
3313 tags:
3314 - Plugins
3315 summary: List plugins
3316 security:
3317 - OAuth2:
3318 - admin
3319 parameters:
3320 - name: pluginType
3321 in: query
3322 schema:
3323 type: integer
3324 - name: uninstalled
3325 in: query
3326 schema:
3327 type: boolean
3328 - $ref: '#/components/parameters/start'
3329 - $ref: '#/components/parameters/count'
3330 - $ref: '#/components/parameters/sort'
3331 responses:
3332 '200':
3333 description: successful operation
3334 content:
3335 application/json:
3336 schema:
3337 $ref: '#/components/schemas/PluginResponse'
3338 /plugins/available:
3339 get:
3340 tags:
3341 - Plugins
3342 summary: List available plugins
3343 security:
3344 - OAuth2:
3345 - admin
3346 parameters:
3347 - name: search
3348 in: query
3349 schema:
3350 type: string
3351 - name: pluginType
3352 in: query
3353 schema:
3354 type: integer
3355 - name: currentPeerTubeEngine
3356 in: query
3357 schema:
3358 type: string
3359 - $ref: '#/components/parameters/start'
3360 - $ref: '#/components/parameters/count'
3361 - $ref: '#/components/parameters/sort'
3362 responses:
3363 '200':
3364 description: successful operation
3365 content:
3366 application/json:
3367 schema:
3368 $ref: '#/components/schemas/PluginResponse'
3369 '503':
3370 description: plugin index unavailable
3371 /plugins/install:
3372 post:
3373 tags:
3374 - Plugins
3375 summary: Install a plugin
3376 security:
3377 - OAuth2:
3378 - admin
3379 requestBody:
3380 content:
3381 application/json:
3382 schema:
3383 oneOf:
3384 - type: object
3385 properties:
3386 npmName:
3387 type: string
3388 example: peertube-plugin-auth-ldap
3389 required:
3390 - npmName
3391 additionalProperties: false
3392 - type: object
3393 properties:
3394 path:
3395 type: string
3396 required:
3397 - path
3398 additionalProperties: false
3399 responses:
3400 '204':
3401 description: successful operation
3402 '400':
3403 description: should have either `npmName` or `path` set
3404 /plugins/update:
3405 post:
3406 tags:
3407 - Plugins
3408 summary: Update a plugin
3409 security:
3410 - OAuth2:
3411 - admin
3412 requestBody:
3413 content:
3414 application/json:
3415 schema:
3416 oneOf:
3417 - type: object
3418 properties:
3419 npmName:
3420 type: string
3421 example: peertube-plugin-auth-ldap
3422 required:
3423 - npmName
3424 additionalProperties: false
3425 - type: object
3426 properties:
3427 path:
3428 type: string
3429 required:
3430 - path
3431 additionalProperties: false
3432 responses:
3433 '204':
3434 description: successful operation
3435 '400':
3436 description: should have either `npmName` or `path` set
3437 '404':
3438 description: existing plugin not found
3439 /plugins/uninstall:
3440 post:
3441 tags:
3442 - Plugins
3443 summary: Uninstall a plugin
3444 security:
3445 - OAuth2:
3446 - admin
3447 requestBody:
3448 content:
3449 application/json:
3450 schema:
3451 type: object
3452 properties:
3453 npmName:
3454 type: string
3455 description: name of the plugin/theme in its package.json
3456 example: peertube-plugin-auth-ldap
3457 required:
3458 - npmName
3459 responses:
3460 '204':
3461 description: successful operation
3462 '404':
3463 description: existing plugin not found
3464 /plugins/{npmName}:
3465 get:
3466 tags:
3467 - Plugins
3468 summary: Get a plugin
3469 security:
3470 - OAuth2:
3471 - admin
3472 parameters:
3473 - $ref: '#/components/parameters/npmName'
3474 responses:
3475 '200':
3476 description: successful operation
3477 content:
3478 application/json:
3479 schema:
3480 $ref: '#/components/schemas/Plugin'
3481 '404':
3482 description: plugin not found
3483 /plugins/{npmName}/settings:
3484 put:
3485 tags:
3486 - Plugins
3487 summary: Set a plugin's settings
3488 security:
3489 - OAuth2:
3490 - admin
3491 parameters:
3492 - $ref: '#/components/parameters/npmName'
3493 requestBody:
3494 content:
3495 application/json:
3496 schema:
3497 type: object
3498 properties:
3499 settings:
3500 type: object
3501 additionalProperties: true
3502 responses:
3503 '204':
3504 description: successful operation
3505 '404':
3506 description: plugin not found
3507 /plugins/{npmName}/public-settings:
3508 get:
3509 tags:
3510 - Plugins
3511 summary: Get a plugin's public settings
3512 parameters:
3513 - $ref: '#/components/parameters/npmName'
3514 responses:
3515 '200':
3516 description: successful operation
3517 content:
3518 application/json:
3519 schema:
3520 type: object
3521 additionalProperties: true
3522 '404':
3523 description: plugin not found
3524 /plugins/{npmName}/registered-settings:
3525 get:
3526 tags:
3527 - Plugins
3528 summary: Get a plugin's registered settings
3529 security:
3530 - OAuth2:
3531 - admin
3532 parameters:
3533 - $ref: '#/components/parameters/npmName'
3534 responses:
3535 '200':
3536 description: successful operation
3537 content:
3538 application/json:
3539 schema:
3540 type: object
3541 additionalProperties: true
3542 '404':
3543 description: plugin not found
3544 servers:
3545 - url: 'https://peertube2.cpy.re/api/v1'
3546 description: Live Test Server (live data - latest nightly version)
3547 - url: 'https://peertube3.cpy.re/api/v1'
3548 description: Live Test Server (live data - latest RC version)
3549 - url: 'https://peertube.cpy.re/api/v1'
3550 description: Live Test Server (live data - stable version)
3551 components:
3552 parameters:
3553 start:
3554 name: start
3555 in: query
3556 required: false
3557 description: Offset used to paginate results
3558 schema:
3559 type: integer
3560 minimum: 0
3561 count:
3562 name: count
3563 in: query
3564 required: false
3565 description: "Number of items to return"
3566 schema:
3567 type: integer
3568 default: 15
3569 maximum: 100
3570 minimum: 1
3571 sort:
3572 name: sort
3573 in: query
3574 required: false
3575 description: Sort column
3576 schema:
3577 type: string
3578 example: -createdAt
3579 search:
3580 name: search
3581 in: query
3582 required: false
3583 description: Plain text search, applied to various parts of the model depending on endpoint
3584 schema:
3585 type: string
3586 searchTarget:
3587 name: searchTarget
3588 in: query
3589 required: false
3590 description: >
3591 If the administrator enabled search index support, you can override the default search target.
3592
3593
3594 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
3595 It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
3596 * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
3597 then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
3598 After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
3599 * 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
3600 the data from the origin instance API
3601 schema:
3602 type: string
3603 enum:
3604 - 'local'
3605 - 'search-index'
3606 videosSort:
3607 name: sort
3608 in: query
3609 required: false
3610 description: Sort videos by criteria
3611 schema:
3612 type: string
3613 enum:
3614 - name
3615 - -duration
3616 - -createdAt
3617 - -publishedAt
3618 - -views
3619 - -likes
3620 - -trending
3621 - -hot
3622 videosSearchSort:
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 - -match
3637 commentsSort:
3638 name: sort
3639 in: query
3640 required: false
3641 description: Sort comments by criteria
3642 schema:
3643 type: string
3644 enum:
3645 - -createdAt
3646 - -totalReplies
3647 blacklistsSort:
3648 name: sort
3649 in: query
3650 required: false
3651 description: Sort blacklists by criteria
3652 schema:
3653 type: string
3654 enum:
3655 - -id
3656 - name
3657 - -duration
3658 - -views
3659 - -likes
3660 - -dislikes
3661 - -uuid
3662 - -createdAt
3663 usersSearch:
3664 name: search
3665 in: query
3666 required: false
3667 description: Plain text search that will match with user usernames or emails
3668 schema:
3669 type: string
3670 usersBlocked:
3671 name: blocked
3672 in: query
3673 required: false
3674 description: Filter results down to (un)banned users
3675 schema:
3676 type: boolean
3677 usersSort:
3678 name: sort
3679 in: query
3680 required: false
3681 description: Sort users by criteria
3682 schema:
3683 type: string
3684 enum:
3685 - -id
3686 - -username
3687 - -createdAt
3688 abusesSort:
3689 name: sort
3690 in: query
3691 required: false
3692 description: Sort abuses by criteria
3693 schema:
3694 type: string
3695 enum:
3696 - -id
3697 - -createdAt
3698 - -state
3699 videoRedundanciesSort:
3700 name: sort
3701 in: query
3702 required: false
3703 description: Sort abuses by criteria
3704 schema:
3705 type: string
3706 enum:
3707 - name
3708 name:
3709 name: name
3710 in: path
3711 required: true
3712 description: The username or handle of the account
3713 schema:
3714 type: string
3715 example: chocobozzz | chocobozzz@example.org
3716 id:
3717 name: id
3718 in: path
3719 required: true
3720 description: The user id
3721 schema:
3722 type: integer
3723 minimum: 0
3724 example: 42
3725 idOrUUID:
3726 name: id
3727 in: path
3728 required: true
3729 description: The object id or uuid
3730 schema:
3731 oneOf:
3732 - type: integer
3733 minimum: 0
3734 example: 42
3735 - type: string
3736 format: uuid
3737 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
3738 playlistElementId:
3739 name: playlistElementId
3740 in: path
3741 required: true
3742 description: Playlist element id
3743 schema:
3744 type: integer
3745 abuseId:
3746 name: abuseId
3747 in: path
3748 required: true
3749 description: Abuse id
3750 schema:
3751 type: integer
3752 abuseMessageId:
3753 name: abuseMessageId
3754 in: path
3755 required: true
3756 description: Abuse message id
3757 schema:
3758 type: integer
3759 captionLanguage:
3760 name: captionLanguage
3761 in: path
3762 required: true
3763 description: The caption language
3764 schema:
3765 type: string
3766 channelHandle:
3767 name: channelHandle
3768 in: path
3769 required: true
3770 description: The video channel handle
3771 schema:
3772 type: string
3773 example: my_username | my_username@example.com
3774 subscriptionHandle:
3775 name: subscriptionHandle
3776 in: path
3777 required: true
3778 description: The subscription handle
3779 schema:
3780 type: string
3781 example: my_username | my_username@example.com
3782 threadId:
3783 name: threadId
3784 in: path
3785 required: true
3786 description: The thread id (root comment id)
3787 schema:
3788 type: integer
3789 commentId:
3790 name: commentId
3791 in: path
3792 required: true
3793 description: The comment id
3794 schema:
3795 type: integer
3796 categoryOneOf:
3797 name: categoryOneOf
3798 in: query
3799 required: false
3800 description: category id of the video (see [/videos/categories](#tag/Video/paths/~1videos~1categories/get))
3801 schema:
3802 oneOf:
3803 - type: integer
3804 - type: array
3805 items:
3806 type: integer
3807 style: form
3808 explode: false
3809 tagsOneOf:
3810 name: tagsOneOf
3811 in: query
3812 required: false
3813 description: tag(s) of the video
3814 schema:
3815 oneOf:
3816 - type: string
3817 - type: array
3818 items:
3819 type: string
3820 style: form
3821 explode: false
3822 tagsAllOf:
3823 name: tagsAllOf
3824 in: query
3825 required: false
3826 description: tag(s) of the video, where all should be present in the video
3827 schema:
3828 oneOf:
3829 - type: string
3830 - type: array
3831 items:
3832 type: string
3833 style: form
3834 explode: false
3835 languageOneOf:
3836 name: languageOneOf
3837 in: query
3838 required: false
3839 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
3840 schema:
3841 oneOf:
3842 - type: string
3843 - type: array
3844 items:
3845 type: string
3846 style: form
3847 explode: false
3848 licenceOneOf:
3849 name: licenceOneOf
3850 in: query
3851 required: false
3852 description: licence id of the video (see [/videos/licences](#tag/Video/paths/~1videos~1licences/get))
3853 schema:
3854 oneOf:
3855 - type: integer
3856 - type: array
3857 items:
3858 type: integer
3859 style: form
3860 explode: false
3861 skipCount:
3862 name: skipCount
3863 in: query
3864 required: false
3865 description: if you don't need the `total` in the response
3866 schema:
3867 type: string
3868 enum:
3869 - 'true'
3870 - 'false'
3871 default: 'false'
3872 nsfw:
3873 name: nsfw
3874 in: query
3875 required: false
3876 description: whether to include nsfw videos, if any
3877 schema:
3878 type: string
3879 enum:
3880 - 'true'
3881 - 'false'
3882 filter:
3883 name: filter
3884 in: query
3885 required: false
3886 description: >
3887 Special filters which might require special rights:
3888 * `local` - only videos local to the instance
3889 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
3890 * `all` - all videos, showing private and unlisted videos (requires Admin privileges)
3891 schema:
3892 type: string
3893 enum:
3894 - local
3895 - all-local
3896 subscriptionsUris:
3897 name: uris
3898 in: query
3899 required: true
3900 description: list of uris to check if each is part of the user subscriptions
3901 schema:
3902 type: array
3903 items:
3904 type: string
3905 format: uri
3906 npmName:
3907 name: npmName
3908 in: path
3909 required: true
3910 description: name of the plugin/theme on npmjs.com or in its package.json
3911 schema:
3912 type: string
3913 example: peertube-plugin-auth-ldap
3914 jobType:
3915 name: jobType
3916 in: query
3917 required: false
3918 description: job type
3919 schema:
3920 type: string
3921 enum:
3922 - activitypub-follow
3923 - activitypub-http-broadcast
3924 - activitypub-http-fetcher
3925 - activitypub-http-unicast
3926 - email
3927 - video-transcoding
3928 - video-file-import
3929 - video-import
3930 - videos-views
3931 - activitypub-refresher
3932 - video-redundancy
3933 - video-live-ending
3934 securitySchemes:
3935 OAuth2:
3936 description: >
3937 In the header: *Authorization: Bearer <token\>*
3938
3939
3940 Authenticating via OAuth requires the following steps:
3941
3942
3943 - Have an account with sufficient authorization levels
3944
3945 - [Generate](https://docs.joinpeertube.org/api-rest-getting-started) a
3946 Bearer Token
3947
3948 - Make Authenticated Requests
3949 type: oauth2
3950 flows:
3951 password:
3952 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
3953 scopes:
3954 admin: Admin scope
3955 moderator: Moderator scope
3956 user: User scope
3957 schemas:
3958 VideoConstantNumber:
3959 properties:
3960 id:
3961 type: integer
3962 label:
3963 type: string
3964 VideoConstantString:
3965 properties:
3966 id:
3967 type: string
3968 label:
3969 type: string
3970
3971 VideoPlaylistPrivacySet:
3972 type: integer
3973 enum:
3974 - 1
3975 - 2
3976 - 3
3977 description: 'The video playlist privacy (Public = `1`, Unlisted = `2`, Private = `3`)'
3978 VideoPlaylistPrivacyConstant:
3979 properties:
3980 id:
3981 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
3982 label:
3983 type: string
3984
3985 VideoPlaylistTypeSet:
3986 type: integer
3987 enum:
3988 - 1
3989 - 2
3990 description: 'The video playlist type (Regular = `1`, Watch Later = `2`)'
3991 VideoPlaylistTypeConstant:
3992 properties:
3993 id:
3994 $ref: '#/components/schemas/VideoPlaylistTypeSet'
3995 label:
3996 type: string
3997
3998 VideoPrivacySet:
3999 type: integer
4000 enum:
4001 - 1
4002 - 2
4003 - 3
4004 - 4
4005 description: 'The video privacy (Public = `1`, Unlisted = `2`, Private = `3`, Internal = `4`)'
4006 VideoPrivacyConstant:
4007 properties:
4008 id:
4009 $ref: '#/components/schemas/VideoPrivacySet'
4010 label:
4011 type: string
4012
4013 NSFWPolicy:
4014 type: string
4015 enum:
4016 - display
4017 - blur
4018 - do_not_list
4019
4020 UserRole:
4021 type: integer
4022 enum:
4023 - 0
4024 - 1
4025 - 2
4026 description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
4027 example: 2
4028 UserAdminFlags:
4029 type: integer
4030 enum:
4031 - 0
4032 - 1
4033 description: 'Admin flags for the user (None = `0`, Bypass video blacklist = `1`)'
4034 example: 1
4035
4036 VideoStateConstant:
4037 properties:
4038 id:
4039 type: integer
4040 enum:
4041 - 1
4042 - 2
4043 - 3
4044 description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
4045 label:
4046 type: string
4047
4048 AbuseStateSet:
4049 type: integer
4050 enum:
4051 - 1
4052 - 2
4053 - 3
4054 description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)'
4055 AbuseStateConstant:
4056 properties:
4057 id:
4058 $ref: '#/components/schemas/AbuseStateSet'
4059 label:
4060 type: string
4061 AbusePredefinedReasons:
4062 type: array
4063 items:
4064 type: string
4065 enum:
4066 - violentOrAbusive
4067 - hatefulOrAbusive
4068 - spamOrMisleading
4069 - privacy
4070 - rights
4071 - serverRules
4072 - thumbnails
4073 - captions
4074 example: [spamOrMisleading]
4075
4076 VideoResolutionConstant:
4077 properties:
4078 id:
4079 type: integer
4080 description: 'Video resolution (240, 360, 720, 1080, 1440 or 2160)'
4081 example: 240
4082 label:
4083 type: string
4084 example: 240p
4085 VideoScheduledUpdate:
4086 properties:
4087 privacy:
4088 $ref: '#/components/schemas/VideoPrivacySet'
4089 updateAt:
4090 type: string
4091 format: date
4092 description: When to update the video
4093 required:
4094 - updateAt
4095 AccountSummary:
4096 properties:
4097 id:
4098 type: integer
4099 name:
4100 type: string
4101 displayName:
4102 type: string
4103 url:
4104 type: string
4105 format: url
4106 host:
4107 type: string
4108 format: hostname
4109 avatar:
4110 nullable: true
4111 allOf:
4112 - $ref: '#/components/schemas/ActorImage'
4113 VideoChannelSummary:
4114 properties:
4115 id:
4116 type: integer
4117 name:
4118 type: string
4119 displayName:
4120 type: string
4121 url:
4122 type: string
4123 format: url
4124 host:
4125 type: string
4126 format: hostname
4127 avatar:
4128 nullable: true
4129 allOf:
4130 - $ref: '#/components/schemas/ActorImage'
4131 PlaylistElement:
4132 properties:
4133 position:
4134 type: integer
4135 startTimestamp:
4136 type: integer
4137 stopTimestamp:
4138 type: integer
4139 video:
4140 nullable: true
4141 allOf:
4142 - $ref: '#/components/schemas/Video'
4143 VideoFile:
4144 properties:
4145 magnetUri:
4146 type: string
4147 resolution:
4148 $ref: '#/components/schemas/VideoResolutionConstant'
4149 size:
4150 type: integer
4151 description: 'Video file size in bytes'
4152 torrentUrl:
4153 type: string
4154 format: url
4155 torrentDownloadUrl:
4156 type: string
4157 format: url
4158 fileUrl:
4159 type: string
4160 format: url
4161 fileDownloadUrl:
4162 type: string
4163 format: url
4164 fps:
4165 type: number
4166 metadataUrl:
4167 type: string
4168 format: url
4169 VideoStreamingPlaylists:
4170 properties:
4171 id:
4172 type: integer
4173 type:
4174 type: integer
4175 enum:
4176 - 1
4177 description: 'Playlist type (HLS = `1`)'
4178 playlistUrl:
4179 type: string
4180 format: url
4181 segmentsSha256Url:
4182 type: string
4183 format: url
4184 files:
4185 type: array
4186 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)'
4187 items:
4188 $ref: '#/components/schemas/VideoFile'
4189 redundancies:
4190 type: array
4191 items:
4192 type: object
4193 properties:
4194 baseUrl:
4195 type: string
4196 format: url
4197 VideoInfo:
4198 properties:
4199 id:
4200 type: integer
4201 uuid:
4202 type: string
4203 format: uuid
4204 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4205 name:
4206 type: string
4207 Video:
4208 properties:
4209 id:
4210 type: integer
4211 example: 8
4212 uuid:
4213 type: string
4214 format: uuid
4215 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4216 isLive:
4217 type: boolean
4218 createdAt:
4219 type: string
4220 format: date-time
4221 publishedAt:
4222 type: string
4223 format: date-time
4224 updatedAt:
4225 type: string
4226 format: date-time
4227 originallyPublishedAt:
4228 type: string
4229 format: date-time
4230 category:
4231 $ref: '#/components/schemas/VideoConstantNumber'
4232 licence:
4233 $ref: '#/components/schemas/VideoConstantNumber'
4234 language:
4235 $ref: '#/components/schemas/VideoConstantString'
4236 privacy:
4237 $ref: '#/components/schemas/VideoPrivacyConstant'
4238 description:
4239 type: string
4240 duration:
4241 type: integer
4242 example: 1419
4243 isLocal:
4244 type: boolean
4245 name:
4246 type: string
4247 example: What is PeerTube?
4248 thumbnailPath:
4249 type: string
4250 example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
4251 previewPath:
4252 type: string
4253 example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
4254 embedPath:
4255 type: string
4256 example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
4257 views:
4258 type: integer
4259 example: 1337
4260 likes:
4261 type: integer
4262 example: 42
4263 dislikes:
4264 type: integer
4265 example: 7
4266 nsfw:
4267 type: boolean
4268 waitTranscoding:
4269 type: boolean
4270 nullable: true
4271 state:
4272 $ref: '#/components/schemas/VideoStateConstant'
4273 scheduledUpdate:
4274 nullable: true
4275 allOf:
4276 - $ref: '#/components/schemas/VideoScheduledUpdate'
4277 blacklisted:
4278 nullable: true
4279 type: boolean
4280 blacklistedReason:
4281 nullable: true
4282 type: string
4283 account:
4284 $ref: '#/components/schemas/AccountSummary'
4285 channel:
4286 $ref: '#/components/schemas/VideoChannelSummary'
4287 userHistory:
4288 nullable: true
4289 type: object
4290 properties:
4291 currentTime:
4292 type: integer
4293 VideoDetails:
4294 allOf:
4295 - $ref: '#/components/schemas/Video'
4296 - type: object
4297 properties:
4298 descriptionPath:
4299 type: string
4300 support:
4301 type: string
4302 description: A text tell the audience how to support the video creator
4303 example: Please support my work on <insert crowdfunding plateform>! <3
4304 channel:
4305 $ref: '#/components/schemas/VideoChannel'
4306 account:
4307 $ref: '#/components/schemas/Account'
4308 tags:
4309 type: array
4310 items:
4311 type: string
4312 example: [flowers, gardening]
4313 files:
4314 type: array
4315 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'
4316 items:
4317 $ref: '#/components/schemas/VideoFile'
4318 commentsEnabled:
4319 type: boolean
4320 downloadEnabled:
4321 type: boolean
4322 trackerUrls:
4323 type: array
4324 items:
4325 type: string
4326 format: url
4327 streamingPlaylists:
4328 type: array
4329 items:
4330 $ref: '#/components/schemas/VideoStreamingPlaylists'
4331 FileRedundancyInformation:
4332 properties:
4333 id:
4334 type: integer
4335 fileUrl:
4336 type: string
4337 format: url
4338 strategy:
4339 type: string
4340 enum:
4341 - manual
4342 - most-views
4343 - trending
4344 - recently-added
4345 size:
4346 type: integer
4347 createdAt:
4348 type: string
4349 format: date-time
4350 updatedAt:
4351 type: string
4352 format: date-time
4353 expiresOn:
4354 type: string
4355 format: date-time
4356 VideoRedundancy:
4357 properties:
4358 id:
4359 type: integer
4360 name:
4361 type: string
4362 url:
4363 type: string
4364 format: url
4365 uuid:
4366 type: string
4367 format: uuid
4368 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4369 redundancies:
4370 type: object
4371 properties:
4372 files:
4373 type: array
4374 items:
4375 $ref: '#/components/schemas/FileRedundancyInformation'
4376 streamingPlaylists:
4377 type: array
4378 items:
4379 $ref: '#/components/schemas/FileRedundancyInformation'
4380 VideoImportStateConstant:
4381 properties:
4382 id:
4383 type: integer
4384 enum:
4385 - 1
4386 - 2
4387 - 3
4388 description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
4389 label:
4390 type: string
4391 example: Pending
4392 VideoImport:
4393 properties:
4394 id:
4395 type: integer
4396 example: 2
4397 targetUrl:
4398 type: string
4399 format: url
4400 example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
4401 magnetUri:
4402 type: string
4403 format: uri
4404 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
4405 torrentName:
4406 type: string
4407 state:
4408 $ref: '#/components/schemas/VideoImportStateConstant'
4409 error:
4410 type: string
4411 createdAt:
4412 type: string
4413 format: date-time
4414 updatedAt:
4415 type: string
4416 format: date-time
4417 video:
4418 $ref: '#/components/schemas/Video'
4419 Abuse:
4420 properties:
4421 id:
4422 type: integer
4423 example: 7
4424 reason:
4425 type: string
4426 example: The video is a spam
4427 predefinedReasons:
4428 $ref: '#/components/schemas/AbusePredefinedReasons'
4429 reporterAccount:
4430 $ref: '#/components/schemas/Account'
4431 state:
4432 $ref: '#/components/schemas/AbuseStateConstant'
4433 moderationComment:
4434 type: string
4435 example: Decided to ban the server since it spams us regularly
4436 video:
4437 type: object
4438 properties:
4439 id:
4440 type: integer
4441 name:
4442 type: string
4443 uuid:
4444 type: string
4445 format: uuid
4446 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4447 createdAt:
4448 type: string
4449 format: date-time
4450 AbuseMessage:
4451 properties:
4452 id:
4453 type: integer
4454 message:
4455 type: string
4456 byModerator:
4457 type: boolean
4458 createdAt:
4459 type: string
4460 format: date-time
4461 account:
4462 $ref: '#/components/schemas/AccountSummary'
4463 VideoBlacklist:
4464 properties:
4465 id:
4466 type: integer
4467 videoId:
4468 type: integer
4469 createdAt:
4470 type: string
4471 format: date-time
4472 updatedAt:
4473 type: string
4474 format: date-time
4475 name:
4476 type: string
4477 uuid:
4478 type: string
4479 format: uuid
4480 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4481 description:
4482 type: string
4483 duration:
4484 type: integer
4485 views:
4486 type: integer
4487 likes:
4488 type: integer
4489 dislikes:
4490 type: integer
4491 nsfw:
4492 type: boolean
4493 VideoChannel:
4494 properties:
4495 displayName:
4496 type: string
4497 description:
4498 type: string
4499 isLocal:
4500 type: boolean
4501 ownerAccount:
4502 type: object
4503 properties:
4504 id:
4505 type: integer
4506 uuid:
4507 type: string
4508 format: uuid
4509 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4510 VideoPlaylist:
4511 properties:
4512 id:
4513 type: integer
4514 createdAt:
4515 type: string
4516 format: date-time
4517 updatedAt:
4518 type: string
4519 format: date-time
4520 description:
4521 type: string
4522 uuid:
4523 type: string
4524 format: uuid
4525 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4526 displayName:
4527 type: string
4528 isLocal:
4529 type: boolean
4530 videoLength:
4531 type: integer
4532 thumbnailPath:
4533 type: string
4534 privacy:
4535 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
4536 type:
4537 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
4538 ownerAccount:
4539 $ref: '#/components/schemas/AccountSummary'
4540 videoChannel:
4541 $ref: '#/components/schemas/VideoChannelSummary'
4542 VideoComment:
4543 properties:
4544 id:
4545 type: integer
4546 url:
4547 type: string
4548 format: url
4549 text:
4550 type: string
4551 threadId:
4552 type: integer
4553 inReplyToCommentId:
4554 type: integer
4555 videoId:
4556 type: integer
4557 createdAt:
4558 type: string
4559 format: date-time
4560 updatedAt:
4561 type: string
4562 format: date-time
4563 totalRepliesFromVideoAuthor:
4564 type: integer
4565 totalReplies:
4566 type: integer
4567 account:
4568 $ref: '#/components/schemas/Account'
4569 VideoCommentThreadTree:
4570 properties:
4571 comment:
4572 $ref: '#/components/schemas/VideoComment'
4573 children:
4574 type: array
4575 items:
4576 $ref: '#/components/schemas/VideoCommentThreadTree'
4577 VideoCaption:
4578 properties:
4579 language:
4580 $ref: '#/components/schemas/VideoConstantString'
4581 captionPath:
4582 type: string
4583 ActorImage:
4584 properties:
4585 path:
4586 type: string
4587 createdAt:
4588 type: string
4589 format: date-time
4590 updatedAt:
4591 type: string
4592 format: date-time
4593 ActorInfo:
4594 properties:
4595 id:
4596 type: integer
4597 example: 11
4598 name:
4599 type: string
4600 displayName:
4601 type: string
4602 host:
4603 type: string
4604 format: hostname
4605 avatar:
4606 nullable: true
4607 type: object
4608 properties:
4609 path:
4610 type: string
4611 Actor:
4612 properties:
4613 id:
4614 type: integer
4615 example: 11
4616 url:
4617 type: string
4618 format: url
4619 name:
4620 type: string
4621 host:
4622 type: string
4623 format: hostname
4624 followingCount:
4625 type: integer
4626 followersCount:
4627 type: integer
4628 createdAt:
4629 type: string
4630 format: date-time
4631 updatedAt:
4632 type: string
4633 format: date-time
4634 avatar:
4635 $ref: '#/components/schemas/ActorImage'
4636 Account:
4637 allOf:
4638 - $ref: '#/components/schemas/Actor'
4639 - properties:
4640 userId:
4641 type: string
4642 example: 2
4643 displayName:
4644 type: string
4645 description:
4646 type: string
4647 UserWatchingVideo:
4648 properties:
4649 currentTime:
4650 type: integer
4651 description: timestamp within the video, in seconds
4652 example: 5
4653 ServerConfig:
4654 properties:
4655 instance:
4656 type: object
4657 properties:
4658 name:
4659 type: string
4660 shortDescription:
4661 type: string
4662 defaultClientRoute:
4663 type: string
4664 isNSFW:
4665 type: boolean
4666 defaultNSFWPolicy:
4667 type: string
4668 customizations:
4669 type: object
4670 properties:
4671 javascript:
4672 type: string
4673 css:
4674 type: string
4675 search:
4676 type: object
4677 properties:
4678 remoteUri:
4679 type: object
4680 properties:
4681 users:
4682 type: boolean
4683 anonymous:
4684 type: boolean
4685 plugin:
4686 type: object
4687 properties:
4688 registered:
4689 type: array
4690 items:
4691 type: string
4692 theme:
4693 type: object
4694 properties:
4695 registered:
4696 type: array
4697 items:
4698 type: string
4699 email:
4700 type: object
4701 properties:
4702 enabled:
4703 type: boolean
4704 contactForm:
4705 type: object
4706 properties:
4707 enabled:
4708 type: boolean
4709 serverVersion:
4710 type: string
4711 serverCommit:
4712 type: string
4713 signup:
4714 type: object
4715 properties:
4716 allowed:
4717 type: boolean
4718 allowedForCurrentIP:
4719 type: boolean
4720 requiresEmailVerification:
4721 type: boolean
4722 transcoding:
4723 type: object
4724 properties:
4725 hls:
4726 type: object
4727 properties:
4728 enabled:
4729 type: boolean
4730 webtorrent:
4731 type: object
4732 properties:
4733 enabled:
4734 type: boolean
4735 enabledResolutions:
4736 type: array
4737 items:
4738 type: integer
4739 import:
4740 type: object
4741 properties:
4742 videos:
4743 type: object
4744 properties:
4745 http:
4746 type: object
4747 properties:
4748 enabled:
4749 type: boolean
4750 torrent:
4751 type: object
4752 properties:
4753 enabled:
4754 type: boolean
4755 autoBlacklist:
4756 type: object
4757 properties:
4758 videos:
4759 type: object
4760 properties:
4761 ofUsers:
4762 type: object
4763 properties:
4764 enabled:
4765 type: boolean
4766 avatar:
4767 type: object
4768 properties:
4769 file:
4770 type: object
4771 properties:
4772 size:
4773 type: object
4774 properties:
4775 max:
4776 type: integer
4777 extensions:
4778 type: array
4779 items:
4780 type: string
4781 video:
4782 type: object
4783 properties:
4784 image:
4785 type: object
4786 properties:
4787 extensions:
4788 type: array
4789 items:
4790 type: string
4791 size:
4792 type: object
4793 properties:
4794 max:
4795 type: integer
4796 file:
4797 type: object
4798 properties:
4799 extensions:
4800 type: array
4801 items:
4802 type: string
4803 videoCaption:
4804 type: object
4805 properties:
4806 file:
4807 type: object
4808 properties:
4809 size:
4810 type: object
4811 properties:
4812 max:
4813 type: integer
4814 extensions:
4815 type: array
4816 items:
4817 type: string
4818 user:
4819 type: object
4820 properties:
4821 videoQuota:
4822 type: integer
4823 videoQuotaDaily:
4824 type: integer
4825 trending:
4826 type: object
4827 properties:
4828 videos:
4829 type: object
4830 properties:
4831 intervalDays:
4832 type: integer
4833 tracker:
4834 type: object
4835 properties:
4836 enabled:
4837 type: boolean
4838 followings:
4839 type: object
4840 properties:
4841 instance:
4842 type: object
4843 properties:
4844 autoFollowIndex:
4845 type: object
4846 properties:
4847 indexUrl:
4848 type: string
4849 format: url
4850 ServerConfigAbout:
4851 properties:
4852 instance:
4853 type: object
4854 properties:
4855 name:
4856 type: string
4857 shortDescription:
4858 type: string
4859 description:
4860 type: string
4861 terms:
4862 type: string
4863 ServerConfigCustom:
4864 properties:
4865 instance:
4866 type: object
4867 properties:
4868 name:
4869 type: string
4870 shortDescription:
4871 type: string
4872 description:
4873 type: string
4874 terms:
4875 type: string
4876 defaultClientRoute:
4877 type: string
4878 isNSFW:
4879 type: boolean
4880 defaultNSFWPolicy:
4881 type: string
4882 customizations:
4883 type: object
4884 properties:
4885 javascript:
4886 type: string
4887 css:
4888 type: string
4889 theme:
4890 type: object
4891 properties:
4892 default:
4893 type: string
4894 services:
4895 type: object
4896 properties:
4897 twitter:
4898 type: object
4899 properties:
4900 username:
4901 type: string
4902 whitelisted:
4903 type: boolean
4904 cache:
4905 type: object
4906 properties:
4907 previews:
4908 type: object
4909 properties:
4910 size:
4911 type: integer
4912 captions:
4913 type: object
4914 properties:
4915 size:
4916 type: integer
4917 signup:
4918 type: object
4919 properties:
4920 enabled:
4921 type: boolean
4922 limit:
4923 type: integer
4924 requiresEmailVerification:
4925 type: boolean
4926 admin:
4927 type: object
4928 properties:
4929 email:
4930 type: string
4931 format: email
4932 contactForm:
4933 type: object
4934 properties:
4935 enabled:
4936 type: boolean
4937 user:
4938 type: object
4939 properties:
4940 videoQuota:
4941 type: integer
4942 videoQuotaDaily:
4943 type: integer
4944 transcoding:
4945 type: object
4946 properties:
4947 enabled:
4948 type: boolean
4949 allowAdditionalExtensions:
4950 type: boolean
4951 allowAudioFiles:
4952 type: boolean
4953 threads:
4954 type: integer
4955 resolutions:
4956 type: object
4957 properties:
4958 240p:
4959 type: boolean
4960 360p:
4961 type: boolean
4962 480p:
4963 type: boolean
4964 720p:
4965 type: boolean
4966 1080p:
4967 type: boolean
4968 1440p:
4969 type: boolean
4970 2160p:
4971 type: boolean
4972 hls:
4973 type: object
4974 properties:
4975 enabled:
4976 type: boolean
4977 import:
4978 type: object
4979 properties:
4980 videos:
4981 type: object
4982 properties:
4983 http:
4984 type: object
4985 properties:
4986 enabled:
4987 type: boolean
4988 torrent:
4989 type: object
4990 properties:
4991 enabled:
4992 type: boolean
4993 autoBlacklist:
4994 type: object
4995 properties:
4996 videos:
4997 type: object
4998 properties:
4999 ofUsers:
5000 type: object
5001 properties:
5002 enabled:
5003 type: boolean
5004 followers:
5005 type: object
5006 properties:
5007 instance:
5008 type: object
5009 properties:
5010 enabled:
5011 type: boolean
5012 manualApproval:
5013 type: boolean
5014 Follow:
5015 properties:
5016 id:
5017 type: integer
5018 follower:
5019 $ref: '#/components/schemas/Actor'
5020 following:
5021 $ref: '#/components/schemas/Actor'
5022 score:
5023 type: number
5024 description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
5025 state:
5026 type: string
5027 enum:
5028 - pending
5029 - accepted
5030 createdAt:
5031 type: string
5032 format: date-time
5033 updatedAt:
5034 type: string
5035 format: date-time
5036
5037 PredefinedAbuseReasons:
5038 description: Reason categories that help triage reports
5039 type: array
5040 items:
5041 type: string
5042 enum:
5043 - violentOrAbusive
5044 - hatefulOrAbusive
5045 - spamOrMisleading
5046 - privacy
5047 - rights
5048 - serverRules
5049 - thumbnails
5050 - captions
5051
5052 Job:
5053 properties:
5054 id:
5055 type: integer
5056 minimum: 0
5057 example: 42
5058 state:
5059 type: string
5060 enum:
5061 - active
5062 - completed
5063 - failed
5064 - waiting
5065 - delayed
5066 type:
5067 type: string
5068 enum:
5069 - activitypub-http-unicast
5070 - activitypub-http-broadcast
5071 - activitypub-http-fetcher
5072 - activitypub-follow
5073 - video-file-import
5074 - video-transcoding
5075 - email
5076 - video-import
5077 - videos-views
5078 - activitypub-refresher
5079 - video-redundancy
5080 data:
5081 type: object
5082 additionalProperties: true
5083 error:
5084 type: object
5085 additionalProperties: true
5086 createdAt:
5087 type: string
5088 format: date-time
5089 finishedOn:
5090 type: string
5091 format: date-time
5092 processedOn:
5093 type: string
5094 format: date-time
5095 AddUserResponse:
5096 properties:
5097 user:
5098 type: object
5099 properties:
5100 id:
5101 type: integer
5102 example: 8
5103 account:
5104 type: object
5105 properties:
5106 id:
5107 type: integer
5108 example: 37
5109 VideoUploadResponse:
5110 properties:
5111 video:
5112 type: object
5113 properties:
5114 id:
5115 type: integer
5116 example: 8
5117 uuid:
5118 type: string
5119 format: uuid
5120 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
5121 CommentThreadResponse:
5122 properties:
5123 total:
5124 type: integer
5125 example: 1
5126 data:
5127 type: array
5128 maxItems: 100
5129 items:
5130 $ref: '#/components/schemas/VideoComment'
5131 CommentThreadPostResponse:
5132 properties:
5133 comment:
5134 $ref: '#/components/schemas/VideoComment'
5135 VideoListResponse:
5136 properties:
5137 total:
5138 type: integer
5139 example: 1
5140 data:
5141 type: array
5142 maxItems: 100
5143 items:
5144 $ref: '#/components/schemas/Video'
5145 User:
5146 properties:
5147 id:
5148 type: integer
5149 readOnly: true
5150 username:
5151 type: string
5152 description: The user username
5153 minLength: 1
5154 maxLength: 50
5155 email:
5156 type: string
5157 format: email
5158 description: The user email
5159 pluginAuth:
5160 type: string
5161 description: Auth plugin to use to authenticate the user
5162 theme:
5163 type: string
5164 description: Theme enabled by this user
5165 emailVerified:
5166 type: boolean
5167 description: Has the user confirmed their email address?
5168 nsfwPolicy:
5169 $ref: '#/components/schemas/NSFWPolicy'
5170 webtorrentEnabled:
5171 type: boolean
5172 description: Enable P2P in the player
5173 autoPlayVideo:
5174 type: boolean
5175 description: Automatically start playing the video on the watch page
5176 role:
5177 $ref: '#/components/schemas/UserRole'
5178 roleLabel:
5179 type: string
5180 enum:
5181 - User
5182 - Moderator
5183 - Administrator
5184 videoQuota:
5185 type: integer
5186 description: The user video quota
5187 videoQuotaDaily:
5188 type: integer
5189 description: The user daily video quota
5190 videosCount:
5191 type: integer
5192 abusesCount:
5193 type: integer
5194 abusesAcceptedCount:
5195 type: integer
5196 abusesCreatedCount:
5197 type: integer
5198 videoCommentsCount:
5199 type: integer
5200 noInstanceConfigWarningModal:
5201 type: boolean
5202 noWelcomeModal:
5203 type: boolean
5204 blocked:
5205 type: boolean
5206 blockedReason:
5207 type: string
5208 createdAt:
5209 type: string
5210 account:
5211 $ref: '#/components/schemas/Account'
5212 videoChannels:
5213 type: array
5214 items:
5215 $ref: '#/components/schemas/VideoChannel'
5216 AddUser:
5217 properties:
5218 username:
5219 type: string
5220 description: The user username
5221 minLength: 1
5222 maxLength: 50
5223 password:
5224 type: string
5225 format: password
5226 description: The user password. If the smtp server is configured, you can leave empty and an email will be sent
5227 minLength: 6
5228 maxLength: 255
5229 email:
5230 type: string
5231 format: email
5232 description: The user email
5233 videoQuota:
5234 type: integer
5235 description: The user video quota
5236 videoQuotaDaily:
5237 type: integer
5238 description: The user daily video quota
5239 channelName:
5240 type: string
5241 description: The user default channel username
5242 role:
5243 $ref: '#/components/schemas/UserRole'
5244 adminFlags:
5245 $ref: '#/components/schemas/UserAdminFlags'
5246 required:
5247 - username
5248 - password
5249 - email
5250 - videoQuota
5251 - videoQuotaDaily
5252 - role
5253 UpdateUser:
5254 properties:
5255 id:
5256 type: string
5257 description: The user id
5258 email:
5259 type: string
5260 format: email
5261 description: The updated email of the user
5262 emailVerified:
5263 type: boolean
5264 description: Set the email as verified
5265 videoQuota:
5266 type: integer
5267 description: The updated video quota of the user
5268 videoQuotaDaily:
5269 type: integer
5270 description: The updated daily video quota of the user
5271 pluginAuth:
5272 type: string
5273 nullable: true
5274 description: The auth plugin to use to authenticate the user
5275 example: 'peertube-plugin-auth-saml2'
5276 role:
5277 $ref: '#/components/schemas/UserRole'
5278 adminFlags:
5279 $ref: '#/components/schemas/UserAdminFlags'
5280 required:
5281 - id
5282 UpdateMe:
5283 properties:
5284 password:
5285 type: string
5286 format: password
5287 description: Your new password
5288 minLength: 6
5289 maxLength: 255
5290 email:
5291 type: string
5292 format: email
5293 description: Your new email
5294 displayNSFW:
5295 type: string
5296 description: Your new displayNSFW
5297 enum:
5298 - 'true'
5299 - 'false'
5300 - both
5301 autoPlayVideo:
5302 type: boolean
5303 description: Your new autoPlayVideo
5304 required:
5305 - password
5306 - email
5307 - displayNSFW
5308 - autoPlayVideo
5309 GetMeVideoRating:
5310 properties:
5311 id:
5312 type: string
5313 description: Id of the video
5314 rating:
5315 type: number
5316 description: Rating of the video
5317 required:
5318 - id
5319 - rating
5320 VideoRating:
5321 properties:
5322 video:
5323 $ref: '#/components/schemas/Video'
5324 rating:
5325 type: number
5326 description: 'Rating of the video'
5327 required:
5328 - video
5329 - rating
5330 RegisterUser:
5331 properties:
5332 username:
5333 type: string
5334 description: The username of the user
5335 minLength: 1
5336 maxLength: 50
5337 pattern: '/^[a-z0-9._]{1,50}$/'
5338 password:
5339 type: string
5340 format: password
5341 description: The password of the user
5342 minLength: 6
5343 maxLength: 255
5344 email:
5345 type: string
5346 format: email
5347 description: The email of the user
5348 displayName:
5349 type: string
5350 description: The user display name
5351 minLength: 1
5352 maxLength: 120
5353 channel:
5354 type: object
5355 properties:
5356 name:
5357 type: string
5358 description: The username for the default channel
5359 pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/'
5360 displayName:
5361 type: string
5362 description: The display name for the default channel
5363 minLength: 1
5364 maxLength: 120
5365 required:
5366 - username
5367 - password
5368 - email
5369 VideoChannelCreate:
5370 properties:
5371 name:
5372 type: string
5373 displayName:
5374 type: string
5375 description:
5376 type: string
5377 support:
5378 type: string
5379 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
5380 example: Please support my work on <insert crowdfunding plateform>! <3
5381 required:
5382 - name
5383 - displayName
5384 VideoChannelUpdate:
5385 properties:
5386 displayName:
5387 type: string
5388 description:
5389 type: string
5390 support:
5391 type: string
5392 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
5393 example: Please support my work on <insert crowdfunding plateform>! <3
5394 bulkVideosSupportUpdate:
5395 type: boolean
5396 description: 'Update the support field for all videos of this channel'
5397
5398 MRSSPeerLink:
5399 type: object
5400 xml:
5401 name: 'media:peerLink'
5402 properties:
5403 href:
5404 type: string
5405 xml:
5406 attribute: true
5407 type:
5408 type: string
5409 enum:
5410 - application/x-bittorrent
5411 xml:
5412 attribute: true
5413 MRSSGroupContent:
5414 type: object
5415 xml:
5416 name: 'media:content'
5417 properties:
5418 url:
5419 type: string
5420 format: url
5421 xml:
5422 attribute: true
5423 fileSize:
5424 type: integer
5425 xml:
5426 attribute: true
5427 type:
5428 type: string
5429 xml:
5430 attribute: true
5431 framerate:
5432 type: integer
5433 xml:
5434 attribute: true
5435 duration:
5436 type: integer
5437 xml:
5438 attribute: true
5439 height:
5440 type: integer
5441 xml:
5442 attribute: true
5443 lang:
5444 type: string
5445 xml:
5446 attribute: true
5447 VideoCommentsForXML:
5448 type: array
5449 xml:
5450 wrapped: true
5451 name: 'channel'
5452 items:
5453 type: object
5454 xml:
5455 name: 'item'
5456 properties:
5457 link:
5458 type: string
5459 format: url
5460 guid:
5461 type: string
5462 pubDate:
5463 type: string
5464 format: date-time
5465 'content:encoded':
5466 type: string
5467 'dc:creator':
5468 type: string
5469 VideosForXML:
5470 type: array
5471 xml:
5472 wrapped: true
5473 name: 'channel'
5474 items:
5475 type: object
5476 xml:
5477 name: 'item'
5478 properties:
5479 link:
5480 type: string
5481 format: url
5482 description: video watch page URL
5483 guid:
5484 type: string
5485 description: video canonical URL
5486 pubDate:
5487 type: string
5488 format: date-time
5489 description: video publication date
5490 description:
5491 type: string
5492 description: video description
5493 'content:encoded':
5494 type: string
5495 description: video description
5496 'dc:creator':
5497 type: string
5498 description: publisher user name
5499 'media:category':
5500 type: integer
5501 description: video category (MRSS)
5502 'media:community':
5503 type: object
5504 description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
5505 properties:
5506 'media:statistics':
5507 type: object
5508 properties:
5509 views:
5510 type: integer
5511 xml:
5512 attribute: true
5513 'media:embed':
5514 type: object
5515 properties:
5516 url:
5517 type: string
5518 format: url
5519 description: video embed path, relative to the canonical URL domain (MRSS)
5520 xml:
5521 attribute: true
5522 'media:player':
5523 type: object
5524 properties:
5525 url:
5526 type: string
5527 format: url
5528 description: video watch path, relative to the canonical URL domain (MRSS)
5529 xml:
5530 attribute: true
5531 'media:thumbnail':
5532 type: object
5533 properties:
5534 url:
5535 type: string
5536 format: url
5537 xml:
5538 attribute: true
5539 height:
5540 type: integer
5541 xml:
5542 attribute: true
5543 width:
5544 type: integer
5545 xml:
5546 attribute: true
5547 'media:title':
5548 type: string
5549 description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
5550 'media:description':
5551 type: string
5552 'media:rating':
5553 type: string
5554 enum:
5555 - nonadult
5556 - adult
5557 description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
5558 'enclosure':
5559 type: object
5560 description: main streamable file for the video
5561 properties:
5562 url:
5563 type: string
5564 format: url
5565 xml:
5566 attribute: true
5567 type:
5568 type: string
5569 enum:
5570 - application/x-bittorrent
5571 xml:
5572 attribute: true
5573 length:
5574 type: integer
5575 xml:
5576 attribute: true
5577 'media:group':
5578 type: array
5579 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)
5580 items:
5581 anyOf:
5582 - $ref: '#/components/schemas/MRSSPeerLink'
5583 - $ref: '#/components/schemas/MRSSGroupContent'
5584 NotificationSettingValue:
5585 type: integer
5586 description: >
5587 Notification type
5588
5589 - `0` NONE
5590
5591 - `1` WEB
5592
5593 - `2` EMAIL
5594 enum:
5595 - 0
5596 - 1
5597 - 3
5598 Notification:
5599 properties:
5600 id:
5601 type: integer
5602 type:
5603 type: integer
5604 description: >
5605 Notification type, following the `UserNotificationType` enum:
5606
5607 - `1` NEW_VIDEO_FROM_SUBSCRIPTION
5608
5609 - `2` NEW_COMMENT_ON_MY_VIDEO
5610
5611 - `3` NEW_ABUSE_FOR_MODERATORS
5612
5613 - `4` BLACKLIST_ON_MY_VIDEO
5614
5615 - `5` UNBLACKLIST_ON_MY_VIDEO
5616
5617 - `6` MY_VIDEO_PUBLISHED
5618
5619 - `7` MY_VIDEO_IMPORT_SUCCESS
5620
5621 - `8` MY_VIDEO_IMPORT_ERROR
5622
5623 - `9` NEW_USER_REGISTRATION
5624
5625 - `10` NEW_FOLLOW
5626
5627 - `11` COMMENT_MENTION
5628
5629 - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
5630
5631 - `13` NEW_INSTANCE_FOLLOWER
5632
5633 - `14` AUTO_INSTANCE_FOLLOWING
5634 read:
5635 type: boolean
5636 video:
5637 nullable: true
5638 allOf:
5639 - $ref: '#/components/schemas/VideoInfo'
5640 - type: object
5641 properties:
5642 channel:
5643 $ref: '#/components/schemas/ActorInfo'
5644 videoImport:
5645 nullable: true
5646 type: object
5647 properties:
5648 id:
5649 type: integer
5650 video:
5651 nullable: true
5652 $ref: '#/components/schemas/VideoInfo'
5653 torrentName:
5654 type: string
5655 nullable: true
5656 magnetUri:
5657 type: string
5658 format: uri
5659 nullable: true
5660 targetUri:
5661 type: string
5662 format: uri
5663 nullable: true
5664 comment:
5665 nullable: true
5666 type: object
5667 properties:
5668 id:
5669 type: integer
5670 threadId:
5671 type: integer
5672 video:
5673 $ref: '#/components/schemas/VideoInfo'
5674 account:
5675 $ref: '#/components/schemas/ActorInfo'
5676 videoAbuse:
5677 nullable: true
5678 type: object
5679 properties:
5680 id:
5681 type: integer
5682 video:
5683 allOf:
5684 - $ref: '#/components/schemas/VideoInfo'
5685 videoBlacklist:
5686 nullable: true
5687 type: object
5688 properties:
5689 id:
5690 type: integer
5691 video:
5692 allOf:
5693 - $ref: '#/components/schemas/VideoInfo'
5694 account:
5695 nullable: true
5696 allOf:
5697 - $ref: '#/components/schemas/ActorInfo'
5698 actorFollow:
5699 type: object
5700 nullable: true
5701 properties:
5702 id:
5703 type: integer
5704 follower:
5705 $ref: '#/components/schemas/ActorInfo'
5706 state:
5707 type: string
5708 enum:
5709 - pending
5710 - accepted
5711 following:
5712 type: object
5713 properties:
5714 type:
5715 type: string
5716 enum:
5717 - account
5718 - channel
5719 - instance
5720 name:
5721 type: string
5722 displayName:
5723 type: string
5724 host:
5725 type: string
5726 format: hostname
5727 createdAt:
5728 type: string
5729 format: date-time
5730 updatedAt:
5731 type: string
5732 format: date-time
5733 NotificationListResponse:
5734 properties:
5735 total:
5736 type: integer
5737 example: 1
5738 data:
5739 type: array
5740 maxItems: 100
5741 items:
5742 $ref: '#/components/schemas/Notification'
5743 Plugin:
5744 properties:
5745 name:
5746 type: string
5747 example: peertube-plugin-auth-ldap
5748 type:
5749 type: integer
5750 description: >
5751 - `1`: PLUGIN
5752
5753 - `2`: THEME
5754 enum:
5755 - 1
5756 - 2
5757 latestVersion:
5758 type: string
5759 example: 0.0.3
5760 version:
5761 type: string
5762 example: 0.0.1
5763 enabled:
5764 type: boolean
5765 uninstalled:
5766 type: boolean
5767 peertubeEngine:
5768 type: string
5769 example: 2.2.0
5770 description:
5771 type: string
5772 homepage:
5773 type: string
5774 format: url
5775 example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap
5776 settings:
5777 type: object
5778 additionalProperties: true
5779 createdAt:
5780 type: string
5781 format: date-time
5782 updatedAt:
5783 type: string
5784 format: date-time
5785 PluginResponse:
5786 properties:
5787 total:
5788 type: integer
5789 example: 1
5790 data:
5791 type: array
5792 maxItems: 100
5793 items:
5794 $ref: '#/components/schemas/Plugin'
5795
5796 LiveVideoUpdate:
5797 properties:
5798 saveReplay:
5799 type: boolean
5800 permanentLive:
5801 description: User can stream multiple times in a permanent live
5802 type: boolean
5803
5804 LiveVideoResponse:
5805 properties:
5806 rtmpUrl:
5807 type: string
5808 streamKey:
5809 type: string
5810 description: RTMP stream key to use to stream into this live video
5811 saveReplay:
5812 type: boolean
5813 permanentLive:
5814 description: User can stream multiple times in a permanent live
5815 type: boolean
5816
5817
5818
5819 callbacks:
5820 searchIndex:
5821 'https://search.example.org/api/v1/search/videos':
5822 post:
5823 summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`
5824 responses:
5825 '200':
5826 description: successful operation
5827 content:
5828 application/json:
5829 schema:
5830 $ref: '#/components/schemas/VideoListResponse'