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