]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/doc/api/openapi.yaml
Add video import in open api
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
1 openapi: 3.0.0
2 info:
3 title: PeerTube
4 version: 1.3.1
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 The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable
17 resource URLs. It returns HTTP response codes to indicate errors. It also
18 accepts and returns JSON in the HTTP body. You can use your favorite
19 HTTP/REST library for your programming language to use PeerTube. No official
20 SDK is currently provided, but the spec API is fully compatible with
21 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
22 which generates a client SDK in the language of your choice.
23
24 # Authentication
25 When you sign up for an account, you are given the possibility to generate
26 sessions, and authenticate using this session token. One session token can
27 currently be used at a time.
28
29 # Errors
30 The API uses standard HTTP status codes to indicate the success or failure
31 of the API call. The body of the response will be JSON in the following
32 format.
33
34 ```
35 {
36 "code": "unauthorized_request", // example inner error code
37 "error": "Token is invalid." // example exposed error message
38 }
39 ```
40 externalDocs:
41 url: https://docs.joinpeertube.org/api-rest-reference.html
42 tags:
43 - name: Accounts
44 description: >
45 Using some features of PeerTube require authentication, for which Accounts
46 provide different levels of permission as well as associated user
47 information. Accounts also encompass remote accounts discovered across the federation.
48 - name: Config
49 description: >
50 Each server exposes public information regarding supported videos and
51 options.
52 - name: Feeds
53 description: |
54 Feeds of videos and feeds of comments allow to see updates and get them in
55 an aggregator or script of your choice.
56 - name: Job
57 description: >
58 Jobs are long-running tasks enqueued and processed by the instance
59 itself. No additional worker registration is currently available.
60 - name: Server Following
61 description: >
62 Managing servers which the instance interacts with is crucial to the
63 concept of federation in PeerTube and external video indexation. The PeerTube
64 server then deals with inter-server ActivityPub operations and propagates
65 information across its social graph by posting activities to actors' inbox
66 endpoints.
67 - name: Video Abuse
68 description: |
69 Video abuses deal with reports of local or remote videos alike.
70 - name: Video
71 description: |
72 Operations dealing with listing, uploading, fetching or modifying videos.
73 - name: Search
74 description: |
75 The search helps to find _videos_ from within the instance and beyond.
76 Videos from other instances federated by the instance (that is, instances
77 followed by the instance) can be found via keywords and other criteria of
78 the advanced search.
79 - name: Video Comment
80 description: >
81 Operations dealing with comments to a video. Comments are organized in
82 threads.
83 - name: Video Channel
84 description: >
85 Operations dealing with creation, modification and video listing of a
86 user's channels.
87 - name: Video Blacklist
88 description: >
89 Operations dealing with blacklisting videos (removing them from view and
90 preventing interactions).
91 - name: Video Rate
92 description: >
93 Voting for a video.
94 x-tagGroups:
95 - name: Accounts
96 tags:
97 - Accounts
98 - User
99 - My User
100 - name: Videos
101 tags:
102 - Video
103 - Video Caption
104 - Video Channel
105 - Video Comment
106 - Video Following
107 - Video Rate
108 - name: Moderation
109 tags:
110 - Video Abuse
111 - Video Blacklist
112 - name: Instance Configuration
113 tags:
114 - Config
115 - Server Following
116 - name: Notifications
117 tags:
118 - Feeds
119 - name: Jobs
120 tags:
121 - Job
122 - name: Search
123 tags:
124 - Search
125 paths:
126 '/accounts/{name}':
127 get:
128 tags:
129 - Accounts
130 summary: Get the account by name
131 parameters:
132 - $ref: '#/components/parameters/name'
133 - $ref: '#/components/parameters/start'
134 - $ref: '#/components/parameters/count'
135 - $ref: '#/components/parameters/sort'
136 responses:
137 '200':
138 description: successful operation
139 content:
140 application/json:
141 schema:
142 $ref: '#/components/schemas/Account'
143 '/accounts/{name}/videos':
144 get:
145 tags:
146 - Accounts
147 - Video
148 summary: 'Get videos for an account, provided the name of that account'
149 parameters:
150 - $ref: '#/components/parameters/name'
151 responses:
152 '200':
153 description: successful operation
154 content:
155 application/json:
156 schema:
157 $ref: '#/components/schemas/VideoListResponse'
158 x-code-samples:
159 - lang: JavaScript
160 source: |
161 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
162 .then(function(response) {
163 return response.json()
164 }).then(function(data) {
165 console.log(data)
166 })
167 - lang: Shell
168 source: |
169 # pip install httpie
170 http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
171 - lang: Ruby
172 source: |
173 require 'uri'
174 require 'net/http'
175
176 url = URI("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
177
178 http = Net::HTTP.new(url.host, url.port)
179 http.use_ssl = true
180 http.verify_mode = OpenSSL::SSL::VERIFY_NONE
181
182 request = Net::HTTP::Post.new(url)
183 request["content-type"] = 'application/json'
184 response = http.request(request)
185 puts response.read_body
186 - lang: Python
187 source: |
188 import http.client
189
190 conn = http.client.HTTPSConnection("https://peertube2.cpy.re/api/v1")
191
192 headers = {
193 'content-type': "application/json"
194 }
195
196 conn.request("POST", "/accounts/{name}/videos", None, headers)
197
198 res = conn.getresponse()
199 data = res.read()
200
201 print(data.decode("utf-8"))
202 /accounts:
203 get:
204 tags:
205 - Accounts
206 summary: Get all accounts
207 responses:
208 '200':
209 description: successful operation
210 content:
211 'application/json':
212 schema:
213 type: array
214 items:
215 $ref: '#/components/schemas/Account'
216 /config:
217 get:
218 tags:
219 - Config
220 summary: Get the public configuration of the server
221 responses:
222 '200':
223 description: successful operation
224 content:
225 application/json:
226 schema:
227 $ref: '#/components/schemas/ServerConfig'
228 /config/about:
229 get:
230 summary: Get the instance about page content
231 tags:
232 - Config
233 responses:
234 '200':
235 description: successful operation
236 /config/custom:
237 get:
238 summary: Get the runtime configuration of the server
239 tags:
240 - Config
241 security:
242 - OAuth2:
243 - admin
244 responses:
245 '200':
246 description: successful operation
247 put:
248 summary: Set the runtime configuration of the server
249 tags:
250 - Config
251 security:
252 - OAuth2:
253 - admin
254 responses:
255 '200':
256 description: successful operation
257 delete:
258 summary: Delete the runtime configuration of the server
259 tags:
260 - Config
261 security:
262 - OAuth2:
263 - admin
264 responses:
265 '200':
266 description: successful operation
267 '/feeds/videos.{format}':
268 get:
269 summary: >-
270 Get the feed of videos for the server, with optional filter by account
271 name or id
272 tags:
273 - Feeds
274 parameters:
275 - name: format
276 in: path
277 required: true
278 description: >-
279 The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and
280 json to JSON FEED 1.0
281 schema:
282 type: string
283 enum:
284 - xml
285 - atom
286 - json
287 default: xml
288 - name: accountId
289 in: query
290 required: false
291 description: >-
292 The id of the local account to filter to (beware, users IDs and not
293 actors IDs which will return empty feeds
294 schema:
295 type: number
296 - name: accountName
297 in: query
298 required: false
299 description: The name of the local account to filter to
300 schema:
301 type: string
302 responses:
303 '200':
304 description: successful operation
305 /jobs/{state}:
306 get:
307 summary: Get list of jobs
308 security:
309 - OAuth2:
310 - admin
311 tags:
312 - Job
313 parameters:
314 - name: state
315 in: path
316 required: true
317 description: The state of the job
318 schema:
319 type: string
320 enum:
321 - active
322 - completed
323 - failed
324 - waiting
325 - delayed
326 - $ref: '#/components/parameters/start'
327 - $ref: '#/components/parameters/count'
328 - $ref: '#/components/parameters/sort'
329 responses:
330 '200':
331 description: successful operation
332 content:
333 application/json:
334 schema:
335 type: array
336 items:
337 $ref: '#/components/schemas/Job'
338 '/server/following/{host}':
339 delete:
340 security:
341 - OAuth2:
342 - admin
343 tags:
344 - Server Following
345 summary: Unfollow a server by hostname
346 parameters:
347 - name: host
348 in: path
349 required: true
350 description: 'The host to unfollow '
351 schema:
352 type: string
353 responses:
354 '201':
355 description: successful operation
356 /server/followers:
357 get:
358 tags:
359 - Server Following
360 summary: Get followers of the server
361 parameters:
362 - $ref: '#/components/parameters/start'
363 - $ref: '#/components/parameters/count'
364 - $ref: '#/components/parameters/sort'
365 responses:
366 '200':
367 description: successful operation
368 content:
369 application/json:
370 schema:
371 type: array
372 items:
373 $ref: '#/components/schemas/Follow'
374 /server/following:
375 get:
376 tags:
377 - Server Following
378 summary: Get servers followed by the server
379 parameters:
380 - $ref: '#/components/parameters/start'
381 - $ref: '#/components/parameters/count'
382 - $ref: '#/components/parameters/sort'
383 responses:
384 '200':
385 description: successful operation
386 content:
387 application/json:
388 schema:
389 type: array
390 items:
391 $ref: '#/components/schemas/Follow'
392 post:
393 security:
394 - OAuth2:
395 - admin
396 tags:
397 - Server Following
398 summary: Follow a server
399 responses:
400 '204':
401 $ref: '#/paths/~1users~1me/put/responses/204'
402 requestBody:
403 content:
404 application/json:
405 schema:
406 $ref: '#/components/schemas/Follow'
407 /users:
408 post:
409 summary: Creates user
410 security:
411 - OAuth2:
412 - admin
413 tags:
414 - User
415 responses:
416 '200':
417 description: successful operation
418 content:
419 application/json:
420 schema:
421 $ref: '#/components/schemas/AddUserResponse'
422 requestBody:
423 content:
424 application/json:
425 schema:
426 $ref: '#/components/schemas/AddUser'
427 description: User to create
428 required: true
429 get:
430 summary: Get a list of users
431 security:
432 - OAuth2: []
433 tags:
434 - User
435 parameters:
436 - $ref: '#/components/parameters/start'
437 - $ref: '#/components/parameters/count'
438 - $ref: '#/components/parameters/usersSort'
439 responses:
440 '200':
441 description: successful operation
442 content:
443 application/json:
444 schema:
445 type: array
446 items:
447 $ref: '#/components/schemas/User'
448 '/users/{id}':
449 delete:
450 summary: Delete a user by its id
451 security:
452 - OAuth2:
453 - admin
454 tags:
455 - User
456 parameters:
457 - $ref: '#/components/parameters/id'
458 responses:
459 '204':
460 $ref: '#/paths/~1users~1me/put/responses/204'
461 get:
462 summary: Get user by its id
463 security:
464 - OAuth2: []
465 tags:
466 - User
467 parameters:
468 - $ref: '#/components/parameters/id'
469 responses:
470 '200':
471 description: successful operation
472 content:
473 application/json:
474 schema:
475 $ref: '#/components/schemas/User'
476 put:
477 summary: Update user profile by its id
478 security:
479 - OAuth2: []
480 tags:
481 - User
482 parameters:
483 - $ref: '#/components/parameters/id'
484 responses:
485 '204':
486 $ref: '#/paths/~1users~1me/put/responses/204'
487 requestBody:
488 content:
489 application/json:
490 schema:
491 $ref: '#/components/schemas/UpdateUser'
492 required: true
493 /users/register:
494 post:
495 summary: Register a user
496 tags:
497 - User
498 responses:
499 '204':
500 $ref: '#/paths/~1users~1me/put/responses/204'
501 requestBody:
502 content:
503 application/json:
504 schema:
505 $ref: '#/components/schemas/RegisterUser'
506 required: true
507 /users/me:
508 get:
509 summary: Get current user information
510 security:
511 - OAuth2:
512 - user
513 tags:
514 - My User
515 responses:
516 '200':
517 description: successful operation
518 content:
519 application/json:
520 schema:
521 type: array
522 items:
523 $ref: '#/components/schemas/User'
524 put:
525 summary: Update current user information
526 security:
527 - OAuth2:
528 - user
529 tags:
530 - My User
531 responses:
532 '204':
533 description: Successful operation
534 requestBody:
535 content:
536 application/json:
537 schema:
538 $ref: '#/components/schemas/UpdateMe'
539 required: true
540 /users/me/videos/imports:
541 get:
542 summary: Get video imports of current user
543 security:
544 - OAuth2:
545 - user
546 tags:
547 - My User
548 parameters:
549 - $ref: '#/components/parameters/start'
550 - $ref: '#/components/parameters/count'
551 - $ref: '#/components/parameters/sort'
552 responses:
553 '200':
554 description: successful operation
555 content:
556 application/json:
557 schema:
558 $ref: '#/components/schemas/VideoImport'
559 /users/me/video-quota-used:
560 get:
561 summary: Get current user used quota
562 security:
563 - OAuth2:
564 - user
565 tags:
566 - My User
567 responses:
568 '200':
569 description: successful operation
570 content:
571 application/json:
572 schema:
573 type: number
574 '/users/me/videos/{videoId}/rating':
575 get:
576 summary: 'Get rating of video by its id, among those of the current user'
577 security:
578 - OAuth2: []
579 tags:
580 - My User
581 parameters:
582 - name: videoId
583 in: path
584 required: true
585 description: 'The video id '
586 schema:
587 type: string
588 responses:
589 '200':
590 description: successful operation
591 content:
592 application/json:
593 schema:
594 $ref: '#/components/schemas/GetMeVideoRating'
595 /users/me/videos:
596 get:
597 summary: Get videos of the current user
598 security:
599 - OAuth2:
600 - user
601 tags:
602 - My User
603 parameters:
604 - $ref: '#/components/parameters/start'
605 - $ref: '#/components/parameters/count'
606 - $ref: '#/components/parameters/sort'
607 responses:
608 '200':
609 description: successful operation
610 content:
611 application/json:
612 schema:
613 $ref: '#/components/schemas/VideoListResponse'
614 /users/me/subscriptions:
615 get:
616 summary: Get subscriptions of the current user
617 security:
618 - OAuth2:
619 - user
620 tags:
621 - My User
622 parameters:
623 - $ref: '#/components/parameters/start'
624 - $ref: '#/components/parameters/count'
625 - $ref: '#/components/parameters/sort'
626 responses:
627 '200':
628 description: successful operation
629 post:
630 summary: Add subscription to the current user
631 security:
632 - OAuth2:
633 - user
634 tags:
635 - My User
636 responses:
637 '200':
638 description: successful operation
639 /users/me/subscriptions/exist:
640 get:
641 summary: Get if subscriptions exist for the current user
642 security:
643 - OAuth2:
644 - user
645 tags:
646 - My User
647 parameters:
648 - $ref: '#/components/parameters/subscriptionsUris'
649 responses:
650 '200':
651 description: successful operation
652 content:
653 application/json:
654 schema:
655 type: object
656 /users/me/subscriptions/videos:
657 get:
658 summary: Get videos of subscriptions of the current user
659 security:
660 - OAuth2:
661 - user
662 tags:
663 - My User
664 parameters:
665 - $ref: '#/components/parameters/start'
666 - $ref: '#/components/parameters/count'
667 - $ref: '#/components/parameters/sort'
668 responses:
669 '200':
670 description: successful operation
671 content:
672 application/json:
673 schema:
674 $ref: '#/components/schemas/VideoListResponse'
675 '/users/me/subscriptions/{subscriptionHandle}':
676 get:
677 summary: Get subscription of the current user for a given uri
678 security:
679 - OAuth2:
680 - user
681 tags:
682 - My User
683 parameters:
684 - $ref: '#/components/parameters/subscriptionHandle'
685 responses:
686 '200':
687 description: successful operation
688 content:
689 application/json:
690 schema:
691 $ref: '#/components/schemas/VideoChannel'
692 delete:
693 summary: Delete subscription of the current user for a given uri
694 security:
695 - OAuth2:
696 - user
697 tags:
698 - My User
699 parameters:
700 - $ref: '#/components/parameters/subscriptionHandle'
701 responses:
702 '200':
703 description: successful operation
704 /users/me/avatar/pick:
705 post:
706 summary: Update current user avatar
707 security:
708 - OAuth2: []
709 tags:
710 - My User
711 responses:
712 '200':
713 description: successful operation
714 content:
715 application/json:
716 schema:
717 $ref: '#/components/schemas/Avatar'
718 requestBody:
719 content:
720 multipart/form-data:
721 schema:
722 type: object
723 properties:
724 avatarfile:
725 description: The file to upload.
726 type: string
727 format: binary
728 encoding:
729 profileImage:
730 # only accept png/jpeg
731 contentType: image/png, image/jpeg
732 /videos:
733 get:
734 summary: Get list of videos
735 tags:
736 - Video
737 parameters:
738 - $ref: '#/components/parameters/categoryOneOf'
739 - $ref: '#/components/parameters/tagsOneOf'
740 - $ref: '#/components/parameters/tagsAllOf'
741 - $ref: '#/components/parameters/licenceOneOf'
742 - $ref: '#/components/parameters/languageOneOf'
743 - $ref: '#/components/parameters/nsfw'
744 - $ref: '#/components/parameters/filter'
745 - $ref: '#/components/parameters/start'
746 - $ref: '#/components/parameters/count'
747 - $ref: '#/components/parameters/videosSort'
748 responses:
749 '200':
750 description: successful operation
751 content:
752 application/json:
753 schema:
754 $ref: '#/components/schemas/VideoListResponse'
755 /videos/categories:
756 get:
757 summary: Get list of video categories known by the server
758 tags:
759 - Video
760 responses:
761 '200':
762 description: successful operation
763 content:
764 application/json:
765 schema:
766 type: array
767 items:
768 type: string
769 /videos/licences:
770 get:
771 summary: Get list of video licences known by the server
772 tags:
773 - Video
774 responses:
775 '200':
776 description: successful operation
777 content:
778 application/json:
779 schema:
780 type: array
781 items:
782 type: string
783 /videos/languages:
784 get:
785 summary: Get list of languages known by the server
786 tags:
787 - Video
788 responses:
789 '200':
790 description: successful operation
791 content:
792 application/json:
793 schema:
794 type: array
795 items:
796 type: string
797 /videos/privacies:
798 get:
799 summary: Get list of privacy policies supported by the server
800 tags:
801 - Video
802 responses:
803 '200':
804 description: successful operation
805 content:
806 application/json:
807 schema:
808 type: array
809 items:
810 type: string
811 '/videos/{id}':
812 put:
813 summary: Update metadata for a video by its id
814 security:
815 - OAuth2: []
816 tags:
817 - Video
818 parameters:
819 - $ref: '#/components/parameters/idOrUUID'
820 responses:
821 '200':
822 description: successful operation
823 content:
824 application/json:
825 schema:
826 $ref: '#/components/schemas/Video'
827 requestBody:
828 content:
829 multipart/form-data:
830 schema:
831 type: object
832 properties:
833 thumbnailfile:
834 description: Video thumbnail file
835 type: string
836 previewfile:
837 description: Video preview file
838 type: string
839 category:
840 description: Video category
841 type: string
842 licence:
843 description: Video licence
844 type: string
845 language:
846 description: Video language
847 type: string
848 description:
849 description: Video description
850 type: string
851 waitTranscoding:
852 description: Whether or not we wait transcoding before publish the video
853 type: string
854 support:
855 description: Text describing how to support the video uploader
856 type: string
857 nsfw:
858 description: Whether or not this video contains sensitive content
859 type: string
860 name:
861 description: Video name
862 type: string
863 tags:
864 description: Video tags (maximum 5 tags each between 2 and 30 characters)
865 type: array
866 items:
867 type: string
868 commentsEnabled:
869 description: Enable or disable comments for this video
870 type: string
871 scheduleUpdate:
872 $ref: '#/components/schemas/VideoScheduledUpdate'
873 get:
874 summary: Get a video by its id
875 tags:
876 - Video
877 parameters:
878 - $ref: '#/components/parameters/idOrUUID'
879 responses:
880 '200':
881 description: successful operation
882 content:
883 application/json:
884 schema:
885 $ref: '#/components/schemas/VideoDetails'
886 delete:
887 summary: Delete a video by its id
888 security:
889 - OAuth2: []
890 tags:
891 - Video
892 parameters:
893 - $ref: '#/components/parameters/idOrUUID'
894 responses:
895 '204':
896 $ref: '#/paths/~1users~1me/put/responses/204'
897 '/videos/{id}/description':
898 get:
899 summary: Get a video description by its id
900 tags:
901 - Video
902 parameters:
903 - $ref: '#/components/parameters/idOrUUID'
904 responses:
905 '200':
906 description: successful operation
907 content:
908 application/json:
909 schema:
910 type: string
911 '/videos/{id}/views':
912 post:
913 summary: Add a view to the video by its id
914 tags:
915 - Video
916 parameters:
917 - $ref: '#/components/parameters/idOrUUID'
918 responses:
919 '204':
920 $ref: '#/paths/~1users~1me/put/responses/204'
921 '/videos/{id}/watching':
922 put:
923 summary: Set watching progress of a video by its id for a user
924 tags:
925 - Video
926 security:
927 - OAuth2: []
928 parameters:
929 - $ref: '#/components/parameters/idOrUUID'
930 requestBody:
931 content:
932 application/json:
933 schema:
934 $ref: '#/components/schemas/UserWatchingVideo'
935 required: true
936 responses:
937 '204':
938 $ref: '#/paths/~1users~1me/put/responses/204'
939 /videos/ownership:
940 get:
941 summary: Get list of video ownership changes requests
942 tags:
943 - Video
944 security:
945 - OAuth2: []
946 responses:
947 '200':
948 description: successful operation
949 '/videos/ownership/{id}/accept':
950 post:
951 summary: Refuse ownership change request for video by its id
952 tags:
953 - Video
954 security:
955 - OAuth2: []
956 parameters:
957 - $ref: '#/components/parameters/idOrUUID'
958 responses:
959 '204':
960 $ref: '#/paths/~1users~1me/put/responses/204'
961 '/videos/ownership/{id}/refuse':
962 post:
963 summary: Accept ownership change request for video by its id
964 tags:
965 - Video
966 security:
967 - OAuth2: []
968 parameters:
969 - $ref: '#/components/parameters/idOrUUID'
970 responses:
971 '204':
972 $ref: '#/paths/~1users~1me/put/responses/204'
973 '/videos/{id}/give-ownership':
974 post:
975 summary: Request change of ownership for a video you own, by its id
976 tags:
977 - Video
978 security:
979 - OAuth2: []
980 parameters:
981 - $ref: '#/components/parameters/idOrUUID'
982 requestBody:
983 required: true
984 content:
985 application/x-www-form-urlencoded:
986 schema:
987 type: object
988 properties:
989 username:
990 type: string
991 required:
992 - username
993 responses:
994 '204':
995 $ref: '#/paths/~1users~1me/put/responses/204'
996 '400':
997 description: 'Changing video ownership to a remote account is not supported yet'
998 /videos/upload:
999 post:
1000 summary: Upload a video file with its metadata
1001 security:
1002 - OAuth2: []
1003 tags:
1004 - Video
1005 responses:
1006 '200':
1007 description: successful operation
1008 content:
1009 application/json:
1010 schema:
1011 $ref: '#/components/schemas/VideoUploadResponse'
1012 requestBody:
1013 content:
1014 multipart/form-data:
1015 schema:
1016 type: object
1017 properties:
1018 videofile:
1019 description: Video file
1020 type: string
1021 format: binary
1022 channelId:
1023 description: Channel id that will contain this video
1024 type: number
1025 thumbnailfile:
1026 description: Video thumbnail file
1027 type: string
1028 previewfile:
1029 description: Video preview file
1030 type: string
1031 privacy:
1032 $ref: '#/components/schemas/VideoPrivacySet'
1033 category:
1034 description: Video category
1035 type: string
1036 licence:
1037 description: Video licence
1038 type: string
1039 language:
1040 description: Video language
1041 type: string
1042 description:
1043 description: Video description
1044 type: string
1045 waitTranscoding:
1046 description: Whether or not we wait transcoding before publish the video
1047 type: string
1048 support:
1049 description: Text describing how to support the video uploader
1050 type: string
1051 nsfw:
1052 description: Whether or not this video contains sensitive content
1053 type: string
1054 name:
1055 description: Video name
1056 type: string
1057 tags:
1058 description: Video tags
1059 type: array
1060 items:
1061 type: string
1062 commentsEnabled:
1063 description: Enable or disable comments for this video
1064 type: string
1065 scheduleUpdate:
1066 $ref: '#/components/schemas/VideoScheduledUpdate'
1067 required:
1068 - videofile
1069 - channelId
1070 - name
1071 x-code-samples:
1072 - lang: Shell
1073 source: |
1074 ## DEPENDENCIES: httpie, jq
1075 # pip install httpie
1076 USERNAME="<your_username>"
1077 PASSWORD="<your_password>"
1078 FILE_PATH="<your_file_path>"
1079 CHANNEL_ID="<your_channel_id>"
1080 NAME="<video_name>"
1081
1082 API_PATH="https://peertube2.cpy.re/api/v1"
1083 ## AUTH
1084 client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1085 client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1086 token=$(http -b --form POST "$API_PATH/users/token" \
1087 client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
1088 username=$USERNAME \
1089 password=$PASSWORD \
1090 | jq -r ".access_token")
1091 ## VIDEO UPLOAD
1092 http -b --form POST "$API_PATH/videos/upload" \
1093 videofile@$FILE_PATH \
1094 channelId=$CHANNEL_ID \
1095 name=$NAME \
1096 "Authorization:Bearer $token"
1097 /videos/imports:
1098 post:
1099 summary: Import a torrent or magnetURI or HTTP ressource (if enabled by the instance administrator)
1100 security:
1101 - OAuth2: []
1102 tags:
1103 - Video
1104 responses:
1105 '200':
1106 description: successful operation
1107 content:
1108 application/json:
1109 schema:
1110 $ref: '#/components/schemas/VideoUploadResponse'
1111 requestBody:
1112 content:
1113 multipart/form-data:
1114 schema:
1115 type: object
1116 properties:
1117 torrentfile:
1118 description: Torrent File
1119 type: string
1120 format: binary
1121 targetUrl:
1122 description: HTTP target URL
1123 type: string
1124 magnetUri:
1125 description: Magnet URI
1126 type: string
1127 channelId:
1128 description: Channel id that will contain this video
1129 type: number
1130 thumbnailfile:
1131 description: Video thumbnail file
1132 type: string
1133 previewfile:
1134 description: Video preview file
1135 type: string
1136 privacy:
1137 $ref: '#/components/schemas/VideoPrivacySet'
1138 category:
1139 description: Video category
1140 type: string
1141 licence:
1142 description: Video licence
1143 type: string
1144 language:
1145 description: Video language
1146 type: string
1147 description:
1148 description: Video description
1149 type: string
1150 waitTranscoding:
1151 description: Whether or not we wait transcoding before publish the video
1152 type: string
1153 support:
1154 description: Text describing how to support the video uploader
1155 type: string
1156 nsfw:
1157 description: Whether or not this video contains sensitive content
1158 type: string
1159 name:
1160 description: Video name
1161 type: string
1162 tags:
1163 description: Video tags
1164 type: array
1165 items:
1166 type: string
1167 commentsEnabled:
1168 description: Enable or disable comments for this video
1169 type: string
1170 scheduleUpdate:
1171 $ref: '#/components/schemas/VideoScheduledUpdate'
1172 required:
1173 - channelId
1174 - name
1175 /videos/abuse:
1176 get:
1177 summary: Get list of reported video abuses
1178 security:
1179 - OAuth2: []
1180 tags:
1181 - Video Abuse
1182 parameters:
1183 - $ref: '#/components/parameters/start'
1184 - $ref: '#/components/parameters/count'
1185 - $ref: '#/components/parameters/abusesSort'
1186 responses:
1187 '200':
1188 description: successful operation
1189 content:
1190 application/json:
1191 schema:
1192 type: array
1193 items:
1194 $ref: '#/components/schemas/VideoAbuse'
1195 '/videos/{id}/abuse':
1196 post:
1197 summary: 'Report an abuse, on a video by its id'
1198 security:
1199 - OAuth2: []
1200 tags:
1201 - Video Abuse
1202 parameters:
1203 - $ref: '#/components/parameters/idOrUUID'
1204 responses:
1205 '204':
1206 $ref: '#/paths/~1users~1me/put/responses/204'
1207 '/videos/{id}/blacklist':
1208 post:
1209 summary: Put on blacklist a video by its id
1210 security:
1211 - OAuth2:
1212 - admin
1213 - moderator
1214 tags:
1215 - Video Blacklist
1216 parameters:
1217 - $ref: '#/components/parameters/idOrUUID'
1218 responses:
1219 '204':
1220 $ref: '#/paths/~1users~1me/put/responses/204'
1221 delete:
1222 summary: Delete an entry of the blacklist of a video by its id
1223 security:
1224 - OAuth2:
1225 - admin
1226 - moderator
1227 tags:
1228 - Video Blacklist
1229 parameters:
1230 - $ref: '#/components/parameters/idOrUUID'
1231 responses:
1232 '204':
1233 $ref: '#/paths/~1users~1me/put/responses/204'
1234 /videos/blacklist:
1235 get:
1236 summary: Get list of videos on blacklist
1237 security:
1238 - OAuth2:
1239 - admin
1240 - moderator
1241 tags:
1242 - Video Blacklist
1243 parameters:
1244 - $ref: '#/components/parameters/start'
1245 - $ref: '#/components/parameters/count'
1246 - $ref: '#/components/parameters/blacklistsSort'
1247 responses:
1248 '200':
1249 description: successful operation
1250 content:
1251 application/json:
1252 schema:
1253 type: array
1254 items:
1255 $ref: '#/components/schemas/VideoBlacklist'
1256 /videos/{id}/captions:
1257 get:
1258 summary: Get list of video's captions
1259 tags:
1260 - Video Caption
1261 parameters:
1262 - $ref: '#/components/parameters/idOrUUID'
1263 responses:
1264 '200':
1265 description: successful operation
1266 content:
1267 application/json:
1268 schema:
1269 type: object
1270 properties:
1271 total:
1272 type: integer
1273 data:
1274 type: array
1275 items:
1276 $ref: '#/components/schemas/VideoCaption'
1277 /videos/{id}/captions/{captionLanguage}:
1278 put:
1279 summary: Add or replace a video caption
1280 tags:
1281 - Video Caption
1282 parameters:
1283 - $ref: '#/components/parameters/idOrUUID'
1284 - $ref: '#/components/parameters/captionLanguage'
1285 requestBody:
1286 content:
1287 multipart/form-data:
1288 schema:
1289 type: object
1290 properties:
1291 captionfile:
1292 description: The file to upload.
1293 type: string
1294 format: binary
1295 responses:
1296 '204':
1297 $ref: '#/paths/~1users~1me/put/responses/204'
1298 delete:
1299 summary: Delete a video caption
1300 tags:
1301 - Video Caption
1302 parameters:
1303 - $ref: '#/components/parameters/idOrUUID'
1304 - $ref: '#/components/parameters/captionLanguage'
1305 responses:
1306 '204':
1307 $ref: '#/paths/~1users~1me/put/responses/204'
1308 /video-channels:
1309 get:
1310 summary: Get list of video channels
1311 tags:
1312 - Video Channel
1313 parameters:
1314 - $ref: '#/components/parameters/start'
1315 - $ref: '#/components/parameters/count'
1316 - $ref: '#/components/parameters/sort'
1317 responses:
1318 '200':
1319 description: successful operation
1320 content:
1321 application/json:
1322 schema:
1323 type: array
1324 items:
1325 $ref: '#/components/schemas/VideoChannel'
1326 post:
1327 summary: Creates a video channel for the current user
1328 security:
1329 - OAuth2: []
1330 tags:
1331 - Video Channel
1332 responses:
1333 '204':
1334 $ref: '#/paths/~1users~1me/put/responses/204'
1335 requestBody:
1336 content:
1337 application/json:
1338 schema:
1339 $ref: '#/components/schemas/VideoChannelCreate'
1340 '/video-channels/{channelHandle}':
1341 get:
1342 summary: Get a video channel by its id
1343 tags:
1344 - Video Channel
1345 parameters:
1346 - $ref: '#/components/parameters/channelHandle'
1347 responses:
1348 '200':
1349 description: successful operation
1350 content:
1351 application/json:
1352 schema:
1353 $ref: '#/components/schemas/VideoChannel'
1354 put:
1355 summary: Update a video channel by its id
1356 security:
1357 - OAuth2: []
1358 tags:
1359 - Video Channel
1360 parameters:
1361 - $ref: '#/components/parameters/channelHandle'
1362 responses:
1363 '204':
1364 $ref: '#/paths/~1users~1me/put/responses/204'
1365 requestBody:
1366 content:
1367 application/json:
1368 schema:
1369 $ref: '#/components/schemas/VideoChannelUpdate'
1370 delete:
1371 summary: Delete a video channel by its id
1372 security:
1373 - OAuth2: []
1374 tags:
1375 - Video Channel
1376 parameters:
1377 - $ref: '#/components/parameters/channelHandle'
1378 responses:
1379 '204':
1380 $ref: '#/paths/~1users~1me/put/responses/204'
1381 '/video-channels/{channelHandle}/videos':
1382 get:
1383 summary: Get videos of a video channel by its id
1384 tags:
1385 - Video
1386 - Video Channel
1387 parameters:
1388 - $ref: '#/components/parameters/channelHandle'
1389 responses:
1390 '200':
1391 description: successful operation
1392 content:
1393 application/json:
1394 schema:
1395 $ref: '#/components/schemas/VideoListResponse'
1396 '/accounts/{name}/video-channels':
1397 get:
1398 summary: Get video channels of an account by its name
1399 tags:
1400 - Video Channel
1401 parameters:
1402 - $ref: '#/components/parameters/name'
1403 responses:
1404 '200':
1405 description: successful operation
1406 content:
1407 application/json:
1408 schema:
1409 type: array
1410 items:
1411 $ref: '#/components/schemas/VideoChannel'
1412 '/accounts/{name}/ratings':
1413 get:
1414 summary: Get ratings of an account by its name
1415 security:
1416 - OAuth2: []
1417 tags:
1418 - User
1419 parameters:
1420 - $ref: '#/components/parameters/name'
1421 - $ref: '#/components/parameters/start'
1422 - $ref: '#/components/parameters/count'
1423 - $ref: '#/components/parameters/sort'
1424 - name: rating
1425 in: query
1426 required: false
1427 description: Optionaly filter which ratings to retrieve
1428 schema:
1429 type: string
1430 enum:
1431 - like
1432 - dislike
1433 responses:
1434 '200':
1435 description: successful operation
1436 content:
1437 application/json:
1438 schema:
1439 type: array
1440 items:
1441 $ref: '#/components/schemas/VideoRating'
1442 '/videos/{id}/comment-threads':
1443 get:
1444 summary: Get the comment threads of a video by its id
1445 tags:
1446 - Video Comment
1447 parameters:
1448 - $ref: '#/components/parameters/idOrUUID'
1449 - $ref: '#/components/parameters/start'
1450 - $ref: '#/components/parameters/count'
1451 - $ref: '#/components/parameters/sort'
1452 responses:
1453 '200':
1454 description: successful operation
1455 content:
1456 application/json:
1457 schema:
1458 $ref: '#/components/schemas/CommentThreadResponse'
1459 post:
1460 summary: 'Creates a comment thread, on a video by its id'
1461 security:
1462 - OAuth2: []
1463 tags:
1464 - Video Comment
1465 parameters:
1466 - $ref: '#/components/parameters/idOrUUID'
1467 responses:
1468 '200':
1469 description: successful operation
1470 content:
1471 application/json:
1472 schema:
1473 $ref: '#/components/schemas/CommentThreadPostResponse'
1474 '/videos/{id}/comment-threads/{threadId}':
1475 get:
1476 summary: 'Get the comment thread by its id, of a video by its id'
1477 tags:
1478 - Video Comment
1479 parameters:
1480 - $ref: '#/components/parameters/idOrUUID'
1481 - $ref: '#/components/parameters/threadId'
1482 responses:
1483 '200':
1484 description: successful operation
1485 content:
1486 application/json:
1487 schema:
1488 $ref: '#/components/schemas/VideoCommentThreadTree'
1489 '/videos/{id}/comments/{commentId}':
1490 post:
1491 summary: 'Creates a comment in a comment thread by its id, of a video by its id'
1492 security:
1493 - OAuth2: []
1494 tags:
1495 - Video Comment
1496 parameters:
1497 - $ref: '#/components/parameters/idOrUUID'
1498 - $ref: '#/components/parameters/commentId'
1499 responses:
1500 '200':
1501 description: successful operation
1502 content:
1503 application/json:
1504 schema:
1505 $ref: '#/components/schemas/CommentThreadPostResponse'
1506 delete:
1507 summary: 'Delete a comment in a comment thread by its id, of a video by its id'
1508 security:
1509 - OAuth2: []
1510 tags:
1511 - Video Comment
1512 parameters:
1513 - $ref: '#/components/parameters/idOrUUID'
1514 - $ref: '#/components/parameters/commentId'
1515 responses:
1516 '204':
1517 $ref: '#/paths/~1users~1me/put/responses/204'
1518 '/videos/{id}/rate':
1519 put:
1520 summary: Vote for a video by its id
1521 security:
1522 - OAuth2: []
1523 tags:
1524 - Video Rate
1525 parameters:
1526 - $ref: '#/components/parameters/idOrUUID'
1527 responses:
1528 '204':
1529 $ref: '#/paths/~1users~1me/put/responses/204'
1530 /search/videos:
1531 get:
1532 tags:
1533 - Search
1534 summary: Get the videos corresponding to a given query
1535 parameters:
1536 - $ref: '#/components/parameters/start'
1537 - $ref: '#/components/parameters/count'
1538 - $ref: '#/components/parameters/videosSearchSort'
1539 - name: search
1540 in: query
1541 required: true
1542 description: String to search
1543 schema:
1544 type: string
1545 responses:
1546 '200':
1547 description: successful operation
1548 content:
1549 application/json:
1550 schema:
1551 $ref: '#/components/schemas/VideoListResponse'
1552 servers:
1553 - url: 'https://peertube.cpy.re/api/v1'
1554 description: Live Test Server (live data - stable version)
1555 - url: 'https://peertube2.cpy.re/api/v1'
1556 description: Live Test Server (live data - bleeding edge version)
1557 - url: 'https://peertube3.cpy.re/api/v1'
1558 description: Live Test Server (live data - bleeding edge version)
1559 components:
1560 parameters:
1561 start:
1562 name: start
1563 in: query
1564 required: false
1565 description: Offset
1566 schema:
1567 type: number
1568 count:
1569 name: count
1570 in: query
1571 required: false
1572 description: Number of items
1573 schema:
1574 type: number
1575 sort:
1576 name: sort
1577 in: query
1578 required: false
1579 description: Sort column (-createdAt for example)
1580 schema:
1581 type: string
1582 videosSort:
1583 name: sort
1584 in: query
1585 required: false
1586 description: Sort videos by criteria
1587 schema:
1588 type: string
1589 enum:
1590 - -name
1591 - -duration
1592 - -createdAt
1593 - -publishedAt
1594 - -views
1595 - -likes
1596 - -trending
1597 videosSearchSort:
1598 name: sort
1599 in: query
1600 required: false
1601 description: Sort videos by criteria
1602 schema:
1603 type: string
1604 enum:
1605 - -name
1606 - -duration
1607 - -createdAt
1608 - -publishedAt
1609 - -views
1610 - -likes
1611 - -match
1612 blacklistsSort:
1613 name: sort
1614 in: query
1615 required: false
1616 description: Sort blacklists by criteria
1617 schema:
1618 type: string
1619 enum:
1620 - -id
1621 - -name
1622 - -duration
1623 - -views
1624 - -likes
1625 - -dislikes
1626 - -uuid
1627 - -createdAt
1628 usersSort:
1629 name: sort
1630 in: query
1631 required: false
1632 description: Sort users by criteria
1633 schema:
1634 type: string
1635 enum:
1636 - -id
1637 - -username
1638 - -createdAt
1639 abusesSort:
1640 name: sort
1641 in: query
1642 required: false
1643 description: Sort abuses by criteria
1644 schema:
1645 type: string
1646 enum:
1647 - -id
1648 - -createdAt
1649 - -state
1650 name:
1651 name: name
1652 in: path
1653 required: true
1654 description: >-
1655 The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
1656 example)
1657 schema:
1658 type: string
1659 id:
1660 name: id
1661 in: path
1662 required: true
1663 description: The user id
1664 schema:
1665 type: number
1666 idOrUUID:
1667 name: id
1668 in: path
1669 required: true
1670 description: The video id or uuid
1671 schema:
1672 type: string
1673 captionLanguage:
1674 name: captionLanguage
1675 in: path
1676 required: true
1677 description: The caption language
1678 schema:
1679 type: string
1680 channelHandle:
1681 name: channelHandle
1682 in: path
1683 required: true
1684 description: "The video channel handle (example: 'my_username@example.com' or 'my_username')"
1685 schema:
1686 type: string
1687 subscriptionHandle:
1688 name: subscriptionHandle
1689 in: path
1690 required: true
1691 description: "The subscription handle (example: 'my_username@example.com' or 'my_username')"
1692 schema:
1693 type: string
1694 threadId:
1695 name: threadId
1696 in: path
1697 required: true
1698 description: The thread id (root comment id)
1699 schema:
1700 type: number
1701 commentId:
1702 name: commentId
1703 in: path
1704 required: true
1705 description: The comment id
1706 schema:
1707 type: number
1708 categoryOneOf:
1709 name: categoryOneOf
1710 in: query
1711 required: false
1712 description: category id of the video
1713 schema:
1714 oneOf:
1715 - type: number
1716 - type: array
1717 items:
1718 type: number
1719 style: form
1720 explode: false
1721 tagsOneOf:
1722 name: tagsOneOf
1723 in: query
1724 required: false
1725 description: tag(s) of the video
1726 schema:
1727 oneOf:
1728 - type: string
1729 - type: array
1730 items:
1731 type: string
1732 style: form
1733 explode: false
1734 tagsAllOf:
1735 name: tagsAllOf
1736 in: query
1737 required: false
1738 description: tag(s) of the video, where all should be present in the video
1739 schema:
1740 oneOf:
1741 - type: string
1742 - type: array
1743 items:
1744 type: string
1745 style: form
1746 explode: false
1747 languageOneOf:
1748 name: languageOneOf
1749 in: query
1750 required: false
1751 description: language id of the video
1752 schema:
1753 oneOf:
1754 - type: string
1755 - type: array
1756 items:
1757 type: string
1758 style: form
1759 explode: false
1760 licenceOneOf:
1761 name: licenceOneOf
1762 in: query
1763 required: false
1764 description: licence id of the video
1765 schema:
1766 oneOf:
1767 - type: number
1768 - type: array
1769 items:
1770 type: number
1771 style: form
1772 explode: false
1773 nsfw:
1774 name: nsfw
1775 in: query
1776 required: false
1777 description: whether to include nsfw videos, if any
1778 schema:
1779 type: string
1780 enum:
1781 - 'true'
1782 - 'false'
1783 filter:
1784 name: filter
1785 in: query
1786 required: false
1787 description: >
1788 Special filters (local for instance) which might require special rights:
1789 * `local` - only videos local to the instance
1790 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
1791 schema:
1792 type: string
1793 enum:
1794 - local
1795 - all-local
1796 subscriptionsUris:
1797 name: uris
1798 in: query
1799 required: true
1800 description: list of uris to check if each is part of the user subscriptions
1801 schema:
1802 type: array
1803 items:
1804 type: string
1805 securitySchemes:
1806 OAuth2:
1807 description: >
1808 In the header: *Authorization: Bearer <token\>*
1809
1810
1811 Authenticating via OAuth requires the following steps:
1812
1813
1814 - Have an account with sufficient authorization levels
1815
1816 - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
1817 Bearer Token
1818
1819 - Make Authenticated Requests
1820 type: oauth2
1821 flows:
1822 password:
1823 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
1824 scopes:
1825 admin: Admin scope
1826 moderator: Moderator scope
1827 user: User scope
1828 schemas:
1829 VideoConstantNumber:
1830 properties:
1831 id:
1832 type: number
1833 label:
1834 type: string
1835 VideoConstantString:
1836 properties:
1837 id:
1838 type: string
1839 label:
1840 type: string
1841 VideoPrivacySet:
1842 type: integer
1843 enum:
1844 - 1
1845 - 2
1846 - 3
1847 description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3)'
1848 VideoPrivacyConstant:
1849 properties:
1850 id:
1851 type: integer
1852 enum:
1853 - 1
1854 - 2
1855 - 3
1856 label:
1857 type: string
1858 VideoStateConstant:
1859 properties:
1860 id:
1861 type: integer
1862 enum:
1863 - 1
1864 - 2
1865 - 3
1866 description: 'The video state (Published = 1, to transcode = 2, to import = 3)'
1867 label:
1868 type: string
1869 VideoResolutionConstant:
1870 properties:
1871 id:
1872 type: integer
1873 description: 'Video resolution (240, 360, 720 ...)'
1874 label:
1875 type: string
1876 VideoScheduledUpdate:
1877 properties:
1878 privacy:
1879 $ref: '#/components/schemas/VideoPrivacySet'
1880 description: Video privacy target
1881 updateAt:
1882 type: string
1883 format: date
1884 description: When to update the video
1885 required:
1886 - updateAt
1887 VideoAccountSummary:
1888 properties:
1889 id:
1890 type: number
1891 name:
1892 type: string
1893 displayName:
1894 type: string
1895 url:
1896 type: string
1897 host:
1898 type: string
1899 avatar:
1900 nullable: true
1901 $ref: '#/components/schemas/Avatar'
1902 VideoChannelSummary:
1903 properties:
1904 id:
1905 type: number
1906 name:
1907 type: string
1908 displayName:
1909 type: string
1910 url:
1911 type: string
1912 host:
1913 type: string
1914 avatar:
1915 nullable: true
1916 $ref: '#/components/schemas/Avatar'
1917 PlaylistElement:
1918 properties:
1919 position:
1920 type: number
1921 startTimestamp:
1922 type: number
1923 stopTimestamp:
1924 type: number
1925 VideoFile:
1926 properties:
1927 magnetUri:
1928 type: string
1929 resolution:
1930 $ref: '#/components/schemas/VideoResolutionConstant'
1931 size:
1932 type: number
1933 description: 'Video file size in bytes'
1934 torrentUrl:
1935 type: string
1936 torrentDownaloadUrl:
1937 type: string
1938 fileUrl:
1939 type: string
1940 fileDownloadUrl:
1941 type: string
1942 fps:
1943 type: number
1944 VideoStreamingPlaylists:
1945 properties:
1946 id:
1947 type: number
1948 type:
1949 type: number
1950 enum:
1951 - 1
1952 description: 'Playlist type (HLS = 1)'
1953 playlistUrl:
1954 type: string
1955 segmentsSha256Url:
1956 type: string
1957 redundancies:
1958 type: array
1959 items:
1960 type: object
1961 properties:
1962 baseUrl:
1963 type: string
1964 Video:
1965 properties:
1966 id:
1967 type: number
1968 uuid:
1969 type: string
1970 createdAt:
1971 type: string
1972 publishedAt:
1973 type: string
1974 updatedAt:
1975 type: string
1976 originallyPublishedAt:
1977 type: string
1978 category:
1979 $ref: '#/components/schemas/VideoConstantNumber'
1980 licence:
1981 $ref: '#/components/schemas/VideoConstantNumber'
1982 language:
1983 $ref: '#/components/schemas/VideoConstantString'
1984 privacy:
1985 $ref: '#/components/schemas/VideoPrivacyConstant'
1986 description:
1987 type: string
1988 duration:
1989 type: number
1990 isLocal:
1991 type: boolean
1992 name:
1993 type: string
1994 thumbnailPath:
1995 type: string
1996 previewPath:
1997 type: string
1998 embedPath:
1999 type: string
2000 views:
2001 type: number
2002 likes:
2003 type: number
2004 dislikes:
2005 type: number
2006 nsfw:
2007 type: boolean
2008 waitTranscoding:
2009 type: boolean
2010 nullable: true
2011 state:
2012 $ref: '#/components/schemas/VideoStateConstant'
2013 scheduledUpdate:
2014 nullable: true
2015 $ref: '#/components/schemas/VideoScheduledUpdate'
2016 blacklisted:
2017 nullable: true
2018 type: boolean
2019 blacklistedReason:
2020 nullable: true
2021 type: string
2022 account:
2023 $ref: '#/components/schemas/VideoAccountSummary'
2024 channel:
2025 $ref: '#/components/schemas/VideoChannelSummary'
2026 userHistory:
2027 nullable: true
2028 type: object
2029 properties:
2030 currentTime:
2031 type: number
2032 playlistElement:
2033 nullable: true
2034 $ref: '#/components/schemas/PlaylistElement'
2035 VideoDetails:
2036 allOf:
2037 - $ref: '#/components/schemas/Video'
2038 - type: object
2039 properties:
2040 descriptionPath:
2041 type: string
2042 support:
2043 type: string
2044 channel:
2045 $ref: '#/components/schemas/VideoChannel'
2046 account:
2047 $ref: '#/components/schemas/Account'
2048 tags:
2049 type: array
2050 items:
2051 type: string
2052 files:
2053 type: array
2054 items:
2055 $ref: '#/components/schemas/VideoFile'
2056 commentsEnabled:
2057 type: boolean
2058 downloadEnabled:
2059 type: boolean
2060 trackerUrls:
2061 type: array
2062 items:
2063 type: string
2064 streamingPlaylists:
2065 type: array
2066 items:
2067 $ref: '#/components/schemas/VideoStreamingPlaylists'
2068 VideoImportStateConstant:
2069 properties:
2070 id:
2071 type: integer
2072 enum:
2073 - 1
2074 - 2
2075 - 3
2076 description: 'The video import state (Pending = 1, Success = 2, Failed = 3)'
2077 label:
2078 type: string
2079 VideoImport:
2080 properties:
2081 id:
2082 type: number
2083 targetUrl:
2084 type: string
2085 magnetUri:
2086 type: string
2087 torrentName:
2088 type: string
2089 state:
2090 type: object
2091 properties:
2092 id:
2093 $ref: '#/components/schemas/VideoImportStateConstant'
2094 label:
2095 type: string
2096 error:
2097 type: string
2098 createdAt:
2099 type: string
2100 updatedAt:
2101 type: string
2102 video:
2103 $ref: '#/components/schemas/Video'
2104 VideoAbuse:
2105 properties:
2106 id:
2107 type: number
2108 reason:
2109 type: string
2110 reporterAccount:
2111 $ref: '#/components/schemas/Account'
2112 video:
2113 type: object
2114 properties:
2115 id:
2116 type: number
2117 name:
2118 type: string
2119 uuid:
2120 type: string
2121 url:
2122 type: string
2123 createdAt:
2124 type: string
2125 VideoBlacklist:
2126 properties:
2127 id:
2128 type: number
2129 videoId:
2130 type: number
2131 createdAt:
2132 type: string
2133 updatedAt:
2134 type: string
2135 name:
2136 type: string
2137 uuid:
2138 type: string
2139 description:
2140 type: string
2141 duration:
2142 type: number
2143 views:
2144 type: number
2145 likes:
2146 type: number
2147 dislikes:
2148 type: number
2149 nsfw:
2150 type: boolean
2151 VideoChannel:
2152 properties:
2153 displayName:
2154 type: string
2155 description:
2156 type: string
2157 isLocal:
2158 type: boolean
2159 ownerAccount:
2160 type: object
2161 properties:
2162 id:
2163 type: number
2164 uuid:
2165 type: string
2166 VideoComment:
2167 properties:
2168 id:
2169 type: number
2170 url:
2171 type: string
2172 text:
2173 type: string
2174 threadId:
2175 type: number
2176 inReplyToCommentId:
2177 type: number
2178 videoId:
2179 type: number
2180 createdAt:
2181 type: string
2182 updatedAt:
2183 type: string
2184 totalReplies:
2185 type: number
2186 account:
2187 $ref: '#/components/schemas/Account'
2188 VideoCommentThreadTree:
2189 properties:
2190 comment:
2191 $ref: '#/components/schemas/VideoComment'
2192 children:
2193 type: array
2194 items:
2195 $ref: '#/components/schemas/VideoCommentThreadTree'
2196 VideoCaption:
2197 properties:
2198 language:
2199 $ref: '#/components/schemas/VideoConstantString'
2200 captionPath:
2201 type: string
2202 Avatar:
2203 properties:
2204 path:
2205 type: string
2206 createdAt:
2207 type: string
2208 updatedAt:
2209 type: string
2210 Actor:
2211 properties:
2212 id:
2213 type: number
2214 uuid:
2215 type: string
2216 url:
2217 type: string
2218 name:
2219 type: string
2220 host:
2221 type: string
2222 followingCount:
2223 type: number
2224 followersCount:
2225 type: number
2226 createdAt:
2227 type: string
2228 updatedAt:
2229 type: string
2230 avatar:
2231 $ref: '#/components/schemas/Avatar'
2232 Account:
2233 allOf:
2234 - $ref: '#/components/schemas/Actor'
2235 - properties:
2236 displayName:
2237 type: string
2238 User:
2239 properties:
2240 id:
2241 type: number
2242 username:
2243 type: string
2244 email:
2245 type: string
2246 displayNSFW:
2247 type: boolean
2248 autoPlayVideo:
2249 type: boolean
2250 role:
2251 type: integer
2252 enum:
2253 - 0
2254 - 1
2255 - 2
2256 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2257 roleLabel:
2258 type: string
2259 enum:
2260 - User
2261 - Moderator
2262 - Administrator
2263 videoQuota:
2264 type: number
2265 videoQuotaDaily:
2266 type: number
2267 createdAt:
2268 type: string
2269 account:
2270 $ref: '#/components/schemas/Account'
2271 videoChannels:
2272 type: array
2273 items:
2274 $ref: '#/components/schemas/VideoChannel'
2275 UserWatchingVideo:
2276 properties:
2277 currentTime:
2278 type: number
2279 ServerConfig:
2280 properties:
2281 signup:
2282 type: object
2283 properties:
2284 allowed:
2285 type: boolean
2286 transcoding:
2287 type: object
2288 properties:
2289 enabledResolutions:
2290 type: array
2291 items:
2292 type: number
2293 avatar:
2294 type: object
2295 properties:
2296 file:
2297 type: object
2298 properties:
2299 size:
2300 type: object
2301 properties:
2302 max:
2303 type: number
2304 extensions:
2305 type: array
2306 items:
2307 type: string
2308 video:
2309 type: object
2310 properties:
2311 file:
2312 type: object
2313 properties:
2314 extensions:
2315 type: array
2316 items:
2317 type: string
2318 Follow:
2319 properties:
2320 id:
2321 type: number
2322 follower:
2323 $ref: '#/components/schemas/Actor'
2324 following:
2325 $ref: '#/components/schemas/Actor'
2326 score:
2327 type: number
2328 state:
2329 type: string
2330 enum:
2331 - pending
2332 - accepted
2333 createdAt:
2334 type: string
2335 updatedAt:
2336 type: string
2337 Job:
2338 properties:
2339 id:
2340 type: number
2341 state:
2342 type: string
2343 enum:
2344 - pending
2345 - processing
2346 - error
2347 - success
2348 category:
2349 type: string
2350 enum:
2351 - transcoding
2352 - activitypub-http
2353 handlerName:
2354 type: string
2355 handlerInputData:
2356 type: string
2357 createdAt:
2358 type: string
2359 updatedAt:
2360 type: string
2361 AddUserResponse:
2362 properties:
2363 id:
2364 type: number
2365 uuid:
2366 type: string
2367 VideoUploadResponse:
2368 properties:
2369 video:
2370 type: object
2371 properties:
2372 id:
2373 type: number
2374 uuid:
2375 type: string
2376 CommentThreadResponse:
2377 properties:
2378 total:
2379 type: number
2380 data:
2381 type: array
2382 items:
2383 $ref: '#/components/schemas/VideoComment'
2384 CommentThreadPostResponse:
2385 properties:
2386 comment:
2387 $ref: '#/components/schemas/VideoComment'
2388 VideoListResponse:
2389 properties:
2390 total:
2391 type: number
2392 data:
2393 type: array
2394 items:
2395 $ref: '#/components/schemas/Video'
2396 AddUser:
2397 properties:
2398 username:
2399 type: string
2400 description: 'The user username '
2401 password:
2402 type: string
2403 description: 'The user password '
2404 email:
2405 type: string
2406 description: 'The user email '
2407 videoQuota:
2408 type: string
2409 description: 'The user videoQuota '
2410 videoQuotaDaily:
2411 type: string
2412 description: 'The user daily video quota '
2413 role:
2414 type: integer
2415 enum:
2416 - 0
2417 - 1
2418 - 2
2419 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2420 required:
2421 - username
2422 - password
2423 - email
2424 - videoQuota
2425 - videoQuotaDaily
2426 - role
2427 UpdateUser:
2428 properties:
2429 id:
2430 type: string
2431 description: 'The user id '
2432 email:
2433 type: string
2434 description: 'The updated email of the user '
2435 videoQuota:
2436 type: string
2437 description: 'The updated videoQuota of the user '
2438 videoQuotaDaily:
2439 type: string
2440 description: 'The updated daily video quota of the user '
2441 role:
2442 type: integer
2443 enum:
2444 - 0
2445 - 1
2446 - 2
2447 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2448 required:
2449 - id
2450 - email
2451 - videoQuota
2452 - videoQuotaDaily
2453 - role
2454 UpdateMe:
2455 properties:
2456 password:
2457 type: string
2458 description: 'Your new password '
2459 email:
2460 type: string
2461 description: 'Your new email '
2462 displayNSFW:
2463 type: string
2464 description: 'Your new displayNSFW '
2465 autoPlayVideo:
2466 type: string
2467 description: 'Your new autoPlayVideo '
2468 required:
2469 - password
2470 - email
2471 - displayNSFW
2472 - autoPlayVideo
2473 GetMeVideoRating:
2474 properties:
2475 id:
2476 type: string
2477 description: 'Id of the video '
2478 rating:
2479 type: number
2480 description: 'Rating of the video '
2481 required:
2482 - id
2483 - rating
2484 VideoRating:
2485 properties:
2486 video:
2487 $ref: '#/components/schemas/Video'
2488 rating:
2489 type: number
2490 description: 'Rating of the video'
2491 required:
2492 - video
2493 - rating
2494 RegisterUser:
2495 properties:
2496 username:
2497 type: string
2498 description: 'The username of the user '
2499 password:
2500 type: string
2501 description: 'The password of the user '
2502 email:
2503 type: string
2504 description: 'The email of the user '
2505 displayName:
2506 type: string
2507 description: 'The user display name'
2508 channel:
2509 type: object
2510 properties:
2511 name:
2512 type: string
2513 description: 'The default channel name'
2514 displayName:
2515 type: string
2516 description: 'The default channel display name'
2517
2518 required:
2519 - username
2520 - password
2521 - email
2522 VideoChannelCreate:
2523 properties:
2524 name:
2525 type: string
2526 displayName:
2527 type: string
2528 description:
2529 type: string
2530 support:
2531 type: string
2532 required:
2533 - name
2534 - displayName
2535 VideoChannelUpdate:
2536 properties:
2537 displayName:
2538 type: string
2539 description:
2540 type: string
2541 support:
2542 type: string
2543 bulkVideosSupportUpdate:
2544 type: boolean
2545 description: 'Update all videos support field of this channel'
2546