]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/doc/api/openapi.yaml
8be6575b488fd2a2e957f7530ff30d931dd604e5
[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 type: array
2650 items:
2651 $ref: '#/components/schemas/VideoChannel'
2652 '/accounts/{name}/ratings':
2653 get:
2654 summary: List ratings of an account
2655 security:
2656 - OAuth2: []
2657 tags:
2658 - Accounts
2659 parameters:
2660 - $ref: '#/components/parameters/name'
2661 - $ref: '#/components/parameters/start'
2662 - $ref: '#/components/parameters/count'
2663 - $ref: '#/components/parameters/sort'
2664 - name: rating
2665 in: query
2666 required: false
2667 description: Optionally filter which ratings to retrieve
2668 schema:
2669 type: string
2670 enum:
2671 - like
2672 - dislike
2673 responses:
2674 '200':
2675 description: successful operation
2676 content:
2677 application/json:
2678 schema:
2679 type: array
2680 items:
2681 $ref: '#/components/schemas/VideoRating'
2682 '/videos/{id}/comment-threads':
2683 get:
2684 summary: List threads of a video
2685 tags:
2686 - Video Comments
2687 parameters:
2688 - $ref: '#/components/parameters/idOrUUID'
2689 - $ref: '#/components/parameters/start'
2690 - $ref: '#/components/parameters/count'
2691 - $ref: '#/components/parameters/commentsSort'
2692 responses:
2693 '200':
2694 description: successful operation
2695 content:
2696 application/json:
2697 schema:
2698 $ref: '#/components/schemas/CommentThreadResponse'
2699 post:
2700 summary: Create a thread
2701 security:
2702 - OAuth2: []
2703 tags:
2704 - Video Comments
2705 parameters:
2706 - $ref: '#/components/parameters/idOrUUID'
2707 responses:
2708 '200':
2709 description: successful operation
2710 content:
2711 application/json:
2712 schema:
2713 $ref: '#/components/schemas/CommentThreadPostResponse'
2714 '404':
2715 description: video does not exist
2716 requestBody:
2717 content:
2718 application/json:
2719 schema:
2720 type: object
2721 properties:
2722 text:
2723 type: string
2724 description: 'Text comment'
2725 required:
2726 - text
2727
2728 '/videos/{id}/comment-threads/{threadId}':
2729 get:
2730 summary: Get a thread
2731 tags:
2732 - Video Comments
2733 parameters:
2734 - $ref: '#/components/parameters/idOrUUID'
2735 - $ref: '#/components/parameters/threadId'
2736 responses:
2737 '200':
2738 description: successful operation
2739 content:
2740 application/json:
2741 schema:
2742 $ref: '#/components/schemas/VideoCommentThreadTree'
2743 '/videos/{id}/comments/{commentId}':
2744 post:
2745 summary: Reply to a thread of a video
2746 security:
2747 - OAuth2: []
2748 tags:
2749 - Video Comments
2750 parameters:
2751 - $ref: '#/components/parameters/idOrUUID'
2752 - $ref: '#/components/parameters/commentId'
2753 responses:
2754 '200':
2755 description: successful operation
2756 content:
2757 application/json:
2758 schema:
2759 $ref: '#/components/schemas/CommentThreadPostResponse'
2760 '404':
2761 description: thread or video does not exist
2762 requestBody:
2763 content:
2764 application/json:
2765 schema:
2766 type: object
2767 properties:
2768 text:
2769 type: string
2770 description: 'Text comment'
2771 required:
2772 - text
2773
2774 delete:
2775 summary: Delete a comment or a reply
2776 security:
2777 - OAuth2: []
2778 tags:
2779 - Video Comments
2780 parameters:
2781 - $ref: '#/components/parameters/idOrUUID'
2782 - $ref: '#/components/parameters/commentId'
2783 responses:
2784 '204':
2785 description: successful operation
2786 '403':
2787 description: cannot remove comment of another user
2788 '404':
2789 description: comment or video does not exist
2790 '409':
2791 description: comment is already deleted
2792 '/videos/{id}/rate':
2793 put:
2794 summary: Like/dislike a video
2795 security:
2796 - OAuth2: []
2797 tags:
2798 - Video Rates
2799 parameters:
2800 - $ref: '#/components/parameters/idOrUUID'
2801 responses:
2802 '204':
2803 description: successful operation
2804 '404':
2805 description: video does not exist
2806 /search/videos:
2807 get:
2808 tags:
2809 - Search
2810 summary: Search videos
2811 parameters:
2812 - name: search
2813 in: query
2814 required: true
2815 allowEmptyValue: false
2816 description: >
2817 String to search. If the user can make a remote URI search, and the string is an URI then the
2818 PeerTube instance will fetch the remote object and add it to its database. Then,
2819 you can use the REST API to fetch the complete video information and interact with it.
2820 schema:
2821 type: string
2822 - $ref: '#/components/parameters/categoryOneOf'
2823 - $ref: '#/components/parameters/tagsOneOf'
2824 - $ref: '#/components/parameters/tagsAllOf'
2825 - $ref: '#/components/parameters/licenceOneOf'
2826 - $ref: '#/components/parameters/languageOneOf'
2827 - $ref: '#/components/parameters/nsfw'
2828 - $ref: '#/components/parameters/filter'
2829 - $ref: '#/components/parameters/skipCount'
2830 - $ref: '#/components/parameters/start'
2831 - $ref: '#/components/parameters/count'
2832 - $ref: '#/components/parameters/searchTarget'
2833 - $ref: '#/components/parameters/videosSearchSort'
2834 - name: startDate
2835 in: query
2836 description: Get videos that are published after this date
2837 schema:
2838 type: string
2839 format: date-time
2840 - name: endDate
2841 in: query
2842 description: Get videos that are published before this date
2843 schema:
2844 type: string
2845 format: date-time
2846 - name: originallyPublishedStartDate
2847 in: query
2848 description: Get videos that are originally published after this date
2849 schema:
2850 type: string
2851 format: date-time
2852 - name: originallyPublishedEndDate
2853 in: query
2854 description: Get videos that are originally published before this date
2855 schema:
2856 type: string
2857 format: date-time
2858 - name: durationMin
2859 in: query
2860 description: Get videos that have this minimum duration
2861 schema:
2862 type: integer
2863 - name: durationMax
2864 in: query
2865 description: Get videos that have this maximum duration
2866 schema:
2867 type: integer
2868 callbacks:
2869 'searchTarget === search-index':
2870 $ref: '#/components/callbacks/searchIndex'
2871 responses:
2872 '200':
2873 description: successful operation
2874 content:
2875 application/json:
2876 schema:
2877 $ref: '#/components/schemas/VideoListResponse'
2878 '500':
2879 description: search index unavailable
2880 /search/video-channels:
2881 get:
2882 tags:
2883 - Search
2884 summary: Search channels
2885 parameters:
2886 - name: search
2887 in: query
2888 required: true
2889 description: >
2890 String to search. If the user can make a remote URI search, and the string is an URI then the
2891 PeerTube instance will fetch the remote object and add it to its database. Then,
2892 you can use the REST API to fetch the complete channel information and interact with it.
2893 schema:
2894 type: string
2895 - $ref: '#/components/parameters/start'
2896 - $ref: '#/components/parameters/count'
2897 - $ref: '#/components/parameters/searchTarget'
2898 - $ref: '#/components/parameters/sort'
2899 callbacks:
2900 'searchTarget === search-index':
2901 $ref: '#/components/callbacks/searchIndex'
2902 responses:
2903 '200':
2904 description: successful operation
2905 content:
2906 application/json:
2907 schema:
2908 type: array
2909 items:
2910 $ref: '#/components/schemas/VideoChannel'
2911 '500':
2912 description: search index unavailable
2913 /blocklist/accounts:
2914 get:
2915 tags:
2916 - Account Blocks
2917 summary: List account blocks
2918 security:
2919 - OAuth2:
2920 - admin
2921 parameters:
2922 - $ref: '#/components/parameters/start'
2923 - $ref: '#/components/parameters/count'
2924 - $ref: '#/components/parameters/sort'
2925 responses:
2926 '200':
2927 description: successful operation
2928 post:
2929 tags:
2930 - Account Blocks
2931 summary: Block an account
2932 security:
2933 - OAuth2:
2934 - admin
2935 requestBody:
2936 content:
2937 application/json:
2938 schema:
2939 type: object
2940 properties:
2941 accountName:
2942 type: string
2943 example: chocobozzz@example.org
2944 description: account to block, in the form `username@domain`
2945 required:
2946 - accountName
2947 responses:
2948 '200':
2949 description: successful operation
2950 '409':
2951 description: self-blocking forbidden
2952 '/blocklist/accounts/{accountName}':
2953 delete:
2954 tags:
2955 - Account Blocks
2956 summary: Unblock an account by its handle
2957 security:
2958 - OAuth2:
2959 - admin
2960 parameters:
2961 - name: accountName
2962 in: path
2963 required: true
2964 description: account to unblock, in the form `username@domain`
2965 schema:
2966 type: string
2967 responses:
2968 '201':
2969 description: successful operation
2970 '404':
2971 description: account or account block does not exist
2972 /blocklist/servers:
2973 get:
2974 tags:
2975 - Server Blocks
2976 summary: List server blocks
2977 security:
2978 - OAuth2:
2979 - admin
2980 parameters:
2981 - $ref: '#/components/parameters/start'
2982 - $ref: '#/components/parameters/count'
2983 - $ref: '#/components/parameters/sort'
2984 responses:
2985 '200':
2986 description: successful operation
2987 post:
2988 tags:
2989 - Server Blocks
2990 summary: Block a server
2991 security:
2992 - OAuth2:
2993 - admin
2994 requestBody:
2995 content:
2996 application/json:
2997 schema:
2998 type: object
2999 properties:
3000 host:
3001 type: string
3002 format: hostname
3003 description: server domain to block
3004 required:
3005 - host
3006 responses:
3007 '200':
3008 description: successful operation
3009 '409':
3010 description: self-blocking forbidden
3011 '/blocklist/servers/{host}':
3012 delete:
3013 tags:
3014 - Server Blocks
3015 summary: Unblock a server by its domain
3016 security:
3017 - OAuth2:
3018 - admin
3019 parameters:
3020 - name: host
3021 in: path
3022 required: true
3023 description: server domain to unblock
3024 schema:
3025 type: string
3026 format: hostname
3027 responses:
3028 '201':
3029 description: successful operation
3030 '404':
3031 description: account block does not exist
3032 /redundancy/{host}:
3033 put:
3034 tags:
3035 - Instance Redundancy
3036 summary: Update a server redundancy policy
3037 security:
3038 - OAuth2:
3039 - admin
3040 parameters:
3041 - name: host
3042 in: path
3043 required: true
3044 description: server domain to mirror
3045 schema:
3046 type: string
3047 format: hostname
3048 requestBody:
3049 content:
3050 application/json:
3051 schema:
3052 type: object
3053 properties:
3054 redundancyAllowed:
3055 type: boolean
3056 description: allow mirroring of the host's local videos
3057 required:
3058 - redundancyAllowed
3059 responses:
3060 '204':
3061 description: successful operation
3062 '404':
3063 description: server is not already known
3064 /redundancy/videos:
3065 get:
3066 tags:
3067 - Video Mirroring
3068 summary: List videos being mirrored
3069 security:
3070 - OAuth2:
3071 - admin
3072 parameters:
3073 - name: target
3074 in: query
3075 required: true
3076 description: direction of the mirror
3077 schema:
3078 type: string
3079 enum:
3080 - my-videos
3081 - remote-videos
3082 - $ref: '#/components/parameters/start'
3083 - $ref: '#/components/parameters/count'
3084 - $ref: '#/components/parameters/videoRedundanciesSort'
3085 responses:
3086 '200':
3087 description: successful operation
3088 content:
3089 application/json:
3090 schema:
3091 type: array
3092 items:
3093 $ref: '#/components/schemas/VideoRedundancy'
3094 post:
3095 tags:
3096 - Video Mirroring
3097 summary: Mirror a video
3098 security:
3099 - OAuth2:
3100 - admin
3101 requestBody:
3102 content:
3103 application/json:
3104 schema:
3105 type: object
3106 properties:
3107 videoId:
3108 type: integer
3109 required:
3110 - videoId
3111 responses:
3112 '204':
3113 description: successful operation
3114 '400':
3115 description: cannot mirror a local video
3116 '404':
3117 description: video does not exist
3118 '409':
3119 description: video is already mirrored
3120 /redundancy/videos/{redundancyId}:
3121 delete:
3122 tags:
3123 - Video Mirroring
3124 summary: Delete a mirror done on a video
3125 security:
3126 - OAuth2:
3127 - admin
3128 parameters:
3129 - name: redundancyId
3130 in: path
3131 required: true
3132 description: id of an existing redundancy on a video
3133 schema:
3134 type: string
3135 responses:
3136 '204':
3137 description: successful operation
3138 '404':
3139 description: video redundancy not found
3140 '/feeds/video-comments.{format}':
3141 get:
3142 tags:
3143 - Feeds
3144 summary: List comments on videos
3145 servers:
3146 - url: 'https://peertube2.cpy.re'
3147 description: Live Test Server (live data - latest nightly version)
3148 - url: 'https://peertube3.cpy.re'
3149 description: Live Test Server (live data - latest RC version)
3150 - url: 'https://peertube.cpy.re'
3151 description: Live Test Server (live data - stable version)
3152 parameters:
3153 - name: format
3154 in: path
3155 required: true
3156 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
3157 schema:
3158 type: string
3159 enum:
3160 - xml
3161 - rss
3162 - rss2
3163 - atom
3164 - atom1
3165 - json
3166 - json1
3167 - name: videoId
3168 in: query
3169 description: 'limit listing to a specific video'
3170 schema:
3171 type: string
3172 - name: accountId
3173 in: query
3174 description: 'limit listing to a specific account'
3175 schema:
3176 type: string
3177 - name: accountName
3178 in: query
3179 description: 'limit listing to a specific account'
3180 schema:
3181 type: string
3182 - name: videoChannelId
3183 in: query
3184 description: 'limit listing to a specific video channel'
3185 schema:
3186 type: string
3187 - name: videoChannelName
3188 in: query
3189 description: 'limit listing to a specific video channel'
3190 schema:
3191 type: string
3192 responses:
3193 '204':
3194 description: successful operation
3195 headers:
3196 Cache-Control:
3197 schema:
3198 type: string
3199 default: 'max-age=900' # 15 min cache
3200 content:
3201 application/xml:
3202 schema:
3203 $ref: '#/components/schemas/VideoCommentsForXML'
3204 application/rss+xml:
3205 schema:
3206 $ref: '#/components/schemas/VideoCommentsForXML'
3207 text/xml:
3208 schema:
3209 $ref: '#/components/schemas/VideoCommentsForXML'
3210 application/atom+xml:
3211 schema:
3212 $ref: '#/components/schemas/VideoCommentsForXML'
3213 application/json:
3214 schema:
3215 type: object
3216 '400':
3217 x-summary: field inconsistencies
3218 description: >
3219 Arises when:
3220 - videoId filter is mixed with a channel filter
3221 '404':
3222 description: video, video channel or account not found
3223 '406':
3224 description: accept header unsupported
3225 '/feeds/videos.{format}':
3226 get:
3227 tags:
3228 - Feeds
3229 summary: List videos
3230 servers:
3231 - url: 'https://peertube2.cpy.re'
3232 description: Live Test Server (live data - latest nightly version)
3233 - url: 'https://peertube3.cpy.re'
3234 description: Live Test Server (live data - latest RC version)
3235 - url: 'https://peertube.cpy.re'
3236 description: Live Test Server (live data - stable version)
3237 parameters:
3238 - name: format
3239 in: path
3240 required: true
3241 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
3242 schema:
3243 type: string
3244 enum:
3245 - xml
3246 - rss
3247 - rss2
3248 - atom
3249 - atom1
3250 - json
3251 - json1
3252 - name: accountId
3253 in: query
3254 description: 'limit listing to a specific account'
3255 schema:
3256 type: string
3257 - name: accountName
3258 in: query
3259 description: 'limit listing to a specific account'
3260 schema:
3261 type: string
3262 - name: videoChannelId
3263 in: query
3264 description: 'limit listing to a specific video channel'
3265 schema:
3266 type: string
3267 - name: videoChannelName
3268 in: query
3269 description: 'limit listing to a specific video channel'
3270 schema:
3271 type: string
3272 - $ref: '#/components/parameters/sort'
3273 - $ref: '#/components/parameters/nsfw'
3274 - $ref: '#/components/parameters/filter'
3275 responses:
3276 '204':
3277 description: successful operation
3278 headers:
3279 Cache-Control:
3280 schema:
3281 type: string
3282 default: 'max-age=900' # 15 min cache
3283 content:
3284 application/xml:
3285 schema:
3286 $ref: '#/components/schemas/VideosForXML'
3287 examples:
3288 nightly:
3289 externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
3290 application/rss+xml:
3291 schema:
3292 $ref: '#/components/schemas/VideosForXML'
3293 text/xml:
3294 schema:
3295 $ref: '#/components/schemas/VideosForXML'
3296 application/atom+xml:
3297 schema:
3298 $ref: '#/components/schemas/VideosForXML'
3299 application/json:
3300 schema:
3301 type: object
3302 '404':
3303 description: video channel or account not found
3304 '406':
3305 description: accept header unsupported
3306 /plugins:
3307 get:
3308 tags:
3309 - Plugins
3310 summary: List plugins
3311 security:
3312 - OAuth2:
3313 - admin
3314 parameters:
3315 - name: pluginType
3316 in: query
3317 schema:
3318 type: integer
3319 - name: uninstalled
3320 in: query
3321 schema:
3322 type: boolean
3323 - $ref: '#/components/parameters/start'
3324 - $ref: '#/components/parameters/count'
3325 - $ref: '#/components/parameters/sort'
3326 responses:
3327 '200':
3328 description: successful operation
3329 content:
3330 application/json:
3331 schema:
3332 $ref: '#/components/schemas/PluginResponse'
3333 /plugins/available:
3334 get:
3335 tags:
3336 - Plugins
3337 summary: List available plugins
3338 security:
3339 - OAuth2:
3340 - admin
3341 parameters:
3342 - name: search
3343 in: query
3344 schema:
3345 type: string
3346 - name: pluginType
3347 in: query
3348 schema:
3349 type: integer
3350 - name: currentPeerTubeEngine
3351 in: query
3352 schema:
3353 type: string
3354 - $ref: '#/components/parameters/start'
3355 - $ref: '#/components/parameters/count'
3356 - $ref: '#/components/parameters/sort'
3357 responses:
3358 '200':
3359 description: successful operation
3360 content:
3361 application/json:
3362 schema:
3363 $ref: '#/components/schemas/PluginResponse'
3364 '503':
3365 description: plugin index unavailable
3366 /plugins/install:
3367 post:
3368 tags:
3369 - Plugins
3370 summary: Install a plugin
3371 security:
3372 - OAuth2:
3373 - admin
3374 requestBody:
3375 content:
3376 application/json:
3377 schema:
3378 oneOf:
3379 - type: object
3380 properties:
3381 npmName:
3382 type: string
3383 example: peertube-plugin-auth-ldap
3384 required:
3385 - npmName
3386 additionalProperties: false
3387 - type: object
3388 properties:
3389 path:
3390 type: string
3391 required:
3392 - path
3393 additionalProperties: false
3394 responses:
3395 '204':
3396 description: successful operation
3397 '400':
3398 description: should have either `npmName` or `path` set
3399 /plugins/update:
3400 post:
3401 tags:
3402 - Plugins
3403 summary: Update a plugin
3404 security:
3405 - OAuth2:
3406 - admin
3407 requestBody:
3408 content:
3409 application/json:
3410 schema:
3411 oneOf:
3412 - type: object
3413 properties:
3414 npmName:
3415 type: string
3416 example: peertube-plugin-auth-ldap
3417 required:
3418 - npmName
3419 additionalProperties: false
3420 - type: object
3421 properties:
3422 path:
3423 type: string
3424 required:
3425 - path
3426 additionalProperties: false
3427 responses:
3428 '204':
3429 description: successful operation
3430 '400':
3431 description: should have either `npmName` or `path` set
3432 '404':
3433 description: existing plugin not found
3434 /plugins/uninstall:
3435 post:
3436 tags:
3437 - Plugins
3438 summary: Uninstall a plugin
3439 security:
3440 - OAuth2:
3441 - admin
3442 requestBody:
3443 content:
3444 application/json:
3445 schema:
3446 type: object
3447 properties:
3448 npmName:
3449 type: string
3450 description: name of the plugin/theme in its package.json
3451 example: peertube-plugin-auth-ldap
3452 required:
3453 - npmName
3454 responses:
3455 '204':
3456 description: successful operation
3457 '404':
3458 description: existing plugin not found
3459 /plugins/{npmName}:
3460 get:
3461 tags:
3462 - Plugins
3463 summary: Get a plugin
3464 security:
3465 - OAuth2:
3466 - admin
3467 parameters:
3468 - $ref: '#/components/parameters/npmName'
3469 responses:
3470 '200':
3471 description: successful operation
3472 content:
3473 application/json:
3474 schema:
3475 $ref: '#/components/schemas/Plugin'
3476 '404':
3477 description: plugin not found
3478 /plugins/{npmName}/settings:
3479 put:
3480 tags:
3481 - Plugins
3482 summary: Set a plugin's settings
3483 security:
3484 - OAuth2:
3485 - admin
3486 parameters:
3487 - $ref: '#/components/parameters/npmName'
3488 requestBody:
3489 content:
3490 application/json:
3491 schema:
3492 type: object
3493 properties:
3494 settings:
3495 type: object
3496 additionalProperties: true
3497 responses:
3498 '204':
3499 description: successful operation
3500 '404':
3501 description: plugin not found
3502 /plugins/{npmName}/public-settings:
3503 get:
3504 tags:
3505 - Plugins
3506 summary: Get a plugin's public settings
3507 parameters:
3508 - $ref: '#/components/parameters/npmName'
3509 responses:
3510 '200':
3511 description: successful operation
3512 content:
3513 application/json:
3514 schema:
3515 type: object
3516 additionalProperties: true
3517 '404':
3518 description: plugin not found
3519 /plugins/{npmName}/registered-settings:
3520 get:
3521 tags:
3522 - Plugins
3523 summary: Get a plugin's registered settings
3524 security:
3525 - OAuth2:
3526 - admin
3527 parameters:
3528 - $ref: '#/components/parameters/npmName'
3529 responses:
3530 '200':
3531 description: successful operation
3532 content:
3533 application/json:
3534 schema:
3535 type: object
3536 additionalProperties: true
3537 '404':
3538 description: plugin not found
3539 servers:
3540 - url: 'https://peertube2.cpy.re/api/v1'
3541 description: Live Test Server (live data - latest nightly version)
3542 - url: 'https://peertube3.cpy.re/api/v1'
3543 description: Live Test Server (live data - latest RC version)
3544 - url: 'https://peertube.cpy.re/api/v1'
3545 description: Live Test Server (live data - stable version)
3546 components:
3547 parameters:
3548 start:
3549 name: start
3550 in: query
3551 required: false
3552 description: Offset used to paginate results
3553 schema:
3554 type: integer
3555 minimum: 0
3556 count:
3557 name: count
3558 in: query
3559 required: false
3560 description: "Number of items to return"
3561 schema:
3562 type: integer
3563 default: 15
3564 maximum: 100
3565 minimum: 1
3566 sort:
3567 name: sort
3568 in: query
3569 required: false
3570 description: Sort column
3571 schema:
3572 type: string
3573 example: -createdAt
3574 search:
3575 name: search
3576 in: query
3577 required: false
3578 description: Plain text search, applied to various parts of the model depending on endpoint
3579 schema:
3580 type: string
3581 searchTarget:
3582 name: searchTarget
3583 in: query
3584 required: false
3585 description: >
3586 If the administrator enabled search index support, you can override the default search target.
3587
3588
3589 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
3590 It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
3591 * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
3592 then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
3593 After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
3594 * 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
3595 the data from the origin instance API
3596 schema:
3597 type: string
3598 enum:
3599 - 'local'
3600 - 'search-index'
3601 videosSort:
3602 name: sort
3603 in: query
3604 required: false
3605 description: Sort videos by criteria
3606 schema:
3607 type: string
3608 enum:
3609 - name
3610 - -duration
3611 - -createdAt
3612 - -publishedAt
3613 - -views
3614 - -likes
3615 - -trending
3616 - -hot
3617 videosSearchSort:
3618 name: sort
3619 in: query
3620 required: false
3621 description: Sort videos by criteria
3622 schema:
3623 type: string
3624 enum:
3625 - name
3626 - -duration
3627 - -createdAt
3628 - -publishedAt
3629 - -views
3630 - -likes
3631 - -match
3632 commentsSort:
3633 name: sort
3634 in: query
3635 required: false
3636 description: Sort comments by criteria
3637 schema:
3638 type: string
3639 enum:
3640 - -createdAt
3641 - -totalReplies
3642 blacklistsSort:
3643 name: sort
3644 in: query
3645 required: false
3646 description: Sort blacklists by criteria
3647 schema:
3648 type: string
3649 enum:
3650 - -id
3651 - name
3652 - -duration
3653 - -views
3654 - -likes
3655 - -dislikes
3656 - -uuid
3657 - -createdAt
3658 usersSearch:
3659 name: search
3660 in: query
3661 required: false
3662 description: Plain text search that will match with user usernames or emails
3663 schema:
3664 type: string
3665 usersBlocked:
3666 name: blocked
3667 in: query
3668 required: false
3669 description: Filter results down to (un)banned users
3670 schema:
3671 type: boolean
3672 usersSort:
3673 name: sort
3674 in: query
3675 required: false
3676 description: Sort users by criteria
3677 schema:
3678 type: string
3679 enum:
3680 - -id
3681 - -username
3682 - -createdAt
3683 abusesSort:
3684 name: sort
3685 in: query
3686 required: false
3687 description: Sort abuses by criteria
3688 schema:
3689 type: string
3690 enum:
3691 - -id
3692 - -createdAt
3693 - -state
3694 videoRedundanciesSort:
3695 name: sort
3696 in: query
3697 required: false
3698 description: Sort abuses by criteria
3699 schema:
3700 type: string
3701 enum:
3702 - name
3703 name:
3704 name: name
3705 in: path
3706 required: true
3707 description: The username or handle of the account
3708 schema:
3709 type: string
3710 example: chocobozzz | chocobozzz@example.org
3711 id:
3712 name: id
3713 in: path
3714 required: true
3715 description: The user id
3716 schema:
3717 type: integer
3718 minimum: 0
3719 example: 42
3720 idOrUUID:
3721 name: id
3722 in: path
3723 required: true
3724 description: The object id or uuid
3725 schema:
3726 oneOf:
3727 - type: integer
3728 minimum: 0
3729 example: 42
3730 - type: string
3731 format: uuid
3732 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
3733 playlistElementId:
3734 name: playlistElementId
3735 in: path
3736 required: true
3737 description: Playlist element id
3738 schema:
3739 type: integer
3740 abuseId:
3741 name: abuseId
3742 in: path
3743 required: true
3744 description: Abuse id
3745 schema:
3746 type: integer
3747 abuseMessageId:
3748 name: abuseMessageId
3749 in: path
3750 required: true
3751 description: Abuse message id
3752 schema:
3753 type: integer
3754 captionLanguage:
3755 name: captionLanguage
3756 in: path
3757 required: true
3758 description: The caption language
3759 schema:
3760 type: string
3761 channelHandle:
3762 name: channelHandle
3763 in: path
3764 required: true
3765 description: The video channel handle
3766 schema:
3767 type: string
3768 example: my_username | my_username@example.com
3769 subscriptionHandle:
3770 name: subscriptionHandle
3771 in: path
3772 required: true
3773 description: The subscription handle
3774 schema:
3775 type: string
3776 example: my_username | my_username@example.com
3777 threadId:
3778 name: threadId
3779 in: path
3780 required: true
3781 description: The thread id (root comment id)
3782 schema:
3783 type: integer
3784 commentId:
3785 name: commentId
3786 in: path
3787 required: true
3788 description: The comment id
3789 schema:
3790 type: integer
3791 categoryOneOf:
3792 name: categoryOneOf
3793 in: query
3794 required: false
3795 description: category id of the video (see [/videos/categories](#tag/Video/paths/~1videos~1categories/get))
3796 schema:
3797 oneOf:
3798 - type: integer
3799 - type: array
3800 items:
3801 type: integer
3802 style: form
3803 explode: false
3804 tagsOneOf:
3805 name: tagsOneOf
3806 in: query
3807 required: false
3808 description: tag(s) of the video
3809 schema:
3810 oneOf:
3811 - type: string
3812 - type: array
3813 items:
3814 type: string
3815 style: form
3816 explode: false
3817 tagsAllOf:
3818 name: tagsAllOf
3819 in: query
3820 required: false
3821 description: tag(s) of the video, where all should be present in the video
3822 schema:
3823 oneOf:
3824 - type: string
3825 - type: array
3826 items:
3827 type: string
3828 style: form
3829 explode: false
3830 languageOneOf:
3831 name: languageOneOf
3832 in: query
3833 required: false
3834 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
3835 schema:
3836 oneOf:
3837 - type: string
3838 - type: array
3839 items:
3840 type: string
3841 style: form
3842 explode: false
3843 licenceOneOf:
3844 name: licenceOneOf
3845 in: query
3846 required: false
3847 description: licence id of the video (see [/videos/licences](#tag/Video/paths/~1videos~1licences/get))
3848 schema:
3849 oneOf:
3850 - type: integer
3851 - type: array
3852 items:
3853 type: integer
3854 style: form
3855 explode: false
3856 skipCount:
3857 name: skipCount
3858 in: query
3859 required: false
3860 description: if you don't need the `total` in the response
3861 schema:
3862 type: string
3863 enum:
3864 - 'true'
3865 - 'false'
3866 default: 'false'
3867 nsfw:
3868 name: nsfw
3869 in: query
3870 required: false
3871 description: whether to include nsfw videos, if any
3872 schema:
3873 type: string
3874 enum:
3875 - 'true'
3876 - 'false'
3877 filter:
3878 name: filter
3879 in: query
3880 required: false
3881 description: >
3882 Special filters which might require special rights:
3883 * `local` - only videos local to the instance
3884 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
3885 * `all` - all videos, showing private and unlisted videos (requires Admin privileges)
3886 schema:
3887 type: string
3888 enum:
3889 - local
3890 - all-local
3891 subscriptionsUris:
3892 name: uris
3893 in: query
3894 required: true
3895 description: list of uris to check if each is part of the user subscriptions
3896 schema:
3897 type: array
3898 items:
3899 type: string
3900 format: uri
3901 npmName:
3902 name: npmName
3903 in: path
3904 required: true
3905 description: name of the plugin/theme on npmjs.com or in its package.json
3906 schema:
3907 type: string
3908 example: peertube-plugin-auth-ldap
3909 jobType:
3910 name: jobType
3911 in: query
3912 required: false
3913 description: job type
3914 schema:
3915 type: string
3916 enum:
3917 - activitypub-follow
3918 - activitypub-http-broadcast
3919 - activitypub-http-fetcher
3920 - activitypub-http-unicast
3921 - email
3922 - video-transcoding
3923 - video-file-import
3924 - video-import
3925 - videos-views
3926 - activitypub-refresher
3927 - video-redundancy
3928 - video-live-ending
3929 securitySchemes:
3930 OAuth2:
3931 description: >
3932 In the header: *Authorization: Bearer <token\>*
3933
3934
3935 Authenticating via OAuth requires the following steps:
3936
3937
3938 - Have an account with sufficient authorization levels
3939
3940 - [Generate](https://docs.joinpeertube.org/api-rest-getting-started) a
3941 Bearer Token
3942
3943 - Make Authenticated Requests
3944 type: oauth2
3945 flows:
3946 password:
3947 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
3948 scopes:
3949 admin: Admin scope
3950 moderator: Moderator scope
3951 user: User scope
3952 schemas:
3953 VideoConstantNumber:
3954 properties:
3955 id:
3956 type: integer
3957 label:
3958 type: string
3959 VideoConstantString:
3960 properties:
3961 id:
3962 type: string
3963 label:
3964 type: string
3965
3966 VideoPlaylistPrivacySet:
3967 type: integer
3968 enum:
3969 - 1
3970 - 2
3971 - 3
3972 description: 'The video playlist privacy (Public = `1`, Unlisted = `2`, Private = `3`)'
3973 VideoPlaylistPrivacyConstant:
3974 properties:
3975 id:
3976 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
3977 label:
3978 type: string
3979
3980 VideoPlaylistTypeSet:
3981 type: integer
3982 enum:
3983 - 1
3984 - 2
3985 description: 'The video playlist type (Regular = `1`, Watch Later = `2`)'
3986 VideoPlaylistTypeConstant:
3987 properties:
3988 id:
3989 $ref: '#/components/schemas/VideoPlaylistTypeSet'
3990 label:
3991 type: string
3992
3993 VideoPrivacySet:
3994 type: integer
3995 enum:
3996 - 1
3997 - 2
3998 - 3
3999 - 4
4000 description: 'The video privacy (Public = `1`, Unlisted = `2`, Private = `3`, Internal = `4`)'
4001 VideoPrivacyConstant:
4002 properties:
4003 id:
4004 $ref: '#/components/schemas/VideoPrivacySet'
4005 label:
4006 type: string
4007
4008 NSFWPolicy:
4009 type: string
4010 enum:
4011 - display
4012 - blur
4013 - do_not_list
4014
4015 UserRole:
4016 type: integer
4017 enum:
4018 - 0
4019 - 1
4020 - 2
4021 description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
4022 example: 2
4023 UserAdminFlags:
4024 type: integer
4025 enum:
4026 - 0
4027 - 1
4028 description: 'Admin flags for the user (None = `0`, Bypass video blacklist = `1`)'
4029 example: 1
4030
4031 VideoStateConstant:
4032 properties:
4033 id:
4034 type: integer
4035 enum:
4036 - 1
4037 - 2
4038 - 3
4039 description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
4040 label:
4041 type: string
4042
4043 AbuseStateSet:
4044 type: integer
4045 enum:
4046 - 1
4047 - 2
4048 - 3
4049 description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)'
4050 AbuseStateConstant:
4051 properties:
4052 id:
4053 $ref: '#/components/schemas/AbuseStateSet'
4054 label:
4055 type: string
4056 AbusePredefinedReasons:
4057 type: array
4058 items:
4059 type: string
4060 enum:
4061 - violentOrAbusive
4062 - hatefulOrAbusive
4063 - spamOrMisleading
4064 - privacy
4065 - rights
4066 - serverRules
4067 - thumbnails
4068 - captions
4069 example: [spamOrMisleading]
4070
4071 VideoResolutionConstant:
4072 properties:
4073 id:
4074 type: integer
4075 description: 'Video resolution (240, 360, 720, 1080, 1440 or 2160)'
4076 example: 240
4077 label:
4078 type: string
4079 example: 240p
4080 VideoScheduledUpdate:
4081 properties:
4082 privacy:
4083 $ref: '#/components/schemas/VideoPrivacySet'
4084 updateAt:
4085 type: string
4086 format: date
4087 description: When to update the video
4088 required:
4089 - updateAt
4090 AccountSummary:
4091 properties:
4092 id:
4093 type: integer
4094 name:
4095 type: string
4096 displayName:
4097 type: string
4098 url:
4099 type: string
4100 format: url
4101 host:
4102 type: string
4103 format: hostname
4104 avatar:
4105 nullable: true
4106 allOf:
4107 - $ref: '#/components/schemas/ActorImage'
4108 VideoChannelSummary:
4109 properties:
4110 id:
4111 type: integer
4112 name:
4113 type: string
4114 displayName:
4115 type: string
4116 url:
4117 type: string
4118 format: url
4119 host:
4120 type: string
4121 format: hostname
4122 avatar:
4123 nullable: true
4124 allOf:
4125 - $ref: '#/components/schemas/ActorImage'
4126 PlaylistElement:
4127 properties:
4128 position:
4129 type: integer
4130 startTimestamp:
4131 type: integer
4132 stopTimestamp:
4133 type: integer
4134 video:
4135 nullable: true
4136 allOf:
4137 - $ref: '#/components/schemas/Video'
4138 VideoFile:
4139 properties:
4140 magnetUri:
4141 type: string
4142 resolution:
4143 $ref: '#/components/schemas/VideoResolutionConstant'
4144 size:
4145 type: integer
4146 description: 'Video file size in bytes'
4147 torrentUrl:
4148 type: string
4149 format: url
4150 torrentDownloadUrl:
4151 type: string
4152 format: url
4153 fileUrl:
4154 type: string
4155 format: url
4156 fileDownloadUrl:
4157 type: string
4158 format: url
4159 fps:
4160 type: number
4161 metadataUrl:
4162 type: string
4163 format: url
4164 VideoStreamingPlaylists:
4165 properties:
4166 id:
4167 type: integer
4168 type:
4169 type: integer
4170 enum:
4171 - 1
4172 description: 'Playlist type (HLS = `1`)'
4173 playlistUrl:
4174 type: string
4175 format: url
4176 segmentsSha256Url:
4177 type: string
4178 format: url
4179 files:
4180 type: array
4181 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)'
4182 items:
4183 $ref: '#/components/schemas/VideoFile'
4184 redundancies:
4185 type: array
4186 items:
4187 type: object
4188 properties:
4189 baseUrl:
4190 type: string
4191 format: url
4192 VideoInfo:
4193 properties:
4194 id:
4195 type: integer
4196 uuid:
4197 type: string
4198 format: uuid
4199 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4200 name:
4201 type: string
4202 Video:
4203 properties:
4204 id:
4205 type: integer
4206 example: 8
4207 uuid:
4208 type: string
4209 format: uuid
4210 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4211 isLive:
4212 type: boolean
4213 createdAt:
4214 type: string
4215 format: date-time
4216 publishedAt:
4217 type: string
4218 format: date-time
4219 updatedAt:
4220 type: string
4221 format: date-time
4222 originallyPublishedAt:
4223 type: string
4224 format: date-time
4225 category:
4226 $ref: '#/components/schemas/VideoConstantNumber'
4227 licence:
4228 $ref: '#/components/schemas/VideoConstantNumber'
4229 language:
4230 $ref: '#/components/schemas/VideoConstantString'
4231 privacy:
4232 $ref: '#/components/schemas/VideoPrivacyConstant'
4233 description:
4234 type: string
4235 duration:
4236 type: integer
4237 example: 1419
4238 isLocal:
4239 type: boolean
4240 name:
4241 type: string
4242 example: What is PeerTube?
4243 thumbnailPath:
4244 type: string
4245 example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
4246 previewPath:
4247 type: string
4248 example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
4249 embedPath:
4250 type: string
4251 example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
4252 views:
4253 type: integer
4254 example: 1337
4255 likes:
4256 type: integer
4257 example: 42
4258 dislikes:
4259 type: integer
4260 example: 7
4261 nsfw:
4262 type: boolean
4263 waitTranscoding:
4264 type: boolean
4265 nullable: true
4266 state:
4267 $ref: '#/components/schemas/VideoStateConstant'
4268 scheduledUpdate:
4269 nullable: true
4270 allOf:
4271 - $ref: '#/components/schemas/VideoScheduledUpdate'
4272 blacklisted:
4273 nullable: true
4274 type: boolean
4275 blacklistedReason:
4276 nullable: true
4277 type: string
4278 account:
4279 $ref: '#/components/schemas/AccountSummary'
4280 channel:
4281 $ref: '#/components/schemas/VideoChannelSummary'
4282 userHistory:
4283 nullable: true
4284 type: object
4285 properties:
4286 currentTime:
4287 type: integer
4288 VideoDetails:
4289 allOf:
4290 - $ref: '#/components/schemas/Video'
4291 - type: object
4292 properties:
4293 descriptionPath:
4294 type: string
4295 support:
4296 type: string
4297 description: A text tell the audience how to support the video creator
4298 example: Please support my work on <insert crowdfunding plateform>! <3
4299 channel:
4300 $ref: '#/components/schemas/VideoChannel'
4301 account:
4302 $ref: '#/components/schemas/Account'
4303 tags:
4304 type: array
4305 items:
4306 type: string
4307 example: [flowers, gardening]
4308 files:
4309 type: array
4310 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'
4311 items:
4312 $ref: '#/components/schemas/VideoFile'
4313 commentsEnabled:
4314 type: boolean
4315 downloadEnabled:
4316 type: boolean
4317 trackerUrls:
4318 type: array
4319 items:
4320 type: string
4321 format: url
4322 streamingPlaylists:
4323 type: array
4324 items:
4325 $ref: '#/components/schemas/VideoStreamingPlaylists'
4326 FileRedundancyInformation:
4327 properties:
4328 id:
4329 type: integer
4330 fileUrl:
4331 type: string
4332 format: url
4333 strategy:
4334 type: string
4335 enum:
4336 - manual
4337 - most-views
4338 - trending
4339 - recently-added
4340 size:
4341 type: integer
4342 createdAt:
4343 type: string
4344 format: date-time
4345 updatedAt:
4346 type: string
4347 format: date-time
4348 expiresOn:
4349 type: string
4350 format: date-time
4351 VideoRedundancy:
4352 properties:
4353 id:
4354 type: integer
4355 name:
4356 type: string
4357 url:
4358 type: string
4359 format: url
4360 uuid:
4361 type: string
4362 format: uuid
4363 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4364 redundancies:
4365 type: object
4366 properties:
4367 files:
4368 type: array
4369 items:
4370 $ref: '#/components/schemas/FileRedundancyInformation'
4371 streamingPlaylists:
4372 type: array
4373 items:
4374 $ref: '#/components/schemas/FileRedundancyInformation'
4375 VideoImportStateConstant:
4376 properties:
4377 id:
4378 type: integer
4379 enum:
4380 - 1
4381 - 2
4382 - 3
4383 description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
4384 label:
4385 type: string
4386 example: Pending
4387 VideoImport:
4388 properties:
4389 id:
4390 type: integer
4391 example: 2
4392 targetUrl:
4393 type: string
4394 format: url
4395 example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
4396 magnetUri:
4397 type: string
4398 format: uri
4399 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
4400 torrentName:
4401 type: string
4402 state:
4403 $ref: '#/components/schemas/VideoImportStateConstant'
4404 error:
4405 type: string
4406 createdAt:
4407 type: string
4408 format: date-time
4409 updatedAt:
4410 type: string
4411 format: date-time
4412 video:
4413 $ref: '#/components/schemas/Video'
4414 Abuse:
4415 properties:
4416 id:
4417 type: integer
4418 example: 7
4419 reason:
4420 type: string
4421 example: The video is a spam
4422 predefinedReasons:
4423 $ref: '#/components/schemas/AbusePredefinedReasons'
4424 reporterAccount:
4425 $ref: '#/components/schemas/Account'
4426 state:
4427 $ref: '#/components/schemas/AbuseStateConstant'
4428 moderationComment:
4429 type: string
4430 example: Decided to ban the server since it spams us regularly
4431 video:
4432 type: object
4433 properties:
4434 id:
4435 type: integer
4436 name:
4437 type: string
4438 uuid:
4439 type: string
4440 format: uuid
4441 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4442 createdAt:
4443 type: string
4444 format: date-time
4445 AbuseMessage:
4446 properties:
4447 id:
4448 type: integer
4449 message:
4450 type: string
4451 byModerator:
4452 type: boolean
4453 createdAt:
4454 type: string
4455 format: date-time
4456 account:
4457 $ref: '#/components/schemas/AccountSummary'
4458 VideoBlacklist:
4459 properties:
4460 id:
4461 type: integer
4462 videoId:
4463 type: integer
4464 createdAt:
4465 type: string
4466 format: date-time
4467 updatedAt:
4468 type: string
4469 format: date-time
4470 name:
4471 type: string
4472 uuid:
4473 type: string
4474 format: uuid
4475 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4476 description:
4477 type: string
4478 duration:
4479 type: integer
4480 views:
4481 type: integer
4482 likes:
4483 type: integer
4484 dislikes:
4485 type: integer
4486 nsfw:
4487 type: boolean
4488 VideoChannel:
4489 properties:
4490 displayName:
4491 type: string
4492 description:
4493 type: string
4494 isLocal:
4495 type: boolean
4496 ownerAccount:
4497 type: object
4498 properties:
4499 id:
4500 type: integer
4501 uuid:
4502 type: string
4503 format: uuid
4504 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4505 VideoPlaylist:
4506 properties:
4507 id:
4508 type: integer
4509 createdAt:
4510 type: string
4511 format: date-time
4512 updatedAt:
4513 type: string
4514 format: date-time
4515 description:
4516 type: string
4517 uuid:
4518 type: string
4519 format: uuid
4520 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4521 displayName:
4522 type: string
4523 isLocal:
4524 type: boolean
4525 videoLength:
4526 type: integer
4527 thumbnailPath:
4528 type: string
4529 privacy:
4530 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
4531 type:
4532 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
4533 ownerAccount:
4534 $ref: '#/components/schemas/AccountSummary'
4535 videoChannel:
4536 $ref: '#/components/schemas/VideoChannelSummary'
4537 VideoComment:
4538 properties:
4539 id:
4540 type: integer
4541 url:
4542 type: string
4543 format: url
4544 text:
4545 type: string
4546 threadId:
4547 type: integer
4548 inReplyToCommentId:
4549 type: integer
4550 videoId:
4551 type: integer
4552 createdAt:
4553 type: string
4554 format: date-time
4555 updatedAt:
4556 type: string
4557 format: date-time
4558 totalRepliesFromVideoAuthor:
4559 type: integer
4560 totalReplies:
4561 type: integer
4562 account:
4563 $ref: '#/components/schemas/Account'
4564 VideoCommentThreadTree:
4565 properties:
4566 comment:
4567 $ref: '#/components/schemas/VideoComment'
4568 children:
4569 type: array
4570 items:
4571 $ref: '#/components/schemas/VideoCommentThreadTree'
4572 VideoCaption:
4573 properties:
4574 language:
4575 $ref: '#/components/schemas/VideoConstantString'
4576 captionPath:
4577 type: string
4578 ActorImage:
4579 properties:
4580 path:
4581 type: string
4582 createdAt:
4583 type: string
4584 format: date-time
4585 updatedAt:
4586 type: string
4587 format: date-time
4588 ActorInfo:
4589 properties:
4590 id:
4591 type: integer
4592 example: 11
4593 name:
4594 type: string
4595 displayName:
4596 type: string
4597 host:
4598 type: string
4599 format: hostname
4600 avatar:
4601 nullable: true
4602 type: object
4603 properties:
4604 path:
4605 type: string
4606 Actor:
4607 properties:
4608 id:
4609 type: integer
4610 example: 11
4611 url:
4612 type: string
4613 format: url
4614 name:
4615 type: string
4616 host:
4617 type: string
4618 format: hostname
4619 followingCount:
4620 type: integer
4621 followersCount:
4622 type: integer
4623 createdAt:
4624 type: string
4625 format: date-time
4626 updatedAt:
4627 type: string
4628 format: date-time
4629 avatar:
4630 $ref: '#/components/schemas/ActorImage'
4631 Account:
4632 allOf:
4633 - $ref: '#/components/schemas/Actor'
4634 - properties:
4635 userId:
4636 type: string
4637 example: 2
4638 displayName:
4639 type: string
4640 description:
4641 type: string
4642 UserWatchingVideo:
4643 properties:
4644 currentTime:
4645 type: integer
4646 description: timestamp within the video, in seconds
4647 example: 5
4648 ServerConfig:
4649 properties:
4650 instance:
4651 type: object
4652 properties:
4653 name:
4654 type: string
4655 shortDescription:
4656 type: string
4657 defaultClientRoute:
4658 type: string
4659 isNSFW:
4660 type: boolean
4661 defaultNSFWPolicy:
4662 type: string
4663 customizations:
4664 type: object
4665 properties:
4666 javascript:
4667 type: string
4668 css:
4669 type: string
4670 search:
4671 type: object
4672 properties:
4673 remoteUri:
4674 type: object
4675 properties:
4676 users:
4677 type: boolean
4678 anonymous:
4679 type: boolean
4680 plugin:
4681 type: object
4682 properties:
4683 registered:
4684 type: array
4685 items:
4686 type: string
4687 theme:
4688 type: object
4689 properties:
4690 registered:
4691 type: array
4692 items:
4693 type: string
4694 email:
4695 type: object
4696 properties:
4697 enabled:
4698 type: boolean
4699 contactForm:
4700 type: object
4701 properties:
4702 enabled:
4703 type: boolean
4704 serverVersion:
4705 type: string
4706 serverCommit:
4707 type: string
4708 signup:
4709 type: object
4710 properties:
4711 allowed:
4712 type: boolean
4713 allowedForCurrentIP:
4714 type: boolean
4715 requiresEmailVerification:
4716 type: boolean
4717 transcoding:
4718 type: object
4719 properties:
4720 hls:
4721 type: object
4722 properties:
4723 enabled:
4724 type: boolean
4725 webtorrent:
4726 type: object
4727 properties:
4728 enabled:
4729 type: boolean
4730 enabledResolutions:
4731 type: array
4732 items:
4733 type: integer
4734 import:
4735 type: object
4736 properties:
4737 videos:
4738 type: object
4739 properties:
4740 http:
4741 type: object
4742 properties:
4743 enabled:
4744 type: boolean
4745 torrent:
4746 type: object
4747 properties:
4748 enabled:
4749 type: boolean
4750 autoBlacklist:
4751 type: object
4752 properties:
4753 videos:
4754 type: object
4755 properties:
4756 ofUsers:
4757 type: object
4758 properties:
4759 enabled:
4760 type: boolean
4761 avatar:
4762 type: object
4763 properties:
4764 file:
4765 type: object
4766 properties:
4767 size:
4768 type: object
4769 properties:
4770 max:
4771 type: integer
4772 extensions:
4773 type: array
4774 items:
4775 type: string
4776 video:
4777 type: object
4778 properties:
4779 image:
4780 type: object
4781 properties:
4782 extensions:
4783 type: array
4784 items:
4785 type: string
4786 size:
4787 type: object
4788 properties:
4789 max:
4790 type: integer
4791 file:
4792 type: object
4793 properties:
4794 extensions:
4795 type: array
4796 items:
4797 type: string
4798 videoCaption:
4799 type: object
4800 properties:
4801 file:
4802 type: object
4803 properties:
4804 size:
4805 type: object
4806 properties:
4807 max:
4808 type: integer
4809 extensions:
4810 type: array
4811 items:
4812 type: string
4813 user:
4814 type: object
4815 properties:
4816 videoQuota:
4817 type: integer
4818 videoQuotaDaily:
4819 type: integer
4820 trending:
4821 type: object
4822 properties:
4823 videos:
4824 type: object
4825 properties:
4826 intervalDays:
4827 type: integer
4828 tracker:
4829 type: object
4830 properties:
4831 enabled:
4832 type: boolean
4833 followings:
4834 type: object
4835 properties:
4836 instance:
4837 type: object
4838 properties:
4839 autoFollowIndex:
4840 type: object
4841 properties:
4842 indexUrl:
4843 type: string
4844 format: url
4845 ServerConfigAbout:
4846 properties:
4847 instance:
4848 type: object
4849 properties:
4850 name:
4851 type: string
4852 shortDescription:
4853 type: string
4854 description:
4855 type: string
4856 terms:
4857 type: string
4858 ServerConfigCustom:
4859 properties:
4860 instance:
4861 type: object
4862 properties:
4863 name:
4864 type: string
4865 shortDescription:
4866 type: string
4867 description:
4868 type: string
4869 terms:
4870 type: string
4871 defaultClientRoute:
4872 type: string
4873 isNSFW:
4874 type: boolean
4875 defaultNSFWPolicy:
4876 type: string
4877 customizations:
4878 type: object
4879 properties:
4880 javascript:
4881 type: string
4882 css:
4883 type: string
4884 theme:
4885 type: object
4886 properties:
4887 default:
4888 type: string
4889 services:
4890 type: object
4891 properties:
4892 twitter:
4893 type: object
4894 properties:
4895 username:
4896 type: string
4897 whitelisted:
4898 type: boolean
4899 cache:
4900 type: object
4901 properties:
4902 previews:
4903 type: object
4904 properties:
4905 size:
4906 type: integer
4907 captions:
4908 type: object
4909 properties:
4910 size:
4911 type: integer
4912 signup:
4913 type: object
4914 properties:
4915 enabled:
4916 type: boolean
4917 limit:
4918 type: integer
4919 requiresEmailVerification:
4920 type: boolean
4921 admin:
4922 type: object
4923 properties:
4924 email:
4925 type: string
4926 format: email
4927 contactForm:
4928 type: object
4929 properties:
4930 enabled:
4931 type: boolean
4932 user:
4933 type: object
4934 properties:
4935 videoQuota:
4936 type: integer
4937 videoQuotaDaily:
4938 type: integer
4939 transcoding:
4940 type: object
4941 properties:
4942 enabled:
4943 type: boolean
4944 allowAdditionalExtensions:
4945 type: boolean
4946 allowAudioFiles:
4947 type: boolean
4948 threads:
4949 type: integer
4950 resolutions:
4951 type: object
4952 properties:
4953 240p:
4954 type: boolean
4955 360p:
4956 type: boolean
4957 480p:
4958 type: boolean
4959 720p:
4960 type: boolean
4961 1080p:
4962 type: boolean
4963 1440p:
4964 type: boolean
4965 2160p:
4966 type: boolean
4967 hls:
4968 type: object
4969 properties:
4970 enabled:
4971 type: boolean
4972 import:
4973 type: object
4974 properties:
4975 videos:
4976 type: object
4977 properties:
4978 http:
4979 type: object
4980 properties:
4981 enabled:
4982 type: boolean
4983 torrent:
4984 type: object
4985 properties:
4986 enabled:
4987 type: boolean
4988 autoBlacklist:
4989 type: object
4990 properties:
4991 videos:
4992 type: object
4993 properties:
4994 ofUsers:
4995 type: object
4996 properties:
4997 enabled:
4998 type: boolean
4999 followers:
5000 type: object
5001 properties:
5002 instance:
5003 type: object
5004 properties:
5005 enabled:
5006 type: boolean
5007 manualApproval:
5008 type: boolean
5009 Follow:
5010 properties:
5011 id:
5012 type: integer
5013 follower:
5014 $ref: '#/components/schemas/Actor'
5015 following:
5016 $ref: '#/components/schemas/Actor'
5017 score:
5018 type: number
5019 description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
5020 state:
5021 type: string
5022 enum:
5023 - pending
5024 - accepted
5025 createdAt:
5026 type: string
5027 format: date-time
5028 updatedAt:
5029 type: string
5030 format: date-time
5031
5032 PredefinedAbuseReasons:
5033 description: Reason categories that help triage reports
5034 type: array
5035 items:
5036 type: string
5037 enum:
5038 - violentOrAbusive
5039 - hatefulOrAbusive
5040 - spamOrMisleading
5041 - privacy
5042 - rights
5043 - serverRules
5044 - thumbnails
5045 - captions
5046
5047 Job:
5048 properties:
5049 id:
5050 type: integer
5051 minimum: 0
5052 example: 42
5053 state:
5054 type: string
5055 enum:
5056 - active
5057 - completed
5058 - failed
5059 - waiting
5060 - delayed
5061 type:
5062 type: string
5063 enum:
5064 - activitypub-http-unicast
5065 - activitypub-http-broadcast
5066 - activitypub-http-fetcher
5067 - activitypub-follow
5068 - video-file-import
5069 - video-transcoding
5070 - email
5071 - video-import
5072 - videos-views
5073 - activitypub-refresher
5074 - video-redundancy
5075 data:
5076 type: object
5077 additionalProperties: true
5078 error:
5079 type: object
5080 additionalProperties: true
5081 createdAt:
5082 type: string
5083 format: date-time
5084 finishedOn:
5085 type: string
5086 format: date-time
5087 processedOn:
5088 type: string
5089 format: date-time
5090 AddUserResponse:
5091 properties:
5092 user:
5093 type: object
5094 properties:
5095 id:
5096 type: integer
5097 example: 8
5098 account:
5099 type: object
5100 properties:
5101 id:
5102 type: integer
5103 example: 37
5104 VideoUploadResponse:
5105 properties:
5106 video:
5107 type: object
5108 properties:
5109 id:
5110 type: integer
5111 example: 8
5112 uuid:
5113 type: string
5114 format: uuid
5115 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
5116 CommentThreadResponse:
5117 properties:
5118 total:
5119 type: integer
5120 example: 1
5121 data:
5122 type: array
5123 maxItems: 100
5124 items:
5125 $ref: '#/components/schemas/VideoComment'
5126 CommentThreadPostResponse:
5127 properties:
5128 comment:
5129 $ref: '#/components/schemas/VideoComment'
5130 VideoListResponse:
5131 properties:
5132 total:
5133 type: integer
5134 example: 1
5135 data:
5136 type: array
5137 maxItems: 100
5138 items:
5139 $ref: '#/components/schemas/Video'
5140 User:
5141 properties:
5142 id:
5143 type: integer
5144 readOnly: true
5145 username:
5146 type: string
5147 description: The user username
5148 minLength: 1
5149 maxLength: 50
5150 email:
5151 type: string
5152 format: email
5153 description: The user email
5154 pluginAuth:
5155 type: string
5156 description: Auth plugin to use to authenticate the user
5157 theme:
5158 type: string
5159 description: Theme enabled by this user
5160 emailVerified:
5161 type: boolean
5162 description: Has the user confirmed their email address?
5163 nsfwPolicy:
5164 $ref: '#/components/schemas/NSFWPolicy'
5165 webtorrentEnabled:
5166 type: boolean
5167 description: Enable P2P in the player
5168 autoPlayVideo:
5169 type: boolean
5170 description: Automatically start playing the video on the watch page
5171 role:
5172 $ref: '#/components/schemas/UserRole'
5173 roleLabel:
5174 type: string
5175 enum:
5176 - User
5177 - Moderator
5178 - Administrator
5179 videoQuota:
5180 type: integer
5181 description: The user video quota
5182 videoQuotaDaily:
5183 type: integer
5184 description: The user daily video quota
5185 videosCount:
5186 type: integer
5187 abusesCount:
5188 type: integer
5189 abusesAcceptedCount:
5190 type: integer
5191 abusesCreatedCount:
5192 type: integer
5193 videoCommentsCount:
5194 type: integer
5195 noInstanceConfigWarningModal:
5196 type: boolean
5197 noWelcomeModal:
5198 type: boolean
5199 blocked:
5200 type: boolean
5201 blockedReason:
5202 type: string
5203 createdAt:
5204 type: string
5205 account:
5206 $ref: '#/components/schemas/Account'
5207 videoChannels:
5208 type: array
5209 items:
5210 $ref: '#/components/schemas/VideoChannel'
5211 AddUser:
5212 properties:
5213 username:
5214 type: string
5215 description: The user username
5216 minLength: 1
5217 maxLength: 50
5218 password:
5219 type: string
5220 format: password
5221 description: The user password. If the smtp server is configured, you can leave empty and an email will be sent
5222 minLength: 6
5223 maxLength: 255
5224 email:
5225 type: string
5226 format: email
5227 description: The user email
5228 videoQuota:
5229 type: integer
5230 description: The user video quota
5231 videoQuotaDaily:
5232 type: integer
5233 description: The user daily video quota
5234 channelName:
5235 type: string
5236 description: The user default channel username
5237 role:
5238 $ref: '#/components/schemas/UserRole'
5239 adminFlags:
5240 $ref: '#/components/schemas/UserAdminFlags'
5241 required:
5242 - username
5243 - password
5244 - email
5245 - videoQuota
5246 - videoQuotaDaily
5247 - role
5248 UpdateUser:
5249 properties:
5250 id:
5251 type: string
5252 description: The user id
5253 email:
5254 type: string
5255 format: email
5256 description: The updated email of the user
5257 emailVerified:
5258 type: boolean
5259 description: Set the email as verified
5260 videoQuota:
5261 type: integer
5262 description: The updated video quota of the user
5263 videoQuotaDaily:
5264 type: integer
5265 description: The updated daily video quota of the user
5266 pluginAuth:
5267 type: string
5268 nullable: true
5269 description: The auth plugin to use to authenticate the user
5270 example: 'peertube-plugin-auth-saml2'
5271 role:
5272 $ref: '#/components/schemas/UserRole'
5273 adminFlags:
5274 $ref: '#/components/schemas/UserAdminFlags'
5275 required:
5276 - id
5277 UpdateMe:
5278 properties:
5279 password:
5280 type: string
5281 format: password
5282 description: Your new password
5283 minLength: 6
5284 maxLength: 255
5285 email:
5286 type: string
5287 format: email
5288 description: Your new email
5289 displayNSFW:
5290 type: string
5291 description: Your new displayNSFW
5292 enum:
5293 - 'true'
5294 - 'false'
5295 - both
5296 autoPlayVideo:
5297 type: boolean
5298 description: Your new autoPlayVideo
5299 required:
5300 - password
5301 - email
5302 - displayNSFW
5303 - autoPlayVideo
5304 GetMeVideoRating:
5305 properties:
5306 id:
5307 type: string
5308 description: Id of the video
5309 rating:
5310 type: number
5311 description: Rating of the video
5312 required:
5313 - id
5314 - rating
5315 VideoRating:
5316 properties:
5317 video:
5318 $ref: '#/components/schemas/Video'
5319 rating:
5320 type: number
5321 description: 'Rating of the video'
5322 required:
5323 - video
5324 - rating
5325 RegisterUser:
5326 properties:
5327 username:
5328 type: string
5329 description: The username of the user
5330 minLength: 1
5331 maxLength: 50
5332 pattern: '/^[a-z0-9._]{1,50}$/'
5333 password:
5334 type: string
5335 format: password
5336 description: The password of the user
5337 minLength: 6
5338 maxLength: 255
5339 email:
5340 type: string
5341 format: email
5342 description: The email of the user
5343 displayName:
5344 type: string
5345 description: The user display name
5346 minLength: 1
5347 maxLength: 120
5348 channel:
5349 type: object
5350 properties:
5351 name:
5352 type: string
5353 description: The username for the default channel
5354 pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/'
5355 displayName:
5356 type: string
5357 description: The display name for the default channel
5358 minLength: 1
5359 maxLength: 120
5360 required:
5361 - username
5362 - password
5363 - email
5364 VideoChannelCreate:
5365 properties:
5366 name:
5367 type: string
5368 displayName:
5369 type: string
5370 description:
5371 type: string
5372 support:
5373 type: string
5374 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
5375 example: Please support my work on <insert crowdfunding plateform>! <3
5376 required:
5377 - name
5378 - displayName
5379 VideoChannelUpdate:
5380 properties:
5381 displayName:
5382 type: string
5383 description:
5384 type: string
5385 support:
5386 type: string
5387 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
5388 example: Please support my work on <insert crowdfunding plateform>! <3
5389 bulkVideosSupportUpdate:
5390 type: boolean
5391 description: 'Update the support field for all videos of this channel'
5392
5393 MRSSPeerLink:
5394 type: object
5395 xml:
5396 name: 'media:peerLink'
5397 properties:
5398 href:
5399 type: string
5400 xml:
5401 attribute: true
5402 type:
5403 type: string
5404 enum:
5405 - application/x-bittorrent
5406 xml:
5407 attribute: true
5408 MRSSGroupContent:
5409 type: object
5410 xml:
5411 name: 'media:content'
5412 properties:
5413 url:
5414 type: string
5415 format: url
5416 xml:
5417 attribute: true
5418 fileSize:
5419 type: integer
5420 xml:
5421 attribute: true
5422 type:
5423 type: string
5424 xml:
5425 attribute: true
5426 framerate:
5427 type: integer
5428 xml:
5429 attribute: true
5430 duration:
5431 type: integer
5432 xml:
5433 attribute: true
5434 height:
5435 type: integer
5436 xml:
5437 attribute: true
5438 lang:
5439 type: string
5440 xml:
5441 attribute: true
5442 VideoCommentsForXML:
5443 type: array
5444 xml:
5445 wrapped: true
5446 name: 'channel'
5447 items:
5448 type: object
5449 xml:
5450 name: 'item'
5451 properties:
5452 link:
5453 type: string
5454 format: url
5455 guid:
5456 type: string
5457 pubDate:
5458 type: string
5459 format: date-time
5460 'content:encoded':
5461 type: string
5462 'dc:creator':
5463 type: string
5464 VideosForXML:
5465 type: array
5466 xml:
5467 wrapped: true
5468 name: 'channel'
5469 items:
5470 type: object
5471 xml:
5472 name: 'item'
5473 properties:
5474 link:
5475 type: string
5476 format: url
5477 description: video watch page URL
5478 guid:
5479 type: string
5480 description: video canonical URL
5481 pubDate:
5482 type: string
5483 format: date-time
5484 description: video publication date
5485 description:
5486 type: string
5487 description: video description
5488 'content:encoded':
5489 type: string
5490 description: video description
5491 'dc:creator':
5492 type: string
5493 description: publisher user name
5494 'media:category':
5495 type: integer
5496 description: video category (MRSS)
5497 'media:community':
5498 type: object
5499 description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
5500 properties:
5501 'media:statistics':
5502 type: object
5503 properties:
5504 views:
5505 type: integer
5506 xml:
5507 attribute: true
5508 'media:embed':
5509 type: object
5510 properties:
5511 url:
5512 type: string
5513 format: url
5514 description: video embed path, relative to the canonical URL domain (MRSS)
5515 xml:
5516 attribute: true
5517 'media:player':
5518 type: object
5519 properties:
5520 url:
5521 type: string
5522 format: url
5523 description: video watch path, relative to the canonical URL domain (MRSS)
5524 xml:
5525 attribute: true
5526 'media:thumbnail':
5527 type: object
5528 properties:
5529 url:
5530 type: string
5531 format: url
5532 xml:
5533 attribute: true
5534 height:
5535 type: integer
5536 xml:
5537 attribute: true
5538 width:
5539 type: integer
5540 xml:
5541 attribute: true
5542 'media:title':
5543 type: string
5544 description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
5545 'media:description':
5546 type: string
5547 'media:rating':
5548 type: string
5549 enum:
5550 - nonadult
5551 - adult
5552 description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
5553 'enclosure':
5554 type: object
5555 description: main streamable file for the video
5556 properties:
5557 url:
5558 type: string
5559 format: url
5560 xml:
5561 attribute: true
5562 type:
5563 type: string
5564 enum:
5565 - application/x-bittorrent
5566 xml:
5567 attribute: true
5568 length:
5569 type: integer
5570 xml:
5571 attribute: true
5572 'media:group':
5573 type: array
5574 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)
5575 items:
5576 anyOf:
5577 - $ref: '#/components/schemas/MRSSPeerLink'
5578 - $ref: '#/components/schemas/MRSSGroupContent'
5579 NotificationSettingValue:
5580 type: integer
5581 description: >
5582 Notification type
5583
5584 - `0` NONE
5585
5586 - `1` WEB
5587
5588 - `2` EMAIL
5589 enum:
5590 - 0
5591 - 1
5592 - 3
5593 Notification:
5594 properties:
5595 id:
5596 type: integer
5597 type:
5598 type: integer
5599 description: >
5600 Notification type, following the `UserNotificationType` enum:
5601
5602 - `1` NEW_VIDEO_FROM_SUBSCRIPTION
5603
5604 - `2` NEW_COMMENT_ON_MY_VIDEO
5605
5606 - `3` NEW_ABUSE_FOR_MODERATORS
5607
5608 - `4` BLACKLIST_ON_MY_VIDEO
5609
5610 - `5` UNBLACKLIST_ON_MY_VIDEO
5611
5612 - `6` MY_VIDEO_PUBLISHED
5613
5614 - `7` MY_VIDEO_IMPORT_SUCCESS
5615
5616 - `8` MY_VIDEO_IMPORT_ERROR
5617
5618 - `9` NEW_USER_REGISTRATION
5619
5620 - `10` NEW_FOLLOW
5621
5622 - `11` COMMENT_MENTION
5623
5624 - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
5625
5626 - `13` NEW_INSTANCE_FOLLOWER
5627
5628 - `14` AUTO_INSTANCE_FOLLOWING
5629 read:
5630 type: boolean
5631 video:
5632 nullable: true
5633 allOf:
5634 - $ref: '#/components/schemas/VideoInfo'
5635 - type: object
5636 properties:
5637 channel:
5638 $ref: '#/components/schemas/ActorInfo'
5639 videoImport:
5640 nullable: true
5641 type: object
5642 properties:
5643 id:
5644 type: integer
5645 video:
5646 nullable: true
5647 $ref: '#/components/schemas/VideoInfo'
5648 torrentName:
5649 type: string
5650 nullable: true
5651 magnetUri:
5652 type: string
5653 format: uri
5654 nullable: true
5655 targetUri:
5656 type: string
5657 format: uri
5658 nullable: true
5659 comment:
5660 nullable: true
5661 type: object
5662 properties:
5663 id:
5664 type: integer
5665 threadId:
5666 type: integer
5667 video:
5668 $ref: '#/components/schemas/VideoInfo'
5669 account:
5670 $ref: '#/components/schemas/ActorInfo'
5671 videoAbuse:
5672 nullable: true
5673 type: object
5674 properties:
5675 id:
5676 type: integer
5677 video:
5678 allOf:
5679 - $ref: '#/components/schemas/VideoInfo'
5680 videoBlacklist:
5681 nullable: true
5682 type: object
5683 properties:
5684 id:
5685 type: integer
5686 video:
5687 allOf:
5688 - $ref: '#/components/schemas/VideoInfo'
5689 account:
5690 nullable: true
5691 allOf:
5692 - $ref: '#/components/schemas/ActorInfo'
5693 actorFollow:
5694 type: object
5695 nullable: true
5696 properties:
5697 id:
5698 type: integer
5699 follower:
5700 $ref: '#/components/schemas/ActorInfo'
5701 state:
5702 type: string
5703 enum:
5704 - pending
5705 - accepted
5706 following:
5707 type: object
5708 properties:
5709 type:
5710 type: string
5711 enum:
5712 - account
5713 - channel
5714 - instance
5715 name:
5716 type: string
5717 displayName:
5718 type: string
5719 host:
5720 type: string
5721 format: hostname
5722 createdAt:
5723 type: string
5724 format: date-time
5725 updatedAt:
5726 type: string
5727 format: date-time
5728 NotificationListResponse:
5729 properties:
5730 total:
5731 type: integer
5732 example: 1
5733 data:
5734 type: array
5735 maxItems: 100
5736 items:
5737 $ref: '#/components/schemas/Notification'
5738 Plugin:
5739 properties:
5740 name:
5741 type: string
5742 example: peertube-plugin-auth-ldap
5743 type:
5744 type: integer
5745 description: >
5746 - `1`: PLUGIN
5747
5748 - `2`: THEME
5749 enum:
5750 - 1
5751 - 2
5752 latestVersion:
5753 type: string
5754 example: 0.0.3
5755 version:
5756 type: string
5757 example: 0.0.1
5758 enabled:
5759 type: boolean
5760 uninstalled:
5761 type: boolean
5762 peertubeEngine:
5763 type: string
5764 example: 2.2.0
5765 description:
5766 type: string
5767 homepage:
5768 type: string
5769 format: url
5770 example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap
5771 settings:
5772 type: object
5773 additionalProperties: true
5774 createdAt:
5775 type: string
5776 format: date-time
5777 updatedAt:
5778 type: string
5779 format: date-time
5780 PluginResponse:
5781 properties:
5782 total:
5783 type: integer
5784 example: 1
5785 data:
5786 type: array
5787 maxItems: 100
5788 items:
5789 $ref: '#/components/schemas/Plugin'
5790
5791 LiveVideoUpdate:
5792 properties:
5793 saveReplay:
5794 type: boolean
5795 permanentLive:
5796 description: User can stream multiple times in a permanent live
5797 type: boolean
5798
5799 LiveVideoResponse:
5800 properties:
5801 rtmpUrl:
5802 type: string
5803 streamKey:
5804 type: string
5805 description: RTMP stream key to use to stream into this live video
5806 saveReplay:
5807 type: boolean
5808 permanentLive:
5809 description: User can stream multiple times in a permanent live
5810 type: boolean
5811
5812
5813
5814 callbacks:
5815 searchIndex:
5816 'https://search.example.org/api/v1/search/videos':
5817 post:
5818 summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`
5819 responses:
5820 '200':
5821 description: successful operation
5822 content:
5823 application/json:
5824 schema:
5825 $ref: '#/components/schemas/VideoListResponse'