]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/doc/api/openapi.yaml
787859c3bbb90ab0afd6198f5a7e90a36b7cdf21
[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/VideoPrivacy'
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/VideoPrivacy'
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 VideoPrivacy:
1828 type: string
1829 enum:
1830 - Public
1831 - Unlisted
1832 - Private
1833 Video:
1834 properties:
1835 id:
1836 type: number
1837 uuid:
1838 type: string
1839 createdAt:
1840 type: string
1841 publishedAt:
1842 type: string
1843 updatedAt:
1844 type: string
1845 category:
1846 $ref: '#/components/schemas/VideoConstantNumber'
1847 licence:
1848 $ref: '#/components/schemas/VideoConstantNumber'
1849 language:
1850 $ref: '#/components/schemas/VideoConstantString'
1851 privacy:
1852 $ref: '#/components/schemas/VideoPrivacy'
1853 description:
1854 type: string
1855 duration:
1856 type: number
1857 isLocal:
1858 type: boolean
1859 name:
1860 type: string
1861 thumbnailPath:
1862 type: string
1863 previewPath:
1864 type: string
1865 embedPath:
1866 type: string
1867 views:
1868 type: number
1869 likes:
1870 type: number
1871 dislikes:
1872 type: number
1873 nsfw:
1874 type: boolean
1875 account:
1876 type: object
1877 properties:
1878 name:
1879 type: string
1880 displayName:
1881 type: string
1882 url:
1883 type: string
1884 host:
1885 type: string
1886 avatar:
1887 $ref: '#/components/schemas/Avatar'
1888 VideoAbuse:
1889 properties:
1890 id:
1891 type: number
1892 reason:
1893 type: string
1894 reporterAccount:
1895 $ref: '#/components/schemas/Account'
1896 video:
1897 type: object
1898 properties:
1899 id:
1900 type: number
1901 name:
1902 type: string
1903 uuid:
1904 type: string
1905 url:
1906 type: string
1907 createdAt:
1908 type: string
1909 VideoBlacklist:
1910 properties:
1911 id:
1912 type: number
1913 videoId:
1914 type: number
1915 createdAt:
1916 type: string
1917 updatedAt:
1918 type: string
1919 name:
1920 type: string
1921 uuid:
1922 type: string
1923 description:
1924 type: string
1925 duration:
1926 type: number
1927 views:
1928 type: number
1929 likes:
1930 type: number
1931 dislikes:
1932 type: number
1933 nsfw:
1934 type: boolean
1935 VideoChannel:
1936 properties:
1937 displayName:
1938 type: string
1939 description:
1940 type: string
1941 isLocal:
1942 type: boolean
1943 ownerAccount:
1944 type: object
1945 properties:
1946 id:
1947 type: number
1948 uuid:
1949 type: string
1950 VideoComment:
1951 properties:
1952 id:
1953 type: number
1954 url:
1955 type: string
1956 text:
1957 type: string
1958 threadId:
1959 type: number
1960 inReplyToCommentId:
1961 type: number
1962 videoId:
1963 type: number
1964 createdAt:
1965 type: string
1966 updatedAt:
1967 type: string
1968 totalReplies:
1969 type: number
1970 account:
1971 $ref: '#/components/schemas/Account'
1972 VideoCommentThreadTree:
1973 properties:
1974 comment:
1975 $ref: '#/components/schemas/VideoComment'
1976 children:
1977 type: array
1978 items:
1979 $ref: '#/components/schemas/VideoCommentThreadTree'
1980 VideoCaption:
1981 properties:
1982 language:
1983 $ref: '#/components/schemas/VideoConstantString'
1984 captionPath:
1985 type: string
1986 Avatar:
1987 properties:
1988 path:
1989 type: string
1990 createdAt:
1991 type: string
1992 updatedAt:
1993 type: string
1994 Actor:
1995 properties:
1996 id:
1997 type: number
1998 uuid:
1999 type: string
2000 url:
2001 type: string
2002 name:
2003 type: string
2004 host:
2005 type: string
2006 followingCount:
2007 type: number
2008 followersCount:
2009 type: number
2010 createdAt:
2011 type: string
2012 updatedAt:
2013 type: string
2014 avatar:
2015 $ref: '#/components/schemas/Avatar'
2016 Account:
2017 allOf:
2018 - $ref: '#/components/schemas/Actor'
2019 - properties:
2020 displayName:
2021 type: string
2022 User:
2023 properties:
2024 id:
2025 type: number
2026 username:
2027 type: string
2028 email:
2029 type: string
2030 displayNSFW:
2031 type: boolean
2032 autoPlayVideo:
2033 type: boolean
2034 role:
2035 type: integer
2036 enum:
2037 - 0
2038 - 1
2039 - 2
2040 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2041 roleLabel:
2042 type: string
2043 enum:
2044 - User
2045 - Moderator
2046 - Administrator
2047 videoQuota:
2048 type: number
2049 videoQuotaDaily:
2050 type: number
2051 createdAt:
2052 type: string
2053 account:
2054 $ref: '#/components/schemas/Account'
2055 videoChannels:
2056 type: array
2057 items:
2058 $ref: '#/components/schemas/VideoChannel'
2059 UserWatchingVideo:
2060 properties:
2061 currentTime:
2062 type: number
2063 ServerConfig:
2064 properties:
2065 signup:
2066 type: object
2067 properties:
2068 allowed:
2069 type: boolean
2070 transcoding:
2071 type: object
2072 properties:
2073 enabledResolutions:
2074 type: array
2075 items:
2076 type: number
2077 avatar:
2078 type: object
2079 properties:
2080 file:
2081 type: object
2082 properties:
2083 size:
2084 type: object
2085 properties:
2086 max:
2087 type: number
2088 extensions:
2089 type: array
2090 items:
2091 type: string
2092 video:
2093 type: object
2094 properties:
2095 file:
2096 type: object
2097 properties:
2098 extensions:
2099 type: array
2100 items:
2101 type: string
2102 Follow:
2103 properties:
2104 id:
2105 type: number
2106 follower:
2107 $ref: '#/components/schemas/Actor'
2108 following:
2109 $ref: '#/components/schemas/Actor'
2110 score:
2111 type: number
2112 state:
2113 type: string
2114 enum:
2115 - pending
2116 - accepted
2117 createdAt:
2118 type: string
2119 updatedAt:
2120 type: string
2121 Job:
2122 properties:
2123 id:
2124 type: number
2125 state:
2126 type: string
2127 enum:
2128 - pending
2129 - processing
2130 - error
2131 - success
2132 category:
2133 type: string
2134 enum:
2135 - transcoding
2136 - activitypub-http
2137 handlerName:
2138 type: string
2139 handlerInputData:
2140 type: string
2141 createdAt:
2142 type: string
2143 updatedAt:
2144 type: string
2145 AddUserResponse:
2146 properties:
2147 id:
2148 type: number
2149 uuid:
2150 type: string
2151 VideoUploadResponse:
2152 properties:
2153 video:
2154 type: object
2155 properties:
2156 id:
2157 type: number
2158 uuid:
2159 type: string
2160 CommentThreadResponse:
2161 properties:
2162 total:
2163 type: number
2164 data:
2165 type: array
2166 items:
2167 $ref: '#/components/schemas/VideoComment'
2168 CommentThreadPostResponse:
2169 properties:
2170 comment:
2171 $ref: '#/components/schemas/VideoComment'
2172 AddUser:
2173 properties:
2174 username:
2175 type: string
2176 description: 'The user username '
2177 password:
2178 type: string
2179 description: 'The user password '
2180 email:
2181 type: string
2182 description: 'The user email '
2183 videoQuota:
2184 type: string
2185 description: 'The user videoQuota '
2186 videoQuotaDaily:
2187 type: string
2188 description: 'The user daily video quota '
2189 role:
2190 type: integer
2191 enum:
2192 - 0
2193 - 1
2194 - 2
2195 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2196 required:
2197 - username
2198 - password
2199 - email
2200 - videoQuota
2201 - videoQuotaDaily
2202 - role
2203 UpdateUser:
2204 properties:
2205 id:
2206 type: string
2207 description: 'The user id '
2208 email:
2209 type: string
2210 description: 'The updated email of the user '
2211 videoQuota:
2212 type: string
2213 description: 'The updated videoQuota of the user '
2214 videoQuotaDaily:
2215 type: string
2216 description: 'The updated daily video quota of the user '
2217 role:
2218 type: integer
2219 enum:
2220 - 0
2221 - 1
2222 - 2
2223 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2224 required:
2225 - id
2226 - email
2227 - videoQuota
2228 - videoQuotaDaily
2229 - role
2230 UpdateMe:
2231 properties:
2232 password:
2233 type: string
2234 description: 'Your new password '
2235 email:
2236 type: string
2237 description: 'Your new email '
2238 displayNSFW:
2239 type: string
2240 description: 'Your new displayNSFW '
2241 autoPlayVideo:
2242 type: string
2243 description: 'Your new autoPlayVideo '
2244 required:
2245 - password
2246 - email
2247 - displayNSFW
2248 - autoPlayVideo
2249 GetMeVideoRating:
2250 properties:
2251 id:
2252 type: string
2253 description: 'Id of the video '
2254 rating:
2255 type: number
2256 description: 'Rating of the video '
2257 required:
2258 - id
2259 - rating
2260 VideoRating:
2261 properties:
2262 video:
2263 $ref: '#/components/schemas/Video'
2264 rating:
2265 type: number
2266 description: 'Rating of the video'
2267 required:
2268 - video
2269 - rating
2270 RegisterUser:
2271 properties:
2272 username:
2273 type: string
2274 description: 'The username of the user '
2275 password:
2276 type: string
2277 description: 'The password of the user '
2278 email:
2279 type: string
2280 description: 'The email of the user '
2281 required:
2282 - username
2283 - password
2284 - email
2285 VideoChannelInput:
2286 properties:
2287 name:
2288 type: string
2289 description:
2290 type: string
2291