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