]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/doc/api/openapi.yaml
ac44cf91d1eec9f4fa3959ef8d6cf8246d6937c4
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
1 openapi: 3.0.0
2 info:
3 title: PeerTube
4 version: 2.2.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 # Errors
35
36 The API uses standard HTTP status codes to indicate the success or failure
37 of the API call. The body of the response will be JSON in the following
38 format.
39
40 ```
41 {
42 "code": "unauthorized_request", // example inner error code
43 "error": "Token is invalid." // example exposed error message
44 }
45 ```
46 externalDocs:
47 url: https://docs.joinpeertube.org/api-rest-reference.html
48 tags:
49 - name: Accounts
50 description: >
51 Using some features of PeerTube require authentication, for which Accounts
52 provide different levels of permission as well as associated user
53 information. Accounts also encompass remote accounts discovered across the federation.
54 - name: Config
55 description: >
56 Each server exposes public information regarding supported videos and
57 options.
58 - name: Job
59 description: >
60 Jobs are long-running tasks enqueued and processed by the instance
61 itself. No additional worker registration is currently available.
62 - name: Instance Follows
63 description: >
64 Managing servers which the instance interacts with is crucial to the
65 concept of federation in PeerTube and external video indexation. The PeerTube
66 server then deals with inter-server ActivityPub operations and propagates
67 information across its social graph by posting activities to actors' inbox
68 endpoints.
69 - name: Video Abuses
70 description: |
71 Video abuses deal with reports of local or remote videos alike.
72 - name: Video
73 description: |
74 Operations dealing with listing, uploading, fetching or modifying videos.
75 - name: Search
76 description: |
77 The search helps to find _videos_ or _channels_ from within the instance and beyond.
78 Videos from other instances federated by the instance (that is, instances
79 followed by the instance) can be found via keywords and other criteria of
80 the advanced search.
81
82 Administrators can also enable the use of a remote search system, indexing
83 videos and channels not could be not federated by the instance.
84 - name: Video Comments
85 description: >
86 Operations dealing with comments to a video. Comments are organized in
87 threads.
88 - name: Video Playlists
89 description: >
90 Operations dealing with playlists of videos. Playlists are bound to users
91 and/or channels.
92 - name: Video Channels
93 description: >
94 Operations dealing with the creation, modification and listing of videos within a channel.
95 - name: Video Blocks
96 description: >
97 Operations dealing with blocking videos (removing them from view and
98 preventing interactions).
99 - name: Video Rates
100 description: >
101 Like/dislike a video.
102 - name: Feeds
103 description: >
104 Server syndication feeds
105 x-tagGroups:
106 - name: Accounts
107 tags:
108 - Accounts
109 - Users
110 - My User
111 - My Subscriptions
112 - name: Videos
113 tags:
114 - Video
115 - Video Caption
116 - Video Channels
117 - Video Comments
118 - Video Rates
119 - Video Playlists
120 - Video Ownership Change
121 - Feeds
122 - name: Search
123 tags:
124 - Search
125 - name: Moderation
126 tags:
127 - Video Abuses
128 - Video Blocks
129 - Account Blocks
130 - Server Blocks
131 - name: Instance Configuration
132 tags:
133 - Config
134 - Instance Follows
135 - name: Jobs
136 tags:
137 - Job
138 paths:
139 '/accounts/{name}':
140 get:
141 tags:
142 - Accounts
143 summary: Get an account
144 parameters:
145 - $ref: '#/components/parameters/name'
146 responses:
147 '200':
148 description: successful operation
149 content:
150 application/json:
151 schema:
152 $ref: '#/components/schemas/Account'
153 '404':
154 description: account not found
155 '/accounts/{name}/videos':
156 get:
157 tags:
158 - Accounts
159 - Video
160 summary: 'List videos of an account'
161 parameters:
162 - $ref: '#/components/parameters/name'
163 - $ref: '#/components/parameters/categoryOneOf'
164 - $ref: '#/components/parameters/tagsOneOf'
165 - $ref: '#/components/parameters/tagsAllOf'
166 - $ref: '#/components/parameters/licenceOneOf'
167 - $ref: '#/components/parameters/languageOneOf'
168 - $ref: '#/components/parameters/nsfw'
169 - $ref: '#/components/parameters/filter'
170 - $ref: '#/components/parameters/skipCount'
171 - $ref: '#/components/parameters/start'
172 - $ref: '#/components/parameters/count'
173 - $ref: '#/components/parameters/videosSort'
174 responses:
175 '200':
176 description: successful operation
177 content:
178 application/json:
179 schema:
180 $ref: '#/components/schemas/VideoListResponse'
181 x-code-samples:
182 - lang: JavaScript
183 source: |
184 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
185 .then(function(response) {
186 return response.json()
187 }).then(function(data) {
188 console.log(data)
189 })
190 - lang: Shell
191 source: |
192 # pip install httpie
193 http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
194 - lang: Ruby
195 source: |
196 require 'net/http'
197 require 'json'
198
199 uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
200
201 http = Net::HTTP.new(uri.host, uri.port)
202 http.use_ssl = true
203
204 response = http.get(uri.request_uri)
205
206 puts JSON.parse(response.read_body)
207 - lang: Python
208 source: |
209 import requests
210
211 r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
212 json = r.json()
213
214 print(json)
215 /accounts:
216 get:
217 tags:
218 - Accounts
219 summary: List accounts
220 parameters:
221 - $ref: '#/components/parameters/start'
222 - $ref: '#/components/parameters/count'
223 - $ref: '#/components/parameters/sort'
224 responses:
225 '200':
226 description: successful operation
227 content:
228 'application/json':
229 schema:
230 type: array
231 items:
232 $ref: '#/components/schemas/Account'
233 /config:
234 get:
235 tags:
236 - Config
237 summary: Get instance public configuration
238 responses:
239 '200':
240 description: successful operation
241 content:
242 application/json:
243 schema:
244 $ref: '#/components/schemas/ServerConfig'
245 /config/about:
246 get:
247 summary: Get instance "About" information
248 tags:
249 - Config
250 responses:
251 '200':
252 description: successful operation
253 content:
254 application/json:
255 schema:
256 $ref: '#/components/schemas/ServerConfigAbout'
257 /config/custom:
258 get:
259 summary: Get instance runtime configuration
260 tags:
261 - Config
262 security:
263 - OAuth2:
264 - admin
265 responses:
266 '200':
267 description: successful operation
268 content:
269 application/json:
270 schema:
271 $ref: '#/components/schemas/ServerConfigCustom'
272 put:
273 summary: Set instance runtime configuration
274 tags:
275 - Config
276 security:
277 - OAuth2:
278 - admin
279 responses:
280 '200':
281 description: successful operation
282 delete:
283 summary: Delete instance runtime configuration
284 tags:
285 - Config
286 security:
287 - OAuth2:
288 - admin
289 responses:
290 '200':
291 description: successful operation
292 /jobs/{state}:
293 get:
294 summary: List instance jobs
295 security:
296 - OAuth2:
297 - admin
298 tags:
299 - Job
300 parameters:
301 - name: state
302 in: path
303 required: true
304 description: The state of the job
305 schema:
306 type: string
307 enum:
308 - active
309 - completed
310 - failed
311 - waiting
312 - delayed
313 - $ref: '#/components/parameters/start'
314 - $ref: '#/components/parameters/count'
315 - $ref: '#/components/parameters/sort'
316 responses:
317 '200':
318 description: successful operation
319 content:
320 application/json:
321 schema:
322 type: array
323 items:
324 $ref: '#/components/schemas/Job'
325 '/server/following/{host}':
326 delete:
327 security:
328 - OAuth2:
329 - admin
330 tags:
331 - Instance Follows
332 summary: Unfollow a server
333 parameters:
334 - name: host
335 in: path
336 required: true
337 description: 'The host to unfollow '
338 schema:
339 type: string
340 responses:
341 '201':
342 description: successful operation
343 /server/followers:
344 get:
345 tags:
346 - Instance Follows
347 summary: List instance followers
348 parameters:
349 - $ref: '#/components/parameters/start'
350 - $ref: '#/components/parameters/count'
351 - $ref: '#/components/parameters/sort'
352 responses:
353 '200':
354 description: successful operation
355 content:
356 application/json:
357 schema:
358 type: array
359 items:
360 $ref: '#/components/schemas/Follow'
361 /server/following:
362 get:
363 tags:
364 - Instance Follows
365 summary: List instance followings
366 parameters:
367 - $ref: '#/components/parameters/start'
368 - $ref: '#/components/parameters/count'
369 - $ref: '#/components/parameters/sort'
370 responses:
371 '200':
372 description: successful operation
373 content:
374 application/json:
375 schema:
376 type: array
377 items:
378 $ref: '#/components/schemas/Follow'
379 post:
380 security:
381 - OAuth2:
382 - admin
383 tags:
384 - Instance Follows
385 summary: Follow a server
386 responses:
387 '204':
388 description: successful operation
389 requestBody:
390 content:
391 application/json:
392 schema:
393 $ref: '#/components/schemas/Follow'
394 /users:
395 post:
396 summary: Create a user
397 security:
398 - OAuth2:
399 - admin
400 tags:
401 - Users
402 responses:
403 '200':
404 description: successful operation
405 content:
406 application/json:
407 schema:
408 $ref: '#/components/schemas/AddUserResponse'
409 requestBody:
410 content:
411 application/json:
412 schema:
413 $ref: '#/components/schemas/AddUser'
414 description: User to create
415 required: true
416 get:
417 summary: List users
418 security:
419 - OAuth2: []
420 tags:
421 - Users
422 parameters:
423 - $ref: '#/components/parameters/start'
424 - $ref: '#/components/parameters/count'
425 - $ref: '#/components/parameters/usersSort'
426 responses:
427 '200':
428 description: successful operation
429 content:
430 application/json:
431 schema:
432 type: array
433 items:
434 $ref: '#/components/schemas/User'
435 '/users/{id}':
436 delete:
437 summary: Delete a user
438 security:
439 - OAuth2:
440 - admin
441 tags:
442 - Users
443 parameters:
444 - $ref: '#/components/parameters/id'
445 responses:
446 '204':
447 description: successful operation
448 get:
449 summary: Get a user
450 security:
451 - OAuth2: []
452 tags:
453 - Users
454 parameters:
455 - $ref: '#/components/parameters/id'
456 responses:
457 '200':
458 description: successful operation
459 content:
460 application/json:
461 schema:
462 $ref: '#/components/schemas/User'
463 put:
464 summary: Update a user
465 security:
466 - OAuth2: []
467 tags:
468 - Users
469 parameters:
470 - $ref: '#/components/parameters/id'
471 responses:
472 '204':
473 description: successful operation
474 requestBody:
475 content:
476 application/json:
477 schema:
478 $ref: '#/components/schemas/UpdateUser'
479 required: true
480 /users/register:
481 post:
482 summary: Register a user
483 tags:
484 - Users
485 responses:
486 '204':
487 description: successful operation
488 requestBody:
489 content:
490 application/json:
491 schema:
492 $ref: '#/components/schemas/RegisterUser'
493 required: true
494 /users/me:
495 get:
496 summary: Get my user information
497 security:
498 - OAuth2:
499 - user
500 tags:
501 - My User
502 responses:
503 '200':
504 description: successful operation
505 content:
506 application/json:
507 schema:
508 type: array
509 items:
510 $ref: '#/components/schemas/User'
511 put:
512 summary: Update my user information
513 security:
514 - OAuth2:
515 - user
516 tags:
517 - My User
518 responses:
519 '204':
520 description: successful operation
521 requestBody:
522 content:
523 application/json:
524 schema:
525 $ref: '#/components/schemas/UpdateMe'
526 required: true
527 /users/me/videos/imports:
528 get:
529 summary: Get video imports of my user
530 security:
531 - OAuth2:
532 - user
533 tags:
534 - Videos
535 - My User
536 parameters:
537 - $ref: '#/components/parameters/start'
538 - $ref: '#/components/parameters/count'
539 - $ref: '#/components/parameters/sort'
540 responses:
541 '200':
542 description: successful operation
543 content:
544 application/json:
545 schema:
546 $ref: '#/components/schemas/VideoImport'
547 /users/me/video-quota-used:
548 get:
549 summary: Get my user used quota
550 security:
551 - OAuth2:
552 - user
553 tags:
554 - My User
555 responses:
556 '200':
557 description: successful operation
558 content:
559 application/json:
560 schema:
561 type: number
562 '/users/me/videos/{videoId}/rating':
563 get:
564 summary: Get rate of my user for a video
565 security:
566 - OAuth2: []
567 tags:
568 - My User
569 - Video Rates
570 parameters:
571 - name: videoId
572 in: path
573 required: true
574 description: 'The video id '
575 schema:
576 type: string
577 responses:
578 '200':
579 description: successful operation
580 content:
581 application/json:
582 schema:
583 $ref: '#/components/schemas/GetMeVideoRating'
584 /users/me/videos:
585 get:
586 summary: Get videos of my user
587 security:
588 - OAuth2:
589 - user
590 tags:
591 - My User
592 - Videos
593 parameters:
594 - $ref: '#/components/parameters/start'
595 - $ref: '#/components/parameters/count'
596 - $ref: '#/components/parameters/sort'
597 responses:
598 '200':
599 description: successful operation
600 content:
601 application/json:
602 schema:
603 $ref: '#/components/schemas/VideoListResponse'
604 /users/me/subscriptions:
605 get:
606 summary: Get my user subscriptions
607 security:
608 - OAuth2:
609 - user
610 tags:
611 - My Subscriptions
612 parameters:
613 - $ref: '#/components/parameters/start'
614 - $ref: '#/components/parameters/count'
615 - $ref: '#/components/parameters/sort'
616 responses:
617 '200':
618 description: successful operation
619 post:
620 summary: Add subscription to my user
621 security:
622 - OAuth2:
623 - user
624 tags:
625 - My Subscriptions
626 responses:
627 '200':
628 description: successful operation
629 /users/me/subscriptions/exist:
630 get:
631 summary: Get if subscriptions exist for my user
632 security:
633 - OAuth2:
634 - user
635 tags:
636 - My Subscriptions
637 parameters:
638 - $ref: '#/components/parameters/subscriptionsUris'
639 responses:
640 '200':
641 description: successful operation
642 content:
643 application/json:
644 schema:
645 type: object
646 /users/me/subscriptions/videos:
647 get:
648 summary: List videos of subscriptions of my user
649 security:
650 - OAuth2:
651 - user
652 tags:
653 - My Subscriptions
654 - Videos
655 parameters:
656 - $ref: '#/components/parameters/categoryOneOf'
657 - $ref: '#/components/parameters/tagsOneOf'
658 - $ref: '#/components/parameters/tagsAllOf'
659 - $ref: '#/components/parameters/licenceOneOf'
660 - $ref: '#/components/parameters/languageOneOf'
661 - $ref: '#/components/parameters/nsfw'
662 - $ref: '#/components/parameters/filter'
663 - $ref: '#/components/parameters/skipCount'
664 - $ref: '#/components/parameters/start'
665 - $ref: '#/components/parameters/count'
666 - $ref: '#/components/parameters/videosSort'
667 responses:
668 '200':
669 description: successful operation
670 content:
671 application/json:
672 schema:
673 $ref: '#/components/schemas/VideoListResponse'
674 '/users/me/subscriptions/{subscriptionHandle}':
675 get:
676 summary: Get subscription of my user
677 security:
678 - OAuth2:
679 - user
680 tags:
681 - My Subscriptions
682 parameters:
683 - $ref: '#/components/parameters/subscriptionHandle'
684 responses:
685 '200':
686 description: successful operation
687 content:
688 application/json:
689 schema:
690 $ref: '#/components/schemas/VideoChannel'
691 delete:
692 summary: Delete subscription of my user
693 security:
694 - OAuth2:
695 - user
696 tags:
697 - My Subscriptions
698 parameters:
699 - $ref: '#/components/parameters/subscriptionHandle'
700 responses:
701 '200':
702 description: successful operation
703 /users/me/avatar/pick:
704 post:
705 summary: Update my user avatar
706 security:
707 - OAuth2: []
708 tags:
709 - My User
710 responses:
711 '200':
712 description: successful operation
713 content:
714 application/json:
715 schema:
716 $ref: '#/components/schemas/Avatar'
717 requestBody:
718 content:
719 multipart/form-data:
720 schema:
721 type: object
722 properties:
723 avatarfile:
724 description: The file to upload.
725 type: string
726 format: binary
727 encoding:
728 avatarfile:
729 contentType: image/png, image/jpeg
730 /videos/ownership:
731 get:
732 summary: List video ownership changes
733 tags:
734 - Video Ownership Change
735 security:
736 - OAuth2: []
737 responses:
738 '200':
739 description: successful operation
740 '/videos/ownership/{id}/accept':
741 post:
742 summary: Accept ownership change request
743 tags:
744 - Video Ownership Change
745 security:
746 - OAuth2: []
747 parameters:
748 - $ref: '#/components/parameters/idOrUUID'
749 responses:
750 '204':
751 description: successful operation
752 '403':
753 description: cannot terminate an ownership change of another user
754 '404':
755 description: video owneship change not found
756 '/videos/ownership/{id}/refuse':
757 post:
758 summary: Refuse ownership change request
759 tags:
760 - Video Ownership Change
761 security:
762 - OAuth2: []
763 parameters:
764 - $ref: '#/components/parameters/idOrUUID'
765 responses:
766 '204':
767 description: successful operation
768 '403':
769 description: cannot terminate an ownership change of another user
770 '404':
771 description: video owneship change not found
772 '/videos/{id}/give-ownership':
773 post:
774 summary: Request ownership change
775 tags:
776 - Video Ownership Change
777 security:
778 - OAuth2: []
779 parameters:
780 - $ref: '#/components/parameters/idOrUUID'
781 requestBody:
782 required: true
783 content:
784 application/x-www-form-urlencoded:
785 schema:
786 type: object
787 properties:
788 username:
789 type: string
790 required:
791 - username
792 responses:
793 '204':
794 description: successful operation
795 '400':
796 description: changing video ownership to a remote account is not supported yet
797 '404':
798 description: video not found
799 /videos:
800 get:
801 summary: List videos
802 tags:
803 - Video
804 parameters:
805 - $ref: '#/components/parameters/categoryOneOf'
806 - $ref: '#/components/parameters/tagsOneOf'
807 - $ref: '#/components/parameters/tagsAllOf'
808 - $ref: '#/components/parameters/licenceOneOf'
809 - $ref: '#/components/parameters/languageOneOf'
810 - $ref: '#/components/parameters/nsfw'
811 - $ref: '#/components/parameters/filter'
812 - $ref: '#/components/parameters/skipCount'
813 - $ref: '#/components/parameters/start'
814 - $ref: '#/components/parameters/count'
815 - $ref: '#/components/parameters/videosSort'
816 responses:
817 '200':
818 description: successful operation
819 content:
820 application/json:
821 schema:
822 $ref: '#/components/schemas/VideoListResponse'
823 /videos/categories:
824 get:
825 summary: List available video categories
826 tags:
827 - Video
828 responses:
829 '200':
830 description: successful operation
831 content:
832 application/json:
833 schema:
834 type: array
835 items:
836 type: string
837 /videos/licences:
838 get:
839 summary: List available video licences
840 tags:
841 - Video
842 responses:
843 '200':
844 description: successful operation
845 content:
846 application/json:
847 schema:
848 type: array
849 items:
850 type: string
851 /videos/languages:
852 get:
853 summary: List available video languages
854 tags:
855 - Video
856 responses:
857 '200':
858 description: successful operation
859 content:
860 application/json:
861 schema:
862 type: array
863 items:
864 type: string
865 /videos/privacies:
866 get:
867 summary: List available video privacies
868 tags:
869 - Video
870 responses:
871 '200':
872 description: successful operation
873 content:
874 application/json:
875 schema:
876 type: array
877 items:
878 type: string
879 '/videos/{id}':
880 put:
881 summary: Update a video
882 security:
883 - OAuth2: []
884 tags:
885 - Video
886 parameters:
887 - $ref: '#/components/parameters/idOrUUID'
888 responses:
889 '204':
890 description: successful operation
891 requestBody:
892 content:
893 multipart/form-data:
894 schema:
895 type: object
896 properties:
897 thumbnailfile:
898 description: Video thumbnail file
899 type: string
900 format: binary
901 previewfile:
902 description: Video preview file
903 type: string
904 format: binary
905 category:
906 description: Video category
907 type: string
908 licence:
909 description: Video licence
910 type: string
911 language:
912 description: Video language
913 type: string
914 privacy:
915 $ref: '#/components/schemas/VideoPrivacySet'
916 description:
917 description: Video description
918 type: string
919 waitTranscoding:
920 description: Whether or not we wait transcoding before publish the video
921 type: string
922 support:
923 description: Text describing how to support the video uploader
924 type: string
925 nsfw:
926 description: Whether or not this video contains sensitive content
927 type: string
928 name:
929 description: Video name
930 type: string
931 tags:
932 description: Video tags (maximum 5 tags each between 2 and 30 characters)
933 type: array
934 minItems: 1
935 maxItems: 5
936 items:
937 type: string
938 minLength: 2
939 maxLength: 30
940 commentsEnabled:
941 description: Enable or disable comments for this video
942 type: string
943 originallyPublishedAt:
944 description: Date when the content was originally published
945 type: string
946 format: date-time
947 scheduleUpdate:
948 $ref: '#/components/schemas/VideoScheduledUpdate'
949 encoding:
950 thumbnailfile:
951 contentType: image/jpeg
952 previewfile:
953 contentType: image/jpeg
954 get:
955 summary: Get a video
956 tags:
957 - Video
958 parameters:
959 - $ref: '#/components/parameters/idOrUUID'
960 responses:
961 '200':
962 description: successful operation
963 content:
964 application/json:
965 schema:
966 $ref: '#/components/schemas/VideoDetails'
967 delete:
968 summary: Delete a video
969 security:
970 - OAuth2: []
971 tags:
972 - Video
973 parameters:
974 - $ref: '#/components/parameters/idOrUUID'
975 responses:
976 '204':
977 description: successful operation
978 '/videos/{id}/description':
979 get:
980 summary: Get complete video description
981 tags:
982 - Video
983 parameters:
984 - $ref: '#/components/parameters/idOrUUID'
985 responses:
986 '200':
987 description: successful operation
988 content:
989 application/json:
990 schema:
991 type: string
992 '/videos/{id}/views':
993 post:
994 summary: Add a view to a video
995 tags:
996 - Video
997 parameters:
998 - $ref: '#/components/parameters/idOrUUID'
999 responses:
1000 '204':
1001 description: successful operation
1002 '/videos/{id}/watching':
1003 put:
1004 summary: Set watching progress of a video
1005 tags:
1006 - Video
1007 security:
1008 - OAuth2: []
1009 parameters:
1010 - $ref: '#/components/parameters/idOrUUID'
1011 requestBody:
1012 content:
1013 application/json:
1014 schema:
1015 $ref: '#/components/schemas/UserWatchingVideo'
1016 required: true
1017 responses:
1018 '204':
1019 description: successful operation
1020 /videos/upload:
1021 post:
1022 summary: Upload a video
1023 security:
1024 - OAuth2: []
1025 tags:
1026 - Video
1027 responses:
1028 '200':
1029 description: successful operation
1030 content:
1031 application/json:
1032 schema:
1033 $ref: '#/components/schemas/VideoUploadResponse'
1034 '403':
1035 description: 'The user video quota is exceeded with this video.'
1036 '408':
1037 description: 'Upload has timed out'
1038 '422':
1039 description: 'Invalid input file.'
1040 requestBody:
1041 content:
1042 multipart/form-data:
1043 schema:
1044 type: object
1045 properties:
1046 videofile:
1047 description: Video file
1048 type: string
1049 format: binary
1050 channelId:
1051 description: Channel id that will contain this video
1052 type: integer
1053 thumbnailfile:
1054 description: Video thumbnail file
1055 type: string
1056 format: binary
1057 previewfile:
1058 description: Video preview file
1059 type: string
1060 format: binary
1061 privacy:
1062 $ref: '#/components/schemas/VideoPrivacySet'
1063 category:
1064 description: Video category
1065 type: string
1066 licence:
1067 description: Video licence
1068 type: string
1069 language:
1070 description: Video language
1071 type: string
1072 description:
1073 description: Video description
1074 type: string
1075 waitTranscoding:
1076 description: Whether or not we wait transcoding before publish the video
1077 type: string
1078 support:
1079 description: Text describing how to support the video uploader
1080 type: string
1081 nsfw:
1082 description: Whether or not this video contains sensitive content
1083 type: string
1084 name:
1085 description: Video name
1086 type: string
1087 tags:
1088 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1089 type: array
1090 minItems: 1
1091 maxItems: 5
1092 uniqueItems: true
1093 items:
1094 type: string
1095 minLength: 2
1096 maxLength: 30
1097 commentsEnabled:
1098 description: Enable or disable comments for this video
1099 type: string
1100 originallyPublishedAt:
1101 description: Date when the content was originally published
1102 type: string
1103 format: date-time
1104 scheduleUpdate:
1105 $ref: '#/components/schemas/VideoScheduledUpdate'
1106 required:
1107 - videofile
1108 - channelId
1109 - name
1110 encoding:
1111 videofile:
1112 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
1113 thumbnailfile:
1114 contentType: image/jpeg
1115 previewfile:
1116 contentType: image/jpeg
1117 x-code-samples:
1118 - lang: Shell
1119 source: |
1120 ## DEPENDENCIES: httpie, jq
1121 # pip install httpie
1122 USERNAME="<your_username>"
1123 PASSWORD="<your_password>"
1124 FILE_PATH="<your_file_path>"
1125 CHANNEL_ID="<your_channel_id>"
1126 NAME="<video_name>"
1127
1128 API_PATH="https://peertube2.cpy.re/api/v1"
1129 ## AUTH
1130 client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1131 client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1132 token=$(http -b --form POST "$API_PATH/users/token" \
1133 client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
1134 username=$USERNAME \
1135 password=$PASSWORD \
1136 | jq -r ".access_token")
1137 ## VIDEO UPLOAD
1138 http -b --form POST "$API_PATH/videos/upload" \
1139 videofile@$FILE_PATH \
1140 channelId=$CHANNEL_ID \
1141 name=$NAME \
1142 "Authorization:Bearer $token"
1143 /videos/imports:
1144 post:
1145 summary: Import a video
1146 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
1147 security:
1148 - OAuth2: []
1149 tags:
1150 - Video
1151 requestBody:
1152 content:
1153 multipart/form-data:
1154 schema:
1155 type: object
1156 properties:
1157 torrentfile:
1158 description: Torrent File
1159 type: string
1160 format: binary
1161 targetUrl:
1162 description: HTTP target URL
1163 type: string
1164 magnetUri:
1165 description: Magnet URI
1166 type: string
1167 channelId:
1168 description: Channel id that will contain this video
1169 type: integer
1170 thumbnailfile:
1171 description: Video thumbnail file
1172 type: string
1173 format: binary
1174 previewfile:
1175 description: Video preview file
1176 type: string
1177 format: binary
1178 privacy:
1179 $ref: '#/components/schemas/VideoPrivacySet'
1180 category:
1181 description: Video category
1182 type: string
1183 licence:
1184 description: Video licence
1185 type: string
1186 language:
1187 description: Video language
1188 type: string
1189 description:
1190 description: Video description
1191 type: string
1192 waitTranscoding:
1193 description: Whether or not we wait transcoding before publish the video
1194 type: string
1195 support:
1196 description: Text describing how to support the video uploader
1197 type: string
1198 nsfw:
1199 description: Whether or not this video contains sensitive content
1200 type: string
1201 name:
1202 description: Video name
1203 type: string
1204 tags:
1205 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1206 type: array
1207 minItems: 1
1208 maxItems: 5
1209 items:
1210 type: string
1211 minLength: 2
1212 maxLength: 30
1213 commentsEnabled:
1214 description: Enable or disable comments for this video
1215 type: string
1216 scheduleUpdate:
1217 $ref: '#/components/schemas/VideoScheduledUpdate'
1218 required:
1219 - channelId
1220 - name
1221 encoding:
1222 torrentfile:
1223 contentType: application/x-bittorrent
1224 thumbnailfile:
1225 contentType: image/jpeg
1226 previewfile:
1227 contentType: image/jpeg
1228 responses:
1229 '200':
1230 description: successful operation
1231 content:
1232 application/json:
1233 schema:
1234 $ref: '#/components/schemas/VideoUploadResponse'
1235 '409':
1236 description: HTTP or Torrent/magnetURI import not enabled
1237 '400':
1238 description: '`magnetUri` or `targetUrl` or a torrent file missing'
1239 /videos/abuse:
1240 get:
1241 summary: List video abuses
1242 security:
1243 - OAuth2:
1244 - admin
1245 - moderator
1246 tags:
1247 - Video Abuses
1248 parameters:
1249 - $ref: '#/components/parameters/start'
1250 - $ref: '#/components/parameters/count'
1251 - $ref: '#/components/parameters/abusesSort'
1252 responses:
1253 '200':
1254 description: successful operation
1255 content:
1256 application/json:
1257 schema:
1258 type: array
1259 items:
1260 $ref: '#/components/schemas/VideoAbuse'
1261 '/videos/{id}/abuse':
1262 post:
1263 summary: Report an abuse
1264 security:
1265 - OAuth2: []
1266 tags:
1267 - Video Abuses
1268 - Videos
1269 parameters:
1270 - $ref: '#/components/parameters/idOrUUID'
1271 requestBody:
1272 required: true
1273 content:
1274 application/json:
1275 schema:
1276 type: object
1277 properties:
1278 reason:
1279 description: Reason why the user reports this video
1280 type: string
1281 predefinedReasons:
1282 description: Reason categories that help triage reports
1283 type: array
1284 items:
1285 type: string
1286 enum:
1287 - violentOrAbusive
1288 - hatefulOrAbusive
1289 - spamOrMisleading
1290 - privacy
1291 - rights
1292 - serverRules
1293 - thumbnails
1294 - captions
1295 startAt:
1296 type: integer
1297 description: Timestamp in the video that marks the beginning of the report
1298 endAt:
1299 type: integer
1300 description: Timestamp in the video that marks the ending of the report
1301 required:
1302 - reason
1303 responses:
1304 '204':
1305 description: successful operation
1306 '/videos/{id}/abuse/{abuseId}':
1307 put:
1308 summary: Update an abuse
1309 security:
1310 - OAuth2:
1311 - admin
1312 - moderator
1313 tags:
1314 - Video Abuses
1315 responses:
1316 '204':
1317 description: successful operation
1318 '404':
1319 description: video abuse not found
1320 parameters:
1321 - $ref: '#/components/parameters/idOrUUID'
1322 - $ref: '#/components/parameters/abuseId'
1323 requestBody:
1324 content:
1325 application/json:
1326 schema:
1327 type: object
1328 properties:
1329 state:
1330 $ref: '#/components/schemas/VideoAbuseStateSet'
1331 moderationComment:
1332 type: string
1333 description: 'Update the comment of the video abuse for other admin/moderators'
1334 delete:
1335 summary: Delete an abuse
1336 security:
1337 - OAuth2:
1338 - admin
1339 - moderator
1340 tags:
1341 - Video Abuses
1342 responses:
1343 '204':
1344 description: successful operation
1345 '404':
1346 description: block not found
1347 parameters:
1348 - $ref: '#/components/parameters/idOrUUID'
1349 - $ref: '#/components/parameters/abuseId'
1350
1351 '/videos/{id}/blacklist':
1352 post:
1353 summary: Block a video
1354 security:
1355 - OAuth2:
1356 - admin
1357 - moderator
1358 tags:
1359 - Video Blocks
1360 parameters:
1361 - $ref: '#/components/parameters/idOrUUID'
1362 responses:
1363 '204':
1364 description: successful operation
1365 delete:
1366 summary: Unblock a video by its id
1367 security:
1368 - OAuth2:
1369 - admin
1370 - moderator
1371 tags:
1372 - Video Blocks
1373 parameters:
1374 - $ref: '#/components/parameters/idOrUUID'
1375 responses:
1376 '204':
1377 description: successful operation
1378 '404':
1379 description: block not found
1380 /videos/blacklist:
1381 get:
1382 tags:
1383 - Video Blocks
1384 summary: List blocked videos
1385 security:
1386 - OAuth2:
1387 - admin
1388 - moderator
1389 parameters:
1390 - $ref: '#/components/parameters/start'
1391 - $ref: '#/components/parameters/count'
1392 - $ref: '#/components/parameters/blacklistsSort'
1393 responses:
1394 '200':
1395 description: successful operation
1396 content:
1397 application/json:
1398 schema:
1399 type: array
1400 items:
1401 $ref: '#/components/schemas/VideoBlacklist'
1402 /videos/{id}/captions:
1403 get:
1404 summary: List captions of a video
1405 tags:
1406 - Video Caption
1407 parameters:
1408 - $ref: '#/components/parameters/idOrUUID'
1409 responses:
1410 '200':
1411 description: successful operation
1412 content:
1413 application/json:
1414 schema:
1415 type: object
1416 properties:
1417 total:
1418 type: integer
1419 data:
1420 type: array
1421 items:
1422 $ref: '#/components/schemas/VideoCaption'
1423 /videos/{id}/captions/{captionLanguage}:
1424 put:
1425 summary: Add or replace a video caption
1426 tags:
1427 - Video Caption
1428 parameters:
1429 - $ref: '#/components/parameters/idOrUUID'
1430 - $ref: '#/components/parameters/captionLanguage'
1431 requestBody:
1432 content:
1433 multipart/form-data:
1434 schema:
1435 type: object
1436 properties:
1437 captionfile:
1438 description: The file to upload.
1439 type: string
1440 format: binary
1441 encoding:
1442 captionfile:
1443 contentType: text/vtt, application/x-subrip, text/plain
1444 responses:
1445 '204':
1446 description: successful operation
1447 '404':
1448 description: video or language not found
1449 delete:
1450 summary: Delete a video caption
1451 tags:
1452 - Video Caption
1453 parameters:
1454 - $ref: '#/components/parameters/idOrUUID'
1455 - $ref: '#/components/parameters/captionLanguage'
1456 responses:
1457 '204':
1458 description: successful operation
1459 '404':
1460 description: video or language or caption for that language not found
1461 /video-channels:
1462 get:
1463 summary: List video channels
1464 tags:
1465 - Video Channels
1466 parameters:
1467 - $ref: '#/components/parameters/start'
1468 - $ref: '#/components/parameters/count'
1469 - $ref: '#/components/parameters/sort'
1470 responses:
1471 '200':
1472 description: successful operation
1473 content:
1474 application/json:
1475 schema:
1476 type: array
1477 items:
1478 $ref: '#/components/schemas/VideoChannel'
1479 post:
1480 summary: Create a video channel
1481 security:
1482 - OAuth2: []
1483 tags:
1484 - Video Channels
1485 responses:
1486 '204':
1487 description: successful operation
1488 requestBody:
1489 content:
1490 application/json:
1491 schema:
1492 $ref: '#/components/schemas/VideoChannelCreate'
1493 '/video-channels/{channelHandle}':
1494 get:
1495 summary: Get a video channel
1496 tags:
1497 - Video Channels
1498 parameters:
1499 - $ref: '#/components/parameters/channelHandle'
1500 responses:
1501 '200':
1502 description: successful operation
1503 content:
1504 application/json:
1505 schema:
1506 $ref: '#/components/schemas/VideoChannel'
1507 put:
1508 summary: Update a video channel
1509 security:
1510 - OAuth2: []
1511 tags:
1512 - Video Channels
1513 parameters:
1514 - $ref: '#/components/parameters/channelHandle'
1515 responses:
1516 '204':
1517 description: successful operation
1518 requestBody:
1519 content:
1520 application/json:
1521 schema:
1522 $ref: '#/components/schemas/VideoChannelUpdate'
1523 delete:
1524 summary: Delete a video channel
1525 security:
1526 - OAuth2: []
1527 tags:
1528 - Video Channels
1529 parameters:
1530 - $ref: '#/components/parameters/channelHandle'
1531 responses:
1532 '204':
1533 description: successful operation
1534 '/video-channels/{channelHandle}/videos':
1535 get:
1536 summary: List videos of a video channel
1537 tags:
1538 - Video
1539 - Video Channels
1540 parameters:
1541 - $ref: '#/components/parameters/channelHandle'
1542 - $ref: '#/components/parameters/categoryOneOf'
1543 - $ref: '#/components/parameters/tagsOneOf'
1544 - $ref: '#/components/parameters/tagsAllOf'
1545 - $ref: '#/components/parameters/licenceOneOf'
1546 - $ref: '#/components/parameters/languageOneOf'
1547 - $ref: '#/components/parameters/nsfw'
1548 - $ref: '#/components/parameters/filter'
1549 - $ref: '#/components/parameters/skipCount'
1550 - $ref: '#/components/parameters/start'
1551 - $ref: '#/components/parameters/count'
1552 - $ref: '#/components/parameters/videosSort'
1553 responses:
1554 '200':
1555 description: successful operation
1556 content:
1557 application/json:
1558 schema:
1559 $ref: '#/components/schemas/VideoListResponse'
1560
1561 /video-playlists/privacies:
1562 get:
1563 summary: List available playlist privacies
1564 tags:
1565 - Video Playlists
1566 responses:
1567 '200':
1568 description: successful operation
1569 content:
1570 application/json:
1571 schema:
1572 type: array
1573 items:
1574 type: string
1575
1576 /video-playlists:
1577 get:
1578 summary: List video playlists
1579 tags:
1580 - Video Playlists
1581 parameters:
1582 - $ref: '#/components/parameters/start'
1583 - $ref: '#/components/parameters/count'
1584 - $ref: '#/components/parameters/sort'
1585 responses:
1586 '200':
1587 description: successful operation
1588 content:
1589 application/json:
1590 schema:
1591 type: array
1592 items:
1593 $ref: '#/components/schemas/VideoPlaylist'
1594 post:
1595 summary: Create a video playlist
1596 description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
1597 security:
1598 - OAuth2: []
1599 tags:
1600 - Video Playlists
1601 responses:
1602 '200':
1603 description: successful operation
1604 content:
1605 application/json:
1606 schema:
1607 type: object
1608 properties:
1609 videoPlaylist:
1610 type: object
1611 properties:
1612 id:
1613 type: integer
1614 uuid:
1615 type: string
1616 requestBody:
1617 content:
1618 multipart/form-data:
1619 schema:
1620 type: object
1621 properties:
1622 displayName:
1623 description: Video playlist display name
1624 type: string
1625 thumbnailfile:
1626 description: Video playlist thumbnail file
1627 type: string
1628 format: binary
1629 privacy:
1630 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1631 description:
1632 description: Video playlist description
1633 type: string
1634 videoChannelId:
1635 description: Video channel in which the playlist will be published
1636 type: integer
1637 required:
1638 - displayName
1639
1640 /video-playlists/{id}:
1641 get:
1642 summary: Get a video playlist
1643 tags:
1644 - Video Playlists
1645 parameters:
1646 - $ref: '#/components/parameters/idOrUUID'
1647 responses:
1648 '200':
1649 description: successful operation
1650 content:
1651 application/json:
1652 schema:
1653 $ref: '#/components/schemas/VideoPlaylist'
1654 put:
1655 summary: Update a video playlist
1656 description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
1657 security:
1658 - OAuth2: []
1659 tags:
1660 - Video Playlists
1661 responses:
1662 '204':
1663 description: successful operation
1664 parameters:
1665 - $ref: '#/components/parameters/idOrUUID'
1666 requestBody:
1667 content:
1668 multipart/form-data:
1669 schema:
1670 type: object
1671 properties:
1672 displayName:
1673 description: Video playlist display name
1674 type: string
1675 thumbnailfile:
1676 description: Video playlist thumbnail file
1677 type: string
1678 format: binary
1679 privacy:
1680 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1681 description:
1682 description: Video playlist description
1683 type: string
1684 videoChannelId:
1685 description: Video channel in which the playlist will be published
1686 type: integer
1687 delete:
1688 summary: Delete a video playlist
1689 security:
1690 - OAuth2: []
1691 tags:
1692 - Video Playlists
1693 parameters:
1694 - $ref: '#/components/parameters/idOrUUID'
1695 responses:
1696 '204':
1697 description: successful operation
1698
1699 /video-playlists/{id}/videos:
1700 get:
1701 summary: 'List videos of a playlist'
1702 tags:
1703 - Videos
1704 - Video Playlists
1705 parameters:
1706 - $ref: '#/components/parameters/idOrUUID'
1707 responses:
1708 '200':
1709 description: successful operation
1710 content:
1711 application/json:
1712 schema:
1713 $ref: '#/components/schemas/VideoListResponse'
1714 post:
1715 summary: 'Add a video in a playlist'
1716 security:
1717 - OAuth2: []
1718 tags:
1719 - Videos
1720 - Video Playlists
1721 parameters:
1722 - $ref: '#/components/parameters/idOrUUID'
1723 responses:
1724 '200':
1725 description: successful operation
1726 content:
1727 application/json:
1728 schema:
1729 type: object
1730 properties:
1731 videoPlaylistElement:
1732 type: object
1733 properties:
1734 id:
1735 type: integer
1736 requestBody:
1737 content:
1738 application/json:
1739 schema:
1740 type: object
1741 properties:
1742 videoId:
1743 type: integer
1744 description: 'Video to add in the playlist'
1745 startTimestamp:
1746 type: integer
1747 description: 'Start the video at this specific timestamp (in seconds)'
1748 stopTimestamp:
1749 type: integer
1750 description: 'Stop the video at this specific timestamp (in seconds)'
1751 required:
1752 - videoId
1753
1754 /video-playlists/{id}/videos/reorder:
1755 post:
1756 summary: 'Reorder a playlist'
1757 security:
1758 - OAuth2: []
1759 tags:
1760 - Video Playlists
1761 parameters:
1762 - $ref: '#/components/parameters/idOrUUID'
1763 responses:
1764 '204':
1765 description: successful operation
1766 requestBody:
1767 content:
1768 application/json:
1769 schema:
1770 type: object
1771 properties:
1772 startPosition:
1773 type: integer
1774 description: 'Start position of the element to reorder'
1775 minimum: 1
1776 insertAfterPosition:
1777 type: integer
1778 description: 'New position for the block to reorder, to add the block before the first element'
1779 minimum: 0
1780 reorderLength:
1781 type: integer
1782 description: 'How many element from `startPosition` to reorder'
1783 minimum: 1
1784 required:
1785 - startPosition
1786 - insertAfterPosition
1787
1788 /video-playlists/{id}/videos/{playlistElementId}:
1789 put:
1790 summary: 'Update a playlist element'
1791 security:
1792 - OAuth2: []
1793 tags:
1794 - Video Playlists
1795 parameters:
1796 - $ref: '#/components/parameters/idOrUUID'
1797 - $ref: '#/components/parameters/playlistElementId'
1798 responses:
1799 '204':
1800 description: successful operation
1801 requestBody:
1802 content:
1803 application/json:
1804 schema:
1805 type: object
1806 properties:
1807 startTimestamp:
1808 type: integer
1809 description: 'Start the video at this specific timestamp (in seconds)'
1810 stopTimestamp:
1811 type: integer
1812 description: 'Stop the video at this specific timestamp (in seconds)'
1813 delete:
1814 summary: 'Delete an element from a playlist'
1815 security:
1816 - OAuth2: []
1817 tags:
1818 - Video Playlists
1819 parameters:
1820 - $ref: '#/components/parameters/idOrUUID'
1821 - $ref: '#/components/parameters/playlistElementId'
1822 responses:
1823 '204':
1824 description: successful operation
1825
1826 '/users/me/video-playlists/videos-exist':
1827 get:
1828 summary: 'Check video exists in my playlists'
1829 security:
1830 - OAuth2: []
1831 tags:
1832 - Video Playlists
1833 parameters:
1834 - name: videoIds
1835 in: query
1836 required: true
1837 description: The video ids to check
1838 schema:
1839 type: array
1840 items:
1841 type: integer
1842 responses:
1843 '200':
1844 description: successful operation
1845 content:
1846 application/json:
1847 schema:
1848 type: object
1849 properties:
1850 videoId:
1851 type: array
1852 items:
1853 type: object
1854 properties:
1855 playlistElementId:
1856 type: integer
1857 playlistId:
1858 type: integer
1859 startTimestamp:
1860 type: integer
1861 stopTimestamp:
1862 type: integer
1863
1864 '/accounts/{name}/video-channels':
1865 get:
1866 summary: List video channels of an account
1867 tags:
1868 - Video Channels
1869 - Accounts
1870 parameters:
1871 - $ref: '#/components/parameters/name'
1872 responses:
1873 '200':
1874 description: successful operation
1875 content:
1876 application/json:
1877 schema:
1878 type: array
1879 items:
1880 $ref: '#/components/schemas/VideoChannel'
1881 '/accounts/{name}/ratings':
1882 get:
1883 summary: List ratings of an account
1884 security:
1885 - OAuth2: []
1886 tags:
1887 - Accounts
1888 parameters:
1889 - $ref: '#/components/parameters/name'
1890 - $ref: '#/components/parameters/start'
1891 - $ref: '#/components/parameters/count'
1892 - $ref: '#/components/parameters/sort'
1893 - name: rating
1894 in: query
1895 required: false
1896 description: Optionally filter which ratings to retrieve
1897 schema:
1898 type: string
1899 enum:
1900 - like
1901 - dislike
1902 responses:
1903 '200':
1904 description: successful operation
1905 content:
1906 application/json:
1907 schema:
1908 type: array
1909 items:
1910 $ref: '#/components/schemas/VideoRating'
1911 '/videos/{id}/comment-threads':
1912 get:
1913 summary: List threads of a video
1914 tags:
1915 - Video Comments
1916 parameters:
1917 - $ref: '#/components/parameters/idOrUUID'
1918 - $ref: '#/components/parameters/start'
1919 - $ref: '#/components/parameters/count'
1920 - $ref: '#/components/parameters/commentsSort'
1921 responses:
1922 '200':
1923 description: successful operation
1924 content:
1925 application/json:
1926 schema:
1927 $ref: '#/components/schemas/CommentThreadResponse'
1928 post:
1929 summary: Create a thread
1930 security:
1931 - OAuth2: []
1932 tags:
1933 - Video Comments
1934 parameters:
1935 - $ref: '#/components/parameters/idOrUUID'
1936 responses:
1937 '200':
1938 description: successful operation
1939 content:
1940 application/json:
1941 schema:
1942 $ref: '#/components/schemas/CommentThreadPostResponse'
1943 requestBody:
1944 content:
1945 application/json:
1946 schema:
1947 type: object
1948 properties:
1949 text:
1950 type: string
1951 description: 'Text comment'
1952 required:
1953 - text
1954
1955 '/videos/{id}/comment-threads/{threadId}':
1956 get:
1957 summary: Get a thread
1958 tags:
1959 - Video Comments
1960 parameters:
1961 - $ref: '#/components/parameters/idOrUUID'
1962 - $ref: '#/components/parameters/threadId'
1963 responses:
1964 '200':
1965 description: successful operation
1966 content:
1967 application/json:
1968 schema:
1969 $ref: '#/components/schemas/VideoCommentThreadTree'
1970 '/videos/{id}/comments/{commentId}':
1971 post:
1972 summary: Reply to a thread of a video
1973 security:
1974 - OAuth2: []
1975 tags:
1976 - Video Comments
1977 parameters:
1978 - $ref: '#/components/parameters/idOrUUID'
1979 - $ref: '#/components/parameters/commentId'
1980 responses:
1981 '200':
1982 description: successful operation
1983 content:
1984 application/json:
1985 schema:
1986 $ref: '#/components/schemas/CommentThreadPostResponse'
1987 requestBody:
1988 content:
1989 application/json:
1990 schema:
1991 type: object
1992 properties:
1993 text:
1994 type: string
1995 description: 'Text comment'
1996 required:
1997 - text
1998
1999 delete:
2000 summary: Delete a comment or a reply
2001 security:
2002 - OAuth2: []
2003 tags:
2004 - Video Comments
2005 parameters:
2006 - $ref: '#/components/parameters/idOrUUID'
2007 - $ref: '#/components/parameters/commentId'
2008 responses:
2009 '204':
2010 description: successful operation
2011 '/videos/{id}/rate':
2012 put:
2013 summary: Like/dislike a video
2014 security:
2015 - OAuth2: []
2016 tags:
2017 - Video Rates
2018 parameters:
2019 - $ref: '#/components/parameters/idOrUUID'
2020 responses:
2021 '204':
2022 description: successful operation
2023 /search/videos:
2024 get:
2025 tags:
2026 - Search
2027 summary: Search videos
2028 parameters:
2029 - $ref: '#/components/parameters/categoryOneOf'
2030 - $ref: '#/components/parameters/tagsOneOf'
2031 - $ref: '#/components/parameters/tagsAllOf'
2032 - $ref: '#/components/parameters/licenceOneOf'
2033 - $ref: '#/components/parameters/languageOneOf'
2034 - $ref: '#/components/parameters/nsfw'
2035 - $ref: '#/components/parameters/filter'
2036 - $ref: '#/components/parameters/skipCount'
2037 - $ref: '#/components/parameters/start'
2038 - $ref: '#/components/parameters/count'
2039 - $ref: '#/components/parameters/searchTarget'
2040 - $ref: '#/components/parameters/videosSearchSort'
2041 - name: search
2042 in: query
2043 required: true
2044 description: >
2045 String to search. If the user can make a remote URI search, and the string is an URI then the
2046 PeerTube instance will fetch the remote object and add it to its database. Then,
2047 you can use the REST API to fetch the complete video information and interact with it.
2048 schema:
2049 type: string
2050 - name: startDate
2051 in: query
2052 required: true
2053 description: Get videos that are published after this date
2054 schema:
2055 type: string
2056 format: date-time
2057 - name: endDate
2058 in: query
2059 required: true
2060 description: Get videos that are published before this date
2061 schema:
2062 type: string
2063 format: date-time
2064 - name: originallyPublishedStartDate
2065 in: query
2066 required: true
2067 description: Get videos that are originally published after this date
2068 schema:
2069 type: string
2070 format: date-time
2071 - name: originallyPublishedEndDate
2072 in: query
2073 required: true
2074 description: Get videos that are originally published before this date
2075 schema:
2076 type: string
2077 format: date-time
2078 - name: durationMin
2079 in: query
2080 required: true
2081 description: Get videos that have this minimum duration
2082 schema:
2083 type: integer
2084 - name: durationMax
2085 in: query
2086 required: true
2087 description: Get videos that have this maximum duration
2088 schema:
2089 type: integer
2090 responses:
2091 '200':
2092 description: successful operation
2093 content:
2094 application/json:
2095 schema:
2096 $ref: '#/components/schemas/VideoListResponse'
2097 /search/video-channels:
2098 get:
2099 tags:
2100 - Search
2101 summary: Search channels
2102 parameters:
2103 - $ref: '#/components/parameters/start'
2104 - $ref: '#/components/parameters/count'
2105 - $ref: '#/components/parameters/searchTarget'
2106 - $ref: '#/components/parameters/sort'
2107 - name: search
2108 in: query
2109 required: true
2110 description: >
2111 String to search. If the user can make a remote URI search, and the string is an URI then the
2112 PeerTube instance will fetch the remote object and add it to its database. Then,
2113 you can use the REST API to fetch the complete channel information and interact with it.
2114 schema:
2115 type: string
2116 responses:
2117 '200':
2118 description: successful operation
2119 content:
2120 application/json:
2121 schema:
2122 type: array
2123 items:
2124 $ref: '#/components/schemas/VideoChannel'
2125 /blocklist/accounts:
2126 get:
2127 tags:
2128 - Account Blocks
2129 summary: List account blocks
2130 security:
2131 - OAuth2:
2132 - admin
2133 parameters:
2134 - $ref: '#/components/parameters/start'
2135 - $ref: '#/components/parameters/count'
2136 - $ref: '#/components/parameters/sort'
2137 responses:
2138 '200':
2139 description: successful operation
2140 post:
2141 tags:
2142 - Account Blocks
2143 summary: Block an account
2144 security:
2145 - OAuth2:
2146 - admin
2147 requestBody:
2148 content:
2149 application/json:
2150 schema:
2151 type: object
2152 properties:
2153 accountName:
2154 type: string
2155 description: account to block, in the form `username@domain`
2156 required:
2157 - accountName
2158 responses:
2159 '200':
2160 description: successful operation
2161 '409':
2162 description: self-blocking forbidden
2163 '/blocklist/accounts/{accountName}':
2164 delete:
2165 tags:
2166 - Account Blocks
2167 summary: Unblock an account by its handle
2168 security:
2169 - OAuth2:
2170 - admin
2171 parameters:
2172 - name: accountName
2173 in: path
2174 required: true
2175 description: account to unblock, in the form `username@domain`
2176 schema:
2177 type: string
2178 responses:
2179 '201':
2180 description: successful operation
2181 '404':
2182 description: account or account block does not exist
2183 /blocklist/servers:
2184 get:
2185 tags:
2186 - Server Blocks
2187 summary: List server blocks
2188 security:
2189 - OAuth2:
2190 - admin
2191 parameters:
2192 - $ref: '#/components/parameters/start'
2193 - $ref: '#/components/parameters/count'
2194 - $ref: '#/components/parameters/sort'
2195 responses:
2196 '200':
2197 description: successful operation
2198 post:
2199 tags:
2200 - Server Blocks
2201 summary: Block a server
2202 security:
2203 - OAuth2:
2204 - admin
2205 requestBody:
2206 content:
2207 application/json:
2208 schema:
2209 type: object
2210 properties:
2211 accountName:
2212 type: string
2213 description: server domain to block
2214 required:
2215 - accountName
2216 responses:
2217 '200':
2218 description: successful operation
2219 '409':
2220 description: self-blocking forbidden
2221 '/blocklist/servers/{host}':
2222 delete:
2223 tags:
2224 - Server Blocks
2225 summary: Unblock a server by its domain
2226 security:
2227 - OAuth2:
2228 - admin
2229 parameters:
2230 - name: host
2231 in: path
2232 required: true
2233 description: server domain to unblock
2234 schema:
2235 type: string
2236 responses:
2237 '201':
2238 description: successful operation
2239 '404':
2240 description: account block does not exist
2241 '/feeds/video-comments.{format}':
2242 get:
2243 tags:
2244 - Feeds
2245 summary: List comments on videos
2246 servers:
2247 - url: 'https://peertube.cpy.re'
2248 description: Live Test Server (live data - stable version)
2249 - url: 'https://peertube2.cpy.re'
2250 description: Live Test Server (live data - latest nighlty version)
2251 - url: 'https://peertube3.cpy.re'
2252 description: Live Test Server (live data - latest RC version)
2253 parameters:
2254 - name: format
2255 in: path
2256 required: true
2257 description: 'format expected (we focus on making `rss` the most featureful ; it serves Media RSS)'
2258 schema:
2259 type: string
2260 enum:
2261 - xml
2262 - rss
2263 - rss2
2264 - atom
2265 - atom1
2266 - json
2267 - json1
2268 - name: videoId
2269 in: query
2270 description: 'limit listing to a specific video'
2271 schema:
2272 type: string
2273 responses:
2274 '204':
2275 description: successful operation
2276 headers:
2277 Cache-Control:
2278 schema:
2279 type: string
2280 default: 'max-age=900' # 15 min cache
2281 content:
2282 application/xml:
2283 schema:
2284 $ref: '#/components/schemas/VideoCommentsForXML'
2285 application/rss+xml:
2286 schema:
2287 $ref: '#/components/schemas/VideoCommentsForXML'
2288 text/xml:
2289 schema:
2290 $ref: '#/components/schemas/VideoCommentsForXML'
2291 application/atom+xml:
2292 schema:
2293 $ref: '#/components/schemas/VideoCommentsForXML'
2294 application/json:
2295 schema:
2296 type: object
2297 '406':
2298 description: accept header unsupported
2299 '/feeds/videos.{format}':
2300 get:
2301 tags:
2302 - Feeds
2303 summary: List videos
2304 servers:
2305 - url: 'https://peertube.cpy.re'
2306 description: Live Test Server (live data - stable version)
2307 - url: 'https://peertube2.cpy.re'
2308 description: Live Test Server (live data - latest nighlty version)
2309 - url: 'https://peertube3.cpy.re'
2310 description: Live Test Server (live data - latest RC version)
2311 parameters:
2312 - name: format
2313 in: path
2314 required: true
2315 description: 'format expected (we focus on making `rss` the most featureful ; it serves Media RSS)'
2316 schema:
2317 type: string
2318 enum:
2319 - xml
2320 - rss
2321 - rss2
2322 - atom
2323 - atom1
2324 - json
2325 - json1
2326 - name: accountId
2327 in: query
2328 description: 'limit listing to a specific account'
2329 schema:
2330 type: string
2331 - name: accountName
2332 in: query
2333 description: 'limit listing to a specific account'
2334 schema:
2335 type: string
2336 - name: videoChannelId
2337 in: query
2338 description: 'limit listing to a specific video channel'
2339 schema:
2340 type: string
2341 - name: videoChannelName
2342 in: query
2343 description: 'limit listing to a specific video channel'
2344 schema:
2345 type: string
2346 responses:
2347 '204':
2348 description: successful operation
2349 headers:
2350 Cache-Control:
2351 schema:
2352 type: string
2353 default: 'max-age=900' # 15 min cache
2354 content:
2355 application/xml:
2356 schema:
2357 $ref: '#/components/schemas/VideosForXML'
2358 application/rss+xml:
2359 schema:
2360 $ref: '#/components/schemas/VideosForXML'
2361 text/xml:
2362 schema:
2363 $ref: '#/components/schemas/VideosForXML'
2364 application/atom+xml:
2365 schema:
2366 $ref: '#/components/schemas/VideosForXML'
2367 application/json:
2368 schema:
2369 type: object
2370 '406':
2371 description: accept header unsupported
2372 servers:
2373 - url: 'https://peertube.cpy.re/api/v1'
2374 description: Live Test Server (live data - stable version)
2375 - url: 'https://peertube2.cpy.re/api/v1'
2376 description: Live Test Server (live data - latest nighlty version)
2377 - url: 'https://peertube3.cpy.re/api/v1'
2378 description: Live Test Server (live data - latest RC version)
2379 components:
2380 parameters:
2381 start:
2382 name: start
2383 in: query
2384 required: false
2385 description: Offset used to paginate results
2386 schema:
2387 type: integer
2388 count:
2389 name: count
2390 in: query
2391 required: false
2392 description: "Number of items to return"
2393 schema:
2394 type: integer
2395 maximum: 100
2396 minimum: 1
2397 sort:
2398 name: sort
2399 in: query
2400 required: false
2401 description: Sort column (`-createdAt` for example)
2402 schema:
2403 type: string
2404 searchTarget:
2405 name: searchTarget
2406 in: query
2407 required: false
2408 description: >
2409 If the administrator enabled search index support, you can override the default search target.
2410
2411
2412 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
2413 It means the instance may not know the objects you fetched. If you want to load video/channel information:
2414 * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
2415 then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
2416 After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
2417 * If the current user has not the ability to make a remote URI search, then redirect the user on the origin instance or fetch
2418 the data from the origin instance API
2419 schema:
2420 type: string
2421 enum:
2422 - 'local'
2423 - 'search-index'
2424 videosSort:
2425 name: sort
2426 in: query
2427 required: false
2428 description: Sort videos by criteria
2429 schema:
2430 type: string
2431 enum:
2432 - -name
2433 - -duration
2434 - -createdAt
2435 - -publishedAt
2436 - -views
2437 - -likes
2438 - -trending
2439 videosSearchSort:
2440 name: sort
2441 in: query
2442 required: false
2443 description: Sort videos by criteria
2444 schema:
2445 type: string
2446 enum:
2447 - -name
2448 - -duration
2449 - -createdAt
2450 - -publishedAt
2451 - -views
2452 - -likes
2453 - -match
2454 commentsSort:
2455 name: sort
2456 in: query
2457 required: false
2458 description: Sort comments by criteria
2459 schema:
2460 type: string
2461 enum:
2462 - -createdAt
2463 - -totalReplies
2464 blacklistsSort:
2465 name: sort
2466 in: query
2467 required: false
2468 description: Sort blacklists by criteria
2469 schema:
2470 type: string
2471 enum:
2472 - -id
2473 - -name
2474 - -duration
2475 - -views
2476 - -likes
2477 - -dislikes
2478 - -uuid
2479 - -createdAt
2480 usersSort:
2481 name: sort
2482 in: query
2483 required: false
2484 description: Sort users by criteria
2485 schema:
2486 type: string
2487 enum:
2488 - -id
2489 - -username
2490 - -createdAt
2491 abusesSort:
2492 name: sort
2493 in: query
2494 required: false
2495 description: Sort abuses by criteria
2496 schema:
2497 type: string
2498 enum:
2499 - -id
2500 - -createdAt
2501 - -state
2502 name:
2503 name: name
2504 in: path
2505 required: true
2506 description: >-
2507 The name of the account (`chocobozzz` or `chocobozzz@example.org` for
2508 example)
2509 schema:
2510 type: string
2511 id:
2512 name: id
2513 in: path
2514 required: true
2515 description: The user id
2516 schema:
2517 type: integer
2518 idOrUUID:
2519 name: id
2520 in: path
2521 required: true
2522 description: The object id or uuid
2523 schema:
2524 type: string
2525 playlistElementId:
2526 name: playlistElementId
2527 in: path
2528 required: true
2529 description: Playlist element id
2530 schema:
2531 type: integer
2532 abuseId:
2533 name: abuseId
2534 in: path
2535 required: true
2536 description: Video abuse id
2537 schema:
2538 type: integer
2539 captionLanguage:
2540 name: captionLanguage
2541 in: path
2542 required: true
2543 description: The caption language
2544 schema:
2545 type: string
2546 channelHandle:
2547 name: channelHandle
2548 in: path
2549 required: true
2550 description: "The video channel handle (example: 'my_username@example.com' or 'my_username')"
2551 schema:
2552 type: string
2553 subscriptionHandle:
2554 name: subscriptionHandle
2555 in: path
2556 required: true
2557 description: "The subscription handle (example: 'my_username@example.com' or 'my_username')"
2558 schema:
2559 type: string
2560 threadId:
2561 name: threadId
2562 in: path
2563 required: true
2564 description: The thread id (root comment id)
2565 schema:
2566 type: integer
2567 commentId:
2568 name: commentId
2569 in: path
2570 required: true
2571 description: The comment id
2572 schema:
2573 type: integer
2574 categoryOneOf:
2575 name: categoryOneOf
2576 in: query
2577 required: false
2578 description: category id of the video (see /videos/categories)
2579 schema:
2580 oneOf:
2581 - type: integer
2582 - type: array
2583 items:
2584 type: integer
2585 style: form
2586 explode: false
2587 tagsOneOf:
2588 name: tagsOneOf
2589 in: query
2590 required: false
2591 description: tag(s) of the video
2592 schema:
2593 oneOf:
2594 - type: string
2595 - type: array
2596 items:
2597 type: string
2598 style: form
2599 explode: false
2600 tagsAllOf:
2601 name: tagsAllOf
2602 in: query
2603 required: false
2604 description: tag(s) of the video, where all should be present in the video
2605 schema:
2606 oneOf:
2607 - type: string
2608 - type: array
2609 items:
2610 type: string
2611 style: form
2612 explode: false
2613 languageOneOf:
2614 name: languageOneOf
2615 in: query
2616 required: false
2617 description: language id of the video (see /videos/languages). Use `_unknown` to filter on videos that don't have a video language
2618 schema:
2619 oneOf:
2620 - type: string
2621 - type: array
2622 items:
2623 type: string
2624 style: form
2625 explode: false
2626 licenceOneOf:
2627 name: licenceOneOf
2628 in: query
2629 required: false
2630 description: licence id of the video (see /videos/licences)
2631 schema:
2632 oneOf:
2633 - type: integer
2634 - type: array
2635 items:
2636 type: integer
2637 style: form
2638 explode: false
2639 skipCount:
2640 name: skipCount
2641 in: query
2642 required: false
2643 description: if you don't need the `total` in the response
2644 schema:
2645 type: string
2646 enum:
2647 - 'true'
2648 - 'false'
2649 default: 'false'
2650 nsfw:
2651 name: nsfw
2652 in: query
2653 required: false
2654 description: whether to include nsfw videos, if any
2655 schema:
2656 type: string
2657 enum:
2658 - 'true'
2659 - 'false'
2660 filter:
2661 name: filter
2662 in: query
2663 required: false
2664 description: >
2665 Special filters (local for instance) which might require special rights:
2666 * `local` - only videos local to the instance
2667 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
2668 schema:
2669 type: string
2670 enum:
2671 - local
2672 - all-local
2673 subscriptionsUris:
2674 name: uris
2675 in: query
2676 required: true
2677 description: list of uris to check if each is part of the user subscriptions
2678 schema:
2679 type: array
2680 items:
2681 type: string
2682 securitySchemes:
2683 OAuth2:
2684 description: >
2685 In the header: *Authorization: Bearer <token\>*
2686
2687
2688 Authenticating via OAuth requires the following steps:
2689
2690
2691 - Have an account with sufficient authorization levels
2692
2693 - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
2694 Bearer Token
2695
2696 - Make Authenticated Requests
2697 type: oauth2
2698 flows:
2699 password:
2700 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
2701 scopes:
2702 admin: Admin scope
2703 moderator: Moderator scope
2704 user: User scope
2705 schemas:
2706 VideoConstantNumber:
2707 properties:
2708 id:
2709 type: integer
2710 label:
2711 type: string
2712 VideoConstantString:
2713 properties:
2714 id:
2715 type: string
2716 label:
2717 type: string
2718
2719 VideoPlaylistPrivacySet:
2720 type: integer
2721 enum:
2722 - 1
2723 - 2
2724 - 3
2725 description: 'The video playlist privacy (Public = `1`, Unlisted = `2`, Private = `3`)'
2726 VideoPlaylistPrivacyConstant:
2727 properties:
2728 id:
2729 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2730 label:
2731 type: string
2732
2733 VideoPlaylistTypeSet:
2734 type: integer
2735 enum:
2736 - 1
2737 - 2
2738 description: 'The video playlist type (Regular = `1`, Watch Later = `2`)'
2739 VideoPlaylistTypeConstant:
2740 properties:
2741 id:
2742 $ref: '#/components/schemas/VideoPlaylistTypeSet'
2743 label:
2744 type: string
2745
2746 VideoPrivacySet:
2747 type: integer
2748 enum:
2749 - 1
2750 - 2
2751 - 3
2752 - 4
2753 description: 'The video privacy (Public = `1`, Unlisted = `2`, Private = `3`, Internal = `4`)'
2754 VideoPrivacyConstant:
2755 properties:
2756 id:
2757 $ref: '#/components/schemas/VideoPrivacySet'
2758 label:
2759 type: string
2760
2761 NSFWPolicy:
2762 type: string
2763 enum:
2764 - display
2765 - blur
2766 - do_not_list
2767
2768 UserRole:
2769 type: integer
2770 enum:
2771 - 0
2772 - 1
2773 - 2
2774 description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
2775
2776 VideoStateConstant:
2777 properties:
2778 id:
2779 type: integer
2780 enum:
2781 - 1
2782 - 2
2783 - 3
2784 description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
2785 label:
2786 type: string
2787
2788 VideoAbuseStateSet:
2789 type: integer
2790 enum:
2791 - 1
2792 - 2
2793 - 3
2794 description: 'The video playlist privacy (Pending = `1`, Rejected = `2`, Accepted = `3`)'
2795 VideoAbuseStateConstant:
2796 properties:
2797 id:
2798 $ref: '#/components/schemas/VideoAbuseStateSet'
2799 label:
2800 type: string
2801 VideoAbusePredefinedReasons:
2802 type: array
2803 items:
2804 type: string
2805 enum:
2806 - violentOrAbusive
2807 - hatefulOrAbusive
2808 - spamOrMisleading
2809 - privacy
2810 - rights
2811 - serverRules
2812 - thumbnails
2813 - captions
2814
2815 VideoResolutionConstant:
2816 properties:
2817 id:
2818 type: integer
2819 description: 'Video resolution (240, 360, 720 ...)'
2820 label:
2821 type: string
2822 VideoScheduledUpdate:
2823 properties:
2824 privacy:
2825 $ref: '#/components/schemas/VideoPrivacySet'
2826 updateAt:
2827 type: string
2828 format: date
2829 description: When to update the video
2830 required:
2831 - updateAt
2832 AccountSummary:
2833 properties:
2834 id:
2835 type: integer
2836 name:
2837 type: string
2838 displayName:
2839 type: string
2840 url:
2841 type: string
2842 host:
2843 type: string
2844 avatar:
2845 nullable: true
2846 allOf:
2847 - $ref: '#/components/schemas/Avatar'
2848 VideoChannelSummary:
2849 properties:
2850 id:
2851 type: integer
2852 name:
2853 type: string
2854 displayName:
2855 type: string
2856 url:
2857 type: string
2858 host:
2859 type: string
2860 avatar:
2861 nullable: true
2862 allOf:
2863 - $ref: '#/components/schemas/Avatar'
2864 PlaylistElement:
2865 properties:
2866 position:
2867 type: integer
2868 startTimestamp:
2869 type: integer
2870 stopTimestamp:
2871 type: integer
2872 video:
2873 nullable: true
2874 allOf:
2875 - $ref: '#/components/schemas/Video'
2876 VideoFile:
2877 properties:
2878 magnetUri:
2879 type: string
2880 resolution:
2881 $ref: '#/components/schemas/VideoResolutionConstant'
2882 size:
2883 type: integer
2884 description: 'Video file size in bytes'
2885 torrentUrl:
2886 type: string
2887 torrentDownloadUrl:
2888 type: string
2889 fileUrl:
2890 type: string
2891 fileDownloadUrl:
2892 type: string
2893 fps:
2894 type: number
2895 metadataUrl:
2896 type: string
2897 VideoStreamingPlaylists:
2898 properties:
2899 id:
2900 type: integer
2901 type:
2902 type: integer
2903 enum:
2904 - 1
2905 description: 'Playlist type (HLS = `1`)'
2906 playlistUrl:
2907 type: string
2908 segmentsSha256Url:
2909 type: string
2910 files:
2911 type: array
2912 items:
2913 $ref: '#/components/schemas/VideoFile'
2914 redundancies:
2915 type: array
2916 items:
2917 type: object
2918 properties:
2919 baseUrl:
2920 type: string
2921 Video:
2922 properties:
2923 id:
2924 type: integer
2925 uuid:
2926 type: string
2927 createdAt:
2928 type: string
2929 publishedAt:
2930 type: string
2931 updatedAt:
2932 type: string
2933 originallyPublishedAt:
2934 type: string
2935 category:
2936 $ref: '#/components/schemas/VideoConstantNumber'
2937 licence:
2938 $ref: '#/components/schemas/VideoConstantNumber'
2939 language:
2940 $ref: '#/components/schemas/VideoConstantString'
2941 privacy:
2942 $ref: '#/components/schemas/VideoPrivacyConstant'
2943 description:
2944 type: string
2945 duration:
2946 type: integer
2947 isLocal:
2948 type: boolean
2949 name:
2950 type: string
2951 thumbnailPath:
2952 type: string
2953 previewPath:
2954 type: string
2955 embedPath:
2956 type: string
2957 views:
2958 type: integer
2959 likes:
2960 type: integer
2961 dislikes:
2962 type: integer
2963 nsfw:
2964 type: boolean
2965 waitTranscoding:
2966 type: boolean
2967 nullable: true
2968 state:
2969 $ref: '#/components/schemas/VideoStateConstant'
2970 scheduledUpdate:
2971 nullable: true
2972 allOf:
2973 - $ref: '#/components/schemas/VideoScheduledUpdate'
2974 blacklisted:
2975 nullable: true
2976 type: boolean
2977 blacklistedReason:
2978 nullable: true
2979 type: string
2980 account:
2981 $ref: '#/components/schemas/AccountSummary'
2982 channel:
2983 $ref: '#/components/schemas/VideoChannelSummary'
2984 userHistory:
2985 nullable: true
2986 type: object
2987 properties:
2988 currentTime:
2989 type: integer
2990 VideoDetails:
2991 allOf:
2992 - $ref: '#/components/schemas/Video'
2993 - type: object
2994 properties:
2995 descriptionPath:
2996 type: string
2997 support:
2998 type: string
2999 channel:
3000 $ref: '#/components/schemas/VideoChannel'
3001 account:
3002 $ref: '#/components/schemas/Account'
3003 tags:
3004 type: array
3005 items:
3006 type: string
3007 files:
3008 type: array
3009 items:
3010 $ref: '#/components/schemas/VideoFile'
3011 commentsEnabled:
3012 type: boolean
3013 downloadEnabled:
3014 type: boolean
3015 trackerUrls:
3016 type: array
3017 items:
3018 type: string
3019 streamingPlaylists:
3020 type: array
3021 items:
3022 $ref: '#/components/schemas/VideoStreamingPlaylists'
3023 VideoImportStateConstant:
3024 properties:
3025 id:
3026 type: integer
3027 enum:
3028 - 1
3029 - 2
3030 - 3
3031 description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
3032 label:
3033 type: string
3034 VideoImport:
3035 properties:
3036 id:
3037 type: integer
3038 targetUrl:
3039 type: string
3040 magnetUri:
3041 type: string
3042 torrentName:
3043 type: string
3044 state:
3045 type: object
3046 properties:
3047 id:
3048 $ref: '#/components/schemas/VideoImportStateConstant'
3049 label:
3050 type: string
3051 error:
3052 type: string
3053 createdAt:
3054 type: string
3055 updatedAt:
3056 type: string
3057 video:
3058 $ref: '#/components/schemas/Video'
3059 VideoAbuse:
3060 properties:
3061 id:
3062 type: integer
3063 reason:
3064 type: string
3065 predefinedReasons:
3066 $ref: '#/components/schemas/VideoAbusePredefinedReasons'
3067 reporterAccount:
3068 $ref: '#/components/schemas/Account'
3069 state:
3070 $ref: '#/components/schemas/VideoAbuseStateConstant'
3071 moderationComment:
3072 type: string
3073 video:
3074 type: object
3075 properties:
3076 id:
3077 type: integer
3078 name:
3079 type: string
3080 uuid:
3081 type: string
3082 createdAt:
3083 type: string
3084 VideoBlacklist:
3085 properties:
3086 id:
3087 type: integer
3088 videoId:
3089 type: integer
3090 createdAt:
3091 type: string
3092 updatedAt:
3093 type: string
3094 name:
3095 type: string
3096 uuid:
3097 type: string
3098 description:
3099 type: string
3100 duration:
3101 type: integer
3102 views:
3103 type: integer
3104 likes:
3105 type: integer
3106 dislikes:
3107 type: integer
3108 nsfw:
3109 type: boolean
3110 VideoChannel:
3111 properties:
3112 displayName:
3113 type: string
3114 description:
3115 type: string
3116 isLocal:
3117 type: boolean
3118 ownerAccount:
3119 type: object
3120 properties:
3121 id:
3122 type: integer
3123 uuid:
3124 type: string
3125 VideoPlaylist:
3126 properties:
3127 id:
3128 type: integer
3129 createdAt:
3130 type: string
3131 updatedAt:
3132 type: string
3133 description:
3134 type: string
3135 uuid:
3136 type: string
3137 displayName:
3138 type: string
3139 isLocal:
3140 type: boolean
3141 videoLength:
3142 type: integer
3143 thumbnailPath:
3144 type: string
3145 privacy:
3146 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
3147 type:
3148 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
3149 ownerAccount:
3150 $ref: '#/components/schemas/AccountSummary'
3151 videoChannel:
3152 $ref: '#/components/schemas/VideoChannelSummary'
3153 VideoComment:
3154 properties:
3155 id:
3156 type: integer
3157 url:
3158 type: string
3159 text:
3160 type: string
3161 threadId:
3162 type: integer
3163 inReplyToCommentId:
3164 type: integer
3165 videoId:
3166 type: integer
3167 createdAt:
3168 type: string
3169 updatedAt:
3170 type: string
3171 totalRepliesFromVideoAuthor:
3172 type: integer
3173 totalReplies:
3174 type: integer
3175 account:
3176 $ref: '#/components/schemas/Account'
3177 VideoCommentThreadTree:
3178 properties:
3179 comment:
3180 $ref: '#/components/schemas/VideoComment'
3181 children:
3182 type: array
3183 items:
3184 $ref: '#/components/schemas/VideoCommentThreadTree'
3185 VideoCaption:
3186 properties:
3187 language:
3188 $ref: '#/components/schemas/VideoConstantString'
3189 captionPath:
3190 type: string
3191 Avatar:
3192 properties:
3193 path:
3194 type: string
3195 createdAt:
3196 type: string
3197 updatedAt:
3198 type: string
3199 Actor:
3200 properties:
3201 id:
3202 type: integer
3203 url:
3204 type: string
3205 name:
3206 type: string
3207 host:
3208 type: string
3209 followingCount:
3210 type: integer
3211 followersCount:
3212 type: integer
3213 createdAt:
3214 type: string
3215 updatedAt:
3216 type: string
3217 avatar:
3218 $ref: '#/components/schemas/Avatar'
3219 Account:
3220 allOf:
3221 - $ref: '#/components/schemas/Actor'
3222 - properties:
3223 userId:
3224 type: string
3225 displayName:
3226 type: string
3227 description:
3228 type: string
3229 User:
3230 properties:
3231 id:
3232 type: integer
3233 username:
3234 type: string
3235 email:
3236 type: string
3237 theme:
3238 type: string
3239 description: 'Theme enabled by this user'
3240 emailVerified:
3241 type: boolean
3242 description: 'Has the user confirmed their email address?'
3243 nsfwPolicy:
3244 $ref: '#/components/schemas/NSFWPolicy'
3245 webtorrentEnabled:
3246 type: boolean
3247 autoPlayVideo:
3248 type: boolean
3249 description: 'Automatically start playing the video on the watch page'
3250 role:
3251 $ref: '#/components/schemas/UserRole'
3252 roleLabel:
3253 type: string
3254 enum:
3255 - User
3256 - Moderator
3257 - Administrator
3258 videoQuota:
3259 type: integer
3260 videoQuotaDaily:
3261 type: integer
3262 videosCount:
3263 type: integer
3264 videoAbusesCount:
3265 type: integer
3266 videoAbusesAcceptedCount:
3267 type: integer
3268 videoAbusesCreatedCount:
3269 type: integer
3270 videoCommentsCount:
3271 type: integer
3272 noInstanceConfigWarningModal:
3273 type: boolean
3274 noWelcomeModal:
3275 type: boolean
3276 blocked:
3277 type: boolean
3278 blockedReason:
3279 type: string
3280 createdAt:
3281 type: string
3282 account:
3283 $ref: '#/components/schemas/Account'
3284 videoChannels:
3285 type: array
3286 items:
3287 $ref: '#/components/schemas/VideoChannel'
3288 UserWatchingVideo:
3289 properties:
3290 currentTime:
3291 type: integer
3292 ServerConfig:
3293 properties:
3294 instance:
3295 type: object
3296 properties:
3297 name:
3298 type: string
3299 shortDescription:
3300 type: string
3301 defaultClientRoute:
3302 type: string
3303 isNSFW:
3304 type: boolean
3305 defaultNSFWPolicy:
3306 type: string
3307 customizations:
3308 type: object
3309 properties:
3310 javascript:
3311 type: string
3312 css:
3313 type: string
3314 search:
3315 type: object
3316 properties:
3317 remoteUri:
3318 type: object
3319 properties:
3320 users:
3321 type: boolean
3322 anonymous:
3323 type: boolean
3324 plugin:
3325 type: object
3326 properties:
3327 registered:
3328 type: array
3329 items:
3330 type: string
3331 theme:
3332 type: object
3333 properties:
3334 registered:
3335 type: array
3336 items:
3337 type: string
3338 email:
3339 type: object
3340 properties:
3341 enabled:
3342 type: boolean
3343 contactForm:
3344 type: object
3345 properties:
3346 enabled:
3347 type: boolean
3348 serverVersion:
3349 type: string
3350 serverCommit:
3351 type: string
3352 signup:
3353 type: object
3354 properties:
3355 allowed:
3356 type: boolean
3357 allowedForCurrentIP:
3358 type: boolean
3359 requiresEmailVerification:
3360 type: boolean
3361 transcoding:
3362 type: object
3363 properties:
3364 hls:
3365 type: object
3366 properties:
3367 enabled:
3368 type: boolean
3369 webtorrent:
3370 type: object
3371 properties:
3372 enabled:
3373 type: boolean
3374 enabledResolutions:
3375 type: array
3376 items:
3377 type: integer
3378 import:
3379 type: object
3380 properties:
3381 videos:
3382 type: object
3383 properties:
3384 http:
3385 type: object
3386 properties:
3387 enabled:
3388 type: boolean
3389 torrent:
3390 type: object
3391 properties:
3392 enabled:
3393 type: boolean
3394 autoBlacklist:
3395 type: object
3396 properties:
3397 videos:
3398 type: object
3399 properties:
3400 ofUsers:
3401 type: object
3402 properties:
3403 enabled:
3404 type: boolean
3405 avatar:
3406 type: object
3407 properties:
3408 file:
3409 type: object
3410 properties:
3411 size:
3412 type: object
3413 properties:
3414 max:
3415 type: integer
3416 extensions:
3417 type: array
3418 items:
3419 type: string
3420 video:
3421 type: object
3422 properties:
3423 image:
3424 type: object
3425 properties:
3426 extensions:
3427 type: array
3428 items:
3429 type: string
3430 size:
3431 type: object
3432 properties:
3433 max:
3434 type: integer
3435 file:
3436 type: object
3437 properties:
3438 extensions:
3439 type: array
3440 items:
3441 type: string
3442 videoCaption:
3443 type: object
3444 properties:
3445 file:
3446 type: object
3447 properties:
3448 size:
3449 type: object
3450 properties:
3451 max:
3452 type: integer
3453 extensions:
3454 type: array
3455 items:
3456 type: string
3457 user:
3458 type: object
3459 properties:
3460 videoQuota:
3461 type: integer
3462 videoQuotaDaily:
3463 type: integer
3464 trending:
3465 type: object
3466 properties:
3467 videos:
3468 type: object
3469 properties:
3470 intervalDays:
3471 type: integer
3472 tracker:
3473 type: object
3474 properties:
3475 enabled:
3476 type: boolean
3477 followings:
3478 type: object
3479 properties:
3480 instance:
3481 type: object
3482 properties:
3483 autoFollowIndex:
3484 type: object
3485 properties:
3486 indexUrl:
3487 type: string
3488 ServerConfigAbout:
3489 properties:
3490 instance:
3491 type: object
3492 properties:
3493 name:
3494 type: string
3495 shortDescription:
3496 type: string
3497 description:
3498 type: string
3499 terms:
3500 type: string
3501 ServerConfigCustom:
3502 properties:
3503 instance:
3504 type: object
3505 properties:
3506 name:
3507 type: string
3508 shortDescription:
3509 type: string
3510 description:
3511 type: string
3512 terms:
3513 type: string
3514 defaultClientRoute:
3515 type: string
3516 isNSFW:
3517 type: boolean
3518 defaultNSFWPolicy:
3519 type: string
3520 customizations:
3521 type: object
3522 properties:
3523 javascript:
3524 type: string
3525 css:
3526 type: string
3527 theme:
3528 type: object
3529 properties:
3530 default:
3531 type: string
3532 services:
3533 type: object
3534 properties:
3535 twitter:
3536 type: object
3537 properties:
3538 username:
3539 type: string
3540 whitelisted:
3541 type: boolean
3542 cache:
3543 type: object
3544 properties:
3545 previews:
3546 type: object
3547 properties:
3548 size:
3549 type: integer
3550 captions:
3551 type: object
3552 properties:
3553 size:
3554 type: integer
3555 signup:
3556 type: object
3557 properties:
3558 enabled:
3559 type: boolean
3560 limit:
3561 type: integer
3562 requiresEmailVerification:
3563 type: boolean
3564 admin:
3565 type: object
3566 properties:
3567 email:
3568 type: string
3569 contactForm:
3570 type: object
3571 properties:
3572 enabled:
3573 type: boolean
3574 user:
3575 type: object
3576 properties:
3577 videoQuota:
3578 type: integer
3579 videoQuotaDaily:
3580 type: integer
3581 transcoding:
3582 type: object
3583 properties:
3584 enabled:
3585 type: boolean
3586 allowAdditionalExtensions:
3587 type: boolean
3588 allowAudioFiles:
3589 type: boolean
3590 threads:
3591 type: integer
3592 resolutions:
3593 type: object
3594 properties:
3595 240p:
3596 type: boolean
3597 360p:
3598 type: boolean
3599 480p:
3600 type: boolean
3601 720p:
3602 type: boolean
3603 1080p:
3604 type: boolean
3605 2160p:
3606 type: boolean
3607 hls:
3608 type: object
3609 properties:
3610 enabled:
3611 type: boolean
3612 import:
3613 type: object
3614 properties:
3615 videos:
3616 type: object
3617 properties:
3618 http:
3619 type: object
3620 properties:
3621 enabled:
3622 type: boolean
3623 torrent:
3624 type: object
3625 properties:
3626 enabled:
3627 type: boolean
3628 autoBlacklist:
3629 type: object
3630 properties:
3631 videos:
3632 type: object
3633 properties:
3634 ofUsers:
3635 type: object
3636 properties:
3637 enabled:
3638 type: boolean
3639 followers:
3640 type: object
3641 properties:
3642 instance:
3643 type: object
3644 properties:
3645 enabled:
3646 type: boolean
3647 manualApproval:
3648 type: boolean
3649 Follow:
3650 properties:
3651 id:
3652 type: integer
3653 follower:
3654 $ref: '#/components/schemas/Actor'
3655 following:
3656 $ref: '#/components/schemas/Actor'
3657 score:
3658 type: number
3659 state:
3660 type: string
3661 enum:
3662 - pending
3663 - accepted
3664 createdAt:
3665 type: string
3666 updatedAt:
3667 type: string
3668 Job:
3669 properties:
3670 id:
3671 type: integer
3672 state:
3673 type: string
3674 enum:
3675 - pending
3676 - processing
3677 - error
3678 - success
3679 category:
3680 type: string
3681 enum:
3682 - transcoding
3683 - activitypub-http
3684 handlerName:
3685 type: string
3686 handlerInputData:
3687 type: string
3688 createdAt:
3689 type: string
3690 updatedAt:
3691 type: string
3692 AddUserResponse:
3693 properties:
3694 id:
3695 type: integer
3696 uuid:
3697 type: string
3698 VideoUploadResponse:
3699 properties:
3700 video:
3701 type: object
3702 properties:
3703 id:
3704 type: integer
3705 uuid:
3706 type: string
3707 CommentThreadResponse:
3708 properties:
3709 total:
3710 type: integer
3711 data:
3712 type: array
3713 items:
3714 $ref: '#/components/schemas/VideoComment'
3715 CommentThreadPostResponse:
3716 properties:
3717 comment:
3718 $ref: '#/components/schemas/VideoComment'
3719 VideoListResponse:
3720 properties:
3721 total:
3722 type: integer
3723 data:
3724 type: array
3725 items:
3726 $ref: '#/components/schemas/Video'
3727 AddUser:
3728 properties:
3729 username:
3730 type: string
3731 description: 'The user username'
3732 minLength: 1
3733 maxLength: 50
3734 password:
3735 type: string
3736 description: 'The user password. If the smtp server is configured, you can leave empty and an email will be sent'
3737 minLength: 6
3738 maxLength: 255
3739 email:
3740 type: string
3741 description: 'The user email. MUST be in the format of an email address.'
3742 videoQuota:
3743 type: string
3744 description: 'The user video quota'
3745 videoQuotaDaily:
3746 type: string
3747 description: 'The user daily video quota'
3748 role:
3749 $ref: '#/components/schemas/UserRole'
3750 required:
3751 - username
3752 - password
3753 - email
3754 - videoQuota
3755 - videoQuotaDaily
3756 - role
3757 UpdateUser:
3758 properties:
3759 id:
3760 type: string
3761 description: 'The user id'
3762 email:
3763 type: string
3764 description: 'The updated email of the user'
3765 videoQuota:
3766 type: string
3767 description: 'The updated video quota of the user'
3768 videoQuotaDaily:
3769 type: string
3770 description: 'The updated daily video quota of the user'
3771 role:
3772 $ref: '#/components/schemas/UserRole'
3773 required:
3774 - id
3775 - email
3776 - videoQuota
3777 - videoQuotaDaily
3778 - role
3779 UpdateMe:
3780 properties:
3781 password:
3782 type: string
3783 description: 'Your new password'
3784 email:
3785 type: string
3786 description: 'Your new email'
3787 displayNSFW:
3788 type: string
3789 description: 'Your new displayNSFW'
3790 autoPlayVideo:
3791 type: string
3792 description: 'Your new autoPlayVideo'
3793 required:
3794 - password
3795 - email
3796 - displayNSFW
3797 - autoPlayVideo
3798 GetMeVideoRating:
3799 properties:
3800 id:
3801 type: string
3802 description: 'Id of the video'
3803 rating:
3804 type: number
3805 description: 'Rating of the video'
3806 required:
3807 - id
3808 - rating
3809 VideoRating:
3810 properties:
3811 video:
3812 $ref: '#/components/schemas/Video'
3813 rating:
3814 type: number
3815 description: 'Rating of the video'
3816 required:
3817 - video
3818 - rating
3819 RegisterUser:
3820 properties:
3821 username:
3822 type: string
3823 description: 'The username of the user'
3824 password:
3825 type: string
3826 description: 'The password of the user'
3827 email:
3828 type: string
3829 description: 'The email of the user'
3830 displayName:
3831 type: string
3832 description: 'The user display name'
3833 channel:
3834 type: object
3835 properties:
3836 name:
3837 type: string
3838 description: 'The name for the default channel'
3839 displayName:
3840 type: string
3841 description: 'The display name for the default channel'
3842
3843 required:
3844 - username
3845 - password
3846 - email
3847 VideoChannelCreate:
3848 properties:
3849 name:
3850 type: string
3851 displayName:
3852 type: string
3853 description:
3854 type: string
3855 support:
3856 type: string
3857 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
3858 required:
3859 - name
3860 - displayName
3861 VideoChannelUpdate:
3862 properties:
3863 displayName:
3864 type: string
3865 description:
3866 type: string
3867 support:
3868 type: string
3869 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
3870 bulkVideosSupportUpdate:
3871 type: boolean
3872 description: 'Update the support field for all videos of this channel'
3873
3874 MRSSPeerLink:
3875 type: object
3876 xml:
3877 name: 'media:peerLink'
3878 properties:
3879 href:
3880 type: string
3881 xml:
3882 attribute: true
3883 type:
3884 type: string
3885 enum:
3886 - application/x-bittorrent
3887 xml:
3888 attribute: true
3889 MRSSGroupContent:
3890 type: object
3891 xml:
3892 name: 'media:content'
3893 properties:
3894 url:
3895 type: string
3896 xml:
3897 attribute: true
3898 fileSize:
3899 type: integer
3900 xml:
3901 attribute: true
3902 type:
3903 type: string
3904 xml:
3905 attribute: true
3906 framerate:
3907 type: integer
3908 xml:
3909 attribute: true
3910 duration:
3911 type: integer
3912 xml:
3913 attribute: true
3914 height:
3915 type: integer
3916 xml:
3917 attribute: true
3918 lang:
3919 type: string
3920 xml:
3921 attribute: true
3922 VideoCommentsForXML:
3923 type: array
3924 xml:
3925 wrapped: true
3926 name: 'channel'
3927 items:
3928 type: object
3929 xml:
3930 name: 'item'
3931 properties:
3932 link:
3933 type: string
3934 guid:
3935 type: string
3936 pubDate:
3937 type: string
3938 format: date-time
3939 'content:encoded':
3940 type: string
3941 'dc:creator':
3942 type: string
3943 VideosForXML:
3944 type: array
3945 xml:
3946 wrapped: true
3947 name: 'channel'
3948 items:
3949 type: object
3950 xml:
3951 name: 'item'
3952 properties:
3953 link:
3954 type: string
3955 description: video watch page URL
3956 guid:
3957 type: string
3958 description: video canonical URL
3959 pubDate:
3960 type: string
3961 format: date-time
3962 description: video publication date
3963 description:
3964 type: string
3965 description: video description
3966 'content:encoded':
3967 type: string
3968 description: video description
3969 'dc:creator':
3970 type: string
3971 description: publisher user name
3972 'media:category':
3973 type: integer
3974 description: video category (MRSS)
3975 'media:community':
3976 type: object
3977 description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
3978 properties:
3979 'media:statistics':
3980 type: object
3981 properties:
3982 views:
3983 type: integer
3984 xml:
3985 attribute: true
3986 'media:embed':
3987 type: object
3988 properties:
3989 url:
3990 type: string
3991 description: video embed path, relative to the canonical URL domain (MRSS)
3992 xml:
3993 attribute: true
3994 'media:player':
3995 type: object
3996 properties:
3997 url:
3998 type: string
3999 description: video watch path, relative to the canonical URL domain (MRSS)
4000 xml:
4001 attribute: true
4002 'media:thumbnail':
4003 type: object
4004 properties:
4005 url:
4006 type: string
4007 xml:
4008 attribute: true
4009 height:
4010 type: integer
4011 xml:
4012 attribute: true
4013 width:
4014 type: integer
4015 xml:
4016 attribute: true
4017 'media:title':
4018 type: string
4019 description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
4020 'media:description':
4021 type: string
4022 'media:rating':
4023 type: string
4024 enum:
4025 - nonadult
4026 - adult
4027 description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
4028 'enclosure':
4029 type: object
4030 description: main streamable file for the video
4031 properties:
4032 url:
4033 type: string
4034 xml:
4035 attribute: true
4036 type:
4037 type: string
4038 enum:
4039 - application/x-bittorrent
4040 xml:
4041 attribute: true
4042 length:
4043 type: integer
4044 xml:
4045 attribute: true
4046 'media:group':
4047 type: array
4048 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)
4049 items:
4050 anyOf:
4051 - $ref: '#/components/schemas/MRSSPeerLink'
4052 - $ref: '#/components/schemas/MRSSGroupContent'