diff options
Diffstat (limited to 'support/doc/api/openapi.yaml')
-rw-r--r-- | support/doc/api/openapi.yaml | 815 |
1 files changed, 604 insertions, 211 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 0e0d2ab5f..fc62f95bb 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` | 2¹ | 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. | ||
87 | externalDocs: | 121 | externalDocs: |
88 | url: https://docs.joinpeertube.org/api-rest-reference.html | 122 | url: https://docs.joinpeertube.org/api-rest-reference.html |
89 | tags: | 123 | tags: |
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). |
212 | x-tagGroups: | 255 | x-tagGroups: |
256 | - name: Auth | ||
257 | tags: | ||
258 | - Register | ||
259 | - Session | ||
213 | - name: Accounts | 260 | - name: Accounts |
214 | tags: | 261 | tags: |
215 | - Accounts | 262 | - Accounts |
@@ -458,66 +505,105 @@ paths: | |||
458 | maxItems: 100 | 505 | maxItems: 100 |
459 | items: | 506 | items: |
460 | $ref: '#/components/schemas/Job' | 507 | $ref: '#/components/schemas/Job' |
461 | '/server/following/{host}': | 508 | |
509 | /server/followers: | ||
510 | get: | ||
511 | tags: | ||
512 | - Instance Follows | ||
513 | summary: List instances following the server | ||
514 | parameters: | ||
515 | - $ref: '#/components/parameters/followState' | ||
516 | - $ref: '#/components/parameters/actorType' | ||
517 | - $ref: '#/components/parameters/start' | ||
518 | - $ref: '#/components/parameters/count' | ||
519 | - $ref: '#/components/parameters/sort' | ||
520 | responses: | ||
521 | '200': | ||
522 | description: successful operation | ||
523 | content: | ||
524 | application/json: | ||
525 | schema: | ||
526 | type: object | ||
527 | properties: | ||
528 | total: | ||
529 | type: integer | ||
530 | example: 1 | ||
531 | data: | ||
532 | type: array | ||
533 | items: | ||
534 | $ref: '#/components/schemas/Follow' | ||
535 | '/server/followers/{nameWithHost}': | ||
462 | delete: | 536 | delete: |
537 | summary: Remove or reject a follower to your server | ||
463 | security: | 538 | security: |
464 | - OAuth2: | 539 | - OAuth2: |
465 | - admin | 540 | - admin |
466 | tags: | 541 | tags: |
467 | - Instance Follows | 542 | - Instance Follows |
468 | summary: Unfollow a server | ||
469 | parameters: | 543 | parameters: |
470 | - name: host | 544 | - name: nameWithHost |
471 | in: path | 545 | in: path |
472 | required: true | 546 | required: true |
473 | description: 'The host to unfollow ' | 547 | description: The remote actor handle to remove from your followers |
474 | schema: | 548 | schema: |
475 | type: string | 549 | type: string |
476 | format: hostname | 550 | format: email |
477 | responses: | 551 | responses: |
478 | '201': | 552 | '204': |
479 | description: successful operation | 553 | description: successful operation |
480 | /server/followers: | 554 | '404': |
481 | get: | 555 | description: follower not found |
556 | '/server/followers/{nameWithHost}/reject': | ||
557 | post: | ||
558 | summary: Reject a pending follower to your server | ||
559 | security: | ||
560 | - OAuth2: | ||
561 | - admin | ||
482 | tags: | 562 | tags: |
483 | - Instance Follows | 563 | - Instance Follows |
484 | summary: List instance followers | ||
485 | parameters: | 564 | parameters: |
486 | - $ref: '#/components/parameters/start' | 565 | - name: nameWithHost |
487 | - $ref: '#/components/parameters/count' | 566 | in: path |
488 | - $ref: '#/components/parameters/sort' | 567 | required: true |
568 | description: The remote actor handle to remove from your followers | ||
569 | schema: | ||
570 | type: string | ||
571 | format: email | ||
489 | responses: | 572 | responses: |
490 | '200': | 573 | '204': |
491 | description: successful operation | 574 | description: successful operation |
492 | content: | 575 | '404': |
493 | application/json: | 576 | description: follower not found |
494 | schema: | 577 | '/server/followers/{nameWithHost}/accept': |
495 | type: array | 578 | post: |
496 | items: | 579 | summary: Accept a pending follower to your server |
497 | $ref: '#/components/schemas/Follow' | 580 | security: |
581 | - OAuth2: | ||
582 | - admin | ||
583 | tags: | ||
584 | - Instance Follows | ||
585 | parameters: | ||
586 | - name: nameWithHost | ||
587 | in: path | ||
588 | required: true | ||
589 | description: The remote actor handle to remove from your followers | ||
590 | schema: | ||
591 | type: string | ||
592 | format: email | ||
593 | responses: | ||
594 | '204': | ||
595 | description: successful operation | ||
596 | '404': | ||
597 | description: follower not found | ||
598 | |||
498 | /server/following: | 599 | /server/following: |
499 | get: | 600 | get: |
500 | tags: | 601 | tags: |
501 | - Instance Follows | 602 | - Instance Follows |
502 | summary: List instances followed by the server | 603 | summary: List instances followed by the server |
503 | parameters: | 604 | parameters: |
504 | - name: state | 605 | - $ref: '#/components/parameters/followState' |
505 | in: query | 606 | - $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' | 607 | - $ref: '#/components/parameters/start' |
522 | - $ref: '#/components/parameters/count' | 608 | - $ref: '#/components/parameters/count' |
523 | - $ref: '#/components/parameters/sort' | 609 | - $ref: '#/components/parameters/sort' |
@@ -527,16 +613,22 @@ paths: | |||
527 | content: | 613 | content: |
528 | application/json: | 614 | application/json: |
529 | schema: | 615 | schema: |
530 | type: array | 616 | type: object |
531 | items: | 617 | properties: |
532 | $ref: '#/components/schemas/Follow' | 618 | total: |
619 | type: integer | ||
620 | example: 1 | ||
621 | data: | ||
622 | type: array | ||
623 | items: | ||
624 | $ref: '#/components/schemas/Follow' | ||
533 | post: | 625 | post: |
534 | security: | 626 | security: |
535 | - OAuth2: | 627 | - OAuth2: |
536 | - admin | 628 | - admin |
537 | tags: | 629 | tags: |
538 | - Instance Follows | 630 | - Instance Follows |
539 | summary: Follow a server | 631 | summary: Follow a list of servers |
540 | responses: | 632 | responses: |
541 | '204': | 633 | '204': |
542 | description: successful operation | 634 | description: successful operation |
@@ -554,9 +646,32 @@ paths: | |||
554 | type: string | 646 | type: string |
555 | format: hostname | 647 | format: hostname |
556 | uniqueItems: true | 648 | uniqueItems: true |
649 | '/server/following/{host}': | ||
650 | delete: | ||
651 | summary: Unfollow a server | ||
652 | security: | ||
653 | - OAuth2: | ||
654 | - admin | ||
655 | tags: | ||
656 | - Instance Follows | ||
657 | parameters: | ||
658 | - name: host | ||
659 | in: path | ||
660 | required: true | ||
661 | description: The host to unfollow | ||
662 | schema: | ||
663 | type: string | ||
664 | format: hostname | ||
665 | responses: | ||
666 | '204': | ||
667 | description: successful operation | ||
668 | '404': | ||
669 | description: host not found | ||
670 | |||
557 | /users: | 671 | /users: |
558 | post: | 672 | post: |
559 | summary: Create a user | 673 | summary: Create a user |
674 | operationId: createUser | ||
560 | security: | 675 | security: |
561 | - OAuth2: | 676 | - OAuth2: |
562 | - admin | 677 | - admin |
@@ -673,11 +788,92 @@ paths: | |||
673 | schema: | 788 | schema: |
674 | $ref: '#/components/schemas/UpdateUser' | 789 | $ref: '#/components/schemas/UpdateUser' |
675 | required: true | 790 | required: true |
791 | |||
792 | /oauth-clients/local: | ||
793 | get: | ||
794 | summary: Login prerequisite | ||
795 | description: You need to retrieve a client id and secret before [logging in](#operation/getOauthToken). | ||
796 | operationId: getOAuthClient | ||
797 | tags: | ||
798 | - Session | ||
799 | responses: | ||
800 | '200': | ||
801 | description: successful operation | ||
802 | content: | ||
803 | application/json: | ||
804 | schema: | ||
805 | $ref: '#/components/schemas/OAuthClient' | ||
806 | links: | ||
807 | UseOAuthClientToLogin: | ||
808 | operationId: getOAuthToken | ||
809 | parameters: | ||
810 | client_id: '$response.body#/client_id' | ||
811 | client_secret: '$response.body#/client_secret' | ||
812 | /users/token: | ||
813 | post: | ||
814 | summary: Login | ||
815 | operationId: getOAuthToken | ||
816 | description: With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens. | ||
817 | tags: | ||
818 | - Session | ||
819 | requestBody: | ||
820 | content: | ||
821 | application/x-www-form-urlencoded: | ||
822 | schema: | ||
823 | oneOf: | ||
824 | - $ref: '#/components/schemas/OAuthToken-password' | ||
825 | - $ref: '#/components/schemas/OAuthToken-refresh_token' | ||
826 | discriminator: | ||
827 | propertyName: grant_type | ||
828 | mapping: | ||
829 | password: '#/components/schemas/OAuthToken-password' | ||
830 | refresh_token: '#/components/schemas/OAuthToken-refresh_token' | ||
831 | responses: | ||
832 | '200': | ||
833 | description: successful operation | ||
834 | content: | ||
835 | application/json: | ||
836 | schema: | ||
837 | type: object | ||
838 | properties: | ||
839 | token_type: | ||
840 | type: string | ||
841 | example: Bearer | ||
842 | access_token: | ||
843 | type: string | ||
844 | example: 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0 | ||
845 | description: valid for 1 day | ||
846 | refresh_token: | ||
847 | type: string | ||
848 | example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 | ||
849 | description: valid for 2 weeks | ||
850 | expires_in: | ||
851 | type: integer | ||
852 | minimum: 0 | ||
853 | example: 14399 | ||
854 | refresh_token_expires_in: | ||
855 | type: integer | ||
856 | minimum: 0 | ||
857 | example: 1209600 | ||
858 | /users/revoke-token: | ||
859 | post: | ||
860 | summary: Logout | ||
861 | description: Revokes your access token and its associated refresh token, destroying your current session. | ||
862 | operationId: revokeOAuthToken | ||
863 | tags: | ||
864 | - Session | ||
865 | security: | ||
866 | - OAuth2: [] | ||
867 | responses: | ||
868 | '200': | ||
869 | description: successful operation | ||
870 | |||
676 | /users/register: | 871 | /users/register: |
677 | post: | 872 | post: |
678 | summary: Register a user | 873 | summary: Register a user |
679 | tags: | 874 | tags: |
680 | - Users | 875 | - Users |
876 | - Register | ||
681 | responses: | 877 | responses: |
682 | '204': | 878 | '204': |
683 | description: successful operation | 879 | description: successful operation |
@@ -687,6 +883,47 @@ paths: | |||
687 | schema: | 883 | schema: |
688 | $ref: '#/components/schemas/RegisterUser' | 884 | $ref: '#/components/schemas/RegisterUser' |
689 | required: true | 885 | required: true |
886 | /users/{id}/verify-email: | ||
887 | post: | ||
888 | summary: Verify a user | ||
889 | description: | | ||
890 | Following a user registration, the new user will receive an email asking to click a link | ||
891 | containing a secret. | ||
892 | tags: | ||
893 | - Users | ||
894 | - Register | ||
895 | parameters: | ||
896 | - $ref: '#/components/parameters/id' | ||
897 | requestBody: | ||
898 | content: | ||
899 | application/json: | ||
900 | schema: | ||
901 | type: object | ||
902 | properties: | ||
903 | verificationString: | ||
904 | type: string | ||
905 | format: url | ||
906 | isPendingEmail: | ||
907 | type: boolean | ||
908 | required: | ||
909 | - verificationString | ||
910 | responses: | ||
911 | '204': | ||
912 | description: successful operation | ||
913 | '403': | ||
914 | description: invalid verification string | ||
915 | '404': | ||
916 | description: user not found | ||
917 | /users/ask-send-verify-email: | ||
918 | post: | ||
919 | summary: Resend user verification link | ||
920 | tags: | ||
921 | - Users | ||
922 | - Register | ||
923 | responses: | ||
924 | '204': | ||
925 | description: successful operation | ||
926 | |||
690 | /users/me: | 927 | /users/me: |
691 | get: | 928 | get: |
692 | summary: Get my user information | 929 | summary: Get my user information |
@@ -1317,7 +1554,7 @@ paths: | |||
1317 | type: string | 1554 | type: string |
1318 | support: | 1555 | support: |
1319 | description: A text tell the audience how to support the video creator | 1556 | description: A text tell the audience how to support the video creator |
1320 | example: Please support my work on <insert crowdfunding plateform>! <3 | 1557 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
1321 | type: string | 1558 | type: string |
1322 | nsfw: | 1559 | nsfw: |
1323 | description: Whether or not this video contains sensitive content | 1560 | description: Whether or not this video contains sensitive content |
@@ -1672,74 +1909,7 @@ paths: | |||
1672 | content: | 1909 | content: |
1673 | multipart/form-data: | 1910 | multipart/form-data: |
1674 | schema: | 1911 | schema: |
1675 | type: object | 1912 | $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: | 1913 | encoding: |
1744 | torrentfile: | 1914 | torrentfile: |
1745 | contentType: application/x-bittorrent | 1915 | contentType: application/x-bittorrent |
@@ -1814,7 +1984,7 @@ paths: | |||
1814 | type: string | 1984 | type: string |
1815 | support: | 1985 | support: |
1816 | description: A text tell the audience how to support the creator | 1986 | description: A text tell the audience how to support the creator |
1817 | example: Please support my work on <insert crowdfunding plateform>! <3 | 1987 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
1818 | type: string | 1988 | type: string |
1819 | nsfw: | 1989 | nsfw: |
1820 | description: Whether or not this live video/replay contains sensitive content | 1990 | description: Whether or not this live video/replay contains sensitive content |
@@ -2042,10 +2212,12 @@ paths: | |||
2042 | - $ref: '#/components/schemas/Video/properties/id' | 2212 | - $ref: '#/components/schemas/Video/properties/id' |
2043 | startAt: | 2213 | startAt: |
2044 | type: integer | 2214 | type: integer |
2215 | format: seconds | ||
2045 | description: Timestamp in the video that marks the beginning of the report | 2216 | description: Timestamp in the video that marks the beginning of the report |
2046 | minimum: 0 | 2217 | minimum: 0 |
2047 | endAt: | 2218 | endAt: |
2048 | type: integer | 2219 | type: integer |
2220 | format: seconds | ||
2049 | description: Timestamp in the video that marks the ending of the report | 2221 | description: Timestamp in the video that marks the ending of the report |
2050 | minimum: 0 | 2222 | minimum: 0 |
2051 | comment: | 2223 | comment: |
@@ -2064,8 +2236,18 @@ paths: | |||
2064 | required: | 2236 | required: |
2065 | - reason | 2237 | - reason |
2066 | responses: | 2238 | responses: |
2067 | '204': | 2239 | '200': |
2068 | description: successful operation | 2240 | description: successful operation |
2241 | content: | ||
2242 | application/json: | ||
2243 | schema: | ||
2244 | type: object | ||
2245 | properties: | ||
2246 | abuse: | ||
2247 | type: object | ||
2248 | properties: | ||
2249 | id: | ||
2250 | $ref: '#/components/schemas/id' | ||
2069 | '400': | 2251 | '400': |
2070 | description: incorrect request parameters | 2252 | description: incorrect request parameters |
2071 | '/abuses/{abuseId}': | 2253 | '/abuses/{abuseId}': |
@@ -2127,9 +2309,15 @@ paths: | |||
2127 | content: | 2309 | content: |
2128 | application/json: | 2310 | application/json: |
2129 | schema: | 2311 | schema: |
2130 | type: array | 2312 | type: object |
2131 | items: | 2313 | properties: |
2132 | $ref: '#/components/schemas/AbuseMessage' | 2314 | total: |
2315 | type: integer | ||
2316 | example: 1 | ||
2317 | data: | ||
2318 | type: array | ||
2319 | items: | ||
2320 | $ref: '#/components/schemas/AbuseMessage' | ||
2133 | 2321 | ||
2134 | post: | 2322 | post: |
2135 | summary: Add message to an abuse | 2323 | summary: Add message to an abuse |
@@ -2316,6 +2504,7 @@ paths: | |||
2316 | /video-channels: | 2504 | /video-channels: |
2317 | get: | 2505 | get: |
2318 | summary: List video channels | 2506 | summary: List video channels |
2507 | operationId: getVideoChannels | ||
2319 | tags: | 2508 | tags: |
2320 | - Video Channels | 2509 | - Video Channels |
2321 | parameters: | 2510 | parameters: |
@@ -2331,6 +2520,7 @@ paths: | |||
2331 | $ref: '#/components/schemas/VideoChannelList' | 2520 | $ref: '#/components/schemas/VideoChannelList' |
2332 | post: | 2521 | post: |
2333 | summary: Create a video channel | 2522 | summary: Create a video channel |
2523 | operationId: createVideoChannel | ||
2334 | security: | 2524 | security: |
2335 | - OAuth2: [] | 2525 | - OAuth2: [] |
2336 | tags: | 2526 | tags: |
@@ -2338,6 +2528,16 @@ paths: | |||
2338 | responses: | 2528 | responses: |
2339 | '204': | 2529 | '204': |
2340 | description: successful operation | 2530 | description: successful operation |
2531 | content: | ||
2532 | application/json: | ||
2533 | schema: | ||
2534 | type: object | ||
2535 | properties: | ||
2536 | videoChannel: | ||
2537 | type: object | ||
2538 | properties: | ||
2539 | id: | ||
2540 | $ref: '#/components/schemas/VideoChannel/properties/id' | ||
2341 | requestBody: | 2541 | requestBody: |
2342 | content: | 2542 | content: |
2343 | application/json: | 2543 | application/json: |
@@ -2346,6 +2546,7 @@ paths: | |||
2346 | '/video-channels/{channelHandle}': | 2546 | '/video-channels/{channelHandle}': |
2347 | get: | 2547 | get: |
2348 | summary: Get a video channel | 2548 | summary: Get a video channel |
2549 | operationId: getVideoChannel | ||
2349 | tags: | 2550 | tags: |
2350 | - Video Channels | 2551 | - Video Channels |
2351 | parameters: | 2552 | parameters: |
@@ -2617,13 +2818,13 @@ paths: | |||
2617 | thumbnailfile: | 2818 | thumbnailfile: |
2618 | contentType: image/jpeg | 2819 | contentType: image/jpeg |
2619 | 2820 | ||
2620 | /video-playlists/{id}: | 2821 | /video-playlists/{playlistId}: |
2621 | get: | 2822 | get: |
2622 | summary: Get a video playlist | 2823 | summary: Get a video playlist |
2623 | tags: | 2824 | tags: |
2624 | - Video Playlists | 2825 | - Video Playlists |
2625 | parameters: | 2826 | parameters: |
2626 | - $ref: '#/components/parameters/idOrUUID' | 2827 | - $ref: '#/components/parameters/playlistId' |
2627 | responses: | 2828 | responses: |
2628 | '200': | 2829 | '200': |
2629 | description: successful operation | 2830 | description: successful operation |
@@ -2642,7 +2843,7 @@ paths: | |||
2642 | '204': | 2843 | '204': |
2643 | description: successful operation | 2844 | description: successful operation |
2644 | parameters: | 2845 | parameters: |
2645 | - $ref: '#/components/parameters/idOrUUID' | 2846 | - $ref: '#/components/parameters/playlistId' |
2646 | requestBody: | 2847 | requestBody: |
2647 | content: | 2848 | content: |
2648 | multipart/form-data: | 2849 | multipart/form-data: |
@@ -2677,19 +2878,19 @@ paths: | |||
2677 | tags: | 2878 | tags: |
2678 | - Video Playlists | 2879 | - Video Playlists |
2679 | parameters: | 2880 | parameters: |
2680 | - $ref: '#/components/parameters/idOrUUID' | 2881 | - $ref: '#/components/parameters/playlistId' |
2681 | responses: | 2882 | responses: |
2682 | '204': | 2883 | '204': |
2683 | description: successful operation | 2884 | description: successful operation |
2684 | 2885 | ||
2685 | /video-playlists/{id}/videos: | 2886 | /video-playlists/{playlistId}/videos: |
2686 | get: | 2887 | get: |
2687 | summary: 'List videos of a playlist' | 2888 | summary: 'List videos of a playlist' |
2688 | tags: | 2889 | tags: |
2689 | - Videos | 2890 | - Videos |
2690 | - Video Playlists | 2891 | - Video Playlists |
2691 | parameters: | 2892 | parameters: |
2692 | - $ref: '#/components/parameters/idOrUUID' | 2893 | - $ref: '#/components/parameters/playlistId' |
2693 | responses: | 2894 | responses: |
2694 | '200': | 2895 | '200': |
2695 | description: successful operation | 2896 | description: successful operation |
@@ -2698,14 +2899,14 @@ paths: | |||
2698 | schema: | 2899 | schema: |
2699 | $ref: '#/components/schemas/VideoListResponse' | 2900 | $ref: '#/components/schemas/VideoListResponse' |
2700 | post: | 2901 | post: |
2701 | summary: 'Add a video in a playlist' | 2902 | summary: Add a video in a playlist |
2702 | security: | 2903 | security: |
2703 | - OAuth2: [] | 2904 | - OAuth2: [] |
2704 | tags: | 2905 | tags: |
2705 | - Videos | 2906 | - Videos |
2706 | - Video Playlists | 2907 | - Video Playlists |
2707 | parameters: | 2908 | parameters: |
2708 | - $ref: '#/components/parameters/idOrUUID' | 2909 | - $ref: '#/components/parameters/playlistId' |
2709 | responses: | 2910 | responses: |
2710 | '200': | 2911 | '200': |
2711 | description: successful operation | 2912 | description: successful operation |
@@ -2719,6 +2920,7 @@ paths: | |||
2719 | properties: | 2920 | properties: |
2720 | id: | 2921 | id: |
2721 | type: integer | 2922 | type: integer |
2923 | example: 2 | ||
2722 | requestBody: | 2924 | requestBody: |
2723 | content: | 2925 | content: |
2724 | application/json: | 2926 | application/json: |
@@ -2726,19 +2928,22 @@ paths: | |||
2726 | type: object | 2928 | type: object |
2727 | properties: | 2929 | properties: |
2728 | videoId: | 2930 | videoId: |
2729 | allOf: | 2931 | oneOf: |
2932 | - $ref: '#/components/schemas/Video/properties/uuid' | ||
2730 | - $ref: '#/components/schemas/Video/properties/id' | 2933 | - $ref: '#/components/schemas/Video/properties/id' |
2731 | description: Video to add in the playlist | 2934 | description: Video to add in the playlist |
2732 | startTimestamp: | 2935 | startTimestamp: |
2733 | type: integer | 2936 | type: integer |
2734 | description: Start the video at this specific timestamp (in seconds) | 2937 | format: seconds |
2938 | description: Start the video at this specific timestamp | ||
2735 | stopTimestamp: | 2939 | stopTimestamp: |
2736 | type: integer | 2940 | type: integer |
2737 | description: Stop the video at this specific timestamp (in seconds) | 2941 | format: seconds |
2942 | description: Stop the video at this specific timestamp | ||
2738 | required: | 2943 | required: |
2739 | - videoId | 2944 | - videoId |
2740 | 2945 | ||
2741 | /video-playlists/{id}/videos/reorder: | 2946 | /video-playlists/{playlistId}/videos/reorder: |
2742 | post: | 2947 | post: |
2743 | summary: 'Reorder a playlist' | 2948 | summary: 'Reorder a playlist' |
2744 | security: | 2949 | security: |
@@ -2746,7 +2951,7 @@ paths: | |||
2746 | tags: | 2951 | tags: |
2747 | - Video Playlists | 2952 | - Video Playlists |
2748 | parameters: | 2953 | parameters: |
2749 | - $ref: '#/components/parameters/idOrUUID' | 2954 | - $ref: '#/components/parameters/playlistId' |
2750 | responses: | 2955 | responses: |
2751 | '204': | 2956 | '204': |
2752 | description: successful operation | 2957 | description: successful operation |
@@ -2772,15 +2977,15 @@ paths: | |||
2772 | - startPosition | 2977 | - startPosition |
2773 | - insertAfterPosition | 2978 | - insertAfterPosition |
2774 | 2979 | ||
2775 | /video-playlists/{id}/videos/{playlistElementId}: | 2980 | /video-playlists/{playlistId}/videos/{playlistElementId}: |
2776 | put: | 2981 | put: |
2777 | summary: 'Update a playlist element' | 2982 | summary: Update a playlist element |
2778 | security: | 2983 | security: |
2779 | - OAuth2: [] | 2984 | - OAuth2: [] |
2780 | tags: | 2985 | tags: |
2781 | - Video Playlists | 2986 | - Video Playlists |
2782 | parameters: | 2987 | parameters: |
2783 | - $ref: '#/components/parameters/idOrUUID' | 2988 | - $ref: '#/components/parameters/playlistId' |
2784 | - $ref: '#/components/parameters/playlistElementId' | 2989 | - $ref: '#/components/parameters/playlistElementId' |
2785 | responses: | 2990 | responses: |
2786 | '204': | 2991 | '204': |
@@ -2793,18 +2998,20 @@ paths: | |||
2793 | properties: | 2998 | properties: |
2794 | startTimestamp: | 2999 | startTimestamp: |
2795 | type: integer | 3000 | type: integer |
2796 | description: 'Start the video at this specific timestamp (in seconds)' | 3001 | format: seconds |
3002 | description: Start the video at this specific timestamp | ||
2797 | stopTimestamp: | 3003 | stopTimestamp: |
2798 | type: integer | 3004 | type: integer |
2799 | description: 'Stop the video at this specific timestamp (in seconds)' | 3005 | format: seconds |
3006 | description: Stop the video at this specific timestamp | ||
2800 | delete: | 3007 | delete: |
2801 | summary: 'Delete an element from a playlist' | 3008 | summary: Delete an element from a playlist |
2802 | security: | 3009 | security: |
2803 | - OAuth2: [] | 3010 | - OAuth2: [] |
2804 | tags: | 3011 | tags: |
2805 | - Video Playlists | 3012 | - Video Playlists |
2806 | parameters: | 3013 | parameters: |
2807 | - $ref: '#/components/parameters/idOrUUID' | 3014 | - $ref: '#/components/parameters/playlistId' |
2808 | - $ref: '#/components/parameters/playlistElementId' | 3015 | - $ref: '#/components/parameters/playlistElementId' |
2809 | responses: | 3016 | responses: |
2810 | '204': | 3017 | '204': |
@@ -2812,7 +3019,7 @@ paths: | |||
2812 | 3019 | ||
2813 | '/users/me/video-playlists/videos-exist': | 3020 | '/users/me/video-playlists/videos-exist': |
2814 | get: | 3021 | get: |
2815 | summary: 'Check video exists in my playlists' | 3022 | summary: Check video exists in my playlists |
2816 | security: | 3023 | security: |
2817 | - OAuth2: [] | 3024 | - OAuth2: [] |
2818 | tags: | 3025 | tags: |
@@ -2845,8 +3052,10 @@ paths: | |||
2845 | type: integer | 3052 | type: integer |
2846 | startTimestamp: | 3053 | startTimestamp: |
2847 | type: integer | 3054 | type: integer |
3055 | format: seconds | ||
2848 | stopTimestamp: | 3056 | stopTimestamp: |
2849 | type: integer | 3057 | type: integer |
3058 | format: seconds | ||
2850 | 3059 | ||
2851 | '/accounts/{name}/video-channels': | 3060 | '/accounts/{name}/video-channels': |
2852 | get: | 3061 | get: |
@@ -2942,8 +3151,10 @@ paths: | |||
2942 | type: object | 3151 | type: object |
2943 | properties: | 3152 | properties: |
2944 | text: | 3153 | text: |
2945 | type: string | 3154 | allOf: |
2946 | description: 'Text comment' | 3155 | - $ref: '#/components/schemas/VideoComment/properties/text' |
3156 | format: markdown | ||
3157 | maxLength: 10000 | ||
2947 | required: | 3158 | required: |
2948 | - text | 3159 | - text |
2949 | 3160 | ||
@@ -2988,7 +3199,10 @@ paths: | |||
2988 | type: object | 3199 | type: object |
2989 | properties: | 3200 | properties: |
2990 | text: | 3201 | text: |
2991 | $ref: '#/components/schemas/VideoComment/properties/text' | 3202 | allOf: |
3203 | - $ref: '#/components/schemas/VideoComment/properties/text' | ||
3204 | format: markdown | ||
3205 | maxLength: 10000 | ||
2992 | required: | 3206 | required: |
2993 | - text | 3207 | - text |
2994 | 3208 | ||
@@ -3019,6 +3233,19 @@ paths: | |||
3019 | - Video Rates | 3233 | - Video Rates |
3020 | parameters: | 3234 | parameters: |
3021 | - $ref: '#/components/parameters/idOrUUID' | 3235 | - $ref: '#/components/parameters/idOrUUID' |
3236 | requestBody: | ||
3237 | content: | ||
3238 | application/json: | ||
3239 | schema: | ||
3240 | type: object | ||
3241 | properties: | ||
3242 | rating: | ||
3243 | type: string | ||
3244 | enum: | ||
3245 | - like | ||
3246 | - dislike | ||
3247 | required: | ||
3248 | - rating | ||
3022 | responses: | 3249 | responses: |
3023 | '204': | 3250 | '204': |
3024 | description: successful operation | 3251 | description: successful operation |
@@ -3130,7 +3357,8 @@ paths: | |||
3130 | $ref: '#/components/schemas/VideoChannelList' | 3357 | $ref: '#/components/schemas/VideoChannelList' |
3131 | '500': | 3358 | '500': |
3132 | description: search index unavailable | 3359 | description: search index unavailable |
3133 | /blocklist/accounts: | 3360 | |
3361 | /server/blocklist/accounts: | ||
3134 | get: | 3362 | get: |
3135 | tags: | 3363 | tags: |
3136 | - Account Blocks | 3364 | - Account Blocks |
@@ -3169,7 +3397,7 @@ paths: | |||
3169 | description: successful operation | 3397 | description: successful operation |
3170 | '409': | 3398 | '409': |
3171 | description: self-blocking forbidden | 3399 | description: self-blocking forbidden |
3172 | '/blocklist/accounts/{accountName}': | 3400 | '/server/blocklist/accounts/{accountName}': |
3173 | delete: | 3401 | delete: |
3174 | tags: | 3402 | tags: |
3175 | - Account Blocks | 3403 | - Account Blocks |
@@ -3189,7 +3417,8 @@ paths: | |||
3189 | description: successful operation | 3417 | description: successful operation |
3190 | '404': | 3418 | '404': |
3191 | description: account or account block does not exist | 3419 | description: account or account block does not exist |
3192 | /blocklist/servers: | 3420 | |
3421 | /server/blocklist/servers: | ||
3193 | get: | 3422 | get: |
3194 | tags: | 3423 | tags: |
3195 | - Server Blocks | 3424 | - Server Blocks |
@@ -3224,11 +3453,11 @@ paths: | |||
3224 | required: | 3453 | required: |
3225 | - host | 3454 | - host |
3226 | responses: | 3455 | responses: |
3227 | '200': | 3456 | '204': |
3228 | description: successful operation | 3457 | description: successful operation |
3229 | '409': | 3458 | '409': |
3230 | description: self-blocking forbidden | 3459 | description: self-blocking forbidden |
3231 | '/blocklist/servers/{host}': | 3460 | '/server/blocklist/servers/{host}': |
3232 | delete: | 3461 | delete: |
3233 | tags: | 3462 | tags: |
3234 | - Server Blocks | 3463 | - Server Blocks |
@@ -3245,11 +3474,12 @@ paths: | |||
3245 | type: string | 3474 | type: string |
3246 | format: hostname | 3475 | format: hostname |
3247 | responses: | 3476 | responses: |
3248 | '201': | 3477 | '204': |
3249 | description: successful operation | 3478 | description: successful operation |
3250 | '404': | 3479 | '404': |
3251 | description: account block does not exist | 3480 | description: account block does not exist |
3252 | /redundancy/{host}: | 3481 | |
3482 | /server/redundancy/{host}: | ||
3253 | put: | 3483 | put: |
3254 | tags: | 3484 | tags: |
3255 | - Instance Redundancy | 3485 | - Instance Redundancy |
@@ -3281,7 +3511,7 @@ paths: | |||
3281 | description: successful operation | 3511 | description: successful operation |
3282 | '404': | 3512 | '404': |
3283 | description: server is not already known | 3513 | description: server is not already known |
3284 | /redundancy/videos: | 3514 | /server/redundancy/videos: |
3285 | get: | 3515 | get: |
3286 | tags: | 3516 | tags: |
3287 | - Video Mirroring | 3517 | - Video Mirroring |
@@ -3337,7 +3567,7 @@ paths: | |||
3337 | description: video does not exist | 3567 | description: video does not exist |
3338 | '409': | 3568 | '409': |
3339 | description: video is already mirrored | 3569 | description: video is already mirrored |
3340 | /redundancy/videos/{redundancyId}: | 3570 | /server/redundancy/videos/{redundancyId}: |
3341 | delete: | 3571 | delete: |
3342 | tags: | 3572 | tags: |
3343 | - Video Mirroring | 3573 | - Video Mirroring |
@@ -3357,6 +3587,7 @@ paths: | |||
3357 | description: successful operation | 3587 | description: successful operation |
3358 | '404': | 3588 | '404': |
3359 | description: video redundancy not found | 3589 | description: video redundancy not found |
3590 | |||
3360 | '/feeds/video-comments.{format}': | 3591 | '/feeds/video-comments.{format}': |
3361 | get: | 3592 | get: |
3362 | tags: | 3593 | tags: |
@@ -4019,6 +4250,13 @@ components: | |||
4019 | oneOf: | 4250 | oneOf: |
4020 | - $ref: '#/components/schemas/id' | 4251 | - $ref: '#/components/schemas/id' |
4021 | - $ref: '#/components/schemas/UUIDv4' | 4252 | - $ref: '#/components/schemas/UUIDv4' |
4253 | playlistId: | ||
4254 | name: playlistId | ||
4255 | in: path | ||
4256 | required: true | ||
4257 | description: Playlist id | ||
4258 | schema: | ||
4259 | $ref: '#/components/schemas/VideoPlaylist/properties/id' | ||
4022 | playlistElementId: | 4260 | playlistElementId: |
4023 | name: playlistElementId | 4261 | name: playlistElementId |
4024 | in: path | 4262 | in: path |
@@ -4223,22 +4461,42 @@ components: | |||
4223 | - activitypub-refresher | 4461 | - activitypub-refresher |
4224 | - video-redundancy | 4462 | - video-redundancy |
4225 | - video-live-ending | 4463 | - video-live-ending |
4464 | followState: | ||
4465 | name: state | ||
4466 | in: query | ||
4467 | schema: | ||
4468 | type: string | ||
4469 | enum: | ||
4470 | - pending | ||
4471 | - accepted | ||
4472 | actorType: | ||
4473 | name: actorType | ||
4474 | in: query | ||
4475 | schema: | ||
4476 | type: string | ||
4477 | enum: | ||
4478 | - Person | ||
4479 | - Application | ||
4480 | - Group | ||
4481 | - Service | ||
4482 | - Organization | ||
4226 | securitySchemes: | 4483 | securitySchemes: |
4227 | OAuth2: | 4484 | OAuth2: |
4228 | description: | | 4485 | description: | |
4229 | Authenticating via OAuth requires the following steps: | 4486 | Authenticating via OAuth requires the following steps: |
4230 | - Have an activated account | 4487 | - Have an activated account |
4231 | - [Generate](https://docs.joinpeertube.org/api-rest-getting-started) a | 4488 | - [Generate] an access token for that account at `/api/v1/users/token`. |
4232 | Bearer Token for that account at `/api/v1/users/token` | 4489 | - 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 | 4490 | - Profit, depending on the role assigned to the account |
4235 | 4491 | ||
4236 | Note that the __access token is valid for 1 day__ and, and is given | 4492 | Note that the __access token is valid for 1 day__ and is given |
4237 | along with a __refresh token valid for 2 weeks__. | 4493 | along with a __refresh token valid for 2 weeks__. |
4494 | |||
4495 | [Generate]: https://docs.joinpeertube.org/api-rest-getting-started | ||
4238 | type: oauth2 | 4496 | type: oauth2 |
4239 | flows: | 4497 | flows: |
4240 | password: | 4498 | password: |
4241 | tokenUrl: 'https://peertube.example.com/api/v1/users/token' | 4499 | tokenUrl: /api/v1/users/token |
4242 | scopes: | 4500 | scopes: |
4243 | admin: Admin scope | 4501 | admin: Admin scope |
4244 | moderator: Moderator scope | 4502 | moderator: Moderator scope |
@@ -4258,20 +4516,21 @@ components: | |||
4258 | maxLength: 36 | 4516 | maxLength: 36 |
4259 | username: | 4517 | username: |
4260 | type: string | 4518 | type: string |
4261 | description: The username of the user | 4519 | description: immutable name of the user, used to find or mention its actor |
4262 | example: chocobozzz | 4520 | example: chocobozzz |
4263 | pattern: '/^[a-z0-9._]{1,50}$/' | 4521 | pattern: '/^[a-z0-9._]+$/' |
4264 | minLength: 1 | 4522 | minLength: 1 |
4265 | maxLength: 50 | 4523 | maxLength: 50 |
4266 | usernameChannel: | 4524 | usernameChannel: |
4267 | type: string | 4525 | type: string |
4268 | description: The username for the default channel | 4526 | description: immutable name of the channel, used to interact with its actor |
4269 | example: The Capybara Channel | 4527 | example: framasoft_videos |
4270 | pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/' | 4528 | pattern: '/^[a-zA-Z0-9\\-_.:]+$/' |
4529 | minLength: 1 | ||
4530 | maxLength: 50 | ||
4271 | password: | 4531 | password: |
4272 | type: string | 4532 | type: string |
4273 | format: password | 4533 | format: password |
4274 | description: The password of the user | ||
4275 | minLength: 6 | 4534 | minLength: 6 |
4276 | maxLength: 255 | 4535 | maxLength: 255 |
4277 | 4536 | ||
@@ -4483,8 +4742,10 @@ components: | |||
4483 | type: integer | 4742 | type: integer |
4484 | startTimestamp: | 4743 | startTimestamp: |
4485 | type: integer | 4744 | type: integer |
4745 | format: seconds | ||
4486 | stopTimestamp: | 4746 | stopTimestamp: |
4487 | type: integer | 4747 | type: integer |
4748 | format: seconds | ||
4488 | video: | 4749 | video: |
4489 | nullable: true | 4750 | nullable: true |
4490 | allOf: | 4751 | allOf: |
@@ -4633,6 +4894,7 @@ components: | |||
4633 | duration: | 4894 | duration: |
4634 | type: integer | 4895 | type: integer |
4635 | example: 1419 | 4896 | example: 1419 |
4897 | format: seconds | ||
4636 | description: duration of the video in seconds | 4898 | description: duration of the video in seconds |
4637 | isLocal: | 4899 | isLocal: |
4638 | type: boolean | 4900 | type: boolean |
@@ -4701,7 +4963,7 @@ components: | |||
4701 | support: | 4963 | support: |
4702 | type: string | 4964 | type: string |
4703 | description: A text tell the audience how to support the video creator | 4965 | description: A text tell the audience how to support the video creator |
4704 | example: Please support my work on <insert crowdfunding plateform>! <3 | 4966 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
4705 | minLength: 3 | 4967 | minLength: 3 |
4706 | maxLength: 1000 | 4968 | maxLength: 1000 |
4707 | channel: | 4969 | channel: |
@@ -4806,10 +5068,33 @@ components: | |||
4806 | label: | 5068 | label: |
4807 | type: string | 5069 | type: string |
4808 | example: Pending | 5070 | example: Pending |
5071 | VideoCreateImport: | ||
5072 | allOf: | ||
5073 | - type: object | ||
5074 | additionalProperties: false | ||
5075 | oneOf: | ||
5076 | - properties: | ||
5077 | targetUrl: | ||
5078 | $ref: '#/components/schemas/VideoImport/properties/targetUrl' | ||
5079 | required: [targetUrl] | ||
5080 | - properties: | ||
5081 | magnetUri: | ||
5082 | $ref: '#/components/schemas/VideoImport/properties/magnetUri' | ||
5083 | required: [magnetUri] | ||
5084 | - properties: | ||
5085 | torrentfile: | ||
5086 | $ref: '#/components/schemas/VideoImport/properties/torrentfile' | ||
5087 | required: [torrentfile] | ||
5088 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | ||
5089 | required: | ||
5090 | - channelId | ||
5091 | - name | ||
4809 | VideoImport: | 5092 | VideoImport: |
4810 | properties: | 5093 | properties: |
4811 | id: | 5094 | id: |
4812 | $ref: '#/components/schemas/id' | 5095 | readOnly: true |
5096 | allOf: | ||
5097 | - $ref: '#/components/schemas/id' | ||
4813 | targetUrl: | 5098 | targetUrl: |
4814 | type: string | 5099 | type: string |
4815 | format: url | 5100 | format: url |
@@ -4821,19 +5106,31 @@ components: | |||
4821 | description: magnet URI allowing to resolve the import's source video | 5106 | 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 | 5107 | 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 | 5108 | pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i |
5109 | torrentfile: | ||
5110 | writeOnly: true | ||
5111 | type: string | ||
5112 | format: binary | ||
5113 | description: Torrent file containing only the video file | ||
4824 | torrentName: | 5114 | torrentName: |
5115 | readOnly: true | ||
4825 | type: string | 5116 | type: string |
4826 | state: | 5117 | state: |
4827 | $ref: '#/components/schemas/VideoImportStateConstant' | 5118 | readOnly: true |
5119 | allOf: | ||
5120 | - $ref: '#/components/schemas/VideoImportStateConstant' | ||
4828 | error: | 5121 | error: |
5122 | readOnly: true | ||
4829 | type: string | 5123 | type: string |
4830 | createdAt: | 5124 | createdAt: |
5125 | readOnly: true | ||
4831 | type: string | 5126 | type: string |
4832 | format: date-time | 5127 | format: date-time |
4833 | updatedAt: | 5128 | updatedAt: |
5129 | readOnly: true | ||
4834 | type: string | 5130 | type: string |
4835 | format: date-time | 5131 | format: date-time |
4836 | video: | 5132 | video: |
5133 | readOnly: true | ||
4837 | nullable: true | 5134 | nullable: true |
4838 | allOf: | 5135 | allOf: |
4839 | - $ref: '#/components/schemas/Video' | 5136 | - $ref: '#/components/schemas/Video' |
@@ -4963,13 +5260,16 @@ components: | |||
4963 | format: url | 5260 | format: url |
4964 | text: | 5261 | text: |
4965 | type: string | 5262 | type: string |
4966 | description: Text of the comment in Markdown | 5263 | format: html |
5264 | description: Text of the comment | ||
4967 | minLength: 1 | 5265 | minLength: 1 |
4968 | maxLength: 10000 | 5266 | example: This video is wonderful! |
4969 | threadId: | 5267 | threadId: |
4970 | type: integer | ||
4971 | inReplyToCommentId: | ||
4972 | $ref: '#/components/schemas/id' | 5268 | $ref: '#/components/schemas/id' |
5269 | inReplyToCommentId: | ||
5270 | nullable: true | ||
5271 | allOf: | ||
5272 | - $ref: '#/components/schemas/id' | ||
4973 | videoId: | 5273 | videoId: |
4974 | $ref: '#/components/schemas/Video/properties/id' | 5274 | $ref: '#/components/schemas/Video/properties/id' |
4975 | createdAt: | 5275 | createdAt: |
@@ -4978,6 +5278,14 @@ components: | |||
4978 | updatedAt: | 5278 | updatedAt: |
4979 | type: string | 5279 | type: string |
4980 | format: date-time | 5280 | format: date-time |
5281 | deletedAt: | ||
5282 | nullable: true | ||
5283 | type: string | ||
5284 | format: date-time | ||
5285 | default: null | ||
5286 | isDeleted: | ||
5287 | type: boolean | ||
5288 | default: false | ||
4981 | totalRepliesFromVideoAuthor: | 5289 | totalRepliesFromVideoAuthor: |
4982 | type: integer | 5290 | type: integer |
4983 | minimum: 0 | 5291 | minimum: 0 |
@@ -5035,7 +5343,7 @@ components: | |||
5035 | type: string | 5343 | type: string |
5036 | format: url | 5344 | format: url |
5037 | name: | 5345 | name: |
5038 | description: immutable name of the actor | 5346 | description: immutable name of the actor, used to find or mention it |
5039 | allOf: | 5347 | allOf: |
5040 | - $ref: '#/components/schemas/username' | 5348 | - $ref: '#/components/schemas/username' |
5041 | host: | 5349 | host: |
@@ -5071,7 +5379,9 @@ components: | |||
5071 | - $ref: '#/components/schemas/User/properties/id' | 5379 | - $ref: '#/components/schemas/User/properties/id' |
5072 | displayName: | 5380 | displayName: |
5073 | type: string | 5381 | type: string |
5074 | description: name displayed on the account's profile | 5382 | description: editable name of the account, displayed in its representations |
5383 | minLength: 3 | ||
5384 | maxLength: 120 | ||
5075 | description: | 5385 | description: |
5076 | type: string | 5386 | type: string |
5077 | description: text or bio displayed on the account's profile | 5387 | description: text or bio displayed on the account's profile |
@@ -5079,6 +5389,7 @@ components: | |||
5079 | properties: | 5389 | properties: |
5080 | currentTime: | 5390 | currentTime: |
5081 | type: integer | 5391 | type: integer |
5392 | format: seconds | ||
5082 | description: timestamp within the video, in seconds | 5393 | description: timestamp within the video, in seconds |
5083 | example: 5 | 5394 | example: 5 |
5084 | ServerConfig: | 5395 | ServerConfig: |
@@ -5593,7 +5904,7 @@ components: | |||
5593 | type: boolean | 5904 | type: boolean |
5594 | support: | 5905 | support: |
5595 | description: A text tell the audience how to support the video creator | 5906 | description: A text tell the audience how to support the video creator |
5596 | example: Please support my work on <insert crowdfunding plateform>! <3 | 5907 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
5597 | type: string | 5908 | type: string |
5598 | nsfw: | 5909 | nsfw: |
5599 | description: Whether or not this video contains sensitive content | 5910 | description: Whether or not this video contains sensitive content |
@@ -5822,9 +6133,9 @@ components: | |||
5822 | UpdateUser: | 6133 | UpdateUser: |
5823 | properties: | 6134 | properties: |
5824 | email: | 6135 | email: |
5825 | type: string | ||
5826 | format: email | ||
5827 | description: The updated email of the user | 6136 | description: The updated email of the user |
6137 | allOf: | ||
6138 | - $ref: '#/components/schemas/User/properties/email' | ||
5828 | emailVerified: | 6139 | emailVerified: |
5829 | type: boolean | 6140 | type: boolean |
5830 | description: Set the email as verified | 6141 | description: Set the email as verified |
@@ -5844,28 +6155,54 @@ components: | |||
5844 | adminFlags: | 6155 | adminFlags: |
5845 | $ref: '#/components/schemas/UserAdminFlags' | 6156 | $ref: '#/components/schemas/UserAdminFlags' |
5846 | UpdateMe: | 6157 | UpdateMe: |
6158 | # see shared/models/users/user-update-me.model.ts: | ||
5847 | properties: | 6159 | properties: |
5848 | password: | 6160 | password: |
5849 | $ref: '#/components/schemas/password' | 6161 | $ref: '#/components/schemas/password' |
6162 | currentPassword: | ||
6163 | $ref: '#/components/schemas/password' | ||
5850 | email: | 6164 | email: |
6165 | description: new email used for login and service communications | ||
6166 | allOf: | ||
6167 | - $ref: '#/components/schemas/User/properties/email' | ||
6168 | displayName: | ||
5851 | type: string | 6169 | type: string |
5852 | format: email | 6170 | description: new name of the user in its representations |
5853 | description: Your new email | 6171 | minLength: 3 |
6172 | maxLength: 120 | ||
5854 | displayNSFW: | 6173 | displayNSFW: |
5855 | type: string | 6174 | type: string |
5856 | description: Your new displayNSFW | 6175 | description: new NSFW display policy |
5857 | enum: | 6176 | enum: |
5858 | - 'true' | 6177 | - 'true' |
5859 | - 'false' | 6178 | - 'false' |
5860 | - both | 6179 | - both |
6180 | webTorrentEnabled: | ||
6181 | type: boolean | ||
6182 | description: whether to enable P2P in the player or not | ||
5861 | autoPlayVideo: | 6183 | autoPlayVideo: |
5862 | type: boolean | 6184 | type: boolean |
5863 | description: Your new autoPlayVideo | 6185 | description: new preference regarding playing videos automatically |
5864 | required: | 6186 | autoPlayNextVideo: |
5865 | - password | 6187 | type: boolean |
5866 | 6188 | description: new preference regarding playing following videos automatically | |
5867 | - displayNSFW | 6189 | autoPlayNextVideoPlaylist: |
5868 | - autoPlayVideo | 6190 | type: boolean |
6191 | description: new preference regarding playing following playlist videos automatically | ||
6192 | videosHistoryEnabled: | ||
6193 | type: boolean | ||
6194 | description: whether to keep track of watched history or not | ||
6195 | videoLanguages: | ||
6196 | type: array | ||
6197 | items: | ||
6198 | type: string | ||
6199 | description: list of languages to filter videos down to | ||
6200 | theme: | ||
6201 | type: string | ||
6202 | noInstanceConfigWarningModal: | ||
6203 | type: boolean | ||
6204 | noWelcomeModal: | ||
6205 | type: boolean | ||
5869 | GetMeVideoRating: | 6206 | GetMeVideoRating: |
5870 | properties: | 6207 | properties: |
5871 | id: | 6208 | id: |
@@ -5897,38 +6234,94 @@ components: | |||
5897 | RegisterUser: | 6234 | RegisterUser: |
5898 | properties: | 6235 | properties: |
5899 | username: | 6236 | username: |
5900 | $ref: '#/components/schemas/username' | 6237 | description: immutable name of the user, used to find or mention its actor |
6238 | allOf: | ||
6239 | - $ref: '#/components/schemas/username' | ||
5901 | password: | 6240 | password: |
5902 | $ref: '#/components/schemas/password' | 6241 | $ref: '#/components/schemas/password' |
5903 | email: | 6242 | email: |
5904 | type: string | 6243 | type: string |
5905 | format: email | 6244 | format: email |
5906 | description: The email of the user | 6245 | description: email of the user, used for login or service communications |
5907 | displayName: | 6246 | displayName: |
5908 | type: string | 6247 | type: string |
5909 | description: The user display name | 6248 | description: editable name of the user, displayed in its representations |
5910 | minLength: 1 | 6249 | minLength: 1 |
5911 | maxLength: 120 | 6250 | maxLength: 120 |
5912 | channel: | 6251 | channel: |
5913 | type: object | 6252 | type: object |
6253 | description: channel base information used to create the first channel of the user | ||
5914 | properties: | 6254 | properties: |
5915 | name: | 6255 | name: |
5916 | $ref: '#/components/schemas/usernameChannel' | 6256 | $ref: '#/components/schemas/usernameChannel' |
5917 | displayName: | 6257 | displayName: |
5918 | type: string | 6258 | $ref: '#/components/schemas/VideoChannel/properties/displayName' |
5919 | description: The display name for the default channel | ||
5920 | minLength: 1 | ||
5921 | maxLength: 120 | ||
5922 | required: | 6259 | required: |
5923 | - username | 6260 | - username |
5924 | - password | 6261 | - password |
5925 | 6262 | ||
5926 | 6263 | ||
6264 | OAuthClient: | ||
6265 | properties: | ||
6266 | client_id: | ||
6267 | type: string | ||
6268 | pattern: /^[a-z0-9]$/ | ||
6269 | maxLength: 32 | ||
6270 | minLength: 32 | ||
6271 | example: v1ikx5hnfop4mdpnci8nsqh93c45rldf | ||
6272 | client_secret: | ||
6273 | type: string | ||
6274 | pattern: /^[a-zA-Z0-9]$/ | ||
6275 | maxLength: 32 | ||
6276 | minLength: 32 | ||
6277 | example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt | ||
6278 | OAuthToken-password: | ||
6279 | allOf: | ||
6280 | - $ref: '#/components/schemas/OAuthClient' | ||
6281 | - type: object | ||
6282 | properties: | ||
6283 | grant_type: | ||
6284 | type: string | ||
6285 | enum: | ||
6286 | - password | ||
6287 | - refresh_token | ||
6288 | default: password | ||
6289 | username: | ||
6290 | $ref: '#/components/schemas/User/properties/username' | ||
6291 | password: | ||
6292 | $ref: '#/components/schemas/password' | ||
6293 | required: | ||
6294 | - client_id | ||
6295 | - client_secret | ||
6296 | - grant_type | ||
6297 | - username | ||
6298 | - password | ||
6299 | OAuthToken-refresh_token: | ||
6300 | allOf: | ||
6301 | - $ref: '#/components/schemas/OAuthClient' | ||
6302 | - type: object | ||
6303 | properties: | ||
6304 | grant_type: | ||
6305 | type: string | ||
6306 | enum: | ||
6307 | - password | ||
6308 | - refresh_token | ||
6309 | default: password | ||
6310 | refresh_token: | ||
6311 | type: string | ||
6312 | example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 | ||
6313 | required: | ||
6314 | - client_id | ||
6315 | - client_secret | ||
6316 | - grant_type | ||
6317 | - refresh_token | ||
6318 | |||
5927 | VideoChannel: | 6319 | VideoChannel: |
5928 | properties: | 6320 | properties: |
5929 | # GET/POST/PUT properties | 6321 | # GET/POST/PUT properties |
5930 | displayName: | 6322 | displayName: |
5931 | type: string | 6323 | type: string |
6324 | description: editable name of the channel, displayed in its representations | ||
5932 | example: Videos of Framasoft | 6325 | example: Videos of Framasoft |
5933 | minLength: 1 | 6326 | minLength: 1 |
5934 | maxLength: 120 | 6327 | maxLength: 120 |
@@ -5940,7 +6333,7 @@ components: | |||
5940 | support: | 6333 | support: |
5941 | type: string | 6334 | type: string |
5942 | description: text shown by default on all videos of this channel, to tell the audience how to support it | 6335 | 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 | 6336 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
5944 | minLength: 3 | 6337 | minLength: 3 |
5945 | maxLength: 1000 | 6338 | maxLength: 1000 |
5946 | # GET-only properties | 6339 | # GET-only properties |