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