diff options
Diffstat (limited to 'support')
-rw-r--r-- | support/doc/api/openapi.yaml | 1012 |
1 files changed, 777 insertions, 235 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 8b4c4c72d..11adf078d 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, |
@@ -210,6 +253,10 @@ tags: | |||
210 | 253 | ||
211 | For importing videos as your own, refer to [video imports](#operation/importVideo). | 254 | For importing videos as your own, refer to [video imports](#operation/importVideo). |
212 | x-tagGroups: | 255 | x-tagGroups: |
256 | - name: Auth | ||
257 | tags: | ||
258 | - Register | ||
259 | - Session | ||
213 | - name: Accounts | 260 | - name: Accounts |
214 | tags: | 261 | tags: |
215 | - Accounts | 262 | - Accounts |
@@ -255,6 +302,7 @@ paths: | |||
255 | tags: | 302 | tags: |
256 | - Accounts | 303 | - Accounts |
257 | summary: Get an account | 304 | summary: Get an account |
305 | operationId: getAccount | ||
258 | parameters: | 306 | parameters: |
259 | - $ref: '#/components/parameters/name' | 307 | - $ref: '#/components/parameters/name' |
260 | responses: | 308 | responses: |
@@ -266,12 +314,14 @@ paths: | |||
266 | $ref: '#/components/schemas/Account' | 314 | $ref: '#/components/schemas/Account' |
267 | '404': | 315 | '404': |
268 | description: account not found | 316 | description: account not found |
317 | |||
269 | '/accounts/{name}/videos': | 318 | '/accounts/{name}/videos': |
270 | get: | 319 | get: |
271 | tags: | 320 | tags: |
272 | - Accounts | 321 | - Accounts |
273 | - Video | 322 | - Video |
274 | summary: 'List videos of an account' | 323 | summary: 'List videos of an account' |
324 | operationId: getAccountVideos | ||
275 | parameters: | 325 | parameters: |
276 | - $ref: '#/components/parameters/name' | 326 | - $ref: '#/components/parameters/name' |
277 | - $ref: '#/components/parameters/categoryOneOf' | 327 | - $ref: '#/components/parameters/categoryOneOf' |
@@ -327,11 +377,13 @@ paths: | |||
327 | json = r.json() | 377 | json = r.json() |
328 | 378 | ||
329 | print(json) | 379 | print(json) |
380 | |||
330 | /accounts: | 381 | /accounts: |
331 | get: | 382 | get: |
332 | tags: | 383 | tags: |
333 | - Accounts | 384 | - Accounts |
334 | summary: List accounts | 385 | summary: List accounts |
386 | operationId: getAccounts | ||
335 | parameters: | 387 | parameters: |
336 | - $ref: '#/components/parameters/start' | 388 | - $ref: '#/components/parameters/start' |
337 | - $ref: '#/components/parameters/count' | 389 | - $ref: '#/components/parameters/count' |
@@ -345,11 +397,13 @@ paths: | |||
345 | type: array | 397 | type: array |
346 | items: | 398 | items: |
347 | $ref: '#/components/schemas/Account' | 399 | $ref: '#/components/schemas/Account' |
400 | |||
348 | /config: | 401 | /config: |
349 | get: | 402 | get: |
350 | tags: | 403 | tags: |
351 | - Config | 404 | - Config |
352 | summary: Get instance public configuration | 405 | summary: Get instance public configuration |
406 | operationId: getConfig | ||
353 | responses: | 407 | responses: |
354 | '200': | 408 | '200': |
355 | description: successful operation | 409 | description: successful operation |
@@ -360,9 +414,11 @@ paths: | |||
360 | examples: | 414 | examples: |
361 | nightly: | 415 | nightly: |
362 | externalValue: https://peertube2.cpy.re/api/v1/config | 416 | externalValue: https://peertube2.cpy.re/api/v1/config |
417 | |||
363 | /config/about: | 418 | /config/about: |
364 | get: | 419 | get: |
365 | summary: Get instance "About" information | 420 | summary: Get instance "About" information |
421 | operationId: getAbout | ||
366 | tags: | 422 | tags: |
367 | - Config | 423 | - Config |
368 | responses: | 424 | responses: |
@@ -375,9 +431,11 @@ paths: | |||
375 | examples: | 431 | examples: |
376 | nightly: | 432 | nightly: |
377 | externalValue: https://peertube2.cpy.re/api/v1/config/about | 433 | externalValue: https://peertube2.cpy.re/api/v1/config/about |
434 | |||
378 | /config/custom: | 435 | /config/custom: |
379 | get: | 436 | get: |
380 | summary: Get instance runtime configuration | 437 | summary: Get instance runtime configuration |
438 | operationId: getCustomConfig | ||
381 | tags: | 439 | tags: |
382 | - Config | 440 | - Config |
383 | security: | 441 | security: |
@@ -392,6 +450,7 @@ paths: | |||
392 | $ref: '#/components/schemas/ServerConfigCustom' | 450 | $ref: '#/components/schemas/ServerConfigCustom' |
393 | put: | 451 | put: |
394 | summary: Set instance runtime configuration | 452 | summary: Set instance runtime configuration |
453 | operationId: putCustomConfig | ||
395 | tags: | 454 | tags: |
396 | - Config | 455 | - Config |
397 | security: | 456 | security: |
@@ -408,6 +467,7 @@ paths: | |||
408 | - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled | 467 | - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled |
409 | delete: | 468 | delete: |
410 | summary: Delete instance runtime configuration | 469 | summary: Delete instance runtime configuration |
470 | operationId: delCustomConfig | ||
411 | tags: | 471 | tags: |
412 | - Config | 472 | - Config |
413 | security: | 473 | security: |
@@ -416,9 +476,11 @@ paths: | |||
416 | responses: | 476 | responses: |
417 | '200': | 477 | '200': |
418 | description: successful operation | 478 | description: successful operation |
479 | |||
419 | /jobs/{state}: | 480 | /jobs/{state}: |
420 | get: | 481 | get: |
421 | summary: List instance jobs | 482 | summary: List instance jobs |
483 | operationId: getJobs | ||
422 | security: | 484 | security: |
423 | - OAuth2: | 485 | - OAuth2: |
424 | - admin | 486 | - admin |
@@ -458,66 +520,108 @@ paths: | |||
458 | maxItems: 100 | 520 | maxItems: 100 |
459 | items: | 521 | items: |
460 | $ref: '#/components/schemas/Job' | 522 | $ref: '#/components/schemas/Job' |
461 | '/server/following/{host}': | 523 | |
524 | /server/followers: | ||
525 | get: | ||
526 | tags: | ||
527 | - Instance Follows | ||
528 | summary: List instances following the server | ||
529 | parameters: | ||
530 | - $ref: '#/components/parameters/followState' | ||
531 | - $ref: '#/components/parameters/actorType' | ||
532 | - $ref: '#/components/parameters/start' | ||
533 | - $ref: '#/components/parameters/count' | ||
534 | - $ref: '#/components/parameters/sort' | ||
535 | responses: | ||
536 | '200': | ||
537 | description: successful operation | ||
538 | content: | ||
539 | application/json: | ||
540 | schema: | ||
541 | type: object | ||
542 | properties: | ||
543 | total: | ||
544 | type: integer | ||
545 | example: 1 | ||
546 | data: | ||
547 | type: array | ||
548 | items: | ||
549 | $ref: '#/components/schemas/Follow' | ||
550 | |||
551 | '/server/followers/{nameWithHost}': | ||
462 | delete: | 552 | delete: |
553 | summary: Remove or reject a follower to your server | ||
463 | security: | 554 | security: |
464 | - OAuth2: | 555 | - OAuth2: |
465 | - admin | 556 | - admin |
466 | tags: | 557 | tags: |
467 | - Instance Follows | 558 | - Instance Follows |
468 | summary: Unfollow a server | ||
469 | parameters: | 559 | parameters: |
470 | - name: host | 560 | - name: nameWithHost |
471 | in: path | 561 | in: path |
472 | required: true | 562 | required: true |
473 | description: 'The host to unfollow ' | 563 | description: The remote actor handle to remove from your followers |
474 | schema: | 564 | schema: |
475 | type: string | 565 | type: string |
476 | format: hostname | 566 | format: email |
477 | responses: | 567 | responses: |
478 | '201': | 568 | '204': |
479 | description: successful operation | 569 | description: successful operation |
480 | /server/followers: | 570 | '404': |
481 | get: | 571 | description: follower not found |
572 | |||
573 | '/server/followers/{nameWithHost}/reject': | ||
574 | post: | ||
575 | summary: Reject a pending follower to your server | ||
576 | security: | ||
577 | - OAuth2: | ||
578 | - admin | ||
482 | tags: | 579 | tags: |
483 | - Instance Follows | 580 | - Instance Follows |
484 | summary: List instance followers | ||
485 | parameters: | 581 | parameters: |
486 | - $ref: '#/components/parameters/start' | 582 | - name: nameWithHost |
487 | - $ref: '#/components/parameters/count' | 583 | in: path |
488 | - $ref: '#/components/parameters/sort' | 584 | required: true |
585 | description: The remote actor handle to remove from your followers | ||
586 | schema: | ||
587 | type: string | ||
588 | format: email | ||
489 | responses: | 589 | responses: |
490 | '200': | 590 | '204': |
491 | description: successful operation | 591 | description: successful operation |
492 | content: | 592 | '404': |
493 | application/json: | 593 | description: follower not found |
494 | schema: | 594 | |
495 | type: array | 595 | '/server/followers/{nameWithHost}/accept': |
496 | items: | 596 | post: |
497 | $ref: '#/components/schemas/Follow' | 597 | summary: Accept a pending follower to your server |
598 | security: | ||
599 | - OAuth2: | ||
600 | - admin | ||
601 | tags: | ||
602 | - Instance Follows | ||
603 | parameters: | ||
604 | - name: nameWithHost | ||
605 | in: path | ||
606 | required: true | ||
607 | description: The remote actor handle to remove from your followers | ||
608 | schema: | ||
609 | type: string | ||
610 | format: email | ||
611 | responses: | ||
612 | '204': | ||
613 | description: successful operation | ||
614 | '404': | ||
615 | description: follower not found | ||
616 | |||
498 | /server/following: | 617 | /server/following: |
499 | get: | 618 | get: |
500 | tags: | 619 | tags: |
501 | - Instance Follows | 620 | - Instance Follows |
502 | summary: List instances followed by the server | 621 | summary: List instances followed by the server |
503 | parameters: | 622 | parameters: |
504 | - name: state | 623 | - $ref: '#/components/parameters/followState' |
505 | in: query | 624 | - $ref: '#/components/parameters/actorType' |
506 | schema: | ||
507 | type: string | ||
508 | enum: | ||
509 | - pending | ||
510 | - accepted | ||
511 | - name: actorType | ||
512 | in: query | ||
513 | schema: | ||
514 | type: string | ||
515 | enum: | ||
516 | - Person | ||
517 | - Application | ||
518 | - Group | ||
519 | - Service | ||
520 | - Organization | ||
521 | - $ref: '#/components/parameters/start' | 625 | - $ref: '#/components/parameters/start' |
522 | - $ref: '#/components/parameters/count' | 626 | - $ref: '#/components/parameters/count' |
523 | - $ref: '#/components/parameters/sort' | 627 | - $ref: '#/components/parameters/sort' |
@@ -527,16 +631,22 @@ paths: | |||
527 | content: | 631 | content: |
528 | application/json: | 632 | application/json: |
529 | schema: | 633 | schema: |
530 | type: array | 634 | type: object |
531 | items: | 635 | properties: |
532 | $ref: '#/components/schemas/Follow' | 636 | total: |
637 | type: integer | ||
638 | example: 1 | ||
639 | data: | ||
640 | type: array | ||
641 | items: | ||
642 | $ref: '#/components/schemas/Follow' | ||
533 | post: | 643 | post: |
534 | security: | 644 | security: |
535 | - OAuth2: | 645 | - OAuth2: |
536 | - admin | 646 | - admin |
537 | tags: | 647 | tags: |
538 | - Instance Follows | 648 | - Instance Follows |
539 | summary: Follow a server | 649 | summary: Follow a list of servers |
540 | responses: | 650 | responses: |
541 | '204': | 651 | '204': |
542 | description: successful operation | 652 | description: successful operation |
@@ -554,9 +664,33 @@ paths: | |||
554 | type: string | 664 | type: string |
555 | format: hostname | 665 | format: hostname |
556 | uniqueItems: true | 666 | uniqueItems: true |
667 | |||
668 | '/server/following/{host}': | ||
669 | delete: | ||
670 | summary: Unfollow a server | ||
671 | security: | ||
672 | - OAuth2: | ||
673 | - admin | ||
674 | tags: | ||
675 | - Instance Follows | ||
676 | parameters: | ||
677 | - name: host | ||
678 | in: path | ||
679 | required: true | ||
680 | description: The host to unfollow | ||
681 | schema: | ||
682 | type: string | ||
683 | format: hostname | ||
684 | responses: | ||
685 | '204': | ||
686 | description: successful operation | ||
687 | '404': | ||
688 | description: host not found | ||
689 | |||
557 | /users: | 690 | /users: |
558 | post: | 691 | post: |
559 | summary: Create a user | 692 | summary: Create a user |
693 | operationId: addUser | ||
560 | security: | 694 | security: |
561 | - OAuth2: | 695 | - OAuth2: |
562 | - admin | 696 | - admin |
@@ -571,18 +705,18 @@ paths: | |||
571 | $ref: '#/components/schemas/AddUserResponse' | 705 | $ref: '#/components/schemas/AddUserResponse' |
572 | links: | 706 | links: |
573 | # GET /users/{id} | 707 | # GET /users/{id} |
574 | GetUserId: | 708 | GetUser: |
575 | operationId: getUserId | 709 | operationId: getUser |
576 | parameters: | 710 | parameters: |
577 | id: '$response.body#/user/id' | 711 | id: '$response.body#/user/id' |
578 | # PUT /users/{id} | 712 | # PUT /users/{id} |
579 | PutUserId: | 713 | PutUser: |
580 | operationId: putUserId | 714 | operationId: putUser |
581 | parameters: | 715 | parameters: |
582 | id: '$response.body#/user/id' | 716 | id: '$response.body#/user/id' |
583 | # DELETE /users/{id} | 717 | # DELETE /users/{id} |
584 | DelUserId: | 718 | DelUser: |
585 | operationId: delUserId | 719 | operationId: delUser |
586 | parameters: | 720 | parameters: |
587 | id: '$response.body#/user/id' | 721 | id: '$response.body#/user/id' |
588 | '403': | 722 | '403': |
@@ -598,6 +732,7 @@ paths: | |||
598 | required: true | 732 | required: true |
599 | get: | 733 | get: |
600 | summary: List users | 734 | summary: List users |
735 | operationId: getUsers | ||
601 | security: | 736 | security: |
602 | - OAuth2: | 737 | - OAuth2: |
603 | - admin | 738 | - admin |
@@ -618,6 +753,7 @@ paths: | |||
618 | type: array | 753 | type: array |
619 | items: | 754 | items: |
620 | $ref: '#/components/schemas/User' | 755 | $ref: '#/components/schemas/User' |
756 | |||
621 | '/users/{id}': | 757 | '/users/{id}': |
622 | parameters: | 758 | parameters: |
623 | - $ref: '#/components/parameters/id' | 759 | - $ref: '#/components/parameters/id' |
@@ -628,7 +764,7 @@ paths: | |||
628 | - admin | 764 | - admin |
629 | tags: | 765 | tags: |
630 | - Users | 766 | - Users |
631 | operationId: delUserId | 767 | operationId: delUser |
632 | responses: | 768 | responses: |
633 | '204': | 769 | '204': |
634 | description: successful operation | 770 | description: successful operation |
@@ -638,7 +774,7 @@ paths: | |||
638 | - OAuth2: [] | 774 | - OAuth2: [] |
639 | tags: | 775 | tags: |
640 | - Users | 776 | - Users |
641 | operationId: getUserId | 777 | operationId: getUser |
642 | parameters: | 778 | parameters: |
643 | - name: withStats | 779 | - name: withStats |
644 | in: query | 780 | in: query |
@@ -663,7 +799,7 @@ paths: | |||
663 | - OAuth2: [] | 799 | - OAuth2: [] |
664 | tags: | 800 | tags: |
665 | - Users | 801 | - Users |
666 | operationId: putUserId | 802 | operationId: putUser |
667 | responses: | 803 | responses: |
668 | '204': | 804 | '204': |
669 | description: successful operation | 805 | description: successful operation |
@@ -673,11 +809,120 @@ paths: | |||
673 | schema: | 809 | schema: |
674 | $ref: '#/components/schemas/UpdateUser' | 810 | $ref: '#/components/schemas/UpdateUser' |
675 | required: true | 811 | required: true |
812 | |||
813 | /oauth-clients/local: | ||
814 | get: | ||
815 | summary: Login prerequisite | ||
816 | description: You need to retrieve a client id and secret before [logging in](#operation/getOAuthToken). | ||
817 | operationId: getOAuthClient | ||
818 | tags: | ||
819 | - Session | ||
820 | responses: | ||
821 | '200': | ||
822 | description: successful operation | ||
823 | content: | ||
824 | application/json: | ||
825 | schema: | ||
826 | $ref: '#/components/schemas/OAuthClient' | ||
827 | links: | ||
828 | UseOAuthClientToLogin: | ||
829 | operationId: getOAuthToken | ||
830 | parameters: | ||
831 | client_id: '$response.body#/client_id' | ||
832 | client_secret: '$response.body#/client_secret' | ||
833 | x-codeSamples: | ||
834 | - lang: Shell | ||
835 | source: | | ||
836 | API="https://peertube2.cpy.re/api/v1" | ||
837 | |||
838 | ## AUTH | ||
839 | curl -s "$API/oauth-clients/local" | ||
840 | |||
841 | /users/token: | ||
842 | post: | ||
843 | summary: Login | ||
844 | operationId: getOAuthToken | ||
845 | description: With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens. | ||
846 | tags: | ||
847 | - Session | ||
848 | requestBody: | ||
849 | content: | ||
850 | application/x-www-form-urlencoded: | ||
851 | schema: | ||
852 | oneOf: | ||
853 | - $ref: '#/components/schemas/OAuthToken-password' | ||
854 | - $ref: '#/components/schemas/OAuthToken-refresh_token' | ||
855 | discriminator: | ||
856 | propertyName: grant_type | ||
857 | mapping: | ||
858 | password: '#/components/schemas/OAuthToken-password' | ||
859 | refresh_token: '#/components/schemas/OAuthToken-refresh_token' | ||
860 | responses: | ||
861 | '200': | ||
862 | description: successful operation | ||
863 | content: | ||
864 | application/json: | ||
865 | schema: | ||
866 | type: object | ||
867 | properties: | ||
868 | token_type: | ||
869 | type: string | ||
870 | example: Bearer | ||
871 | access_token: | ||
872 | type: string | ||
873 | example: 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0 | ||
874 | description: valid for 1 day | ||
875 | refresh_token: | ||
876 | type: string | ||
877 | example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 | ||
878 | description: valid for 2 weeks | ||
879 | expires_in: | ||
880 | type: integer | ||
881 | minimum: 0 | ||
882 | example: 14399 | ||
883 | refresh_token_expires_in: | ||
884 | type: integer | ||
885 | minimum: 0 | ||
886 | example: 1209600 | ||
887 | x-codeSamples: | ||
888 | - lang: Shell | ||
889 | source: | | ||
890 | ## DEPENDENCIES: jq | ||
891 | API="https://peertube2.cpy.re/api/v1" | ||
892 | USERNAME="<your_username>" | ||
893 | PASSWORD="<your_password>" | ||
894 | |||
895 | ## AUTH | ||
896 | client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id") | ||
897 | client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret") | ||
898 | curl -s "$API/users/token" \ | ||
899 | --data client_id="$client_id" \ | ||
900 | --data client_secret="$client_secret" \ | ||
901 | --data grant_type=password \ | ||
902 | --data username="$USERNAME" \ | ||
903 | --data password="$PASSWORD" \ | ||
904 | | jq -r ".access_token" | ||
905 | |||
906 | /users/revoke-token: | ||
907 | post: | ||
908 | summary: Logout | ||
909 | description: Revokes your access token and its associated refresh token, destroying your current session. | ||
910 | operationId: revokeOAuthToken | ||
911 | tags: | ||
912 | - Session | ||
913 | security: | ||
914 | - OAuth2: [] | ||
915 | responses: | ||
916 | '200': | ||
917 | description: successful operation | ||
918 | |||
676 | /users/register: | 919 | /users/register: |
677 | post: | 920 | post: |
678 | summary: Register a user | 921 | summary: Register a user |
922 | operationId: registerUser | ||
679 | tags: | 923 | tags: |
680 | - Users | 924 | - Users |
925 | - Register | ||
681 | responses: | 926 | responses: |
682 | '204': | 927 | '204': |
683 | description: successful operation | 928 | description: successful operation |
@@ -687,9 +932,55 @@ paths: | |||
687 | schema: | 932 | schema: |
688 | $ref: '#/components/schemas/RegisterUser' | 933 | $ref: '#/components/schemas/RegisterUser' |
689 | required: true | 934 | required: true |
935 | |||
936 | /users/{id}/verify-email: | ||
937 | post: | ||
938 | summary: Verify a user | ||
939 | operationId: verifyUser | ||
940 | description: | | ||
941 | Following a user registration, the new user will receive an email asking to click a link | ||
942 | containing a secret. | ||
943 | tags: | ||
944 | - Users | ||
945 | - Register | ||
946 | parameters: | ||
947 | - $ref: '#/components/parameters/id' | ||
948 | requestBody: | ||
949 | content: | ||
950 | application/json: | ||
951 | schema: | ||
952 | type: object | ||
953 | properties: | ||
954 | verificationString: | ||
955 | type: string | ||
956 | format: url | ||
957 | isPendingEmail: | ||
958 | type: boolean | ||
959 | required: | ||
960 | - verificationString | ||
961 | responses: | ||
962 | '204': | ||
963 | description: successful operation | ||
964 | '403': | ||
965 | description: invalid verification string | ||
966 | '404': | ||
967 | description: user not found | ||
968 | |||
969 | /users/ask-send-verify-email: | ||
970 | post: | ||
971 | summary: Resend user verification link | ||
972 | operationId: resendEmailToVerifyUser | ||
973 | tags: | ||
974 | - Users | ||
975 | - Register | ||
976 | responses: | ||
977 | '204': | ||
978 | description: successful operation | ||
979 | |||
690 | /users/me: | 980 | /users/me: |
691 | get: | 981 | get: |
692 | summary: Get my user information | 982 | summary: Get my user information |
983 | operationId: getUserInfo | ||
693 | security: | 984 | security: |
694 | - OAuth2: | 985 | - OAuth2: |
695 | - user | 986 | - user |
@@ -706,6 +997,7 @@ paths: | |||
706 | $ref: '#/components/schemas/User' | 997 | $ref: '#/components/schemas/User' |
707 | put: | 998 | put: |
708 | summary: Update my user information | 999 | summary: Update my user information |
1000 | operationId: putUserInfo | ||
709 | security: | 1001 | security: |
710 | - OAuth2: | 1002 | - OAuth2: |
711 | - user | 1003 | - user |
@@ -720,6 +1012,7 @@ paths: | |||
720 | schema: | 1012 | schema: |
721 | $ref: '#/components/schemas/UpdateMe' | 1013 | $ref: '#/components/schemas/UpdateMe' |
722 | required: true | 1014 | required: true |
1015 | |||
723 | /users/me/videos/imports: | 1016 | /users/me/videos/imports: |
724 | get: | 1017 | get: |
725 | summary: Get video imports of my user | 1018 | summary: Get video imports of my user |
@@ -740,6 +1033,7 @@ paths: | |||
740 | application/json: | 1033 | application/json: |
741 | schema: | 1034 | schema: |
742 | $ref: '#/components/schemas/VideoImportsList' | 1035 | $ref: '#/components/schemas/VideoImportsList' |
1036 | |||
743 | /users/me/video-quota-used: | 1037 | /users/me/video-quota-used: |
744 | get: | 1038 | get: |
745 | summary: Get my user used quota | 1039 | summary: Get my user used quota |
@@ -764,6 +1058,7 @@ paths: | |||
764 | type: number | 1058 | type: number |
765 | description: The user video quota used today in bytes | 1059 | description: The user video quota used today in bytes |
766 | example: 1681014151 | 1060 | example: 1681014151 |
1061 | |||
767 | '/users/me/videos/{videoId}/rating': | 1062 | '/users/me/videos/{videoId}/rating': |
768 | get: | 1063 | get: |
769 | summary: Get rate of my user for a video | 1064 | summary: Get rate of my user for a video |
@@ -786,6 +1081,7 @@ paths: | |||
786 | application/json: | 1081 | application/json: |
787 | schema: | 1082 | schema: |
788 | $ref: '#/components/schemas/GetMeVideoRating' | 1083 | $ref: '#/components/schemas/GetMeVideoRating' |
1084 | |||
789 | /users/me/videos: | 1085 | /users/me/videos: |
790 | get: | 1086 | get: |
791 | summary: Get videos of my user | 1087 | summary: Get videos of my user |
@@ -806,6 +1102,7 @@ paths: | |||
806 | application/json: | 1102 | application/json: |
807 | schema: | 1103 | schema: |
808 | $ref: '#/components/schemas/VideoListResponse' | 1104 | $ref: '#/components/schemas/VideoListResponse' |
1105 | |||
809 | /users/me/subscriptions: | 1106 | /users/me/subscriptions: |
810 | get: | 1107 | get: |
811 | summary: Get my user subscriptions | 1108 | summary: Get my user subscriptions |
@@ -851,6 +1148,7 @@ paths: | |||
851 | responses: | 1148 | responses: |
852 | '200': | 1149 | '200': |
853 | description: successful operation | 1150 | description: successful operation |
1151 | |||
854 | /users/me/subscriptions/exist: | 1152 | /users/me/subscriptions/exist: |
855 | get: | 1153 | get: |
856 | summary: Get if subscriptions exist for my user | 1154 | summary: Get if subscriptions exist for my user |
@@ -868,6 +1166,7 @@ paths: | |||
868 | application/json: | 1166 | application/json: |
869 | schema: | 1167 | schema: |
870 | type: object | 1168 | type: object |
1169 | |||
871 | /users/me/subscriptions/videos: | 1170 | /users/me/subscriptions/videos: |
872 | get: | 1171 | get: |
873 | summary: List videos of subscriptions of my user | 1172 | summary: List videos of subscriptions of my user |
@@ -897,6 +1196,7 @@ paths: | |||
897 | application/json: | 1196 | application/json: |
898 | schema: | 1197 | schema: |
899 | $ref: '#/components/schemas/VideoListResponse' | 1198 | $ref: '#/components/schemas/VideoListResponse' |
1199 | |||
900 | '/users/me/subscriptions/{subscriptionHandle}': | 1200 | '/users/me/subscriptions/{subscriptionHandle}': |
901 | get: | 1201 | get: |
902 | summary: Get subscription of my user | 1202 | summary: Get subscription of my user |
@@ -926,6 +1226,7 @@ paths: | |||
926 | responses: | 1226 | responses: |
927 | '200': | 1227 | '200': |
928 | description: successful operation | 1228 | description: successful operation |
1229 | |||
929 | /users/me/notifications: | 1230 | /users/me/notifications: |
930 | get: | 1231 | get: |
931 | summary: List my notifications | 1232 | summary: List my notifications |
@@ -949,6 +1250,7 @@ paths: | |||
949 | application/json: | 1250 | application/json: |
950 | schema: | 1251 | schema: |
951 | $ref: '#/components/schemas/NotificationListResponse' | 1252 | $ref: '#/components/schemas/NotificationListResponse' |
1253 | |||
952 | /users/me/notifications/read: | 1254 | /users/me/notifications/read: |
953 | post: | 1255 | post: |
954 | summary: Mark notifications as read by their id | 1256 | summary: Mark notifications as read by their id |
@@ -972,6 +1274,7 @@ paths: | |||
972 | responses: | 1274 | responses: |
973 | '204': | 1275 | '204': |
974 | description: successful operation | 1276 | description: successful operation |
1277 | |||
975 | /users/me/notifications/read-all: | 1278 | /users/me/notifications/read-all: |
976 | post: | 1279 | post: |
977 | summary: Mark all my notification as read | 1280 | summary: Mark all my notification as read |
@@ -982,6 +1285,7 @@ paths: | |||
982 | responses: | 1285 | responses: |
983 | '204': | 1286 | '204': |
984 | description: successful operation | 1287 | description: successful operation |
1288 | |||
985 | /users/me/notification-settings: | 1289 | /users/me/notification-settings: |
986 | put: | 1290 | put: |
987 | summary: Update my notification settings | 1291 | summary: Update my notification settings |
@@ -1022,6 +1326,7 @@ paths: | |||
1022 | responses: | 1326 | responses: |
1023 | '204': | 1327 | '204': |
1024 | description: successful operation | 1328 | description: successful operation |
1329 | |||
1025 | /users/me/history/videos: | 1330 | /users/me/history/videos: |
1026 | get: | 1331 | get: |
1027 | summary: List watched videos history | 1332 | summary: List watched videos history |
@@ -1040,6 +1345,7 @@ paths: | |||
1040 | application/json: | 1345 | application/json: |
1041 | schema: | 1346 | schema: |
1042 | $ref: '#/components/schemas/VideoListResponse' | 1347 | $ref: '#/components/schemas/VideoListResponse' |
1348 | |||
1043 | /users/me/history/videos/remove: | 1349 | /users/me/history/videos/remove: |
1044 | post: | 1350 | post: |
1045 | summary: Clear video history | 1351 | summary: Clear video history |
@@ -1060,6 +1366,7 @@ paths: | |||
1060 | responses: | 1366 | responses: |
1061 | '204': | 1367 | '204': |
1062 | description: successful operation | 1368 | description: successful operation |
1369 | |||
1063 | /users/me/avatar/pick: | 1370 | /users/me/avatar/pick: |
1064 | post: | 1371 | post: |
1065 | summary: Update my user avatar | 1372 | summary: Update my user avatar |
@@ -1098,6 +1405,7 @@ paths: | |||
1098 | encoding: | 1405 | encoding: |
1099 | avatarfile: | 1406 | avatarfile: |
1100 | contentType: image/png, image/jpeg | 1407 | contentType: image/png, image/jpeg |
1408 | |||
1101 | /users/me/avatar: | 1409 | /users/me/avatar: |
1102 | delete: | 1410 | delete: |
1103 | summary: Delete my avatar | 1411 | summary: Delete my avatar |
@@ -1119,6 +1427,7 @@ paths: | |||
1119 | responses: | 1427 | responses: |
1120 | '200': | 1428 | '200': |
1121 | description: successful operation | 1429 | description: successful operation |
1430 | |||
1122 | '/videos/ownership/{id}/accept': | 1431 | '/videos/ownership/{id}/accept': |
1123 | post: | 1432 | post: |
1124 | summary: Accept ownership change request | 1433 | summary: Accept ownership change request |
@@ -1135,6 +1444,7 @@ paths: | |||
1135 | description: cannot terminate an ownership change of another user | 1444 | description: cannot terminate an ownership change of another user |
1136 | '404': | 1445 | '404': |
1137 | description: video owneship change not found | 1446 | description: video owneship change not found |
1447 | |||
1138 | '/videos/ownership/{id}/refuse': | 1448 | '/videos/ownership/{id}/refuse': |
1139 | post: | 1449 | post: |
1140 | summary: Refuse ownership change request | 1450 | summary: Refuse ownership change request |
@@ -1151,6 +1461,7 @@ paths: | |||
1151 | description: cannot terminate an ownership change of another user | 1461 | description: cannot terminate an ownership change of another user |
1152 | '404': | 1462 | '404': |
1153 | description: video owneship change not found | 1463 | description: video owneship change not found |
1464 | |||
1154 | '/videos/{id}/give-ownership': | 1465 | '/videos/{id}/give-ownership': |
1155 | post: | 1466 | post: |
1156 | summary: Request ownership change | 1467 | summary: Request ownership change |
@@ -1178,9 +1489,11 @@ paths: | |||
1178 | description: changing video ownership to a remote account is not supported yet | 1489 | description: changing video ownership to a remote account is not supported yet |
1179 | '404': | 1490 | '404': |
1180 | description: video not found | 1491 | description: video not found |
1492 | |||
1181 | /videos: | 1493 | /videos: |
1182 | get: | 1494 | get: |
1183 | summary: List videos | 1495 | summary: List videos |
1496 | operationId: getVideos | ||
1184 | tags: | 1497 | tags: |
1185 | - Video | 1498 | - Video |
1186 | parameters: | 1499 | parameters: |
@@ -1203,6 +1516,7 @@ paths: | |||
1203 | application/json: | 1516 | application/json: |
1204 | schema: | 1517 | schema: |
1205 | $ref: '#/components/schemas/VideoListResponse' | 1518 | $ref: '#/components/schemas/VideoListResponse' |
1519 | |||
1206 | /videos/categories: | 1520 | /videos/categories: |
1207 | get: | 1521 | get: |
1208 | summary: List available video categories | 1522 | summary: List available video categories |
@@ -1221,6 +1535,7 @@ paths: | |||
1221 | examples: | 1535 | examples: |
1222 | nightly: | 1536 | nightly: |
1223 | externalValue: https://peertube2.cpy.re/api/v1/videos/categories | 1537 | externalValue: https://peertube2.cpy.re/api/v1/videos/categories |
1538 | |||
1224 | /videos/licences: | 1539 | /videos/licences: |
1225 | get: | 1540 | get: |
1226 | summary: List available video licences | 1541 | summary: List available video licences |
@@ -1239,6 +1554,7 @@ paths: | |||
1239 | examples: | 1554 | examples: |
1240 | nightly: | 1555 | nightly: |
1241 | externalValue: https://peertube2.cpy.re/api/v1/videos/licences | 1556 | externalValue: https://peertube2.cpy.re/api/v1/videos/licences |
1557 | |||
1242 | /videos/languages: | 1558 | /videos/languages: |
1243 | get: | 1559 | get: |
1244 | summary: List available video languages | 1560 | summary: List available video languages |
@@ -1257,6 +1573,7 @@ paths: | |||
1257 | examples: | 1573 | examples: |
1258 | nightly: | 1574 | nightly: |
1259 | externalValue: https://peertube2.cpy.re/api/v1/videos/languages | 1575 | externalValue: https://peertube2.cpy.re/api/v1/videos/languages |
1576 | |||
1260 | /videos/privacies: | 1577 | /videos/privacies: |
1261 | get: | 1578 | get: |
1262 | summary: List available video privacy policies | 1579 | summary: List available video privacy policies |
@@ -1275,9 +1592,11 @@ paths: | |||
1275 | examples: | 1592 | examples: |
1276 | nightly: | 1593 | nightly: |
1277 | externalValue: https://peertube2.cpy.re/api/v1/videos/privacies | 1594 | externalValue: https://peertube2.cpy.re/api/v1/videos/privacies |
1595 | |||
1278 | '/videos/{id}': | 1596 | '/videos/{id}': |
1279 | put: | 1597 | put: |
1280 | summary: Update a video | 1598 | summary: Update a video |
1599 | operationId: putVideo | ||
1281 | security: | 1600 | security: |
1282 | - OAuth2: [] | 1601 | - OAuth2: [] |
1283 | tags: | 1602 | tags: |
@@ -1317,7 +1636,7 @@ paths: | |||
1317 | type: string | 1636 | type: string |
1318 | support: | 1637 | support: |
1319 | description: A text tell the audience how to support the video creator | 1638 | description: A text tell the audience how to support the video creator |
1320 | example: Please support my work on <insert crowdfunding plateform>! <3 | 1639 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
1321 | type: string | 1640 | type: string |
1322 | nsfw: | 1641 | nsfw: |
1323 | description: Whether or not this video contains sensitive content | 1642 | description: Whether or not this video contains sensitive content |
@@ -1352,6 +1671,7 @@ paths: | |||
1352 | contentType: image/jpeg | 1671 | contentType: image/jpeg |
1353 | get: | 1672 | get: |
1354 | summary: Get a video | 1673 | summary: Get a video |
1674 | operationId: getVideo | ||
1355 | tags: | 1675 | tags: |
1356 | - Video | 1676 | - Video |
1357 | parameters: | 1677 | parameters: |
@@ -1365,6 +1685,7 @@ paths: | |||
1365 | $ref: '#/components/schemas/VideoDetails' | 1685 | $ref: '#/components/schemas/VideoDetails' |
1366 | delete: | 1686 | delete: |
1367 | summary: Delete a video | 1687 | summary: Delete a video |
1688 | operationId: delVideo | ||
1368 | security: | 1689 | security: |
1369 | - OAuth2: [] | 1690 | - OAuth2: [] |
1370 | tags: | 1691 | tags: |
@@ -1374,9 +1695,11 @@ paths: | |||
1374 | responses: | 1695 | responses: |
1375 | '204': | 1696 | '204': |
1376 | description: successful operation | 1697 | description: successful operation |
1698 | |||
1377 | '/videos/{id}/description': | 1699 | '/videos/{id}/description': |
1378 | get: | 1700 | get: |
1379 | summary: Get complete video description | 1701 | summary: Get complete video description |
1702 | operationId: getVideoDesc | ||
1380 | tags: | 1703 | tags: |
1381 | - Video | 1704 | - Video |
1382 | parameters: | 1705 | parameters: |
@@ -1393,6 +1716,7 @@ paths: | |||
1393 | maxLength: 10000 | 1716 | maxLength: 10000 |
1394 | example: | | 1717 | 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)** | 1718 | **[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)** |
1719 | |||
1396 | '/videos/{id}/views': | 1720 | '/videos/{id}/views': |
1397 | post: | 1721 | post: |
1398 | summary: Add a view to a video | 1722 | summary: Add a view to a video |
@@ -1403,6 +1727,7 @@ paths: | |||
1403 | responses: | 1727 | responses: |
1404 | '204': | 1728 | '204': |
1405 | description: successful operation | 1729 | description: successful operation |
1730 | |||
1406 | '/videos/{id}/watching': | 1731 | '/videos/{id}/watching': |
1407 | put: | 1732 | put: |
1408 | summary: Set watching progress of a video | 1733 | summary: Set watching progress of a video |
@@ -1421,6 +1746,7 @@ paths: | |||
1421 | responses: | 1746 | responses: |
1422 | '204': | 1747 | '204': |
1423 | description: successful operation | 1748 | description: successful operation |
1749 | |||
1424 | /videos/upload: | 1750 | /videos/upload: |
1425 | post: | 1751 | post: |
1426 | summary: Upload a video | 1752 | summary: Upload a video |
@@ -1477,26 +1803,27 @@ paths: | |||
1477 | FILE_PATH="<your_file_path>" | 1803 | FILE_PATH="<your_file_path>" |
1478 | CHANNEL_ID="<your_channel_id>" | 1804 | CHANNEL_ID="<your_channel_id>" |
1479 | NAME="<video_name>" | 1805 | NAME="<video_name>" |
1806 | API="https://peertube2.cpy.re/api/v1" | ||
1480 | 1807 | ||
1481 | API_PATH="https://peertube2.cpy.re/api/v1" | ||
1482 | ## AUTH | 1808 | ## AUTH |
1483 | client_id=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_id") | 1809 | 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") | 1810 | client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret") |
1485 | token=$(curl -s "$API_PATH/users/token" \ | 1811 | token=$(curl -s "$API/users/token" \ |
1486 | --data client_id="$client_id" \ | 1812 | --data client_id="$client_id" \ |
1487 | --data client_secret="$client_secret" \ | 1813 | --data client_secret="$client_secret" \ |
1488 | --data grant_type=password \ | 1814 | --data grant_type=password \ |
1489 | --data response_type=code \ | ||
1490 | --data username="$USERNAME" \ | 1815 | --data username="$USERNAME" \ |
1491 | --data password="$PASSWORD" \ | 1816 | --data password="$PASSWORD" \ |
1492 | | jq -r ".access_token") | 1817 | | jq -r ".access_token") |
1818 | |||
1493 | ## VIDEO UPLOAD | 1819 | ## VIDEO UPLOAD |
1494 | curl -s "$API_PATH/videos/upload" \ | 1820 | curl -s "$API/videos/upload" \ |
1495 | -H "Authorization: Bearer $token" \ | 1821 | -H "Authorization: Bearer $token" \ |
1496 | --max-time 600 \ | 1822 | --max-time 600 \ |
1497 | --form videofile=@"$FILE_PATH" \ | 1823 | --form videofile=@"$FILE_PATH" \ |
1498 | --form channelId=$CHANNEL_ID \ | 1824 | --form channelId=$CHANNEL_ID \ |
1499 | --form name="$NAME" | 1825 | --form name="$NAME" |
1826 | |||
1500 | /videos/upload-resumable: | 1827 | /videos/upload-resumable: |
1501 | post: | 1828 | post: |
1502 | summary: Initialize the resumable upload of a video | 1829 | summary: Initialize the resumable upload of a video |
@@ -1658,6 +1985,7 @@ paths: | |||
1658 | schema: | 1985 | schema: |
1659 | type: number | 1986 | type: number |
1660 | example: 0 | 1987 | example: 0 |
1988 | |||
1661 | /videos/imports: | 1989 | /videos/imports: |
1662 | post: | 1990 | post: |
1663 | summary: Import a video | 1991 | summary: Import a video |
@@ -1672,74 +2000,7 @@ paths: | |||
1672 | content: | 2000 | content: |
1673 | multipart/form-data: | 2001 | multipart/form-data: |
1674 | schema: | 2002 | schema: |
1675 | type: object | 2003 | $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: | 2004 | encoding: |
1744 | torrentfile: | 2005 | torrentfile: |
1745 | contentType: application/x-bittorrent | 2006 | contentType: application/x-bittorrent |
@@ -1764,7 +2025,7 @@ paths: | |||
1764 | /videos/live: | 2025 | /videos/live: |
1765 | post: | 2026 | post: |
1766 | summary: Create a live | 2027 | summary: Create a live |
1767 | operationId: createLive | 2028 | operationId: addLive |
1768 | security: | 2029 | security: |
1769 | - OAuth2: [] | 2030 | - OAuth2: [] |
1770 | tags: | 2031 | tags: |
@@ -1814,7 +2075,7 @@ paths: | |||
1814 | type: string | 2075 | type: string |
1815 | support: | 2076 | support: |
1816 | description: A text tell the audience how to support the creator | 2077 | description: A text tell the audience how to support the creator |
1817 | example: Please support my work on <insert crowdfunding plateform>! <3 | 2078 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
1818 | type: string | 2079 | type: string |
1819 | nsfw: | 2080 | nsfw: |
1820 | description: Whether or not this live video/replay contains sensitive content | 2081 | description: Whether or not this live video/replay contains sensitive content |
@@ -2012,7 +2273,6 @@ paths: | |||
2012 | type: array | 2273 | type: array |
2013 | items: | 2274 | items: |
2014 | $ref: '#/components/schemas/Abuse' | 2275 | $ref: '#/components/schemas/Abuse' |
2015 | |||
2016 | post: | 2276 | post: |
2017 | summary: Report an abuse | 2277 | summary: Report an abuse |
2018 | security: | 2278 | security: |
@@ -2042,10 +2302,12 @@ paths: | |||
2042 | - $ref: '#/components/schemas/Video/properties/id' | 2302 | - $ref: '#/components/schemas/Video/properties/id' |
2043 | startAt: | 2303 | startAt: |
2044 | type: integer | 2304 | type: integer |
2305 | format: seconds | ||
2045 | description: Timestamp in the video that marks the beginning of the report | 2306 | description: Timestamp in the video that marks the beginning of the report |
2046 | minimum: 0 | 2307 | minimum: 0 |
2047 | endAt: | 2308 | endAt: |
2048 | type: integer | 2309 | type: integer |
2310 | format: seconds | ||
2049 | description: Timestamp in the video that marks the ending of the report | 2311 | description: Timestamp in the video that marks the ending of the report |
2050 | minimum: 0 | 2312 | minimum: 0 |
2051 | comment: | 2313 | comment: |
@@ -2064,10 +2326,21 @@ paths: | |||
2064 | required: | 2326 | required: |
2065 | - reason | 2327 | - reason |
2066 | responses: | 2328 | responses: |
2067 | '204': | 2329 | '200': |
2068 | description: successful operation | 2330 | description: successful operation |
2331 | content: | ||
2332 | application/json: | ||
2333 | schema: | ||
2334 | type: object | ||
2335 | properties: | ||
2336 | abuse: | ||
2337 | type: object | ||
2338 | properties: | ||
2339 | id: | ||
2340 | $ref: '#/components/schemas/id' | ||
2069 | '400': | 2341 | '400': |
2070 | description: incorrect request parameters | 2342 | description: incorrect request parameters |
2343 | |||
2071 | '/abuses/{abuseId}': | 2344 | '/abuses/{abuseId}': |
2072 | put: | 2345 | put: |
2073 | summary: Update an abuse | 2346 | summary: Update an abuse |
@@ -2112,6 +2385,7 @@ paths: | |||
2112 | description: successful operation | 2385 | description: successful operation |
2113 | '404': | 2386 | '404': |
2114 | description: block not found | 2387 | description: block not found |
2388 | |||
2115 | '/abuses/{abuseId}/messages': | 2389 | '/abuses/{abuseId}/messages': |
2116 | get: | 2390 | get: |
2117 | summary: List messages of an abuse | 2391 | summary: List messages of an abuse |
@@ -2127,10 +2401,15 @@ paths: | |||
2127 | content: | 2401 | content: |
2128 | application/json: | 2402 | application/json: |
2129 | schema: | 2403 | schema: |
2130 | type: array | 2404 | type: object |
2131 | items: | 2405 | properties: |
2132 | $ref: '#/components/schemas/AbuseMessage' | 2406 | total: |
2133 | 2407 | type: integer | |
2408 | example: 1 | ||
2409 | data: | ||
2410 | type: array | ||
2411 | items: | ||
2412 | $ref: '#/components/schemas/AbuseMessage' | ||
2134 | post: | 2413 | post: |
2135 | summary: Add message to an abuse | 2414 | summary: Add message to an abuse |
2136 | security: | 2415 | security: |
@@ -2158,6 +2437,7 @@ paths: | |||
2158 | description: successful operation | 2437 | description: successful operation |
2159 | '400': | 2438 | '400': |
2160 | description: incorrect request parameters | 2439 | description: incorrect request parameters |
2440 | |||
2161 | '/abuses/{abuseId}/messages/{abuseMessageId}': | 2441 | '/abuses/{abuseId}/messages/{abuseMessageId}': |
2162 | delete: | 2442 | delete: |
2163 | summary: Delete an abuse message | 2443 | summary: Delete an abuse message |
@@ -2175,6 +2455,7 @@ paths: | |||
2175 | '/videos/{id}/blacklist': | 2455 | '/videos/{id}/blacklist': |
2176 | post: | 2456 | post: |
2177 | summary: Block a video | 2457 | summary: Block a video |
2458 | operationId: addVideoBlock | ||
2178 | security: | 2459 | security: |
2179 | - OAuth2: | 2460 | - OAuth2: |
2180 | - admin | 2461 | - admin |
@@ -2188,6 +2469,7 @@ paths: | |||
2188 | description: successful operation | 2469 | description: successful operation |
2189 | delete: | 2470 | delete: |
2190 | summary: Unblock a video by its id | 2471 | summary: Unblock a video by its id |
2472 | operationId: delVideoBlock | ||
2191 | security: | 2473 | security: |
2192 | - OAuth2: | 2474 | - OAuth2: |
2193 | - admin | 2475 | - admin |
@@ -2201,11 +2483,13 @@ paths: | |||
2201 | description: successful operation | 2483 | description: successful operation |
2202 | '404': | 2484 | '404': |
2203 | description: block not found | 2485 | description: block not found |
2486 | |||
2204 | /videos/blacklist: | 2487 | /videos/blacklist: |
2205 | get: | 2488 | get: |
2206 | tags: | 2489 | tags: |
2207 | - Video Blocks | 2490 | - Video Blocks |
2208 | summary: List video blocks | 2491 | summary: List video blocks |
2492 | operationId: getVideoBlocks | ||
2209 | security: | 2493 | security: |
2210 | - OAuth2: | 2494 | - OAuth2: |
2211 | - admin | 2495 | - admin |
@@ -2247,9 +2531,11 @@ paths: | |||
2247 | type: array | 2531 | type: array |
2248 | items: | 2532 | items: |
2249 | $ref: '#/components/schemas/VideoBlacklist' | 2533 | $ref: '#/components/schemas/VideoBlacklist' |
2534 | |||
2250 | /videos/{id}/captions: | 2535 | /videos/{id}/captions: |
2251 | get: | 2536 | get: |
2252 | summary: List captions of a video | 2537 | summary: List captions of a video |
2538 | operationId: getVideoCaptions | ||
2253 | tags: | 2539 | tags: |
2254 | - Video Captions | 2540 | - Video Captions |
2255 | parameters: | 2541 | parameters: |
@@ -2269,9 +2555,11 @@ paths: | |||
2269 | type: array | 2555 | type: array |
2270 | items: | 2556 | items: |
2271 | $ref: '#/components/schemas/VideoCaption' | 2557 | $ref: '#/components/schemas/VideoCaption' |
2558 | |||
2272 | /videos/{id}/captions/{captionLanguage}: | 2559 | /videos/{id}/captions/{captionLanguage}: |
2273 | put: | 2560 | put: |
2274 | summary: Add or replace a video caption | 2561 | summary: Add or replace a video caption |
2562 | operationId: addVideoCaption | ||
2275 | security: | 2563 | security: |
2276 | - OAuth2: | 2564 | - OAuth2: |
2277 | - user | 2565 | - user |
@@ -2300,6 +2588,7 @@ paths: | |||
2300 | description: video or language not found | 2588 | description: video or language not found |
2301 | delete: | 2589 | delete: |
2302 | summary: Delete a video caption | 2590 | summary: Delete a video caption |
2591 | operationId: delVideoCaption | ||
2303 | security: | 2592 | security: |
2304 | - OAuth2: | 2593 | - OAuth2: |
2305 | - user | 2594 | - user |
@@ -2313,9 +2602,11 @@ paths: | |||
2313 | description: successful operation | 2602 | description: successful operation |
2314 | '404': | 2603 | '404': |
2315 | description: video or language or caption for that language not found | 2604 | description: video or language or caption for that language not found |
2605 | |||
2316 | /video-channels: | 2606 | /video-channels: |
2317 | get: | 2607 | get: |
2318 | summary: List video channels | 2608 | summary: List video channels |
2609 | operationId: getVideoChannels | ||
2319 | tags: | 2610 | tags: |
2320 | - Video Channels | 2611 | - Video Channels |
2321 | parameters: | 2612 | parameters: |
@@ -2331,6 +2622,7 @@ paths: | |||
2331 | $ref: '#/components/schemas/VideoChannelList' | 2622 | $ref: '#/components/schemas/VideoChannelList' |
2332 | post: | 2623 | post: |
2333 | summary: Create a video channel | 2624 | summary: Create a video channel |
2625 | operationId: addVideoChannel | ||
2334 | security: | 2626 | security: |
2335 | - OAuth2: [] | 2627 | - OAuth2: [] |
2336 | tags: | 2628 | tags: |
@@ -2338,14 +2630,26 @@ paths: | |||
2338 | responses: | 2630 | responses: |
2339 | '204': | 2631 | '204': |
2340 | description: successful operation | 2632 | description: successful operation |
2633 | content: | ||
2634 | application/json: | ||
2635 | schema: | ||
2636 | type: object | ||
2637 | properties: | ||
2638 | videoChannel: | ||
2639 | type: object | ||
2640 | properties: | ||
2641 | id: | ||
2642 | $ref: '#/components/schemas/VideoChannel/properties/id' | ||
2341 | requestBody: | 2643 | requestBody: |
2342 | content: | 2644 | content: |
2343 | application/json: | 2645 | application/json: |
2344 | schema: | 2646 | schema: |
2345 | $ref: '#/components/schemas/VideoChannelCreate' | 2647 | $ref: '#/components/schemas/VideoChannelCreate' |
2648 | |||
2346 | '/video-channels/{channelHandle}': | 2649 | '/video-channels/{channelHandle}': |
2347 | get: | 2650 | get: |
2348 | summary: Get a video channel | 2651 | summary: Get a video channel |
2652 | operationId: getVideoChannel | ||
2349 | tags: | 2653 | tags: |
2350 | - Video Channels | 2654 | - Video Channels |
2351 | parameters: | 2655 | parameters: |
@@ -2359,6 +2663,7 @@ paths: | |||
2359 | $ref: '#/components/schemas/VideoChannel' | 2663 | $ref: '#/components/schemas/VideoChannel' |
2360 | put: | 2664 | put: |
2361 | summary: Update a video channel | 2665 | summary: Update a video channel |
2666 | operationId: putVideoChannel | ||
2362 | security: | 2667 | security: |
2363 | - OAuth2: [] | 2668 | - OAuth2: [] |
2364 | tags: | 2669 | tags: |
@@ -2375,6 +2680,7 @@ paths: | |||
2375 | $ref: '#/components/schemas/VideoChannelUpdate' | 2680 | $ref: '#/components/schemas/VideoChannelUpdate' |
2376 | delete: | 2681 | delete: |
2377 | summary: Delete a video channel | 2682 | summary: Delete a video channel |
2683 | operationId: delVideoChannel | ||
2378 | security: | 2684 | security: |
2379 | - OAuth2: [] | 2685 | - OAuth2: [] |
2380 | tags: | 2686 | tags: |
@@ -2384,9 +2690,11 @@ paths: | |||
2384 | responses: | 2690 | responses: |
2385 | '204': | 2691 | '204': |
2386 | description: successful operation | 2692 | description: successful operation |
2693 | |||
2387 | '/video-channels/{channelHandle}/videos': | 2694 | '/video-channels/{channelHandle}/videos': |
2388 | get: | 2695 | get: |
2389 | summary: List videos of a video channel | 2696 | summary: List videos of a video channel |
2697 | operationId: getVideoChannelVideos | ||
2390 | tags: | 2698 | tags: |
2391 | - Video | 2699 | - Video |
2392 | - Video Channels | 2700 | - Video Channels |
@@ -2411,6 +2719,7 @@ paths: | |||
2411 | application/json: | 2719 | application/json: |
2412 | schema: | 2720 | schema: |
2413 | $ref: '#/components/schemas/VideoListResponse' | 2721 | $ref: '#/components/schemas/VideoListResponse' |
2722 | |||
2414 | '/video-channels/{channelHandle}/avatar/pick': | 2723 | '/video-channels/{channelHandle}/avatar/pick': |
2415 | post: | 2724 | post: |
2416 | summary: Update channel avatar | 2725 | summary: Update channel avatar |
@@ -2451,6 +2760,7 @@ paths: | |||
2451 | encoding: | 2760 | encoding: |
2452 | avatarfile: | 2761 | avatarfile: |
2453 | contentType: image/png, image/jpeg | 2762 | contentType: image/png, image/jpeg |
2763 | |||
2454 | '/video-channels/{channelHandle}/avatar': | 2764 | '/video-channels/{channelHandle}/avatar': |
2455 | delete: | 2765 | delete: |
2456 | summary: Delete channel avatar | 2766 | summary: Delete channel avatar |
@@ -2464,7 +2774,6 @@ paths: | |||
2464 | '204': | 2774 | '204': |
2465 | description: successful operation | 2775 | description: successful operation |
2466 | 2776 | ||
2467 | |||
2468 | '/video-channels/{channelHandle}/banner/pick': | 2777 | '/video-channels/{channelHandle}/banner/pick': |
2469 | post: | 2778 | post: |
2470 | summary: Update channel banner | 2779 | summary: Update channel banner |
@@ -2505,6 +2814,7 @@ paths: | |||
2505 | encoding: | 2814 | encoding: |
2506 | bannerfile: | 2815 | bannerfile: |
2507 | contentType: image/png, image/jpeg | 2816 | contentType: image/png, image/jpeg |
2817 | |||
2508 | '/video-channels/{channelHandle}/banner': | 2818 | '/video-channels/{channelHandle}/banner': |
2509 | delete: | 2819 | delete: |
2510 | summary: Delete channel banner | 2820 | summary: Delete channel banner |
@@ -2565,7 +2875,7 @@ paths: | |||
2565 | post: | 2875 | post: |
2566 | summary: Create a video playlist | 2876 | summary: Create a video playlist |
2567 | description: If the video playlist is set as public, `videoChannelId` is mandatory. | 2877 | description: If the video playlist is set as public, `videoChannelId` is mandatory. |
2568 | operationId: createPlaylist | 2878 | operationId: addPlaylist |
2569 | security: | 2879 | security: |
2570 | - OAuth2: [] | 2880 | - OAuth2: [] |
2571 | tags: | 2881 | tags: |
@@ -2617,13 +2927,13 @@ paths: | |||
2617 | thumbnailfile: | 2927 | thumbnailfile: |
2618 | contentType: image/jpeg | 2928 | contentType: image/jpeg |
2619 | 2929 | ||
2620 | /video-playlists/{id}: | 2930 | /video-playlists/{playlistId}: |
2621 | get: | 2931 | get: |
2622 | summary: Get a video playlist | 2932 | summary: Get a video playlist |
2623 | tags: | 2933 | tags: |
2624 | - Video Playlists | 2934 | - Video Playlists |
2625 | parameters: | 2935 | parameters: |
2626 | - $ref: '#/components/parameters/idOrUUID' | 2936 | - $ref: '#/components/parameters/playlistId' |
2627 | responses: | 2937 | responses: |
2628 | '200': | 2938 | '200': |
2629 | description: successful operation | 2939 | description: successful operation |
@@ -2642,7 +2952,7 @@ paths: | |||
2642 | '204': | 2952 | '204': |
2643 | description: successful operation | 2953 | description: successful operation |
2644 | parameters: | 2954 | parameters: |
2645 | - $ref: '#/components/parameters/idOrUUID' | 2955 | - $ref: '#/components/parameters/playlistId' |
2646 | requestBody: | 2956 | requestBody: |
2647 | content: | 2957 | content: |
2648 | multipart/form-data: | 2958 | multipart/form-data: |
@@ -2677,19 +2987,20 @@ paths: | |||
2677 | tags: | 2987 | tags: |
2678 | - Video Playlists | 2988 | - Video Playlists |
2679 | parameters: | 2989 | parameters: |
2680 | - $ref: '#/components/parameters/idOrUUID' | 2990 | - $ref: '#/components/parameters/playlistId' |
2681 | responses: | 2991 | responses: |
2682 | '204': | 2992 | '204': |
2683 | description: successful operation | 2993 | description: successful operation |
2684 | 2994 | ||
2685 | /video-playlists/{id}/videos: | 2995 | /video-playlists/{playlistId}/videos: |
2686 | get: | 2996 | get: |
2687 | summary: 'List videos of a playlist' | 2997 | summary: 'List videos of a playlist' |
2998 | operationId: getVideoPlaylistVideos | ||
2688 | tags: | 2999 | tags: |
2689 | - Videos | 3000 | - Videos |
2690 | - Video Playlists | 3001 | - Video Playlists |
2691 | parameters: | 3002 | parameters: |
2692 | - $ref: '#/components/parameters/idOrUUID' | 3003 | - $ref: '#/components/parameters/playlistId' |
2693 | responses: | 3004 | responses: |
2694 | '200': | 3005 | '200': |
2695 | description: successful operation | 3006 | description: successful operation |
@@ -2698,14 +3009,15 @@ paths: | |||
2698 | schema: | 3009 | schema: |
2699 | $ref: '#/components/schemas/VideoListResponse' | 3010 | $ref: '#/components/schemas/VideoListResponse' |
2700 | post: | 3011 | post: |
2701 | summary: 'Add a video in a playlist' | 3012 | summary: Add a video in a playlist |
3013 | operationId: addVideoPlaylistVideo | ||
2702 | security: | 3014 | security: |
2703 | - OAuth2: [] | 3015 | - OAuth2: [] |
2704 | tags: | 3016 | tags: |
2705 | - Videos | 3017 | - Videos |
2706 | - Video Playlists | 3018 | - Video Playlists |
2707 | parameters: | 3019 | parameters: |
2708 | - $ref: '#/components/parameters/idOrUUID' | 3020 | - $ref: '#/components/parameters/playlistId' |
2709 | responses: | 3021 | responses: |
2710 | '200': | 3022 | '200': |
2711 | description: successful operation | 3023 | description: successful operation |
@@ -2719,6 +3031,7 @@ paths: | |||
2719 | properties: | 3031 | properties: |
2720 | id: | 3032 | id: |
2721 | type: integer | 3033 | type: integer |
3034 | example: 2 | ||
2722 | requestBody: | 3035 | requestBody: |
2723 | content: | 3036 | content: |
2724 | application/json: | 3037 | application/json: |
@@ -2726,27 +3039,31 @@ paths: | |||
2726 | type: object | 3039 | type: object |
2727 | properties: | 3040 | properties: |
2728 | videoId: | 3041 | videoId: |
2729 | allOf: | 3042 | oneOf: |
3043 | - $ref: '#/components/schemas/Video/properties/uuid' | ||
2730 | - $ref: '#/components/schemas/Video/properties/id' | 3044 | - $ref: '#/components/schemas/Video/properties/id' |
2731 | description: Video to add in the playlist | 3045 | description: Video to add in the playlist |
2732 | startTimestamp: | 3046 | startTimestamp: |
2733 | type: integer | 3047 | type: integer |
2734 | description: Start the video at this specific timestamp (in seconds) | 3048 | format: seconds |
3049 | description: Start the video at this specific timestamp | ||
2735 | stopTimestamp: | 3050 | stopTimestamp: |
2736 | type: integer | 3051 | type: integer |
2737 | description: Stop the video at this specific timestamp (in seconds) | 3052 | format: seconds |
3053 | description: Stop the video at this specific timestamp | ||
2738 | required: | 3054 | required: |
2739 | - videoId | 3055 | - videoId |
2740 | 3056 | ||
2741 | /video-playlists/{id}/videos/reorder: | 3057 | /video-playlists/{playlistId}/videos/reorder: |
2742 | post: | 3058 | post: |
2743 | summary: 'Reorder a playlist' | 3059 | summary: 'Reorder a playlist' |
3060 | operationId: reorderVideoPlaylist | ||
2744 | security: | 3061 | security: |
2745 | - OAuth2: [] | 3062 | - OAuth2: [] |
2746 | tags: | 3063 | tags: |
2747 | - Video Playlists | 3064 | - Video Playlists |
2748 | parameters: | 3065 | parameters: |
2749 | - $ref: '#/components/parameters/idOrUUID' | 3066 | - $ref: '#/components/parameters/playlistId' |
2750 | responses: | 3067 | responses: |
2751 | '204': | 3068 | '204': |
2752 | description: successful operation | 3069 | description: successful operation |
@@ -2772,15 +3089,16 @@ paths: | |||
2772 | - startPosition | 3089 | - startPosition |
2773 | - insertAfterPosition | 3090 | - insertAfterPosition |
2774 | 3091 | ||
2775 | /video-playlists/{id}/videos/{playlistElementId}: | 3092 | /video-playlists/{playlistId}/videos/{playlistElementId}: |
2776 | put: | 3093 | put: |
2777 | summary: 'Update a playlist element' | 3094 | summary: Update a playlist element |
3095 | operationId: putVideoPlaylistVideo | ||
2778 | security: | 3096 | security: |
2779 | - OAuth2: [] | 3097 | - OAuth2: [] |
2780 | tags: | 3098 | tags: |
2781 | - Video Playlists | 3099 | - Video Playlists |
2782 | parameters: | 3100 | parameters: |
2783 | - $ref: '#/components/parameters/idOrUUID' | 3101 | - $ref: '#/components/parameters/playlistId' |
2784 | - $ref: '#/components/parameters/playlistElementId' | 3102 | - $ref: '#/components/parameters/playlistElementId' |
2785 | responses: | 3103 | responses: |
2786 | '204': | 3104 | '204': |
@@ -2793,18 +3111,21 @@ paths: | |||
2793 | properties: | 3111 | properties: |
2794 | startTimestamp: | 3112 | startTimestamp: |
2795 | type: integer | 3113 | type: integer |
2796 | description: 'Start the video at this specific timestamp (in seconds)' | 3114 | format: seconds |
3115 | description: Start the video at this specific timestamp | ||
2797 | stopTimestamp: | 3116 | stopTimestamp: |
2798 | type: integer | 3117 | type: integer |
2799 | description: 'Stop the video at this specific timestamp (in seconds)' | 3118 | format: seconds |
3119 | description: Stop the video at this specific timestamp | ||
2800 | delete: | 3120 | delete: |
2801 | summary: 'Delete an element from a playlist' | 3121 | summary: Delete an element from a playlist |
3122 | operationId: delVideoPlaylistVideo | ||
2802 | security: | 3123 | security: |
2803 | - OAuth2: [] | 3124 | - OAuth2: [] |
2804 | tags: | 3125 | tags: |
2805 | - Video Playlists | 3126 | - Video Playlists |
2806 | parameters: | 3127 | parameters: |
2807 | - $ref: '#/components/parameters/idOrUUID' | 3128 | - $ref: '#/components/parameters/playlistId' |
2808 | - $ref: '#/components/parameters/playlistElementId' | 3129 | - $ref: '#/components/parameters/playlistElementId' |
2809 | responses: | 3130 | responses: |
2810 | '204': | 3131 | '204': |
@@ -2812,7 +3133,7 @@ paths: | |||
2812 | 3133 | ||
2813 | '/users/me/video-playlists/videos-exist': | 3134 | '/users/me/video-playlists/videos-exist': |
2814 | get: | 3135 | get: |
2815 | summary: 'Check video exists in my playlists' | 3136 | summary: Check video exists in my playlists |
2816 | security: | 3137 | security: |
2817 | - OAuth2: [] | 3138 | - OAuth2: [] |
2818 | tags: | 3139 | tags: |
@@ -2845,8 +3166,10 @@ paths: | |||
2845 | type: integer | 3166 | type: integer |
2846 | startTimestamp: | 3167 | startTimestamp: |
2847 | type: integer | 3168 | type: integer |
3169 | format: seconds | ||
2848 | stopTimestamp: | 3170 | stopTimestamp: |
2849 | type: integer | 3171 | type: integer |
3172 | format: seconds | ||
2850 | 3173 | ||
2851 | '/accounts/{name}/video-channels': | 3174 | '/accounts/{name}/video-channels': |
2852 | get: | 3175 | get: |
@@ -2871,6 +3194,7 @@ paths: | |||
2871 | application/json: | 3194 | application/json: |
2872 | schema: | 3195 | schema: |
2873 | $ref: '#/components/schemas/VideoChannelList' | 3196 | $ref: '#/components/schemas/VideoChannelList' |
3197 | |||
2874 | '/accounts/{name}/ratings': | 3198 | '/accounts/{name}/ratings': |
2875 | get: | 3199 | get: |
2876 | summary: List ratings of an account | 3200 | summary: List ratings of an account |
@@ -2901,6 +3225,7 @@ paths: | |||
2901 | type: array | 3225 | type: array |
2902 | items: | 3226 | items: |
2903 | $ref: '#/components/schemas/VideoRating' | 3227 | $ref: '#/components/schemas/VideoRating' |
3228 | |||
2904 | '/videos/{id}/comment-threads': | 3229 | '/videos/{id}/comment-threads': |
2905 | get: | 3230 | get: |
2906 | summary: List threads of a video | 3231 | summary: List threads of a video |
@@ -2942,8 +3267,10 @@ paths: | |||
2942 | type: object | 3267 | type: object |
2943 | properties: | 3268 | properties: |
2944 | text: | 3269 | text: |
2945 | type: string | 3270 | allOf: |
2946 | description: 'Text comment' | 3271 | - $ref: '#/components/schemas/VideoComment/properties/text' |
3272 | format: markdown | ||
3273 | maxLength: 10000 | ||
2947 | required: | 3274 | required: |
2948 | - text | 3275 | - text |
2949 | 3276 | ||
@@ -2962,6 +3289,7 @@ paths: | |||
2962 | application/json: | 3289 | application/json: |
2963 | schema: | 3290 | schema: |
2964 | $ref: '#/components/schemas/VideoCommentThreadTree' | 3291 | $ref: '#/components/schemas/VideoCommentThreadTree' |
3292 | |||
2965 | '/videos/{id}/comments/{commentId}': | 3293 | '/videos/{id}/comments/{commentId}': |
2966 | post: | 3294 | post: |
2967 | summary: Reply to a thread of a video | 3295 | summary: Reply to a thread of a video |
@@ -2988,10 +3316,12 @@ paths: | |||
2988 | type: object | 3316 | type: object |
2989 | properties: | 3317 | properties: |
2990 | text: | 3318 | text: |
2991 | $ref: '#/components/schemas/VideoComment/properties/text' | 3319 | allOf: |
3320 | - $ref: '#/components/schemas/VideoComment/properties/text' | ||
3321 | format: markdown | ||
3322 | maxLength: 10000 | ||
2992 | required: | 3323 | required: |
2993 | - text | 3324 | - text |
2994 | |||
2995 | delete: | 3325 | delete: |
2996 | summary: Delete a comment or a reply | 3326 | summary: Delete a comment or a reply |
2997 | security: | 3327 | security: |
@@ -3010,6 +3340,7 @@ paths: | |||
3010 | description: comment or video does not exist | 3340 | description: comment or video does not exist |
3011 | '409': | 3341 | '409': |
3012 | description: comment is already deleted | 3342 | description: comment is already deleted |
3343 | |||
3013 | '/videos/{id}/rate': | 3344 | '/videos/{id}/rate': |
3014 | put: | 3345 | put: |
3015 | summary: Like/dislike a video | 3346 | summary: Like/dislike a video |
@@ -3019,16 +3350,31 @@ paths: | |||
3019 | - Video Rates | 3350 | - Video Rates |
3020 | parameters: | 3351 | parameters: |
3021 | - $ref: '#/components/parameters/idOrUUID' | 3352 | - $ref: '#/components/parameters/idOrUUID' |
3353 | requestBody: | ||
3354 | content: | ||
3355 | application/json: | ||
3356 | schema: | ||
3357 | type: object | ||
3358 | properties: | ||
3359 | rating: | ||
3360 | type: string | ||
3361 | enum: | ||
3362 | - like | ||
3363 | - dislike | ||
3364 | required: | ||
3365 | - rating | ||
3022 | responses: | 3366 | responses: |
3023 | '204': | 3367 | '204': |
3024 | description: successful operation | 3368 | description: successful operation |
3025 | '404': | 3369 | '404': |
3026 | description: video does not exist | 3370 | description: video does not exist |
3371 | |||
3027 | /search/videos: | 3372 | /search/videos: |
3028 | get: | 3373 | get: |
3029 | tags: | 3374 | tags: |
3030 | - Search | 3375 | - Search |
3031 | summary: Search videos | 3376 | summary: Search videos |
3377 | operationId: searchVideos | ||
3032 | parameters: | 3378 | parameters: |
3033 | - name: search | 3379 | - name: search |
3034 | in: query | 3380 | in: query |
@@ -3099,11 +3445,13 @@ paths: | |||
3099 | $ref: '#/components/schemas/VideoListResponse' | 3445 | $ref: '#/components/schemas/VideoListResponse' |
3100 | '500': | 3446 | '500': |
3101 | description: search index unavailable | 3447 | description: search index unavailable |
3448 | |||
3102 | /search/video-channels: | 3449 | /search/video-channels: |
3103 | get: | 3450 | get: |
3104 | tags: | 3451 | tags: |
3105 | - Search | 3452 | - Search |
3106 | summary: Search channels | 3453 | summary: Search channels |
3454 | operationId: searchChannels | ||
3107 | parameters: | 3455 | parameters: |
3108 | - name: search | 3456 | - name: search |
3109 | in: query | 3457 | in: query |
@@ -3130,7 +3478,8 @@ paths: | |||
3130 | $ref: '#/components/schemas/VideoChannelList' | 3478 | $ref: '#/components/schemas/VideoChannelList' |
3131 | '500': | 3479 | '500': |
3132 | description: search index unavailable | 3480 | description: search index unavailable |
3133 | /blocklist/accounts: | 3481 | |
3482 | /server/blocklist/accounts: | ||
3134 | get: | 3483 | get: |
3135 | tags: | 3484 | tags: |
3136 | - Account Blocks | 3485 | - Account Blocks |
@@ -3169,7 +3518,8 @@ paths: | |||
3169 | description: successful operation | 3518 | description: successful operation |
3170 | '409': | 3519 | '409': |
3171 | description: self-blocking forbidden | 3520 | description: self-blocking forbidden |
3172 | '/blocklist/accounts/{accountName}': | 3521 | |
3522 | '/server/blocklist/accounts/{accountName}': | ||
3173 | delete: | 3523 | delete: |
3174 | tags: | 3524 | tags: |
3175 | - Account Blocks | 3525 | - Account Blocks |
@@ -3189,7 +3539,8 @@ paths: | |||
3189 | description: successful operation | 3539 | description: successful operation |
3190 | '404': | 3540 | '404': |
3191 | description: account or account block does not exist | 3541 | description: account or account block does not exist |
3192 | /blocklist/servers: | 3542 | |
3543 | /server/blocklist/servers: | ||
3193 | get: | 3544 | get: |
3194 | tags: | 3545 | tags: |
3195 | - Server Blocks | 3546 | - Server Blocks |
@@ -3224,11 +3575,12 @@ paths: | |||
3224 | required: | 3575 | required: |
3225 | - host | 3576 | - host |
3226 | responses: | 3577 | responses: |
3227 | '200': | 3578 | '204': |
3228 | description: successful operation | 3579 | description: successful operation |
3229 | '409': | 3580 | '409': |
3230 | description: self-blocking forbidden | 3581 | description: self-blocking forbidden |
3231 | '/blocklist/servers/{host}': | 3582 | |
3583 | '/server/blocklist/servers/{host}': | ||
3232 | delete: | 3584 | delete: |
3233 | tags: | 3585 | tags: |
3234 | - Server Blocks | 3586 | - Server Blocks |
@@ -3245,11 +3597,12 @@ paths: | |||
3245 | type: string | 3597 | type: string |
3246 | format: hostname | 3598 | format: hostname |
3247 | responses: | 3599 | responses: |
3248 | '201': | 3600 | '204': |
3249 | description: successful operation | 3601 | description: successful operation |
3250 | '404': | 3602 | '404': |
3251 | description: account block does not exist | 3603 | description: account block does not exist |
3252 | /redundancy/{host}: | 3604 | |
3605 | /server/redundancy/{host}: | ||
3253 | put: | 3606 | put: |
3254 | tags: | 3607 | tags: |
3255 | - Instance Redundancy | 3608 | - Instance Redundancy |
@@ -3281,11 +3634,13 @@ paths: | |||
3281 | description: successful operation | 3634 | description: successful operation |
3282 | '404': | 3635 | '404': |
3283 | description: server is not already known | 3636 | description: server is not already known |
3284 | /redundancy/videos: | 3637 | |
3638 | /server/redundancy/videos: | ||
3285 | get: | 3639 | get: |
3286 | tags: | 3640 | tags: |
3287 | - Video Mirroring | 3641 | - Video Mirroring |
3288 | summary: List videos being mirrored | 3642 | summary: List videos being mirrored |
3643 | operationId: getMirroredVideos | ||
3289 | security: | 3644 | security: |
3290 | - OAuth2: | 3645 | - OAuth2: |
3291 | - admin | 3646 | - admin |
@@ -3315,6 +3670,7 @@ paths: | |||
3315 | tags: | 3670 | tags: |
3316 | - Video Mirroring | 3671 | - Video Mirroring |
3317 | summary: Mirror a video | 3672 | summary: Mirror a video |
3673 | operationId: putMirroredVideo | ||
3318 | security: | 3674 | security: |
3319 | - OAuth2: | 3675 | - OAuth2: |
3320 | - admin | 3676 | - admin |
@@ -3337,11 +3693,13 @@ paths: | |||
3337 | description: video does not exist | 3693 | description: video does not exist |
3338 | '409': | 3694 | '409': |
3339 | description: video is already mirrored | 3695 | description: video is already mirrored |
3340 | /redundancy/videos/{redundancyId}: | 3696 | |
3697 | /server/redundancy/videos/{redundancyId}: | ||
3341 | delete: | 3698 | delete: |
3342 | tags: | 3699 | tags: |
3343 | - Video Mirroring | 3700 | - Video Mirroring |
3344 | summary: Delete a mirror done on a video | 3701 | summary: Delete a mirror done on a video |
3702 | operationId: delMirroredVideo | ||
3345 | security: | 3703 | security: |
3346 | - OAuth2: | 3704 | - OAuth2: |
3347 | - admin | 3705 | - admin |
@@ -3357,11 +3715,13 @@ paths: | |||
3357 | description: successful operation | 3715 | description: successful operation |
3358 | '404': | 3716 | '404': |
3359 | description: video redundancy not found | 3717 | description: video redundancy not found |
3718 | |||
3360 | '/feeds/video-comments.{format}': | 3719 | '/feeds/video-comments.{format}': |
3361 | get: | 3720 | get: |
3362 | tags: | 3721 | tags: |
3363 | - Feeds | 3722 | - Feeds |
3364 | summary: List comments on videos | 3723 | summary: List comments on videos |
3724 | operationId: getSyndicatedComments | ||
3365 | parameters: | 3725 | parameters: |
3366 | - name: format | 3726 | - name: format |
3367 | in: path | 3727 | in: path |
@@ -3450,11 +3810,13 @@ paths: | |||
3450 | description: video, video channel or account not found | 3810 | description: video, video channel or account not found |
3451 | '406': | 3811 | '406': |
3452 | description: accept header unsupported | 3812 | description: accept header unsupported |
3813 | |||
3453 | '/feeds/videos.{format}': | 3814 | '/feeds/videos.{format}': |
3454 | get: | 3815 | get: |
3455 | tags: | 3816 | tags: |
3456 | - Feeds | 3817 | - Feeds |
3457 | summary: List videos | 3818 | summary: List videos |
3819 | operationId: getSyndicatedVideos | ||
3458 | parameters: | 3820 | parameters: |
3459 | - name: format | 3821 | - name: format |
3460 | in: path | 3822 | in: path |
@@ -3536,12 +3898,14 @@ paths: | |||
3536 | description: video channel or account not found | 3898 | description: video channel or account not found |
3537 | '406': | 3899 | '406': |
3538 | description: accept header unsupported | 3900 | description: accept header unsupported |
3901 | |||
3539 | '/feeds/subscriptions.{format}': | 3902 | '/feeds/subscriptions.{format}': |
3540 | get: | 3903 | get: |
3541 | tags: | 3904 | tags: |
3542 | - Feeds | 3905 | - Feeds |
3543 | - Account | 3906 | - Account |
3544 | summary: List videos of subscriptions tied to a token | 3907 | summary: List videos of subscriptions tied to a token |
3908 | operationId: getSyndicatedSubscriptionVideos | ||
3545 | parameters: | 3909 | parameters: |
3546 | - name: format | 3910 | - name: format |
3547 | in: path | 3911 | in: path |
@@ -3598,11 +3962,13 @@ paths: | |||
3598 | type: object | 3962 | type: object |
3599 | '406': | 3963 | '406': |
3600 | description: accept header unsupported | 3964 | description: accept header unsupported |
3965 | |||
3601 | /plugins: | 3966 | /plugins: |
3602 | get: | 3967 | get: |
3603 | tags: | 3968 | tags: |
3604 | - Plugins | 3969 | - Plugins |
3605 | summary: List plugins | 3970 | summary: List plugins |
3971 | operationId: getPlugins | ||
3606 | security: | 3972 | security: |
3607 | - OAuth2: | 3973 | - OAuth2: |
3608 | - admin | 3974 | - admin |
@@ -3625,11 +3991,13 @@ paths: | |||
3625 | application/json: | 3991 | application/json: |
3626 | schema: | 3992 | schema: |
3627 | $ref: '#/components/schemas/PluginResponse' | 3993 | $ref: '#/components/schemas/PluginResponse' |
3994 | |||
3628 | /plugins/available: | 3995 | /plugins/available: |
3629 | get: | 3996 | get: |
3630 | tags: | 3997 | tags: |
3631 | - Plugins | 3998 | - Plugins |
3632 | summary: List available plugins | 3999 | summary: List available plugins |
4000 | operationId: getAvailablePlugins | ||
3633 | security: | 4001 | security: |
3634 | - OAuth2: | 4002 | - OAuth2: |
3635 | - admin | 4003 | - admin |
@@ -3658,11 +4026,13 @@ paths: | |||
3658 | $ref: '#/components/schemas/PluginResponse' | 4026 | $ref: '#/components/schemas/PluginResponse' |
3659 | '503': | 4027 | '503': |
3660 | description: plugin index unavailable | 4028 | description: plugin index unavailable |
4029 | |||
3661 | /plugins/install: | 4030 | /plugins/install: |
3662 | post: | 4031 | post: |
3663 | tags: | 4032 | tags: |
3664 | - Plugins | 4033 | - Plugins |
3665 | summary: Install a plugin | 4034 | summary: Install a plugin |
4035 | operationId: addPlugin | ||
3666 | security: | 4036 | security: |
3667 | - OAuth2: | 4037 | - OAuth2: |
3668 | - admin | 4038 | - admin |
@@ -3691,11 +4061,13 @@ paths: | |||
3691 | description: successful operation | 4061 | description: successful operation |
3692 | '400': | 4062 | '400': |
3693 | description: should have either `npmName` or `path` set | 4063 | description: should have either `npmName` or `path` set |
4064 | |||
3694 | /plugins/update: | 4065 | /plugins/update: |
3695 | post: | 4066 | post: |
3696 | tags: | 4067 | tags: |
3697 | - Plugins | 4068 | - Plugins |
3698 | summary: Update a plugin | 4069 | summary: Update a plugin |
4070 | operationId: updatePlugin | ||
3699 | security: | 4071 | security: |
3700 | - OAuth2: | 4072 | - OAuth2: |
3701 | - admin | 4073 | - admin |
@@ -3726,11 +4098,13 @@ paths: | |||
3726 | description: should have either `npmName` or `path` set | 4098 | description: should have either `npmName` or `path` set |
3727 | '404': | 4099 | '404': |
3728 | description: existing plugin not found | 4100 | description: existing plugin not found |
4101 | |||
3729 | /plugins/uninstall: | 4102 | /plugins/uninstall: |
3730 | post: | 4103 | post: |
3731 | tags: | 4104 | tags: |
3732 | - Plugins | 4105 | - Plugins |
3733 | summary: Uninstall a plugin | 4106 | summary: Uninstall a plugin |
4107 | operationId: uninstallPlugin | ||
3734 | security: | 4108 | security: |
3735 | - OAuth2: | 4109 | - OAuth2: |
3736 | - admin | 4110 | - admin |
@@ -3751,11 +4125,13 @@ paths: | |||
3751 | description: successful operation | 4125 | description: successful operation |
3752 | '404': | 4126 | '404': |
3753 | description: existing plugin not found | 4127 | description: existing plugin not found |
4128 | |||
3754 | /plugins/{npmName}: | 4129 | /plugins/{npmName}: |
3755 | get: | 4130 | get: |
3756 | tags: | 4131 | tags: |
3757 | - Plugins | 4132 | - Plugins |
3758 | summary: Get a plugin | 4133 | summary: Get a plugin |
4134 | operationId: getPlugin | ||
3759 | security: | 4135 | security: |
3760 | - OAuth2: | 4136 | - OAuth2: |
3761 | - admin | 4137 | - admin |
@@ -3770,6 +4146,7 @@ paths: | |||
3770 | $ref: '#/components/schemas/Plugin' | 4146 | $ref: '#/components/schemas/Plugin' |
3771 | '404': | 4147 | '404': |
3772 | description: plugin not found | 4148 | description: plugin not found |
4149 | |||
3773 | /plugins/{npmName}/settings: | 4150 | /plugins/{npmName}/settings: |
3774 | put: | 4151 | put: |
3775 | tags: | 4152 | tags: |
@@ -3794,6 +4171,7 @@ paths: | |||
3794 | description: successful operation | 4171 | description: successful operation |
3795 | '404': | 4172 | '404': |
3796 | description: plugin not found | 4173 | description: plugin not found |
4174 | |||
3797 | /plugins/{npmName}/public-settings: | 4175 | /plugins/{npmName}/public-settings: |
3798 | get: | 4176 | get: |
3799 | tags: | 4177 | tags: |
@@ -3811,6 +4189,7 @@ paths: | |||
3811 | additionalProperties: true | 4189 | additionalProperties: true |
3812 | '404': | 4190 | '404': |
3813 | description: plugin not found | 4191 | description: plugin not found |
4192 | |||
3814 | /plugins/{npmName}/registered-settings: | 4193 | /plugins/{npmName}/registered-settings: |
3815 | get: | 4194 | get: |
3816 | tags: | 4195 | tags: |
@@ -3831,6 +4210,7 @@ paths: | |||
3831 | additionalProperties: true | 4210 | additionalProperties: true |
3832 | '404': | 4211 | '404': |
3833 | description: plugin not found | 4212 | description: plugin not found |
4213 | |||
3834 | servers: | 4214 | servers: |
3835 | - url: 'https://peertube2.cpy.re/api/v1' | 4215 | - url: 'https://peertube2.cpy.re/api/v1' |
3836 | description: Live Test Server (live data - latest nightly version) | 4216 | description: Live Test Server (live data - latest nightly version) |
@@ -4019,6 +4399,13 @@ components: | |||
4019 | oneOf: | 4399 | oneOf: |
4020 | - $ref: '#/components/schemas/id' | 4400 | - $ref: '#/components/schemas/id' |
4021 | - $ref: '#/components/schemas/UUIDv4' | 4401 | - $ref: '#/components/schemas/UUIDv4' |
4402 | playlistId: | ||
4403 | name: playlistId | ||
4404 | in: path | ||
4405 | required: true | ||
4406 | description: Playlist id | ||
4407 | schema: | ||
4408 | $ref: '#/components/schemas/VideoPlaylist/properties/id' | ||
4022 | playlistElementId: | 4409 | playlistElementId: |
4023 | name: playlistElementId | 4410 | name: playlistElementId |
4024 | in: path | 4411 | in: path |
@@ -4069,7 +4456,7 @@ components: | |||
4069 | required: true | 4456 | required: true |
4070 | description: The thread id (root comment id) | 4457 | description: The thread id (root comment id) |
4071 | schema: | 4458 | schema: |
4072 | $ref: '#/components/schemas/VideoCommentThreadTree/properties/comment/properties/id' | 4459 | type: integer |
4073 | commentId: | 4460 | commentId: |
4074 | name: commentId | 4461 | name: commentId |
4075 | in: path | 4462 | in: path |
@@ -4223,22 +4610,42 @@ components: | |||
4223 | - activitypub-refresher | 4610 | - activitypub-refresher |
4224 | - video-redundancy | 4611 | - video-redundancy |
4225 | - video-live-ending | 4612 | - video-live-ending |
4613 | followState: | ||
4614 | name: state | ||
4615 | in: query | ||
4616 | schema: | ||
4617 | type: string | ||
4618 | enum: | ||
4619 | - pending | ||
4620 | - accepted | ||
4621 | actorType: | ||
4622 | name: actorType | ||
4623 | in: query | ||
4624 | schema: | ||
4625 | type: string | ||
4626 | enum: | ||
4627 | - Person | ||
4628 | - Application | ||
4629 | - Group | ||
4630 | - Service | ||
4631 | - Organization | ||
4226 | securitySchemes: | 4632 | securitySchemes: |
4227 | OAuth2: | 4633 | OAuth2: |
4228 | description: | | 4634 | description: | |
4229 | Authenticating via OAuth requires the following steps: | 4635 | Authenticating via OAuth requires the following steps: |
4230 | - Have an activated account | 4636 | - Have an activated account |
4231 | - [Generate](https://docs.joinpeertube.org/api-rest-getting-started) a | 4637 | - [Generate] an access token for that account at `/api/v1/users/token`. |
4232 | Bearer Token for that account at `/api/v1/users/token` | 4638 | - 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 | 4639 | - Profit, depending on the role assigned to the account |
4235 | 4640 | ||
4236 | Note that the __access token is valid for 1 day__ and, and is given | 4641 | Note that the __access token is valid for 1 day__ and is given |
4237 | along with a __refresh token valid for 2 weeks__. | 4642 | along with a __refresh token valid for 2 weeks__. |
4643 | |||
4644 | [Generate]: https://docs.joinpeertube.org/api-rest-getting-started | ||
4238 | type: oauth2 | 4645 | type: oauth2 |
4239 | flows: | 4646 | flows: |
4240 | password: | 4647 | password: |
4241 | tokenUrl: 'https://peertube.example.com/api/v1/users/token' | 4648 | tokenUrl: /api/v1/users/token |
4242 | scopes: | 4649 | scopes: |
4243 | admin: Admin scope | 4650 | admin: Admin scope |
4244 | moderator: Moderator scope | 4651 | moderator: Moderator scope |
@@ -4258,20 +4665,21 @@ components: | |||
4258 | maxLength: 36 | 4665 | maxLength: 36 |
4259 | username: | 4666 | username: |
4260 | type: string | 4667 | type: string |
4261 | description: The username of the user | 4668 | description: immutable name of the user, used to find or mention its actor |
4262 | example: chocobozzz | 4669 | example: chocobozzz |
4263 | pattern: '/^[a-z0-9._]{1,50}$/' | 4670 | pattern: '/^[a-z0-9._]+$/' |
4264 | minLength: 1 | 4671 | minLength: 1 |
4265 | maxLength: 50 | 4672 | maxLength: 50 |
4266 | usernameChannel: | 4673 | usernameChannel: |
4267 | type: string | 4674 | type: string |
4268 | description: The username for the default channel | 4675 | description: immutable name of the channel, used to interact with its actor |
4269 | example: The Capybara Channel | 4676 | example: framasoft_videos |
4270 | pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/' | 4677 | pattern: '/^[a-zA-Z0-9\\-_.:]+$/' |
4678 | minLength: 1 | ||
4679 | maxLength: 50 | ||
4271 | password: | 4680 | password: |
4272 | type: string | 4681 | type: string |
4273 | format: password | 4682 | format: password |
4274 | description: The password of the user | ||
4275 | minLength: 6 | 4683 | minLength: 6 |
4276 | maxLength: 255 | 4684 | maxLength: 255 |
4277 | 4685 | ||
@@ -4483,8 +4891,10 @@ components: | |||
4483 | type: integer | 4891 | type: integer |
4484 | startTimestamp: | 4892 | startTimestamp: |
4485 | type: integer | 4893 | type: integer |
4894 | format: seconds | ||
4486 | stopTimestamp: | 4895 | stopTimestamp: |
4487 | type: integer | 4896 | type: integer |
4897 | format: seconds | ||
4488 | video: | 4898 | video: |
4489 | nullable: true | 4899 | nullable: true |
4490 | allOf: | 4900 | allOf: |
@@ -4633,6 +5043,7 @@ components: | |||
4633 | duration: | 5043 | duration: |
4634 | type: integer | 5044 | type: integer |
4635 | example: 1419 | 5045 | example: 1419 |
5046 | format: seconds | ||
4636 | description: duration of the video in seconds | 5047 | description: duration of the video in seconds |
4637 | isLocal: | 5048 | isLocal: |
4638 | type: boolean | 5049 | type: boolean |
@@ -4701,7 +5112,7 @@ components: | |||
4701 | support: | 5112 | support: |
4702 | type: string | 5113 | type: string |
4703 | description: A text tell the audience how to support the video creator | 5114 | description: A text tell the audience how to support the video creator |
4704 | example: Please support my work on <insert crowdfunding plateform>! <3 | 5115 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
4705 | minLength: 3 | 5116 | minLength: 3 |
4706 | maxLength: 1000 | 5117 | maxLength: 1000 |
4707 | channel: | 5118 | channel: |
@@ -4806,10 +5217,33 @@ components: | |||
4806 | label: | 5217 | label: |
4807 | type: string | 5218 | type: string |
4808 | example: Pending | 5219 | example: Pending |
5220 | VideoCreateImport: | ||
5221 | allOf: | ||
5222 | - type: object | ||
5223 | additionalProperties: false | ||
5224 | oneOf: | ||
5225 | - properties: | ||
5226 | targetUrl: | ||
5227 | $ref: '#/components/schemas/VideoImport/properties/targetUrl' | ||
5228 | required: [targetUrl] | ||
5229 | - properties: | ||
5230 | magnetUri: | ||
5231 | $ref: '#/components/schemas/VideoImport/properties/magnetUri' | ||
5232 | required: [magnetUri] | ||
5233 | - properties: | ||
5234 | torrentfile: | ||
5235 | $ref: '#/components/schemas/VideoImport/properties/torrentfile' | ||
5236 | required: [torrentfile] | ||
5237 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | ||
5238 | required: | ||
5239 | - channelId | ||
5240 | - name | ||
4809 | VideoImport: | 5241 | VideoImport: |
4810 | properties: | 5242 | properties: |
4811 | id: | 5243 | id: |
4812 | $ref: '#/components/schemas/id' | 5244 | readOnly: true |
5245 | allOf: | ||
5246 | - $ref: '#/components/schemas/id' | ||
4813 | targetUrl: | 5247 | targetUrl: |
4814 | type: string | 5248 | type: string |
4815 | format: url | 5249 | format: url |
@@ -4821,19 +5255,31 @@ components: | |||
4821 | description: magnet URI allowing to resolve the import's source video | 5255 | 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 | 5256 | 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 | 5257 | pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i |
5258 | torrentfile: | ||
5259 | writeOnly: true | ||
5260 | type: string | ||
5261 | format: binary | ||
5262 | description: Torrent file containing only the video file | ||
4824 | torrentName: | 5263 | torrentName: |
5264 | readOnly: true | ||
4825 | type: string | 5265 | type: string |
4826 | state: | 5266 | state: |
4827 | $ref: '#/components/schemas/VideoImportStateConstant' | 5267 | readOnly: true |
5268 | allOf: | ||
5269 | - $ref: '#/components/schemas/VideoImportStateConstant' | ||
4828 | error: | 5270 | error: |
5271 | readOnly: true | ||
4829 | type: string | 5272 | type: string |
4830 | createdAt: | 5273 | createdAt: |
5274 | readOnly: true | ||
4831 | type: string | 5275 | type: string |
4832 | format: date-time | 5276 | format: date-time |
4833 | updatedAt: | 5277 | updatedAt: |
5278 | readOnly: true | ||
4834 | type: string | 5279 | type: string |
4835 | format: date-time | 5280 | format: date-time |
4836 | video: | 5281 | video: |
5282 | readOnly: true | ||
4837 | nullable: true | 5283 | nullable: true |
4838 | allOf: | 5284 | allOf: |
4839 | - $ref: '#/components/schemas/Video' | 5285 | - $ref: '#/components/schemas/Video' |
@@ -4963,13 +5409,16 @@ components: | |||
4963 | format: url | 5409 | format: url |
4964 | text: | 5410 | text: |
4965 | type: string | 5411 | type: string |
4966 | description: Text of the comment in Markdown | 5412 | format: html |
5413 | description: Text of the comment | ||
4967 | minLength: 1 | 5414 | minLength: 1 |
4968 | maxLength: 10000 | 5415 | example: This video is wonderful! |
4969 | threadId: | 5416 | threadId: |
4970 | type: integer | ||
4971 | inReplyToCommentId: | ||
4972 | $ref: '#/components/schemas/id' | 5417 | $ref: '#/components/schemas/id' |
5418 | inReplyToCommentId: | ||
5419 | nullable: true | ||
5420 | allOf: | ||
5421 | - $ref: '#/components/schemas/id' | ||
4973 | videoId: | 5422 | videoId: |
4974 | $ref: '#/components/schemas/Video/properties/id' | 5423 | $ref: '#/components/schemas/Video/properties/id' |
4975 | createdAt: | 5424 | createdAt: |
@@ -4978,6 +5427,14 @@ components: | |||
4978 | updatedAt: | 5427 | updatedAt: |
4979 | type: string | 5428 | type: string |
4980 | format: date-time | 5429 | format: date-time |
5430 | deletedAt: | ||
5431 | nullable: true | ||
5432 | type: string | ||
5433 | format: date-time | ||
5434 | default: null | ||
5435 | isDeleted: | ||
5436 | type: boolean | ||
5437 | default: false | ||
4981 | totalRepliesFromVideoAuthor: | 5438 | totalRepliesFromVideoAuthor: |
4982 | type: integer | 5439 | type: integer |
4983 | minimum: 0 | 5440 | minimum: 0 |
@@ -5035,7 +5492,7 @@ components: | |||
5035 | type: string | 5492 | type: string |
5036 | format: url | 5493 | format: url |
5037 | name: | 5494 | name: |
5038 | description: immutable name of the actor | 5495 | description: immutable name of the actor, used to find or mention it |
5039 | allOf: | 5496 | allOf: |
5040 | - $ref: '#/components/schemas/username' | 5497 | - $ref: '#/components/schemas/username' |
5041 | host: | 5498 | host: |
@@ -5071,7 +5528,9 @@ components: | |||
5071 | - $ref: '#/components/schemas/User/properties/id' | 5528 | - $ref: '#/components/schemas/User/properties/id' |
5072 | displayName: | 5529 | displayName: |
5073 | type: string | 5530 | type: string |
5074 | description: name displayed on the account's profile | 5531 | description: editable name of the account, displayed in its representations |
5532 | minLength: 3 | ||
5533 | maxLength: 120 | ||
5075 | description: | 5534 | description: |
5076 | type: string | 5535 | type: string |
5077 | description: text or bio displayed on the account's profile | 5536 | description: text or bio displayed on the account's profile |
@@ -5079,6 +5538,7 @@ components: | |||
5079 | properties: | 5538 | properties: |
5080 | currentTime: | 5539 | currentTime: |
5081 | type: integer | 5540 | type: integer |
5541 | format: seconds | ||
5082 | description: timestamp within the video, in seconds | 5542 | description: timestamp within the video, in seconds |
5083 | example: 5 | 5543 | example: 5 |
5084 | ServerConfig: | 5544 | ServerConfig: |
@@ -5593,7 +6053,7 @@ components: | |||
5593 | type: boolean | 6053 | type: boolean |
5594 | support: | 6054 | support: |
5595 | description: A text tell the audience how to support the video creator | 6055 | description: A text tell the audience how to support the video creator |
5596 | example: Please support my work on <insert crowdfunding plateform>! <3 | 6056 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
5597 | type: string | 6057 | type: string |
5598 | nsfw: | 6058 | nsfw: |
5599 | description: Whether or not this video contains sensitive content | 6059 | description: Whether or not this video contains sensitive content |
@@ -5775,7 +6235,7 @@ components: | |||
5775 | # optionally present fields: they require WITH_STATS scope | 6235 | # optionally present fields: they require WITH_STATS scope |
5776 | videosCount: | 6236 | videosCount: |
5777 | type: integer | 6237 | type: integer |
5778 | description: Count of videos published | 6238 | description: Count of videos published |
5779 | abusesCount: | 6239 | abusesCount: |
5780 | type: integer | 6240 | type: integer |
5781 | description: Count of reports/abuses of which the user is a target | 6241 | description: Count of reports/abuses of which the user is a target |
@@ -5822,9 +6282,9 @@ components: | |||
5822 | UpdateUser: | 6282 | UpdateUser: |
5823 | properties: | 6283 | properties: |
5824 | email: | 6284 | email: |
5825 | type: string | ||
5826 | format: email | ||
5827 | description: The updated email of the user | 6285 | description: The updated email of the user |
6286 | allOf: | ||
6287 | - $ref: '#/components/schemas/User/properties/email' | ||
5828 | emailVerified: | 6288 | emailVerified: |
5829 | type: boolean | 6289 | type: boolean |
5830 | description: Set the email as verified | 6290 | description: Set the email as verified |
@@ -5844,28 +6304,54 @@ components: | |||
5844 | adminFlags: | 6304 | adminFlags: |
5845 | $ref: '#/components/schemas/UserAdminFlags' | 6305 | $ref: '#/components/schemas/UserAdminFlags' |
5846 | UpdateMe: | 6306 | UpdateMe: |
6307 | # see shared/models/users/user-update-me.model.ts: | ||
5847 | properties: | 6308 | properties: |
5848 | password: | 6309 | password: |
5849 | $ref: '#/components/schemas/password' | 6310 | $ref: '#/components/schemas/password' |
6311 | currentPassword: | ||
6312 | $ref: '#/components/schemas/password' | ||
5850 | email: | 6313 | email: |
6314 | description: new email used for login and service communications | ||
6315 | allOf: | ||
6316 | - $ref: '#/components/schemas/User/properties/email' | ||
6317 | displayName: | ||
5851 | type: string | 6318 | type: string |
5852 | format: email | 6319 | description: new name of the user in its representations |
5853 | description: Your new email | 6320 | minLength: 3 |
6321 | maxLength: 120 | ||
5854 | displayNSFW: | 6322 | displayNSFW: |
5855 | type: string | 6323 | type: string |
5856 | description: Your new displayNSFW | 6324 | description: new NSFW display policy |
5857 | enum: | 6325 | enum: |
5858 | - 'true' | 6326 | - 'true' |
5859 | - 'false' | 6327 | - 'false' |
5860 | - both | 6328 | - both |
6329 | webTorrentEnabled: | ||
6330 | type: boolean | ||
6331 | description: whether to enable P2P in the player or not | ||
5861 | autoPlayVideo: | 6332 | autoPlayVideo: |
5862 | type: boolean | 6333 | type: boolean |
5863 | description: Your new autoPlayVideo | 6334 | description: new preference regarding playing videos automatically |
5864 | required: | 6335 | autoPlayNextVideo: |
5865 | - password | 6336 | type: boolean |
5866 | 6337 | description: new preference regarding playing following videos automatically | |
5867 | - displayNSFW | 6338 | autoPlayNextVideoPlaylist: |
5868 | - autoPlayVideo | 6339 | type: boolean |
6340 | description: new preference regarding playing following playlist videos automatically | ||
6341 | videosHistoryEnabled: | ||
6342 | type: boolean | ||
6343 | description: whether to keep track of watched history or not | ||
6344 | videoLanguages: | ||
6345 | type: array | ||
6346 | items: | ||
6347 | type: string | ||
6348 | description: list of languages to filter videos down to | ||
6349 | theme: | ||
6350 | type: string | ||
6351 | noInstanceConfigWarningModal: | ||
6352 | type: boolean | ||
6353 | noWelcomeModal: | ||
6354 | type: boolean | ||
5869 | GetMeVideoRating: | 6355 | GetMeVideoRating: |
5870 | properties: | 6356 | properties: |
5871 | id: | 6357 | id: |
@@ -5897,38 +6383,94 @@ components: | |||
5897 | RegisterUser: | 6383 | RegisterUser: |
5898 | properties: | 6384 | properties: |
5899 | username: | 6385 | username: |
5900 | $ref: '#/components/schemas/username' | 6386 | description: immutable name of the user, used to find or mention its actor |
6387 | allOf: | ||
6388 | - $ref: '#/components/schemas/username' | ||
5901 | password: | 6389 | password: |
5902 | $ref: '#/components/schemas/password' | 6390 | $ref: '#/components/schemas/password' |
5903 | email: | 6391 | email: |
5904 | type: string | 6392 | type: string |
5905 | format: email | 6393 | format: email |
5906 | description: The email of the user | 6394 | description: email of the user, used for login or service communications |
5907 | displayName: | 6395 | displayName: |
5908 | type: string | 6396 | type: string |
5909 | description: The user display name | 6397 | description: editable name of the user, displayed in its representations |
5910 | minLength: 1 | 6398 | minLength: 1 |
5911 | maxLength: 120 | 6399 | maxLength: 120 |
5912 | channel: | 6400 | channel: |
5913 | type: object | 6401 | type: object |
6402 | description: channel base information used to create the first channel of the user | ||
5914 | properties: | 6403 | properties: |
5915 | name: | 6404 | name: |
5916 | $ref: '#/components/schemas/usernameChannel' | 6405 | $ref: '#/components/schemas/usernameChannel' |
5917 | displayName: | 6406 | displayName: |
5918 | type: string | 6407 | $ref: '#/components/schemas/VideoChannel/properties/displayName' |
5919 | description: The display name for the default channel | ||
5920 | minLength: 1 | ||
5921 | maxLength: 120 | ||
5922 | required: | 6408 | required: |
5923 | - username | 6409 | - username |
5924 | - password | 6410 | - password |
5925 | 6411 | ||
5926 | 6412 | ||
6413 | OAuthClient: | ||
6414 | properties: | ||
6415 | client_id: | ||
6416 | type: string | ||
6417 | pattern: /^[a-z0-9]$/ | ||
6418 | maxLength: 32 | ||
6419 | minLength: 32 | ||
6420 | example: v1ikx5hnfop4mdpnci8nsqh93c45rldf | ||
6421 | client_secret: | ||
6422 | type: string | ||
6423 | pattern: /^[a-zA-Z0-9]$/ | ||
6424 | maxLength: 32 | ||
6425 | minLength: 32 | ||
6426 | example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt | ||
6427 | OAuthToken-password: | ||
6428 | allOf: | ||
6429 | - $ref: '#/components/schemas/OAuthClient' | ||
6430 | - type: object | ||
6431 | properties: | ||
6432 | grant_type: | ||
6433 | type: string | ||
6434 | enum: | ||
6435 | - password | ||
6436 | - refresh_token | ||
6437 | default: password | ||
6438 | username: | ||
6439 | $ref: '#/components/schemas/User/properties/username' | ||
6440 | password: | ||
6441 | $ref: '#/components/schemas/password' | ||
6442 | required: | ||
6443 | - client_id | ||
6444 | - client_secret | ||
6445 | - grant_type | ||
6446 | - username | ||
6447 | - password | ||
6448 | OAuthToken-refresh_token: | ||
6449 | allOf: | ||
6450 | - $ref: '#/components/schemas/OAuthClient' | ||
6451 | - type: object | ||
6452 | properties: | ||
6453 | grant_type: | ||
6454 | type: string | ||
6455 | enum: | ||
6456 | - password | ||
6457 | - refresh_token | ||
6458 | default: password | ||
6459 | refresh_token: | ||
6460 | type: string | ||
6461 | example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 | ||
6462 | required: | ||
6463 | - client_id | ||
6464 | - client_secret | ||
6465 | - grant_type | ||
6466 | - refresh_token | ||
6467 | |||
5927 | VideoChannel: | 6468 | VideoChannel: |
5928 | properties: | 6469 | properties: |
5929 | # GET/POST/PUT properties | 6470 | # GET/POST/PUT properties |
5930 | displayName: | 6471 | displayName: |
5931 | type: string | 6472 | type: string |
6473 | description: editable name of the channel, displayed in its representations | ||
5932 | example: Videos of Framasoft | 6474 | example: Videos of Framasoft |
5933 | minLength: 1 | 6475 | minLength: 1 |
5934 | maxLength: 120 | 6476 | maxLength: 120 |
@@ -5940,7 +6482,7 @@ components: | |||
5940 | support: | 6482 | support: |
5941 | type: string | 6483 | type: string |
5942 | description: text shown by default on all videos of this channel, to tell the audience how to support it | 6484 | 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 | 6485 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
5944 | minLength: 3 | 6486 | minLength: 3 |
5945 | maxLength: 1000 | 6487 | maxLength: 1000 |
5946 | # GET-only properties | 6488 | # GET-only properties |