diff options
Diffstat (limited to 'support/doc')
-rw-r--r-- | support/doc/api/openapi.yaml | 1067 |
1 files changed, 830 insertions, 237 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 8b4c4c72d..0762e590a 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml | |||
@@ -4,12 +4,12 @@ info: | |||
4 | version: 3.2.0 | 4 | version: 3.2.0 |
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 |
@@ -22,13 +22,13 @@ info: | |||
22 | - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin) | 22 | - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin) |
23 | 23 | ||
24 | See the [REST API quick start](https://docs.joinpeertube.org/api-rest-getting-started) for a few | 24 | See the [REST API quick start](https://docs.joinpeertube.org/api-rest-getting-started) for a few |
25 | examples of using with the PeerTube API. | 25 | examples of using the PeerTube API. |
26 | 26 | ||
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/addUser) 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, |
@@ -204,12 +247,18 @@ tags: | |||
204 | 247 | ||
205 | Administrators can also enable the use of a remote search system, indexing | 248 | Administrators can also enable the use of a remote search system, indexing |
206 | videos and channels not could be not federated by the instance. | 249 | videos and channels not could be not federated by the instance. |
250 | - name: Homepage | ||
251 | description: Get and update the custom homepage | ||
207 | - name: Video Mirroring | 252 | - name: Video Mirroring |
208 | description: | | 253 | description: | |
209 | PeerTube instances can mirror videos from one another, and help distribute some videos. | 254 | PeerTube instances can mirror videos from one another, and help distribute some videos. |
210 | 255 | ||
211 | For importing videos as your own, refer to [video imports](#operation/importVideo). | 256 | For importing videos as your own, refer to [video imports](#operation/importVideo). |
212 | x-tagGroups: | 257 | x-tagGroups: |
258 | - name: Auth | ||
259 | tags: | ||
260 | - Register | ||
261 | - Session | ||
213 | - name: Accounts | 262 | - name: Accounts |
214 | tags: | 263 | tags: |
215 | - Accounts | 264 | - Accounts |
@@ -234,6 +283,9 @@ x-tagGroups: | |||
234 | - name: Search | 283 | - name: Search |
235 | tags: | 284 | tags: |
236 | - Search | 285 | - Search |
286 | - name: Custom pages | ||
287 | tags: | ||
288 | - Homepage | ||
237 | - name: Moderation | 289 | - name: Moderation |
238 | tags: | 290 | tags: |
239 | - Abuses | 291 | - Abuses |
@@ -255,6 +307,7 @@ paths: | |||
255 | tags: | 307 | tags: |
256 | - Accounts | 308 | - Accounts |
257 | summary: Get an account | 309 | summary: Get an account |
310 | operationId: getAccount | ||
258 | parameters: | 311 | parameters: |
259 | - $ref: '#/components/parameters/name' | 312 | - $ref: '#/components/parameters/name' |
260 | responses: | 313 | responses: |
@@ -266,12 +319,14 @@ paths: | |||
266 | $ref: '#/components/schemas/Account' | 319 | $ref: '#/components/schemas/Account' |
267 | '404': | 320 | '404': |
268 | description: account not found | 321 | description: account not found |
322 | |||
269 | '/accounts/{name}/videos': | 323 | '/accounts/{name}/videos': |
270 | get: | 324 | get: |
271 | tags: | 325 | tags: |
272 | - Accounts | 326 | - Accounts |
273 | - Video | 327 | - Video |
274 | summary: 'List videos of an account' | 328 | summary: 'List videos of an account' |
329 | operationId: getAccountVideos | ||
275 | parameters: | 330 | parameters: |
276 | - $ref: '#/components/parameters/name' | 331 | - $ref: '#/components/parameters/name' |
277 | - $ref: '#/components/parameters/categoryOneOf' | 332 | - $ref: '#/components/parameters/categoryOneOf' |
@@ -327,11 +382,13 @@ paths: | |||
327 | json = r.json() | 382 | json = r.json() |
328 | 383 | ||
329 | print(json) | 384 | print(json) |
385 | |||
330 | /accounts: | 386 | /accounts: |
331 | get: | 387 | get: |
332 | tags: | 388 | tags: |
333 | - Accounts | 389 | - Accounts |
334 | summary: List accounts | 390 | summary: List accounts |
391 | operationId: getAccounts | ||
335 | parameters: | 392 | parameters: |
336 | - $ref: '#/components/parameters/start' | 393 | - $ref: '#/components/parameters/start' |
337 | - $ref: '#/components/parameters/count' | 394 | - $ref: '#/components/parameters/count' |
@@ -345,11 +402,13 @@ paths: | |||
345 | type: array | 402 | type: array |
346 | items: | 403 | items: |
347 | $ref: '#/components/schemas/Account' | 404 | $ref: '#/components/schemas/Account' |
405 | |||
348 | /config: | 406 | /config: |
349 | get: | 407 | get: |
350 | tags: | 408 | tags: |
351 | - Config | 409 | - Config |
352 | summary: Get instance public configuration | 410 | summary: Get instance public configuration |
411 | operationId: getConfig | ||
353 | responses: | 412 | responses: |
354 | '200': | 413 | '200': |
355 | description: successful operation | 414 | description: successful operation |
@@ -360,9 +419,11 @@ paths: | |||
360 | examples: | 419 | examples: |
361 | nightly: | 420 | nightly: |
362 | externalValue: https://peertube2.cpy.re/api/v1/config | 421 | externalValue: https://peertube2.cpy.re/api/v1/config |
422 | |||
363 | /config/about: | 423 | /config/about: |
364 | get: | 424 | get: |
365 | summary: Get instance "About" information | 425 | summary: Get instance "About" information |
426 | operationId: getAbout | ||
366 | tags: | 427 | tags: |
367 | - Config | 428 | - Config |
368 | responses: | 429 | responses: |
@@ -375,9 +436,11 @@ paths: | |||
375 | examples: | 436 | examples: |
376 | nightly: | 437 | nightly: |
377 | externalValue: https://peertube2.cpy.re/api/v1/config/about | 438 | externalValue: https://peertube2.cpy.re/api/v1/config/about |
439 | |||
378 | /config/custom: | 440 | /config/custom: |
379 | get: | 441 | get: |
380 | summary: Get instance runtime configuration | 442 | summary: Get instance runtime configuration |
443 | operationId: getCustomConfig | ||
381 | tags: | 444 | tags: |
382 | - Config | 445 | - Config |
383 | security: | 446 | security: |
@@ -392,6 +455,7 @@ paths: | |||
392 | $ref: '#/components/schemas/ServerConfigCustom' | 455 | $ref: '#/components/schemas/ServerConfigCustom' |
393 | put: | 456 | put: |
394 | summary: Set instance runtime configuration | 457 | summary: Set instance runtime configuration |
458 | operationId: putCustomConfig | ||
395 | tags: | 459 | tags: |
396 | - Config | 460 | - Config |
397 | security: | 461 | security: |
@@ -408,6 +472,7 @@ paths: | |||
408 | - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled | 472 | - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled |
409 | delete: | 473 | delete: |
410 | summary: Delete instance runtime configuration | 474 | summary: Delete instance runtime configuration |
475 | operationId: delCustomConfig | ||
411 | tags: | 476 | tags: |
412 | - Config | 477 | - Config |
413 | security: | 478 | security: |
@@ -416,9 +481,45 @@ paths: | |||
416 | responses: | 481 | responses: |
417 | '200': | 482 | '200': |
418 | description: successful operation | 483 | description: successful operation |
484 | |||
485 | /custom-pages/homepage/instance: | ||
486 | get: | ||
487 | summary: Get instance custom homepage | ||
488 | tags: | ||
489 | - Homepage | ||
490 | responses: | ||
491 | '404': | ||
492 | description: No homepage set | ||
493 | '200': | ||
494 | description: successful operation | ||
495 | content: | ||
496 | application/json: | ||
497 | schema: | ||
498 | $ref: '#/components/schemas/CustomHomepage' | ||
499 | put: | ||
500 | summary: Set instance custom homepage | ||
501 | tags: | ||
502 | - Homepage | ||
503 | security: | ||
504 | - OAuth2: | ||
505 | - admin | ||
506 | requestBody: | ||
507 | content: | ||
508 | application/json: | ||
509 | schema: | ||
510 | type: object | ||
511 | properties: | ||
512 | content: | ||
513 | type: string | ||
514 | description: content of the homepage, that will be injected in the client | ||
515 | responses: | ||
516 | '204': | ||
517 | description: successful operation | ||
518 | |||
419 | /jobs/{state}: | 519 | /jobs/{state}: |
420 | get: | 520 | get: |
421 | summary: List instance jobs | 521 | summary: List instance jobs |
522 | operationId: getJobs | ||
422 | security: | 523 | security: |
423 | - OAuth2: | 524 | - OAuth2: |
424 | - admin | 525 | - admin |
@@ -458,66 +559,108 @@ paths: | |||
458 | maxItems: 100 | 559 | maxItems: 100 |
459 | items: | 560 | items: |
460 | $ref: '#/components/schemas/Job' | 561 | $ref: '#/components/schemas/Job' |
461 | '/server/following/{host}': | 562 | |
563 | /server/followers: | ||
564 | get: | ||
565 | tags: | ||
566 | - Instance Follows | ||
567 | summary: List instances following the server | ||
568 | parameters: | ||
569 | - $ref: '#/components/parameters/followState' | ||
570 | - $ref: '#/components/parameters/actorType' | ||
571 | - $ref: '#/components/parameters/start' | ||
572 | - $ref: '#/components/parameters/count' | ||
573 | - $ref: '#/components/parameters/sort' | ||
574 | responses: | ||
575 | '200': | ||
576 | description: successful operation | ||
577 | content: | ||
578 | application/json: | ||
579 | schema: | ||
580 | type: object | ||
581 | properties: | ||
582 | total: | ||
583 | type: integer | ||
584 | example: 1 | ||
585 | data: | ||
586 | type: array | ||
587 | items: | ||
588 | $ref: '#/components/schemas/Follow' | ||
589 | |||
590 | '/server/followers/{nameWithHost}': | ||
462 | delete: | 591 | delete: |
592 | summary: Remove or reject a follower to your server | ||
463 | security: | 593 | security: |
464 | - OAuth2: | 594 | - OAuth2: |
465 | - admin | 595 | - admin |
466 | tags: | 596 | tags: |
467 | - Instance Follows | 597 | - Instance Follows |
468 | summary: Unfollow a server | ||
469 | parameters: | 598 | parameters: |
470 | - name: host | 599 | - name: nameWithHost |
471 | in: path | 600 | in: path |
472 | required: true | 601 | required: true |
473 | description: 'The host to unfollow ' | 602 | description: The remote actor handle to remove from your followers |
474 | schema: | 603 | schema: |
475 | type: string | 604 | type: string |
476 | format: hostname | 605 | format: email |
477 | responses: | 606 | responses: |
478 | '201': | 607 | '204': |
479 | description: successful operation | 608 | description: successful operation |
480 | /server/followers: | 609 | '404': |
481 | get: | 610 | description: follower not found |
611 | |||
612 | '/server/followers/{nameWithHost}/reject': | ||
613 | post: | ||
614 | summary: Reject a pending follower to your server | ||
615 | security: | ||
616 | - OAuth2: | ||
617 | - admin | ||
482 | tags: | 618 | tags: |
483 | - Instance Follows | 619 | - Instance Follows |
484 | summary: List instance followers | ||
485 | parameters: | 620 | parameters: |
486 | - $ref: '#/components/parameters/start' | 621 | - name: nameWithHost |
487 | - $ref: '#/components/parameters/count' | 622 | in: path |
488 | - $ref: '#/components/parameters/sort' | 623 | required: true |
624 | description: The remote actor handle to remove from your followers | ||
625 | schema: | ||
626 | type: string | ||
627 | format: email | ||
489 | responses: | 628 | responses: |
490 | '200': | 629 | '204': |
491 | description: successful operation | 630 | description: successful operation |
492 | content: | 631 | '404': |
493 | application/json: | 632 | description: follower not found |
494 | schema: | 633 | |
495 | type: array | 634 | '/server/followers/{nameWithHost}/accept': |
496 | items: | 635 | post: |
497 | $ref: '#/components/schemas/Follow' | 636 | summary: Accept a pending follower to your server |
637 | security: | ||
638 | - OAuth2: | ||
639 | - admin | ||
640 | tags: | ||
641 | - Instance Follows | ||
642 | parameters: | ||
643 | - name: nameWithHost | ||
644 | in: path | ||
645 | required: true | ||
646 | description: The remote actor handle to remove from your followers | ||
647 | schema: | ||
648 | type: string | ||
649 | format: email | ||
650 | responses: | ||
651 | '204': | ||
652 | description: successful operation | ||
653 | '404': | ||
654 | description: follower not found | ||
655 | |||
498 | /server/following: | 656 | /server/following: |
499 | get: | 657 | get: |
500 | tags: | 658 | tags: |
501 | - Instance Follows | 659 | - Instance Follows |
502 | summary: List instances followed by the server | 660 | summary: List instances followed by the server |
503 | parameters: | 661 | parameters: |
504 | - name: state | 662 | - $ref: '#/components/parameters/followState' |
505 | in: query | 663 | - $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' | 664 | - $ref: '#/components/parameters/start' |
522 | - $ref: '#/components/parameters/count' | 665 | - $ref: '#/components/parameters/count' |
523 | - $ref: '#/components/parameters/sort' | 666 | - $ref: '#/components/parameters/sort' |
@@ -527,16 +670,22 @@ paths: | |||
527 | content: | 670 | content: |
528 | application/json: | 671 | application/json: |
529 | schema: | 672 | schema: |
530 | type: array | 673 | type: object |
531 | items: | 674 | properties: |
532 | $ref: '#/components/schemas/Follow' | 675 | total: |
676 | type: integer | ||
677 | example: 1 | ||
678 | data: | ||
679 | type: array | ||
680 | items: | ||
681 | $ref: '#/components/schemas/Follow' | ||
533 | post: | 682 | post: |
534 | security: | 683 | security: |
535 | - OAuth2: | 684 | - OAuth2: |
536 | - admin | 685 | - admin |
537 | tags: | 686 | tags: |
538 | - Instance Follows | 687 | - Instance Follows |
539 | summary: Follow a server | 688 | summary: Follow a list of servers |
540 | responses: | 689 | responses: |
541 | '204': | 690 | '204': |
542 | description: successful operation | 691 | description: successful operation |
@@ -554,9 +703,33 @@ paths: | |||
554 | type: string | 703 | type: string |
555 | format: hostname | 704 | format: hostname |
556 | uniqueItems: true | 705 | uniqueItems: true |
706 | |||
707 | '/server/following/{host}': | ||
708 | delete: | ||
709 | summary: Unfollow a server | ||
710 | security: | ||
711 | - OAuth2: | ||
712 | - admin | ||
713 | tags: | ||
714 | - Instance Follows | ||
715 | parameters: | ||
716 | - name: host | ||
717 | in: path | ||
718 | required: true | ||
719 | description: The host to unfollow | ||
720 | schema: | ||
721 | type: string | ||
722 | format: hostname | ||
723 | responses: | ||
724 | '204': | ||
725 | description: successful operation | ||
726 | '404': | ||
727 | description: host not found | ||
728 | |||
557 | /users: | 729 | /users: |
558 | post: | 730 | post: |
559 | summary: Create a user | 731 | summary: Create a user |
732 | operationId: addUser | ||
560 | security: | 733 | security: |
561 | - OAuth2: | 734 | - OAuth2: |
562 | - admin | 735 | - admin |
@@ -571,18 +744,18 @@ paths: | |||
571 | $ref: '#/components/schemas/AddUserResponse' | 744 | $ref: '#/components/schemas/AddUserResponse' |
572 | links: | 745 | links: |
573 | # GET /users/{id} | 746 | # GET /users/{id} |
574 | GetUserId: | 747 | GetUser: |
575 | operationId: getUserId | 748 | operationId: getUser |
576 | parameters: | 749 | parameters: |
577 | id: '$response.body#/user/id' | 750 | id: '$response.body#/user/id' |
578 | # PUT /users/{id} | 751 | # PUT /users/{id} |
579 | PutUserId: | 752 | PutUser: |
580 | operationId: putUserId | 753 | operationId: putUser |
581 | parameters: | 754 | parameters: |
582 | id: '$response.body#/user/id' | 755 | id: '$response.body#/user/id' |
583 | # DELETE /users/{id} | 756 | # DELETE /users/{id} |
584 | DelUserId: | 757 | DelUser: |
585 | operationId: delUserId | 758 | operationId: delUser |
586 | parameters: | 759 | parameters: |
587 | id: '$response.body#/user/id' | 760 | id: '$response.body#/user/id' |
588 | '403': | 761 | '403': |
@@ -598,6 +771,7 @@ paths: | |||
598 | required: true | 771 | required: true |
599 | get: | 772 | get: |
600 | summary: List users | 773 | summary: List users |
774 | operationId: getUsers | ||
601 | security: | 775 | security: |
602 | - OAuth2: | 776 | - OAuth2: |
603 | - admin | 777 | - admin |
@@ -618,6 +792,7 @@ paths: | |||
618 | type: array | 792 | type: array |
619 | items: | 793 | items: |
620 | $ref: '#/components/schemas/User' | 794 | $ref: '#/components/schemas/User' |
795 | |||
621 | '/users/{id}': | 796 | '/users/{id}': |
622 | parameters: | 797 | parameters: |
623 | - $ref: '#/components/parameters/id' | 798 | - $ref: '#/components/parameters/id' |
@@ -628,7 +803,7 @@ paths: | |||
628 | - admin | 803 | - admin |
629 | tags: | 804 | tags: |
630 | - Users | 805 | - Users |
631 | operationId: delUserId | 806 | operationId: delUser |
632 | responses: | 807 | responses: |
633 | '204': | 808 | '204': |
634 | description: successful operation | 809 | description: successful operation |
@@ -638,7 +813,7 @@ paths: | |||
638 | - OAuth2: [] | 813 | - OAuth2: [] |
639 | tags: | 814 | tags: |
640 | - Users | 815 | - Users |
641 | operationId: getUserId | 816 | operationId: getUser |
642 | parameters: | 817 | parameters: |
643 | - name: withStats | 818 | - name: withStats |
644 | in: query | 819 | in: query |
@@ -663,7 +838,7 @@ paths: | |||
663 | - OAuth2: [] | 838 | - OAuth2: [] |
664 | tags: | 839 | tags: |
665 | - Users | 840 | - Users |
666 | operationId: putUserId | 841 | operationId: putUser |
667 | responses: | 842 | responses: |
668 | '204': | 843 | '204': |
669 | description: successful operation | 844 | description: successful operation |
@@ -673,11 +848,120 @@ paths: | |||
673 | schema: | 848 | schema: |
674 | $ref: '#/components/schemas/UpdateUser' | 849 | $ref: '#/components/schemas/UpdateUser' |
675 | required: true | 850 | required: true |
851 | |||
852 | /oauth-clients/local: | ||
853 | get: | ||
854 | summary: Login prerequisite | ||
855 | description: You need to retrieve a client id and secret before [logging in](#operation/getOAuthToken). | ||
856 | operationId: getOAuthClient | ||
857 | tags: | ||
858 | - Session | ||
859 | responses: | ||
860 | '200': | ||
861 | description: successful operation | ||
862 | content: | ||
863 | application/json: | ||
864 | schema: | ||
865 | $ref: '#/components/schemas/OAuthClient' | ||
866 | links: | ||
867 | UseOAuthClientToLogin: | ||
868 | operationId: getOAuthToken | ||
869 | parameters: | ||
870 | client_id: '$response.body#/client_id' | ||
871 | client_secret: '$response.body#/client_secret' | ||
872 | x-codeSamples: | ||
873 | - lang: Shell | ||
874 | source: | | ||
875 | API="https://peertube2.cpy.re/api/v1" | ||
876 | |||
877 | ## AUTH | ||
878 | curl -s "$API/oauth-clients/local" | ||
879 | |||
880 | /users/token: | ||
881 | post: | ||
882 | summary: Login | ||
883 | operationId: getOAuthToken | ||
884 | description: With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens. | ||
885 | tags: | ||
886 | - Session | ||
887 | requestBody: | ||
888 | content: | ||
889 | application/x-www-form-urlencoded: | ||
890 | schema: | ||
891 | oneOf: | ||
892 | - $ref: '#/components/schemas/OAuthToken-password' | ||
893 | - $ref: '#/components/schemas/OAuthToken-refresh_token' | ||
894 | discriminator: | ||
895 | propertyName: grant_type | ||
896 | mapping: | ||
897 | password: '#/components/schemas/OAuthToken-password' | ||
898 | refresh_token: '#/components/schemas/OAuthToken-refresh_token' | ||
899 | responses: | ||
900 | '200': | ||
901 | description: successful operation | ||
902 | content: | ||
903 | application/json: | ||
904 | schema: | ||
905 | type: object | ||
906 | properties: | ||
907 | token_type: | ||
908 | type: string | ||
909 | example: Bearer | ||
910 | access_token: | ||
911 | type: string | ||
912 | example: 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0 | ||
913 | description: valid for 1 day | ||
914 | refresh_token: | ||
915 | type: string | ||
916 | example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 | ||
917 | description: valid for 2 weeks | ||
918 | expires_in: | ||
919 | type: integer | ||
920 | minimum: 0 | ||
921 | example: 14399 | ||
922 | refresh_token_expires_in: | ||
923 | type: integer | ||
924 | minimum: 0 | ||
925 | example: 1209600 | ||
926 | x-codeSamples: | ||
927 | - lang: Shell | ||
928 | source: | | ||
929 | ## DEPENDENCIES: jq | ||
930 | API="https://peertube2.cpy.re/api/v1" | ||
931 | USERNAME="<your_username>" | ||
932 | PASSWORD="<your_password>" | ||
933 | |||
934 | ## AUTH | ||
935 | client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id") | ||
936 | client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret") | ||
937 | curl -s "$API/users/token" \ | ||
938 | --data client_id="$client_id" \ | ||
939 | --data client_secret="$client_secret" \ | ||
940 | --data grant_type=password \ | ||
941 | --data username="$USERNAME" \ | ||
942 | --data password="$PASSWORD" \ | ||
943 | | jq -r ".access_token" | ||
944 | |||
945 | /users/revoke-token: | ||
946 | post: | ||
947 | summary: Logout | ||
948 | description: Revokes your access token and its associated refresh token, destroying your current session. | ||
949 | operationId: revokeOAuthToken | ||
950 | tags: | ||
951 | - Session | ||
952 | security: | ||
953 | - OAuth2: [] | ||
954 | responses: | ||
955 | '200': | ||
956 | description: successful operation | ||
957 | |||
676 | /users/register: | 958 | /users/register: |
677 | post: | 959 | post: |
678 | summary: Register a user | 960 | summary: Register a user |
961 | operationId: registerUser | ||
679 | tags: | 962 | tags: |
680 | - Users | 963 | - Users |
964 | - Register | ||
681 | responses: | 965 | responses: |
682 | '204': | 966 | '204': |
683 | description: successful operation | 967 | description: successful operation |
@@ -687,9 +971,55 @@ paths: | |||
687 | schema: | 971 | schema: |
688 | $ref: '#/components/schemas/RegisterUser' | 972 | $ref: '#/components/schemas/RegisterUser' |
689 | required: true | 973 | required: true |
974 | |||
975 | /users/{id}/verify-email: | ||
976 | post: | ||
977 | summary: Verify a user | ||
978 | operationId: verifyUser | ||
979 | description: | | ||
980 | Following a user registration, the new user will receive an email asking to click a link | ||
981 | containing a secret. | ||
982 | tags: | ||
983 | - Users | ||
984 | - Register | ||
985 | parameters: | ||
986 | - $ref: '#/components/parameters/id' | ||
987 | requestBody: | ||
988 | content: | ||
989 | application/json: | ||
990 | schema: | ||
991 | type: object | ||
992 | properties: | ||
993 | verificationString: | ||
994 | type: string | ||
995 | format: url | ||
996 | isPendingEmail: | ||
997 | type: boolean | ||
998 | required: | ||
999 | - verificationString | ||
1000 | responses: | ||
1001 | '204': | ||
1002 | description: successful operation | ||
1003 | '403': | ||
1004 | description: invalid verification string | ||
1005 | '404': | ||
1006 | description: user not found | ||
1007 | |||
1008 | /users/ask-send-verify-email: | ||
1009 | post: | ||
1010 | summary: Resend user verification link | ||
1011 | operationId: resendEmailToVerifyUser | ||
1012 | tags: | ||
1013 | - Users | ||
1014 | - Register | ||
1015 | responses: | ||
1016 | '204': | ||
1017 | description: successful operation | ||
1018 | |||
690 | /users/me: | 1019 | /users/me: |
691 | get: | 1020 | get: |
692 | summary: Get my user information | 1021 | summary: Get my user information |
1022 | operationId: getUserInfo | ||
693 | security: | 1023 | security: |
694 | - OAuth2: | 1024 | - OAuth2: |
695 | - user | 1025 | - user |
@@ -706,6 +1036,7 @@ paths: | |||
706 | $ref: '#/components/schemas/User' | 1036 | $ref: '#/components/schemas/User' |
707 | put: | 1037 | put: |
708 | summary: Update my user information | 1038 | summary: Update my user information |
1039 | operationId: putUserInfo | ||
709 | security: | 1040 | security: |
710 | - OAuth2: | 1041 | - OAuth2: |
711 | - user | 1042 | - user |
@@ -720,6 +1051,7 @@ paths: | |||
720 | schema: | 1051 | schema: |
721 | $ref: '#/components/schemas/UpdateMe' | 1052 | $ref: '#/components/schemas/UpdateMe' |
722 | required: true | 1053 | required: true |
1054 | |||
723 | /users/me/videos/imports: | 1055 | /users/me/videos/imports: |
724 | get: | 1056 | get: |
725 | summary: Get video imports of my user | 1057 | summary: Get video imports of my user |
@@ -740,6 +1072,7 @@ paths: | |||
740 | application/json: | 1072 | application/json: |
741 | schema: | 1073 | schema: |
742 | $ref: '#/components/schemas/VideoImportsList' | 1074 | $ref: '#/components/schemas/VideoImportsList' |
1075 | |||
743 | /users/me/video-quota-used: | 1076 | /users/me/video-quota-used: |
744 | get: | 1077 | get: |
745 | summary: Get my user used quota | 1078 | summary: Get my user used quota |
@@ -764,6 +1097,7 @@ paths: | |||
764 | type: number | 1097 | type: number |
765 | description: The user video quota used today in bytes | 1098 | description: The user video quota used today in bytes |
766 | example: 1681014151 | 1099 | example: 1681014151 |
1100 | |||
767 | '/users/me/videos/{videoId}/rating': | 1101 | '/users/me/videos/{videoId}/rating': |
768 | get: | 1102 | get: |
769 | summary: Get rate of my user for a video | 1103 | summary: Get rate of my user for a video |
@@ -786,6 +1120,7 @@ paths: | |||
786 | application/json: | 1120 | application/json: |
787 | schema: | 1121 | schema: |
788 | $ref: '#/components/schemas/GetMeVideoRating' | 1122 | $ref: '#/components/schemas/GetMeVideoRating' |
1123 | |||
789 | /users/me/videos: | 1124 | /users/me/videos: |
790 | get: | 1125 | get: |
791 | summary: Get videos of my user | 1126 | summary: Get videos of my user |
@@ -806,6 +1141,7 @@ paths: | |||
806 | application/json: | 1141 | application/json: |
807 | schema: | 1142 | schema: |
808 | $ref: '#/components/schemas/VideoListResponse' | 1143 | $ref: '#/components/schemas/VideoListResponse' |
1144 | |||
809 | /users/me/subscriptions: | 1145 | /users/me/subscriptions: |
810 | get: | 1146 | get: |
811 | summary: Get my user subscriptions | 1147 | summary: Get my user subscriptions |
@@ -851,6 +1187,7 @@ paths: | |||
851 | responses: | 1187 | responses: |
852 | '200': | 1188 | '200': |
853 | description: successful operation | 1189 | description: successful operation |
1190 | |||
854 | /users/me/subscriptions/exist: | 1191 | /users/me/subscriptions/exist: |
855 | get: | 1192 | get: |
856 | summary: Get if subscriptions exist for my user | 1193 | summary: Get if subscriptions exist for my user |
@@ -868,6 +1205,7 @@ paths: | |||
868 | application/json: | 1205 | application/json: |
869 | schema: | 1206 | schema: |
870 | type: object | 1207 | type: object |
1208 | |||
871 | /users/me/subscriptions/videos: | 1209 | /users/me/subscriptions/videos: |
872 | get: | 1210 | get: |
873 | summary: List videos of subscriptions of my user | 1211 | summary: List videos of subscriptions of my user |
@@ -897,6 +1235,7 @@ paths: | |||
897 | application/json: | 1235 | application/json: |
898 | schema: | 1236 | schema: |
899 | $ref: '#/components/schemas/VideoListResponse' | 1237 | $ref: '#/components/schemas/VideoListResponse' |
1238 | |||
900 | '/users/me/subscriptions/{subscriptionHandle}': | 1239 | '/users/me/subscriptions/{subscriptionHandle}': |
901 | get: | 1240 | get: |
902 | summary: Get subscription of my user | 1241 | summary: Get subscription of my user |
@@ -926,6 +1265,7 @@ paths: | |||
926 | responses: | 1265 | responses: |
927 | '200': | 1266 | '200': |
928 | description: successful operation | 1267 | description: successful operation |
1268 | |||
929 | /users/me/notifications: | 1269 | /users/me/notifications: |
930 | get: | 1270 | get: |
931 | summary: List my notifications | 1271 | summary: List my notifications |
@@ -949,6 +1289,7 @@ paths: | |||
949 | application/json: | 1289 | application/json: |
950 | schema: | 1290 | schema: |
951 | $ref: '#/components/schemas/NotificationListResponse' | 1291 | $ref: '#/components/schemas/NotificationListResponse' |
1292 | |||
952 | /users/me/notifications/read: | 1293 | /users/me/notifications/read: |
953 | post: | 1294 | post: |
954 | summary: Mark notifications as read by their id | 1295 | summary: Mark notifications as read by their id |
@@ -972,6 +1313,7 @@ paths: | |||
972 | responses: | 1313 | responses: |
973 | '204': | 1314 | '204': |
974 | description: successful operation | 1315 | description: successful operation |
1316 | |||
975 | /users/me/notifications/read-all: | 1317 | /users/me/notifications/read-all: |
976 | post: | 1318 | post: |
977 | summary: Mark all my notification as read | 1319 | summary: Mark all my notification as read |
@@ -982,6 +1324,7 @@ paths: | |||
982 | responses: | 1324 | responses: |
983 | '204': | 1325 | '204': |
984 | description: successful operation | 1326 | description: successful operation |
1327 | |||
985 | /users/me/notification-settings: | 1328 | /users/me/notification-settings: |
986 | put: | 1329 | put: |
987 | summary: Update my notification settings | 1330 | summary: Update my notification settings |
@@ -1022,6 +1365,7 @@ paths: | |||
1022 | responses: | 1365 | responses: |
1023 | '204': | 1366 | '204': |
1024 | description: successful operation | 1367 | description: successful operation |
1368 | |||
1025 | /users/me/history/videos: | 1369 | /users/me/history/videos: |
1026 | get: | 1370 | get: |
1027 | summary: List watched videos history | 1371 | summary: List watched videos history |
@@ -1040,6 +1384,7 @@ paths: | |||
1040 | application/json: | 1384 | application/json: |
1041 | schema: | 1385 | schema: |
1042 | $ref: '#/components/schemas/VideoListResponse' | 1386 | $ref: '#/components/schemas/VideoListResponse' |
1387 | |||
1043 | /users/me/history/videos/remove: | 1388 | /users/me/history/videos/remove: |
1044 | post: | 1389 | post: |
1045 | summary: Clear video history | 1390 | summary: Clear video history |
@@ -1060,6 +1405,7 @@ paths: | |||
1060 | responses: | 1405 | responses: |
1061 | '204': | 1406 | '204': |
1062 | description: successful operation | 1407 | description: successful operation |
1408 | |||
1063 | /users/me/avatar/pick: | 1409 | /users/me/avatar/pick: |
1064 | post: | 1410 | post: |
1065 | summary: Update my user avatar | 1411 | summary: Update my user avatar |
@@ -1098,6 +1444,7 @@ paths: | |||
1098 | encoding: | 1444 | encoding: |
1099 | avatarfile: | 1445 | avatarfile: |
1100 | contentType: image/png, image/jpeg | 1446 | contentType: image/png, image/jpeg |
1447 | |||
1101 | /users/me/avatar: | 1448 | /users/me/avatar: |
1102 | delete: | 1449 | delete: |
1103 | summary: Delete my avatar | 1450 | summary: Delete my avatar |
@@ -1119,6 +1466,7 @@ paths: | |||
1119 | responses: | 1466 | responses: |
1120 | '200': | 1467 | '200': |
1121 | description: successful operation | 1468 | description: successful operation |
1469 | |||
1122 | '/videos/ownership/{id}/accept': | 1470 | '/videos/ownership/{id}/accept': |
1123 | post: | 1471 | post: |
1124 | summary: Accept ownership change request | 1472 | summary: Accept ownership change request |
@@ -1135,6 +1483,7 @@ paths: | |||
1135 | description: cannot terminate an ownership change of another user | 1483 | description: cannot terminate an ownership change of another user |
1136 | '404': | 1484 | '404': |
1137 | description: video owneship change not found | 1485 | description: video owneship change not found |
1486 | |||
1138 | '/videos/ownership/{id}/refuse': | 1487 | '/videos/ownership/{id}/refuse': |
1139 | post: | 1488 | post: |
1140 | summary: Refuse ownership change request | 1489 | summary: Refuse ownership change request |
@@ -1151,6 +1500,7 @@ paths: | |||
1151 | description: cannot terminate an ownership change of another user | 1500 | description: cannot terminate an ownership change of another user |
1152 | '404': | 1501 | '404': |
1153 | description: video owneship change not found | 1502 | description: video owneship change not found |
1503 | |||
1154 | '/videos/{id}/give-ownership': | 1504 | '/videos/{id}/give-ownership': |
1155 | post: | 1505 | post: |
1156 | summary: Request ownership change | 1506 | summary: Request ownership change |
@@ -1178,9 +1528,11 @@ paths: | |||
1178 | description: changing video ownership to a remote account is not supported yet | 1528 | description: changing video ownership to a remote account is not supported yet |
1179 | '404': | 1529 | '404': |
1180 | description: video not found | 1530 | description: video not found |
1531 | |||
1181 | /videos: | 1532 | /videos: |
1182 | get: | 1533 | get: |
1183 | summary: List videos | 1534 | summary: List videos |
1535 | operationId: getVideos | ||
1184 | tags: | 1536 | tags: |
1185 | - Video | 1537 | - Video |
1186 | parameters: | 1538 | parameters: |
@@ -1203,6 +1555,7 @@ paths: | |||
1203 | application/json: | 1555 | application/json: |
1204 | schema: | 1556 | schema: |
1205 | $ref: '#/components/schemas/VideoListResponse' | 1557 | $ref: '#/components/schemas/VideoListResponse' |
1558 | |||
1206 | /videos/categories: | 1559 | /videos/categories: |
1207 | get: | 1560 | get: |
1208 | summary: List available video categories | 1561 | summary: List available video categories |
@@ -1221,6 +1574,7 @@ paths: | |||
1221 | examples: | 1574 | examples: |
1222 | nightly: | 1575 | nightly: |
1223 | externalValue: https://peertube2.cpy.re/api/v1/videos/categories | 1576 | externalValue: https://peertube2.cpy.re/api/v1/videos/categories |
1577 | |||
1224 | /videos/licences: | 1578 | /videos/licences: |
1225 | get: | 1579 | get: |
1226 | summary: List available video licences | 1580 | summary: List available video licences |
@@ -1239,6 +1593,7 @@ paths: | |||
1239 | examples: | 1593 | examples: |
1240 | nightly: | 1594 | nightly: |
1241 | externalValue: https://peertube2.cpy.re/api/v1/videos/licences | 1595 | externalValue: https://peertube2.cpy.re/api/v1/videos/licences |
1596 | |||
1242 | /videos/languages: | 1597 | /videos/languages: |
1243 | get: | 1598 | get: |
1244 | summary: List available video languages | 1599 | summary: List available video languages |
@@ -1257,6 +1612,7 @@ paths: | |||
1257 | examples: | 1612 | examples: |
1258 | nightly: | 1613 | nightly: |
1259 | externalValue: https://peertube2.cpy.re/api/v1/videos/languages | 1614 | externalValue: https://peertube2.cpy.re/api/v1/videos/languages |
1615 | |||
1260 | /videos/privacies: | 1616 | /videos/privacies: |
1261 | get: | 1617 | get: |
1262 | summary: List available video privacy policies | 1618 | summary: List available video privacy policies |
@@ -1275,9 +1631,11 @@ paths: | |||
1275 | examples: | 1631 | examples: |
1276 | nightly: | 1632 | nightly: |
1277 | externalValue: https://peertube2.cpy.re/api/v1/videos/privacies | 1633 | externalValue: https://peertube2.cpy.re/api/v1/videos/privacies |
1634 | |||
1278 | '/videos/{id}': | 1635 | '/videos/{id}': |
1279 | put: | 1636 | put: |
1280 | summary: Update a video | 1637 | summary: Update a video |
1638 | operationId: putVideo | ||
1281 | security: | 1639 | security: |
1282 | - OAuth2: [] | 1640 | - OAuth2: [] |
1283 | tags: | 1641 | tags: |
@@ -1317,7 +1675,7 @@ paths: | |||
1317 | type: string | 1675 | type: string |
1318 | support: | 1676 | support: |
1319 | description: A text tell the audience how to support the video creator | 1677 | description: A text tell the audience how to support the video creator |
1320 | example: Please support my work on <insert crowdfunding plateform>! <3 | 1678 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
1321 | type: string | 1679 | type: string |
1322 | nsfw: | 1680 | nsfw: |
1323 | description: Whether or not this video contains sensitive content | 1681 | description: Whether or not this video contains sensitive content |
@@ -1352,6 +1710,7 @@ paths: | |||
1352 | contentType: image/jpeg | 1710 | contentType: image/jpeg |
1353 | get: | 1711 | get: |
1354 | summary: Get a video | 1712 | summary: Get a video |
1713 | operationId: getVideo | ||
1355 | tags: | 1714 | tags: |
1356 | - Video | 1715 | - Video |
1357 | parameters: | 1716 | parameters: |
@@ -1365,6 +1724,7 @@ paths: | |||
1365 | $ref: '#/components/schemas/VideoDetails' | 1724 | $ref: '#/components/schemas/VideoDetails' |
1366 | delete: | 1725 | delete: |
1367 | summary: Delete a video | 1726 | summary: Delete a video |
1727 | operationId: delVideo | ||
1368 | security: | 1728 | security: |
1369 | - OAuth2: [] | 1729 | - OAuth2: [] |
1370 | tags: | 1730 | tags: |
@@ -1374,9 +1734,11 @@ paths: | |||
1374 | responses: | 1734 | responses: |
1375 | '204': | 1735 | '204': |
1376 | description: successful operation | 1736 | description: successful operation |
1737 | |||
1377 | '/videos/{id}/description': | 1738 | '/videos/{id}/description': |
1378 | get: | 1739 | get: |
1379 | summary: Get complete video description | 1740 | summary: Get complete video description |
1741 | operationId: getVideoDesc | ||
1380 | tags: | 1742 | tags: |
1381 | - Video | 1743 | - Video |
1382 | parameters: | 1744 | parameters: |
@@ -1393,6 +1755,7 @@ paths: | |||
1393 | maxLength: 10000 | 1755 | maxLength: 10000 |
1394 | example: | | 1756 | 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)** | 1757 | **[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)** |
1758 | |||
1396 | '/videos/{id}/views': | 1759 | '/videos/{id}/views': |
1397 | post: | 1760 | post: |
1398 | summary: Add a view to a video | 1761 | summary: Add a view to a video |
@@ -1403,6 +1766,7 @@ paths: | |||
1403 | responses: | 1766 | responses: |
1404 | '204': | 1767 | '204': |
1405 | description: successful operation | 1768 | description: successful operation |
1769 | |||
1406 | '/videos/{id}/watching': | 1770 | '/videos/{id}/watching': |
1407 | put: | 1771 | put: |
1408 | summary: Set watching progress of a video | 1772 | summary: Set watching progress of a video |
@@ -1421,6 +1785,7 @@ paths: | |||
1421 | responses: | 1785 | responses: |
1422 | '204': | 1786 | '204': |
1423 | description: successful operation | 1787 | description: successful operation |
1788 | |||
1424 | /videos/upload: | 1789 | /videos/upload: |
1425 | post: | 1790 | post: |
1426 | summary: Upload a video | 1791 | summary: Upload a video |
@@ -1477,26 +1842,27 @@ paths: | |||
1477 | FILE_PATH="<your_file_path>" | 1842 | FILE_PATH="<your_file_path>" |
1478 | CHANNEL_ID="<your_channel_id>" | 1843 | CHANNEL_ID="<your_channel_id>" |
1479 | NAME="<video_name>" | 1844 | NAME="<video_name>" |
1845 | API="https://peertube2.cpy.re/api/v1" | ||
1480 | 1846 | ||
1481 | API_PATH="https://peertube2.cpy.re/api/v1" | ||
1482 | ## AUTH | 1847 | ## AUTH |
1483 | client_id=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_id") | 1848 | 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") | 1849 | client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret") |
1485 | token=$(curl -s "$API_PATH/users/token" \ | 1850 | token=$(curl -s "$API/users/token" \ |
1486 | --data client_id="$client_id" \ | 1851 | --data client_id="$client_id" \ |
1487 | --data client_secret="$client_secret" \ | 1852 | --data client_secret="$client_secret" \ |
1488 | --data grant_type=password \ | 1853 | --data grant_type=password \ |
1489 | --data response_type=code \ | ||
1490 | --data username="$USERNAME" \ | 1854 | --data username="$USERNAME" \ |
1491 | --data password="$PASSWORD" \ | 1855 | --data password="$PASSWORD" \ |
1492 | | jq -r ".access_token") | 1856 | | jq -r ".access_token") |
1857 | |||
1493 | ## VIDEO UPLOAD | 1858 | ## VIDEO UPLOAD |
1494 | curl -s "$API_PATH/videos/upload" \ | 1859 | curl -s "$API/videos/upload" \ |
1495 | -H "Authorization: Bearer $token" \ | 1860 | -H "Authorization: Bearer $token" \ |
1496 | --max-time 600 \ | 1861 | --max-time 600 \ |
1497 | --form videofile=@"$FILE_PATH" \ | 1862 | --form videofile=@"$FILE_PATH" \ |
1498 | --form channelId=$CHANNEL_ID \ | 1863 | --form channelId=$CHANNEL_ID \ |
1499 | --form name="$NAME" | 1864 | --form name="$NAME" |
1865 | |||
1500 | /videos/upload-resumable: | 1866 | /videos/upload-resumable: |
1501 | post: | 1867 | post: |
1502 | summary: Initialize the resumable upload of a video | 1868 | summary: Initialize the resumable upload of a video |
@@ -1560,7 +1926,7 @@ paths: | |||
1560 | - Video Upload | 1926 | - Video Upload |
1561 | parameters: | 1927 | parameters: |
1562 | - name: upload_id | 1928 | - name: upload_id |
1563 | in: path | 1929 | in: query |
1564 | required: true | 1930 | required: true |
1565 | description: | | 1931 | description: | |
1566 | Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is | 1932 | Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is |
@@ -1637,7 +2003,7 @@ paths: | |||
1637 | - Video Upload | 2003 | - Video Upload |
1638 | parameters: | 2004 | parameters: |
1639 | - name: upload_id | 2005 | - name: upload_id |
1640 | in: path | 2006 | in: query |
1641 | required: true | 2007 | required: true |
1642 | description: | | 2008 | description: | |
1643 | Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is | 2009 | Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is |
@@ -1658,6 +2024,7 @@ paths: | |||
1658 | schema: | 2024 | schema: |
1659 | type: number | 2025 | type: number |
1660 | example: 0 | 2026 | example: 0 |
2027 | |||
1661 | /videos/imports: | 2028 | /videos/imports: |
1662 | post: | 2029 | post: |
1663 | summary: Import a video | 2030 | summary: Import a video |
@@ -1672,74 +2039,7 @@ paths: | |||
1672 | content: | 2039 | content: |
1673 | multipart/form-data: | 2040 | multipart/form-data: |
1674 | schema: | 2041 | schema: |
1675 | type: object | 2042 | $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: | 2043 | encoding: |
1744 | torrentfile: | 2044 | torrentfile: |
1745 | contentType: application/x-bittorrent | 2045 | contentType: application/x-bittorrent |
@@ -1764,7 +2064,7 @@ paths: | |||
1764 | /videos/live: | 2064 | /videos/live: |
1765 | post: | 2065 | post: |
1766 | summary: Create a live | 2066 | summary: Create a live |
1767 | operationId: createLive | 2067 | operationId: addLive |
1768 | security: | 2068 | security: |
1769 | - OAuth2: [] | 2069 | - OAuth2: [] |
1770 | tags: | 2070 | tags: |
@@ -1814,7 +2114,7 @@ paths: | |||
1814 | type: string | 2114 | type: string |
1815 | support: | 2115 | support: |
1816 | description: A text tell the audience how to support the creator | 2116 | description: A text tell the audience how to support the creator |
1817 | example: Please support my work on <insert crowdfunding plateform>! <3 | 2117 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
1818 | type: string | 2118 | type: string |
1819 | nsfw: | 2119 | nsfw: |
1820 | description: Whether or not this live video/replay contains sensitive content | 2120 | description: Whether or not this live video/replay contains sensitive content |
@@ -2012,7 +2312,6 @@ paths: | |||
2012 | type: array | 2312 | type: array |
2013 | items: | 2313 | items: |
2014 | $ref: '#/components/schemas/Abuse' | 2314 | $ref: '#/components/schemas/Abuse' |
2015 | |||
2016 | post: | 2315 | post: |
2017 | summary: Report an abuse | 2316 | summary: Report an abuse |
2018 | security: | 2317 | security: |
@@ -2042,10 +2341,12 @@ paths: | |||
2042 | - $ref: '#/components/schemas/Video/properties/id' | 2341 | - $ref: '#/components/schemas/Video/properties/id' |
2043 | startAt: | 2342 | startAt: |
2044 | type: integer | 2343 | type: integer |
2344 | format: seconds | ||
2045 | description: Timestamp in the video that marks the beginning of the report | 2345 | description: Timestamp in the video that marks the beginning of the report |
2046 | minimum: 0 | 2346 | minimum: 0 |
2047 | endAt: | 2347 | endAt: |
2048 | type: integer | 2348 | type: integer |
2349 | format: seconds | ||
2049 | description: Timestamp in the video that marks the ending of the report | 2350 | description: Timestamp in the video that marks the ending of the report |
2050 | minimum: 0 | 2351 | minimum: 0 |
2051 | comment: | 2352 | comment: |
@@ -2064,10 +2365,21 @@ paths: | |||
2064 | required: | 2365 | required: |
2065 | - reason | 2366 | - reason |
2066 | responses: | 2367 | responses: |
2067 | '204': | 2368 | '200': |
2068 | description: successful operation | 2369 | description: successful operation |
2370 | content: | ||
2371 | application/json: | ||
2372 | schema: | ||
2373 | type: object | ||
2374 | properties: | ||
2375 | abuse: | ||
2376 | type: object | ||
2377 | properties: | ||
2378 | id: | ||
2379 | $ref: '#/components/schemas/id' | ||
2069 | '400': | 2380 | '400': |
2070 | description: incorrect request parameters | 2381 | description: incorrect request parameters |
2382 | |||
2071 | '/abuses/{abuseId}': | 2383 | '/abuses/{abuseId}': |
2072 | put: | 2384 | put: |
2073 | summary: Update an abuse | 2385 | summary: Update an abuse |
@@ -2112,6 +2424,7 @@ paths: | |||
2112 | description: successful operation | 2424 | description: successful operation |
2113 | '404': | 2425 | '404': |
2114 | description: block not found | 2426 | description: block not found |
2427 | |||
2115 | '/abuses/{abuseId}/messages': | 2428 | '/abuses/{abuseId}/messages': |
2116 | get: | 2429 | get: |
2117 | summary: List messages of an abuse | 2430 | summary: List messages of an abuse |
@@ -2127,10 +2440,15 @@ paths: | |||
2127 | content: | 2440 | content: |
2128 | application/json: | 2441 | application/json: |
2129 | schema: | 2442 | schema: |
2130 | type: array | 2443 | type: object |
2131 | items: | 2444 | properties: |
2132 | $ref: '#/components/schemas/AbuseMessage' | 2445 | total: |
2133 | 2446 | type: integer | |
2447 | example: 1 | ||
2448 | data: | ||
2449 | type: array | ||
2450 | items: | ||
2451 | $ref: '#/components/schemas/AbuseMessage' | ||
2134 | post: | 2452 | post: |
2135 | summary: Add message to an abuse | 2453 | summary: Add message to an abuse |
2136 | security: | 2454 | security: |
@@ -2158,6 +2476,7 @@ paths: | |||
2158 | description: successful operation | 2476 | description: successful operation |
2159 | '400': | 2477 | '400': |
2160 | description: incorrect request parameters | 2478 | description: incorrect request parameters |
2479 | |||
2161 | '/abuses/{abuseId}/messages/{abuseMessageId}': | 2480 | '/abuses/{abuseId}/messages/{abuseMessageId}': |
2162 | delete: | 2481 | delete: |
2163 | summary: Delete an abuse message | 2482 | summary: Delete an abuse message |
@@ -2175,6 +2494,7 @@ paths: | |||
2175 | '/videos/{id}/blacklist': | 2494 | '/videos/{id}/blacklist': |
2176 | post: | 2495 | post: |
2177 | summary: Block a video | 2496 | summary: Block a video |
2497 | operationId: addVideoBlock | ||
2178 | security: | 2498 | security: |
2179 | - OAuth2: | 2499 | - OAuth2: |
2180 | - admin | 2500 | - admin |
@@ -2188,6 +2508,7 @@ paths: | |||
2188 | description: successful operation | 2508 | description: successful operation |
2189 | delete: | 2509 | delete: |
2190 | summary: Unblock a video by its id | 2510 | summary: Unblock a video by its id |
2511 | operationId: delVideoBlock | ||
2191 | security: | 2512 | security: |
2192 | - OAuth2: | 2513 | - OAuth2: |
2193 | - admin | 2514 | - admin |
@@ -2201,11 +2522,13 @@ paths: | |||
2201 | description: successful operation | 2522 | description: successful operation |
2202 | '404': | 2523 | '404': |
2203 | description: block not found | 2524 | description: block not found |
2525 | |||
2204 | /videos/blacklist: | 2526 | /videos/blacklist: |
2205 | get: | 2527 | get: |
2206 | tags: | 2528 | tags: |
2207 | - Video Blocks | 2529 | - Video Blocks |
2208 | summary: List video blocks | 2530 | summary: List video blocks |
2531 | operationId: getVideoBlocks | ||
2209 | security: | 2532 | security: |
2210 | - OAuth2: | 2533 | - OAuth2: |
2211 | - admin | 2534 | - admin |
@@ -2247,9 +2570,11 @@ paths: | |||
2247 | type: array | 2570 | type: array |
2248 | items: | 2571 | items: |
2249 | $ref: '#/components/schemas/VideoBlacklist' | 2572 | $ref: '#/components/schemas/VideoBlacklist' |
2573 | |||
2250 | /videos/{id}/captions: | 2574 | /videos/{id}/captions: |
2251 | get: | 2575 | get: |
2252 | summary: List captions of a video | 2576 | summary: List captions of a video |
2577 | operationId: getVideoCaptions | ||
2253 | tags: | 2578 | tags: |
2254 | - Video Captions | 2579 | - Video Captions |
2255 | parameters: | 2580 | parameters: |
@@ -2269,9 +2594,11 @@ paths: | |||
2269 | type: array | 2594 | type: array |
2270 | items: | 2595 | items: |
2271 | $ref: '#/components/schemas/VideoCaption' | 2596 | $ref: '#/components/schemas/VideoCaption' |
2597 | |||
2272 | /videos/{id}/captions/{captionLanguage}: | 2598 | /videos/{id}/captions/{captionLanguage}: |
2273 | put: | 2599 | put: |
2274 | summary: Add or replace a video caption | 2600 | summary: Add or replace a video caption |
2601 | operationId: addVideoCaption | ||
2275 | security: | 2602 | security: |
2276 | - OAuth2: | 2603 | - OAuth2: |
2277 | - user | 2604 | - user |
@@ -2300,6 +2627,7 @@ paths: | |||
2300 | description: video or language not found | 2627 | description: video or language not found |
2301 | delete: | 2628 | delete: |
2302 | summary: Delete a video caption | 2629 | summary: Delete a video caption |
2630 | operationId: delVideoCaption | ||
2303 | security: | 2631 | security: |
2304 | - OAuth2: | 2632 | - OAuth2: |
2305 | - user | 2633 | - user |
@@ -2313,9 +2641,11 @@ paths: | |||
2313 | description: successful operation | 2641 | description: successful operation |
2314 | '404': | 2642 | '404': |
2315 | description: video or language or caption for that language not found | 2643 | description: video or language or caption for that language not found |
2644 | |||
2316 | /video-channels: | 2645 | /video-channels: |
2317 | get: | 2646 | get: |
2318 | summary: List video channels | 2647 | summary: List video channels |
2648 | operationId: getVideoChannels | ||
2319 | tags: | 2649 | tags: |
2320 | - Video Channels | 2650 | - Video Channels |
2321 | parameters: | 2651 | parameters: |
@@ -2331,6 +2661,7 @@ paths: | |||
2331 | $ref: '#/components/schemas/VideoChannelList' | 2661 | $ref: '#/components/schemas/VideoChannelList' |
2332 | post: | 2662 | post: |
2333 | summary: Create a video channel | 2663 | summary: Create a video channel |
2664 | operationId: addVideoChannel | ||
2334 | security: | 2665 | security: |
2335 | - OAuth2: [] | 2666 | - OAuth2: [] |
2336 | tags: | 2667 | tags: |
@@ -2338,14 +2669,26 @@ paths: | |||
2338 | responses: | 2669 | responses: |
2339 | '204': | 2670 | '204': |
2340 | description: successful operation | 2671 | description: successful operation |
2672 | content: | ||
2673 | application/json: | ||
2674 | schema: | ||
2675 | type: object | ||
2676 | properties: | ||
2677 | videoChannel: | ||
2678 | type: object | ||
2679 | properties: | ||
2680 | id: | ||
2681 | $ref: '#/components/schemas/VideoChannel/properties/id' | ||
2341 | requestBody: | 2682 | requestBody: |
2342 | content: | 2683 | content: |
2343 | application/json: | 2684 | application/json: |
2344 | schema: | 2685 | schema: |
2345 | $ref: '#/components/schemas/VideoChannelCreate' | 2686 | $ref: '#/components/schemas/VideoChannelCreate' |
2687 | |||
2346 | '/video-channels/{channelHandle}': | 2688 | '/video-channels/{channelHandle}': |
2347 | get: | 2689 | get: |
2348 | summary: Get a video channel | 2690 | summary: Get a video channel |
2691 | operationId: getVideoChannel | ||
2349 | tags: | 2692 | tags: |
2350 | - Video Channels | 2693 | - Video Channels |
2351 | parameters: | 2694 | parameters: |
@@ -2359,6 +2702,7 @@ paths: | |||
2359 | $ref: '#/components/schemas/VideoChannel' | 2702 | $ref: '#/components/schemas/VideoChannel' |
2360 | put: | 2703 | put: |
2361 | summary: Update a video channel | 2704 | summary: Update a video channel |
2705 | operationId: putVideoChannel | ||
2362 | security: | 2706 | security: |
2363 | - OAuth2: [] | 2707 | - OAuth2: [] |
2364 | tags: | 2708 | tags: |
@@ -2375,6 +2719,7 @@ paths: | |||
2375 | $ref: '#/components/schemas/VideoChannelUpdate' | 2719 | $ref: '#/components/schemas/VideoChannelUpdate' |
2376 | delete: | 2720 | delete: |
2377 | summary: Delete a video channel | 2721 | summary: Delete a video channel |
2722 | operationId: delVideoChannel | ||
2378 | security: | 2723 | security: |
2379 | - OAuth2: [] | 2724 | - OAuth2: [] |
2380 | tags: | 2725 | tags: |
@@ -2384,9 +2729,11 @@ paths: | |||
2384 | responses: | 2729 | responses: |
2385 | '204': | 2730 | '204': |
2386 | description: successful operation | 2731 | description: successful operation |
2732 | |||
2387 | '/video-channels/{channelHandle}/videos': | 2733 | '/video-channels/{channelHandle}/videos': |
2388 | get: | 2734 | get: |
2389 | summary: List videos of a video channel | 2735 | summary: List videos of a video channel |
2736 | operationId: getVideoChannelVideos | ||
2390 | tags: | 2737 | tags: |
2391 | - Video | 2738 | - Video |
2392 | - Video Channels | 2739 | - Video Channels |
@@ -2411,6 +2758,7 @@ paths: | |||
2411 | application/json: | 2758 | application/json: |
2412 | schema: | 2759 | schema: |
2413 | $ref: '#/components/schemas/VideoListResponse' | 2760 | $ref: '#/components/schemas/VideoListResponse' |
2761 | |||
2414 | '/video-channels/{channelHandle}/avatar/pick': | 2762 | '/video-channels/{channelHandle}/avatar/pick': |
2415 | post: | 2763 | post: |
2416 | summary: Update channel avatar | 2764 | summary: Update channel avatar |
@@ -2451,6 +2799,7 @@ paths: | |||
2451 | encoding: | 2799 | encoding: |
2452 | avatarfile: | 2800 | avatarfile: |
2453 | contentType: image/png, image/jpeg | 2801 | contentType: image/png, image/jpeg |
2802 | |||
2454 | '/video-channels/{channelHandle}/avatar': | 2803 | '/video-channels/{channelHandle}/avatar': |
2455 | delete: | 2804 | delete: |
2456 | summary: Delete channel avatar | 2805 | summary: Delete channel avatar |
@@ -2464,7 +2813,6 @@ paths: | |||
2464 | '204': | 2813 | '204': |
2465 | description: successful operation | 2814 | description: successful operation |
2466 | 2815 | ||
2467 | |||
2468 | '/video-channels/{channelHandle}/banner/pick': | 2816 | '/video-channels/{channelHandle}/banner/pick': |
2469 | post: | 2817 | post: |
2470 | summary: Update channel banner | 2818 | summary: Update channel banner |
@@ -2505,6 +2853,7 @@ paths: | |||
2505 | encoding: | 2853 | encoding: |
2506 | bannerfile: | 2854 | bannerfile: |
2507 | contentType: image/png, image/jpeg | 2855 | contentType: image/png, image/jpeg |
2856 | |||
2508 | '/video-channels/{channelHandle}/banner': | 2857 | '/video-channels/{channelHandle}/banner': |
2509 | delete: | 2858 | delete: |
2510 | summary: Delete channel banner | 2859 | summary: Delete channel banner |
@@ -2565,7 +2914,7 @@ paths: | |||
2565 | post: | 2914 | post: |
2566 | summary: Create a video playlist | 2915 | summary: Create a video playlist |
2567 | description: If the video playlist is set as public, `videoChannelId` is mandatory. | 2916 | description: If the video playlist is set as public, `videoChannelId` is mandatory. |
2568 | operationId: createPlaylist | 2917 | operationId: addPlaylist |
2569 | security: | 2918 | security: |
2570 | - OAuth2: [] | 2919 | - OAuth2: [] |
2571 | tags: | 2920 | tags: |
@@ -2617,13 +2966,13 @@ paths: | |||
2617 | thumbnailfile: | 2966 | thumbnailfile: |
2618 | contentType: image/jpeg | 2967 | contentType: image/jpeg |
2619 | 2968 | ||
2620 | /video-playlists/{id}: | 2969 | /video-playlists/{playlistId}: |
2621 | get: | 2970 | get: |
2622 | summary: Get a video playlist | 2971 | summary: Get a video playlist |
2623 | tags: | 2972 | tags: |
2624 | - Video Playlists | 2973 | - Video Playlists |
2625 | parameters: | 2974 | parameters: |
2626 | - $ref: '#/components/parameters/idOrUUID' | 2975 | - $ref: '#/components/parameters/playlistId' |
2627 | responses: | 2976 | responses: |
2628 | '200': | 2977 | '200': |
2629 | description: successful operation | 2978 | description: successful operation |
@@ -2642,7 +2991,7 @@ paths: | |||
2642 | '204': | 2991 | '204': |
2643 | description: successful operation | 2992 | description: successful operation |
2644 | parameters: | 2993 | parameters: |
2645 | - $ref: '#/components/parameters/idOrUUID' | 2994 | - $ref: '#/components/parameters/playlistId' |
2646 | requestBody: | 2995 | requestBody: |
2647 | content: | 2996 | content: |
2648 | multipart/form-data: | 2997 | multipart/form-data: |
@@ -2677,19 +3026,20 @@ paths: | |||
2677 | tags: | 3026 | tags: |
2678 | - Video Playlists | 3027 | - Video Playlists |
2679 | parameters: | 3028 | parameters: |
2680 | - $ref: '#/components/parameters/idOrUUID' | 3029 | - $ref: '#/components/parameters/playlistId' |
2681 | responses: | 3030 | responses: |
2682 | '204': | 3031 | '204': |
2683 | description: successful operation | 3032 | description: successful operation |
2684 | 3033 | ||
2685 | /video-playlists/{id}/videos: | 3034 | /video-playlists/{playlistId}/videos: |
2686 | get: | 3035 | get: |
2687 | summary: 'List videos of a playlist' | 3036 | summary: 'List videos of a playlist' |
3037 | operationId: getVideoPlaylistVideos | ||
2688 | tags: | 3038 | tags: |
2689 | - Videos | 3039 | - Videos |
2690 | - Video Playlists | 3040 | - Video Playlists |
2691 | parameters: | 3041 | parameters: |
2692 | - $ref: '#/components/parameters/idOrUUID' | 3042 | - $ref: '#/components/parameters/playlistId' |
2693 | responses: | 3043 | responses: |
2694 | '200': | 3044 | '200': |
2695 | description: successful operation | 3045 | description: successful operation |
@@ -2698,14 +3048,15 @@ paths: | |||
2698 | schema: | 3048 | schema: |
2699 | $ref: '#/components/schemas/VideoListResponse' | 3049 | $ref: '#/components/schemas/VideoListResponse' |
2700 | post: | 3050 | post: |
2701 | summary: 'Add a video in a playlist' | 3051 | summary: Add a video in a playlist |
3052 | operationId: addVideoPlaylistVideo | ||
2702 | security: | 3053 | security: |
2703 | - OAuth2: [] | 3054 | - OAuth2: [] |
2704 | tags: | 3055 | tags: |
2705 | - Videos | 3056 | - Videos |
2706 | - Video Playlists | 3057 | - Video Playlists |
2707 | parameters: | 3058 | parameters: |
2708 | - $ref: '#/components/parameters/idOrUUID' | 3059 | - $ref: '#/components/parameters/playlistId' |
2709 | responses: | 3060 | responses: |
2710 | '200': | 3061 | '200': |
2711 | description: successful operation | 3062 | description: successful operation |
@@ -2719,6 +3070,7 @@ paths: | |||
2719 | properties: | 3070 | properties: |
2720 | id: | 3071 | id: |
2721 | type: integer | 3072 | type: integer |
3073 | example: 2 | ||
2722 | requestBody: | 3074 | requestBody: |
2723 | content: | 3075 | content: |
2724 | application/json: | 3076 | application/json: |
@@ -2726,27 +3078,31 @@ paths: | |||
2726 | type: object | 3078 | type: object |
2727 | properties: | 3079 | properties: |
2728 | videoId: | 3080 | videoId: |
2729 | allOf: | 3081 | oneOf: |
3082 | - $ref: '#/components/schemas/Video/properties/uuid' | ||
2730 | - $ref: '#/components/schemas/Video/properties/id' | 3083 | - $ref: '#/components/schemas/Video/properties/id' |
2731 | description: Video to add in the playlist | 3084 | description: Video to add in the playlist |
2732 | startTimestamp: | 3085 | startTimestamp: |
2733 | type: integer | 3086 | type: integer |
2734 | description: Start the video at this specific timestamp (in seconds) | 3087 | format: seconds |
3088 | description: Start the video at this specific timestamp | ||
2735 | stopTimestamp: | 3089 | stopTimestamp: |
2736 | type: integer | 3090 | type: integer |
2737 | description: Stop the video at this specific timestamp (in seconds) | 3091 | format: seconds |
3092 | description: Stop the video at this specific timestamp | ||
2738 | required: | 3093 | required: |
2739 | - videoId | 3094 | - videoId |
2740 | 3095 | ||
2741 | /video-playlists/{id}/videos/reorder: | 3096 | /video-playlists/{playlistId}/videos/reorder: |
2742 | post: | 3097 | post: |
2743 | summary: 'Reorder a playlist' | 3098 | summary: 'Reorder a playlist' |
3099 | operationId: reorderVideoPlaylist | ||
2744 | security: | 3100 | security: |
2745 | - OAuth2: [] | 3101 | - OAuth2: [] |
2746 | tags: | 3102 | tags: |
2747 | - Video Playlists | 3103 | - Video Playlists |
2748 | parameters: | 3104 | parameters: |
2749 | - $ref: '#/components/parameters/idOrUUID' | 3105 | - $ref: '#/components/parameters/playlistId' |
2750 | responses: | 3106 | responses: |
2751 | '204': | 3107 | '204': |
2752 | description: successful operation | 3108 | description: successful operation |
@@ -2772,15 +3128,16 @@ paths: | |||
2772 | - startPosition | 3128 | - startPosition |
2773 | - insertAfterPosition | 3129 | - insertAfterPosition |
2774 | 3130 | ||
2775 | /video-playlists/{id}/videos/{playlistElementId}: | 3131 | /video-playlists/{playlistId}/videos/{playlistElementId}: |
2776 | put: | 3132 | put: |
2777 | summary: 'Update a playlist element' | 3133 | summary: Update a playlist element |
3134 | operationId: putVideoPlaylistVideo | ||
2778 | security: | 3135 | security: |
2779 | - OAuth2: [] | 3136 | - OAuth2: [] |
2780 | tags: | 3137 | tags: |
2781 | - Video Playlists | 3138 | - Video Playlists |
2782 | parameters: | 3139 | parameters: |
2783 | - $ref: '#/components/parameters/idOrUUID' | 3140 | - $ref: '#/components/parameters/playlistId' |
2784 | - $ref: '#/components/parameters/playlistElementId' | 3141 | - $ref: '#/components/parameters/playlistElementId' |
2785 | responses: | 3142 | responses: |
2786 | '204': | 3143 | '204': |
@@ -2793,18 +3150,21 @@ paths: | |||
2793 | properties: | 3150 | properties: |
2794 | startTimestamp: | 3151 | startTimestamp: |
2795 | type: integer | 3152 | type: integer |
2796 | description: 'Start the video at this specific timestamp (in seconds)' | 3153 | format: seconds |
3154 | description: Start the video at this specific timestamp | ||
2797 | stopTimestamp: | 3155 | stopTimestamp: |
2798 | type: integer | 3156 | type: integer |
2799 | description: 'Stop the video at this specific timestamp (in seconds)' | 3157 | format: seconds |
3158 | description: Stop the video at this specific timestamp | ||
2800 | delete: | 3159 | delete: |
2801 | summary: 'Delete an element from a playlist' | 3160 | summary: Delete an element from a playlist |
3161 | operationId: delVideoPlaylistVideo | ||
2802 | security: | 3162 | security: |
2803 | - OAuth2: [] | 3163 | - OAuth2: [] |
2804 | tags: | 3164 | tags: |
2805 | - Video Playlists | 3165 | - Video Playlists |
2806 | parameters: | 3166 | parameters: |
2807 | - $ref: '#/components/parameters/idOrUUID' | 3167 | - $ref: '#/components/parameters/playlistId' |
2808 | - $ref: '#/components/parameters/playlistElementId' | 3168 | - $ref: '#/components/parameters/playlistElementId' |
2809 | responses: | 3169 | responses: |
2810 | '204': | 3170 | '204': |
@@ -2812,7 +3172,7 @@ paths: | |||
2812 | 3172 | ||
2813 | '/users/me/video-playlists/videos-exist': | 3173 | '/users/me/video-playlists/videos-exist': |
2814 | get: | 3174 | get: |
2815 | summary: 'Check video exists in my playlists' | 3175 | summary: Check video exists in my playlists |
2816 | security: | 3176 | security: |
2817 | - OAuth2: [] | 3177 | - OAuth2: [] |
2818 | tags: | 3178 | tags: |
@@ -2845,8 +3205,10 @@ paths: | |||
2845 | type: integer | 3205 | type: integer |
2846 | startTimestamp: | 3206 | startTimestamp: |
2847 | type: integer | 3207 | type: integer |
3208 | format: seconds | ||
2848 | stopTimestamp: | 3209 | stopTimestamp: |
2849 | type: integer | 3210 | type: integer |
3211 | format: seconds | ||
2850 | 3212 | ||
2851 | '/accounts/{name}/video-channels': | 3213 | '/accounts/{name}/video-channels': |
2852 | get: | 3214 | get: |
@@ -2871,6 +3233,7 @@ paths: | |||
2871 | application/json: | 3233 | application/json: |
2872 | schema: | 3234 | schema: |
2873 | $ref: '#/components/schemas/VideoChannelList' | 3235 | $ref: '#/components/schemas/VideoChannelList' |
3236 | |||
2874 | '/accounts/{name}/ratings': | 3237 | '/accounts/{name}/ratings': |
2875 | get: | 3238 | get: |
2876 | summary: List ratings of an account | 3239 | summary: List ratings of an account |
@@ -2901,6 +3264,7 @@ paths: | |||
2901 | type: array | 3264 | type: array |
2902 | items: | 3265 | items: |
2903 | $ref: '#/components/schemas/VideoRating' | 3266 | $ref: '#/components/schemas/VideoRating' |
3267 | |||
2904 | '/videos/{id}/comment-threads': | 3268 | '/videos/{id}/comment-threads': |
2905 | get: | 3269 | get: |
2906 | summary: List threads of a video | 3270 | summary: List threads of a video |
@@ -2942,8 +3306,10 @@ paths: | |||
2942 | type: object | 3306 | type: object |
2943 | properties: | 3307 | properties: |
2944 | text: | 3308 | text: |
2945 | type: string | 3309 | allOf: |
2946 | description: 'Text comment' | 3310 | - $ref: '#/components/schemas/VideoComment/properties/text' |
3311 | format: markdown | ||
3312 | maxLength: 10000 | ||
2947 | required: | 3313 | required: |
2948 | - text | 3314 | - text |
2949 | 3315 | ||
@@ -2962,6 +3328,7 @@ paths: | |||
2962 | application/json: | 3328 | application/json: |
2963 | schema: | 3329 | schema: |
2964 | $ref: '#/components/schemas/VideoCommentThreadTree' | 3330 | $ref: '#/components/schemas/VideoCommentThreadTree' |
3331 | |||
2965 | '/videos/{id}/comments/{commentId}': | 3332 | '/videos/{id}/comments/{commentId}': |
2966 | post: | 3333 | post: |
2967 | summary: Reply to a thread of a video | 3334 | summary: Reply to a thread of a video |
@@ -2988,10 +3355,12 @@ paths: | |||
2988 | type: object | 3355 | type: object |
2989 | properties: | 3356 | properties: |
2990 | text: | 3357 | text: |
2991 | $ref: '#/components/schemas/VideoComment/properties/text' | 3358 | allOf: |
3359 | - $ref: '#/components/schemas/VideoComment/properties/text' | ||
3360 | format: markdown | ||
3361 | maxLength: 10000 | ||
2992 | required: | 3362 | required: |
2993 | - text | 3363 | - text |
2994 | |||
2995 | delete: | 3364 | delete: |
2996 | summary: Delete a comment or a reply | 3365 | summary: Delete a comment or a reply |
2997 | security: | 3366 | security: |
@@ -3010,6 +3379,7 @@ paths: | |||
3010 | description: comment or video does not exist | 3379 | description: comment or video does not exist |
3011 | '409': | 3380 | '409': |
3012 | description: comment is already deleted | 3381 | description: comment is already deleted |
3382 | |||
3013 | '/videos/{id}/rate': | 3383 | '/videos/{id}/rate': |
3014 | put: | 3384 | put: |
3015 | summary: Like/dislike a video | 3385 | summary: Like/dislike a video |
@@ -3019,16 +3389,31 @@ paths: | |||
3019 | - Video Rates | 3389 | - Video Rates |
3020 | parameters: | 3390 | parameters: |
3021 | - $ref: '#/components/parameters/idOrUUID' | 3391 | - $ref: '#/components/parameters/idOrUUID' |
3392 | requestBody: | ||
3393 | content: | ||
3394 | application/json: | ||
3395 | schema: | ||
3396 | type: object | ||
3397 | properties: | ||
3398 | rating: | ||
3399 | type: string | ||
3400 | enum: | ||
3401 | - like | ||
3402 | - dislike | ||
3403 | required: | ||
3404 | - rating | ||
3022 | responses: | 3405 | responses: |
3023 | '204': | 3406 | '204': |
3024 | description: successful operation | 3407 | description: successful operation |
3025 | '404': | 3408 | '404': |
3026 | description: video does not exist | 3409 | description: video does not exist |
3410 | |||
3027 | /search/videos: | 3411 | /search/videos: |
3028 | get: | 3412 | get: |
3029 | tags: | 3413 | tags: |
3030 | - Search | 3414 | - Search |
3031 | summary: Search videos | 3415 | summary: Search videos |
3416 | operationId: searchVideos | ||
3032 | parameters: | 3417 | parameters: |
3033 | - name: search | 3418 | - name: search |
3034 | in: query | 3419 | in: query |
@@ -3099,11 +3484,13 @@ paths: | |||
3099 | $ref: '#/components/schemas/VideoListResponse' | 3484 | $ref: '#/components/schemas/VideoListResponse' |
3100 | '500': | 3485 | '500': |
3101 | description: search index unavailable | 3486 | description: search index unavailable |
3487 | |||
3102 | /search/video-channels: | 3488 | /search/video-channels: |
3103 | get: | 3489 | get: |
3104 | tags: | 3490 | tags: |
3105 | - Search | 3491 | - Search |
3106 | summary: Search channels | 3492 | summary: Search channels |
3493 | operationId: searchChannels | ||
3107 | parameters: | 3494 | parameters: |
3108 | - name: search | 3495 | - name: search |
3109 | in: query | 3496 | in: query |
@@ -3130,7 +3517,8 @@ paths: | |||
3130 | $ref: '#/components/schemas/VideoChannelList' | 3517 | $ref: '#/components/schemas/VideoChannelList' |
3131 | '500': | 3518 | '500': |
3132 | description: search index unavailable | 3519 | description: search index unavailable |
3133 | /blocklist/accounts: | 3520 | |
3521 | /server/blocklist/accounts: | ||
3134 | get: | 3522 | get: |
3135 | tags: | 3523 | tags: |
3136 | - Account Blocks | 3524 | - Account Blocks |
@@ -3169,7 +3557,8 @@ paths: | |||
3169 | description: successful operation | 3557 | description: successful operation |
3170 | '409': | 3558 | '409': |
3171 | description: self-blocking forbidden | 3559 | description: self-blocking forbidden |
3172 | '/blocklist/accounts/{accountName}': | 3560 | |
3561 | '/server/blocklist/accounts/{accountName}': | ||
3173 | delete: | 3562 | delete: |
3174 | tags: | 3563 | tags: |
3175 | - Account Blocks | 3564 | - Account Blocks |
@@ -3189,7 +3578,8 @@ paths: | |||
3189 | description: successful operation | 3578 | description: successful operation |
3190 | '404': | 3579 | '404': |
3191 | description: account or account block does not exist | 3580 | description: account or account block does not exist |
3192 | /blocklist/servers: | 3581 | |
3582 | /server/blocklist/servers: | ||
3193 | get: | 3583 | get: |
3194 | tags: | 3584 | tags: |
3195 | - Server Blocks | 3585 | - Server Blocks |
@@ -3224,11 +3614,12 @@ paths: | |||
3224 | required: | 3614 | required: |
3225 | - host | 3615 | - host |
3226 | responses: | 3616 | responses: |
3227 | '200': | 3617 | '204': |
3228 | description: successful operation | 3618 | description: successful operation |
3229 | '409': | 3619 | '409': |
3230 | description: self-blocking forbidden | 3620 | description: self-blocking forbidden |
3231 | '/blocklist/servers/{host}': | 3621 | |
3622 | '/server/blocklist/servers/{host}': | ||
3232 | delete: | 3623 | delete: |
3233 | tags: | 3624 | tags: |
3234 | - Server Blocks | 3625 | - Server Blocks |
@@ -3245,11 +3636,12 @@ paths: | |||
3245 | type: string | 3636 | type: string |
3246 | format: hostname | 3637 | format: hostname |
3247 | responses: | 3638 | responses: |
3248 | '201': | 3639 | '204': |
3249 | description: successful operation | 3640 | description: successful operation |
3250 | '404': | 3641 | '404': |
3251 | description: account block does not exist | 3642 | description: account block does not exist |
3252 | /redundancy/{host}: | 3643 | |
3644 | /server/redundancy/{host}: | ||
3253 | put: | 3645 | put: |
3254 | tags: | 3646 | tags: |
3255 | - Instance Redundancy | 3647 | - Instance Redundancy |
@@ -3281,11 +3673,13 @@ paths: | |||
3281 | description: successful operation | 3673 | description: successful operation |
3282 | '404': | 3674 | '404': |
3283 | description: server is not already known | 3675 | description: server is not already known |
3284 | /redundancy/videos: | 3676 | |
3677 | /server/redundancy/videos: | ||
3285 | get: | 3678 | get: |
3286 | tags: | 3679 | tags: |
3287 | - Video Mirroring | 3680 | - Video Mirroring |
3288 | summary: List videos being mirrored | 3681 | summary: List videos being mirrored |
3682 | operationId: getMirroredVideos | ||
3289 | security: | 3683 | security: |
3290 | - OAuth2: | 3684 | - OAuth2: |
3291 | - admin | 3685 | - admin |
@@ -3315,6 +3709,7 @@ paths: | |||
3315 | tags: | 3709 | tags: |
3316 | - Video Mirroring | 3710 | - Video Mirroring |
3317 | summary: Mirror a video | 3711 | summary: Mirror a video |
3712 | operationId: putMirroredVideo | ||
3318 | security: | 3713 | security: |
3319 | - OAuth2: | 3714 | - OAuth2: |
3320 | - admin | 3715 | - admin |
@@ -3337,11 +3732,13 @@ paths: | |||
3337 | description: video does not exist | 3732 | description: video does not exist |
3338 | '409': | 3733 | '409': |
3339 | description: video is already mirrored | 3734 | description: video is already mirrored |
3340 | /redundancy/videos/{redundancyId}: | 3735 | |
3736 | /server/redundancy/videos/{redundancyId}: | ||
3341 | delete: | 3737 | delete: |
3342 | tags: | 3738 | tags: |
3343 | - Video Mirroring | 3739 | - Video Mirroring |
3344 | summary: Delete a mirror done on a video | 3740 | summary: Delete a mirror done on a video |
3741 | operationId: delMirroredVideo | ||
3345 | security: | 3742 | security: |
3346 | - OAuth2: | 3743 | - OAuth2: |
3347 | - admin | 3744 | - admin |
@@ -3357,11 +3754,13 @@ paths: | |||
3357 | description: successful operation | 3754 | description: successful operation |
3358 | '404': | 3755 | '404': |
3359 | description: video redundancy not found | 3756 | description: video redundancy not found |
3757 | |||
3360 | '/feeds/video-comments.{format}': | 3758 | '/feeds/video-comments.{format}': |
3361 | get: | 3759 | get: |
3362 | tags: | 3760 | tags: |
3363 | - Feeds | 3761 | - Feeds |
3364 | summary: List comments on videos | 3762 | summary: List comments on videos |
3763 | operationId: getSyndicatedComments | ||
3365 | parameters: | 3764 | parameters: |
3366 | - name: format | 3765 | - name: format |
3367 | in: path | 3766 | in: path |
@@ -3450,11 +3849,13 @@ paths: | |||
3450 | description: video, video channel or account not found | 3849 | description: video, video channel or account not found |
3451 | '406': | 3850 | '406': |
3452 | description: accept header unsupported | 3851 | description: accept header unsupported |
3852 | |||
3453 | '/feeds/videos.{format}': | 3853 | '/feeds/videos.{format}': |
3454 | get: | 3854 | get: |
3455 | tags: | 3855 | tags: |
3456 | - Feeds | 3856 | - Feeds |
3457 | summary: List videos | 3857 | summary: List videos |
3858 | operationId: getSyndicatedVideos | ||
3458 | parameters: | 3859 | parameters: |
3459 | - name: format | 3860 | - name: format |
3460 | in: path | 3861 | in: path |
@@ -3536,12 +3937,14 @@ paths: | |||
3536 | description: video channel or account not found | 3937 | description: video channel or account not found |
3537 | '406': | 3938 | '406': |
3538 | description: accept header unsupported | 3939 | description: accept header unsupported |
3940 | |||
3539 | '/feeds/subscriptions.{format}': | 3941 | '/feeds/subscriptions.{format}': |
3540 | get: | 3942 | get: |
3541 | tags: | 3943 | tags: |
3542 | - Feeds | 3944 | - Feeds |
3543 | - Account | 3945 | - Account |
3544 | summary: List videos of subscriptions tied to a token | 3946 | summary: List videos of subscriptions tied to a token |
3947 | operationId: getSyndicatedSubscriptionVideos | ||
3545 | parameters: | 3948 | parameters: |
3546 | - name: format | 3949 | - name: format |
3547 | in: path | 3950 | in: path |
@@ -3598,11 +4001,13 @@ paths: | |||
3598 | type: object | 4001 | type: object |
3599 | '406': | 4002 | '406': |
3600 | description: accept header unsupported | 4003 | description: accept header unsupported |
4004 | |||
3601 | /plugins: | 4005 | /plugins: |
3602 | get: | 4006 | get: |
3603 | tags: | 4007 | tags: |
3604 | - Plugins | 4008 | - Plugins |
3605 | summary: List plugins | 4009 | summary: List plugins |
4010 | operationId: getPlugins | ||
3606 | security: | 4011 | security: |
3607 | - OAuth2: | 4012 | - OAuth2: |
3608 | - admin | 4013 | - admin |
@@ -3625,11 +4030,13 @@ paths: | |||
3625 | application/json: | 4030 | application/json: |
3626 | schema: | 4031 | schema: |
3627 | $ref: '#/components/schemas/PluginResponse' | 4032 | $ref: '#/components/schemas/PluginResponse' |
4033 | |||
3628 | /plugins/available: | 4034 | /plugins/available: |
3629 | get: | 4035 | get: |
3630 | tags: | 4036 | tags: |
3631 | - Plugins | 4037 | - Plugins |
3632 | summary: List available plugins | 4038 | summary: List available plugins |
4039 | operationId: getAvailablePlugins | ||
3633 | security: | 4040 | security: |
3634 | - OAuth2: | 4041 | - OAuth2: |
3635 | - admin | 4042 | - admin |
@@ -3658,11 +4065,13 @@ paths: | |||
3658 | $ref: '#/components/schemas/PluginResponse' | 4065 | $ref: '#/components/schemas/PluginResponse' |
3659 | '503': | 4066 | '503': |
3660 | description: plugin index unavailable | 4067 | description: plugin index unavailable |
4068 | |||
3661 | /plugins/install: | 4069 | /plugins/install: |
3662 | post: | 4070 | post: |
3663 | tags: | 4071 | tags: |
3664 | - Plugins | 4072 | - Plugins |
3665 | summary: Install a plugin | 4073 | summary: Install a plugin |
4074 | operationId: addPlugin | ||
3666 | security: | 4075 | security: |
3667 | - OAuth2: | 4076 | - OAuth2: |
3668 | - admin | 4077 | - admin |
@@ -3691,11 +4100,13 @@ paths: | |||
3691 | description: successful operation | 4100 | description: successful operation |
3692 | '400': | 4101 | '400': |
3693 | description: should have either `npmName` or `path` set | 4102 | description: should have either `npmName` or `path` set |
4103 | |||
3694 | /plugins/update: | 4104 | /plugins/update: |
3695 | post: | 4105 | post: |
3696 | tags: | 4106 | tags: |
3697 | - Plugins | 4107 | - Plugins |
3698 | summary: Update a plugin | 4108 | summary: Update a plugin |
4109 | operationId: updatePlugin | ||
3699 | security: | 4110 | security: |
3700 | - OAuth2: | 4111 | - OAuth2: |
3701 | - admin | 4112 | - admin |
@@ -3726,11 +4137,13 @@ paths: | |||
3726 | description: should have either `npmName` or `path` set | 4137 | description: should have either `npmName` or `path` set |
3727 | '404': | 4138 | '404': |
3728 | description: existing plugin not found | 4139 | description: existing plugin not found |
4140 | |||
3729 | /plugins/uninstall: | 4141 | /plugins/uninstall: |
3730 | post: | 4142 | post: |
3731 | tags: | 4143 | tags: |
3732 | - Plugins | 4144 | - Plugins |
3733 | summary: Uninstall a plugin | 4145 | summary: Uninstall a plugin |
4146 | operationId: uninstallPlugin | ||
3734 | security: | 4147 | security: |
3735 | - OAuth2: | 4148 | - OAuth2: |
3736 | - admin | 4149 | - admin |
@@ -3751,11 +4164,13 @@ paths: | |||
3751 | description: successful operation | 4164 | description: successful operation |
3752 | '404': | 4165 | '404': |
3753 | description: existing plugin not found | 4166 | description: existing plugin not found |
4167 | |||
3754 | /plugins/{npmName}: | 4168 | /plugins/{npmName}: |
3755 | get: | 4169 | get: |
3756 | tags: | 4170 | tags: |
3757 | - Plugins | 4171 | - Plugins |
3758 | summary: Get a plugin | 4172 | summary: Get a plugin |
4173 | operationId: getPlugin | ||
3759 | security: | 4174 | security: |
3760 | - OAuth2: | 4175 | - OAuth2: |
3761 | - admin | 4176 | - admin |
@@ -3770,6 +4185,7 @@ paths: | |||
3770 | $ref: '#/components/schemas/Plugin' | 4185 | $ref: '#/components/schemas/Plugin' |
3771 | '404': | 4186 | '404': |
3772 | description: plugin not found | 4187 | description: plugin not found |
4188 | |||
3773 | /plugins/{npmName}/settings: | 4189 | /plugins/{npmName}/settings: |
3774 | put: | 4190 | put: |
3775 | tags: | 4191 | tags: |
@@ -3794,6 +4210,7 @@ paths: | |||
3794 | description: successful operation | 4210 | description: successful operation |
3795 | '404': | 4211 | '404': |
3796 | description: plugin not found | 4212 | description: plugin not found |
4213 | |||
3797 | /plugins/{npmName}/public-settings: | 4214 | /plugins/{npmName}/public-settings: |
3798 | get: | 4215 | get: |
3799 | tags: | 4216 | tags: |
@@ -3811,6 +4228,7 @@ paths: | |||
3811 | additionalProperties: true | 4228 | additionalProperties: true |
3812 | '404': | 4229 | '404': |
3813 | description: plugin not found | 4230 | description: plugin not found |
4231 | |||
3814 | /plugins/{npmName}/registered-settings: | 4232 | /plugins/{npmName}/registered-settings: |
3815 | get: | 4233 | get: |
3816 | tags: | 4234 | tags: |
@@ -3831,6 +4249,7 @@ paths: | |||
3831 | additionalProperties: true | 4249 | additionalProperties: true |
3832 | '404': | 4250 | '404': |
3833 | description: plugin not found | 4251 | description: plugin not found |
4252 | |||
3834 | servers: | 4253 | servers: |
3835 | - url: 'https://peertube2.cpy.re/api/v1' | 4254 | - url: 'https://peertube2.cpy.re/api/v1' |
3836 | description: Live Test Server (live data - latest nightly version) | 4255 | description: Live Test Server (live data - latest nightly version) |
@@ -4019,6 +4438,13 @@ components: | |||
4019 | oneOf: | 4438 | oneOf: |
4020 | - $ref: '#/components/schemas/id' | 4439 | - $ref: '#/components/schemas/id' |
4021 | - $ref: '#/components/schemas/UUIDv4' | 4440 | - $ref: '#/components/schemas/UUIDv4' |
4441 | playlistId: | ||
4442 | name: playlistId | ||
4443 | in: path | ||
4444 | required: true | ||
4445 | description: Playlist id | ||
4446 | schema: | ||
4447 | $ref: '#/components/schemas/VideoPlaylist/properties/id' | ||
4022 | playlistElementId: | 4448 | playlistElementId: |
4023 | name: playlistElementId | 4449 | name: playlistElementId |
4024 | in: path | 4450 | in: path |
@@ -4069,7 +4495,7 @@ components: | |||
4069 | required: true | 4495 | required: true |
4070 | description: The thread id (root comment id) | 4496 | description: The thread id (root comment id) |
4071 | schema: | 4497 | schema: |
4072 | $ref: '#/components/schemas/VideoCommentThreadTree/properties/comment/properties/id' | 4498 | type: integer |
4073 | commentId: | 4499 | commentId: |
4074 | name: commentId | 4500 | name: commentId |
4075 | in: path | 4501 | in: path |
@@ -4223,22 +4649,42 @@ components: | |||
4223 | - activitypub-refresher | 4649 | - activitypub-refresher |
4224 | - video-redundancy | 4650 | - video-redundancy |
4225 | - video-live-ending | 4651 | - video-live-ending |
4652 | followState: | ||
4653 | name: state | ||
4654 | in: query | ||
4655 | schema: | ||
4656 | type: string | ||
4657 | enum: | ||
4658 | - pending | ||
4659 | - accepted | ||
4660 | actorType: | ||
4661 | name: actorType | ||
4662 | in: query | ||
4663 | schema: | ||
4664 | type: string | ||
4665 | enum: | ||
4666 | - Person | ||
4667 | - Application | ||
4668 | - Group | ||
4669 | - Service | ||
4670 | - Organization | ||
4226 | securitySchemes: | 4671 | securitySchemes: |
4227 | OAuth2: | 4672 | OAuth2: |
4228 | description: | | 4673 | description: | |
4229 | Authenticating via OAuth requires the following steps: | 4674 | Authenticating via OAuth requires the following steps: |
4230 | - Have an activated account | 4675 | - Have an activated account |
4231 | - [Generate](https://docs.joinpeertube.org/api-rest-getting-started) a | 4676 | - [Generate] an access token for that account at `/api/v1/users/token`. |
4232 | Bearer Token for that account at `/api/v1/users/token` | 4677 | - 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 | 4678 | - Profit, depending on the role assigned to the account |
4235 | 4679 | ||
4236 | Note that the __access token is valid for 1 day__ and, and is given | 4680 | Note that the __access token is valid for 1 day__ and is given |
4237 | along with a __refresh token valid for 2 weeks__. | 4681 | along with a __refresh token valid for 2 weeks__. |
4682 | |||
4683 | [Generate]: https://docs.joinpeertube.org/api-rest-getting-started | ||
4238 | type: oauth2 | 4684 | type: oauth2 |
4239 | flows: | 4685 | flows: |
4240 | password: | 4686 | password: |
4241 | tokenUrl: 'https://peertube.example.com/api/v1/users/token' | 4687 | tokenUrl: /api/v1/users/token |
4242 | scopes: | 4688 | scopes: |
4243 | admin: Admin scope | 4689 | admin: Admin scope |
4244 | moderator: Moderator scope | 4690 | moderator: Moderator scope |
@@ -4258,20 +4704,21 @@ components: | |||
4258 | maxLength: 36 | 4704 | maxLength: 36 |
4259 | username: | 4705 | username: |
4260 | type: string | 4706 | type: string |
4261 | description: The username of the user | 4707 | description: immutable name of the user, used to find or mention its actor |
4262 | example: chocobozzz | 4708 | example: chocobozzz |
4263 | pattern: '/^[a-z0-9._]{1,50}$/' | 4709 | pattern: '/^[a-z0-9._]+$/' |
4264 | minLength: 1 | 4710 | minLength: 1 |
4265 | maxLength: 50 | 4711 | maxLength: 50 |
4266 | usernameChannel: | 4712 | usernameChannel: |
4267 | type: string | 4713 | type: string |
4268 | description: The username for the default channel | 4714 | description: immutable name of the channel, used to interact with its actor |
4269 | example: The Capybara Channel | 4715 | example: framasoft_videos |
4270 | pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/' | 4716 | pattern: '/^[a-zA-Z0-9\\-_.:]+$/' |
4717 | minLength: 1 | ||
4718 | maxLength: 50 | ||
4271 | password: | 4719 | password: |
4272 | type: string | 4720 | type: string |
4273 | format: password | 4721 | format: password |
4274 | description: The password of the user | ||
4275 | minLength: 6 | 4722 | minLength: 6 |
4276 | maxLength: 255 | 4723 | maxLength: 255 |
4277 | 4724 | ||
@@ -4483,8 +4930,10 @@ components: | |||
4483 | type: integer | 4930 | type: integer |
4484 | startTimestamp: | 4931 | startTimestamp: |
4485 | type: integer | 4932 | type: integer |
4933 | format: seconds | ||
4486 | stopTimestamp: | 4934 | stopTimestamp: |
4487 | type: integer | 4935 | type: integer |
4936 | format: seconds | ||
4488 | video: | 4937 | video: |
4489 | nullable: true | 4938 | nullable: true |
4490 | allOf: | 4939 | allOf: |
@@ -4633,6 +5082,7 @@ components: | |||
4633 | duration: | 5082 | duration: |
4634 | type: integer | 5083 | type: integer |
4635 | example: 1419 | 5084 | example: 1419 |
5085 | format: seconds | ||
4636 | description: duration of the video in seconds | 5086 | description: duration of the video in seconds |
4637 | isLocal: | 5087 | isLocal: |
4638 | type: boolean | 5088 | type: boolean |
@@ -4701,7 +5151,7 @@ components: | |||
4701 | support: | 5151 | support: |
4702 | type: string | 5152 | type: string |
4703 | description: A text tell the audience how to support the video creator | 5153 | description: A text tell the audience how to support the video creator |
4704 | example: Please support my work on <insert crowdfunding plateform>! <3 | 5154 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
4705 | minLength: 3 | 5155 | minLength: 3 |
4706 | maxLength: 1000 | 5156 | maxLength: 1000 |
4707 | channel: | 5157 | channel: |
@@ -4806,10 +5256,33 @@ components: | |||
4806 | label: | 5256 | label: |
4807 | type: string | 5257 | type: string |
4808 | example: Pending | 5258 | example: Pending |
5259 | VideoCreateImport: | ||
5260 | allOf: | ||
5261 | - type: object | ||
5262 | additionalProperties: false | ||
5263 | oneOf: | ||
5264 | - properties: | ||
5265 | targetUrl: | ||
5266 | $ref: '#/components/schemas/VideoImport/properties/targetUrl' | ||
5267 | required: [targetUrl] | ||
5268 | - properties: | ||
5269 | magnetUri: | ||
5270 | $ref: '#/components/schemas/VideoImport/properties/magnetUri' | ||
5271 | required: [magnetUri] | ||
5272 | - properties: | ||
5273 | torrentfile: | ||
5274 | $ref: '#/components/schemas/VideoImport/properties/torrentfile' | ||
5275 | required: [torrentfile] | ||
5276 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | ||
5277 | required: | ||
5278 | - channelId | ||
5279 | - name | ||
4809 | VideoImport: | 5280 | VideoImport: |
4810 | properties: | 5281 | properties: |
4811 | id: | 5282 | id: |
4812 | $ref: '#/components/schemas/id' | 5283 | readOnly: true |
5284 | allOf: | ||
5285 | - $ref: '#/components/schemas/id' | ||
4813 | targetUrl: | 5286 | targetUrl: |
4814 | type: string | 5287 | type: string |
4815 | format: url | 5288 | format: url |
@@ -4821,19 +5294,31 @@ components: | |||
4821 | description: magnet URI allowing to resolve the import's source video | 5294 | 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 | 5295 | 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 | 5296 | pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i |
5297 | torrentfile: | ||
5298 | writeOnly: true | ||
5299 | type: string | ||
5300 | format: binary | ||
5301 | description: Torrent file containing only the video file | ||
4824 | torrentName: | 5302 | torrentName: |
5303 | readOnly: true | ||
4825 | type: string | 5304 | type: string |
4826 | state: | 5305 | state: |
4827 | $ref: '#/components/schemas/VideoImportStateConstant' | 5306 | readOnly: true |
5307 | allOf: | ||
5308 | - $ref: '#/components/schemas/VideoImportStateConstant' | ||
4828 | error: | 5309 | error: |
5310 | readOnly: true | ||
4829 | type: string | 5311 | type: string |
4830 | createdAt: | 5312 | createdAt: |
5313 | readOnly: true | ||
4831 | type: string | 5314 | type: string |
4832 | format: date-time | 5315 | format: date-time |
4833 | updatedAt: | 5316 | updatedAt: |
5317 | readOnly: true | ||
4834 | type: string | 5318 | type: string |
4835 | format: date-time | 5319 | format: date-time |
4836 | video: | 5320 | video: |
5321 | readOnly: true | ||
4837 | nullable: true | 5322 | nullable: true |
4838 | allOf: | 5323 | allOf: |
4839 | - $ref: '#/components/schemas/Video' | 5324 | - $ref: '#/components/schemas/Video' |
@@ -4963,13 +5448,16 @@ components: | |||
4963 | format: url | 5448 | format: url |
4964 | text: | 5449 | text: |
4965 | type: string | 5450 | type: string |
4966 | description: Text of the comment in Markdown | 5451 | format: html |
5452 | description: Text of the comment | ||
4967 | minLength: 1 | 5453 | minLength: 1 |
4968 | maxLength: 10000 | 5454 | example: This video is wonderful! |
4969 | threadId: | 5455 | threadId: |
4970 | type: integer | ||
4971 | inReplyToCommentId: | ||
4972 | $ref: '#/components/schemas/id' | 5456 | $ref: '#/components/schemas/id' |
5457 | inReplyToCommentId: | ||
5458 | nullable: true | ||
5459 | allOf: | ||
5460 | - $ref: '#/components/schemas/id' | ||
4973 | videoId: | 5461 | videoId: |
4974 | $ref: '#/components/schemas/Video/properties/id' | 5462 | $ref: '#/components/schemas/Video/properties/id' |
4975 | createdAt: | 5463 | createdAt: |
@@ -4978,6 +5466,14 @@ components: | |||
4978 | updatedAt: | 5466 | updatedAt: |
4979 | type: string | 5467 | type: string |
4980 | format: date-time | 5468 | format: date-time |
5469 | deletedAt: | ||
5470 | nullable: true | ||
5471 | type: string | ||
5472 | format: date-time | ||
5473 | default: null | ||
5474 | isDeleted: | ||
5475 | type: boolean | ||
5476 | default: false | ||
4981 | totalRepliesFromVideoAuthor: | 5477 | totalRepliesFromVideoAuthor: |
4982 | type: integer | 5478 | type: integer |
4983 | minimum: 0 | 5479 | minimum: 0 |
@@ -5035,7 +5531,7 @@ components: | |||
5035 | type: string | 5531 | type: string |
5036 | format: url | 5532 | format: url |
5037 | name: | 5533 | name: |
5038 | description: immutable name of the actor | 5534 | description: immutable name of the actor, used to find or mention it |
5039 | allOf: | 5535 | allOf: |
5040 | - $ref: '#/components/schemas/username' | 5536 | - $ref: '#/components/schemas/username' |
5041 | host: | 5537 | host: |
@@ -5071,7 +5567,9 @@ components: | |||
5071 | - $ref: '#/components/schemas/User/properties/id' | 5567 | - $ref: '#/components/schemas/User/properties/id' |
5072 | displayName: | 5568 | displayName: |
5073 | type: string | 5569 | type: string |
5074 | description: name displayed on the account's profile | 5570 | description: editable name of the account, displayed in its representations |
5571 | minLength: 3 | ||
5572 | maxLength: 120 | ||
5075 | description: | 5573 | description: |
5076 | type: string | 5574 | type: string |
5077 | description: text or bio displayed on the account's profile | 5575 | description: text or bio displayed on the account's profile |
@@ -5079,6 +5577,7 @@ components: | |||
5079 | properties: | 5577 | properties: |
5080 | currentTime: | 5578 | currentTime: |
5081 | type: integer | 5579 | type: integer |
5580 | format: seconds | ||
5082 | description: timestamp within the video, in seconds | 5581 | description: timestamp within the video, in seconds |
5083 | example: 5 | 5582 | example: 5 |
5084 | ServerConfig: | 5583 | ServerConfig: |
@@ -5280,6 +5779,12 @@ components: | |||
5280 | indexUrl: | 5779 | indexUrl: |
5281 | type: string | 5780 | type: string |
5282 | format: url | 5781 | format: url |
5782 | homepage: | ||
5783 | type: object | ||
5784 | properties: | ||
5785 | enabled: | ||
5786 | type: boolean | ||
5787 | |||
5283 | ServerConfigAbout: | 5788 | ServerConfigAbout: |
5284 | properties: | 5789 | properties: |
5285 | instance: | 5790 | instance: |
@@ -5470,6 +5975,12 @@ components: | |||
5470 | type: boolean | 5975 | type: boolean |
5471 | manualApproval: | 5976 | manualApproval: |
5472 | type: boolean | 5977 | type: boolean |
5978 | |||
5979 | CustomHomepage: | ||
5980 | properties: | ||
5981 | content: | ||
5982 | type: string | ||
5983 | |||
5473 | Follow: | 5984 | Follow: |
5474 | properties: | 5985 | properties: |
5475 | id: | 5986 | id: |
@@ -5593,7 +6104,7 @@ components: | |||
5593 | type: boolean | 6104 | type: boolean |
5594 | support: | 6105 | support: |
5595 | description: A text tell the audience how to support the video creator | 6106 | description: A text tell the audience how to support the video creator |
5596 | example: Please support my work on <insert crowdfunding plateform>! <3 | 6107 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
5597 | type: string | 6108 | type: string |
5598 | nsfw: | 6109 | nsfw: |
5599 | description: Whether or not this video contains sensitive content | 6110 | description: Whether or not this video contains sensitive content |
@@ -5775,7 +6286,7 @@ components: | |||
5775 | # optionally present fields: they require WITH_STATS scope | 6286 | # optionally present fields: they require WITH_STATS scope |
5776 | videosCount: | 6287 | videosCount: |
5777 | type: integer | 6288 | type: integer |
5778 | description: Count of videos published | 6289 | description: Count of videos published |
5779 | abusesCount: | 6290 | abusesCount: |
5780 | type: integer | 6291 | type: integer |
5781 | description: Count of reports/abuses of which the user is a target | 6292 | description: Count of reports/abuses of which the user is a target |
@@ -5822,9 +6333,9 @@ components: | |||
5822 | UpdateUser: | 6333 | UpdateUser: |
5823 | properties: | 6334 | properties: |
5824 | email: | 6335 | email: |
5825 | type: string | ||
5826 | format: email | ||
5827 | description: The updated email of the user | 6336 | description: The updated email of the user |
6337 | allOf: | ||
6338 | - $ref: '#/components/schemas/User/properties/email' | ||
5828 | emailVerified: | 6339 | emailVerified: |
5829 | type: boolean | 6340 | type: boolean |
5830 | description: Set the email as verified | 6341 | description: Set the email as verified |
@@ -5844,28 +6355,54 @@ components: | |||
5844 | adminFlags: | 6355 | adminFlags: |
5845 | $ref: '#/components/schemas/UserAdminFlags' | 6356 | $ref: '#/components/schemas/UserAdminFlags' |
5846 | UpdateMe: | 6357 | UpdateMe: |
6358 | # see shared/models/users/user-update-me.model.ts: | ||
5847 | properties: | 6359 | properties: |
5848 | password: | 6360 | password: |
5849 | $ref: '#/components/schemas/password' | 6361 | $ref: '#/components/schemas/password' |
6362 | currentPassword: | ||
6363 | $ref: '#/components/schemas/password' | ||
5850 | email: | 6364 | email: |
6365 | description: new email used for login and service communications | ||
6366 | allOf: | ||
6367 | - $ref: '#/components/schemas/User/properties/email' | ||
6368 | displayName: | ||
5851 | type: string | 6369 | type: string |
5852 | format: email | 6370 | description: new name of the user in its representations |
5853 | description: Your new email | 6371 | minLength: 3 |
6372 | maxLength: 120 | ||
5854 | displayNSFW: | 6373 | displayNSFW: |
5855 | type: string | 6374 | type: string |
5856 | description: Your new displayNSFW | 6375 | description: new NSFW display policy |
5857 | enum: | 6376 | enum: |
5858 | - 'true' | 6377 | - 'true' |
5859 | - 'false' | 6378 | - 'false' |
5860 | - both | 6379 | - both |
6380 | webTorrentEnabled: | ||
6381 | type: boolean | ||
6382 | description: whether to enable P2P in the player or not | ||
5861 | autoPlayVideo: | 6383 | autoPlayVideo: |
5862 | type: boolean | 6384 | type: boolean |
5863 | description: Your new autoPlayVideo | 6385 | description: new preference regarding playing videos automatically |
5864 | required: | 6386 | autoPlayNextVideo: |
5865 | - password | 6387 | type: boolean |
5866 | 6388 | description: new preference regarding playing following videos automatically | |
5867 | - displayNSFW | 6389 | autoPlayNextVideoPlaylist: |
5868 | - autoPlayVideo | 6390 | type: boolean |
6391 | description: new preference regarding playing following playlist videos automatically | ||
6392 | videosHistoryEnabled: | ||
6393 | type: boolean | ||
6394 | description: whether to keep track of watched history or not | ||
6395 | videoLanguages: | ||
6396 | type: array | ||
6397 | items: | ||
6398 | type: string | ||
6399 | description: list of languages to filter videos down to | ||
6400 | theme: | ||
6401 | type: string | ||
6402 | noInstanceConfigWarningModal: | ||
6403 | type: boolean | ||
6404 | noWelcomeModal: | ||
6405 | type: boolean | ||
5869 | GetMeVideoRating: | 6406 | GetMeVideoRating: |
5870 | properties: | 6407 | properties: |
5871 | id: | 6408 | id: |
@@ -5897,38 +6434,94 @@ components: | |||
5897 | RegisterUser: | 6434 | RegisterUser: |
5898 | properties: | 6435 | properties: |
5899 | username: | 6436 | username: |
5900 | $ref: '#/components/schemas/username' | 6437 | description: immutable name of the user, used to find or mention its actor |
6438 | allOf: | ||
6439 | - $ref: '#/components/schemas/username' | ||
5901 | password: | 6440 | password: |
5902 | $ref: '#/components/schemas/password' | 6441 | $ref: '#/components/schemas/password' |
5903 | email: | 6442 | email: |
5904 | type: string | 6443 | type: string |
5905 | format: email | 6444 | format: email |
5906 | description: The email of the user | 6445 | description: email of the user, used for login or service communications |
5907 | displayName: | 6446 | displayName: |
5908 | type: string | 6447 | type: string |
5909 | description: The user display name | 6448 | description: editable name of the user, displayed in its representations |
5910 | minLength: 1 | 6449 | minLength: 1 |
5911 | maxLength: 120 | 6450 | maxLength: 120 |
5912 | channel: | 6451 | channel: |
5913 | type: object | 6452 | type: object |
6453 | description: channel base information used to create the first channel of the user | ||
5914 | properties: | 6454 | properties: |
5915 | name: | 6455 | name: |
5916 | $ref: '#/components/schemas/usernameChannel' | 6456 | $ref: '#/components/schemas/usernameChannel' |
5917 | displayName: | 6457 | displayName: |
5918 | type: string | 6458 | $ref: '#/components/schemas/VideoChannel/properties/displayName' |
5919 | description: The display name for the default channel | ||
5920 | minLength: 1 | ||
5921 | maxLength: 120 | ||
5922 | required: | 6459 | required: |
5923 | - username | 6460 | - username |
5924 | - password | 6461 | - password |
5925 | 6462 | ||
5926 | 6463 | ||
6464 | OAuthClient: | ||
6465 | properties: | ||
6466 | client_id: | ||
6467 | type: string | ||
6468 | pattern: /^[a-z0-9]$/ | ||
6469 | maxLength: 32 | ||
6470 | minLength: 32 | ||
6471 | example: v1ikx5hnfop4mdpnci8nsqh93c45rldf | ||
6472 | client_secret: | ||
6473 | type: string | ||
6474 | pattern: /^[a-zA-Z0-9]$/ | ||
6475 | maxLength: 32 | ||
6476 | minLength: 32 | ||
6477 | example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt | ||
6478 | OAuthToken-password: | ||
6479 | allOf: | ||
6480 | - $ref: '#/components/schemas/OAuthClient' | ||
6481 | - type: object | ||
6482 | properties: | ||
6483 | grant_type: | ||
6484 | type: string | ||
6485 | enum: | ||
6486 | - password | ||
6487 | - refresh_token | ||
6488 | default: password | ||
6489 | username: | ||
6490 | $ref: '#/components/schemas/User/properties/username' | ||
6491 | password: | ||
6492 | $ref: '#/components/schemas/password' | ||
6493 | required: | ||
6494 | - client_id | ||
6495 | - client_secret | ||
6496 | - grant_type | ||
6497 | - username | ||
6498 | - password | ||
6499 | OAuthToken-refresh_token: | ||
6500 | allOf: | ||
6501 | - $ref: '#/components/schemas/OAuthClient' | ||
6502 | - type: object | ||
6503 | properties: | ||
6504 | grant_type: | ||
6505 | type: string | ||
6506 | enum: | ||
6507 | - password | ||
6508 | - refresh_token | ||
6509 | default: password | ||
6510 | refresh_token: | ||
6511 | type: string | ||
6512 | example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 | ||
6513 | required: | ||
6514 | - client_id | ||
6515 | - client_secret | ||
6516 | - grant_type | ||
6517 | - refresh_token | ||
6518 | |||
5927 | VideoChannel: | 6519 | VideoChannel: |
5928 | properties: | 6520 | properties: |
5929 | # GET/POST/PUT properties | 6521 | # GET/POST/PUT properties |
5930 | displayName: | 6522 | displayName: |
5931 | type: string | 6523 | type: string |
6524 | description: editable name of the channel, displayed in its representations | ||
5932 | example: Videos of Framasoft | 6525 | example: Videos of Framasoft |
5933 | minLength: 1 | 6526 | minLength: 1 |
5934 | maxLength: 120 | 6527 | maxLength: 120 |
@@ -5940,7 +6533,7 @@ components: | |||
5940 | support: | 6533 | support: |
5941 | type: string | 6534 | type: string |
5942 | description: text shown by default on all videos of this channel, to tell the audience how to support it | 6535 | 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 | 6536 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
5944 | minLength: 3 | 6537 | minLength: 3 |
5945 | maxLength: 1000 | 6538 | maxLength: 1000 |
5946 | # GET-only properties | 6539 | # GET-only properties |