aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-21 12:09:54 +0200
committerChocobozzz <me@florianbigard.com>2020-04-21 12:19:00 +0200
commitb029d58a273ddbb1b17271fb8cae61d09a790005 (patch)
treeb43101dabbe8574cc250b67736717be0641f4c33
parent512decf37ee6d36d0f16bda0f9bec6bf37d132b3 (diff)
downloadPeerTube-b029d58a273ddbb1b17271fb8cae61d09a790005.tar.gz
PeerTube-b029d58a273ddbb1b17271fb8cae61d09a790005.tar.zst
PeerTube-b029d58a273ddbb1b17271fb8cae61d09a790005.zip
Openapi consistency
-rw-r--r--support/doc/api/openapi.yaml359
1 files changed, 185 insertions, 174 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index 28c97f2c8..68c65b5a9 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -14,14 +14,14 @@ info:
14 description: | 14 description: |
15 # Introduction 15 # Introduction
16 16
17 The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable 17 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite
18 resource URLs. It returns HTTP response codes to indicate errors. It also
19 accepts and returns JSON in the HTTP body. You can use your favorite
20 HTTP/REST library for your programming language to use PeerTube. No official 18 HTTP/REST library for your programming language to use PeerTube. No official
21 SDK is currently provided, but the spec API is fully compatible with 19 SDK is currently provided, but the spec API is fully compatible with
22 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO) 20 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
23 which generates a client SDK in the language of your choice. 21 which generates a client SDK in the language of your choice.
24 22
23 See the [Quick Start guide](https://docs.joinpeertube.org/#/api-rest-getting-started) so you can play with the PeerTube API.
24
25 # Authentication 25 # Authentication
26 26
27 When you sign up for an account, you are given the possibility to generate 27 When you sign up for an account, you are given the possibility to generate
@@ -56,7 +56,7 @@ tags:
56 description: > 56 description: >
57 Jobs are long-running tasks enqueued and processed by the instance 57 Jobs are long-running tasks enqueued and processed by the instance
58 itself. No additional worker registration is currently available. 58 itself. No additional worker registration is currently available.
59 - name: Server Following 59 - name: Instance Follows
60 description: > 60 description: >
61 Managing servers which the instance interacts with is crucial to the 61 Managing servers which the instance interacts with is crucial to the
62 concept of federation in PeerTube and external video indexation. The PeerTube 62 concept of federation in PeerTube and external video indexation. The PeerTube
@@ -75,15 +75,15 @@ tags:
75 Videos from other instances federated by the instance (that is, instances 75 Videos from other instances federated by the instance (that is, instances
76 followed by the instance) can be found via keywords and other criteria of 76 followed by the instance) can be found via keywords and other criteria of
77 the advanced search. 77 the advanced search.
78 - name: Video Comment 78 - name: Video Comments
79 description: > 79 description: >
80 Operations dealing with comments to a video. Comments are organized in 80 Operations dealing with comments to a video. Comments are organized in
81 threads. 81 threads.
82 - name: Video Playlist 82 - name: Video Playlists
83 description: > 83 description: >
84 Operations dealing with playlists of videos. Playlists are bound to users 84 Operations dealing with playlists of videos. Playlists are bound to users
85 and/or channels. 85 and/or channels.
86 - name: Video Channel 86 - name: Video Channels
87 description: > 87 description: >
88 Operations dealing with creation, modification and video listing of a 88 Operations dealing with creation, modification and video listing of a
89 user's channels. 89 user's channels.
@@ -91,23 +91,29 @@ tags:
91 description: > 91 description: >
92 Operations dealing with blacklisting videos (removing them from view and 92 Operations dealing with blacklisting videos (removing them from view and
93 preventing interactions). 93 preventing interactions).
94 - name: Video Rate 94 - name: Video Rates
95 description: > 95 description: >
96 Voting for a video. 96 Like/dislike a video.
97x-tagGroups: 97x-tagGroups:
98 - name: Accounts 98 - name: Accounts
99 tags: 99 tags:
100 - Accounts 100 - Accounts
101 - User 101 - Users
102 - My User 102 - My User
103 - My Subscriptions
103 - name: Videos 104 - name: Videos
104 tags: 105 tags:
105 - Video 106 - Video
106 - Video Caption 107 - Video Caption
107 - Video Channel 108 - Video Channels
108 - Video Comment 109 - Video Comments
109 - Video Following 110 - Video Following
110 - Video Rate 111 - Video Rates
112 - Video Playlists
113 - Video Ownership Change
114 - name: Search
115 tags:
116 - Search
111 - name: Moderation 117 - name: Moderation
112 tags: 118 tags:
113 - Video Abuse 119 - Video Abuse
@@ -115,19 +121,16 @@ x-tagGroups:
115 - name: Instance Configuration 121 - name: Instance Configuration
116 tags: 122 tags:
117 - Config 123 - Config
118 - Server Following 124 - Instance Follows
119 - name: Jobs 125 - name: Jobs
120 tags: 126 tags:
121 - Job 127 - Job
122 - name: Search
123 tags:
124 - Search
125paths: 128paths:
126 '/accounts/{name}': 129 '/accounts/{name}':
127 get: 130 get:
128 tags: 131 tags:
129 - Accounts 132 - Accounts
130 summary: Get the account by name 133 summary: Get an account
131 parameters: 134 parameters:
132 - $ref: '#/components/parameters/name' 135 - $ref: '#/components/parameters/name'
133 responses: 136 responses:
@@ -142,7 +145,7 @@ paths:
142 tags: 145 tags:
143 - Accounts 146 - Accounts
144 - Video 147 - Video
145 summary: 'Get videos for an account, provided the name of that account' 148 summary: 'List videos of an account'
146 parameters: 149 parameters:
147 - $ref: '#/components/parameters/name' 150 - $ref: '#/components/parameters/name'
148 responses: 151 responses:
@@ -190,7 +193,7 @@ paths:
190 get: 193 get:
191 tags: 194 tags:
192 - Accounts 195 - Accounts
193 summary: Get all accounts 196 summary: List accounts
194 parameters: 197 parameters:
195 - $ref: '#/components/parameters/start' 198 - $ref: '#/components/parameters/start'
196 - $ref: '#/components/parameters/count' 199 - $ref: '#/components/parameters/count'
@@ -208,7 +211,7 @@ paths:
208 get: 211 get:
209 tags: 212 tags:
210 - Config 213 - Config
211 summary: Get the public configuration of the server 214 summary: Get instance public configuration
212 responses: 215 responses:
213 '200': 216 '200':
214 description: successful operation 217 description: successful operation
@@ -218,7 +221,7 @@ paths:
218 $ref: '#/components/schemas/ServerConfig' 221 $ref: '#/components/schemas/ServerConfig'
219 /config/about: 222 /config/about:
220 get: 223 get:
221 summary: Get the instance about page content 224 summary: Get instance "About" information
222 tags: 225 tags:
223 - Config 226 - Config
224 responses: 227 responses:
@@ -230,7 +233,7 @@ paths:
230 $ref: '#/components/schemas/ServerConfigAbout' 233 $ref: '#/components/schemas/ServerConfigAbout'
231 /config/custom: 234 /config/custom:
232 get: 235 get:
233 summary: Get the runtime configuration of the server 236 summary: Get instance runtime configuration
234 tags: 237 tags:
235 - Config 238 - Config
236 security: 239 security:
@@ -244,7 +247,7 @@ paths:
244 schema: 247 schema:
245 $ref: '#/components/schemas/ServerConfigCustom' 248 $ref: '#/components/schemas/ServerConfigCustom'
246 put: 249 put:
247 summary: Set the runtime configuration of the server 250 summary: Set instance runtime configuration
248 tags: 251 tags:
249 - Config 252 - Config
250 security: 253 security:
@@ -254,7 +257,7 @@ paths:
254 '200': 257 '200':
255 description: successful operation 258 description: successful operation
256 delete: 259 delete:
257 summary: Delete the runtime configuration of the server 260 summary: Delete instance runtime configuration
258 tags: 261 tags:
259 - Config 262 - Config
260 security: 263 security:
@@ -265,7 +268,7 @@ paths:
265 description: successful operation 268 description: successful operation
266 /jobs/{state}: 269 /jobs/{state}:
267 get: 270 get:
268 summary: Get list of jobs 271 summary: List instance jobs
269 security: 272 security:
270 - OAuth2: 273 - OAuth2:
271 - admin 274 - admin
@@ -302,8 +305,8 @@ paths:
302 - OAuth2: 305 - OAuth2:
303 - admin 306 - admin
304 tags: 307 tags:
305 - Server Following 308 - Instance Follows
306 summary: Unfollow a server by hostname 309 summary: Unfollow a server
307 parameters: 310 parameters:
308 - name: host 311 - name: host
309 in: path 312 in: path
@@ -317,8 +320,8 @@ paths:
317 /server/followers: 320 /server/followers:
318 get: 321 get:
319 tags: 322 tags:
320 - Server Following 323 - Instance Follows
321 summary: Get followers of the server 324 summary: List instance followers
322 parameters: 325 parameters:
323 - $ref: '#/components/parameters/start' 326 - $ref: '#/components/parameters/start'
324 - $ref: '#/components/parameters/count' 327 - $ref: '#/components/parameters/count'
@@ -335,8 +338,8 @@ paths:
335 /server/following: 338 /server/following:
336 get: 339 get:
337 tags: 340 tags:
338 - Server Following 341 - Instance Follows
339 summary: Get servers followed by the server 342 summary: List instance followings
340 parameters: 343 parameters:
341 - $ref: '#/components/parameters/start' 344 - $ref: '#/components/parameters/start'
342 - $ref: '#/components/parameters/count' 345 - $ref: '#/components/parameters/count'
@@ -355,7 +358,7 @@ paths:
355 - OAuth2: 358 - OAuth2:
356 - admin 359 - admin
357 tags: 360 tags:
358 - Server Following 361 - Instance Follows
359 summary: Follow a server 362 summary: Follow a server
360 responses: 363 responses:
361 '204': 364 '204':
@@ -367,12 +370,12 @@ paths:
367 $ref: '#/components/schemas/Follow' 370 $ref: '#/components/schemas/Follow'
368 /users: 371 /users:
369 post: 372 post:
370 summary: Creates user 373 summary: Create a user
371 security: 374 security:
372 - OAuth2: 375 - OAuth2:
373 - admin 376 - admin
374 tags: 377 tags:
375 - User 378 - Users
376 responses: 379 responses:
377 '200': 380 '200':
378 description: successful operation 381 description: successful operation
@@ -388,11 +391,11 @@ paths:
388 description: User to create 391 description: User to create
389 required: true 392 required: true
390 get: 393 get:
391 summary: Get a list of users 394 summary: List users
392 security: 395 security:
393 - OAuth2: [] 396 - OAuth2: []
394 tags: 397 tags:
395 - User 398 - Users
396 parameters: 399 parameters:
397 - $ref: '#/components/parameters/start' 400 - $ref: '#/components/parameters/start'
398 - $ref: '#/components/parameters/count' 401 - $ref: '#/components/parameters/count'
@@ -408,23 +411,23 @@ paths:
408 $ref: '#/components/schemas/User' 411 $ref: '#/components/schemas/User'
409 '/users/{id}': 412 '/users/{id}':
410 delete: 413 delete:
411 summary: Delete a user by its id 414 summary: Delete a user
412 security: 415 security:
413 - OAuth2: 416 - OAuth2:
414 - admin 417 - admin
415 tags: 418 tags:
416 - User 419 - Users
417 parameters: 420 parameters:
418 - $ref: '#/components/parameters/id' 421 - $ref: '#/components/parameters/id'
419 responses: 422 responses:
420 '204': 423 '204':
421 $ref: '#/paths/~1users~1me/put/responses/204' 424 $ref: '#/paths/~1users~1me/put/responses/204'
422 get: 425 get:
423 summary: Get user by its id 426 summary: Get a user
424 security: 427 security:
425 - OAuth2: [] 428 - OAuth2: []
426 tags: 429 tags:
427 - User 430 - Users
428 parameters: 431 parameters:
429 - $ref: '#/components/parameters/id' 432 - $ref: '#/components/parameters/id'
430 responses: 433 responses:
@@ -435,11 +438,11 @@ paths:
435 schema: 438 schema:
436 $ref: '#/components/schemas/User' 439 $ref: '#/components/schemas/User'
437 put: 440 put:
438 summary: Update user profile by its id 441 summary: Update a user
439 security: 442 security:
440 - OAuth2: [] 443 - OAuth2: []
441 tags: 444 tags:
442 - User 445 - Users
443 parameters: 446 parameters:
444 - $ref: '#/components/parameters/id' 447 - $ref: '#/components/parameters/id'
445 responses: 448 responses:
@@ -455,7 +458,7 @@ paths:
455 post: 458 post:
456 summary: Register a user 459 summary: Register a user
457 tags: 460 tags:
458 - User 461 - Users
459 responses: 462 responses:
460 '204': 463 '204':
461 $ref: '#/paths/~1users~1me/put/responses/204' 464 $ref: '#/paths/~1users~1me/put/responses/204'
@@ -467,7 +470,7 @@ paths:
467 required: true 470 required: true
468 /users/me: 471 /users/me:
469 get: 472 get:
470 summary: Get current user information 473 summary: Get my user information
471 security: 474 security:
472 - OAuth2: 475 - OAuth2:
473 - user 476 - user
@@ -483,7 +486,7 @@ paths:
483 items: 486 items:
484 $ref: '#/components/schemas/User' 487 $ref: '#/components/schemas/User'
485 put: 488 put:
486 summary: Update current user information 489 summary: Update my user information
487 security: 490 security:
488 - OAuth2: 491 - OAuth2:
489 - user 492 - user
@@ -500,11 +503,12 @@ paths:
500 required: true 503 required: true
501 /users/me/videos/imports: 504 /users/me/videos/imports:
502 get: 505 get:
503 summary: Get video imports of current user 506 summary: Get video imports of my user
504 security: 507 security:
505 - OAuth2: 508 - OAuth2:
506 - user 509 - user
507 tags: 510 tags:
511 - Videos
508 - My User 512 - My User
509 parameters: 513 parameters:
510 - $ref: '#/components/parameters/start' 514 - $ref: '#/components/parameters/start'
@@ -519,7 +523,7 @@ paths:
519 $ref: '#/components/schemas/VideoImport' 523 $ref: '#/components/schemas/VideoImport'
520 /users/me/video-quota-used: 524 /users/me/video-quota-used:
521 get: 525 get:
522 summary: Get current user used quota 526 summary: Get my user used quota
523 security: 527 security:
524 - OAuth2: 528 - OAuth2:
525 - user 529 - user
@@ -534,11 +538,12 @@ paths:
534 type: number 538 type: number
535 '/users/me/videos/{videoId}/rating': 539 '/users/me/videos/{videoId}/rating':
536 get: 540 get:
537 summary: 'Get rating of video by its id, among those of the current user' 541 summary: Get rate of my user of a video
538 security: 542 security:
539 - OAuth2: [] 543 - OAuth2: []
540 tags: 544 tags:
541 - My User 545 - My User
546 - Video Rates
542 parameters: 547 parameters:
543 - name: videoId 548 - name: videoId
544 in: path 549 in: path
@@ -555,12 +560,13 @@ paths:
555 $ref: '#/components/schemas/GetMeVideoRating' 560 $ref: '#/components/schemas/GetMeVideoRating'
556 /users/me/videos: 561 /users/me/videos:
557 get: 562 get:
558 summary: Get videos of the current user 563 summary: Get videos of my user
559 security: 564 security:
560 - OAuth2: 565 - OAuth2:
561 - user 566 - user
562 tags: 567 tags:
563 - My User 568 - My User
569 - Videos
564 parameters: 570 parameters:
565 - $ref: '#/components/parameters/start' 571 - $ref: '#/components/parameters/start'
566 - $ref: '#/components/parameters/count' 572 - $ref: '#/components/parameters/count'
@@ -574,12 +580,12 @@ paths:
574 $ref: '#/components/schemas/VideoListResponse' 580 $ref: '#/components/schemas/VideoListResponse'
575 /users/me/subscriptions: 581 /users/me/subscriptions:
576 get: 582 get:
577 summary: Get subscriptions of the current user 583 summary: Get my user subscriptions
578 security: 584 security:
579 - OAuth2: 585 - OAuth2:
580 - user 586 - user
581 tags: 587 tags:
582 - My User 588 - My Subscriptions
583 parameters: 589 parameters:
584 - $ref: '#/components/parameters/start' 590 - $ref: '#/components/parameters/start'
585 - $ref: '#/components/parameters/count' 591 - $ref: '#/components/parameters/count'
@@ -588,23 +594,23 @@ paths:
588 '200': 594 '200':
589 description: successful operation 595 description: successful operation
590 post: 596 post:
591 summary: Add subscription to the current user 597 summary: Add subscription to my user
592 security: 598 security:
593 - OAuth2: 599 - OAuth2:
594 - user 600 - user
595 tags: 601 tags:
596 - My User 602 - My Subscriptions
597 responses: 603 responses:
598 '200': 604 '200':
599 description: successful operation 605 description: successful operation
600 /users/me/subscriptions/exist: 606 /users/me/subscriptions/exist:
601 get: 607 get:
602 summary: Get if subscriptions exist for the current user 608 summary: Get if subscriptions exist for my user
603 security: 609 security:
604 - OAuth2: 610 - OAuth2:
605 - user 611 - user
606 tags: 612 tags:
607 - My User 613 - My Subscriptions
608 parameters: 614 parameters:
609 - $ref: '#/components/parameters/subscriptionsUris' 615 - $ref: '#/components/parameters/subscriptionsUris'
610 responses: 616 responses:
@@ -616,12 +622,13 @@ paths:
616 type: object 622 type: object
617 /users/me/subscriptions/videos: 623 /users/me/subscriptions/videos:
618 get: 624 get:
619 summary: Get videos of subscriptions of the current user 625 summary: List videos of subscriptions of my user
620 security: 626 security:
621 - OAuth2: 627 - OAuth2:
622 - user 628 - user
623 tags: 629 tags:
624 - My User 630 - My Subscriptions
631 - Videos
625 parameters: 632 parameters:
626 - $ref: '#/components/parameters/start' 633 - $ref: '#/components/parameters/start'
627 - $ref: '#/components/parameters/count' 634 - $ref: '#/components/parameters/count'
@@ -635,12 +642,12 @@ paths:
635 $ref: '#/components/schemas/VideoListResponse' 642 $ref: '#/components/schemas/VideoListResponse'
636 '/users/me/subscriptions/{subscriptionHandle}': 643 '/users/me/subscriptions/{subscriptionHandle}':
637 get: 644 get:
638 summary: Get subscription of the current user for a given uri 645 summary: Get subscription of my user
639 security: 646 security:
640 - OAuth2: 647 - OAuth2:
641 - user 648 - user
642 tags: 649 tags:
643 - My User 650 - My Subscriptions
644 parameters: 651 parameters:
645 - $ref: '#/components/parameters/subscriptionHandle' 652 - $ref: '#/components/parameters/subscriptionHandle'
646 responses: 653 responses:
@@ -651,12 +658,12 @@ paths:
651 schema: 658 schema:
652 $ref: '#/components/schemas/VideoChannel' 659 $ref: '#/components/schemas/VideoChannel'
653 delete: 660 delete:
654 summary: Delete subscription of the current user for a given uri 661 summary: Delete subscription of my user
655 security: 662 security:
656 - OAuth2: 663 - OAuth2:
657 - user 664 - user
658 tags: 665 tags:
659 - My User 666 - My Subscriptions
660 parameters: 667 parameters:
661 - $ref: '#/components/parameters/subscriptionHandle' 668 - $ref: '#/components/parameters/subscriptionHandle'
662 responses: 669 responses:
@@ -664,7 +671,7 @@ paths:
664 description: successful operation 671 description: successful operation
665 /users/me/avatar/pick: 672 /users/me/avatar/pick:
666 post: 673 post:
667 summary: Update current user avatar 674 summary: Update my user avatar
668 security: 675 security:
669 - OAuth2: [] 676 - OAuth2: []
670 tags: 677 tags:
@@ -689,9 +696,68 @@ paths:
689 encoding: 696 encoding:
690 avatarfile: 697 avatarfile:
691 contentType: image/png, image/jpeg 698 contentType: image/png, image/jpeg
699 /videos/ownership:
700 get:
701 summary: List video ownership changes
702 tags:
703 - Video Ownership Change
704 security:
705 - OAuth2: []
706 responses:
707 '200':
708 description: successful operation
709 '/videos/ownership/{id}/accept':
710 post:
711 summary: Accept ownership change request
712 tags:
713 - Video Ownership Change
714 security:
715 - OAuth2: []
716 parameters:
717 - $ref: '#/components/parameters/idOrUUID'
718 responses:
719 '204':
720 $ref: '#/paths/~1users~1me/put/responses/204'
721 '/videos/ownership/{id}/refuse':
722 post:
723 summary: Refuse ownership change request
724 tags:
725 - Video Ownership Change
726 security:
727 - OAuth2: []
728 parameters:
729 - $ref: '#/components/parameters/idOrUUID'
730 responses:
731 '204':
732 $ref: '#/paths/~1users~1me/put/responses/204'
733 '/videos/{id}/give-ownership':
734 post:
735 summary: Request ownership change
736 tags:
737 - Video Ownership Change
738 security:
739 - OAuth2: []
740 parameters:
741 - $ref: '#/components/parameters/idOrUUID'
742 requestBody:
743 required: true
744 content:
745 application/x-www-form-urlencoded:
746 schema:
747 type: object
748 properties:
749 username:
750 type: string
751 required:
752 - username
753 responses:
754 '204':
755 $ref: '#/paths/~1users~1me/put/responses/204'
756 '400':
757 description: 'Changing video ownership to a remote account is not supported yet'
692 /videos: 758 /videos:
693 get: 759 get:
694 summary: Get list of videos 760 summary: List videos
695 tags: 761 tags:
696 - Video 762 - Video
697 parameters: 763 parameters:
@@ -714,7 +780,7 @@ paths:
714 $ref: '#/components/schemas/VideoListResponse' 780 $ref: '#/components/schemas/VideoListResponse'
715 /videos/categories: 781 /videos/categories:
716 get: 782 get:
717 summary: Get list of video categories known by the server 783 summary: List available video categories
718 tags: 784 tags:
719 - Video 785 - Video
720 responses: 786 responses:
@@ -728,7 +794,7 @@ paths:
728 type: string 794 type: string
729 /videos/licences: 795 /videos/licences:
730 get: 796 get:
731 summary: Get list of video licences known by the server 797 summary: List available video licences
732 tags: 798 tags:
733 - Video 799 - Video
734 responses: 800 responses:
@@ -742,7 +808,7 @@ paths:
742 type: string 808 type: string
743 /videos/languages: 809 /videos/languages:
744 get: 810 get:
745 summary: Get list of languages known by the server 811 summary: List available video languages
746 tags: 812 tags:
747 - Video 813 - Video
748 responses: 814 responses:
@@ -756,7 +822,7 @@ paths:
756 type: string 822 type: string
757 /videos/privacies: 823 /videos/privacies:
758 get: 824 get:
759 summary: Get list of privacy policies supported by the server 825 summary: List available video privacies
760 tags: 826 tags:
761 - Video 827 - Video
762 responses: 828 responses:
@@ -770,7 +836,7 @@ paths:
770 type: string 836 type: string
771 '/videos/{id}': 837 '/videos/{id}':
772 put: 838 put:
773 summary: Update metadata for a video by its id 839 summary: Update a video
774 security: 840 security:
775 - OAuth2: [] 841 - OAuth2: []
776 tags: 842 tags:
@@ -842,7 +908,7 @@ paths:
842 previewfile: 908 previewfile:
843 contentType: image/jpeg 909 contentType: image/jpeg
844 get: 910 get:
845 summary: Get a video by its id 911 summary: Get a video
846 tags: 912 tags:
847 - Video 913 - Video
848 parameters: 914 parameters:
@@ -855,7 +921,7 @@ paths:
855 schema: 921 schema:
856 $ref: '#/components/schemas/VideoDetails' 922 $ref: '#/components/schemas/VideoDetails'
857 delete: 923 delete:
858 summary: Delete a video by its id 924 summary: Delete a video
859 security: 925 security:
860 - OAuth2: [] 926 - OAuth2: []
861 tags: 927 tags:
@@ -867,7 +933,7 @@ paths:
867 $ref: '#/paths/~1users~1me/put/responses/204' 933 $ref: '#/paths/~1users~1me/put/responses/204'
868 '/videos/{id}/description': 934 '/videos/{id}/description':
869 get: 935 get:
870 summary: Get a video description by its id 936 summary: Get complete video description
871 tags: 937 tags:
872 - Video 938 - Video
873 parameters: 939 parameters:
@@ -881,7 +947,7 @@ paths:
881 type: string 947 type: string
882 '/videos/{id}/views': 948 '/videos/{id}/views':
883 post: 949 post:
884 summary: Add a view to the video by its id 950 summary: Add a view to a video
885 tags: 951 tags:
886 - Video 952 - Video
887 parameters: 953 parameters:
@@ -891,7 +957,7 @@ paths:
891 $ref: '#/paths/~1users~1me/put/responses/204' 957 $ref: '#/paths/~1users~1me/put/responses/204'
892 '/videos/{id}/watching': 958 '/videos/{id}/watching':
893 put: 959 put:
894 summary: Set watching progress of a video by its id for a user 960 summary: Set watching progress of a video
895 tags: 961 tags:
896 - Video 962 - Video
897 security: 963 security:
@@ -907,68 +973,9 @@ paths:
907 responses: 973 responses:
908 '204': 974 '204':
909 $ref: '#/paths/~1users~1me/put/responses/204' 975 $ref: '#/paths/~1users~1me/put/responses/204'
910 /videos/ownership:
911 get:
912 summary: Get list of video ownership changes requests
913 tags:
914 - Video
915 security:
916 - OAuth2: []
917 responses:
918 '200':
919 description: successful operation
920 '/videos/ownership/{id}/accept':
921 post:
922 summary: Refuse ownership change request for video by its id
923 tags:
924 - Video
925 security:
926 - OAuth2: []
927 parameters:
928 - $ref: '#/components/parameters/idOrUUID'
929 responses:
930 '204':
931 $ref: '#/paths/~1users~1me/put/responses/204'
932 '/videos/ownership/{id}/refuse':
933 post:
934 summary: Accept ownership change request for video by its id
935 tags:
936 - Video
937 security:
938 - OAuth2: []
939 parameters:
940 - $ref: '#/components/parameters/idOrUUID'
941 responses:
942 '204':
943 $ref: '#/paths/~1users~1me/put/responses/204'
944 '/videos/{id}/give-ownership':
945 post:
946 summary: Request change of ownership for a video you own, by its id
947 tags:
948 - Video
949 security:
950 - OAuth2: []
951 parameters:
952 - $ref: '#/components/parameters/idOrUUID'
953 requestBody:
954 required: true
955 content:
956 application/x-www-form-urlencoded:
957 schema:
958 type: object
959 properties:
960 username:
961 type: string
962 required:
963 - username
964 responses:
965 '204':
966 $ref: '#/paths/~1users~1me/put/responses/204'
967 '400':
968 description: 'Changing video ownership to a remote account is not supported yet'
969 /videos/upload: 976 /videos/upload:
970 post: 977 post:
971 summary: Upload a video file with its metadata 978 summary: Upload a video
972 security: 979 security:
973 - OAuth2: [] 980 - OAuth2: []
974 tags: 981 tags:
@@ -1090,7 +1097,8 @@ paths:
1090 "Authorization:Bearer $token" 1097 "Authorization:Bearer $token"
1091 /videos/imports: 1098 /videos/imports:
1092 post: 1099 post:
1093 summary: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator) 1100 summary: Import a video
1101 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
1094 security: 1102 security:
1095 - OAuth2: [] 1103 - OAuth2: []
1096 tags: 1104 tags:
@@ -1181,9 +1189,11 @@ paths:
1181 contentType: image/jpeg 1189 contentType: image/jpeg
1182 /videos/abuse: 1190 /videos/abuse:
1183 get: 1191 get:
1184 summary: Get list of reported video abuses 1192 summary: List video abuses
1185 security: 1193 security:
1186 - OAuth2: [] 1194 - OAuth2:
1195 - admin
1196 - moderator
1187 tags: 1197 tags:
1188 - Video Abuse 1198 - Video Abuse
1189 parameters: 1199 parameters:
@@ -1201,7 +1211,7 @@ paths:
1201 $ref: '#/components/schemas/VideoAbuse' 1211 $ref: '#/components/schemas/VideoAbuse'
1202 '/videos/{id}/abuse': 1212 '/videos/{id}/abuse':
1203 post: 1213 post:
1204 summary: 'Report an abuse, on a video by its id' 1214 summary: Report an abuse
1205 security: 1215 security:
1206 - OAuth2: [] 1216 - OAuth2: []
1207 tags: 1217 tags:
@@ -1213,7 +1223,7 @@ paths:
1213 $ref: '#/paths/~1users~1me/put/responses/204' 1223 $ref: '#/paths/~1users~1me/put/responses/204'
1214 '/videos/{id}/blacklist': 1224 '/videos/{id}/blacklist':
1215 post: 1225 post:
1216 summary: Put on blacklist a video by its id 1226 summary: Blacklist a video
1217 security: 1227 security:
1218 - OAuth2: 1228 - OAuth2:
1219 - admin 1229 - admin
@@ -1240,7 +1250,7 @@ paths:
1240 $ref: '#/paths/~1users~1me/put/responses/204' 1250 $ref: '#/paths/~1users~1me/put/responses/204'
1241 /videos/blacklist: 1251 /videos/blacklist:
1242 get: 1252 get:
1243 summary: Get list of videos on blacklist 1253 summary: List blacklisted videos
1244 security: 1254 security:
1245 - OAuth2: 1255 - OAuth2:
1246 - admin 1256 - admin
@@ -1262,7 +1272,7 @@ paths:
1262 $ref: '#/components/schemas/VideoBlacklist' 1272 $ref: '#/components/schemas/VideoBlacklist'
1263 /videos/{id}/captions: 1273 /videos/{id}/captions:
1264 get: 1274 get:
1265 summary: Get list of video's captions 1275 summary: List captions of a video
1266 tags: 1276 tags:
1267 - Video Caption 1277 - Video Caption
1268 parameters: 1278 parameters:
@@ -1317,9 +1327,9 @@ paths:
1317 $ref: '#/paths/~1users~1me/put/responses/204' 1327 $ref: '#/paths/~1users~1me/put/responses/204'
1318 /video-channels: 1328 /video-channels:
1319 get: 1329 get:
1320 summary: Get list of video channels 1330 summary: List video channels
1321 tags: 1331 tags:
1322 - Video Channel 1332 - Video Channels
1323 parameters: 1333 parameters:
1324 - $ref: '#/components/parameters/start' 1334 - $ref: '#/components/parameters/start'
1325 - $ref: '#/components/parameters/count' 1335 - $ref: '#/components/parameters/count'
@@ -1334,11 +1344,11 @@ paths:
1334 items: 1344 items:
1335 $ref: '#/components/schemas/VideoChannel' 1345 $ref: '#/components/schemas/VideoChannel'
1336 post: 1346 post:
1337 summary: Creates a video channel for the current user 1347 summary: Create a video channel
1338 security: 1348 security:
1339 - OAuth2: [] 1349 - OAuth2: []
1340 tags: 1350 tags:
1341 - Video Channel 1351 - Video Channels
1342 responses: 1352 responses:
1343 '204': 1353 '204':
1344 $ref: '#/paths/~1users~1me/put/responses/204' 1354 $ref: '#/paths/~1users~1me/put/responses/204'
@@ -1349,9 +1359,9 @@ paths:
1349 $ref: '#/components/schemas/VideoChannelCreate' 1359 $ref: '#/components/schemas/VideoChannelCreate'
1350 '/video-channels/{channelHandle}': 1360 '/video-channels/{channelHandle}':
1351 get: 1361 get:
1352 summary: Get a video channel by its id 1362 summary: Get a video channel
1353 tags: 1363 tags:
1354 - Video Channel 1364 - Video Channels
1355 parameters: 1365 parameters:
1356 - $ref: '#/components/parameters/channelHandle' 1366 - $ref: '#/components/parameters/channelHandle'
1357 responses: 1367 responses:
@@ -1362,11 +1372,11 @@ paths:
1362 schema: 1372 schema:
1363 $ref: '#/components/schemas/VideoChannel' 1373 $ref: '#/components/schemas/VideoChannel'
1364 put: 1374 put:
1365 summary: Update a video channel by its id 1375 summary: Update a video channel
1366 security: 1376 security:
1367 - OAuth2: [] 1377 - OAuth2: []
1368 tags: 1378 tags:
1369 - Video Channel 1379 - Video Channels
1370 parameters: 1380 parameters:
1371 - $ref: '#/components/parameters/channelHandle' 1381 - $ref: '#/components/parameters/channelHandle'
1372 responses: 1382 responses:
@@ -1378,11 +1388,11 @@ paths:
1378 schema: 1388 schema:
1379 $ref: '#/components/schemas/VideoChannelUpdate' 1389 $ref: '#/components/schemas/VideoChannelUpdate'
1380 delete: 1390 delete:
1381 summary: Delete a video channel by its id 1391 summary: Delete a video channel
1382 security: 1392 security:
1383 - OAuth2: [] 1393 - OAuth2: []
1384 tags: 1394 tags:
1385 - Video Channel 1395 - Video Channels
1386 parameters: 1396 parameters:
1387 - $ref: '#/components/parameters/channelHandle' 1397 - $ref: '#/components/parameters/channelHandle'
1388 responses: 1398 responses:
@@ -1390,10 +1400,10 @@ paths:
1390 $ref: '#/paths/~1users~1me/put/responses/204' 1400 $ref: '#/paths/~1users~1me/put/responses/204'
1391 '/video-channels/{channelHandle}/videos': 1401 '/video-channels/{channelHandle}/videos':
1392 get: 1402 get:
1393 summary: Get videos of a video channel by its id 1403 summary: List videos of a video channel
1394 tags: 1404 tags:
1395 - Video 1405 - Video
1396 - Video Channel 1406 - Video Channels
1397 parameters: 1407 parameters:
1398 - $ref: '#/components/parameters/channelHandle' 1408 - $ref: '#/components/parameters/channelHandle'
1399 responses: 1409 responses:
@@ -1405,9 +1415,9 @@ paths:
1405 $ref: '#/components/schemas/VideoListResponse' 1415 $ref: '#/components/schemas/VideoListResponse'
1406 /video-playlists: 1416 /video-playlists:
1407 get: 1417 get:
1408 summary: Get list of video playlists 1418 summary: List video playlists
1409 tags: 1419 tags:
1410 - Video Playlist 1420 - Video Playlists
1411 parameters: 1421 parameters:
1412 - $ref: '#/components/parameters/start' 1422 - $ref: '#/components/parameters/start'
1413 - $ref: '#/components/parameters/count' 1423 - $ref: '#/components/parameters/count'
@@ -1423,9 +1433,10 @@ paths:
1423 $ref: '#/components/schemas/VideoPlaylist' 1433 $ref: '#/components/schemas/VideoPlaylist'
1424 '/accounts/{name}/video-channels': 1434 '/accounts/{name}/video-channels':
1425 get: 1435 get:
1426 summary: Get video channels of an account by its name 1436 summary: List video channels of an account
1427 tags: 1437 tags:
1428 - Video Channel 1438 - Video Channels
1439 - Accounts
1429 parameters: 1440 parameters:
1430 - $ref: '#/components/parameters/name' 1441 - $ref: '#/components/parameters/name'
1431 responses: 1442 responses:
@@ -1439,11 +1450,11 @@ paths:
1439 $ref: '#/components/schemas/VideoChannel' 1450 $ref: '#/components/schemas/VideoChannel'
1440 '/accounts/{name}/ratings': 1451 '/accounts/{name}/ratings':
1441 get: 1452 get:
1442 summary: Get ratings of an account by its name 1453 summary: List ratings of an account
1443 security: 1454 security:
1444 - OAuth2: [] 1455 - OAuth2: []
1445 tags: 1456 tags:
1446 - User 1457 - Accounts
1447 parameters: 1458 parameters:
1448 - $ref: '#/components/parameters/name' 1459 - $ref: '#/components/parameters/name'
1449 - $ref: '#/components/parameters/start' 1460 - $ref: '#/components/parameters/start'
@@ -1469,9 +1480,9 @@ paths:
1469 $ref: '#/components/schemas/VideoRating' 1480 $ref: '#/components/schemas/VideoRating'
1470 '/videos/{id}/comment-threads': 1481 '/videos/{id}/comment-threads':
1471 get: 1482 get:
1472 summary: Get the comment threads of a video by its id 1483 summary: List threads of a video
1473 tags: 1484 tags:
1474 - Video Comment 1485 - Video Comments
1475 parameters: 1486 parameters:
1476 - $ref: '#/components/parameters/idOrUUID' 1487 - $ref: '#/components/parameters/idOrUUID'
1477 - $ref: '#/components/parameters/start' 1488 - $ref: '#/components/parameters/start'
@@ -1485,11 +1496,11 @@ paths:
1485 schema: 1496 schema:
1486 $ref: '#/components/schemas/CommentThreadResponse' 1497 $ref: '#/components/schemas/CommentThreadResponse'
1487 post: 1498 post:
1488 summary: 'Creates a comment thread, on a video by its id' 1499 summary: Create a thread
1489 security: 1500 security:
1490 - OAuth2: [] 1501 - OAuth2: []
1491 tags: 1502 tags:
1492 - Video Comment 1503 - Video Comments
1493 parameters: 1504 parameters:
1494 - $ref: '#/components/parameters/idOrUUID' 1505 - $ref: '#/components/parameters/idOrUUID'
1495 responses: 1506 responses:
@@ -1501,9 +1512,9 @@ paths:
1501 $ref: '#/components/schemas/CommentThreadPostResponse' 1512 $ref: '#/components/schemas/CommentThreadPostResponse'
1502 '/videos/{id}/comment-threads/{threadId}': 1513 '/videos/{id}/comment-threads/{threadId}':
1503 get: 1514 get:
1504 summary: 'Get the comment thread by its id, of a video by its id' 1515 summary: Get a thread
1505 tags: 1516 tags:
1506 - Video Comment 1517 - Video Comments
1507 parameters: 1518 parameters:
1508 - $ref: '#/components/parameters/idOrUUID' 1519 - $ref: '#/components/parameters/idOrUUID'
1509 - $ref: '#/components/parameters/threadId' 1520 - $ref: '#/components/parameters/threadId'
@@ -1516,11 +1527,11 @@ paths:
1516 $ref: '#/components/schemas/VideoCommentThreadTree' 1527 $ref: '#/components/schemas/VideoCommentThreadTree'
1517 '/videos/{id}/comments/{commentId}': 1528 '/videos/{id}/comments/{commentId}':
1518 post: 1529 post:
1519 summary: 'Creates a comment in a comment thread by its id, of a video by its id' 1530 summary: Reply to a thread of a video
1520 security: 1531 security:
1521 - OAuth2: [] 1532 - OAuth2: []
1522 tags: 1533 tags:
1523 - Video Comment 1534 - Video Comments
1524 parameters: 1535 parameters:
1525 - $ref: '#/components/parameters/idOrUUID' 1536 - $ref: '#/components/parameters/idOrUUID'
1526 - $ref: '#/components/parameters/commentId' 1537 - $ref: '#/components/parameters/commentId'
@@ -1532,11 +1543,11 @@ paths:
1532 schema: 1543 schema:
1533 $ref: '#/components/schemas/CommentThreadPostResponse' 1544 $ref: '#/components/schemas/CommentThreadPostResponse'
1534 delete: 1545 delete:
1535 summary: 'Delete a comment in a comment thread by its id, of a video by its id' 1546 summary: Delete a comment or a reply
1536 security: 1547 security:
1537 - OAuth2: [] 1548 - OAuth2: []
1538 tags: 1549 tags:
1539 - Video Comment 1550 - Video Comments
1540 parameters: 1551 parameters:
1541 - $ref: '#/components/parameters/idOrUUID' 1552 - $ref: '#/components/parameters/idOrUUID'
1542 - $ref: '#/components/parameters/commentId' 1553 - $ref: '#/components/parameters/commentId'
@@ -1545,11 +1556,11 @@ paths:
1545 $ref: '#/paths/~1users~1me/put/responses/204' 1556 $ref: '#/paths/~1users~1me/put/responses/204'
1546 '/videos/{id}/rate': 1557 '/videos/{id}/rate':
1547 put: 1558 put:
1548 summary: Vote for a video by its id 1559 summary: Like/dislike a video
1549 security: 1560 security:
1550 - OAuth2: [] 1561 - OAuth2: []
1551 tags: 1562 tags:
1552 - Video Rate 1563 - Video Rates
1553 parameters: 1564 parameters:
1554 - $ref: '#/components/parameters/idOrUUID' 1565 - $ref: '#/components/parameters/idOrUUID'
1555 responses: 1566 responses:
@@ -1559,7 +1570,7 @@ paths:
1559 get: 1570 get:
1560 tags: 1571 tags:
1561 - Search 1572 - Search
1562 summary: Get the videos corresponding to a given query 1573 summary: Search videos
1563 parameters: 1574 parameters:
1564 - $ref: '#/components/parameters/start' 1575 - $ref: '#/components/parameters/start'
1565 - $ref: '#/components/parameters/count' 1576 - $ref: '#/components/parameters/count'
@@ -1581,9 +1592,9 @@ servers:
1581 - url: 'https://peertube.cpy.re/api/v1' 1592 - url: 'https://peertube.cpy.re/api/v1'
1582 description: Live Test Server (live data - stable version) 1593 description: Live Test Server (live data - stable version)
1583 - url: 'https://peertube2.cpy.re/api/v1' 1594 - url: 'https://peertube2.cpy.re/api/v1'
1584 description: Live Test Server (live data - bleeding edge version) 1595 description: Live Test Server (live data - latest nighlty version)
1585 - url: 'https://peertube3.cpy.re/api/v1' 1596 - url: 'https://peertube3.cpy.re/api/v1'
1586 description: Live Test Server (live data - bleeding edge version) 1597 description: Live Test Server (live data - latest RC version)
1587components: 1598components:
1588 parameters: 1599 parameters:
1589 start: 1600 start: