aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc
diff options
context:
space:
mode:
Diffstat (limited to 'support/doc')
-rw-r--r--support/doc/api/openapi.yaml964
1 files changed, 743 insertions, 221 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index 0e0d2ab5f..61fd6c95a 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -4,12 +4,12 @@ info:
4 version: 3.2.0-rc.1 4 version: 3.2.0-rc.1
5 contact: 5 contact:
6 name: PeerTube Community 6 name: PeerTube Community
7 url: 'https://joinpeertube.org' 7 url: https://joinpeertube.org
8 license: 8 license:
9 name: AGPLv3.0 9 name: AGPLv3.0
10 url: 'https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE' 10 url: https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE
11 x-logo: 11 x-logo:
12 url: 'https://joinpeertube.org/img/brand.png' 12 url: https://joinpeertube.org/img/brand.png
13 altText: PeerTube Project Homepage 13 altText: PeerTube Project Homepage
14 description: | 14 description: |
15 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite 15 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite
@@ -27,8 +27,8 @@ info:
27 # Authentication 27 # Authentication
28 28
29 When you sign up for an account on a PeerTube instance, you are given the possibility 29 When you sign up for an account on a PeerTube instance, you are given the possibility
30 to generate sessions on it, and authenticate there using a session token. Only __one 30 to generate sessions on it, and authenticate there using an access token. Only __one
31 session token can currently be used at a time__. 31 access token can currently be used at a time__.
32 32
33 ## Roles 33 ## Roles
34 34
@@ -38,41 +38,60 @@ info:
38 # Errors 38 # Errors
39 39
40 The API uses standard HTTP status codes to indicate the success or failure 40 The API uses standard HTTP status codes to indicate the success or failure
41 of the API call. The body of the response will be JSON in the following 41 of the API call.
42 formats.
43 42
44 ``` 43 ```
44 HTTP 1.1 404 Not Found
45 Content-Type: application/json
46
45 { 47 {
46 "error": "Account not found" // error debug message 48 "errorCode": 1
49 "error": "Account not found"
47 } 50 }
48 ``` 51 ```
49 52
50 Some errors benefit from a more detailed message: 53 We provide error codes for [a growing number of cases](https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/server/server-error-code.enum.ts),
54 but it is still optional.
55
56 ### Validation errors
57
58 Each parameter is evaluated on its own against a set of rules before the route validator
59 proceeds with potential testing involving parameter combinations. Errors coming from Validation
60 errors appear earlier and benefit from a more detailed error type:
61
51 ``` 62 ```
63 HTTP 1.1 400 Bad Request
64 Content-Type: application/json
65
52 { 66 {
53 "errors": { 67 "errors": {
54 "id": { // where 'id' is the name of the parameter concerned by the error. 68 "id": {
55 "value": "a117eb-c6a9-4756-bb09-2a956239f", // value that triggered the error. 69 "value": "a117eb-c6a9-4756-bb09-2a956239f",
56 "msg": "Should have an valid id", // error debug message 70 "msg": "Should have a valid id",
57 "param": "id", 71 "param": "id",
58 "location": "params" // 'params', 'body', 'header', 'query' or 'cookies' 72 "location": "params"
59 } 73 }
60 } 74 }
61 } 75 }
62 ``` 76 ```
63 77
78 Where `id` is the name of the field concerned by the error, within the route definition.
79 `errors.<field>.location` can be either 'params', 'body', 'header', 'query' or 'cookies', and
80 `errors.<field>.value` reports the value that didn't pass validation whose `errors.<field>.msg`
81 is about.
82
64 # Rate limits 83 # Rate limits
65 84
66 We are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators: 85 We are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators:
67 86
68 | Endpoint | Calls | Time frame | 87 | Endpoint (prefix: `/api/v1`) | Calls | Time frame |
69 |-------------------------|------------------|---------------------------| 88 |------------------------------|---------------|--------------|
70 | `/*` | 50 | 10 seconds | 89 | `/*` | 50 | 10 seconds |
71 | `POST /users/token` | 15 | 5 minutes | 90 | `POST /users/token` | 15 | 5 minutes |
72 | `POST /users/register` | | 5 minutes | 91 | `POST /users/register` | 2<sup>*</sup> | 5 minutes |
73 | `POST /users/ask-send-verify-email` | 3 | 5 minutes | 92 | `POST /users/ask-send-verify-email` | 3 | 5 minutes |
74 93
75 Depending on the endpoint, ¹failed requests are not taken into account. A service 94 Depending on the endpoint, <sup>*</sup>failed requests are not taken into account. A service
76 limit is announced by a `429 Too Many Requests` status code. 95 limit is announced by a `429 Too Many Requests` status code.
77 96
78 You can get details about the current state of your rate limit by reading the 97 You can get details about the current state of your rate limit by reading the
@@ -80,13 +99,37 @@ info:
80 99
81 | Header | Description | 100 | Header | Description |
82 |-------------------------|------------------------------------------------------------| 101 |-------------------------|------------------------------------------------------------|
83 | X-RateLimit-Limit | Number of max requests allowed in the current time period | 102 | `X-RateLimit-Limit` | Number of max requests allowed in the current time period |
84 | X-RateLimit-Remaining | Number of remaining requests in the current time period | 103 | `X-RateLimit-Remaining` | Number of remaining requests in the current time period |
85 | X-RateLimit-Reset | Timestamp of end of current time period as UNIX timestamp | 104 | `X-RateLimit-Reset` | Timestamp of end of current time period as UNIX timestamp |
86 | Retry-After | Seconds to delay after the first `429` is received | 105 | `Retry-After` | Seconds to delay after the first `429` is received |
106
107 # CORS
108
109 This API features [Cross-Origin Resource Sharing (CORS)](https://fetch.spec.whatwg.org/),
110 allowing cross-domain communication from the browser for some routes:
111
112 | Endpoint |
113 |------------------------- ---|
114 | `/api/*` |
115 | `/download/*` |
116 | `/lazy-static/*` |
117 | `/live/segments-sha256/*` |
118 | `/.well-known/webfinger` |
119
120 In addition, all routes serving ActivityPub are CORS-enabled for all origins.
87externalDocs: 121externalDocs:
88 url: https://docs.joinpeertube.org/api-rest-reference.html 122 url: https://docs.joinpeertube.org/api-rest-reference.html
89tags: 123tags:
124 - name: Register
125 description: |
126 As a visitor, you can use this API to open an account (if registrations are open on
127 that PeerTube instance). As an admin, you should use the dedicated [User creation
128 API](#operation/createUser) instead.
129 - name: Session
130 x-displayName: Login/Logout
131 description: |
132 Sessions deal with access tokens over time. Only __one session token can currently be used at a time__.
90 - name: Accounts 133 - name: Accounts
91 description: > 134 description: >
92 Accounts encompass remote accounts discovered across the federation, 135 Accounts encompass remote accounts discovered across the federation,
@@ -210,6 +253,10 @@ tags:
210 253
211 For importing videos as your own, refer to [video imports](#operation/importVideo). 254 For importing videos as your own, refer to [video imports](#operation/importVideo).
212x-tagGroups: 255x-tagGroups:
256 - name: Auth
257 tags:
258 - Register
259 - Session
213 - name: Accounts 260 - name: Accounts
214 tags: 261 tags:
215 - Accounts 262 - Accounts
@@ -255,6 +302,7 @@ paths:
255 tags: 302 tags:
256 - Accounts 303 - Accounts
257 summary: Get an account 304 summary: Get an account
305 operationId: getAccount
258 parameters: 306 parameters:
259 - $ref: '#/components/parameters/name' 307 - $ref: '#/components/parameters/name'
260 responses: 308 responses:
@@ -266,12 +314,14 @@ paths:
266 $ref: '#/components/schemas/Account' 314 $ref: '#/components/schemas/Account'
267 '404': 315 '404':
268 description: account not found 316 description: account not found
317
269 '/accounts/{name}/videos': 318 '/accounts/{name}/videos':
270 get: 319 get:
271 tags: 320 tags:
272 - Accounts 321 - Accounts
273 - Video 322 - Video
274 summary: 'List videos of an account' 323 summary: 'List videos of an account'
324 operationId: getAccountVideos
275 parameters: 325 parameters:
276 - $ref: '#/components/parameters/name' 326 - $ref: '#/components/parameters/name'
277 - $ref: '#/components/parameters/categoryOneOf' 327 - $ref: '#/components/parameters/categoryOneOf'
@@ -327,11 +377,13 @@ paths:
327 json = r.json() 377 json = r.json()
328 378
329 print(json) 379 print(json)
380
330 /accounts: 381 /accounts:
331 get: 382 get:
332 tags: 383 tags:
333 - Accounts 384 - Accounts
334 summary: List accounts 385 summary: List accounts
386 operationId: getAccounts
335 parameters: 387 parameters:
336 - $ref: '#/components/parameters/start' 388 - $ref: '#/components/parameters/start'
337 - $ref: '#/components/parameters/count' 389 - $ref: '#/components/parameters/count'
@@ -345,11 +397,13 @@ paths:
345 type: array 397 type: array
346 items: 398 items:
347 $ref: '#/components/schemas/Account' 399 $ref: '#/components/schemas/Account'
400
348 /config: 401 /config:
349 get: 402 get:
350 tags: 403 tags:
351 - Config 404 - Config
352 summary: Get instance public configuration 405 summary: Get instance public configuration
406 operationId: getConfig
353 responses: 407 responses:
354 '200': 408 '200':
355 description: successful operation 409 description: successful operation
@@ -360,9 +414,11 @@ paths:
360 examples: 414 examples:
361 nightly: 415 nightly:
362 externalValue: https://peertube2.cpy.re/api/v1/config 416 externalValue: https://peertube2.cpy.re/api/v1/config
417
363 /config/about: 418 /config/about:
364 get: 419 get:
365 summary: Get instance "About" information 420 summary: Get instance "About" information
421 operationId: getAbout
366 tags: 422 tags:
367 - Config 423 - Config
368 responses: 424 responses:
@@ -375,9 +431,11 @@ paths:
375 examples: 431 examples:
376 nightly: 432 nightly:
377 externalValue: https://peertube2.cpy.re/api/v1/config/about 433 externalValue: https://peertube2.cpy.re/api/v1/config/about
434
378 /config/custom: 435 /config/custom:
379 get: 436 get:
380 summary: Get instance runtime configuration 437 summary: Get instance runtime configuration
438 operationId: getCustomConfig
381 tags: 439 tags:
382 - Config 440 - Config
383 security: 441 security:
@@ -392,6 +450,7 @@ paths:
392 $ref: '#/components/schemas/ServerConfigCustom' 450 $ref: '#/components/schemas/ServerConfigCustom'
393 put: 451 put:
394 summary: Set instance runtime configuration 452 summary: Set instance runtime configuration
453 operationId: putCustomConfig
395 tags: 454 tags:
396 - Config 455 - Config
397 security: 456 security:
@@ -408,6 +467,7 @@ paths:
408 - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled 467 - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled
409 delete: 468 delete:
410 summary: Delete instance runtime configuration 469 summary: Delete instance runtime configuration
470 operationId: delCustomConfig
411 tags: 471 tags:
412 - Config 472 - Config
413 security: 473 security:
@@ -416,9 +476,11 @@ paths:
416 responses: 476 responses:
417 '200': 477 '200':
418 description: successful operation 478 description: successful operation
479
419 /jobs/{state}: 480 /jobs/{state}:
420 get: 481 get:
421 summary: List instance jobs 482 summary: List instance jobs
483 operationId: getJobs
422 security: 484 security:
423 - OAuth2: 485 - OAuth2:
424 - admin 486 - admin
@@ -458,66 +520,108 @@ paths:
458 maxItems: 100 520 maxItems: 100
459 items: 521 items:
460 $ref: '#/components/schemas/Job' 522 $ref: '#/components/schemas/Job'
461 '/server/following/{host}': 523
524 /server/followers:
525 get:
526 tags:
527 - Instance Follows
528 summary: List instances following the server
529 parameters:
530 - $ref: '#/components/parameters/followState'
531 - $ref: '#/components/parameters/actorType'
532 - $ref: '#/components/parameters/start'
533 - $ref: '#/components/parameters/count'
534 - $ref: '#/components/parameters/sort'
535 responses:
536 '200':
537 description: successful operation
538 content:
539 application/json:
540 schema:
541 type: object
542 properties:
543 total:
544 type: integer
545 example: 1
546 data:
547 type: array
548 items:
549 $ref: '#/components/schemas/Follow'
550
551 '/server/followers/{nameWithHost}':
462 delete: 552 delete:
553 summary: Remove or reject a follower to your server
463 security: 554 security:
464 - OAuth2: 555 - OAuth2:
465 - admin 556 - admin
466 tags: 557 tags:
467 - Instance Follows 558 - Instance Follows
468 summary: Unfollow a server
469 parameters: 559 parameters:
470 - name: host 560 - name: nameWithHost
471 in: path 561 in: path
472 required: true 562 required: true
473 description: 'The host to unfollow ' 563 description: The remote actor handle to remove from your followers
474 schema: 564 schema:
475 type: string 565 type: string
476 format: hostname 566 format: email
477 responses: 567 responses:
478 '201': 568 '204':
479 description: successful operation 569 description: successful operation
480 /server/followers: 570 '404':
481 get: 571 description: follower not found
572
573 '/server/followers/{nameWithHost}/reject':
574 post:
575 summary: Reject a pending follower to your server
576 security:
577 - OAuth2:
578 - admin
482 tags: 579 tags:
483 - Instance Follows 580 - Instance Follows
484 summary: List instance followers
485 parameters: 581 parameters:
486 - $ref: '#/components/parameters/start' 582 - name: nameWithHost
487 - $ref: '#/components/parameters/count' 583 in: path
488 - $ref: '#/components/parameters/sort' 584 required: true
585 description: The remote actor handle to remove from your followers
586 schema:
587 type: string
588 format: email
489 responses: 589 responses:
490 '200': 590 '204':
491 description: successful operation 591 description: successful operation
492 content: 592 '404':
493 application/json: 593 description: follower not found
494 schema: 594
495 type: array 595 '/server/followers/{nameWithHost}/accept':
496 items: 596 post:
497 $ref: '#/components/schemas/Follow' 597 summary: Accept a pending follower to your server
598 security:
599 - OAuth2:
600 - admin
601 tags:
602 - Instance Follows
603 parameters:
604 - name: nameWithHost
605 in: path
606 required: true
607 description: The remote actor handle to remove from your followers
608 schema:
609 type: string
610 format: email
611 responses:
612 '204':
613 description: successful operation
614 '404':
615 description: follower not found
616
498 /server/following: 617 /server/following:
499 get: 618 get:
500 tags: 619 tags:
501 - Instance Follows 620 - Instance Follows
502 summary: List instances followed by the server 621 summary: List instances followed by the server
503 parameters: 622 parameters:
504 - name: state 623 - $ref: '#/components/parameters/followState'
505 in: query 624 - $ref: '#/components/parameters/actorType'
506 schema:
507 type: string
508 enum:
509 - pending
510 - accepted
511 - name: actorType
512 in: query
513 schema:
514 type: string
515 enum:
516 - Person
517 - Application
518 - Group
519 - Service
520 - Organization
521 - $ref: '#/components/parameters/start' 625 - $ref: '#/components/parameters/start'
522 - $ref: '#/components/parameters/count' 626 - $ref: '#/components/parameters/count'
523 - $ref: '#/components/parameters/sort' 627 - $ref: '#/components/parameters/sort'
@@ -527,16 +631,22 @@ paths:
527 content: 631 content:
528 application/json: 632 application/json:
529 schema: 633 schema:
530 type: array 634 type: object
531 items: 635 properties:
532 $ref: '#/components/schemas/Follow' 636 total:
637 type: integer
638 example: 1
639 data:
640 type: array
641 items:
642 $ref: '#/components/schemas/Follow'
533 post: 643 post:
534 security: 644 security:
535 - OAuth2: 645 - OAuth2:
536 - admin 646 - admin
537 tags: 647 tags:
538 - Instance Follows 648 - Instance Follows
539 summary: Follow a server 649 summary: Follow a list of servers
540 responses: 650 responses:
541 '204': 651 '204':
542 description: successful operation 652 description: successful operation
@@ -554,9 +664,33 @@ paths:
554 type: string 664 type: string
555 format: hostname 665 format: hostname
556 uniqueItems: true 666 uniqueItems: true
667
668 '/server/following/{host}':
669 delete:
670 summary: Unfollow a server
671 security:
672 - OAuth2:
673 - admin
674 tags:
675 - Instance Follows
676 parameters:
677 - name: host
678 in: path
679 required: true
680 description: The host to unfollow
681 schema:
682 type: string
683 format: hostname
684 responses:
685 '204':
686 description: successful operation
687 '404':
688 description: host not found
689
557 /users: 690 /users:
558 post: 691 post:
559 summary: Create a user 692 summary: Create a user
693 operationId: createUser
560 security: 694 security:
561 - OAuth2: 695 - OAuth2:
562 - admin 696 - admin
@@ -598,6 +732,7 @@ paths:
598 required: true 732 required: true
599 get: 733 get:
600 summary: List users 734 summary: List users
735 operationId: getUsers
601 security: 736 security:
602 - OAuth2: 737 - OAuth2:
603 - admin 738 - admin
@@ -618,6 +753,7 @@ paths:
618 type: array 753 type: array
619 items: 754 items:
620 $ref: '#/components/schemas/User' 755 $ref: '#/components/schemas/User'
756
621 '/users/{id}': 757 '/users/{id}':
622 parameters: 758 parameters:
623 - $ref: '#/components/parameters/id' 759 - $ref: '#/components/parameters/id'
@@ -673,11 +809,120 @@ paths:
673 schema: 809 schema:
674 $ref: '#/components/schemas/UpdateUser' 810 $ref: '#/components/schemas/UpdateUser'
675 required: true 811 required: true
812
813 /oauth-clients/local:
814 get:
815 summary: Login prerequisite
816 description: You need to retrieve a client id and secret before [logging in](#operation/getOAuthToken).
817 operationId: getOAuthClient
818 tags:
819 - Session
820 responses:
821 '200':
822 description: successful operation
823 content:
824 application/json:
825 schema:
826 $ref: '#/components/schemas/OAuthClient'
827 links:
828 UseOAuthClientToLogin:
829 operationId: getOAuthToken
830 parameters:
831 client_id: '$response.body#/client_id'
832 client_secret: '$response.body#/client_secret'
833 x-codeSamples:
834 - lang: Shell
835 source: |
836 API="https://peertube2.cpy.re/api/v1"
837
838 ## AUTH
839 curl -s "$API/oauth-clients/local"
840
841 /users/token:
842 post:
843 summary: Login
844 operationId: getOAuthToken
845 description: With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens.
846 tags:
847 - Session
848 requestBody:
849 content:
850 application/x-www-form-urlencoded:
851 schema:
852 oneOf:
853 - $ref: '#/components/schemas/OAuthToken-password'
854 - $ref: '#/components/schemas/OAuthToken-refresh_token'
855 discriminator:
856 propertyName: grant_type
857 mapping:
858 password: '#/components/schemas/OAuthToken-password'
859 refresh_token: '#/components/schemas/OAuthToken-refresh_token'
860 responses:
861 '200':
862 description: successful operation
863 content:
864 application/json:
865 schema:
866 type: object
867 properties:
868 token_type:
869 type: string
870 example: Bearer
871 access_token:
872 type: string
873 example: 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0
874 description: valid for 1 day
875 refresh_token:
876 type: string
877 example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7
878 description: valid for 2 weeks
879 expires_in:
880 type: integer
881 minimum: 0
882 example: 14399
883 refresh_token_expires_in:
884 type: integer
885 minimum: 0
886 example: 1209600
887 x-codeSamples:
888 - lang: Shell
889 source: |
890 ## DEPENDENCIES: jq
891 API="https://peertube2.cpy.re/api/v1"
892 USERNAME="<your_username>"
893 PASSWORD="<your_password>"
894
895 ## AUTH
896 client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id")
897 client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret")
898 curl -s "$API/users/token" \
899 --data client_id="$client_id" \
900 --data client_secret="$client_secret" \
901 --data grant_type=password \
902 --data username="$USERNAME" \
903 --data password="$PASSWORD" \
904 | jq -r ".access_token"
905
906 /users/revoke-token:
907 post:
908 summary: Logout
909 description: Revokes your access token and its associated refresh token, destroying your current session.
910 operationId: revokeOAuthToken
911 tags:
912 - Session
913 security:
914 - OAuth2: []
915 responses:
916 '200':
917 description: successful operation
918
676 /users/register: 919 /users/register:
677 post: 920 post:
678 summary: Register a user 921 summary: Register a user
922 operationId: registerUser
679 tags: 923 tags:
680 - Users 924 - Users
925 - Register
681 responses: 926 responses:
682 '204': 927 '204':
683 description: successful operation 928 description: successful operation
@@ -687,9 +932,55 @@ paths:
687 schema: 932 schema:
688 $ref: '#/components/schemas/RegisterUser' 933 $ref: '#/components/schemas/RegisterUser'
689 required: true 934 required: true
935
936 /users/{id}/verify-email:
937 post:
938 summary: Verify a user
939 operationId: verifyUser
940 description: |
941 Following a user registration, the new user will receive an email asking to click a link
942 containing a secret.
943 tags:
944 - Users
945 - Register
946 parameters:
947 - $ref: '#/components/parameters/id'
948 requestBody:
949 content:
950 application/json:
951 schema:
952 type: object
953 properties:
954 verificationString:
955 type: string
956 format: url
957 isPendingEmail:
958 type: boolean
959 required:
960 - verificationString
961 responses:
962 '204':
963 description: successful operation
964 '403':
965 description: invalid verification string
966 '404':
967 description: user not found
968
969 /users/ask-send-verify-email:
970 post:
971 summary: Resend user verification link
972 operationId: resendEmailToVerifyUser
973 tags:
974 - Users
975 - Register
976 responses:
977 '204':
978 description: successful operation
979
690 /users/me: 980 /users/me:
691 get: 981 get:
692 summary: Get my user information 982 summary: Get my user information
983 operationId: getUserInfo
693 security: 984 security:
694 - OAuth2: 985 - OAuth2:
695 - user 986 - user
@@ -706,6 +997,7 @@ paths:
706 $ref: '#/components/schemas/User' 997 $ref: '#/components/schemas/User'
707 put: 998 put:
708 summary: Update my user information 999 summary: Update my user information
1000 operationId: putUserInfo
709 security: 1001 security:
710 - OAuth2: 1002 - OAuth2:
711 - user 1003 - user
@@ -720,6 +1012,7 @@ paths:
720 schema: 1012 schema:
721 $ref: '#/components/schemas/UpdateMe' 1013 $ref: '#/components/schemas/UpdateMe'
722 required: true 1014 required: true
1015
723 /users/me/videos/imports: 1016 /users/me/videos/imports:
724 get: 1017 get:
725 summary: Get video imports of my user 1018 summary: Get video imports of my user
@@ -740,6 +1033,7 @@ paths:
740 application/json: 1033 application/json:
741 schema: 1034 schema:
742 $ref: '#/components/schemas/VideoImportsList' 1035 $ref: '#/components/schemas/VideoImportsList'
1036
743 /users/me/video-quota-used: 1037 /users/me/video-quota-used:
744 get: 1038 get:
745 summary: Get my user used quota 1039 summary: Get my user used quota
@@ -764,6 +1058,7 @@ paths:
764 type: number 1058 type: number
765 description: The user video quota used today in bytes 1059 description: The user video quota used today in bytes
766 example: 1681014151 1060 example: 1681014151
1061
767 '/users/me/videos/{videoId}/rating': 1062 '/users/me/videos/{videoId}/rating':
768 get: 1063 get:
769 summary: Get rate of my user for a video 1064 summary: Get rate of my user for a video
@@ -786,6 +1081,7 @@ paths:
786 application/json: 1081 application/json:
787 schema: 1082 schema:
788 $ref: '#/components/schemas/GetMeVideoRating' 1083 $ref: '#/components/schemas/GetMeVideoRating'
1084
789 /users/me/videos: 1085 /users/me/videos:
790 get: 1086 get:
791 summary: Get videos of my user 1087 summary: Get videos of my user
@@ -806,6 +1102,7 @@ paths:
806 application/json: 1102 application/json:
807 schema: 1103 schema:
808 $ref: '#/components/schemas/VideoListResponse' 1104 $ref: '#/components/schemas/VideoListResponse'
1105
809 /users/me/subscriptions: 1106 /users/me/subscriptions:
810 get: 1107 get:
811 summary: Get my user subscriptions 1108 summary: Get my user subscriptions
@@ -851,6 +1148,7 @@ paths:
851 responses: 1148 responses:
852 '200': 1149 '200':
853 description: successful operation 1150 description: successful operation
1151
854 /users/me/subscriptions/exist: 1152 /users/me/subscriptions/exist:
855 get: 1153 get:
856 summary: Get if subscriptions exist for my user 1154 summary: Get if subscriptions exist for my user
@@ -868,6 +1166,7 @@ paths:
868 application/json: 1166 application/json:
869 schema: 1167 schema:
870 type: object 1168 type: object
1169
871 /users/me/subscriptions/videos: 1170 /users/me/subscriptions/videos:
872 get: 1171 get:
873 summary: List videos of subscriptions of my user 1172 summary: List videos of subscriptions of my user
@@ -897,6 +1196,7 @@ paths:
897 application/json: 1196 application/json:
898 schema: 1197 schema:
899 $ref: '#/components/schemas/VideoListResponse' 1198 $ref: '#/components/schemas/VideoListResponse'
1199
900 '/users/me/subscriptions/{subscriptionHandle}': 1200 '/users/me/subscriptions/{subscriptionHandle}':
901 get: 1201 get:
902 summary: Get subscription of my user 1202 summary: Get subscription of my user
@@ -926,6 +1226,7 @@ paths:
926 responses: 1226 responses:
927 '200': 1227 '200':
928 description: successful operation 1228 description: successful operation
1229
929 /users/me/notifications: 1230 /users/me/notifications:
930 get: 1231 get:
931 summary: List my notifications 1232 summary: List my notifications
@@ -949,6 +1250,7 @@ paths:
949 application/json: 1250 application/json:
950 schema: 1251 schema:
951 $ref: '#/components/schemas/NotificationListResponse' 1252 $ref: '#/components/schemas/NotificationListResponse'
1253
952 /users/me/notifications/read: 1254 /users/me/notifications/read:
953 post: 1255 post:
954 summary: Mark notifications as read by their id 1256 summary: Mark notifications as read by their id
@@ -972,6 +1274,7 @@ paths:
972 responses: 1274 responses:
973 '204': 1275 '204':
974 description: successful operation 1276 description: successful operation
1277
975 /users/me/notifications/read-all: 1278 /users/me/notifications/read-all:
976 post: 1279 post:
977 summary: Mark all my notification as read 1280 summary: Mark all my notification as read
@@ -982,6 +1285,7 @@ paths:
982 responses: 1285 responses:
983 '204': 1286 '204':
984 description: successful operation 1287 description: successful operation
1288
985 /users/me/notification-settings: 1289 /users/me/notification-settings:
986 put: 1290 put:
987 summary: Update my notification settings 1291 summary: Update my notification settings
@@ -1022,6 +1326,7 @@ paths:
1022 responses: 1326 responses:
1023 '204': 1327 '204':
1024 description: successful operation 1328 description: successful operation
1329
1025 /users/me/history/videos: 1330 /users/me/history/videos:
1026 get: 1331 get:
1027 summary: List watched videos history 1332 summary: List watched videos history
@@ -1040,6 +1345,7 @@ paths:
1040 application/json: 1345 application/json:
1041 schema: 1346 schema:
1042 $ref: '#/components/schemas/VideoListResponse' 1347 $ref: '#/components/schemas/VideoListResponse'
1348
1043 /users/me/history/videos/remove: 1349 /users/me/history/videos/remove:
1044 post: 1350 post:
1045 summary: Clear video history 1351 summary: Clear video history
@@ -1060,6 +1366,7 @@ paths:
1060 responses: 1366 responses:
1061 '204': 1367 '204':
1062 description: successful operation 1368 description: successful operation
1369
1063 /users/me/avatar/pick: 1370 /users/me/avatar/pick:
1064 post: 1371 post:
1065 summary: Update my user avatar 1372 summary: Update my user avatar
@@ -1098,6 +1405,7 @@ paths:
1098 encoding: 1405 encoding:
1099 avatarfile: 1406 avatarfile:
1100 contentType: image/png, image/jpeg 1407 contentType: image/png, image/jpeg
1408
1101 /users/me/avatar: 1409 /users/me/avatar:
1102 delete: 1410 delete:
1103 summary: Delete my avatar 1411 summary: Delete my avatar
@@ -1119,6 +1427,7 @@ paths:
1119 responses: 1427 responses:
1120 '200': 1428 '200':
1121 description: successful operation 1429 description: successful operation
1430
1122 '/videos/ownership/{id}/accept': 1431 '/videos/ownership/{id}/accept':
1123 post: 1432 post:
1124 summary: Accept ownership change request 1433 summary: Accept ownership change request
@@ -1135,6 +1444,7 @@ paths:
1135 description: cannot terminate an ownership change of another user 1444 description: cannot terminate an ownership change of another user
1136 '404': 1445 '404':
1137 description: video owneship change not found 1446 description: video owneship change not found
1447
1138 '/videos/ownership/{id}/refuse': 1448 '/videos/ownership/{id}/refuse':
1139 post: 1449 post:
1140 summary: Refuse ownership change request 1450 summary: Refuse ownership change request
@@ -1151,6 +1461,7 @@ paths:
1151 description: cannot terminate an ownership change of another user 1461 description: cannot terminate an ownership change of another user
1152 '404': 1462 '404':
1153 description: video owneship change not found 1463 description: video owneship change not found
1464
1154 '/videos/{id}/give-ownership': 1465 '/videos/{id}/give-ownership':
1155 post: 1466 post:
1156 summary: Request ownership change 1467 summary: Request ownership change
@@ -1178,6 +1489,7 @@ paths:
1178 description: changing video ownership to a remote account is not supported yet 1489 description: changing video ownership to a remote account is not supported yet
1179 '404': 1490 '404':
1180 description: video not found 1491 description: video not found
1492
1181 /videos: 1493 /videos:
1182 get: 1494 get:
1183 summary: List videos 1495 summary: List videos
@@ -1203,6 +1515,7 @@ paths:
1203 application/json: 1515 application/json:
1204 schema: 1516 schema:
1205 $ref: '#/components/schemas/VideoListResponse' 1517 $ref: '#/components/schemas/VideoListResponse'
1518
1206 /videos/categories: 1519 /videos/categories:
1207 get: 1520 get:
1208 summary: List available video categories 1521 summary: List available video categories
@@ -1221,6 +1534,7 @@ paths:
1221 examples: 1534 examples:
1222 nightly: 1535 nightly:
1223 externalValue: https://peertube2.cpy.re/api/v1/videos/categories 1536 externalValue: https://peertube2.cpy.re/api/v1/videos/categories
1537
1224 /videos/licences: 1538 /videos/licences:
1225 get: 1539 get:
1226 summary: List available video licences 1540 summary: List available video licences
@@ -1239,6 +1553,7 @@ paths:
1239 examples: 1553 examples:
1240 nightly: 1554 nightly:
1241 externalValue: https://peertube2.cpy.re/api/v1/videos/licences 1555 externalValue: https://peertube2.cpy.re/api/v1/videos/licences
1556
1242 /videos/languages: 1557 /videos/languages:
1243 get: 1558 get:
1244 summary: List available video languages 1559 summary: List available video languages
@@ -1257,6 +1572,7 @@ paths:
1257 examples: 1572 examples:
1258 nightly: 1573 nightly:
1259 externalValue: https://peertube2.cpy.re/api/v1/videos/languages 1574 externalValue: https://peertube2.cpy.re/api/v1/videos/languages
1575
1260 /videos/privacies: 1576 /videos/privacies:
1261 get: 1577 get:
1262 summary: List available video privacy policies 1578 summary: List available video privacy policies
@@ -1275,9 +1591,11 @@ paths:
1275 examples: 1591 examples:
1276 nightly: 1592 nightly:
1277 externalValue: https://peertube2.cpy.re/api/v1/videos/privacies 1593 externalValue: https://peertube2.cpy.re/api/v1/videos/privacies
1594
1278 '/videos/{id}': 1595 '/videos/{id}':
1279 put: 1596 put:
1280 summary: Update a video 1597 summary: Update a video
1598 operationId: putVideo
1281 security: 1599 security:
1282 - OAuth2: [] 1600 - OAuth2: []
1283 tags: 1601 tags:
@@ -1317,7 +1635,7 @@ paths:
1317 type: string 1635 type: string
1318 support: 1636 support:
1319 description: A text tell the audience how to support the video creator 1637 description: A text tell the audience how to support the video creator
1320 example: Please support my work on <insert crowdfunding plateform>! <3 1638 example: Please support our work on https://soutenir.framasoft.org/en/ <3
1321 type: string 1639 type: string
1322 nsfw: 1640 nsfw:
1323 description: Whether or not this video contains sensitive content 1641 description: Whether or not this video contains sensitive content
@@ -1352,6 +1670,7 @@ paths:
1352 contentType: image/jpeg 1670 contentType: image/jpeg
1353 get: 1671 get:
1354 summary: Get a video 1672 summary: Get a video
1673 operationId: getVideo
1355 tags: 1674 tags:
1356 - Video 1675 - Video
1357 parameters: 1676 parameters:
@@ -1365,6 +1684,7 @@ paths:
1365 $ref: '#/components/schemas/VideoDetails' 1684 $ref: '#/components/schemas/VideoDetails'
1366 delete: 1685 delete:
1367 summary: Delete a video 1686 summary: Delete a video
1687 operationId: delVideo
1368 security: 1688 security:
1369 - OAuth2: [] 1689 - OAuth2: []
1370 tags: 1690 tags:
@@ -1374,9 +1694,11 @@ paths:
1374 responses: 1694 responses:
1375 '204': 1695 '204':
1376 description: successful operation 1696 description: successful operation
1697
1377 '/videos/{id}/description': 1698 '/videos/{id}/description':
1378 get: 1699 get:
1379 summary: Get complete video description 1700 summary: Get complete video description
1701 operationId: getVideoDesc
1380 tags: 1702 tags:
1381 - Video 1703 - Video
1382 parameters: 1704 parameters:
@@ -1393,6 +1715,7 @@ paths:
1393 maxLength: 10000 1715 maxLength: 10000
1394 example: | 1716 example: |
1395 **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)** 1717 **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**
1718
1396 '/videos/{id}/views': 1719 '/videos/{id}/views':
1397 post: 1720 post:
1398 summary: Add a view to a video 1721 summary: Add a view to a video
@@ -1403,6 +1726,7 @@ paths:
1403 responses: 1726 responses:
1404 '204': 1727 '204':
1405 description: successful operation 1728 description: successful operation
1729
1406 '/videos/{id}/watching': 1730 '/videos/{id}/watching':
1407 put: 1731 put:
1408 summary: Set watching progress of a video 1732 summary: Set watching progress of a video
@@ -1421,6 +1745,7 @@ paths:
1421 responses: 1745 responses:
1422 '204': 1746 '204':
1423 description: successful operation 1747 description: successful operation
1748
1424 /videos/upload: 1749 /videos/upload:
1425 post: 1750 post:
1426 summary: Upload a video 1751 summary: Upload a video
@@ -1477,26 +1802,27 @@ paths:
1477 FILE_PATH="<your_file_path>" 1802 FILE_PATH="<your_file_path>"
1478 CHANNEL_ID="<your_channel_id>" 1803 CHANNEL_ID="<your_channel_id>"
1479 NAME="<video_name>" 1804 NAME="<video_name>"
1805 API="https://peertube2.cpy.re/api/v1"
1480 1806
1481 API_PATH="https://peertube2.cpy.re/api/v1"
1482 ## AUTH 1807 ## AUTH
1483 client_id=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_id") 1808 client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id")
1484 client_secret=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_secret") 1809 client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret")
1485 token=$(curl -s "$API_PATH/users/token" \ 1810 token=$(curl -s "$API/users/token" \
1486 --data client_id="$client_id" \ 1811 --data client_id="$client_id" \
1487 --data client_secret="$client_secret" \ 1812 --data client_secret="$client_secret" \
1488 --data grant_type=password \ 1813 --data grant_type=password \
1489 --data response_type=code \
1490 --data username="$USERNAME" \ 1814 --data username="$USERNAME" \
1491 --data password="$PASSWORD" \ 1815 --data password="$PASSWORD" \
1492 | jq -r ".access_token") 1816 | jq -r ".access_token")
1817
1493 ## VIDEO UPLOAD 1818 ## VIDEO UPLOAD
1494 curl -s "$API_PATH/videos/upload" \ 1819 curl -s "$API/videos/upload" \
1495 -H "Authorization: Bearer $token" \ 1820 -H "Authorization: Bearer $token" \
1496 --max-time 600 \ 1821 --max-time 600 \
1497 --form videofile=@"$FILE_PATH" \ 1822 --form videofile=@"$FILE_PATH" \
1498 --form channelId=$CHANNEL_ID \ 1823 --form channelId=$CHANNEL_ID \
1499 --form name="$NAME" 1824 --form name="$NAME"
1825
1500 /videos/upload-resumable: 1826 /videos/upload-resumable:
1501 post: 1827 post:
1502 summary: Initialize the resumable upload of a video 1828 summary: Initialize the resumable upload of a video
@@ -1658,6 +1984,7 @@ paths:
1658 schema: 1984 schema:
1659 type: number 1985 type: number
1660 example: 0 1986 example: 0
1987
1661 /videos/imports: 1988 /videos/imports:
1662 post: 1989 post:
1663 summary: Import a video 1990 summary: Import a video
@@ -1672,74 +1999,7 @@ paths:
1672 content: 1999 content:
1673 multipart/form-data: 2000 multipart/form-data:
1674 schema: 2001 schema:
1675 type: object 2002 $ref: '#/components/schemas/VideoCreateImport'
1676 properties:
1677 torrentfile:
1678 description: Torrent File
1679 type: string
1680 format: binary
1681 targetUrl:
1682 $ref: '#/components/schemas/VideoImport/properties/targetUrl'
1683 magnetUri:
1684 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
1685 channelId:
1686 description: Channel id that will contain this video
1687 allOf:
1688 - $ref: '#/components/schemas/VideoChannel/properties/id'
1689 thumbnailfile:
1690 description: Video thumbnail file
1691 type: string
1692 format: binary
1693 previewfile:
1694 description: Video preview file
1695 type: string
1696 format: binary
1697 privacy:
1698 $ref: '#/components/schemas/VideoPrivacySet'
1699 category:
1700 $ref: '#/components/schemas/VideoCategorySet'
1701 licence:
1702 $ref: '#/components/schemas/VideoLicenceSet'
1703 language:
1704 $ref: '#/components/schemas/VideoLanguageSet'
1705 description:
1706 description: Video description
1707 type: string
1708 waitTranscoding:
1709 description: Whether or not we wait transcoding before publish the video
1710 type: boolean
1711 support:
1712 description: A text tell the audience how to support the video creator
1713 example: Please support my work on <insert crowdfunding plateform>! <3
1714 type: string
1715 nsfw:
1716 description: Whether or not this video contains sensitive content
1717 type: boolean
1718 name:
1719 description: Video name
1720 type: string
1721 minLength: 3
1722 maxLength: 120
1723 tags:
1724 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1725 type: array
1726 minItems: 1
1727 maxItems: 5
1728 items:
1729 type: string
1730 minLength: 2
1731 maxLength: 30
1732 commentsEnabled:
1733 description: Enable or disable comments for this video
1734 type: boolean
1735 downloadEnabled:
1736 description: Enable or disable downloading for this video
1737 type: boolean
1738 scheduleUpdate:
1739 $ref: '#/components/schemas/VideoScheduledUpdate'
1740 required:
1741 - channelId
1742 - name
1743 encoding: 2003 encoding:
1744 torrentfile: 2004 torrentfile:
1745 contentType: application/x-bittorrent 2005 contentType: application/x-bittorrent
@@ -1814,7 +2074,7 @@ paths:
1814 type: string 2074 type: string
1815 support: 2075 support:
1816 description: A text tell the audience how to support the creator 2076 description: A text tell the audience how to support the creator
1817 example: Please support my work on <insert crowdfunding plateform>! <3 2077 example: Please support our work on https://soutenir.framasoft.org/en/ <3
1818 type: string 2078 type: string
1819 nsfw: 2079 nsfw:
1820 description: Whether or not this live video/replay contains sensitive content 2080 description: Whether or not this live video/replay contains sensitive content
@@ -2012,7 +2272,6 @@ paths:
2012 type: array 2272 type: array
2013 items: 2273 items:
2014 $ref: '#/components/schemas/Abuse' 2274 $ref: '#/components/schemas/Abuse'
2015
2016 post: 2275 post:
2017 summary: Report an abuse 2276 summary: Report an abuse
2018 security: 2277 security:
@@ -2042,10 +2301,12 @@ paths:
2042 - $ref: '#/components/schemas/Video/properties/id' 2301 - $ref: '#/components/schemas/Video/properties/id'
2043 startAt: 2302 startAt:
2044 type: integer 2303 type: integer
2304 format: seconds
2045 description: Timestamp in the video that marks the beginning of the report 2305 description: Timestamp in the video that marks the beginning of the report
2046 minimum: 0 2306 minimum: 0
2047 endAt: 2307 endAt:
2048 type: integer 2308 type: integer
2309 format: seconds
2049 description: Timestamp in the video that marks the ending of the report 2310 description: Timestamp in the video that marks the ending of the report
2050 minimum: 0 2311 minimum: 0
2051 comment: 2312 comment:
@@ -2064,10 +2325,21 @@ paths:
2064 required: 2325 required:
2065 - reason 2326 - reason
2066 responses: 2327 responses:
2067 '204': 2328 '200':
2068 description: successful operation 2329 description: successful operation
2330 content:
2331 application/json:
2332 schema:
2333 type: object
2334 properties:
2335 abuse:
2336 type: object
2337 properties:
2338 id:
2339 $ref: '#/components/schemas/id'
2069 '400': 2340 '400':
2070 description: incorrect request parameters 2341 description: incorrect request parameters
2342
2071 '/abuses/{abuseId}': 2343 '/abuses/{abuseId}':
2072 put: 2344 put:
2073 summary: Update an abuse 2345 summary: Update an abuse
@@ -2112,6 +2384,7 @@ paths:
2112 description: successful operation 2384 description: successful operation
2113 '404': 2385 '404':
2114 description: block not found 2386 description: block not found
2387
2115 '/abuses/{abuseId}/messages': 2388 '/abuses/{abuseId}/messages':
2116 get: 2389 get:
2117 summary: List messages of an abuse 2390 summary: List messages of an abuse
@@ -2127,10 +2400,15 @@ paths:
2127 content: 2400 content:
2128 application/json: 2401 application/json:
2129 schema: 2402 schema:
2130 type: array 2403 type: object
2131 items: 2404 properties:
2132 $ref: '#/components/schemas/AbuseMessage' 2405 total:
2133 2406 type: integer
2407 example: 1
2408 data:
2409 type: array
2410 items:
2411 $ref: '#/components/schemas/AbuseMessage'
2134 post: 2412 post:
2135 summary: Add message to an abuse 2413 summary: Add message to an abuse
2136 security: 2414 security:
@@ -2158,6 +2436,7 @@ paths:
2158 description: successful operation 2436 description: successful operation
2159 '400': 2437 '400':
2160 description: incorrect request parameters 2438 description: incorrect request parameters
2439
2161 '/abuses/{abuseId}/messages/{abuseMessageId}': 2440 '/abuses/{abuseId}/messages/{abuseMessageId}':
2162 delete: 2441 delete:
2163 summary: Delete an abuse message 2442 summary: Delete an abuse message
@@ -2175,6 +2454,7 @@ paths:
2175 '/videos/{id}/blacklist': 2454 '/videos/{id}/blacklist':
2176 post: 2455 post:
2177 summary: Block a video 2456 summary: Block a video
2457 operationId: addVideoBlock
2178 security: 2458 security:
2179 - OAuth2: 2459 - OAuth2:
2180 - admin 2460 - admin
@@ -2188,6 +2468,7 @@ paths:
2188 description: successful operation 2468 description: successful operation
2189 delete: 2469 delete:
2190 summary: Unblock a video by its id 2470 summary: Unblock a video by its id
2471 operationId: delVideoBlock
2191 security: 2472 security:
2192 - OAuth2: 2473 - OAuth2:
2193 - admin 2474 - admin
@@ -2201,11 +2482,13 @@ paths:
2201 description: successful operation 2482 description: successful operation
2202 '404': 2483 '404':
2203 description: block not found 2484 description: block not found
2485
2204 /videos/blacklist: 2486 /videos/blacklist:
2205 get: 2487 get:
2206 tags: 2488 tags:
2207 - Video Blocks 2489 - Video Blocks
2208 summary: List video blocks 2490 summary: List video blocks
2491 operationId: getVideoBlocks
2209 security: 2492 security:
2210 - OAuth2: 2493 - OAuth2:
2211 - admin 2494 - admin
@@ -2247,9 +2530,11 @@ paths:
2247 type: array 2530 type: array
2248 items: 2531 items:
2249 $ref: '#/components/schemas/VideoBlacklist' 2532 $ref: '#/components/schemas/VideoBlacklist'
2533
2250 /videos/{id}/captions: 2534 /videos/{id}/captions:
2251 get: 2535 get:
2252 summary: List captions of a video 2536 summary: List captions of a video
2537 operationId: getVideoCaptions
2253 tags: 2538 tags:
2254 - Video Captions 2539 - Video Captions
2255 parameters: 2540 parameters:
@@ -2269,9 +2554,11 @@ paths:
2269 type: array 2554 type: array
2270 items: 2555 items:
2271 $ref: '#/components/schemas/VideoCaption' 2556 $ref: '#/components/schemas/VideoCaption'
2557
2272 /videos/{id}/captions/{captionLanguage}: 2558 /videos/{id}/captions/{captionLanguage}:
2273 put: 2559 put:
2274 summary: Add or replace a video caption 2560 summary: Add or replace a video caption
2561 operationId: addVideoCaption
2275 security: 2562 security:
2276 - OAuth2: 2563 - OAuth2:
2277 - user 2564 - user
@@ -2300,6 +2587,7 @@ paths:
2300 description: video or language not found 2587 description: video or language not found
2301 delete: 2588 delete:
2302 summary: Delete a video caption 2589 summary: Delete a video caption
2590 operationId: delVideoCaption
2303 security: 2591 security:
2304 - OAuth2: 2592 - OAuth2:
2305 - user 2593 - user
@@ -2313,9 +2601,11 @@ paths:
2313 description: successful operation 2601 description: successful operation
2314 '404': 2602 '404':
2315 description: video or language or caption for that language not found 2603 description: video or language or caption for that language not found
2604
2316 /video-channels: 2605 /video-channels:
2317 get: 2606 get:
2318 summary: List video channels 2607 summary: List video channels
2608 operationId: getVideoChannels
2319 tags: 2609 tags:
2320 - Video Channels 2610 - Video Channels
2321 parameters: 2611 parameters:
@@ -2331,6 +2621,7 @@ paths:
2331 $ref: '#/components/schemas/VideoChannelList' 2621 $ref: '#/components/schemas/VideoChannelList'
2332 post: 2622 post:
2333 summary: Create a video channel 2623 summary: Create a video channel
2624 operationId: addVideoChannel
2334 security: 2625 security:
2335 - OAuth2: [] 2626 - OAuth2: []
2336 tags: 2627 tags:
@@ -2338,14 +2629,26 @@ paths:
2338 responses: 2629 responses:
2339 '204': 2630 '204':
2340 description: successful operation 2631 description: successful operation
2632 content:
2633 application/json:
2634 schema:
2635 type: object
2636 properties:
2637 videoChannel:
2638 type: object
2639 properties:
2640 id:
2641 $ref: '#/components/schemas/VideoChannel/properties/id'
2341 requestBody: 2642 requestBody:
2342 content: 2643 content:
2343 application/json: 2644 application/json:
2344 schema: 2645 schema:
2345 $ref: '#/components/schemas/VideoChannelCreate' 2646 $ref: '#/components/schemas/VideoChannelCreate'
2647
2346 '/video-channels/{channelHandle}': 2648 '/video-channels/{channelHandle}':
2347 get: 2649 get:
2348 summary: Get a video channel 2650 summary: Get a video channel
2651 operationId: getVideoChannel
2349 tags: 2652 tags:
2350 - Video Channels 2653 - Video Channels
2351 parameters: 2654 parameters:
@@ -2359,6 +2662,7 @@ paths:
2359 $ref: '#/components/schemas/VideoChannel' 2662 $ref: '#/components/schemas/VideoChannel'
2360 put: 2663 put:
2361 summary: Update a video channel 2664 summary: Update a video channel
2665 operationId: putVideoChannel
2362 security: 2666 security:
2363 - OAuth2: [] 2667 - OAuth2: []
2364 tags: 2668 tags:
@@ -2375,6 +2679,7 @@ paths:
2375 $ref: '#/components/schemas/VideoChannelUpdate' 2679 $ref: '#/components/schemas/VideoChannelUpdate'
2376 delete: 2680 delete:
2377 summary: Delete a video channel 2681 summary: Delete a video channel
2682 operationId: delVideoChannel
2378 security: 2683 security:
2379 - OAuth2: [] 2684 - OAuth2: []
2380 tags: 2685 tags:
@@ -2384,9 +2689,11 @@ paths:
2384 responses: 2689 responses:
2385 '204': 2690 '204':
2386 description: successful operation 2691 description: successful operation
2692
2387 '/video-channels/{channelHandle}/videos': 2693 '/video-channels/{channelHandle}/videos':
2388 get: 2694 get:
2389 summary: List videos of a video channel 2695 summary: List videos of a video channel
2696 operationId: getVideoChannelVideos
2390 tags: 2697 tags:
2391 - Video 2698 - Video
2392 - Video Channels 2699 - Video Channels
@@ -2411,6 +2718,7 @@ paths:
2411 application/json: 2718 application/json:
2412 schema: 2719 schema:
2413 $ref: '#/components/schemas/VideoListResponse' 2720 $ref: '#/components/schemas/VideoListResponse'
2721
2414 '/video-channels/{channelHandle}/avatar/pick': 2722 '/video-channels/{channelHandle}/avatar/pick':
2415 post: 2723 post:
2416 summary: Update channel avatar 2724 summary: Update channel avatar
@@ -2451,6 +2759,7 @@ paths:
2451 encoding: 2759 encoding:
2452 avatarfile: 2760 avatarfile:
2453 contentType: image/png, image/jpeg 2761 contentType: image/png, image/jpeg
2762
2454 '/video-channels/{channelHandle}/avatar': 2763 '/video-channels/{channelHandle}/avatar':
2455 delete: 2764 delete:
2456 summary: Delete channel avatar 2765 summary: Delete channel avatar
@@ -2464,7 +2773,6 @@ paths:
2464 '204': 2773 '204':
2465 description: successful operation 2774 description: successful operation
2466 2775
2467
2468 '/video-channels/{channelHandle}/banner/pick': 2776 '/video-channels/{channelHandle}/banner/pick':
2469 post: 2777 post:
2470 summary: Update channel banner 2778 summary: Update channel banner
@@ -2505,6 +2813,7 @@ paths:
2505 encoding: 2813 encoding:
2506 bannerfile: 2814 bannerfile:
2507 contentType: image/png, image/jpeg 2815 contentType: image/png, image/jpeg
2816
2508 '/video-channels/{channelHandle}/banner': 2817 '/video-channels/{channelHandle}/banner':
2509 delete: 2818 delete:
2510 summary: Delete channel banner 2819 summary: Delete channel banner
@@ -2617,13 +2926,13 @@ paths:
2617 thumbnailfile: 2926 thumbnailfile:
2618 contentType: image/jpeg 2927 contentType: image/jpeg
2619 2928
2620 /video-playlists/{id}: 2929 /video-playlists/{playlistId}:
2621 get: 2930 get:
2622 summary: Get a video playlist 2931 summary: Get a video playlist
2623 tags: 2932 tags:
2624 - Video Playlists 2933 - Video Playlists
2625 parameters: 2934 parameters:
2626 - $ref: '#/components/parameters/idOrUUID' 2935 - $ref: '#/components/parameters/playlistId'
2627 responses: 2936 responses:
2628 '200': 2937 '200':
2629 description: successful operation 2938 description: successful operation
@@ -2642,7 +2951,7 @@ paths:
2642 '204': 2951 '204':
2643 description: successful operation 2952 description: successful operation
2644 parameters: 2953 parameters:
2645 - $ref: '#/components/parameters/idOrUUID' 2954 - $ref: '#/components/parameters/playlistId'
2646 requestBody: 2955 requestBody:
2647 content: 2956 content:
2648 multipart/form-data: 2957 multipart/form-data:
@@ -2677,19 +2986,19 @@ paths:
2677 tags: 2986 tags:
2678 - Video Playlists 2987 - Video Playlists
2679 parameters: 2988 parameters:
2680 - $ref: '#/components/parameters/idOrUUID' 2989 - $ref: '#/components/parameters/playlistId'
2681 responses: 2990 responses:
2682 '204': 2991 '204':
2683 description: successful operation 2992 description: successful operation
2684 2993
2685 /video-playlists/{id}/videos: 2994 /video-playlists/{playlistId}/videos:
2686 get: 2995 get:
2687 summary: 'List videos of a playlist' 2996 summary: 'List videos of a playlist'
2688 tags: 2997 tags:
2689 - Videos 2998 - Videos
2690 - Video Playlists 2999 - Video Playlists
2691 parameters: 3000 parameters:
2692 - $ref: '#/components/parameters/idOrUUID' 3001 - $ref: '#/components/parameters/playlistId'
2693 responses: 3002 responses:
2694 '200': 3003 '200':
2695 description: successful operation 3004 description: successful operation
@@ -2698,14 +3007,14 @@ paths:
2698 schema: 3007 schema:
2699 $ref: '#/components/schemas/VideoListResponse' 3008 $ref: '#/components/schemas/VideoListResponse'
2700 post: 3009 post:
2701 summary: 'Add a video in a playlist' 3010 summary: Add a video in a playlist
2702 security: 3011 security:
2703 - OAuth2: [] 3012 - OAuth2: []
2704 tags: 3013 tags:
2705 - Videos 3014 - Videos
2706 - Video Playlists 3015 - Video Playlists
2707 parameters: 3016 parameters:
2708 - $ref: '#/components/parameters/idOrUUID' 3017 - $ref: '#/components/parameters/playlistId'
2709 responses: 3018 responses:
2710 '200': 3019 '200':
2711 description: successful operation 3020 description: successful operation
@@ -2719,6 +3028,7 @@ paths:
2719 properties: 3028 properties:
2720 id: 3029 id:
2721 type: integer 3030 type: integer
3031 example: 2
2722 requestBody: 3032 requestBody:
2723 content: 3033 content:
2724 application/json: 3034 application/json:
@@ -2726,19 +3036,22 @@ paths:
2726 type: object 3036 type: object
2727 properties: 3037 properties:
2728 videoId: 3038 videoId:
2729 allOf: 3039 oneOf:
3040 - $ref: '#/components/schemas/Video/properties/uuid'
2730 - $ref: '#/components/schemas/Video/properties/id' 3041 - $ref: '#/components/schemas/Video/properties/id'
2731 description: Video to add in the playlist 3042 description: Video to add in the playlist
2732 startTimestamp: 3043 startTimestamp:
2733 type: integer 3044 type: integer
2734 description: Start the video at this specific timestamp (in seconds) 3045 format: seconds
3046 description: Start the video at this specific timestamp
2735 stopTimestamp: 3047 stopTimestamp:
2736 type: integer 3048 type: integer
2737 description: Stop the video at this specific timestamp (in seconds) 3049 format: seconds
3050 description: Stop the video at this specific timestamp
2738 required: 3051 required:
2739 - videoId 3052 - videoId
2740 3053
2741 /video-playlists/{id}/videos/reorder: 3054 /video-playlists/{playlistId}/videos/reorder:
2742 post: 3055 post:
2743 summary: 'Reorder a playlist' 3056 summary: 'Reorder a playlist'
2744 security: 3057 security:
@@ -2746,7 +3059,7 @@ paths:
2746 tags: 3059 tags:
2747 - Video Playlists 3060 - Video Playlists
2748 parameters: 3061 parameters:
2749 - $ref: '#/components/parameters/idOrUUID' 3062 - $ref: '#/components/parameters/playlistId'
2750 responses: 3063 responses:
2751 '204': 3064 '204':
2752 description: successful operation 3065 description: successful operation
@@ -2772,15 +3085,15 @@ paths:
2772 - startPosition 3085 - startPosition
2773 - insertAfterPosition 3086 - insertAfterPosition
2774 3087
2775 /video-playlists/{id}/videos/{playlistElementId}: 3088 /video-playlists/{playlistId}/videos/{playlistElementId}:
2776 put: 3089 put:
2777 summary: 'Update a playlist element' 3090 summary: Update a playlist element
2778 security: 3091 security:
2779 - OAuth2: [] 3092 - OAuth2: []
2780 tags: 3093 tags:
2781 - Video Playlists 3094 - Video Playlists
2782 parameters: 3095 parameters:
2783 - $ref: '#/components/parameters/idOrUUID' 3096 - $ref: '#/components/parameters/playlistId'
2784 - $ref: '#/components/parameters/playlistElementId' 3097 - $ref: '#/components/parameters/playlistElementId'
2785 responses: 3098 responses:
2786 '204': 3099 '204':
@@ -2793,18 +3106,20 @@ paths:
2793 properties: 3106 properties:
2794 startTimestamp: 3107 startTimestamp:
2795 type: integer 3108 type: integer
2796 description: 'Start the video at this specific timestamp (in seconds)' 3109 format: seconds
3110 description: Start the video at this specific timestamp
2797 stopTimestamp: 3111 stopTimestamp:
2798 type: integer 3112 type: integer
2799 description: 'Stop the video at this specific timestamp (in seconds)' 3113 format: seconds
3114 description: Stop the video at this specific timestamp
2800 delete: 3115 delete:
2801 summary: 'Delete an element from a playlist' 3116 summary: Delete an element from a playlist
2802 security: 3117 security:
2803 - OAuth2: [] 3118 - OAuth2: []
2804 tags: 3119 tags:
2805 - Video Playlists 3120 - Video Playlists
2806 parameters: 3121 parameters:
2807 - $ref: '#/components/parameters/idOrUUID' 3122 - $ref: '#/components/parameters/playlistId'
2808 - $ref: '#/components/parameters/playlistElementId' 3123 - $ref: '#/components/parameters/playlistElementId'
2809 responses: 3124 responses:
2810 '204': 3125 '204':
@@ -2812,7 +3127,7 @@ paths:
2812 3127
2813 '/users/me/video-playlists/videos-exist': 3128 '/users/me/video-playlists/videos-exist':
2814 get: 3129 get:
2815 summary: 'Check video exists in my playlists' 3130 summary: Check video exists in my playlists
2816 security: 3131 security:
2817 - OAuth2: [] 3132 - OAuth2: []
2818 tags: 3133 tags:
@@ -2845,8 +3160,10 @@ paths:
2845 type: integer 3160 type: integer
2846 startTimestamp: 3161 startTimestamp:
2847 type: integer 3162 type: integer
3163 format: seconds
2848 stopTimestamp: 3164 stopTimestamp:
2849 type: integer 3165 type: integer
3166 format: seconds
2850 3167
2851 '/accounts/{name}/video-channels': 3168 '/accounts/{name}/video-channels':
2852 get: 3169 get:
@@ -2871,6 +3188,7 @@ paths:
2871 application/json: 3188 application/json:
2872 schema: 3189 schema:
2873 $ref: '#/components/schemas/VideoChannelList' 3190 $ref: '#/components/schemas/VideoChannelList'
3191
2874 '/accounts/{name}/ratings': 3192 '/accounts/{name}/ratings':
2875 get: 3193 get:
2876 summary: List ratings of an account 3194 summary: List ratings of an account
@@ -2901,6 +3219,7 @@ paths:
2901 type: array 3219 type: array
2902 items: 3220 items:
2903 $ref: '#/components/schemas/VideoRating' 3221 $ref: '#/components/schemas/VideoRating'
3222
2904 '/videos/{id}/comment-threads': 3223 '/videos/{id}/comment-threads':
2905 get: 3224 get:
2906 summary: List threads of a video 3225 summary: List threads of a video
@@ -2942,8 +3261,10 @@ paths:
2942 type: object 3261 type: object
2943 properties: 3262 properties:
2944 text: 3263 text:
2945 type: string 3264 allOf:
2946 description: 'Text comment' 3265 - $ref: '#/components/schemas/VideoComment/properties/text'
3266 format: markdown
3267 maxLength: 10000
2947 required: 3268 required:
2948 - text 3269 - text
2949 3270
@@ -2962,6 +3283,7 @@ paths:
2962 application/json: 3283 application/json:
2963 schema: 3284 schema:
2964 $ref: '#/components/schemas/VideoCommentThreadTree' 3285 $ref: '#/components/schemas/VideoCommentThreadTree'
3286
2965 '/videos/{id}/comments/{commentId}': 3287 '/videos/{id}/comments/{commentId}':
2966 post: 3288 post:
2967 summary: Reply to a thread of a video 3289 summary: Reply to a thread of a video
@@ -2988,10 +3310,12 @@ paths:
2988 type: object 3310 type: object
2989 properties: 3311 properties:
2990 text: 3312 text:
2991 $ref: '#/components/schemas/VideoComment/properties/text' 3313 allOf:
3314 - $ref: '#/components/schemas/VideoComment/properties/text'
3315 format: markdown
3316 maxLength: 10000
2992 required: 3317 required:
2993 - text 3318 - text
2994
2995 delete: 3319 delete:
2996 summary: Delete a comment or a reply 3320 summary: Delete a comment or a reply
2997 security: 3321 security:
@@ -3010,6 +3334,7 @@ paths:
3010 description: comment or video does not exist 3334 description: comment or video does not exist
3011 '409': 3335 '409':
3012 description: comment is already deleted 3336 description: comment is already deleted
3337
3013 '/videos/{id}/rate': 3338 '/videos/{id}/rate':
3014 put: 3339 put:
3015 summary: Like/dislike a video 3340 summary: Like/dislike a video
@@ -3019,11 +3344,25 @@ paths:
3019 - Video Rates 3344 - Video Rates
3020 parameters: 3345 parameters:
3021 - $ref: '#/components/parameters/idOrUUID' 3346 - $ref: '#/components/parameters/idOrUUID'
3347 requestBody:
3348 content:
3349 application/json:
3350 schema:
3351 type: object
3352 properties:
3353 rating:
3354 type: string
3355 enum:
3356 - like
3357 - dislike
3358 required:
3359 - rating
3022 responses: 3360 responses:
3023 '204': 3361 '204':
3024 description: successful operation 3362 description: successful operation
3025 '404': 3363 '404':
3026 description: video does not exist 3364 description: video does not exist
3365
3027 /search/videos: 3366 /search/videos:
3028 get: 3367 get:
3029 tags: 3368 tags:
@@ -3099,6 +3438,7 @@ paths:
3099 $ref: '#/components/schemas/VideoListResponse' 3438 $ref: '#/components/schemas/VideoListResponse'
3100 '500': 3439 '500':
3101 description: search index unavailable 3440 description: search index unavailable
3441
3102 /search/video-channels: 3442 /search/video-channels:
3103 get: 3443 get:
3104 tags: 3444 tags:
@@ -3130,7 +3470,8 @@ paths:
3130 $ref: '#/components/schemas/VideoChannelList' 3470 $ref: '#/components/schemas/VideoChannelList'
3131 '500': 3471 '500':
3132 description: search index unavailable 3472 description: search index unavailable
3133 /blocklist/accounts: 3473
3474 /server/blocklist/accounts:
3134 get: 3475 get:
3135 tags: 3476 tags:
3136 - Account Blocks 3477 - Account Blocks
@@ -3169,7 +3510,8 @@ paths:
3169 description: successful operation 3510 description: successful operation
3170 '409': 3511 '409':
3171 description: self-blocking forbidden 3512 description: self-blocking forbidden
3172 '/blocklist/accounts/{accountName}': 3513
3514 '/server/blocklist/accounts/{accountName}':
3173 delete: 3515 delete:
3174 tags: 3516 tags:
3175 - Account Blocks 3517 - Account Blocks
@@ -3189,7 +3531,8 @@ paths:
3189 description: successful operation 3531 description: successful operation
3190 '404': 3532 '404':
3191 description: account or account block does not exist 3533 description: account or account block does not exist
3192 /blocklist/servers: 3534
3535 /server/blocklist/servers:
3193 get: 3536 get:
3194 tags: 3537 tags:
3195 - Server Blocks 3538 - Server Blocks
@@ -3224,11 +3567,12 @@ paths:
3224 required: 3567 required:
3225 - host 3568 - host
3226 responses: 3569 responses:
3227 '200': 3570 '204':
3228 description: successful operation 3571 description: successful operation
3229 '409': 3572 '409':
3230 description: self-blocking forbidden 3573 description: self-blocking forbidden
3231 '/blocklist/servers/{host}': 3574
3575 '/server/blocklist/servers/{host}':
3232 delete: 3576 delete:
3233 tags: 3577 tags:
3234 - Server Blocks 3578 - Server Blocks
@@ -3245,11 +3589,12 @@ paths:
3245 type: string 3589 type: string
3246 format: hostname 3590 format: hostname
3247 responses: 3591 responses:
3248 '201': 3592 '204':
3249 description: successful operation 3593 description: successful operation
3250 '404': 3594 '404':
3251 description: account block does not exist 3595 description: account block does not exist
3252 /redundancy/{host}: 3596
3597 /server/redundancy/{host}:
3253 put: 3598 put:
3254 tags: 3599 tags:
3255 - Instance Redundancy 3600 - Instance Redundancy
@@ -3281,7 +3626,8 @@ paths:
3281 description: successful operation 3626 description: successful operation
3282 '404': 3627 '404':
3283 description: server is not already known 3628 description: server is not already known
3284 /redundancy/videos: 3629
3630 /server/redundancy/videos:
3285 get: 3631 get:
3286 tags: 3632 tags:
3287 - Video Mirroring 3633 - Video Mirroring
@@ -3337,7 +3683,8 @@ paths:
3337 description: video does not exist 3683 description: video does not exist
3338 '409': 3684 '409':
3339 description: video is already mirrored 3685 description: video is already mirrored
3340 /redundancy/videos/{redundancyId}: 3686
3687 /server/redundancy/videos/{redundancyId}:
3341 delete: 3688 delete:
3342 tags: 3689 tags:
3343 - Video Mirroring 3690 - Video Mirroring
@@ -3357,6 +3704,7 @@ paths:
3357 description: successful operation 3704 description: successful operation
3358 '404': 3705 '404':
3359 description: video redundancy not found 3706 description: video redundancy not found
3707
3360 '/feeds/video-comments.{format}': 3708 '/feeds/video-comments.{format}':
3361 get: 3709 get:
3362 tags: 3710 tags:
@@ -3450,6 +3798,7 @@ paths:
3450 description: video, video channel or account not found 3798 description: video, video channel or account not found
3451 '406': 3799 '406':
3452 description: accept header unsupported 3800 description: accept header unsupported
3801
3453 '/feeds/videos.{format}': 3802 '/feeds/videos.{format}':
3454 get: 3803 get:
3455 tags: 3804 tags:
@@ -3536,6 +3885,7 @@ paths:
3536 description: video channel or account not found 3885 description: video channel or account not found
3537 '406': 3886 '406':
3538 description: accept header unsupported 3887 description: accept header unsupported
3888
3539 '/feeds/subscriptions.{format}': 3889 '/feeds/subscriptions.{format}':
3540 get: 3890 get:
3541 tags: 3891 tags:
@@ -3598,6 +3948,7 @@ paths:
3598 type: object 3948 type: object
3599 '406': 3949 '406':
3600 description: accept header unsupported 3950 description: accept header unsupported
3951
3601 /plugins: 3952 /plugins:
3602 get: 3953 get:
3603 tags: 3954 tags:
@@ -3625,6 +3976,7 @@ paths:
3625 application/json: 3976 application/json:
3626 schema: 3977 schema:
3627 $ref: '#/components/schemas/PluginResponse' 3978 $ref: '#/components/schemas/PluginResponse'
3979
3628 /plugins/available: 3980 /plugins/available:
3629 get: 3981 get:
3630 tags: 3982 tags:
@@ -3658,6 +4010,7 @@ paths:
3658 $ref: '#/components/schemas/PluginResponse' 4010 $ref: '#/components/schemas/PluginResponse'
3659 '503': 4011 '503':
3660 description: plugin index unavailable 4012 description: plugin index unavailable
4013
3661 /plugins/install: 4014 /plugins/install:
3662 post: 4015 post:
3663 tags: 4016 tags:
@@ -3691,6 +4044,7 @@ paths:
3691 description: successful operation 4044 description: successful operation
3692 '400': 4045 '400':
3693 description: should have either `npmName` or `path` set 4046 description: should have either `npmName` or `path` set
4047
3694 /plugins/update: 4048 /plugins/update:
3695 post: 4049 post:
3696 tags: 4050 tags:
@@ -3726,6 +4080,7 @@ paths:
3726 description: should have either `npmName` or `path` set 4080 description: should have either `npmName` or `path` set
3727 '404': 4081 '404':
3728 description: existing plugin not found 4082 description: existing plugin not found
4083
3729 /plugins/uninstall: 4084 /plugins/uninstall:
3730 post: 4085 post:
3731 tags: 4086 tags:
@@ -3751,6 +4106,7 @@ paths:
3751 description: successful operation 4106 description: successful operation
3752 '404': 4107 '404':
3753 description: existing plugin not found 4108 description: existing plugin not found
4109
3754 /plugins/{npmName}: 4110 /plugins/{npmName}:
3755 get: 4111 get:
3756 tags: 4112 tags:
@@ -3770,6 +4126,7 @@ paths:
3770 $ref: '#/components/schemas/Plugin' 4126 $ref: '#/components/schemas/Plugin'
3771 '404': 4127 '404':
3772 description: plugin not found 4128 description: plugin not found
4129
3773 /plugins/{npmName}/settings: 4130 /plugins/{npmName}/settings:
3774 put: 4131 put:
3775 tags: 4132 tags:
@@ -3794,6 +4151,7 @@ paths:
3794 description: successful operation 4151 description: successful operation
3795 '404': 4152 '404':
3796 description: plugin not found 4153 description: plugin not found
4154
3797 /plugins/{npmName}/public-settings: 4155 /plugins/{npmName}/public-settings:
3798 get: 4156 get:
3799 tags: 4157 tags:
@@ -3811,6 +4169,7 @@ paths:
3811 additionalProperties: true 4169 additionalProperties: true
3812 '404': 4170 '404':
3813 description: plugin not found 4171 description: plugin not found
4172
3814 /plugins/{npmName}/registered-settings: 4173 /plugins/{npmName}/registered-settings:
3815 get: 4174 get:
3816 tags: 4175 tags:
@@ -3831,6 +4190,7 @@ paths:
3831 additionalProperties: true 4190 additionalProperties: true
3832 '404': 4191 '404':
3833 description: plugin not found 4192 description: plugin not found
4193
3834servers: 4194servers:
3835 - url: 'https://peertube2.cpy.re/api/v1' 4195 - url: 'https://peertube2.cpy.re/api/v1'
3836 description: Live Test Server (live data - latest nightly version) 4196 description: Live Test Server (live data - latest nightly version)
@@ -4019,6 +4379,13 @@ components:
4019 oneOf: 4379 oneOf:
4020 - $ref: '#/components/schemas/id' 4380 - $ref: '#/components/schemas/id'
4021 - $ref: '#/components/schemas/UUIDv4' 4381 - $ref: '#/components/schemas/UUIDv4'
4382 playlistId:
4383 name: playlistId
4384 in: path
4385 required: true
4386 description: Playlist id
4387 schema:
4388 $ref: '#/components/schemas/VideoPlaylist/properties/id'
4022 playlistElementId: 4389 playlistElementId:
4023 name: playlistElementId 4390 name: playlistElementId
4024 in: path 4391 in: path
@@ -4223,22 +4590,42 @@ components:
4223 - activitypub-refresher 4590 - activitypub-refresher
4224 - video-redundancy 4591 - video-redundancy
4225 - video-live-ending 4592 - video-live-ending
4593 followState:
4594 name: state
4595 in: query
4596 schema:
4597 type: string
4598 enum:
4599 - pending
4600 - accepted
4601 actorType:
4602 name: actorType
4603 in: query
4604 schema:
4605 type: string
4606 enum:
4607 - Person
4608 - Application
4609 - Group
4610 - Service
4611 - Organization
4226 securitySchemes: 4612 securitySchemes:
4227 OAuth2: 4613 OAuth2:
4228 description: | 4614 description: |
4229 Authenticating via OAuth requires the following steps: 4615 Authenticating via OAuth requires the following steps:
4230 - Have an activated account 4616 - Have an activated account
4231 - [Generate](https://docs.joinpeertube.org/api-rest-getting-started) a 4617 - [Generate] an access token for that account at `/api/v1/users/token`.
4232 Bearer Token for that account at `/api/v1/users/token` 4618 - Make requests with the *Authorization: Bearer <token\>* header
4233 - Make authenticated requests, putting *Authorization: Bearer <token\>*
4234 - Profit, depending on the role assigned to the account 4619 - Profit, depending on the role assigned to the account
4235 4620
4236 Note that the __access token is valid for 1 day__ and, and is given 4621 Note that the __access token is valid for 1 day__ and is given
4237 along with a __refresh token valid for 2 weeks__. 4622 along with a __refresh token valid for 2 weeks__.
4623
4624 [Generate]: https://docs.joinpeertube.org/api-rest-getting-started
4238 type: oauth2 4625 type: oauth2
4239 flows: 4626 flows:
4240 password: 4627 password:
4241 tokenUrl: 'https://peertube.example.com/api/v1/users/token' 4628 tokenUrl: /api/v1/users/token
4242 scopes: 4629 scopes:
4243 admin: Admin scope 4630 admin: Admin scope
4244 moderator: Moderator scope 4631 moderator: Moderator scope
@@ -4258,20 +4645,21 @@ components:
4258 maxLength: 36 4645 maxLength: 36
4259 username: 4646 username:
4260 type: string 4647 type: string
4261 description: The username of the user 4648 description: immutable name of the user, used to find or mention its actor
4262 example: chocobozzz 4649 example: chocobozzz
4263 pattern: '/^[a-z0-9._]{1,50}$/' 4650 pattern: '/^[a-z0-9._]+$/'
4264 minLength: 1 4651 minLength: 1
4265 maxLength: 50 4652 maxLength: 50
4266 usernameChannel: 4653 usernameChannel:
4267 type: string 4654 type: string
4268 description: The username for the default channel 4655 description: immutable name of the channel, used to interact with its actor
4269 example: The Capybara Channel 4656 example: framasoft_videos
4270 pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/' 4657 pattern: '/^[a-zA-Z0-9\\-_.:]+$/'
4658 minLength: 1
4659 maxLength: 50
4271 password: 4660 password:
4272 type: string 4661 type: string
4273 format: password 4662 format: password
4274 description: The password of the user
4275 minLength: 6 4663 minLength: 6
4276 maxLength: 255 4664 maxLength: 255
4277 4665
@@ -4483,8 +4871,10 @@ components:
4483 type: integer 4871 type: integer
4484 startTimestamp: 4872 startTimestamp:
4485 type: integer 4873 type: integer
4874 format: seconds
4486 stopTimestamp: 4875 stopTimestamp:
4487 type: integer 4876 type: integer
4877 format: seconds
4488 video: 4878 video:
4489 nullable: true 4879 nullable: true
4490 allOf: 4880 allOf:
@@ -4633,6 +5023,7 @@ components:
4633 duration: 5023 duration:
4634 type: integer 5024 type: integer
4635 example: 1419 5025 example: 1419
5026 format: seconds
4636 description: duration of the video in seconds 5027 description: duration of the video in seconds
4637 isLocal: 5028 isLocal:
4638 type: boolean 5029 type: boolean
@@ -4701,7 +5092,7 @@ components:
4701 support: 5092 support:
4702 type: string 5093 type: string
4703 description: A text tell the audience how to support the video creator 5094 description: A text tell the audience how to support the video creator
4704 example: Please support my work on <insert crowdfunding plateform>! <3 5095 example: Please support our work on https://soutenir.framasoft.org/en/ <3
4705 minLength: 3 5096 minLength: 3
4706 maxLength: 1000 5097 maxLength: 1000
4707 channel: 5098 channel:
@@ -4806,10 +5197,33 @@ components:
4806 label: 5197 label:
4807 type: string 5198 type: string
4808 example: Pending 5199 example: Pending
5200 VideoCreateImport:
5201 allOf:
5202 - type: object
5203 additionalProperties: false
5204 oneOf:
5205 - properties:
5206 targetUrl:
5207 $ref: '#/components/schemas/VideoImport/properties/targetUrl'
5208 required: [targetUrl]
5209 - properties:
5210 magnetUri:
5211 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
5212 required: [magnetUri]
5213 - properties:
5214 torrentfile:
5215 $ref: '#/components/schemas/VideoImport/properties/torrentfile'
5216 required: [torrentfile]
5217 - $ref: '#/components/schemas/VideoUploadRequestCommon'
5218 required:
5219 - channelId
5220 - name
4809 VideoImport: 5221 VideoImport:
4810 properties: 5222 properties:
4811 id: 5223 id:
4812 $ref: '#/components/schemas/id' 5224 readOnly: true
5225 allOf:
5226 - $ref: '#/components/schemas/id'
4813 targetUrl: 5227 targetUrl:
4814 type: string 5228 type: string
4815 format: url 5229 format: url
@@ -4821,19 +5235,31 @@ components:
4821 description: magnet URI allowing to resolve the import's source video 5235 description: magnet URI allowing to resolve the import's source video
4822 example: magnet:?xs=https%3A%2F%2Fframatube.org%2Fstatic%2Ftorrents%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.torrent&xt=urn:btih:38b4747ff788b30bf61f59d1965cd38f9e48e01f&dn=What+is+PeerTube%3F&tr=wss%3A%2F%2Fframatube.org%2Ftracker%2Fsocket&tr=https%3A%2F%2Fframatube.org%2Ftracker%2Fannounce&ws=https%3A%2F%2Fframatube.org%2Fstatic%2Fwebseed%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.mp4 5236 example: magnet:?xs=https%3A%2F%2Fframatube.org%2Fstatic%2Ftorrents%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.torrent&xt=urn:btih:38b4747ff788b30bf61f59d1965cd38f9e48e01f&dn=What+is+PeerTube%3F&tr=wss%3A%2F%2Fframatube.org%2Ftracker%2Fsocket&tr=https%3A%2F%2Fframatube.org%2Ftracker%2Fannounce&ws=https%3A%2F%2Fframatube.org%2Fstatic%2Fwebseed%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.mp4
4823 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i 5237 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
5238 torrentfile:
5239 writeOnly: true
5240 type: string
5241 format: binary
5242 description: Torrent file containing only the video file
4824 torrentName: 5243 torrentName:
5244 readOnly: true
4825 type: string 5245 type: string
4826 state: 5246 state:
4827 $ref: '#/components/schemas/VideoImportStateConstant' 5247 readOnly: true
5248 allOf:
5249 - $ref: '#/components/schemas/VideoImportStateConstant'
4828 error: 5250 error:
5251 readOnly: true
4829 type: string 5252 type: string
4830 createdAt: 5253 createdAt:
5254 readOnly: true
4831 type: string 5255 type: string
4832 format: date-time 5256 format: date-time
4833 updatedAt: 5257 updatedAt:
5258 readOnly: true
4834 type: string 5259 type: string
4835 format: date-time 5260 format: date-time
4836 video: 5261 video:
5262 readOnly: true
4837 nullable: true 5263 nullable: true
4838 allOf: 5264 allOf:
4839 - $ref: '#/components/schemas/Video' 5265 - $ref: '#/components/schemas/Video'
@@ -4963,13 +5389,16 @@ components:
4963 format: url 5389 format: url
4964 text: 5390 text:
4965 type: string 5391 type: string
4966 description: Text of the comment in Markdown 5392 format: html
5393 description: Text of the comment
4967 minLength: 1 5394 minLength: 1
4968 maxLength: 10000 5395 example: This video is wonderful!
4969 threadId: 5396 threadId:
4970 type: integer
4971 inReplyToCommentId:
4972 $ref: '#/components/schemas/id' 5397 $ref: '#/components/schemas/id'
5398 inReplyToCommentId:
5399 nullable: true
5400 allOf:
5401 - $ref: '#/components/schemas/id'
4973 videoId: 5402 videoId:
4974 $ref: '#/components/schemas/Video/properties/id' 5403 $ref: '#/components/schemas/Video/properties/id'
4975 createdAt: 5404 createdAt:
@@ -4978,6 +5407,14 @@ components:
4978 updatedAt: 5407 updatedAt:
4979 type: string 5408 type: string
4980 format: date-time 5409 format: date-time
5410 deletedAt:
5411 nullable: true
5412 type: string
5413 format: date-time
5414 default: null
5415 isDeleted:
5416 type: boolean
5417 default: false
4981 totalRepliesFromVideoAuthor: 5418 totalRepliesFromVideoAuthor:
4982 type: integer 5419 type: integer
4983 minimum: 0 5420 minimum: 0
@@ -5035,7 +5472,7 @@ components:
5035 type: string 5472 type: string
5036 format: url 5473 format: url
5037 name: 5474 name:
5038 description: immutable name of the actor 5475 description: immutable name of the actor, used to find or mention it
5039 allOf: 5476 allOf:
5040 - $ref: '#/components/schemas/username' 5477 - $ref: '#/components/schemas/username'
5041 host: 5478 host:
@@ -5071,7 +5508,9 @@ components:
5071 - $ref: '#/components/schemas/User/properties/id' 5508 - $ref: '#/components/schemas/User/properties/id'
5072 displayName: 5509 displayName:
5073 type: string 5510 type: string
5074 description: name displayed on the account's profile 5511 description: editable name of the account, displayed in its representations
5512 minLength: 3
5513 maxLength: 120
5075 description: 5514 description:
5076 type: string 5515 type: string
5077 description: text or bio displayed on the account's profile 5516 description: text or bio displayed on the account's profile
@@ -5079,6 +5518,7 @@ components:
5079 properties: 5518 properties:
5080 currentTime: 5519 currentTime:
5081 type: integer 5520 type: integer
5521 format: seconds
5082 description: timestamp within the video, in seconds 5522 description: timestamp within the video, in seconds
5083 example: 5 5523 example: 5
5084 ServerConfig: 5524 ServerConfig:
@@ -5593,7 +6033,7 @@ components:
5593 type: boolean 6033 type: boolean
5594 support: 6034 support:
5595 description: A text tell the audience how to support the video creator 6035 description: A text tell the audience how to support the video creator
5596 example: Please support my work on <insert crowdfunding plateform>! <3 6036 example: Please support our work on https://soutenir.framasoft.org/en/ <3
5597 type: string 6037 type: string
5598 nsfw: 6038 nsfw:
5599 description: Whether or not this video contains sensitive content 6039 description: Whether or not this video contains sensitive content
@@ -5822,9 +6262,9 @@ components:
5822 UpdateUser: 6262 UpdateUser:
5823 properties: 6263 properties:
5824 email: 6264 email:
5825 type: string
5826 format: email
5827 description: The updated email of the user 6265 description: The updated email of the user
6266 allOf:
6267 - $ref: '#/components/schemas/User/properties/email'
5828 emailVerified: 6268 emailVerified:
5829 type: boolean 6269 type: boolean
5830 description: Set the email as verified 6270 description: Set the email as verified
@@ -5844,28 +6284,54 @@ components:
5844 adminFlags: 6284 adminFlags:
5845 $ref: '#/components/schemas/UserAdminFlags' 6285 $ref: '#/components/schemas/UserAdminFlags'
5846 UpdateMe: 6286 UpdateMe:
6287 # see shared/models/users/user-update-me.model.ts:
5847 properties: 6288 properties:
5848 password: 6289 password:
5849 $ref: '#/components/schemas/password' 6290 $ref: '#/components/schemas/password'
6291 currentPassword:
6292 $ref: '#/components/schemas/password'
5850 email: 6293 email:
6294 description: new email used for login and service communications
6295 allOf:
6296 - $ref: '#/components/schemas/User/properties/email'
6297 displayName:
5851 type: string 6298 type: string
5852 format: email 6299 description: new name of the user in its representations
5853 description: Your new email 6300 minLength: 3
6301 maxLength: 120
5854 displayNSFW: 6302 displayNSFW:
5855 type: string 6303 type: string
5856 description: Your new displayNSFW 6304 description: new NSFW display policy
5857 enum: 6305 enum:
5858 - 'true' 6306 - 'true'
5859 - 'false' 6307 - 'false'
5860 - both 6308 - both
6309 webTorrentEnabled:
6310 type: boolean
6311 description: whether to enable P2P in the player or not
5861 autoPlayVideo: 6312 autoPlayVideo:
5862 type: boolean 6313 type: boolean
5863 description: Your new autoPlayVideo 6314 description: new preference regarding playing videos automatically
5864 required: 6315 autoPlayNextVideo:
5865 - password 6316 type: boolean
5866 - email 6317 description: new preference regarding playing following videos automatically
5867 - displayNSFW 6318 autoPlayNextVideoPlaylist:
5868 - autoPlayVideo 6319 type: boolean
6320 description: new preference regarding playing following playlist videos automatically
6321 videosHistoryEnabled:
6322 type: boolean
6323 description: whether to keep track of watched history or not
6324 videoLanguages:
6325 type: array
6326 items:
6327 type: string
6328 description: list of languages to filter videos down to
6329 theme:
6330 type: string
6331 noInstanceConfigWarningModal:
6332 type: boolean
6333 noWelcomeModal:
6334 type: boolean
5869 GetMeVideoRating: 6335 GetMeVideoRating:
5870 properties: 6336 properties:
5871 id: 6337 id:
@@ -5897,38 +6363,94 @@ components:
5897 RegisterUser: 6363 RegisterUser:
5898 properties: 6364 properties:
5899 username: 6365 username:
5900 $ref: '#/components/schemas/username' 6366 description: immutable name of the user, used to find or mention its actor
6367 allOf:
6368 - $ref: '#/components/schemas/username'
5901 password: 6369 password:
5902 $ref: '#/components/schemas/password' 6370 $ref: '#/components/schemas/password'
5903 email: 6371 email:
5904 type: string 6372 type: string
5905 format: email 6373 format: email
5906 description: The email of the user 6374 description: email of the user, used for login or service communications
5907 displayName: 6375 displayName:
5908 type: string 6376 type: string
5909 description: The user display name 6377 description: editable name of the user, displayed in its representations
5910 minLength: 1 6378 minLength: 1
5911 maxLength: 120 6379 maxLength: 120
5912 channel: 6380 channel:
5913 type: object 6381 type: object
6382 description: channel base information used to create the first channel of the user
5914 properties: 6383 properties:
5915 name: 6384 name:
5916 $ref: '#/components/schemas/usernameChannel' 6385 $ref: '#/components/schemas/usernameChannel'
5917 displayName: 6386 displayName:
5918 type: string 6387 $ref: '#/components/schemas/VideoChannel/properties/displayName'
5919 description: The display name for the default channel
5920 minLength: 1
5921 maxLength: 120
5922 required: 6388 required:
5923 - username 6389 - username
5924 - password 6390 - password
5925 - email 6391 - email
5926 6392
6393 OAuthClient:
6394 properties:
6395 client_id:
6396 type: string
6397 pattern: /^[a-z0-9]$/
6398 maxLength: 32
6399 minLength: 32
6400 example: v1ikx5hnfop4mdpnci8nsqh93c45rldf
6401 client_secret:
6402 type: string
6403 pattern: /^[a-zA-Z0-9]$/
6404 maxLength: 32
6405 minLength: 32
6406 example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt
6407 OAuthToken-password:
6408 allOf:
6409 - $ref: '#/components/schemas/OAuthClient'
6410 - type: object
6411 properties:
6412 grant_type:
6413 type: string
6414 enum:
6415 - password
6416 - refresh_token
6417 default: password
6418 username:
6419 $ref: '#/components/schemas/User/properties/username'
6420 password:
6421 $ref: '#/components/schemas/password'
6422 required:
6423 - client_id
6424 - client_secret
6425 - grant_type
6426 - username
6427 - password
6428 OAuthToken-refresh_token:
6429 allOf:
6430 - $ref: '#/components/schemas/OAuthClient'
6431 - type: object
6432 properties:
6433 grant_type:
6434 type: string
6435 enum:
6436 - password
6437 - refresh_token
6438 default: password
6439 refresh_token:
6440 type: string
6441 example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7
6442 required:
6443 - client_id
6444 - client_secret
6445 - grant_type
6446 - refresh_token
6447
5927 VideoChannel: 6448 VideoChannel:
5928 properties: 6449 properties:
5929 # GET/POST/PUT properties 6450 # GET/POST/PUT properties
5930 displayName: 6451 displayName:
5931 type: string 6452 type: string
6453 description: editable name of the channel, displayed in its representations
5932 example: Videos of Framasoft 6454 example: Videos of Framasoft
5933 minLength: 1 6455 minLength: 1
5934 maxLength: 120 6456 maxLength: 120
@@ -5940,7 +6462,7 @@ components:
5940 support: 6462 support:
5941 type: string 6463 type: string
5942 description: text shown by default on all videos of this channel, to tell the audience how to support it 6464 description: text shown by default on all videos of this channel, to tell the audience how to support it
5943 example: Please support my work on <insert crowdfunding plateform>! <3 6465 example: Please support our work on https://soutenir.framasoft.org/en/ <3
5944 minLength: 3 6466 minLength: 3
5945 maxLength: 1000 6467 maxLength: 1000
5946 # GET-only properties 6468 # GET-only properties