]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/doc/api/openapi.yaml
9f2997774382c0c8c7d7f3f232f3a52430309ff8
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
1 openapi: 3.0.0
2 info:
3 title: PeerTube
4 version: 1.1.0-alpha.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 description: |
14 # Introduction
15 The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable
16 resource URLs. It returns HTTP response codes to indicate errors. It also
17 accepts and returns JSON in the HTTP body. You can use your favorite
18 HTTP/REST library for your programming language to use PeerTube. No official
19 SDK is currently provided.
20
21 # Authentication
22 When you sign up for an account, you are given the possibility to generate
23 sessions, and authenticate using this session token. One session token can
24 currently be used at a time.
25 tags:
26 - name: Accounts
27 description: >
28 Using some features of PeerTube require authentication, for which Accounts
29
30 provide different levels of permission as well as associated user
31 information.
32
33 Accounts also encompass remote accounts discovered across the federation.
34 - name: Config
35 description: >
36 Each server exposes public information regarding supported videos and
37 options.
38 - name: Feeds
39 description: |
40 Feeds of videos and feeds of comments allow to see updates and get them in
41 an aggregator or script of your choice.
42 - name: Job
43 description: >
44 Jobs are long-running tasks enqueued and processed by the instance
45 itself.
46
47 No additional worker registration is currently available.
48 - name: ServerFollowing
49 description: >
50 Managing servers which the instance interacts with is crucial to the
51 concept
52
53 of federation in PeerTube and external video indexation. The PeerTube
54 server
55
56 then deals with inter-server ActivityPub operations and propagates
57
58 information across its social graph by posting activities to actors' inbox
59
60 endpoints.
61 - name: VideoAbuse
62 description: |
63 Video abuses deal with reports of local or remote videos alike.
64 - name: Video
65 description: |
66 Operations dealing with listing, uploading, fetching or modifying videos.
67 - name: Search
68 description: |
69 The search helps to find _videos_ from within the instance and beyond.
70 Videos from other instances federated by the instance (that is, instances
71 followed by the instance) can be found via keywords and other criteria of
72 the advanced search.
73 - name: VideoComment
74 description: >
75 Operations dealing with comments to a video. Comments are organized in
76 threads.
77 - name: VideoChannel
78 description: >
79 Operations dealing with creation, modification and video listing of a
80 user's
81
82 channels.
83 paths:
84 '/accounts/{name}':
85 get:
86 tags:
87 - Accounts
88 summary: Get the account by name
89 parameters:
90 - $ref: '#/components/parameters/name'
91 - $ref: '#/components/parameters/start'
92 - $ref: '#/components/parameters/count'
93 - $ref: '#/components/parameters/sort'
94 responses:
95 '200':
96 description: successful operation
97 content:
98 application/json:
99 schema:
100 $ref: '#/components/schemas/Account'
101 '/accounts/{name}/videos':
102 get:
103 tags:
104 - Accounts
105 - Video
106 summary: 'Get videos for an account, provided the name of that account'
107 parameters:
108 - $ref: '#/components/parameters/name'
109 responses:
110 '200':
111 description: successful operation
112 content:
113 application/json:
114 schema:
115 $ref: '#/components/schemas/Video'
116 x-code-samples:
117 - lang: JavaScript
118 source: |
119 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
120 .then(function(response) {
121 return response.json()
122 }).then(function(data) {
123 console.log(data)
124 })
125 - lang: Shell
126 source: |
127 # pip install httpie
128 http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
129 /accounts:
130 get:
131 tags:
132 - Accounts
133 summary: Get all accounts
134 responses:
135 '200':
136 description: successful operation
137 content:
138 'application/json':
139 schema:
140 type: array
141 items:
142 $ref: '#/components/schemas/Account'
143 /config:
144 get:
145 tags:
146 - Config
147 summary: Get the configuration of the server
148 responses:
149 '200':
150 description: successful operation
151 content:
152 application/json:
153 schema:
154 $ref: '#/components/schemas/ServerConfig'
155 '/feeds/videos.{format}':
156 get:
157 summary: >-
158 Get the feed of videos for the server, with optional filter by account
159 name or id
160 tags:
161 - Feeds
162 parameters:
163 - name: format
164 in: path
165 required: true
166 description: >-
167 The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and
168 json to JSON FEED 1.0
169 schema:
170 type: string
171 enum:
172 - xml
173 - atom
174 - json
175 default: xml
176 - name: accountId
177 in: query
178 required: false
179 description: >-
180 The id of the local account to filter to (beware, users IDs and not
181 actors IDs which will return empty feeds
182 schema:
183 type: number
184 - name: accountName
185 in: query
186 required: false
187 description: The name of the local account to filter to
188 schema:
189 type: string
190 responses:
191 '200':
192 description: successful operation
193 /jobs:
194 get:
195 summary: Get list of jobs
196 security:
197 - OAuth2:
198 - admin
199 tags:
200 - Job
201 parameters:
202 - name: state
203 in: path
204 required: true
205 description: The state of the job
206 schema:
207 type: string
208 - $ref: '#/components/parameters/start'
209 - $ref: '#/components/parameters/count'
210 - $ref: '#/components/parameters/sort'
211 responses:
212 '200':
213 description: successful operation
214 content:
215 application/json:
216 schema:
217 type: array
218 items:
219 $ref: '#/components/schemas/Job'
220 '/server/following/{host}':
221 delete:
222 security:
223 - OAuth2:
224 - admin
225 tags:
226 - ServerFollowing
227 summary: Unfollow a server by hostname
228 parameters:
229 - name: host
230 in: path
231 required: true
232 description: 'The host to unfollow '
233 schema:
234 type: string
235 responses:
236 '201':
237 description: successful operation
238 /server/followers:
239 get:
240 tags:
241 - ServerFollowing
242 summary: Get followers of the server
243 parameters:
244 - $ref: '#/components/parameters/start'
245 - $ref: '#/components/parameters/count'
246 - $ref: '#/components/parameters/sort'
247 responses:
248 '200':
249 description: successful operation
250 content:
251 application/json:
252 schema:
253 type: array
254 items:
255 $ref: '#/components/schemas/Follow'
256 /server/following:
257 get:
258 tags:
259 - ServerFollowing
260 summary: Get servers followed by the server
261 parameters:
262 - $ref: '#/components/parameters/start'
263 - $ref: '#/components/parameters/count'
264 - $ref: '#/components/parameters/sort'
265 responses:
266 '200':
267 description: successful operation
268 content:
269 application/json:
270 schema:
271 type: array
272 items:
273 $ref: '#/components/schemas/Follow'
274 post:
275 security:
276 - OAuth2:
277 - admin
278 tags:
279 - ServerFollowing
280 summary: Follow a server
281 responses:
282 '204':
283 $ref: '#/paths/~1users~1me/put/responses/204'
284 requestBody:
285 content:
286 application/json:
287 schema:
288 $ref: '#/components/schemas/Follow'
289 /users:
290 post:
291 summary: Creates user
292 security:
293 - OAuth2:
294 - admin
295 tags:
296 - User
297 responses:
298 '200':
299 description: successful operation
300 content:
301 application/json:
302 schema:
303 $ref: '#/components/schemas/AddUserResponse'
304 requestBody:
305 content:
306 application/json:
307 schema:
308 $ref: '#/components/schemas/AddUser'
309 description: User to create
310 required: true
311 get:
312 summary: Get a list of users
313 security:
314 - OAuth2: []
315 tags:
316 - User
317 parameters:
318 - $ref: '#/components/parameters/start'
319 - $ref: '#/components/parameters/count'
320 - $ref: '#/components/parameters/sort'
321 responses:
322 '200':
323 description: successful operation
324 content:
325 application/json:
326 schema:
327 type: array
328 items:
329 $ref: '#/components/schemas/User'
330 '/users/{id}':
331 delete:
332 summary: Delete a user by its id
333 security:
334 - OAuth2:
335 - admin
336 tags:
337 - User
338 parameters:
339 - $ref: '#/components/parameters/id'
340 responses:
341 '204':
342 $ref: '#/paths/~1users~1me/put/responses/204'
343 get:
344 summary: Get user by its id
345 security:
346 - OAuth2: []
347 tags:
348 - User
349 parameters:
350 - $ref: '#/components/parameters/id'
351 responses:
352 '200':
353 description: successful operation
354 content:
355 application/json:
356 schema:
357 $ref: '#/components/schemas/User'
358 put:
359 summary: Update user profile by its id
360 security:
361 - OAuth2: []
362 tags:
363 - User
364 parameters:
365 - $ref: '#/components/parameters/id'
366 responses:
367 '204':
368 $ref: '#/paths/~1users~1me/put/responses/204'
369 requestBody:
370 content:
371 application/json:
372 schema:
373 $ref: '#/components/schemas/UpdateUser'
374 required: true
375 /users/me:
376 get:
377 summary: Get current user information
378 security:
379 - OAuth2: []
380 tags:
381 - User
382 responses:
383 '200':
384 description: successful operation
385 content:
386 application/json:
387 schema:
388 type: array
389 items:
390 $ref: '#/components/schemas/User'
391 put:
392 summary: Update current user information
393 security:
394 - OAuth2: []
395 tags:
396 - User
397 responses:
398 '204':
399 description: Successful operation
400 requestBody:
401 content:
402 application/json:
403 schema:
404 $ref: '#/components/schemas/UpdateMe'
405 required: true
406 /users/me/video-quota-used:
407 get:
408 summary: Get current user used quota
409 security:
410 - OAuth2: []
411 tags:
412 - User
413 responses:
414 '200':
415 description: successful operation
416 content:
417 application/json:
418 schema:
419 type: number
420 '/users/me/videos/{videoId}/rating':
421 get:
422 summary: 'Get rating of video by its id, among those of the current user'
423 security:
424 - OAuth2: []
425 tags:
426 - User
427 parameters:
428 - name: videoId
429 in: path
430 required: true
431 description: 'The video id '
432 schema:
433 type: string
434 responses:
435 '200':
436 description: successful operation
437 content:
438 application/json:
439 schema:
440 $ref: '#/components/schemas/GetMeVideoRating'
441 /users/me/videos:
442 get:
443 summary: Get videos of the current user
444 security:
445 - OAuth2: []
446 tags:
447 - User
448 parameters:
449 - $ref: '#/components/parameters/start'
450 - $ref: '#/components/parameters/count'
451 - $ref: '#/components/parameters/sort'
452 responses:
453 '200':
454 description: successful operation
455 content:
456 application/json:
457 schema:
458 type: array
459 items:
460 $ref: '#/components/schemas/Video'
461 /users/register:
462 post:
463 summary: Register a user
464 tags:
465 - User
466 responses:
467 '204':
468 $ref: '#/paths/~1users~1me/put/responses/204'
469 requestBody:
470 content:
471 application/json:
472 schema:
473 $ref: '#/components/schemas/RegisterUser'
474 required: true
475 /users/me/avatar/pick:
476 post:
477 summary: Update current user avatar
478 security:
479 - OAuth2: []
480 tags:
481 - User
482 responses:
483 '200':
484 description: successful operation
485 content:
486 application/json:
487 schema:
488 $ref: '#/components/schemas/Avatar'
489 requestBody:
490 content:
491 multipart/form-data:
492 schema:
493 type: object
494 properties:
495 avatarfile:
496 description: The file to upload.
497 type: string
498 format: binary
499 encoding:
500 profileImage:
501 # only accept png/jpeg
502 contentType: image/png, image/jpeg
503 /videos:
504 get:
505 summary: Get list of videos
506 tags:
507 - Video
508 parameters:
509 - name: category
510 in: query
511 required: false
512 description: category id of the video
513 schema:
514 type: number
515 - $ref: '#/components/parameters/start'
516 - $ref: '#/components/parameters/count'
517 - $ref: '#/components/parameters/sort'
518 responses:
519 '200':
520 description: successful operation
521 content:
522 application/json:
523 schema:
524 type: array
525 items:
526 $ref: '#/components/schemas/Video'
527 /videos/categories:
528 get:
529 summary: Get list of video licences known by the server
530 tags:
531 - Video
532 responses:
533 '200':
534 description: successful operation
535 content:
536 application/json:
537 schema:
538 type: array
539 items:
540 type: string
541 /videos/licences:
542 get:
543 summary: Get list of video licences known by the server
544 tags:
545 - Video
546 responses:
547 '200':
548 description: successful operation
549 content:
550 application/json:
551 schema:
552 type: array
553 items:
554 type: string
555 /videos/languages:
556 get:
557 summary: Get list of languages known by the server
558 tags:
559 - Video
560 responses:
561 '200':
562 description: successful operation
563 content:
564 application/json:
565 schema:
566 type: array
567 items:
568 type: string
569 /videos/privacies:
570 get:
571 summary: Get list of privacy policies supported by the server
572 tags:
573 - Video
574 responses:
575 '200':
576 description: successful operation
577 content:
578 application/json:
579 schema:
580 type: array
581 items:
582 type: string
583 '/videos/{id}':
584 put:
585 summary: Update metadata for a video by its id
586 security:
587 - OAuth2: []
588 tags:
589 - Video
590 parameters:
591 - $ref: '#/components/parameters/id2'
592 responses:
593 '200':
594 description: successful operation
595 content:
596 application/json:
597 schema:
598 $ref: '#/components/schemas/Video'
599 requestBody:
600 content:
601 multipart/form-data:
602 schema:
603 type: object
604 properties:
605 thumbnailfile:
606 description: Video thumbnail file
607 type: string
608 previewfile:
609 description: Video preview file
610 type: string
611 category:
612 description: Video category
613 type: string
614 licence:
615 description: Video licence
616 type: string
617 language:
618 description: Video language
619 type: string
620 description:
621 description: Video description
622 type: string
623 waitTranscoding:
624 description: Whether or not we wait transcoding before publish the video
625 type: string
626 support:
627 description: Text describing how to support the video uploader
628 type: string
629 nsfw:
630 description: Whether or not this video contains sensitive content
631 type: string
632 name:
633 description: Video name
634 type: string
635 tags:
636 description: Video tags
637 type: string
638 commentsEnabled:
639 description: Enable or disable comments for this video
640 type: string
641 scheduleUpdate: &ref_0
642 type: object
643 properties:
644 privacy:
645 type: string
646 enum:
647 - Public
648 - Unlisted
649 description: Video privacy target
650 updateAt:
651 type: string
652 format: date
653 description: When to update the video
654 required:
655 - updateAt
656 get:
657 summary: Get a video by its id
658 tags:
659 - Video
660 parameters:
661 - $ref: '#/components/parameters/id2'
662 responses:
663 '200':
664 description: successful operation
665 content:
666 application/json:
667 schema:
668 $ref: '#/components/schemas/Video'
669 delete:
670 summary: Delete a video by its id
671 security:
672 - OAuth2: []
673 tags:
674 - Video
675 parameters:
676 - $ref: '#/components/parameters/id2'
677 responses:
678 '204':
679 $ref: '#/paths/~1users~1me/put/responses/204'
680 '/videos/{id}/description':
681 get:
682 summary: Get a video description by its id
683 tags:
684 - Video
685 parameters:
686 - $ref: '#/components/parameters/id2'
687 responses:
688 '200':
689 description: successful operation
690 content:
691 application/json:
692 schema:
693 type: string
694 '/videos/{id}/views':
695 post:
696 summary: Add a view to the video by its id
697 tags:
698 - Video
699 parameters:
700 - $ref: '#/components/parameters/id2'
701 responses:
702 '204':
703 $ref: '#/paths/~1users~1me/put/responses/204'
704 /videos/upload:
705 post:
706 summary: Upload a video file with its metadata
707 security:
708 - OAuth2: []
709 tags:
710 - Video
711 responses:
712 '200':
713 description: successful operation
714 content:
715 application/json:
716 schema:
717 $ref: '#/components/schemas/VideoUploadResponse'
718 requestBody:
719 content:
720 multipart/form-data:
721 schema:
722 type: object
723 properties:
724 videofile:
725 description: Video file
726 type: string
727 format: binary
728 channelId:
729 description: Channel id that will contain this video
730 type: number
731 thumbnailfile:
732 description: Video thumbnail file
733 type: string
734 previewfile:
735 description: Video preview file
736 type: string
737 privacy:
738 $ref: '#/components/schemas/VideoPrivacy'
739 category:
740 description: Video category
741 type: string
742 licence:
743 description: Video licence
744 type: string
745 language:
746 description: Video language
747 type: string
748 description:
749 description: Video description
750 type: string
751 waitTranscoding:
752 description: Whether or not we wait transcoding before publish the video
753 type: string
754 support:
755 description: Text describing how to support the video uploader
756 type: string
757 nsfw:
758 description: Whether or not this video contains sensitive content
759 type: string
760 name:
761 description: Video name
762 type: string
763 tags:
764 description: Video tags
765 type: string
766 commentsEnabled:
767 description: Enable or disable comments for this video
768 type: string
769 scheduleUpdate: *ref_0
770 required:
771 - videofile
772 - channelId
773 - name
774 x-code-samples:
775 - lang: Shell
776 source: |
777 ## DEPENDENCIES: httpie, jq
778 # pip install httpie
779 USERNAME="<your_username>"
780 PASSWORD="<your_password>"
781 FILE_PATH="<your_file_path>"
782 CHANNEL_ID="<your_channel_id>"
783 NAME="<video_name>"
784
785 API_PATH="https://peertube2.cpy.re/api/v1"
786 ## AUTH
787 client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
788 client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
789 token=$(http -b --form POST "$API_PATH/users/token" \
790 client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
791 username=$USERNAME \
792 password=$PASSWORD \
793 | jq -r ".access_token")
794 ## VIDEO UPLOAD
795 http -b --form POST "$API_PATH/videos/upload" \
796 videofile@$FILE_PATH \
797 channelId=$CHANNEL_ID \
798 name=$NAME \
799 "Authorization:Bearer $token"
800 /videos/abuse:
801 get:
802 summary: Get list of reported video abuses
803 security:
804 - OAuth2: []
805 tags:
806 - VideoAbuse
807 parameters:
808 - $ref: '#/components/parameters/start'
809 - $ref: '#/components/parameters/count'
810 - $ref: '#/components/parameters/sort'
811 responses:
812 '200':
813 description: successful operation
814 content:
815 application/json:
816 schema:
817 type: array
818 items:
819 $ref: '#/components/schemas/VideoAbuse'
820 '/videos/{id}/abuse':
821 post:
822 summary: 'Report an abuse, on a video by its id'
823 security:
824 - OAuth2: []
825 tags:
826 - VideoAbuse
827 parameters:
828 - $ref: '#/components/parameters/id2'
829 responses:
830 '204':
831 $ref: '#/paths/~1users~1me/put/responses/204'
832 '/videos/{id}/blacklist':
833 post:
834 summary: Put on blacklist a video by its id
835 security:
836 - OAuth2:
837 - admin
838 - moderator
839 tags:
840 - VideoBlacklist
841 parameters:
842 - $ref: '#/components/parameters/id2'
843 responses:
844 '204':
845 $ref: '#/paths/~1users~1me/put/responses/204'
846 delete:
847 summary: Delete an entry of the blacklist of a video by its id
848 security:
849 - OAuth2:
850 - admin
851 - moderator
852 tags:
853 - VideoBlacklist
854 parameters:
855 - $ref: '#/components/parameters/id2'
856 responses:
857 '204':
858 $ref: '#/paths/~1users~1me/put/responses/204'
859 /videos/blacklist:
860 get:
861 summary: Get list of videos on blacklist
862 security:
863 - OAuth2:
864 - admin
865 - moderator
866 tags:
867 - VideoBlacklist
868 parameters:
869 - $ref: '#/components/parameters/start'
870 - $ref: '#/components/parameters/count'
871 - $ref: '#/components/parameters/sort'
872 responses:
873 '200':
874 description: successful operation
875 content:
876 application/json:
877 schema:
878 type: array
879 items:
880 $ref: '#/components/schemas/VideoBlacklist'
881 /video-channels:
882 get:
883 summary: Get list of video channels
884 tags:
885 - VideoChannel
886 parameters:
887 - $ref: '#/components/parameters/start'
888 - $ref: '#/components/parameters/count'
889 - $ref: '#/components/parameters/sort'
890 responses:
891 '200':
892 description: successful operation
893 content:
894 application/json:
895 schema:
896 type: array
897 items:
898 $ref: '#/components/schemas/VideoChannel'
899 post:
900 summary: Creates a video channel for the current user
901 security:
902 - OAuth2: []
903 tags:
904 - VideoChannel
905 responses:
906 '204':
907 $ref: '#/paths/~1users~1me/put/responses/204'
908 requestBody:
909 $ref: '#/components/requestBodies/VideoChannelInput'
910 '/video-channels/{id}':
911 get:
912 summary: Get a video channel by its id
913 tags:
914 - VideoChannel
915 parameters:
916 - $ref: '#/components/parameters/id3'
917 responses:
918 '200':
919 description: successful operation
920 content:
921 application/json:
922 schema:
923 $ref: '#/components/schemas/VideoChannel'
924 put:
925 summary: Update a video channel by its id
926 security:
927 - OAuth2: []
928 tags:
929 - VideoChannel
930 parameters:
931 - $ref: '#/components/parameters/id3'
932 responses:
933 '204':
934 $ref: '#/paths/~1users~1me/put/responses/204'
935 requestBody:
936 $ref: '#/components/requestBodies/VideoChannelInput'
937 delete:
938 summary: Delete a video channel by its id
939 security:
940 - OAuth2: []
941 tags:
942 - VideoChannel
943 parameters:
944 - $ref: '#/components/parameters/id3'
945 responses:
946 '204':
947 $ref: '#/paths/~1users~1me/put/responses/204'
948 '/video-channels/{id}/videos':
949 get:
950 summary: Get videos of a video channel by its id
951 tags:
952 - VideoChannel
953 parameters:
954 - $ref: '#/components/parameters/id3'
955 responses:
956 '200':
957 description: successful operation
958 content:
959 application/json:
960 schema:
961 $ref: '#/components/schemas/Video'
962 '/accounts/{name}/video-channels':
963 get:
964 summary: Get video channels of an account by its name
965 tags:
966 - VideoChannel
967 parameters:
968 - $ref: '#/components/parameters/name'
969 responses:
970 '200':
971 description: successful operation
972 content:
973 application/json:
974 schema:
975 type: array
976 items:
977 $ref: '#/components/schemas/VideoChannel'
978 '/videos/{id}/comment-threads':
979 get:
980 summary: Get the comment threads of a video by its id
981 tags:
982 - VideoComment
983 parameters:
984 - $ref: '#/components/parameters/id2'
985 - $ref: '#/components/parameters/start'
986 - $ref: '#/components/parameters/count'
987 - $ref: '#/components/parameters/sort'
988 responses:
989 '200':
990 description: successful operation
991 content:
992 application/json:
993 schema:
994 $ref: '#/components/schemas/CommentThreadResponse'
995 post:
996 summary: 'Creates a comment thread, on a video by its id'
997 security:
998 - OAuth2: []
999 tags:
1000 - VideoComment
1001 parameters:
1002 - $ref: '#/components/parameters/id2'
1003 responses:
1004 '200':
1005 description: successful operation
1006 content:
1007 application/json:
1008 schema:
1009 $ref: '#/components/schemas/CommentThreadPostResponse'
1010 '/videos/{id}/comment-threads/{threadId}':
1011 get:
1012 summary: 'Get the comment thread by its id, of a video by its id'
1013 tags:
1014 - VideoComment
1015 parameters:
1016 - $ref: '#/components/parameters/id2'
1017 - name: threadId
1018 in: path
1019 required: true
1020 description: The thread id (root comment id)
1021 schema:
1022 type: number
1023 responses:
1024 '200':
1025 description: successful operation
1026 content:
1027 application/json:
1028 schema:
1029 $ref: '#/components/schemas/VideoCommentThreadTree'
1030 '/videos/{id}/comments/{commentId}':
1031 post:
1032 summary: 'Creates a comment in a comment thread by its id, of a video by its id'
1033 security:
1034 - OAuth2: []
1035 tags:
1036 - VideoComment
1037 parameters:
1038 - $ref: '#/components/parameters/id2'
1039 - $ref: '#/components/parameters/commentId'
1040 responses:
1041 '200':
1042 description: successful operation
1043 content:
1044 application/json:
1045 schema:
1046 $ref: '#/components/schemas/CommentThreadPostResponse'
1047 delete:
1048 summary: 'Delete a comment in a comment therad by its id, of a video by its id'
1049 security:
1050 - OAuth2: []
1051 tags:
1052 - VideoComment
1053 parameters:
1054 - $ref: '#/components/parameters/id2'
1055 - $ref: '#/components/parameters/commentId'
1056 responses:
1057 '204':
1058 $ref: '#/paths/~1users~1me/put/responses/204'
1059 '/videos/{id}/rate':
1060 put:
1061 summary: Vote for a video by its id
1062 security:
1063 - OAuth2: []
1064 tags:
1065 - VideoRate
1066 parameters:
1067 - $ref: '#/components/parameters/id2'
1068 responses:
1069 '204':
1070 $ref: '#/paths/~1users~1me/put/responses/204'
1071 /search/videos:
1072 get:
1073 tags:
1074 - Search
1075 summary: Get the videos corresponding to a given query
1076 parameters:
1077 - $ref: '#/components/parameters/start'
1078 - $ref: '#/components/parameters/count'
1079 - $ref: '#/components/parameters/sort'
1080 - name: search
1081 in: query
1082 required: true
1083 description: String to search
1084 schema:
1085 type: string
1086 responses:
1087 '200':
1088 description: successful operation
1089 content:
1090 application/json:
1091 schema:
1092 type: array
1093 items:
1094 $ref: '#/components/schemas/Video'
1095 servers:
1096 - url: 'https://peertube2.cpy.re/api/v1'
1097 description: Live Server
1098 components:
1099 parameters:
1100 start:
1101 name: start
1102 in: query
1103 required: false
1104 description: Offset
1105 schema:
1106 type: number
1107 count:
1108 name: count
1109 in: query
1110 required: false
1111 description: Number of items
1112 schema:
1113 type: number
1114 sort:
1115 name: sort
1116 in: query
1117 required: false
1118 description: Sort column (-createdAt for example)
1119 schema:
1120 type: string
1121 name:
1122 name: name
1123 in: path
1124 required: true
1125 description: >-
1126 The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
1127 example)
1128 schema:
1129 type: string
1130 id:
1131 name: id
1132 in: path
1133 required: true
1134 description: The user id
1135 schema:
1136 type: number
1137 id2:
1138 name: id
1139 in: path
1140 required: true
1141 description: The video id or uuid
1142 schema:
1143 type: string
1144 id3:
1145 name: id
1146 in: path
1147 required: true
1148 description: The video channel id or uuid
1149 schema:
1150 type: string
1151 commentId:
1152 name: threadId
1153 in: path
1154 required: true
1155 description: The comment id
1156 schema:
1157 type: number
1158 requestBodies:
1159 VideoChannelInput:
1160 content:
1161 application/json:
1162 schema:
1163 $ref: '#/components/schemas/VideoChannelInput'
1164 securitySchemes:
1165 OAuth2:
1166 description: >
1167 In the header: *Authorization: Bearer <token\>*
1168
1169
1170 Authenticating via OAuth requires the following steps:
1171
1172
1173 - Have an account with sufficient authorization levels
1174
1175 - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a
1176 Bearer Token
1177
1178 - Make Authenticated Requests
1179 type: oauth2
1180 flows:
1181 password:
1182 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
1183 scopes:
1184 admin: Admin scope
1185 moderator: Moderator scope
1186 user: User scope
1187 schemas:
1188 VideoConstantNumber:
1189 properties:
1190 id:
1191 type: number
1192 label:
1193 type: string
1194 VideoConstantString:
1195 properties:
1196 id:
1197 type: string
1198 label:
1199 type: string
1200 VideoPrivacy:
1201 type: string
1202 enum:
1203 - Public
1204 - Unlisted
1205 - Private
1206 Video:
1207 properties:
1208 id:
1209 type: number
1210 uuid:
1211 type: string
1212 createdAt:
1213 type: string
1214 publishedAt:
1215 type: string
1216 updatedAt:
1217 type: string
1218 category:
1219 $ref: '#/components/schemas/VideoConstantNumber'
1220 licence:
1221 $ref: '#/components/schemas/VideoConstantNumber'
1222 language:
1223 $ref: '#/components/schemas/VideoConstantString'
1224 privacy:
1225 $ref: '#/components/schemas/VideoPrivacy'
1226 description:
1227 type: string
1228 duration:
1229 type: number
1230 isLocal:
1231 type: boolean
1232 name:
1233 type: string
1234 thumbnailPath:
1235 type: string
1236 previewPath:
1237 type: string
1238 embedPath:
1239 type: string
1240 views:
1241 type: number
1242 likes:
1243 type: number
1244 dislikes:
1245 type: number
1246 nsfw:
1247 type: boolean
1248 account:
1249 type: object
1250 properties:
1251 name:
1252 type: string
1253 displayName:
1254 type: string
1255 url:
1256 type: string
1257 host:
1258 type: string
1259 avatar:
1260 $ref: '#/components/schemas/Avatar'
1261 VideoAbuse:
1262 properties:
1263 id:
1264 type: number
1265 reason:
1266 type: string
1267 reporterAccount:
1268 $ref: '#/components/schemas/Account'
1269 video:
1270 type: object
1271 properties:
1272 id:
1273 type: number
1274 name:
1275 type: string
1276 uuid:
1277 type: string
1278 url:
1279 type: string
1280 createdAt:
1281 type: string
1282 VideoBlacklist:
1283 properties:
1284 id:
1285 type: number
1286 videoId:
1287 type: number
1288 createdAt:
1289 type: string
1290 updatedAt:
1291 type: string
1292 name:
1293 type: string
1294 uuid:
1295 type: string
1296 description:
1297 type: string
1298 duration:
1299 type: number
1300 views:
1301 type: number
1302 likes:
1303 type: number
1304 dislikes:
1305 type: number
1306 nsfw:
1307 type: boolean
1308 VideoChannel:
1309 properties:
1310 displayName:
1311 type: string
1312 description:
1313 type: string
1314 isLocal:
1315 type: boolean
1316 ownerAccount:
1317 type: object
1318 properties:
1319 id:
1320 type: number
1321 uuid:
1322 type: string
1323 VideoComment:
1324 properties:
1325 id:
1326 type: number
1327 url:
1328 type: string
1329 text:
1330 type: string
1331 threadId:
1332 type: number
1333 inReplyToCommentId:
1334 type: number
1335 videoId:
1336 type: number
1337 createdAt:
1338 type: string
1339 updatedAt:
1340 type: string
1341 totalReplies:
1342 type: number
1343 account:
1344 $ref: '#/components/schemas/Account'
1345 VideoCommentThreadTree:
1346 properties:
1347 comment:
1348 $ref: '#/components/schemas/VideoComment'
1349 children:
1350 type: array
1351 items:
1352 $ref: '#/components/schemas/VideoCommentThreadTree'
1353 Avatar:
1354 properties:
1355 path:
1356 type: string
1357 createdAt:
1358 type: string
1359 updatedAt:
1360 type: string
1361 Actor:
1362 properties:
1363 id:
1364 type: number
1365 uuid:
1366 type: string
1367 url:
1368 type: string
1369 name:
1370 type: string
1371 host:
1372 type: string
1373 followingCount:
1374 type: number
1375 followersCount:
1376 type: number
1377 createdAt:
1378 type: string
1379 updatedAt:
1380 type: string
1381 avatar:
1382 $ref: '#/components/schemas/Avatar'
1383 Account:
1384 allOf:
1385 - $ref: '#/components/schemas/Actor'
1386 - properties:
1387 displayName:
1388 type: string
1389 User:
1390 properties:
1391 id:
1392 type: number
1393 username:
1394 type: string
1395 email:
1396 type: string
1397 displayNSFW:
1398 type: boolean
1399 autoPlayVideo:
1400 type: boolean
1401 role:
1402 type: string
1403 enum:
1404 - User
1405 - Moderator
1406 - Administrator
1407 videoQuota:
1408 type: number
1409 createdAt:
1410 type: string
1411 account:
1412 $ref: '#/components/schemas/Account'
1413 videoChannels:
1414 type: array
1415 items:
1416 $ref: '#/components/schemas/VideoChannel'
1417 ServerConfig:
1418 properties:
1419 signup:
1420 type: object
1421 properties:
1422 allowed:
1423 type: boolean
1424 transcoding:
1425 type: object
1426 properties:
1427 enabledResolutions:
1428 type: array
1429 items:
1430 type: number
1431 avatar:
1432 type: object
1433 properties:
1434 file:
1435 type: object
1436 properties:
1437 size:
1438 type: object
1439 properties:
1440 max:
1441 type: number
1442 extensions:
1443 type: array
1444 items:
1445 type: string
1446 video:
1447 type: object
1448 properties:
1449 file:
1450 type: object
1451 properties:
1452 extensions:
1453 type: array
1454 items:
1455 type: string
1456 Follow:
1457 properties:
1458 id:
1459 type: number
1460 follower:
1461 $ref: '#/components/schemas/Actor'
1462 following:
1463 $ref: '#/components/schemas/Actor'
1464 score:
1465 type: number
1466 state:
1467 type: string
1468 enum:
1469 - pending
1470 - accepted
1471 createdAt:
1472 type: string
1473 updatedAt:
1474 type: string
1475 Job:
1476 properties:
1477 id:
1478 type: number
1479 state:
1480 type: string
1481 enum:
1482 - pending
1483 - processing
1484 - error
1485 - success
1486 category:
1487 type: string
1488 enum:
1489 - transcoding
1490 - activitypub-http
1491 handlerName:
1492 type: string
1493 handlerInputData:
1494 type: string
1495 createdAt:
1496 type: string
1497 updatedAt:
1498 type: string
1499 AddUserResponse:
1500 properties:
1501 id:
1502 type: number
1503 uuid:
1504 type: string
1505 VideoUploadResponse:
1506 properties:
1507 video:
1508 type: object
1509 properties:
1510 id:
1511 type: number
1512 uuid:
1513 type: string
1514 CommentThreadResponse:
1515 properties:
1516 total:
1517 type: number
1518 data:
1519 type: array
1520 items:
1521 $ref: '#/components/schemas/VideoComment'
1522 CommentThreadPostResponse:
1523 properties:
1524 comment:
1525 $ref: '#/components/schemas/VideoComment'
1526 AddUser:
1527 properties:
1528 username:
1529 type: string
1530 description: 'The user username '
1531 password:
1532 type: string
1533 description: 'The user password '
1534 email:
1535 type: string
1536 description: 'The user email '
1537 videoQuota:
1538 type: string
1539 description: 'The user videoQuota '
1540 role:
1541 type: string
1542 description: 'The user role '
1543 required:
1544 - username
1545 - password
1546 - email
1547 - videoQuota
1548 - role
1549 UpdateUser:
1550 properties:
1551 id:
1552 type: string
1553 description: 'The user id '
1554 email:
1555 type: string
1556 description: 'The updated email of the user '
1557 videoQuota:
1558 type: string
1559 description: 'The updated videoQuota of the user '
1560 role:
1561 type: string
1562 description: 'The updated role of the user '
1563 required:
1564 - id
1565 - email
1566 - videoQuota
1567 - role
1568 UpdateMe:
1569 properties:
1570 password:
1571 type: string
1572 description: 'Your new password '
1573 email:
1574 type: string
1575 description: 'Your new email '
1576 displayNSFW:
1577 type: string
1578 description: 'Your new displayNSFW '
1579 autoPlayVideo:
1580 type: string
1581 description: 'Your new autoPlayVideo '
1582 required:
1583 - password
1584 - email
1585 - displayNSFW
1586 - autoPlayVideo
1587 GetMeVideoRating:
1588 properties:
1589 id:
1590 type: string
1591 description: 'Id of the video '
1592 rating:
1593 type: number
1594 description: 'Rating of the video '
1595 required:
1596 - id
1597 - rating
1598 RegisterUser:
1599 properties:
1600 username:
1601 type: string
1602 description: 'The username of the user '
1603 password:
1604 type: string
1605 description: 'The password of the user '
1606 email:
1607 type: string
1608 description: 'The email of the user '
1609 required:
1610 - username
1611 - password
1612 - email
1613 VideoChannelInput:
1614 properties:
1615 name:
1616 type: string
1617 description:
1618 type: string
1619