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