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