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