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