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