]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/doc/api/openapi.yaml
c1a9a3987b7f94430f1bcda0c41f7890e028cad8
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
1 openapi: 3.0.0
2 info:
3 title: PeerTube
4 version: 1.3.0-rc.2
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/Video'
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 type: array
580 items:
581 $ref: '#/components/schemas/Video'
582 /users/me/subscriptions:
583 get:
584 summary: Get subscriptions of the current user
585 security:
586 - OAuth2:
587 - user
588 tags:
589 - User
590 parameters:
591 - $ref: '#/components/parameters/start'
592 - $ref: '#/components/parameters/count'
593 - $ref: '#/components/parameters/sort'
594 responses:
595 '200':
596 description: successful operation
597 post:
598 summary: Add subscription to the current user
599 security:
600 - OAuth2:
601 - user
602 tags:
603 - User
604 responses:
605 '200':
606 description: successful operation
607 /users/me/subscriptions/exist:
608 get:
609 summary: Get if subscriptions exist for the current user
610 security:
611 - OAuth2:
612 - user
613 tags:
614 - User
615 parameters:
616 - $ref: '#/components/parameters/subscriptionsUris'
617 responses:
618 '200':
619 description: successful operation
620 content:
621 application/json:
622 schema:
623 type: object
624 /users/me/subscriptions/videos:
625 get:
626 summary: Get videos of subscriptions of the current user
627 security:
628 - OAuth2:
629 - user
630 tags:
631 - User
632 parameters:
633 - $ref: '#/components/parameters/start'
634 - $ref: '#/components/parameters/count'
635 - $ref: '#/components/parameters/sort'
636 responses:
637 '200':
638 description: successful operation
639 content:
640 application/json:
641 schema:
642 type: array
643 items:
644 $ref: '#/components/schemas/Video'
645 '/users/me/subscriptions/{uri}':
646 get:
647 summary: Get subscription of the current user for a given uri
648 security:
649 - OAuth2:
650 - user
651 tags:
652 - User
653 responses:
654 '200':
655 description: successful operation
656 content:
657 application/json:
658 schema:
659 $ref: '#/components/schemas/VideoChannel'
660 delete:
661 summary: Delete subscription of the current user for a given uri
662 security:
663 - OAuth2:
664 - user
665 tags:
666 - User
667 responses:
668 '200':
669 description: successful operation
670 /users/register:
671 post:
672 summary: Register a user
673 tags:
674 - User
675 responses:
676 '204':
677 $ref: '#/paths/~1users~1me/put/responses/204'
678 requestBody:
679 content:
680 application/json:
681 schema:
682 $ref: '#/components/schemas/RegisterUser'
683 required: true
684 /users/me/avatar/pick:
685 post:
686 summary: Update current user avatar
687 security:
688 - OAuth2: []
689 tags:
690 - User
691 responses:
692 '200':
693 description: successful operation
694 content:
695 application/json:
696 schema:
697 $ref: '#/components/schemas/Avatar'
698 requestBody:
699 content:
700 multipart/form-data:
701 schema:
702 type: object
703 properties:
704 avatarfile:
705 description: The file to upload.
706 type: string
707 format: binary
708 encoding:
709 profileImage:
710 # only accept png/jpeg
711 contentType: image/png, image/jpeg
712 /videos:
713 get:
714 summary: Get list of videos
715 tags:
716 - Video
717 parameters:
718 - $ref: '#/components/parameters/categoryOneOf'
719 - $ref: '#/components/parameters/tagsOneOf'
720 - $ref: '#/components/parameters/tagsAllOf'
721 - $ref: '#/components/parameters/licenceOneOf'
722 - $ref: '#/components/parameters/languageOneOf'
723 - $ref: '#/components/parameters/nsfw'
724 - $ref: '#/components/parameters/filter'
725 - $ref: '#/components/parameters/start'
726 - $ref: '#/components/parameters/count'
727 - $ref: '#/components/parameters/videosSort'
728 responses:
729 '200':
730 description: successful operation
731 content:
732 application/json:
733 schema:
734 type: array
735 items:
736 $ref: '#/components/schemas/Video'
737 /videos/categories:
738 get:
739 summary: Get list of video licences known by the server
740 tags:
741 - Video
742 responses:
743 '200':
744 description: successful operation
745 content:
746 application/json:
747 schema:
748 type: array
749 items:
750 type: string
751 /videos/licences:
752 get:
753 summary: Get list of video licences known by the server
754 tags:
755 - Video
756 responses:
757 '200':
758 description: successful operation
759 content:
760 application/json:
761 schema:
762 type: array
763 items:
764 type: string
765 /videos/languages:
766 get:
767 summary: Get list of languages known by the server
768 tags:
769 - Video
770 responses:
771 '200':
772 description: successful operation
773 content:
774 application/json:
775 schema:
776 type: array
777 items:
778 type: string
779 /videos/privacies:
780 get:
781 summary: Get list of privacy policies supported by the server
782 tags:
783 - Video
784 responses:
785 '200':
786 description: successful operation
787 content:
788 application/json:
789 schema:
790 type: array
791 items:
792 type: string
793 '/videos/{id}':
794 put:
795 summary: Update metadata for a video by its id
796 security:
797 - OAuth2: []
798 tags:
799 - Video
800 parameters:
801 - $ref: '#/components/parameters/id2'
802 responses:
803 '200':
804 description: successful operation
805 content:
806 application/json:
807 schema:
808 $ref: '#/components/schemas/Video'
809 requestBody:
810 content:
811 multipart/form-data:
812 schema:
813 type: object
814 properties:
815 thumbnailfile:
816 description: Video thumbnail file
817 type: string
818 previewfile:
819 description: Video preview file
820 type: string
821 category:
822 description: Video category
823 type: string
824 licence:
825 description: Video licence
826 type: string
827 language:
828 description: Video language
829 type: string
830 description:
831 description: Video description
832 type: string
833 waitTranscoding:
834 description: Whether or not we wait transcoding before publish the video
835 type: string
836 support:
837 description: Text describing how to support the video uploader
838 type: string
839 nsfw:
840 description: Whether or not this video contains sensitive content
841 type: string
842 name:
843 description: Video name
844 type: string
845 tags:
846 description: Video tags (maximum 5 tags each between 2 and 30 characters)
847 type: array
848 items:
849 type: string
850 commentsEnabled:
851 description: Enable or disable comments for this video
852 type: string
853 scheduleUpdate: &ref_0
854 type: object
855 properties:
856 privacy:
857 type: string
858 enum:
859 - Public
860 - Unlisted
861 description: Video privacy target
862 updateAt:
863 type: string
864 format: date
865 description: When to update the video
866 required:
867 - updateAt
868 get:
869 summary: Get a video by its id
870 tags:
871 - Video
872 parameters:
873 - $ref: '#/components/parameters/id2'
874 responses:
875 '200':
876 description: successful operation
877 content:
878 application/json:
879 schema:
880 $ref: '#/components/schemas/Video'
881 delete:
882 summary: Delete a video by its id
883 security:
884 - OAuth2: []
885 tags:
886 - Video
887 parameters:
888 - $ref: '#/components/parameters/id2'
889 responses:
890 '204':
891 $ref: '#/paths/~1users~1me/put/responses/204'
892 '/videos/{id}/description':
893 get:
894 summary: Get a video description by its id
895 tags:
896 - Video
897 parameters:
898 - $ref: '#/components/parameters/id2'
899 responses:
900 '200':
901 description: successful operation
902 content:
903 application/json:
904 schema:
905 type: string
906 '/videos/{id}/views':
907 post:
908 summary: Add a view to the video by its id
909 tags:
910 - Video
911 parameters:
912 - $ref: '#/components/parameters/id2'
913 responses:
914 '204':
915 $ref: '#/paths/~1users~1me/put/responses/204'
916 '/videos/{id}/watching':
917 put:
918 summary: Set watching progress of a video by its id for a user
919 tags:
920 - Video
921 security:
922 - OAuth2: []
923 parameters:
924 - $ref: '#/components/parameters/id2'
925 requestBody:
926 content:
927 application/json:
928 schema:
929 $ref: '#/components/schemas/UserWatchingVideo'
930 required: true
931 responses:
932 '204':
933 $ref: '#/paths/~1users~1me/put/responses/204'
934 /videos/ownership:
935 get:
936 summary: Get list of video ownership changes requests
937 tags:
938 - Video
939 security:
940 - OAuth2: []
941 parameters:
942 - $ref: '#/components/parameters/id2'
943 responses:
944 '200':
945 description: successful operation
946 '/videos/ownership/{id}/accept':
947 post:
948 summary: Refuse ownership change request for video by its id
949 tags:
950 - Video
951 security:
952 - OAuth2: []
953 parameters:
954 - $ref: '#/components/parameters/id2'
955 responses:
956 '204':
957 $ref: '#/paths/~1users~1me/put/responses/204'
958 '/videos/ownership/{id}/refuse':
959 post:
960 summary: Accept ownership change request for video by its id
961 tags:
962 - Video
963 security:
964 - OAuth2: []
965 parameters:
966 - $ref: '#/components/parameters/id2'
967 responses:
968 '204':
969 $ref: '#/paths/~1users~1me/put/responses/204'
970 '/videos/{id}/give-ownership':
971 post:
972 summary: Request change of ownership for a video you own, by its id
973 tags:
974 - Video
975 security:
976 - OAuth2: []
977 parameters:
978 - $ref: '#/components/parameters/id2'
979 requestBody:
980 required: true
981 content:
982 application/x-www-form-urlencoded:
983 schema:
984 type: object
985 properties:
986 username:
987 type: string
988 required:
989 - username
990 responses:
991 '204':
992 $ref: '#/paths/~1users~1me/put/responses/204'
993 '400':
994 description: 'Changing video ownership to a remote account is not supported yet'
995 /videos/upload:
996 post:
997 summary: Upload a video file with its metadata
998 security:
999 - OAuth2: []
1000 tags:
1001 - Video
1002 responses:
1003 '200':
1004 description: successful operation
1005 content:
1006 application/json:
1007 schema:
1008 $ref: '#/components/schemas/VideoUploadResponse'
1009 requestBody:
1010 content:
1011 multipart/form-data:
1012 schema:
1013 type: object
1014 properties:
1015 videofile:
1016 description: Video file
1017 type: string
1018 format: binary
1019 channelId:
1020 description: Channel id that will contain this video
1021 type: number
1022 thumbnailfile:
1023 description: Video thumbnail file
1024 type: string
1025 previewfile:
1026 description: Video preview file
1027 type: string
1028 privacy:
1029 $ref: '#/components/schemas/VideoPrivacySet'
1030 category:
1031 description: Video category
1032 type: string
1033 licence:
1034 description: Video licence
1035 type: string
1036 language:
1037 description: Video language
1038 type: string
1039 description:
1040 description: Video description
1041 type: string
1042 waitTranscoding:
1043 description: Whether or not we wait transcoding before publish the video
1044 type: string
1045 support:
1046 description: Text describing how to support the video uploader
1047 type: string
1048 nsfw:
1049 description: Whether or not this video contains sensitive content
1050 type: string
1051 name:
1052 description: Video name
1053 type: string
1054 tags:
1055 description: Video tags
1056 type: array
1057 items:
1058 type: string
1059 commentsEnabled:
1060 description: Enable or disable comments for this video
1061 type: string
1062 scheduleUpdate: *ref_0
1063 required:
1064 - videofile
1065 - channelId
1066 - name
1067 x-code-samples:
1068 - lang: Shell
1069 source: |
1070 ## DEPENDENCIES: httpie, jq
1071 # pip install httpie
1072 USERNAME="<your_username>"
1073 PASSWORD="<your_password>"
1074 FILE_PATH="<your_file_path>"
1075 CHANNEL_ID="<your_channel_id>"
1076 NAME="<video_name>"
1077
1078 API_PATH="https://peertube2.cpy.re/api/v1"
1079 ## AUTH
1080 client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1081 client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1082 token=$(http -b --form POST "$API_PATH/users/token" \
1083 client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
1084 username=$USERNAME \
1085 password=$PASSWORD \
1086 | jq -r ".access_token")
1087 ## VIDEO UPLOAD
1088 http -b --form POST "$API_PATH/videos/upload" \
1089 videofile@$FILE_PATH \
1090 channelId=$CHANNEL_ID \
1091 name=$NAME \
1092 "Authorization:Bearer $token"
1093 /videos/imports:
1094 post:
1095 summary: Import a torrent or magnetURI or HTTP ressource (if enabled by the instance administrator)
1096 security:
1097 - OAuth2: []
1098 tags:
1099 - Video
1100 responses:
1101 '200':
1102 description: successful operation
1103 content:
1104 application/json:
1105 schema:
1106 $ref: '#/components/schemas/VideoUploadResponse'
1107 requestBody:
1108 content:
1109 multipart/form-data:
1110 schema:
1111 type: object
1112 properties:
1113 torrentfile:
1114 description: Torrent File
1115 type: string
1116 format: binary
1117 targetUrl:
1118 description: HTTP target URL
1119 type: string
1120 magnetUri:
1121 description: Magnet URI
1122 type: string
1123 channelId:
1124 description: Channel id that will contain this video
1125 type: number
1126 thumbnailfile:
1127 description: Video thumbnail file
1128 type: string
1129 previewfile:
1130 description: Video preview file
1131 type: string
1132 privacy:
1133 $ref: '#/components/schemas/VideoPrivacySet'
1134 category:
1135 description: Video category
1136 type: string
1137 licence:
1138 description: Video licence
1139 type: string
1140 language:
1141 description: Video language
1142 type: string
1143 description:
1144 description: Video description
1145 type: string
1146 waitTranscoding:
1147 description: Whether or not we wait transcoding before publish the video
1148 type: string
1149 support:
1150 description: Text describing how to support the video uploader
1151 type: string
1152 nsfw:
1153 description: Whether or not this video contains sensitive content
1154 type: string
1155 name:
1156 description: Video name
1157 type: string
1158 tags:
1159 description: Video tags
1160 type: array
1161 items:
1162 type: string
1163 commentsEnabled:
1164 description: Enable or disable comments for this video
1165 type: string
1166 scheduleUpdate: *ref_0
1167 required:
1168 - channelId
1169 - name
1170 /videos/abuse:
1171 get:
1172 summary: Get list of reported video abuses
1173 security:
1174 - OAuth2: []
1175 tags:
1176 - Video Abuse
1177 parameters:
1178 - $ref: '#/components/parameters/start'
1179 - $ref: '#/components/parameters/count'
1180 - $ref: '#/components/parameters/abusesSort'
1181 responses:
1182 '200':
1183 description: successful operation
1184 content:
1185 application/json:
1186 schema:
1187 type: array
1188 items:
1189 $ref: '#/components/schemas/VideoAbuse'
1190 '/videos/{id}/abuse':
1191 post:
1192 summary: 'Report an abuse, on a video by its id'
1193 security:
1194 - OAuth2: []
1195 tags:
1196 - Video Abuse
1197 parameters:
1198 - $ref: '#/components/parameters/id2'
1199 responses:
1200 '204':
1201 $ref: '#/paths/~1users~1me/put/responses/204'
1202 '/videos/{id}/blacklist':
1203 post:
1204 summary: Put on blacklist a video by its id
1205 security:
1206 - OAuth2:
1207 - admin
1208 - moderator
1209 tags:
1210 - Video Blacklist
1211 parameters:
1212 - $ref: '#/components/parameters/id2'
1213 responses:
1214 '204':
1215 $ref: '#/paths/~1users~1me/put/responses/204'
1216 delete:
1217 summary: Delete an entry of the blacklist of a video by its id
1218 security:
1219 - OAuth2:
1220 - admin
1221 - moderator
1222 tags:
1223 - Video Blacklist
1224 parameters:
1225 - $ref: '#/components/parameters/id2'
1226 responses:
1227 '204':
1228 $ref: '#/paths/~1users~1me/put/responses/204'
1229 /videos/blacklist:
1230 get:
1231 summary: Get list of videos on blacklist
1232 security:
1233 - OAuth2:
1234 - admin
1235 - moderator
1236 tags:
1237 - Video Blacklist
1238 parameters:
1239 - $ref: '#/components/parameters/start'
1240 - $ref: '#/components/parameters/count'
1241 - $ref: '#/components/parameters/blacklistsSort'
1242 responses:
1243 '200':
1244 description: successful operation
1245 content:
1246 application/json:
1247 schema:
1248 type: array
1249 items:
1250 $ref: '#/components/schemas/VideoBlacklist'
1251 /videos/{id}/captions:
1252 get:
1253 summary: Get list of video's captions
1254 tags:
1255 - Video Caption
1256 parameters:
1257 - $ref: '#/components/parameters/id2'
1258 responses:
1259 '200':
1260 description: successful operation
1261 content:
1262 application/json:
1263 schema:
1264 type: object
1265 properties:
1266 total:
1267 type: integer
1268 data:
1269 type: array
1270 items:
1271 $ref: '#/components/schemas/VideoCaption'
1272 /videos/{id}/captions/{captionLanguage}:
1273 put:
1274 summary: Add or replace a video caption
1275 tags:
1276 - Video Caption
1277 parameters:
1278 - $ref: '#/components/parameters/id2'
1279 - $ref: '#/components/parameters/captionLanguage'
1280 requestBody:
1281 content:
1282 multipart/form-data:
1283 schema:
1284 type: object
1285 properties:
1286 captionfile:
1287 description: The file to upload.
1288 type: string
1289 format: binary
1290 responses:
1291 '204':
1292 $ref: '#/paths/~1users~1me/put/responses/204'
1293 delete:
1294 summary: Delete a video caption
1295 tags:
1296 - Video Caption
1297 parameters:
1298 - $ref: '#/components/parameters/id2'
1299 - $ref: '#/components/parameters/captionLanguage'
1300 responses:
1301 '204':
1302 $ref: '#/paths/~1users~1me/put/responses/204'
1303 /video-channels:
1304 get:
1305 summary: Get list of video channels
1306 tags:
1307 - Video Channel
1308 parameters:
1309 - $ref: '#/components/parameters/start'
1310 - $ref: '#/components/parameters/count'
1311 - $ref: '#/components/parameters/sort'
1312 responses:
1313 '200':
1314 description: successful operation
1315 content:
1316 application/json:
1317 schema:
1318 type: array
1319 items:
1320 $ref: '#/components/schemas/VideoChannel'
1321 post:
1322 summary: Creates a video channel for the current user
1323 security:
1324 - OAuth2: []
1325 tags:
1326 - Video Channel
1327 responses:
1328 '204':
1329 $ref: '#/paths/~1users~1me/put/responses/204'
1330 requestBody:
1331 $ref: '#/components/requestBodies/VideoChannelInput'
1332 '/video-channels/{channelHandle}':
1333 get:
1334 summary: Get a video channel by its id
1335 tags:
1336 - Video Channel
1337 parameters:
1338 - $ref: '#/components/parameters/channelHandle'
1339 responses:
1340 '200':
1341 description: successful operation
1342 content:
1343 application/json:
1344 schema:
1345 $ref: '#/components/schemas/VideoChannel'
1346 put:
1347 summary: Update a video channel by its id
1348 security:
1349 - OAuth2: []
1350 tags:
1351 - Video Channel
1352 parameters:
1353 - $ref: '#/components/parameters/channelHandle'
1354 responses:
1355 '204':
1356 $ref: '#/paths/~1users~1me/put/responses/204'
1357 requestBody:
1358 $ref: '#/components/requestBodies/VideoChannelInput'
1359 delete:
1360 summary: Delete a video channel by its id
1361 security:
1362 - OAuth2: []
1363 tags:
1364 - Video Channel
1365 parameters:
1366 - $ref: '#/components/parameters/channelHandle'
1367 responses:
1368 '204':
1369 $ref: '#/paths/~1users~1me/put/responses/204'
1370 '/video-channels/{channelHandle}/videos':
1371 get:
1372 summary: Get videos of a video channel by its id
1373 tags:
1374 - Video Channel
1375 parameters:
1376 - $ref: '#/components/parameters/channelHandle'
1377 responses:
1378 '200':
1379 description: successful operation
1380 content:
1381 application/json:
1382 schema:
1383 $ref: '#/components/schemas/Video'
1384 '/accounts/{name}/video-channels':
1385 get:
1386 summary: Get video channels of an account by its name
1387 tags:
1388 - Video Channel
1389 parameters:
1390 - $ref: '#/components/parameters/name'
1391 responses:
1392 '200':
1393 description: successful operation
1394 content:
1395 application/json:
1396 schema:
1397 type: array
1398 items:
1399 $ref: '#/components/schemas/VideoChannel'
1400 '/accounts/{name}/ratings':
1401 get:
1402 summary: Get ratings of an account by its name
1403 security:
1404 - OAuth2: []
1405 tags:
1406 - User
1407 parameters:
1408 - $ref: '#/components/parameters/start'
1409 - $ref: '#/components/parameters/count'
1410 - $ref: '#/components/parameters/sort'
1411 - name: rating
1412 in: query
1413 required: false
1414 description: Optionaly filter which ratings to retrieve
1415 schema:
1416 type: string
1417 enum:
1418 - like
1419 - dislike
1420 responses:
1421 '200':
1422 description: successful operation
1423 content:
1424 application/json:
1425 schema:
1426 type: array
1427 items:
1428 $ref: '#/components/schemas/VideoRating'
1429 '/videos/{id}/comment-threads':
1430 get:
1431 summary: Get the comment threads of a video by its id
1432 tags:
1433 - Video Comment
1434 parameters:
1435 - $ref: '#/components/parameters/id2'
1436 - $ref: '#/components/parameters/start'
1437 - $ref: '#/components/parameters/count'
1438 - $ref: '#/components/parameters/sort'
1439 responses:
1440 '200':
1441 description: successful operation
1442 content:
1443 application/json:
1444 schema:
1445 $ref: '#/components/schemas/CommentThreadResponse'
1446 post:
1447 summary: 'Creates a comment thread, on a video by its id'
1448 security:
1449 - OAuth2: []
1450 tags:
1451 - Video Comment
1452 parameters:
1453 - $ref: '#/components/parameters/id2'
1454 responses:
1455 '200':
1456 description: successful operation
1457 content:
1458 application/json:
1459 schema:
1460 $ref: '#/components/schemas/CommentThreadPostResponse'
1461 '/videos/{id}/comment-threads/{threadId}':
1462 get:
1463 summary: 'Get the comment thread by its id, of a video by its id'
1464 tags:
1465 - Video Comment
1466 parameters:
1467 - $ref: '#/components/parameters/id2'
1468 - name: threadId
1469 in: path
1470 required: true
1471 description: The thread id (root comment id)
1472 schema:
1473 type: number
1474 responses:
1475 '200':
1476 description: successful operation
1477 content:
1478 application/json:
1479 schema:
1480 $ref: '#/components/schemas/VideoCommentThreadTree'
1481 '/videos/{id}/comments/{commentId}':
1482 post:
1483 summary: 'Creates a comment in a comment thread by its id, of a video by its id'
1484 security:
1485 - OAuth2: []
1486 tags:
1487 - Video Comment
1488 parameters:
1489 - $ref: '#/components/parameters/id2'
1490 - $ref: '#/components/parameters/commentId'
1491 responses:
1492 '200':
1493 description: successful operation
1494 content:
1495 application/json:
1496 schema:
1497 $ref: '#/components/schemas/CommentThreadPostResponse'
1498 delete:
1499 summary: 'Delete a comment in a comment therad by its id, of a video by its id'
1500 security:
1501 - OAuth2: []
1502 tags:
1503 - Video Comment
1504 parameters:
1505 - $ref: '#/components/parameters/id2'
1506 - $ref: '#/components/parameters/commentId'
1507 responses:
1508 '204':
1509 $ref: '#/paths/~1users~1me/put/responses/204'
1510 '/videos/{id}/rate':
1511 put:
1512 summary: Vote for a video by its id
1513 security:
1514 - OAuth2: []
1515 tags:
1516 - Video Rate
1517 parameters:
1518 - $ref: '#/components/parameters/id2'
1519 responses:
1520 '204':
1521 $ref: '#/paths/~1users~1me/put/responses/204'
1522 /search/videos:
1523 get:
1524 tags:
1525 - Search
1526 summary: Get the videos corresponding to a given query
1527 parameters:
1528 - $ref: '#/components/parameters/start'
1529 - $ref: '#/components/parameters/count'
1530 - $ref: '#/components/parameters/videosSearchSort'
1531 - name: search
1532 in: query
1533 required: true
1534 description: String to search
1535 schema:
1536 type: string
1537 responses:
1538 '200':
1539 description: successful operation
1540 content:
1541 application/json:
1542 schema:
1543 type: array
1544 items:
1545 $ref: '#/components/schemas/Video'
1546 servers:
1547 - url: 'https://peertube.cpy.re/api/v1'
1548 description: Live Test Server (live data - stable version)
1549 - url: 'https://peertube2.cpy.re/api/v1'
1550 description: Live Test Server (live data - bleeding edge version)
1551 - url: 'https://peertube3.cpy.re/api/v1'
1552 description: Live Test Server (live data - bleeding edge version)
1553 components:
1554 parameters:
1555 start:
1556 name: start
1557 in: query
1558 required: false
1559 description: Offset
1560 schema:
1561 type: number
1562 count:
1563 name: count
1564 in: query
1565 required: false
1566 description: Number of items
1567 schema:
1568 type: number
1569 sort:
1570 name: sort
1571 in: query
1572 required: false
1573 description: Sort column (-createdAt for example)
1574 schema:
1575 type: string
1576 videosSort:
1577 name: sort
1578 in: query
1579 required: false
1580 description: Sort videos by criteria
1581 schema:
1582 type: string
1583 enum:
1584 - -name
1585 - -duration
1586 - -createdAt
1587 - -publishedAt
1588 - -views
1589 - -likes
1590 - -trending
1591 videosSearchSort:
1592 name: sort
1593 in: query
1594 required: false
1595 description: Sort videos by criteria
1596 schema:
1597 type: string
1598 enum:
1599 - -name
1600 - -duration
1601 - -createdAt
1602 - -publishedAt
1603 - -views
1604 - -likes
1605 - -match
1606 blacklistsSort:
1607 name: sort
1608 in: query
1609 required: false
1610 description: Sort blacklists by criteria
1611 schema:
1612 type: string
1613 enum:
1614 - -id
1615 - -name
1616 - -duration
1617 - -views
1618 - -likes
1619 - -dislikes
1620 - -uuid
1621 - -createdAt
1622 usersSort:
1623 name: sort
1624 in: query
1625 required: false
1626 description: Sort users by criteria
1627 schema:
1628 type: string
1629 enum:
1630 - -id
1631 - -username
1632 - -createdAt
1633 abusesSort:
1634 name: sort
1635 in: query
1636 required: false
1637 description: Sort abuses by criteria
1638 schema:
1639 type: string
1640 enum:
1641 - -id
1642 - -createdAt
1643 - -state
1644 name:
1645 name: name
1646 in: path
1647 required: true
1648 description: >-
1649 The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
1650 example)
1651 schema:
1652 type: string
1653 id:
1654 name: id
1655 in: path
1656 required: true
1657 description: The user id
1658 schema:
1659 type: number
1660 id2:
1661 name: id
1662 in: path
1663 required: true
1664 description: The video id or uuid
1665 schema:
1666 type: string
1667 captionLanguage:
1668 name: captionLanguage
1669 in: path
1670 required: true
1671 description: The caption language
1672 schema:
1673 type: string
1674 channelHandle:
1675 name: channelHandle
1676 in: path
1677 required: true
1678 description: "The video channel handle (example: 'my_username@example.com' or 'my_username')"
1679 schema:
1680 type: string
1681 commentId:
1682 name: threadId
1683 in: path
1684 required: true
1685 description: The comment id
1686 schema:
1687 type: number
1688 categoryOneOf:
1689 name: categoryOneOf
1690 in: query
1691 required: false
1692 description: category id of the video
1693 schema:
1694 oneOf:
1695 - type: number
1696 - type: array
1697 items:
1698 type: number
1699 style: form
1700 explode: false
1701 tagsOneOf:
1702 name: tagsOneOf
1703 in: query
1704 required: false
1705 description: tag(s) of the video
1706 schema:
1707 oneOf:
1708 - type: string
1709 - type: array
1710 items:
1711 type: string
1712 style: form
1713 explode: false
1714 tagsAllOf:
1715 name: tagsAllOf
1716 in: query
1717 required: false
1718 description: tag(s) of the video, where all should be present in the video
1719 schema:
1720 oneOf:
1721 - type: string
1722 - type: array
1723 items:
1724 type: string
1725 style: form
1726 explode: false
1727 languageOneOf:
1728 name: languageOneOf
1729 in: query
1730 required: false
1731 description: language id of the video
1732 schema:
1733 oneOf:
1734 - type: string
1735 - type: array
1736 items:
1737 type: string
1738 style: form
1739 explode: false
1740 licenceOneOf:
1741 name: licenceOneOf
1742 in: query
1743 required: false
1744 description: licence id of the video
1745 schema:
1746 oneOf:
1747 - type: number
1748 - type: array
1749 items:
1750 type: number
1751 style: form
1752 explode: false
1753 nsfw:
1754 name: nsfw
1755 in: query
1756 required: false
1757 description: whether to include nsfw videos, if any
1758 schema:
1759 type: string
1760 enum:
1761 - 'true'
1762 - 'false'
1763 filter:
1764 name: filter
1765 in: query
1766 required: false
1767 description: >
1768 Special filters (local for instance) which might require special rights:
1769 * `local` - only videos local to the instance
1770 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
1771 schema:
1772 type: string
1773 enum:
1774 - local
1775 - all-local
1776 subscriptionsUris:
1777 name: uris
1778 in: query
1779 required: true
1780 description: list of uris to check if each is part of the user subscriptions
1781 schema:
1782 type: array
1783 items:
1784 type: string
1785 requestBodies:
1786 VideoChannelInput:
1787 content:
1788 application/json:
1789 schema:
1790 $ref: '#/components/schemas/VideoChannelInput'
1791 securitySchemes:
1792 OAuth2:
1793 description: >
1794 In the header: *Authorization: Bearer <token\>*
1795
1796
1797 Authenticating via OAuth requires the following steps:
1798
1799
1800 - Have an account with sufficient authorization levels
1801
1802 - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
1803 Bearer Token
1804
1805 - Make Authenticated Requests
1806 type: oauth2
1807 flows:
1808 password:
1809 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
1810 scopes:
1811 admin: Admin scope
1812 moderator: Moderator scope
1813 user: User scope
1814 schemas:
1815 VideoConstantNumber:
1816 properties:
1817 id:
1818 type: number
1819 label:
1820 type: string
1821 VideoConstantString:
1822 properties:
1823 id:
1824 type: string
1825 label:
1826 type: string
1827 VideoPrivacySet:
1828 type: integer
1829 enum:
1830 - 1
1831 - 2
1832 - 3
1833 description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3)'
1834 VideoPrivacyConstant:
1835 properties:
1836 id:
1837 type: integer
1838 enum:
1839 - 1
1840 - 2
1841 - 3
1842 label:
1843 type: string
1844 Video:
1845 properties:
1846 id:
1847 type: number
1848 uuid:
1849 type: string
1850 createdAt:
1851 type: string
1852 publishedAt:
1853 type: string
1854 updatedAt:
1855 type: string
1856 category:
1857 $ref: '#/components/schemas/VideoConstantNumber'
1858 licence:
1859 $ref: '#/components/schemas/VideoConstantNumber'
1860 language:
1861 $ref: '#/components/schemas/VideoConstantString'
1862 privacy:
1863 $ref: '#/components/schemas/VideoPrivacyConstant'
1864 description:
1865 type: string
1866 duration:
1867 type: number
1868 isLocal:
1869 type: boolean
1870 name:
1871 type: string
1872 thumbnailPath:
1873 type: string
1874 previewPath:
1875 type: string
1876 embedPath:
1877 type: string
1878 views:
1879 type: number
1880 likes:
1881 type: number
1882 dislikes:
1883 type: number
1884 nsfw:
1885 type: boolean
1886 account:
1887 type: object
1888 properties:
1889 name:
1890 type: string
1891 displayName:
1892 type: string
1893 url:
1894 type: string
1895 host:
1896 type: string
1897 avatar:
1898 $ref: '#/components/schemas/Avatar'
1899 VideoAbuse:
1900 properties:
1901 id:
1902 type: number
1903 reason:
1904 type: string
1905 reporterAccount:
1906 $ref: '#/components/schemas/Account'
1907 video:
1908 type: object
1909 properties:
1910 id:
1911 type: number
1912 name:
1913 type: string
1914 uuid:
1915 type: string
1916 url:
1917 type: string
1918 createdAt:
1919 type: string
1920 VideoBlacklist:
1921 properties:
1922 id:
1923 type: number
1924 videoId:
1925 type: number
1926 createdAt:
1927 type: string
1928 updatedAt:
1929 type: string
1930 name:
1931 type: string
1932 uuid:
1933 type: string
1934 description:
1935 type: string
1936 duration:
1937 type: number
1938 views:
1939 type: number
1940 likes:
1941 type: number
1942 dislikes:
1943 type: number
1944 nsfw:
1945 type: boolean
1946 VideoChannel:
1947 properties:
1948 displayName:
1949 type: string
1950 description:
1951 type: string
1952 isLocal:
1953 type: boolean
1954 ownerAccount:
1955 type: object
1956 properties:
1957 id:
1958 type: number
1959 uuid:
1960 type: string
1961 VideoComment:
1962 properties:
1963 id:
1964 type: number
1965 url:
1966 type: string
1967 text:
1968 type: string
1969 threadId:
1970 type: number
1971 inReplyToCommentId:
1972 type: number
1973 videoId:
1974 type: number
1975 createdAt:
1976 type: string
1977 updatedAt:
1978 type: string
1979 totalReplies:
1980 type: number
1981 account:
1982 $ref: '#/components/schemas/Account'
1983 VideoCommentThreadTree:
1984 properties:
1985 comment:
1986 $ref: '#/components/schemas/VideoComment'
1987 children:
1988 type: array
1989 items:
1990 $ref: '#/components/schemas/VideoCommentThreadTree'
1991 VideoCaption:
1992 properties:
1993 language:
1994 $ref: '#/components/schemas/VideoConstantString'
1995 captionPath:
1996 type: string
1997 Avatar:
1998 properties:
1999 path:
2000 type: string
2001 createdAt:
2002 type: string
2003 updatedAt:
2004 type: string
2005 Actor:
2006 properties:
2007 id:
2008 type: number
2009 uuid:
2010 type: string
2011 url:
2012 type: string
2013 name:
2014 type: string
2015 host:
2016 type: string
2017 followingCount:
2018 type: number
2019 followersCount:
2020 type: number
2021 createdAt:
2022 type: string
2023 updatedAt:
2024 type: string
2025 avatar:
2026 $ref: '#/components/schemas/Avatar'
2027 Account:
2028 allOf:
2029 - $ref: '#/components/schemas/Actor'
2030 - properties:
2031 displayName:
2032 type: string
2033 User:
2034 properties:
2035 id:
2036 type: number
2037 username:
2038 type: string
2039 email:
2040 type: string
2041 displayNSFW:
2042 type: boolean
2043 autoPlayVideo:
2044 type: boolean
2045 role:
2046 type: integer
2047 enum:
2048 - 0
2049 - 1
2050 - 2
2051 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2052 roleLabel:
2053 type: string
2054 enum:
2055 - User
2056 - Moderator
2057 - Administrator
2058 videoQuota:
2059 type: number
2060 videoQuotaDaily:
2061 type: number
2062 createdAt:
2063 type: string
2064 account:
2065 $ref: '#/components/schemas/Account'
2066 videoChannels:
2067 type: array
2068 items:
2069 $ref: '#/components/schemas/VideoChannel'
2070 UserWatchingVideo:
2071 properties:
2072 currentTime:
2073 type: number
2074 ServerConfig:
2075 properties:
2076 signup:
2077 type: object
2078 properties:
2079 allowed:
2080 type: boolean
2081 transcoding:
2082 type: object
2083 properties:
2084 enabledResolutions:
2085 type: array
2086 items:
2087 type: number
2088 avatar:
2089 type: object
2090 properties:
2091 file:
2092 type: object
2093 properties:
2094 size:
2095 type: object
2096 properties:
2097 max:
2098 type: number
2099 extensions:
2100 type: array
2101 items:
2102 type: string
2103 video:
2104 type: object
2105 properties:
2106 file:
2107 type: object
2108 properties:
2109 extensions:
2110 type: array
2111 items:
2112 type: string
2113 Follow:
2114 properties:
2115 id:
2116 type: number
2117 follower:
2118 $ref: '#/components/schemas/Actor'
2119 following:
2120 $ref: '#/components/schemas/Actor'
2121 score:
2122 type: number
2123 state:
2124 type: string
2125 enum:
2126 - pending
2127 - accepted
2128 createdAt:
2129 type: string
2130 updatedAt:
2131 type: string
2132 Job:
2133 properties:
2134 id:
2135 type: number
2136 state:
2137 type: string
2138 enum:
2139 - pending
2140 - processing
2141 - error
2142 - success
2143 category:
2144 type: string
2145 enum:
2146 - transcoding
2147 - activitypub-http
2148 handlerName:
2149 type: string
2150 handlerInputData:
2151 type: string
2152 createdAt:
2153 type: string
2154 updatedAt:
2155 type: string
2156 AddUserResponse:
2157 properties:
2158 id:
2159 type: number
2160 uuid:
2161 type: string
2162 VideoUploadResponse:
2163 properties:
2164 video:
2165 type: object
2166 properties:
2167 id:
2168 type: number
2169 uuid:
2170 type: string
2171 CommentThreadResponse:
2172 properties:
2173 total:
2174 type: number
2175 data:
2176 type: array
2177 items:
2178 $ref: '#/components/schemas/VideoComment'
2179 CommentThreadPostResponse:
2180 properties:
2181 comment:
2182 $ref: '#/components/schemas/VideoComment'
2183 AddUser:
2184 properties:
2185 username:
2186 type: string
2187 description: 'The user username '
2188 password:
2189 type: string
2190 description: 'The user password '
2191 email:
2192 type: string
2193 description: 'The user email '
2194 videoQuota:
2195 type: string
2196 description: 'The user videoQuota '
2197 videoQuotaDaily:
2198 type: string
2199 description: 'The user daily video quota '
2200 role:
2201 type: integer
2202 enum:
2203 - 0
2204 - 1
2205 - 2
2206 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2207 required:
2208 - username
2209 - password
2210 - email
2211 - videoQuota
2212 - videoQuotaDaily
2213 - role
2214 UpdateUser:
2215 properties:
2216 id:
2217 type: string
2218 description: 'The user id '
2219 email:
2220 type: string
2221 description: 'The updated email of the user '
2222 videoQuota:
2223 type: string
2224 description: 'The updated videoQuota of the user '
2225 videoQuotaDaily:
2226 type: string
2227 description: 'The updated daily video quota of the user '
2228 role:
2229 type: integer
2230 enum:
2231 - 0
2232 - 1
2233 - 2
2234 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2235 required:
2236 - id
2237 - email
2238 - videoQuota
2239 - videoQuotaDaily
2240 - role
2241 UpdateMe:
2242 properties:
2243 password:
2244 type: string
2245 description: 'Your new password '
2246 email:
2247 type: string
2248 description: 'Your new email '
2249 displayNSFW:
2250 type: string
2251 description: 'Your new displayNSFW '
2252 autoPlayVideo:
2253 type: string
2254 description: 'Your new autoPlayVideo '
2255 required:
2256 - password
2257 - email
2258 - displayNSFW
2259 - autoPlayVideo
2260 GetMeVideoRating:
2261 properties:
2262 id:
2263 type: string
2264 description: 'Id of the video '
2265 rating:
2266 type: number
2267 description: 'Rating of the video '
2268 required:
2269 - id
2270 - rating
2271 VideoRating:
2272 properties:
2273 video:
2274 $ref: '#/components/schemas/Video'
2275 rating:
2276 type: number
2277 description: 'Rating of the video'
2278 required:
2279 - video
2280 - rating
2281 RegisterUser:
2282 properties:
2283 username:
2284 type: string
2285 description: 'The username of the user '
2286 password:
2287 type: string
2288 description: 'The password of the user '
2289 email:
2290 type: string
2291 description: 'The email of the user '
2292 required:
2293 - username
2294 - password
2295 - email
2296 VideoChannelInput:
2297 properties:
2298 name:
2299 type: string
2300 description:
2301 type: string
2302