aboutsummaryrefslogtreecommitdiffhomepage
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/doc/api/openapi.yaml2307
-rw-r--r--support/doc/dependencies.md2
-rw-r--r--support/doc/development/monitoring.md17
-rw-r--r--support/doc/plugins/guide.md13
-rw-r--r--support/doc/production.md1
-rw-r--r--support/docker/production/.env1
-rw-r--r--support/docker/production/Dockerfile.buster2
-rw-r--r--support/docker/production/config/custom-environment-variables.yaml3
-rw-r--r--support/docker/production/config/production.yaml2
-rw-r--r--support/nginx/peertube7
10 files changed, 1741 insertions, 614 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index d4fe15664..0762e590a 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -1,19 +1,17 @@
1openapi: 3.0.0 1openapi: 3.0.0
2info: 2info:
3 title: PeerTube 3 title: PeerTube
4 version: 3.1.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 # Introduction
16
17 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
18 HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with 16 HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with
19 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO) 17 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
@@ -23,13 +21,14 @@ info:
23 - [Go](https://framagit.org/framasoft/peertube/clients/go) 21 - [Go](https://framagit.org/framasoft/peertube/clients/go)
24 - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin) 22 - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin)
25 23
26 See the [Quick Start guide](https://docs.joinpeertube.org/api-rest-getting-started) so you can play with the PeerTube API. 24 See the [REST API quick start](https://docs.joinpeertube.org/api-rest-getting-started) for a few
25 examples of using the PeerTube API.
27 26
28 # Authentication 27 # Authentication
29 28
30 When you sign up for an account, you are given the possibility to generate 29 When you sign up for an account on a PeerTube instance, you are given the possibility
31 sessions, and authenticate using this session token. One session token can 30 to generate sessions on it, and authenticate there using an access token. Only __one
32 currently be used at a time. 31 access token can currently be used at a time__.
33 32
34 ## Roles 33 ## Roles
35 34
@@ -39,18 +38,98 @@ info:
39 # Errors 38 # Errors
40 39
41 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
42 of the API call. The body of the response will be JSON in the following 41 of the API call.
43 format.
44 42
45 ``` 43 ```
44 HTTP 1.1 404 Not Found
45 Content-Type: application/json
46
46 { 47 {
47 "code": "unauthorized_request", // example inner error code 48 "errorCode": 1
48 "error": "Token is invalid." // example exposed error message 49 "error": "Account not found"
49 } 50 }
50 ``` 51 ```
52
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
62 ```
63 HTTP 1.1 400 Bad Request
64 Content-Type: application/json
65
66 {
67 "errors": {
68 "id": {
69 "value": "a117eb-c6a9-4756-bb09-2a956239f",
70 "msg": "Should have a valid id",
71 "param": "id",
72 "location": "params"
73 }
74 }
75 }
76 ```
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
83 # Rate limits
84
85 We are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators:
86
87 | Endpoint (prefix: `/api/v1`) | Calls | Time frame |
88 |------------------------------|---------------|--------------|
89 | `/*` | 50 | 10 seconds |
90 | `POST /users/token` | 15 | 5 minutes |
91 | `POST /users/register` | 2<sup>*</sup> | 5 minutes |
92 | `POST /users/ask-send-verify-email` | 3 | 5 minutes |
93
94 Depending on the endpoint, <sup>*</sup>failed requests are not taken into account. A service
95 limit is announced by a `429 Too Many Requests` status code.
96
97 You can get details about the current state of your rate limit by reading the
98 following headers:
99
100 | Header | Description |
101 |-------------------------|------------------------------------------------------------|
102 | `X-RateLimit-Limit` | Number of max requests allowed in the current time period |
103 | `X-RateLimit-Remaining` | Number of remaining requests in the current time period |
104 | `X-RateLimit-Reset` | Timestamp of end of current time period as UNIX timestamp |
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.
51externalDocs: 121externalDocs:
52 url: https://docs.joinpeertube.org/api-rest-reference.html 122 url: https://docs.joinpeertube.org/api-rest-reference.html
53tags: 123tags:
124 - name: Register
125 description: |
126 As a visitor, you can use this API to open an account (if registrations are open on
127 that PeerTube instance). As an admin, you should use the dedicated [User creation
128 API](#operation/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__.
54 - name: Accounts 133 - name: Accounts
55 description: > 134 description: >
56 Accounts encompass remote accounts discovered across the federation, 135 Accounts encompass remote accounts discovered across the federation,
@@ -101,7 +180,7 @@ tags:
101 Redundancy is part of the inter-server solidarity that PeerTube fosters. 180 Redundancy is part of the inter-server solidarity that PeerTube fosters.
102 Manage the list of instances you wish to help by seeding their videos according 181 Manage the list of instances you wish to help by seeding their videos according
103 to the policy of video selection of your choice. Note that you have a similar functionality 182 to the policy of video selection of your choice. Note that you have a similar functionality
104 to mirror individual videos, see `Video Mirroring`. 183 to mirror individual videos, see [video mirroring](#tag/Video-Mirroring).
105 externalDocs: 184 externalDocs:
106 url: https://docs.joinpeertube.org/admin-following-instances?id=instances-redundancy 185 url: https://docs.joinpeertube.org/admin-following-instances?id=instances-redundancy
107 - name: Plugins 186 - name: Plugins
@@ -115,6 +194,50 @@ tags:
115 - name: Video 194 - name: Video
116 description: | 195 description: |
117 Operations dealing with listing, uploading, fetching or modifying videos. 196 Operations dealing with listing, uploading, fetching or modifying videos.
197 - name: Video Upload
198 description: |
199 Operations dealing with adding video or audio. PeerTube supports two upload modes, and three import modes.
200
201 ### Upload
202
203 - [_legacy_](#operation/uploadLegacy), where the video file is sent in a single request
204 - [_resumable_](#operation/uploadResumableInit), where the video file is sent in chunks
205
206 You can upload videos more reliably by using the resumable variant. Its protocol lets
207 you resume an upload operation after a network interruption or other transmission failure,
208 saving time and bandwidth in the event of network failures.
209
210 Favor using resumable uploads in any of the following cases:
211 - You are transferring large files
212 - The likelihood of a network interruption is high
213 - Uploads are originating from a device with a low-bandwidth or unstable Internet connection,
214 such as a mobile device
215
216 ### Import
217
218 - _URL_-based: where the URL points to any service supported by [youtube-dl](https://ytdl-org.github.io/youtube-dl/)
219 - _magnet_-based: where the URI resolves to a BitTorrent ressource containing a single supported video file
220 - _torrent_-based: where the metainfo file resolves to a BitTorrent ressource containing a single supported video file
221
222 The import function is practical when the desired video/audio is available online. It makes PeerTube
223 download it for you, saving you as much bandwidth and avoiding any instability or limitation your network might have.
224 - name: Video Captions
225 description: Operations dealing with listing, adding and removing closed captions of a video.
226 - name: Video Channels
227 description: Operations dealing with the creation, modification and listing of videos within a channel.
228 - name: Video Comments
229 description: >
230 Operations dealing with comments to a video. Comments are organized in threads: adding a
231 comment in response to the video starts a thread, adding a reply to a comment adds it to
232 its root comment thread.
233 - name: Video Blocks
234 description: Operations dealing with blocking videos (removing them from view and preventing interactions).
235 - name: Video Rates
236 description: Like/dislike a video.
237 - name: Video Playlists
238 description: Operations dealing with playlists of videos. Playlists are bound to users and/or channels.
239 - name: Feeds
240 description: Server syndication feeds
118 - name: Search 241 - name: Search
119 description: | 242 description: |
120 The search helps to find _videos_ or _channels_ from within the instance and beyond. 243 The search helps to find _videos_ or _channels_ from within the instance and beyond.
@@ -124,28 +247,18 @@ tags:
124 247
125 Administrators can also enable the use of a remote search system, indexing 248 Administrators can also enable the use of a remote search system, indexing
126 videos and channels not could be not federated by the instance. 249 videos and channels not could be not federated by the instance.
127 - name: Video Comments 250 - name: Homepage
128 description: > 251 description: Get and update the custom homepage
129 Operations dealing with comments to a video. Comments are organized in 252 - name: Video Mirroring
130 threads. 253 description: |
131 - name: Video Playlists 254 PeerTube instances can mirror videos from one another, and help distribute some videos.
132 description: > 255
133 Operations dealing with playlists of videos. Playlists are bound to users 256 For importing videos as your own, refer to [video imports](#operation/importVideo).
134 and/or channels.
135 - name: Video Channels
136 description: >
137 Operations dealing with the creation, modification and listing of videos within a channel.
138 - name: Video Blocks
139 description: >
140 Operations dealing with blocking videos (removing them from view and
141 preventing interactions).
142 - name: Video Rates
143 description: >
144 Like/dislike a video.
145 - name: Feeds
146 description: >
147 Server syndication feeds
148x-tagGroups: 257x-tagGroups:
258 - name: Auth
259 tags:
260 - Register
261 - Session
149 - name: Accounts 262 - name: Accounts
150 tags: 263 tags:
151 - Accounts 264 - Accounts
@@ -157,6 +270,7 @@ x-tagGroups:
157 - name: Videos 270 - name: Videos
158 tags: 271 tags:
159 - Video 272 - Video
273 - Video Upload
160 - Video Captions 274 - Video Captions
161 - Video Channels 275 - Video Channels
162 - Video Comments 276 - Video Comments
@@ -169,6 +283,9 @@ x-tagGroups:
169 - name: Search 283 - name: Search
170 tags: 284 tags:
171 - Search 285 - Search
286 - name: Custom pages
287 tags:
288 - Homepage
172 - name: Moderation 289 - name: Moderation
173 tags: 290 tags:
174 - Abuses 291 - Abuses
@@ -190,6 +307,7 @@ paths:
190 tags: 307 tags:
191 - Accounts 308 - Accounts
192 summary: Get an account 309 summary: Get an account
310 operationId: getAccount
193 parameters: 311 parameters:
194 - $ref: '#/components/parameters/name' 312 - $ref: '#/components/parameters/name'
195 responses: 313 responses:
@@ -201,12 +319,14 @@ paths:
201 $ref: '#/components/schemas/Account' 319 $ref: '#/components/schemas/Account'
202 '404': 320 '404':
203 description: account not found 321 description: account not found
322
204 '/accounts/{name}/videos': 323 '/accounts/{name}/videos':
205 get: 324 get:
206 tags: 325 tags:
207 - Accounts 326 - Accounts
208 - Video 327 - Video
209 summary: 'List videos of an account' 328 summary: 'List videos of an account'
329 operationId: getAccountVideos
210 parameters: 330 parameters:
211 - $ref: '#/components/parameters/name' 331 - $ref: '#/components/parameters/name'
212 - $ref: '#/components/parameters/categoryOneOf' 332 - $ref: '#/components/parameters/categoryOneOf'
@@ -228,7 +348,7 @@ paths:
228 application/json: 348 application/json:
229 schema: 349 schema:
230 $ref: '#/components/schemas/VideoListResponse' 350 $ref: '#/components/schemas/VideoListResponse'
231 x-code-samples: 351 x-codeSamples:
232 - lang: JavaScript 352 - lang: JavaScript
233 source: | 353 source: |
234 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos') 354 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
@@ -262,11 +382,13 @@ paths:
262 json = r.json() 382 json = r.json()
263 383
264 print(json) 384 print(json)
385
265 /accounts: 386 /accounts:
266 get: 387 get:
267 tags: 388 tags:
268 - Accounts 389 - Accounts
269 summary: List accounts 390 summary: List accounts
391 operationId: getAccounts
270 parameters: 392 parameters:
271 - $ref: '#/components/parameters/start' 393 - $ref: '#/components/parameters/start'
272 - $ref: '#/components/parameters/count' 394 - $ref: '#/components/parameters/count'
@@ -280,11 +402,13 @@ paths:
280 type: array 402 type: array
281 items: 403 items:
282 $ref: '#/components/schemas/Account' 404 $ref: '#/components/schemas/Account'
405
283 /config: 406 /config:
284 get: 407 get:
285 tags: 408 tags:
286 - Config 409 - Config
287 summary: Get instance public configuration 410 summary: Get instance public configuration
411 operationId: getConfig
288 responses: 412 responses:
289 '200': 413 '200':
290 description: successful operation 414 description: successful operation
@@ -292,9 +416,14 @@ paths:
292 application/json: 416 application/json:
293 schema: 417 schema:
294 $ref: '#/components/schemas/ServerConfig' 418 $ref: '#/components/schemas/ServerConfig'
419 examples:
420 nightly:
421 externalValue: https://peertube2.cpy.re/api/v1/config
422
295 /config/about: 423 /config/about:
296 get: 424 get:
297 summary: Get instance "About" information 425 summary: Get instance "About" information
426 operationId: getAbout
298 tags: 427 tags:
299 - Config 428 - Config
300 responses: 429 responses:
@@ -304,9 +433,14 @@ paths:
304 application/json: 433 application/json:
305 schema: 434 schema:
306 $ref: '#/components/schemas/ServerConfigAbout' 435 $ref: '#/components/schemas/ServerConfigAbout'
436 examples:
437 nightly:
438 externalValue: https://peertube2.cpy.re/api/v1/config/about
439
307 /config/custom: 440 /config/custom:
308 get: 441 get:
309 summary: Get instance runtime configuration 442 summary: Get instance runtime configuration
443 operationId: getCustomConfig
310 tags: 444 tags:
311 - Config 445 - Config
312 security: 446 security:
@@ -321,6 +455,7 @@ paths:
321 $ref: '#/components/schemas/ServerConfigCustom' 455 $ref: '#/components/schemas/ServerConfigCustom'
322 put: 456 put:
323 summary: Set instance runtime configuration 457 summary: Set instance runtime configuration
458 operationId: putCustomConfig
324 tags: 459 tags:
325 - Config 460 - Config
326 security: 461 security:
@@ -337,6 +472,7 @@ paths:
337 - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled 472 - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled
338 delete: 473 delete:
339 summary: Delete instance runtime configuration 474 summary: Delete instance runtime configuration
475 operationId: delCustomConfig
340 tags: 476 tags:
341 - Config 477 - Config
342 security: 478 security:
@@ -345,9 +481,45 @@ paths:
345 responses: 481 responses:
346 '200': 482 '200':
347 description: successful operation 483 description: successful operation
484
485 /custom-pages/homepage/instance:
486 get:
487 summary: Get instance custom homepage
488 tags:
489 - Homepage
490 responses:
491 '404':
492 description: No homepage set
493 '200':
494 description: successful operation
495 content:
496 application/json:
497 schema:
498 $ref: '#/components/schemas/CustomHomepage'
499 put:
500 summary: Set instance custom homepage
501 tags:
502 - Homepage
503 security:
504 - OAuth2:
505 - admin
506 requestBody:
507 content:
508 application/json:
509 schema:
510 type: object
511 properties:
512 content:
513 type: string
514 description: content of the homepage, that will be injected in the client
515 responses:
516 '204':
517 description: successful operation
518
348 /jobs/{state}: 519 /jobs/{state}:
349 get: 520 get:
350 summary: List instance jobs 521 summary: List instance jobs
522 operationId: getJobs
351 security: 523 security:
352 - OAuth2: 524 - OAuth2:
353 - admin 525 - admin
@@ -387,66 +559,108 @@ paths:
387 maxItems: 100 559 maxItems: 100
388 items: 560 items:
389 $ref: '#/components/schemas/Job' 561 $ref: '#/components/schemas/Job'
390 '/server/following/{host}': 562
563 /server/followers:
564 get:
565 tags:
566 - Instance Follows
567 summary: List instances following the server
568 parameters:
569 - $ref: '#/components/parameters/followState'
570 - $ref: '#/components/parameters/actorType'
571 - $ref: '#/components/parameters/start'
572 - $ref: '#/components/parameters/count'
573 - $ref: '#/components/parameters/sort'
574 responses:
575 '200':
576 description: successful operation
577 content:
578 application/json:
579 schema:
580 type: object
581 properties:
582 total:
583 type: integer
584 example: 1
585 data:
586 type: array
587 items:
588 $ref: '#/components/schemas/Follow'
589
590 '/server/followers/{nameWithHost}':
391 delete: 591 delete:
592 summary: Remove or reject a follower to your server
392 security: 593 security:
393 - OAuth2: 594 - OAuth2:
394 - admin 595 - admin
395 tags: 596 tags:
396 - Instance Follows 597 - Instance Follows
397 summary: Unfollow a server
398 parameters: 598 parameters:
399 - name: host 599 - name: nameWithHost
400 in: path 600 in: path
401 required: true 601 required: true
402 description: 'The host to unfollow ' 602 description: The remote actor handle to remove from your followers
403 schema: 603 schema:
404 type: string 604 type: string
405 format: hostname 605 format: email
406 responses: 606 responses:
407 '201': 607 '204':
408 description: successful operation 608 description: successful operation
409 /server/followers: 609 '404':
410 get: 610 description: follower not found
611
612 '/server/followers/{nameWithHost}/reject':
613 post:
614 summary: Reject a pending follower to your server
615 security:
616 - OAuth2:
617 - admin
411 tags: 618 tags:
412 - Instance Follows 619 - Instance Follows
413 summary: List instance followers
414 parameters: 620 parameters:
415 - $ref: '#/components/parameters/start' 621 - name: nameWithHost
416 - $ref: '#/components/parameters/count' 622 in: path
417 - $ref: '#/components/parameters/sort' 623 required: true
624 description: The remote actor handle to remove from your followers
625 schema:
626 type: string
627 format: email
418 responses: 628 responses:
419 '200': 629 '204':
420 description: successful operation 630 description: successful operation
421 content: 631 '404':
422 application/json: 632 description: follower not found
423 schema: 633
424 type: array 634 '/server/followers/{nameWithHost}/accept':
425 items: 635 post:
426 $ref: '#/components/schemas/Follow' 636 summary: Accept a pending follower to your server
637 security:
638 - OAuth2:
639 - admin
640 tags:
641 - Instance Follows
642 parameters:
643 - name: nameWithHost
644 in: path
645 required: true
646 description: The remote actor handle to remove from your followers
647 schema:
648 type: string
649 format: email
650 responses:
651 '204':
652 description: successful operation
653 '404':
654 description: follower not found
655
427 /server/following: 656 /server/following:
428 get: 657 get:
429 tags: 658 tags:
430 - Instance Follows 659 - Instance Follows
431 summary: List instances followed by the server 660 summary: List instances followed by the server
432 parameters: 661 parameters:
433 - name: state 662 - $ref: '#/components/parameters/followState'
434 in: query 663 - $ref: '#/components/parameters/actorType'
435 schema:
436 type: string
437 enum:
438 - pending
439 - accepted
440 - name: actorType
441 in: query
442 schema:
443 type: string
444 enum:
445 - Person
446 - Application
447 - Group
448 - Service
449 - Organization
450 - $ref: '#/components/parameters/start' 664 - $ref: '#/components/parameters/start'
451 - $ref: '#/components/parameters/count' 665 - $ref: '#/components/parameters/count'
452 - $ref: '#/components/parameters/sort' 666 - $ref: '#/components/parameters/sort'
@@ -456,16 +670,22 @@ paths:
456 content: 670 content:
457 application/json: 671 application/json:
458 schema: 672 schema:
459 type: array 673 type: object
460 items: 674 properties:
461 $ref: '#/components/schemas/Follow' 675 total:
676 type: integer
677 example: 1
678 data:
679 type: array
680 items:
681 $ref: '#/components/schemas/Follow'
462 post: 682 post:
463 security: 683 security:
464 - OAuth2: 684 - OAuth2:
465 - admin 685 - admin
466 tags: 686 tags:
467 - Instance Follows 687 - Instance Follows
468 summary: Follow a server 688 summary: Follow a list of servers
469 responses: 689 responses:
470 '204': 690 '204':
471 description: successful operation 691 description: successful operation
@@ -483,9 +703,33 @@ paths:
483 type: string 703 type: string
484 format: hostname 704 format: hostname
485 uniqueItems: true 705 uniqueItems: true
706
707 '/server/following/{host}':
708 delete:
709 summary: Unfollow a server
710 security:
711 - OAuth2:
712 - admin
713 tags:
714 - Instance Follows
715 parameters:
716 - name: host
717 in: path
718 required: true
719 description: The host to unfollow
720 schema:
721 type: string
722 format: hostname
723 responses:
724 '204':
725 description: successful operation
726 '404':
727 description: host not found
728
486 /users: 729 /users:
487 post: 730 post:
488 summary: Create a user 731 summary: Create a user
732 operationId: addUser
489 security: 733 security:
490 - OAuth2: 734 - OAuth2:
491 - admin 735 - admin
@@ -500,18 +744,18 @@ paths:
500 $ref: '#/components/schemas/AddUserResponse' 744 $ref: '#/components/schemas/AddUserResponse'
501 links: 745 links:
502 # GET /users/{id} 746 # GET /users/{id}
503 GetUserId: 747 GetUser:
504 operationId: getUserId 748 operationId: getUser
505 parameters: 749 parameters:
506 id: '$response.body#/user/id' 750 id: '$response.body#/user/id'
507 # PUT /users/{id} 751 # PUT /users/{id}
508 PutUserId: 752 PutUser:
509 operationId: putUserId 753 operationId: putUser
510 parameters: 754 parameters:
511 id: '$response.body#/user/id' 755 id: '$response.body#/user/id'
512 # DELETE /users/{id} 756 # DELETE /users/{id}
513 DelUserId: 757 DelUser:
514 operationId: delUserId 758 operationId: delUser
515 parameters: 759 parameters:
516 id: '$response.body#/user/id' 760 id: '$response.body#/user/id'
517 '403': 761 '403':
@@ -521,10 +765,13 @@ paths:
521 application/json: 765 application/json:
522 schema: 766 schema:
523 $ref: '#/components/schemas/AddUser' 767 $ref: '#/components/schemas/AddUser'
524 description: User to create 768 description: |
769 If the smtp server is configured, you can leave the password empty and an email will be sent
770 asking the user to set it first.
525 required: true 771 required: true
526 get: 772 get:
527 summary: List users 773 summary: List users
774 operationId: getUsers
528 security: 775 security:
529 - OAuth2: 776 - OAuth2:
530 - admin 777 - admin
@@ -545,6 +792,7 @@ paths:
545 type: array 792 type: array
546 items: 793 items:
547 $ref: '#/components/schemas/User' 794 $ref: '#/components/schemas/User'
795
548 '/users/{id}': 796 '/users/{id}':
549 parameters: 797 parameters:
550 - $ref: '#/components/parameters/id' 798 - $ref: '#/components/parameters/id'
@@ -555,7 +803,7 @@ paths:
555 - admin 803 - admin
556 tags: 804 tags:
557 - Users 805 - Users
558 operationId: delUserId 806 operationId: delUser
559 responses: 807 responses:
560 '204': 808 '204':
561 description: successful operation 809 description: successful operation
@@ -565,21 +813,32 @@ paths:
565 - OAuth2: [] 813 - OAuth2: []
566 tags: 814 tags:
567 - Users 815 - Users
568 operationId: getUserId 816 operationId: getUser
817 parameters:
818 - name: withStats
819 in: query
820 description: include statistics about the user (only available as a moderator/admin)
821 schema:
822 type: boolean
569 responses: 823 responses:
570 '200': 824 '200':
571 description: successful operation 825 x-summary: successful operation
826 description: |
827 As an admin/moderator, you can request a response augmented with statistics about the user's
828 moderation relations and videos usage, by using the `withStats` parameter.
572 content: 829 content:
573 application/json: 830 application/json:
574 schema: 831 schema:
575 $ref: '#/components/schemas/User' 832 oneOf:
833 - $ref: '#/components/schemas/User'
834 - $ref: '#/components/schemas/UserWithStats'
576 put: 835 put:
577 summary: Update a user 836 summary: Update a user
578 security: 837 security:
579 - OAuth2: [] 838 - OAuth2: []
580 tags: 839 tags:
581 - Users 840 - Users
582 operationId: putUserId 841 operationId: putUser
583 responses: 842 responses:
584 '204': 843 '204':
585 description: successful operation 844 description: successful operation
@@ -589,11 +848,120 @@ paths:
589 schema: 848 schema:
590 $ref: '#/components/schemas/UpdateUser' 849 $ref: '#/components/schemas/UpdateUser'
591 required: true 850 required: true
851
852 /oauth-clients/local:
853 get:
854 summary: Login prerequisite
855 description: You need to retrieve a client id and secret before [logging in](#operation/getOAuthToken).
856 operationId: getOAuthClient
857 tags:
858 - Session
859 responses:
860 '200':
861 description: successful operation
862 content:
863 application/json:
864 schema:
865 $ref: '#/components/schemas/OAuthClient'
866 links:
867 UseOAuthClientToLogin:
868 operationId: getOAuthToken
869 parameters:
870 client_id: '$response.body#/client_id'
871 client_secret: '$response.body#/client_secret'
872 x-codeSamples:
873 - lang: Shell
874 source: |
875 API="https://peertube2.cpy.re/api/v1"
876
877 ## AUTH
878 curl -s "$API/oauth-clients/local"
879
880 /users/token:
881 post:
882 summary: Login
883 operationId: getOAuthToken
884 description: With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens.
885 tags:
886 - Session
887 requestBody:
888 content:
889 application/x-www-form-urlencoded:
890 schema:
891 oneOf:
892 - $ref: '#/components/schemas/OAuthToken-password'
893 - $ref: '#/components/schemas/OAuthToken-refresh_token'
894 discriminator:
895 propertyName: grant_type
896 mapping:
897 password: '#/components/schemas/OAuthToken-password'
898 refresh_token: '#/components/schemas/OAuthToken-refresh_token'
899 responses:
900 '200':
901 description: successful operation
902 content:
903 application/json:
904 schema:
905 type: object
906 properties:
907 token_type:
908 type: string
909 example: Bearer
910 access_token:
911 type: string
912 example: 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0
913 description: valid for 1 day
914 refresh_token:
915 type: string
916 example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7
917 description: valid for 2 weeks
918 expires_in:
919 type: integer
920 minimum: 0
921 example: 14399
922 refresh_token_expires_in:
923 type: integer
924 minimum: 0
925 example: 1209600
926 x-codeSamples:
927 - lang: Shell
928 source: |
929 ## DEPENDENCIES: jq
930 API="https://peertube2.cpy.re/api/v1"
931 USERNAME="<your_username>"
932 PASSWORD="<your_password>"
933
934 ## AUTH
935 client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id")
936 client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret")
937 curl -s "$API/users/token" \
938 --data client_id="$client_id" \
939 --data client_secret="$client_secret" \
940 --data grant_type=password \
941 --data username="$USERNAME" \
942 --data password="$PASSWORD" \
943 | jq -r ".access_token"
944
945 /users/revoke-token:
946 post:
947 summary: Logout
948 description: Revokes your access token and its associated refresh token, destroying your current session.
949 operationId: revokeOAuthToken
950 tags:
951 - Session
952 security:
953 - OAuth2: []
954 responses:
955 '200':
956 description: successful operation
957
592 /users/register: 958 /users/register:
593 post: 959 post:
594 summary: Register a user 960 summary: Register a user
961 operationId: registerUser
595 tags: 962 tags:
596 - Users 963 - Users
964 - Register
597 responses: 965 responses:
598 '204': 966 '204':
599 description: successful operation 967 description: successful operation
@@ -603,9 +971,55 @@ paths:
603 schema: 971 schema:
604 $ref: '#/components/schemas/RegisterUser' 972 $ref: '#/components/schemas/RegisterUser'
605 required: true 973 required: true
974
975 /users/{id}/verify-email:
976 post:
977 summary: Verify a user
978 operationId: verifyUser
979 description: |
980 Following a user registration, the new user will receive an email asking to click a link
981 containing a secret.
982 tags:
983 - Users
984 - Register
985 parameters:
986 - $ref: '#/components/parameters/id'
987 requestBody:
988 content:
989 application/json:
990 schema:
991 type: object
992 properties:
993 verificationString:
994 type: string
995 format: url
996 isPendingEmail:
997 type: boolean
998 required:
999 - verificationString
1000 responses:
1001 '204':
1002 description: successful operation
1003 '403':
1004 description: invalid verification string
1005 '404':
1006 description: user not found
1007
1008 /users/ask-send-verify-email:
1009 post:
1010 summary: Resend user verification link
1011 operationId: resendEmailToVerifyUser
1012 tags:
1013 - Users
1014 - Register
1015 responses:
1016 '204':
1017 description: successful operation
1018
606 /users/me: 1019 /users/me:
607 get: 1020 get:
608 summary: Get my user information 1021 summary: Get my user information
1022 operationId: getUserInfo
609 security: 1023 security:
610 - OAuth2: 1024 - OAuth2:
611 - user 1025 - user
@@ -622,6 +1036,7 @@ paths:
622 $ref: '#/components/schemas/User' 1036 $ref: '#/components/schemas/User'
623 put: 1037 put:
624 summary: Update my user information 1038 summary: Update my user information
1039 operationId: putUserInfo
625 security: 1040 security:
626 - OAuth2: 1041 - OAuth2:
627 - user 1042 - user
@@ -636,6 +1051,7 @@ paths:
636 schema: 1051 schema:
637 $ref: '#/components/schemas/UpdateMe' 1052 $ref: '#/components/schemas/UpdateMe'
638 required: true 1053 required: true
1054
639 /users/me/videos/imports: 1055 /users/me/videos/imports:
640 get: 1056 get:
641 summary: Get video imports of my user 1057 summary: Get video imports of my user
@@ -655,7 +1071,8 @@ paths:
655 content: 1071 content:
656 application/json: 1072 application/json:
657 schema: 1073 schema:
658 $ref: '#/components/schemas/VideoImport' 1074 $ref: '#/components/schemas/VideoImportsList'
1075
659 /users/me/video-quota-used: 1076 /users/me/video-quota-used:
660 get: 1077 get:
661 summary: Get my user used quota 1078 summary: Get my user used quota
@@ -670,7 +1087,17 @@ paths:
670 content: 1087 content:
671 application/json: 1088 application/json:
672 schema: 1089 schema:
673 type: number 1090 type: object
1091 properties:
1092 videoQuotaUsed:
1093 type: number
1094 description: The user video quota used so far in bytes
1095 example: 16810141515
1096 videoQuotaUsedDaily:
1097 type: number
1098 description: The user video quota used today in bytes
1099 example: 1681014151
1100
674 '/users/me/videos/{videoId}/rating': 1101 '/users/me/videos/{videoId}/rating':
675 get: 1102 get:
676 summary: Get rate of my user for a video 1103 summary: Get rate of my user for a video
@@ -683,9 +1110,9 @@ paths:
683 - name: videoId 1110 - name: videoId
684 in: path 1111 in: path
685 required: true 1112 required: true
686 description: 'The video id ' 1113 description: The video id
687 schema: 1114 schema:
688 type: string 1115 $ref: '#/components/schemas/Video/properties/id'
689 responses: 1116 responses:
690 '200': 1117 '200':
691 description: successful operation 1118 description: successful operation
@@ -693,6 +1120,7 @@ paths:
693 application/json: 1120 application/json:
694 schema: 1121 schema:
695 $ref: '#/components/schemas/GetMeVideoRating' 1122 $ref: '#/components/schemas/GetMeVideoRating'
1123
696 /users/me/videos: 1124 /users/me/videos:
697 get: 1125 get:
698 summary: Get videos of my user 1126 summary: Get videos of my user
@@ -713,6 +1141,7 @@ paths:
713 application/json: 1141 application/json:
714 schema: 1142 schema:
715 $ref: '#/components/schemas/VideoListResponse' 1143 $ref: '#/components/schemas/VideoListResponse'
1144
716 /users/me/subscriptions: 1145 /users/me/subscriptions:
717 get: 1146 get:
718 summary: Get my user subscriptions 1147 summary: Get my user subscriptions
@@ -728,6 +1157,10 @@ paths:
728 responses: 1157 responses:
729 '200': 1158 '200':
730 description: successful operation 1159 description: successful operation
1160 content:
1161 application/json:
1162 schema:
1163 $ref: '#/components/schemas/VideoChannelList'
731 post: 1164 post:
732 tags: 1165 tags:
733 - My Subscriptions 1166 - My Subscriptions
@@ -754,6 +1187,7 @@ paths:
754 responses: 1187 responses:
755 '200': 1188 '200':
756 description: successful operation 1189 description: successful operation
1190
757 /users/me/subscriptions/exist: 1191 /users/me/subscriptions/exist:
758 get: 1192 get:
759 summary: Get if subscriptions exist for my user 1193 summary: Get if subscriptions exist for my user
@@ -771,6 +1205,7 @@ paths:
771 application/json: 1205 application/json:
772 schema: 1206 schema:
773 type: object 1207 type: object
1208
774 /users/me/subscriptions/videos: 1209 /users/me/subscriptions/videos:
775 get: 1210 get:
776 summary: List videos of subscriptions of my user 1211 summary: List videos of subscriptions of my user
@@ -800,6 +1235,7 @@ paths:
800 application/json: 1235 application/json:
801 schema: 1236 schema:
802 $ref: '#/components/schemas/VideoListResponse' 1237 $ref: '#/components/schemas/VideoListResponse'
1238
803 '/users/me/subscriptions/{subscriptionHandle}': 1239 '/users/me/subscriptions/{subscriptionHandle}':
804 get: 1240 get:
805 summary: Get subscription of my user 1241 summary: Get subscription of my user
@@ -829,6 +1265,7 @@ paths:
829 responses: 1265 responses:
830 '200': 1266 '200':
831 description: successful operation 1267 description: successful operation
1268
832 /users/me/notifications: 1269 /users/me/notifications:
833 get: 1270 get:
834 summary: List my notifications 1271 summary: List my notifications
@@ -852,6 +1289,7 @@ paths:
852 application/json: 1289 application/json:
853 schema: 1290 schema:
854 $ref: '#/components/schemas/NotificationListResponse' 1291 $ref: '#/components/schemas/NotificationListResponse'
1292
855 /users/me/notifications/read: 1293 /users/me/notifications/read:
856 post: 1294 post:
857 summary: Mark notifications as read by their id 1295 summary: Mark notifications as read by their id
@@ -875,6 +1313,7 @@ paths:
875 responses: 1313 responses:
876 '204': 1314 '204':
877 description: successful operation 1315 description: successful operation
1316
878 /users/me/notifications/read-all: 1317 /users/me/notifications/read-all:
879 post: 1318 post:
880 summary: Mark all my notification as read 1319 summary: Mark all my notification as read
@@ -885,6 +1324,7 @@ paths:
885 responses: 1324 responses:
886 '204': 1325 '204':
887 description: successful operation 1326 description: successful operation
1327
888 /users/me/notification-settings: 1328 /users/me/notification-settings:
889 put: 1329 put:
890 summary: Update my notification settings 1330 summary: Update my notification settings
@@ -925,6 +1365,7 @@ paths:
925 responses: 1365 responses:
926 '204': 1366 '204':
927 description: successful operation 1367 description: successful operation
1368
928 /users/me/history/videos: 1369 /users/me/history/videos:
929 get: 1370 get:
930 summary: List watched videos history 1371 summary: List watched videos history
@@ -943,6 +1384,7 @@ paths:
943 application/json: 1384 application/json:
944 schema: 1385 schema:
945 $ref: '#/components/schemas/VideoListResponse' 1386 $ref: '#/components/schemas/VideoListResponse'
1387
946 /users/me/history/videos/remove: 1388 /users/me/history/videos/remove:
947 post: 1389 post:
948 summary: Clear video history 1390 summary: Clear video history
@@ -963,6 +1405,7 @@ paths:
963 responses: 1405 responses:
964 '204': 1406 '204':
965 description: successful operation 1407 description: successful operation
1408
966 /users/me/avatar/pick: 1409 /users/me/avatar/pick:
967 post: 1410 post:
968 summary: Update my user avatar 1411 summary: Update my user avatar
@@ -995,12 +1438,13 @@ paths:
995 type: object 1438 type: object
996 properties: 1439 properties:
997 avatarfile: 1440 avatarfile:
998 description: The file to upload. 1441 description: The file to upload
999 type: string 1442 type: string
1000 format: binary 1443 format: binary
1001 encoding: 1444 encoding:
1002 avatarfile: 1445 avatarfile:
1003 contentType: image/png, image/jpeg 1446 contentType: image/png, image/jpeg
1447
1004 /users/me/avatar: 1448 /users/me/avatar:
1005 delete: 1449 delete:
1006 summary: Delete my avatar 1450 summary: Delete my avatar
@@ -1022,6 +1466,7 @@ paths:
1022 responses: 1466 responses:
1023 '200': 1467 '200':
1024 description: successful operation 1468 description: successful operation
1469
1025 '/videos/ownership/{id}/accept': 1470 '/videos/ownership/{id}/accept':
1026 post: 1471 post:
1027 summary: Accept ownership change request 1472 summary: Accept ownership change request
@@ -1038,6 +1483,7 @@ paths:
1038 description: cannot terminate an ownership change of another user 1483 description: cannot terminate an ownership change of another user
1039 '404': 1484 '404':
1040 description: video owneship change not found 1485 description: video owneship change not found
1486
1041 '/videos/ownership/{id}/refuse': 1487 '/videos/ownership/{id}/refuse':
1042 post: 1488 post:
1043 summary: Refuse ownership change request 1489 summary: Refuse ownership change request
@@ -1054,6 +1500,7 @@ paths:
1054 description: cannot terminate an ownership change of another user 1500 description: cannot terminate an ownership change of another user
1055 '404': 1501 '404':
1056 description: video owneship change not found 1502 description: video owneship change not found
1503
1057 '/videos/{id}/give-ownership': 1504 '/videos/{id}/give-ownership':
1058 post: 1505 post:
1059 summary: Request ownership change 1506 summary: Request ownership change
@@ -1081,9 +1528,11 @@ paths:
1081 description: changing video ownership to a remote account is not supported yet 1528 description: changing video ownership to a remote account is not supported yet
1082 '404': 1529 '404':
1083 description: video not found 1530 description: video not found
1531
1084 /videos: 1532 /videos:
1085 get: 1533 get:
1086 summary: List videos 1534 summary: List videos
1535 operationId: getVideos
1087 tags: 1536 tags:
1088 - Video 1537 - Video
1089 parameters: 1538 parameters:
@@ -1106,9 +1555,11 @@ paths:
1106 application/json: 1555 application/json:
1107 schema: 1556 schema:
1108 $ref: '#/components/schemas/VideoListResponse' 1557 $ref: '#/components/schemas/VideoListResponse'
1558
1109 /videos/categories: 1559 /videos/categories:
1110 get: 1560 get:
1111 summary: List available video categories 1561 summary: List available video categories
1562 operationId: getCategories
1112 tags: 1563 tags:
1113 - Video 1564 - Video
1114 responses: 1565 responses:
@@ -1123,9 +1574,11 @@ paths:
1123 examples: 1574 examples:
1124 nightly: 1575 nightly:
1125 externalValue: https://peertube2.cpy.re/api/v1/videos/categories 1576 externalValue: https://peertube2.cpy.re/api/v1/videos/categories
1577
1126 /videos/licences: 1578 /videos/licences:
1127 get: 1579 get:
1128 summary: List available video licences 1580 summary: List available video licences
1581 operationId: getLicences
1129 tags: 1582 tags:
1130 - Video 1583 - Video
1131 responses: 1584 responses:
@@ -1140,9 +1593,11 @@ paths:
1140 examples: 1593 examples:
1141 nightly: 1594 nightly:
1142 externalValue: https://peertube2.cpy.re/api/v1/videos/licences 1595 externalValue: https://peertube2.cpy.re/api/v1/videos/licences
1596
1143 /videos/languages: 1597 /videos/languages:
1144 get: 1598 get:
1145 summary: List available video languages 1599 summary: List available video languages
1600 operationId: getLanguages
1146 tags: 1601 tags:
1147 - Video 1602 - Video
1148 responses: 1603 responses:
@@ -1157,9 +1612,11 @@ paths:
1157 examples: 1612 examples:
1158 nightly: 1613 nightly:
1159 externalValue: https://peertube2.cpy.re/api/v1/videos/languages 1614 externalValue: https://peertube2.cpy.re/api/v1/videos/languages
1615
1160 /videos/privacies: 1616 /videos/privacies:
1161 get: 1617 get:
1162 summary: List available video privacies 1618 summary: List available video privacy policies
1619 operationId: getPrivacyPolicies
1163 tags: 1620 tags:
1164 - Video 1621 - Video
1165 responses: 1622 responses:
@@ -1174,9 +1631,11 @@ paths:
1174 examples: 1631 examples:
1175 nightly: 1632 nightly:
1176 externalValue: https://peertube2.cpy.re/api/v1/videos/privacies 1633 externalValue: https://peertube2.cpy.re/api/v1/videos/privacies
1634
1177 '/videos/{id}': 1635 '/videos/{id}':
1178 put: 1636 put:
1179 summary: Update a video 1637 summary: Update a video
1638 operationId: putVideo
1180 security: 1639 security:
1181 - OAuth2: [] 1640 - OAuth2: []
1182 tags: 1641 tags:
@@ -1201,16 +1660,11 @@ paths:
1201 type: string 1660 type: string
1202 format: binary 1661 format: binary
1203 category: 1662 category:
1204 description: Video category 1663 $ref: '#/components/schemas/VideoCategorySet'
1205 type: integer
1206 example: 4
1207 licence: 1664 licence:
1208 description: Video licence 1665 $ref: '#/components/schemas/VideoLicenceSet'
1209 type: integer
1210 example: 2
1211 language: 1666 language:
1212 description: Video language 1667 $ref: '#/components/schemas/VideoLanguageSet'
1213 type: string
1214 privacy: 1668 privacy:
1215 $ref: '#/components/schemas/VideoPrivacySet' 1669 $ref: '#/components/schemas/VideoPrivacySet'
1216 description: 1670 description:
@@ -1221,7 +1675,7 @@ paths:
1221 type: string 1675 type: string
1222 support: 1676 support:
1223 description: A text tell the audience how to support the video creator 1677 description: A text tell the audience how to support the video creator
1224 example: Please support my work on <insert crowdfunding plateform>! <3 1678 example: Please support our work on https://soutenir.framasoft.org/en/ <3
1225 type: string 1679 type: string
1226 nsfw: 1680 nsfw:
1227 description: Whether or not this video contains sensitive content 1681 description: Whether or not this video contains sensitive content
@@ -1256,6 +1710,7 @@ paths:
1256 contentType: image/jpeg 1710 contentType: image/jpeg
1257 get: 1711 get:
1258 summary: Get a video 1712 summary: Get a video
1713 operationId: getVideo
1259 tags: 1714 tags:
1260 - Video 1715 - Video
1261 parameters: 1716 parameters:
@@ -1269,6 +1724,7 @@ paths:
1269 $ref: '#/components/schemas/VideoDetails' 1724 $ref: '#/components/schemas/VideoDetails'
1270 delete: 1725 delete:
1271 summary: Delete a video 1726 summary: Delete a video
1727 operationId: delVideo
1272 security: 1728 security:
1273 - OAuth2: [] 1729 - OAuth2: []
1274 tags: 1730 tags:
@@ -1278,9 +1734,11 @@ paths:
1278 responses: 1734 responses:
1279 '204': 1735 '204':
1280 description: successful operation 1736 description: successful operation
1737
1281 '/videos/{id}/description': 1738 '/videos/{id}/description':
1282 get: 1739 get:
1283 summary: Get complete video description 1740 summary: Get complete video description
1741 operationId: getVideoDesc
1284 tags: 1742 tags:
1285 - Video 1743 - Video
1286 parameters: 1744 parameters:
@@ -1291,7 +1749,13 @@ paths:
1291 content: 1749 content:
1292 application/json: 1750 application/json:
1293 schema: 1751 schema:
1752 nullable: true
1294 type: string 1753 type: string
1754 minLength: 3
1755 maxLength: 10000
1756 example: |
1757 **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**
1758
1295 '/videos/{id}/views': 1759 '/videos/{id}/views':
1296 post: 1760 post:
1297 summary: Add a view to a video 1761 summary: Add a view to a video
@@ -1302,6 +1766,7 @@ paths:
1302 responses: 1766 responses:
1303 '204': 1767 '204':
1304 description: successful operation 1768 description: successful operation
1769
1305 '/videos/{id}/watching': 1770 '/videos/{id}/watching':
1306 put: 1771 put:
1307 summary: Set watching progress of a video 1772 summary: Set watching progress of a video
@@ -1320,13 +1785,17 @@ paths:
1320 responses: 1785 responses:
1321 '204': 1786 '204':
1322 description: successful operation 1787 description: successful operation
1788
1323 /videos/upload: 1789 /videos/upload:
1324 post: 1790 post:
1325 summary: Upload a video 1791 summary: Upload a video
1792 description: Uses a single request to upload a video.
1793 operationId: uploadLegacy
1326 security: 1794 security:
1327 - OAuth2: [] 1795 - OAuth2: []
1328 tags: 1796 tags:
1329 - Video 1797 - Video
1798 - Video Upload
1330 responses: 1799 responses:
1331 '200': 1800 '200':
1332 description: successful operation 1801 description: successful operation
@@ -1356,80 +1825,7 @@ paths:
1356 content: 1825 content:
1357 multipart/form-data: 1826 multipart/form-data:
1358 schema: 1827 schema:
1359 type: object 1828 $ref: '#/components/schemas/VideoUploadRequestLegacy'
1360 properties:
1361 videofile:
1362 description: Video file
1363 type: string
1364 format: binary
1365 channelId:
1366 description: Channel id that will contain this video
1367 type: integer
1368 thumbnailfile:
1369 description: Video thumbnail file
1370 type: string
1371 format: binary
1372 previewfile:
1373 description: Video preview file
1374 type: string
1375 format: binary
1376 privacy:
1377 $ref: '#/components/schemas/VideoPrivacySet'
1378 category:
1379 description: Video category
1380 type: integer
1381 example: 4
1382 licence:
1383 description: Video licence
1384 type: integer
1385 example: 2
1386 language:
1387 description: Video language
1388 type: string
1389 description:
1390 description: Video description
1391 type: string
1392 waitTranscoding:
1393 description: Whether or not we wait transcoding before publish the video
1394 type: boolean
1395 support:
1396 description: A text tell the audience how to support the video creator
1397 example: Please support my work on <insert crowdfunding plateform>! <3
1398 type: string
1399 nsfw:
1400 description: Whether or not this video contains sensitive content
1401 type: boolean
1402 name:
1403 description: Video name
1404 type: string
1405 minLength: 3
1406 maxLength: 120
1407 tags:
1408 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1409 type: array
1410 minItems: 1
1411 maxItems: 5
1412 uniqueItems: true
1413 items:
1414 type: string
1415 minLength: 2
1416 maxLength: 30
1417 commentsEnabled:
1418 description: Enable or disable comments for this video
1419 type: boolean
1420 downloadEnabled:
1421 description: Enable or disable downloading for this video
1422 type: boolean
1423 originallyPublishedAt:
1424 description: Date when the content was originally published
1425 type: string
1426 format: date-time
1427 scheduleUpdate:
1428 $ref: '#/components/schemas/VideoScheduledUpdate'
1429 required:
1430 - videofile
1431 - channelId
1432 - name
1433 encoding: 1829 encoding:
1434 videofile: 1830 videofile:
1435 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream 1831 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
@@ -1437,7 +1833,7 @@ paths:
1437 contentType: image/jpeg 1833 contentType: image/jpeg
1438 previewfile: 1834 previewfile:
1439 contentType: image/jpeg 1835 contentType: image/jpeg
1440 x-code-samples: 1836 x-codeSamples:
1441 - lang: Shell 1837 - lang: Shell
1442 source: | 1838 source: |
1443 ## DEPENDENCIES: jq 1839 ## DEPENDENCIES: jq
@@ -1446,112 +1842,204 @@ paths:
1446 FILE_PATH="<your_file_path>" 1842 FILE_PATH="<your_file_path>"
1447 CHANNEL_ID="<your_channel_id>" 1843 CHANNEL_ID="<your_channel_id>"
1448 NAME="<video_name>" 1844 NAME="<video_name>"
1845 API="https://peertube2.cpy.re/api/v1"
1449 1846
1450 API_PATH="https://peertube2.cpy.re/api/v1"
1451 ## AUTH 1847 ## AUTH
1452 client_id=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_id") 1848 client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id")
1453 client_secret=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_secret") 1849 client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret")
1454 token=$(curl -s "$API_PATH/users/token" \ 1850 token=$(curl -s "$API/users/token" \
1455 --data client_id="$client_id" \ 1851 --data client_id="$client_id" \
1456 --data client_secret="$client_secret" \ 1852 --data client_secret="$client_secret" \
1457 --data grant_type=password \ 1853 --data grant_type=password \
1458 --data response_type=code \
1459 --data username="$USERNAME" \ 1854 --data username="$USERNAME" \
1460 --data password="$PASSWORD" \ 1855 --data password="$PASSWORD" \
1461 | jq -r ".access_token") 1856 | jq -r ".access_token")
1857
1462 ## VIDEO UPLOAD 1858 ## VIDEO UPLOAD
1463 curl -s "$API_PATH/videos/upload" \ 1859 curl -s "$API/videos/upload" \
1464 -H "Authorization: Bearer $token" \ 1860 -H "Authorization: Bearer $token" \
1465 --max-time 600 \ 1861 --max-time 600 \
1466 --form videofile=@"$FILE_PATH" \ 1862 --form videofile=@"$FILE_PATH" \
1467 --form channelId=$CHANNEL_ID \ 1863 --form channelId=$CHANNEL_ID \
1468 --form name="$NAME" 1864 --form name="$NAME"
1865
1866 /videos/upload-resumable:
1867 post:
1868 summary: Initialize the resumable upload of a video
1869 description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to initialize the upload of a video
1870 operationId: uploadResumableInit
1871 security:
1872 - OAuth2: []
1873 tags:
1874 - Video
1875 - Video Upload
1876 parameters:
1877 - name: X-Upload-Content-Length
1878 in: header
1879 schema:
1880 type: number
1881 example: 2469036
1882 required: true
1883 description: Number of bytes that will be uploaded in subsequent requests. Set this value to the size of the file you are uploading.
1884 - name: X-Upload-Content-Type
1885 in: header
1886 schema:
1887 type: string
1888 format: mimetype
1889 example: video/mp4
1890 required: true
1891 description: MIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary.
1892 requestBody:
1893 content:
1894 application/json:
1895 schema:
1896 $ref: '#/components/schemas/VideoUploadRequestResumable'
1897 responses:
1898 '200':
1899 description: file already exists, send a [`resume`](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) request instead
1900 '201':
1901 description: created
1902 headers:
1903 Location:
1904 schema:
1905 type: string
1906 format: url
1907 example: /api/v1/videos/upload-resumable?upload_id=471e97554f21dec3b8bb5d4602939c51
1908 Content-Length:
1909 schema:
1910 type: number
1911 example: 0
1912 '400':
1913 description: invalid file field, schedule date or parameter
1914 '413':
1915 description: video file too large, due to quota, absolute max file size or concurrent partial upload limit
1916 '415':
1917 description: video type unsupported
1918 put:
1919 summary: Send chunk for the resumable upload of a video
1920 description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to continue, pause or resume the upload of a video
1921 operationId: uploadResumable
1922 security:
1923 - OAuth2: []
1924 tags:
1925 - Video
1926 - Video Upload
1927 parameters:
1928 - name: upload_id
1929 in: query
1930 required: true
1931 description: |
1932 Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is
1933 not valid anymore and you need to initialize a new upload.
1934 schema:
1935 type: string
1936 - name: Content-Range
1937 in: header
1938 schema:
1939 type: string
1940 example: bytes 0-262143/2469036
1941 required: true
1942 description: |
1943 Specifies the bytes in the file that the request is uploading.
1944
1945 For example, a value of `bytes 0-262143/1000000` shows that the request is sending the first
1946 262144 bytes (256 x 1024) in a 2,469,036 byte file.
1947 - name: Content-Length
1948 in: header
1949 schema:
1950 type: number
1951 example: 262144
1952 required: true
1953 description: |
1954 Size of the chunk that the request is sending.
1955
1956 The chunk size __must be a multiple of 256 KB__, and unlike [Google Resumable](https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol)
1957 doesn't mandate for chunks to have the same size throughout the upload sequence.
1958
1959 Remember that larger chunks are more efficient. PeerTube's web client uses chunks varying from
1960 1048576 bytes (~1MB) and increases or reduces size depending on connection health.
1961 requestBody:
1962 content:
1963 application/octet-stream:
1964 schema:
1965 type: string
1966 format: binary
1967 responses:
1968 '200':
1969 description: last chunk received
1970 headers:
1971 Content-Length:
1972 schema:
1973 type: number
1974 content:
1975 application/json:
1976 schema:
1977 $ref: '#/components/schemas/VideoUploadResponse'
1978 '308':
1979 description: resume incomplete
1980 headers:
1981 Range:
1982 schema:
1983 type: string
1984 example: bytes=0-262143
1985 Content-Length:
1986 schema:
1987 type: number
1988 example: 0
1989 '403':
1990 description: video didn't pass upload filter
1991 '413':
1992 description: video file too large, due to quota or max body size limit set by the reverse-proxy
1993 '422':
1994 description: video unreadable
1995 delete:
1996 summary: Cancel the resumable upload of a video, deleting any data uploaded so far
1997 description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the upload of a video
1998 operationId: uploadResumableCancel
1999 security:
2000 - OAuth2: []
2001 tags:
2002 - Video
2003 - Video Upload
2004 parameters:
2005 - name: upload_id
2006 in: query
2007 required: true
2008 description: |
2009 Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is
2010 not valid anymore and the upload session has already been deleted with its data ;-)
2011 schema:
2012 type: string
2013 - name: Content-Length
2014 in: header
2015 required: true
2016 schema:
2017 type: number
2018 example: 0
2019 responses:
2020 '204':
2021 description: upload cancelled
2022 headers:
2023 Content-Length:
2024 schema:
2025 type: number
2026 example: 0
2027
1469 /videos/imports: 2028 /videos/imports:
1470 post: 2029 post:
1471 summary: Import a video 2030 summary: Import a video
1472 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator) 2031 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
2032 operationId: importVideo
1473 security: 2033 security:
1474 - OAuth2: [] 2034 - OAuth2: []
1475 tags: 2035 tags:
1476 - Video 2036 - Video
2037 - Video Upload
1477 requestBody: 2038 requestBody:
1478 content: 2039 content:
1479 multipart/form-data: 2040 multipart/form-data:
1480 schema: 2041 schema:
1481 type: object 2042 $ref: '#/components/schemas/VideoCreateImport'
1482 properties:
1483 torrentfile:
1484 description: Torrent File
1485 type: string
1486 format: binary
1487 targetUrl:
1488 description: HTTP target URL
1489 type: string
1490 magnetUri:
1491 description: Magnet URI
1492 type: string
1493 channelId:
1494 description: Channel id that will contain this video
1495 type: integer
1496 thumbnailfile:
1497 description: Video thumbnail file
1498 type: string
1499 format: binary
1500 previewfile:
1501 description: Video preview file
1502 type: string
1503 format: binary
1504 privacy:
1505 $ref: '#/components/schemas/VideoPrivacySet'
1506 category:
1507 description: Video category
1508 type: integer
1509 example: 4
1510 licence:
1511 description: Video licence
1512 type: integer
1513 example: 2
1514 language:
1515 description: Video language
1516 type: string
1517 description:
1518 description: Video description
1519 type: string
1520 waitTranscoding:
1521 description: Whether or not we wait transcoding before publish the video
1522 type: boolean
1523 support:
1524 description: A text tell the audience how to support the video creator
1525 example: Please support my work on <insert crowdfunding plateform>! <3
1526 type: string
1527 nsfw:
1528 description: Whether or not this video contains sensitive content
1529 type: boolean
1530 name:
1531 description: Video name
1532 type: string
1533 minLength: 3
1534 maxLength: 120
1535 tags:
1536 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1537 type: array
1538 minItems: 1
1539 maxItems: 5
1540 items:
1541 type: string
1542 minLength: 2
1543 maxLength: 30
1544 commentsEnabled:
1545 description: Enable or disable comments for this video
1546 type: boolean
1547 downloadEnabled:
1548 description: Enable or disable downloading for this video
1549 type: boolean
1550 scheduleUpdate:
1551 $ref: '#/components/schemas/VideoScheduledUpdate'
1552 required:
1553 - channelId
1554 - name
1555 encoding: 2043 encoding:
1556 torrentfile: 2044 torrentfile:
1557 contentType: application/x-bittorrent 2045 contentType: application/x-bittorrent
@@ -1576,6 +2064,7 @@ paths:
1576 /videos/live: 2064 /videos/live:
1577 post: 2065 post:
1578 summary: Create a live 2066 summary: Create a live
2067 operationId: addLive
1579 security: 2068 security:
1580 - OAuth2: [] 2069 - OAuth2: []
1581 tags: 2070 tags:
@@ -1589,7 +2078,7 @@ paths:
1589 schema: 2078 schema:
1590 $ref: '#/components/schemas/VideoUploadResponse' 2079 $ref: '#/components/schemas/VideoUploadResponse'
1591 '403': 2080 '403':
1592 description: Live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded 2081 description: live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded
1593 requestBody: 2082 requestBody:
1594 content: 2083 content:
1595 multipart/form-data: 2084 multipart/form-data:
@@ -1615,20 +2104,17 @@ paths:
1615 privacy: 2104 privacy:
1616 $ref: '#/components/schemas/VideoPrivacySet' 2105 $ref: '#/components/schemas/VideoPrivacySet'
1617 category: 2106 category:
1618 description: Live video/replay category 2107 $ref: '#/components/schemas/VideoCategorySet'
1619 type: string
1620 licence: 2108 licence:
1621 description: Live video/replay licence 2109 $ref: '#/components/schemas/VideoLicenceSet'
1622 type: string
1623 language: 2110 language:
1624 description: Live video/replay language 2111 $ref: '#/components/schemas/VideoLanguageSet'
1625 type: string
1626 description: 2112 description:
1627 description: Live video/replay description 2113 description: Live video/replay description
1628 type: string 2114 type: string
1629 support: 2115 support:
1630 description: A text tell the audience how to support the creator 2116 description: A text tell the audience how to support the creator
1631 example: Please support my work on <insert crowdfunding plateform>! <3 2117 example: Please support our work on https://soutenir.framasoft.org/en/ <3
1632 type: string 2118 type: string
1633 nsfw: 2119 nsfw:
1634 description: Whether or not this live video/replay contains sensitive content 2120 description: Whether or not this live video/replay contains sensitive content
@@ -1664,7 +2150,8 @@ paths:
1664 2150
1665 /videos/live/{id}: 2151 /videos/live/{id}:
1666 get: 2152 get:
1667 summary: Get a live information 2153 summary: Get information about a live
2154 operationId: getLiveId
1668 security: 2155 security:
1669 - OAuth2: [] 2156 - OAuth2: []
1670 tags: 2157 tags:
@@ -1680,7 +2167,8 @@ paths:
1680 schema: 2167 schema:
1681 $ref: '#/components/schemas/LiveVideoResponse' 2168 $ref: '#/components/schemas/LiveVideoResponse'
1682 put: 2169 put:
1683 summary: Update a live information 2170 summary: Update information about a live
2171 operationId: updateLiveId
1684 security: 2172 security:
1685 - OAuth2: [] 2173 - OAuth2: []
1686 tags: 2174 tags:
@@ -1695,15 +2183,16 @@ paths:
1695 $ref: '#/components/schemas/LiveVideoUpdate' 2183 $ref: '#/components/schemas/LiveVideoUpdate'
1696 responses: 2184 responses:
1697 '204': 2185 '204':
1698 description: Successful operation 2186 description: successful operation
1699 '400': 2187 '400':
1700 description: Bad parameters or trying to update a live that has already started 2188 description: bad parameters or trying to update a live that has already started
1701 '403': 2189 '403':
1702 description: Trying to save replay of the live but saving replay is not enabled on the instance 2190 description: trying to save replay of the live but saving replay is not enabled on the instance
1703 2191
1704 /users/me/abuses: 2192 /users/me/abuses:
1705 get: 2193 get:
1706 summary: List my abuses 2194 summary: List my abuses
2195 operationId: getMyAbuses
1707 security: 2196 security:
1708 - OAuth2: [] 2197 - OAuth2: []
1709 tags: 2198 tags:
@@ -1719,22 +2208,29 @@ paths:
1719 in: query 2208 in: query
1720 schema: 2209 schema:
1721 $ref: '#/components/schemas/AbuseStateSet' 2210 $ref: '#/components/schemas/AbuseStateSet'
2211 - $ref: '#/components/parameters/abusesSort'
1722 - $ref: '#/components/parameters/start' 2212 - $ref: '#/components/parameters/start'
1723 - $ref: '#/components/parameters/count' 2213 - $ref: '#/components/parameters/count'
1724 - $ref: '#/components/parameters/abusesSort'
1725 responses: 2214 responses:
1726 '200': 2215 '200':
1727 description: successful operation 2216 description: successful operation
1728 content: 2217 content:
1729 application/json: 2218 application/json:
1730 schema: 2219 schema:
1731 type: array 2220 type: object
1732 items: 2221 properties:
1733 $ref: '#/components/schemas/Abuse' 2222 total:
2223 type: integer
2224 example: 1
2225 data:
2226 type: array
2227 items:
2228 $ref: '#/components/schemas/Abuse'
1734 2229
1735 /abuses: 2230 /abuses:
1736 get: 2231 get:
1737 summary: List abuses 2232 summary: List abuses
2233 operationId: getAbuses
1738 security: 2234 security:
1739 - OAuth2: 2235 - OAuth2:
1740 - admin 2236 - admin
@@ -1807,10 +2303,15 @@ paths:
1807 content: 2303 content:
1808 application/json: 2304 application/json:
1809 schema: 2305 schema:
1810 type: array 2306 type: object
1811 items: 2307 properties:
1812 $ref: '#/components/schemas/Abuse' 2308 total:
1813 2309 type: integer
2310 example: 1
2311 data:
2312 type: array
2313 items:
2314 $ref: '#/components/schemas/Abuse'
1814 post: 2315 post:
1815 summary: Report an abuse 2316 summary: Report an abuse
1816 security: 2317 security:
@@ -1836,13 +2337,16 @@ paths:
1836 properties: 2337 properties:
1837 id: 2338 id:
1838 description: Video id to report 2339 description: Video id to report
1839 type: number 2340 allOf:
2341 - $ref: '#/components/schemas/Video/properties/id'
1840 startAt: 2342 startAt:
1841 type: integer 2343 type: integer
2344 format: seconds
1842 description: Timestamp in the video that marks the beginning of the report 2345 description: Timestamp in the video that marks the beginning of the report
1843 minimum: 0 2346 minimum: 0
1844 endAt: 2347 endAt:
1845 type: integer 2348 type: integer
2349 format: seconds
1846 description: Timestamp in the video that marks the ending of the report 2350 description: Timestamp in the video that marks the ending of the report
1847 minimum: 0 2351 minimum: 0
1848 comment: 2352 comment:
@@ -1850,20 +2354,32 @@ paths:
1850 properties: 2354 properties:
1851 id: 2355 id:
1852 description: Comment id to report 2356 description: Comment id to report
1853 type: number 2357 allOf:
2358 - $ref: '#/components/schemas/VideoComment/properties/id'
1854 account: 2359 account:
1855 type: object 2360 type: object
1856 properties: 2361 properties:
1857 id: 2362 id:
1858 description: Account id to report 2363 description: Account id to report
1859 type: number 2364 type: integer
1860 required: 2365 required:
1861 - reason 2366 - reason
1862 responses: 2367 responses:
1863 '204': 2368 '200':
1864 description: successful operation 2369 description: successful operation
2370 content:
2371 application/json:
2372 schema:
2373 type: object
2374 properties:
2375 abuse:
2376 type: object
2377 properties:
2378 id:
2379 $ref: '#/components/schemas/id'
1865 '400': 2380 '400':
1866 description: incorrect request parameters 2381 description: incorrect request parameters
2382
1867 '/abuses/{abuseId}': 2383 '/abuses/{abuseId}':
1868 put: 2384 put:
1869 summary: Update an abuse 2385 summary: Update an abuse
@@ -1908,6 +2424,7 @@ paths:
1908 description: successful operation 2424 description: successful operation
1909 '404': 2425 '404':
1910 description: block not found 2426 description: block not found
2427
1911 '/abuses/{abuseId}/messages': 2428 '/abuses/{abuseId}/messages':
1912 get: 2429 get:
1913 summary: List messages of an abuse 2430 summary: List messages of an abuse
@@ -1923,10 +2440,15 @@ paths:
1923 content: 2440 content:
1924 application/json: 2441 application/json:
1925 schema: 2442 schema:
1926 type: array 2443 type: object
1927 items: 2444 properties:
1928 $ref: '#/components/schemas/AbuseMessage' 2445 total:
1929 2446 type: integer
2447 example: 1
2448 data:
2449 type: array
2450 items:
2451 $ref: '#/components/schemas/AbuseMessage'
1930 post: 2452 post:
1931 summary: Add message to an abuse 2453 summary: Add message to an abuse
1932 security: 2454 security:
@@ -1954,6 +2476,7 @@ paths:
1954 description: successful operation 2476 description: successful operation
1955 '400': 2477 '400':
1956 description: incorrect request parameters 2478 description: incorrect request parameters
2479
1957 '/abuses/{abuseId}/messages/{abuseMessageId}': 2480 '/abuses/{abuseId}/messages/{abuseMessageId}':
1958 delete: 2481 delete:
1959 summary: Delete an abuse message 2482 summary: Delete an abuse message
@@ -1971,6 +2494,7 @@ paths:
1971 '/videos/{id}/blacklist': 2494 '/videos/{id}/blacklist':
1972 post: 2495 post:
1973 summary: Block a video 2496 summary: Block a video
2497 operationId: addVideoBlock
1974 security: 2498 security:
1975 - OAuth2: 2499 - OAuth2:
1976 - admin 2500 - admin
@@ -1984,6 +2508,7 @@ paths:
1984 description: successful operation 2508 description: successful operation
1985 delete: 2509 delete:
1986 summary: Unblock a video by its id 2510 summary: Unblock a video by its id
2511 operationId: delVideoBlock
1987 security: 2512 security:
1988 - OAuth2: 2513 - OAuth2:
1989 - admin 2514 - admin
@@ -1997,11 +2522,13 @@ paths:
1997 description: successful operation 2522 description: successful operation
1998 '404': 2523 '404':
1999 description: block not found 2524 description: block not found
2525
2000 /videos/blacklist: 2526 /videos/blacklist:
2001 get: 2527 get:
2002 tags: 2528 tags:
2003 - Video Blocks 2529 - Video Blocks
2004 summary: List video blocks 2530 summary: List video blocks
2531 operationId: getVideoBlocks
2005 security: 2532 security:
2006 - OAuth2: 2533 - OAuth2:
2007 - admin 2534 - admin
@@ -2043,9 +2570,11 @@ paths:
2043 type: array 2570 type: array
2044 items: 2571 items:
2045 $ref: '#/components/schemas/VideoBlacklist' 2572 $ref: '#/components/schemas/VideoBlacklist'
2573
2046 /videos/{id}/captions: 2574 /videos/{id}/captions:
2047 get: 2575 get:
2048 summary: List captions of a video 2576 summary: List captions of a video
2577 operationId: getVideoCaptions
2049 tags: 2578 tags:
2050 - Video Captions 2579 - Video Captions
2051 parameters: 2580 parameters:
@@ -2065,9 +2594,11 @@ paths:
2065 type: array 2594 type: array
2066 items: 2595 items:
2067 $ref: '#/components/schemas/VideoCaption' 2596 $ref: '#/components/schemas/VideoCaption'
2597
2068 /videos/{id}/captions/{captionLanguage}: 2598 /videos/{id}/captions/{captionLanguage}:
2069 put: 2599 put:
2070 summary: Add or replace a video caption 2600 summary: Add or replace a video caption
2601 operationId: addVideoCaption
2071 security: 2602 security:
2072 - OAuth2: 2603 - OAuth2:
2073 - user 2604 - user
@@ -2096,6 +2627,7 @@ paths:
2096 description: video or language not found 2627 description: video or language not found
2097 delete: 2628 delete:
2098 summary: Delete a video caption 2629 summary: Delete a video caption
2630 operationId: delVideoCaption
2099 security: 2631 security:
2100 - OAuth2: 2632 - OAuth2:
2101 - user 2633 - user
@@ -2109,9 +2641,11 @@ paths:
2109 description: successful operation 2641 description: successful operation
2110 '404': 2642 '404':
2111 description: video or language or caption for that language not found 2643 description: video or language or caption for that language not found
2644
2112 /video-channels: 2645 /video-channels:
2113 get: 2646 get:
2114 summary: List video channels 2647 summary: List video channels
2648 operationId: getVideoChannels
2115 tags: 2649 tags:
2116 - Video Channels 2650 - Video Channels
2117 parameters: 2651 parameters:
@@ -2124,17 +2658,10 @@ paths:
2124 content: 2658 content:
2125 application/json: 2659 application/json:
2126 schema: 2660 schema:
2127 type: object 2661 $ref: '#/components/schemas/VideoChannelList'
2128 properties:
2129 total:
2130 type: integer
2131 example: 1
2132 data:
2133 type: array
2134 items:
2135 $ref: '#/components/schemas/VideoChannel'
2136 post: 2662 post:
2137 summary: Create a video channel 2663 summary: Create a video channel
2664 operationId: addVideoChannel
2138 security: 2665 security:
2139 - OAuth2: [] 2666 - OAuth2: []
2140 tags: 2667 tags:
@@ -2142,14 +2669,26 @@ paths:
2142 responses: 2669 responses:
2143 '204': 2670 '204':
2144 description: successful operation 2671 description: successful operation
2672 content:
2673 application/json:
2674 schema:
2675 type: object
2676 properties:
2677 videoChannel:
2678 type: object
2679 properties:
2680 id:
2681 $ref: '#/components/schemas/VideoChannel/properties/id'
2145 requestBody: 2682 requestBody:
2146 content: 2683 content:
2147 application/json: 2684 application/json:
2148 schema: 2685 schema:
2149 $ref: '#/components/schemas/VideoChannelCreate' 2686 $ref: '#/components/schemas/VideoChannelCreate'
2687
2150 '/video-channels/{channelHandle}': 2688 '/video-channels/{channelHandle}':
2151 get: 2689 get:
2152 summary: Get a video channel 2690 summary: Get a video channel
2691 operationId: getVideoChannel
2153 tags: 2692 tags:
2154 - Video Channels 2693 - Video Channels
2155 parameters: 2694 parameters:
@@ -2163,6 +2702,7 @@ paths:
2163 $ref: '#/components/schemas/VideoChannel' 2702 $ref: '#/components/schemas/VideoChannel'
2164 put: 2703 put:
2165 summary: Update a video channel 2704 summary: Update a video channel
2705 operationId: putVideoChannel
2166 security: 2706 security:
2167 - OAuth2: [] 2707 - OAuth2: []
2168 tags: 2708 tags:
@@ -2179,6 +2719,7 @@ paths:
2179 $ref: '#/components/schemas/VideoChannelUpdate' 2719 $ref: '#/components/schemas/VideoChannelUpdate'
2180 delete: 2720 delete:
2181 summary: Delete a video channel 2721 summary: Delete a video channel
2722 operationId: delVideoChannel
2182 security: 2723 security:
2183 - OAuth2: [] 2724 - OAuth2: []
2184 tags: 2725 tags:
@@ -2188,9 +2729,11 @@ paths:
2188 responses: 2729 responses:
2189 '204': 2730 '204':
2190 description: successful operation 2731 description: successful operation
2732
2191 '/video-channels/{channelHandle}/videos': 2733 '/video-channels/{channelHandle}/videos':
2192 get: 2734 get:
2193 summary: List videos of a video channel 2735 summary: List videos of a video channel
2736 operationId: getVideoChannelVideos
2194 tags: 2737 tags:
2195 - Video 2738 - Video
2196 - Video Channels 2739 - Video Channels
@@ -2215,6 +2758,7 @@ paths:
2215 application/json: 2758 application/json:
2216 schema: 2759 schema:
2217 $ref: '#/components/schemas/VideoListResponse' 2760 $ref: '#/components/schemas/VideoListResponse'
2761
2218 '/video-channels/{channelHandle}/avatar/pick': 2762 '/video-channels/{channelHandle}/avatar/pick':
2219 post: 2763 post:
2220 summary: Update channel avatar 2764 summary: Update channel avatar
@@ -2255,6 +2799,7 @@ paths:
2255 encoding: 2799 encoding:
2256 avatarfile: 2800 avatarfile:
2257 contentType: image/png, image/jpeg 2801 contentType: image/png, image/jpeg
2802
2258 '/video-channels/{channelHandle}/avatar': 2803 '/video-channels/{channelHandle}/avatar':
2259 delete: 2804 delete:
2260 summary: Delete channel avatar 2805 summary: Delete channel avatar
@@ -2268,7 +2813,6 @@ paths:
2268 '204': 2813 '204':
2269 description: successful operation 2814 description: successful operation
2270 2815
2271
2272 '/video-channels/{channelHandle}/banner/pick': 2816 '/video-channels/{channelHandle}/banner/pick':
2273 post: 2817 post:
2274 summary: Update channel banner 2818 summary: Update channel banner
@@ -2309,6 +2853,7 @@ paths:
2309 encoding: 2853 encoding:
2310 bannerfile: 2854 bannerfile:
2311 contentType: image/png, image/jpeg 2855 contentType: image/png, image/jpeg
2856
2312 '/video-channels/{channelHandle}/banner': 2857 '/video-channels/{channelHandle}/banner':
2313 delete: 2858 delete:
2314 summary: Delete channel banner 2859 summary: Delete channel banner
@@ -2324,7 +2869,8 @@ paths:
2324 2869
2325 /video-playlists/privacies: 2870 /video-playlists/privacies:
2326 get: 2871 get:
2327 summary: List available playlist privacies 2872 summary: List available playlist privacy policies
2873 operationId: getPlaylistPrivacyPolicies
2328 tags: 2874 tags:
2329 - Video Playlists 2875 - Video Playlists
2330 responses: 2876 responses:
@@ -2343,6 +2889,7 @@ paths:
2343 /video-playlists: 2889 /video-playlists:
2344 get: 2890 get:
2345 summary: List video playlists 2891 summary: List video playlists
2892 operationId: getPlaylists
2346 tags: 2893 tags:
2347 - Video Playlists 2894 - Video Playlists
2348 parameters: 2895 parameters:
@@ -2366,7 +2913,8 @@ paths:
2366 $ref: '#/components/schemas/VideoPlaylist' 2913 $ref: '#/components/schemas/VideoPlaylist'
2367 post: 2914 post:
2368 summary: Create a video playlist 2915 summary: Create a video playlist
2369 description: 'If the video playlist is set as public, the videoChannelId is mandatory.' 2916 description: If the video playlist is set as public, `videoChannelId` is mandatory.
2917 operationId: addPlaylist
2370 security: 2918 security:
2371 - OAuth2: [] 2919 - OAuth2: []
2372 tags: 2920 tags:
@@ -2383,9 +2931,9 @@ paths:
2383 type: object 2931 type: object
2384 properties: 2932 properties:
2385 id: 2933 id:
2386 type: integer 2934 $ref: '#/components/schemas/VideoPlaylist/properties/id'
2387 uuid: 2935 uuid:
2388 $ref: '#/components/schemas/UUIDv4' 2936 $ref: '#/components/schemas/VideoPlaylist/properties/uuid'
2389 requestBody: 2937 requestBody:
2390 content: 2938 content:
2391 multipart/form-data: 2939 multipart/form-data:
@@ -2406,22 +2954,25 @@ paths:
2406 description: 2954 description:
2407 description: Video playlist description 2955 description: Video playlist description
2408 type: string 2956 type: string
2957 minLength: 3
2958 maxLength: 1000
2409 videoChannelId: 2959 videoChannelId:
2960 allOf:
2961 - $ref: '#/components/schemas/id'
2410 description: Video channel in which the playlist will be published 2962 description: Video channel in which the playlist will be published
2411 type: integer
2412 required: 2963 required:
2413 - displayName 2964 - displayName
2414 encoding: 2965 encoding:
2415 thumbnailfile: 2966 thumbnailfile:
2416 contentType: image/jpeg 2967 contentType: image/jpeg
2417 2968
2418 /video-playlists/{id}: 2969 /video-playlists/{playlistId}:
2419 get: 2970 get:
2420 summary: Get a video playlist 2971 summary: Get a video playlist
2421 tags: 2972 tags:
2422 - Video Playlists 2973 - Video Playlists
2423 parameters: 2974 parameters:
2424 - $ref: '#/components/parameters/idOrUUID' 2975 - $ref: '#/components/parameters/playlistId'
2425 responses: 2976 responses:
2426 '200': 2977 '200':
2427 description: successful operation 2978 description: successful operation
@@ -2440,7 +2991,7 @@ paths:
2440 '204': 2991 '204':
2441 description: successful operation 2992 description: successful operation
2442 parameters: 2993 parameters:
2443 - $ref: '#/components/parameters/idOrUUID' 2994 - $ref: '#/components/parameters/playlistId'
2444 requestBody: 2995 requestBody:
2445 content: 2996 content:
2446 multipart/form-data: 2997 multipart/form-data:
@@ -2462,8 +3013,9 @@ paths:
2462 description: Video playlist description 3013 description: Video playlist description
2463 type: string 3014 type: string
2464 videoChannelId: 3015 videoChannelId:
3016 allOf:
3017 - $ref: '#/components/schemas/id'
2465 description: Video channel in which the playlist will be published 3018 description: Video channel in which the playlist will be published
2466 type: integer
2467 encoding: 3019 encoding:
2468 thumbnailfile: 3020 thumbnailfile:
2469 contentType: image/jpeg 3021 contentType: image/jpeg
@@ -2474,19 +3026,20 @@ paths:
2474 tags: 3026 tags:
2475 - Video Playlists 3027 - Video Playlists
2476 parameters: 3028 parameters:
2477 - $ref: '#/components/parameters/idOrUUID' 3029 - $ref: '#/components/parameters/playlistId'
2478 responses: 3030 responses:
2479 '204': 3031 '204':
2480 description: successful operation 3032 description: successful operation
2481 3033
2482 /video-playlists/{id}/videos: 3034 /video-playlists/{playlistId}/videos:
2483 get: 3035 get:
2484 summary: 'List videos of a playlist' 3036 summary: 'List videos of a playlist'
3037 operationId: getVideoPlaylistVideos
2485 tags: 3038 tags:
2486 - Videos 3039 - Videos
2487 - Video Playlists 3040 - Video Playlists
2488 parameters: 3041 parameters:
2489 - $ref: '#/components/parameters/idOrUUID' 3042 - $ref: '#/components/parameters/playlistId'
2490 responses: 3043 responses:
2491 '200': 3044 '200':
2492 description: successful operation 3045 description: successful operation
@@ -2495,14 +3048,15 @@ paths:
2495 schema: 3048 schema:
2496 $ref: '#/components/schemas/VideoListResponse' 3049 $ref: '#/components/schemas/VideoListResponse'
2497 post: 3050 post:
2498 summary: 'Add a video in a playlist' 3051 summary: Add a video in a playlist
3052 operationId: addVideoPlaylistVideo
2499 security: 3053 security:
2500 - OAuth2: [] 3054 - OAuth2: []
2501 tags: 3055 tags:
2502 - Videos 3056 - Videos
2503 - Video Playlists 3057 - Video Playlists
2504 parameters: 3058 parameters:
2505 - $ref: '#/components/parameters/idOrUUID' 3059 - $ref: '#/components/parameters/playlistId'
2506 responses: 3060 responses:
2507 '200': 3061 '200':
2508 description: successful operation 3062 description: successful operation
@@ -2516,6 +3070,7 @@ paths:
2516 properties: 3070 properties:
2517 id: 3071 id:
2518 type: integer 3072 type: integer
3073 example: 2
2519 requestBody: 3074 requestBody:
2520 content: 3075 content:
2521 application/json: 3076 application/json:
@@ -2523,26 +3078,31 @@ paths:
2523 type: object 3078 type: object
2524 properties: 3079 properties:
2525 videoId: 3080 videoId:
2526 type: integer 3081 oneOf:
2527 description: 'Video to add in the playlist' 3082 - $ref: '#/components/schemas/Video/properties/uuid'
3083 - $ref: '#/components/schemas/Video/properties/id'
3084 description: Video to add in the playlist
2528 startTimestamp: 3085 startTimestamp:
2529 type: integer 3086 type: integer
2530 description: 'Start the video at this specific timestamp (in seconds)' 3087 format: seconds
3088 description: Start the video at this specific timestamp
2531 stopTimestamp: 3089 stopTimestamp:
2532 type: integer 3090 type: integer
2533 description: 'Stop the video at this specific timestamp (in seconds)' 3091 format: seconds
3092 description: Stop the video at this specific timestamp
2534 required: 3093 required:
2535 - videoId 3094 - videoId
2536 3095
2537 /video-playlists/{id}/videos/reorder: 3096 /video-playlists/{playlistId}/videos/reorder:
2538 post: 3097 post:
2539 summary: 'Reorder a playlist' 3098 summary: 'Reorder a playlist'
3099 operationId: reorderVideoPlaylist
2540 security: 3100 security:
2541 - OAuth2: [] 3101 - OAuth2: []
2542 tags: 3102 tags:
2543 - Video Playlists 3103 - Video Playlists
2544 parameters: 3104 parameters:
2545 - $ref: '#/components/parameters/idOrUUID' 3105 - $ref: '#/components/parameters/playlistId'
2546 responses: 3106 responses:
2547 '204': 3107 '204':
2548 description: successful operation 3108 description: successful operation
@@ -2568,15 +3128,16 @@ paths:
2568 - startPosition 3128 - startPosition
2569 - insertAfterPosition 3129 - insertAfterPosition
2570 3130
2571 /video-playlists/{id}/videos/{playlistElementId}: 3131 /video-playlists/{playlistId}/videos/{playlistElementId}:
2572 put: 3132 put:
2573 summary: 'Update a playlist element' 3133 summary: Update a playlist element
3134 operationId: putVideoPlaylistVideo
2574 security: 3135 security:
2575 - OAuth2: [] 3136 - OAuth2: []
2576 tags: 3137 tags:
2577 - Video Playlists 3138 - Video Playlists
2578 parameters: 3139 parameters:
2579 - $ref: '#/components/parameters/idOrUUID' 3140 - $ref: '#/components/parameters/playlistId'
2580 - $ref: '#/components/parameters/playlistElementId' 3141 - $ref: '#/components/parameters/playlistElementId'
2581 responses: 3142 responses:
2582 '204': 3143 '204':
@@ -2589,18 +3150,21 @@ paths:
2589 properties: 3150 properties:
2590 startTimestamp: 3151 startTimestamp:
2591 type: integer 3152 type: integer
2592 description: 'Start the video at this specific timestamp (in seconds)' 3153 format: seconds
3154 description: Start the video at this specific timestamp
2593 stopTimestamp: 3155 stopTimestamp:
2594 type: integer 3156 type: integer
2595 description: 'Stop the video at this specific timestamp (in seconds)' 3157 format: seconds
3158 description: Stop the video at this specific timestamp
2596 delete: 3159 delete:
2597 summary: 'Delete an element from a playlist' 3160 summary: Delete an element from a playlist
3161 operationId: delVideoPlaylistVideo
2598 security: 3162 security:
2599 - OAuth2: [] 3163 - OAuth2: []
2600 tags: 3164 tags:
2601 - Video Playlists 3165 - Video Playlists
2602 parameters: 3166 parameters:
2603 - $ref: '#/components/parameters/idOrUUID' 3167 - $ref: '#/components/parameters/playlistId'
2604 - $ref: '#/components/parameters/playlistElementId' 3168 - $ref: '#/components/parameters/playlistElementId'
2605 responses: 3169 responses:
2606 '204': 3170 '204':
@@ -2608,7 +3172,7 @@ paths:
2608 3172
2609 '/users/me/video-playlists/videos-exist': 3173 '/users/me/video-playlists/videos-exist':
2610 get: 3174 get:
2611 summary: 'Check video exists in my playlists' 3175 summary: Check video exists in my playlists
2612 security: 3176 security:
2613 - OAuth2: [] 3177 - OAuth2: []
2614 tags: 3178 tags:
@@ -2621,7 +3185,7 @@ paths:
2621 schema: 3185 schema:
2622 type: array 3186 type: array
2623 items: 3187 items:
2624 type: integer 3188 $ref: '#/components/schemas/Video/properties/id'
2625 responses: 3189 responses:
2626 '200': 3190 '200':
2627 description: successful operation 3191 description: successful operation
@@ -2641,8 +3205,10 @@ paths:
2641 type: integer 3205 type: integer
2642 startTimestamp: 3206 startTimestamp:
2643 type: integer 3207 type: integer
3208 format: seconds
2644 stopTimestamp: 3209 stopTimestamp:
2645 type: integer 3210 type: integer
3211 format: seconds
2646 3212
2647 '/accounts/{name}/video-channels': 3213 '/accounts/{name}/video-channels':
2648 get: 3214 get:
@@ -2666,14 +3232,8 @@ paths:
2666 content: 3232 content:
2667 application/json: 3233 application/json:
2668 schema: 3234 schema:
2669 properties: 3235 $ref: '#/components/schemas/VideoChannelList'
2670 total: 3236
2671 type: integer
2672 example: 1
2673 data:
2674 type: array
2675 items:
2676 $ref: '#/components/schemas/VideoChannel'
2677 '/accounts/{name}/ratings': 3237 '/accounts/{name}/ratings':
2678 get: 3238 get:
2679 summary: List ratings of an account 3239 summary: List ratings of an account
@@ -2704,6 +3264,7 @@ paths:
2704 type: array 3264 type: array
2705 items: 3265 items:
2706 $ref: '#/components/schemas/VideoRating' 3266 $ref: '#/components/schemas/VideoRating'
3267
2707 '/videos/{id}/comment-threads': 3268 '/videos/{id}/comment-threads':
2708 get: 3269 get:
2709 summary: List threads of a video 3270 summary: List threads of a video
@@ -2745,8 +3306,10 @@ paths:
2745 type: object 3306 type: object
2746 properties: 3307 properties:
2747 text: 3308 text:
2748 type: string 3309 allOf:
2749 description: 'Text comment' 3310 - $ref: '#/components/schemas/VideoComment/properties/text'
3311 format: markdown
3312 maxLength: 10000
2750 required: 3313 required:
2751 - text 3314 - text
2752 3315
@@ -2765,6 +3328,7 @@ paths:
2765 application/json: 3328 application/json:
2766 schema: 3329 schema:
2767 $ref: '#/components/schemas/VideoCommentThreadTree' 3330 $ref: '#/components/schemas/VideoCommentThreadTree'
3331
2768 '/videos/{id}/comments/{commentId}': 3332 '/videos/{id}/comments/{commentId}':
2769 post: 3333 post:
2770 summary: Reply to a thread of a video 3334 summary: Reply to a thread of a video
@@ -2791,11 +3355,12 @@ paths:
2791 type: object 3355 type: object
2792 properties: 3356 properties:
2793 text: 3357 text:
2794 type: string 3358 allOf:
2795 description: 'Text comment' 3359 - $ref: '#/components/schemas/VideoComment/properties/text'
3360 format: markdown
3361 maxLength: 10000
2796 required: 3362 required:
2797 - text 3363 - text
2798
2799 delete: 3364 delete:
2800 summary: Delete a comment or a reply 3365 summary: Delete a comment or a reply
2801 security: 3366 security:
@@ -2814,6 +3379,7 @@ paths:
2814 description: comment or video does not exist 3379 description: comment or video does not exist
2815 '409': 3380 '409':
2816 description: comment is already deleted 3381 description: comment is already deleted
3382
2817 '/videos/{id}/rate': 3383 '/videos/{id}/rate':
2818 put: 3384 put:
2819 summary: Like/dislike a video 3385 summary: Like/dislike a video
@@ -2823,16 +3389,31 @@ paths:
2823 - Video Rates 3389 - Video Rates
2824 parameters: 3390 parameters:
2825 - $ref: '#/components/parameters/idOrUUID' 3391 - $ref: '#/components/parameters/idOrUUID'
3392 requestBody:
3393 content:
3394 application/json:
3395 schema:
3396 type: object
3397 properties:
3398 rating:
3399 type: string
3400 enum:
3401 - like
3402 - dislike
3403 required:
3404 - rating
2826 responses: 3405 responses:
2827 '204': 3406 '204':
2828 description: successful operation 3407 description: successful operation
2829 '404': 3408 '404':
2830 description: video does not exist 3409 description: video does not exist
3410
2831 /search/videos: 3411 /search/videos:
2832 get: 3412 get:
2833 tags: 3413 tags:
2834 - Search 3414 - Search
2835 summary: Search videos 3415 summary: Search videos
3416 operationId: searchVideos
2836 parameters: 3417 parameters:
2837 - name: search 3418 - name: search
2838 in: query 3419 in: query
@@ -2903,11 +3484,13 @@ paths:
2903 $ref: '#/components/schemas/VideoListResponse' 3484 $ref: '#/components/schemas/VideoListResponse'
2904 '500': 3485 '500':
2905 description: search index unavailable 3486 description: search index unavailable
3487
2906 /search/video-channels: 3488 /search/video-channels:
2907 get: 3489 get:
2908 tags: 3490 tags:
2909 - Search 3491 - Search
2910 summary: Search channels 3492 summary: Search channels
3493 operationId: searchChannels
2911 parameters: 3494 parameters:
2912 - name: search 3495 - name: search
2913 in: query 3496 in: query
@@ -2931,12 +3514,11 @@ paths:
2931 content: 3514 content:
2932 application/json: 3515 application/json:
2933 schema: 3516 schema:
2934 type: array 3517 $ref: '#/components/schemas/VideoChannelList'
2935 items:
2936 $ref: '#/components/schemas/VideoChannel'
2937 '500': 3518 '500':
2938 description: search index unavailable 3519 description: search index unavailable
2939 /blocklist/accounts: 3520
3521 /server/blocklist/accounts:
2940 get: 3522 get:
2941 tags: 3523 tags:
2942 - Account Blocks 3524 - Account Blocks
@@ -2975,7 +3557,8 @@ paths:
2975 description: successful operation 3557 description: successful operation
2976 '409': 3558 '409':
2977 description: self-blocking forbidden 3559 description: self-blocking forbidden
2978 '/blocklist/accounts/{accountName}': 3560
3561 '/server/blocklist/accounts/{accountName}':
2979 delete: 3562 delete:
2980 tags: 3563 tags:
2981 - Account Blocks 3564 - Account Blocks
@@ -2995,7 +3578,8 @@ paths:
2995 description: successful operation 3578 description: successful operation
2996 '404': 3579 '404':
2997 description: account or account block does not exist 3580 description: account or account block does not exist
2998 /blocklist/servers: 3581
3582 /server/blocklist/servers:
2999 get: 3583 get:
3000 tags: 3584 tags:
3001 - Server Blocks 3585 - Server Blocks
@@ -3030,11 +3614,12 @@ paths:
3030 required: 3614 required:
3031 - host 3615 - host
3032 responses: 3616 responses:
3033 '200': 3617 '204':
3034 description: successful operation 3618 description: successful operation
3035 '409': 3619 '409':
3036 description: self-blocking forbidden 3620 description: self-blocking forbidden
3037 '/blocklist/servers/{host}': 3621
3622 '/server/blocklist/servers/{host}':
3038 delete: 3623 delete:
3039 tags: 3624 tags:
3040 - Server Blocks 3625 - Server Blocks
@@ -3051,11 +3636,12 @@ paths:
3051 type: string 3636 type: string
3052 format: hostname 3637 format: hostname
3053 responses: 3638 responses:
3054 '201': 3639 '204':
3055 description: successful operation 3640 description: successful operation
3056 '404': 3641 '404':
3057 description: account block does not exist 3642 description: account block does not exist
3058 /redundancy/{host}: 3643
3644 /server/redundancy/{host}:
3059 put: 3645 put:
3060 tags: 3646 tags:
3061 - Instance Redundancy 3647 - Instance Redundancy
@@ -3087,11 +3673,13 @@ paths:
3087 description: successful operation 3673 description: successful operation
3088 '404': 3674 '404':
3089 description: server is not already known 3675 description: server is not already known
3090 /redundancy/videos: 3676
3677 /server/redundancy/videos:
3091 get: 3678 get:
3092 tags: 3679 tags:
3093 - Video Mirroring 3680 - Video Mirroring
3094 summary: List videos being mirrored 3681 summary: List videos being mirrored
3682 operationId: getMirroredVideos
3095 security: 3683 security:
3096 - OAuth2: 3684 - OAuth2:
3097 - admin 3685 - admin
@@ -3121,6 +3709,7 @@ paths:
3121 tags: 3709 tags:
3122 - Video Mirroring 3710 - Video Mirroring
3123 summary: Mirror a video 3711 summary: Mirror a video
3712 operationId: putMirroredVideo
3124 security: 3713 security:
3125 - OAuth2: 3714 - OAuth2:
3126 - admin 3715 - admin
@@ -3131,7 +3720,7 @@ paths:
3131 type: object 3720 type: object
3132 properties: 3721 properties:
3133 videoId: 3722 videoId:
3134 type: integer 3723 $ref: '#/components/schemas/Video/properties/id'
3135 required: 3724 required:
3136 - videoId 3725 - videoId
3137 responses: 3726 responses:
@@ -3143,11 +3732,13 @@ paths:
3143 description: video does not exist 3732 description: video does not exist
3144 '409': 3733 '409':
3145 description: video is already mirrored 3734 description: video is already mirrored
3146 /redundancy/videos/{redundancyId}: 3735
3736 /server/redundancy/videos/{redundancyId}:
3147 delete: 3737 delete:
3148 tags: 3738 tags:
3149 - Video Mirroring 3739 - Video Mirroring
3150 summary: Delete a mirror done on a video 3740 summary: Delete a mirror done on a video
3741 operationId: delMirroredVideo
3151 security: 3742 security:
3152 - OAuth2: 3743 - OAuth2:
3153 - admin 3744 - admin
@@ -3163,18 +3754,13 @@ paths:
3163 description: successful operation 3754 description: successful operation
3164 '404': 3755 '404':
3165 description: video redundancy not found 3756 description: video redundancy not found
3757
3166 '/feeds/video-comments.{format}': 3758 '/feeds/video-comments.{format}':
3167 get: 3759 get:
3168 tags: 3760 tags:
3169 - Feeds 3761 - Feeds
3170 summary: List comments on videos 3762 summary: List comments on videos
3171 servers: 3763 operationId: getSyndicatedComments
3172 - url: 'https://peertube2.cpy.re'
3173 description: Live Test Server (live data - latest nightly version)
3174 - url: 'https://peertube3.cpy.re'
3175 description: Live Test Server (live data - latest RC version)
3176 - url: 'https://peertube.cpy.re'
3177 description: Live Test Server (live data - stable version)
3178 parameters: 3764 parameters:
3179 - name: format 3765 - name: format
3180 in: path 3766 in: path
@@ -3227,18 +3813,33 @@ paths:
3227 application/xml: 3813 application/xml:
3228 schema: 3814 schema:
3229 $ref: '#/components/schemas/VideoCommentsForXML' 3815 $ref: '#/components/schemas/VideoCommentsForXML'
3816 examples:
3817 nightly:
3818 externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local
3230 application/rss+xml: 3819 application/rss+xml:
3231 schema: 3820 schema:
3232 $ref: '#/components/schemas/VideoCommentsForXML' 3821 $ref: '#/components/schemas/VideoCommentsForXML'
3822 examples:
3823 nightly:
3824 externalValue: https://peertube2.cpy.re/feeds/video-comments.rss?filter=local
3233 text/xml: 3825 text/xml:
3234 schema: 3826 schema:
3235 $ref: '#/components/schemas/VideoCommentsForXML' 3827 $ref: '#/components/schemas/VideoCommentsForXML'
3828 examples:
3829 nightly:
3830 externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local
3236 application/atom+xml: 3831 application/atom+xml:
3237 schema: 3832 schema:
3238 $ref: '#/components/schemas/VideoCommentsForXML' 3833 $ref: '#/components/schemas/VideoCommentsForXML'
3834 examples:
3835 nightly:
3836 externalValue: https://peertube2.cpy.re/feeds/video-comments.atom?filter=local
3239 application/json: 3837 application/json:
3240 schema: 3838 schema:
3241 type: object 3839 type: object
3840 examples:
3841 nightly:
3842 externalValue: https://peertube2.cpy.re/feeds/video-comments.json?filter=local
3242 '400': 3843 '400':
3243 x-summary: field inconsistencies 3844 x-summary: field inconsistencies
3244 description: > 3845 description: >
@@ -3248,18 +3849,13 @@ paths:
3248 description: video, video channel or account not found 3849 description: video, video channel or account not found
3249 '406': 3850 '406':
3250 description: accept header unsupported 3851 description: accept header unsupported
3852
3251 '/feeds/videos.{format}': 3853 '/feeds/videos.{format}':
3252 get: 3854 get:
3253 tags: 3855 tags:
3254 - Feeds 3856 - Feeds
3255 summary: List videos 3857 summary: List videos
3256 servers: 3858 operationId: getSyndicatedVideos
3257 - url: 'https://peertube2.cpy.re'
3258 description: Live Test Server (live data - latest nightly version)
3259 - url: 'https://peertube3.cpy.re'
3260 description: Live Test Server (live data - latest RC version)
3261 - url: 'https://peertube.cpy.re'
3262 description: Live Test Server (live data - stable version)
3263 parameters: 3859 parameters:
3264 - name: format 3860 - name: format
3265 in: path 3861 in: path
@@ -3316,24 +3912,102 @@ paths:
3316 application/rss+xml: 3912 application/rss+xml:
3317 schema: 3913 schema:
3318 $ref: '#/components/schemas/VideosForXML' 3914 $ref: '#/components/schemas/VideosForXML'
3915 examples:
3916 nightly:
3917 externalValue: https://peertube2.cpy.re/feeds/videos.rss?filter=local
3319 text/xml: 3918 text/xml:
3320 schema: 3919 schema:
3321 $ref: '#/components/schemas/VideosForXML' 3920 $ref: '#/components/schemas/VideosForXML'
3921 examples:
3922 nightly:
3923 externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
3322 application/atom+xml: 3924 application/atom+xml:
3323 schema: 3925 schema:
3324 $ref: '#/components/schemas/VideosForXML' 3926 $ref: '#/components/schemas/VideosForXML'
3927 examples:
3928 nightly:
3929 externalValue: https://peertube2.cpy.re/feeds/videos.atom?filter=local
3325 application/json: 3930 application/json:
3326 schema: 3931 schema:
3327 type: object 3932 type: object
3933 examples:
3934 nightly:
3935 externalValue: https://peertube2.cpy.re/feeds/videos.json?filter=local
3328 '404': 3936 '404':
3329 description: video channel or account not found 3937 description: video channel or account not found
3330 '406': 3938 '406':
3331 description: accept header unsupported 3939 description: accept header unsupported
3940
3941 '/feeds/subscriptions.{format}':
3942 get:
3943 tags:
3944 - Feeds
3945 - Account
3946 summary: List videos of subscriptions tied to a token
3947 operationId: getSyndicatedSubscriptionVideos
3948 parameters:
3949 - name: format
3950 in: path
3951 required: true
3952 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
3953 schema:
3954 type: string
3955 enum:
3956 - xml
3957 - rss
3958 - rss2
3959 - atom
3960 - atom1
3961 - json
3962 - json1
3963 - name: accountId
3964 in: query
3965 description: limit listing to a specific account
3966 schema:
3967 type: string
3968 required: true
3969 - name: token
3970 in: query
3971 description: private token allowing access
3972 schema:
3973 type: string
3974 required: true
3975 - $ref: '#/components/parameters/sort'
3976 - $ref: '#/components/parameters/nsfw'
3977 - $ref: '#/components/parameters/filter'
3978 responses:
3979 '204':
3980 description: successful operation
3981 headers:
3982 Cache-Control:
3983 schema:
3984 type: string
3985 default: 'max-age=900' # 15 min cache
3986 content:
3987 application/xml:
3988 schema:
3989 $ref: '#/components/schemas/VideosForXML'
3990 application/rss+xml:
3991 schema:
3992 $ref: '#/components/schemas/VideosForXML'
3993 text/xml:
3994 schema:
3995 $ref: '#/components/schemas/VideosForXML'
3996 application/atom+xml:
3997 schema:
3998 $ref: '#/components/schemas/VideosForXML'
3999 application/json:
4000 schema:
4001 type: object
4002 '406':
4003 description: accept header unsupported
4004
3332 /plugins: 4005 /plugins:
3333 get: 4006 get:
3334 tags: 4007 tags:
3335 - Plugins 4008 - Plugins
3336 summary: List plugins 4009 summary: List plugins
4010 operationId: getPlugins
3337 security: 4011 security:
3338 - OAuth2: 4012 - OAuth2:
3339 - admin 4013 - admin
@@ -3356,11 +4030,13 @@ paths:
3356 application/json: 4030 application/json:
3357 schema: 4031 schema:
3358 $ref: '#/components/schemas/PluginResponse' 4032 $ref: '#/components/schemas/PluginResponse'
4033
3359 /plugins/available: 4034 /plugins/available:
3360 get: 4035 get:
3361 tags: 4036 tags:
3362 - Plugins 4037 - Plugins
3363 summary: List available plugins 4038 summary: List available plugins
4039 operationId: getAvailablePlugins
3364 security: 4040 security:
3365 - OAuth2: 4041 - OAuth2:
3366 - admin 4042 - admin
@@ -3389,11 +4065,13 @@ paths:
3389 $ref: '#/components/schemas/PluginResponse' 4065 $ref: '#/components/schemas/PluginResponse'
3390 '503': 4066 '503':
3391 description: plugin index unavailable 4067 description: plugin index unavailable
4068
3392 /plugins/install: 4069 /plugins/install:
3393 post: 4070 post:
3394 tags: 4071 tags:
3395 - Plugins 4072 - Plugins
3396 summary: Install a plugin 4073 summary: Install a plugin
4074 operationId: addPlugin
3397 security: 4075 security:
3398 - OAuth2: 4076 - OAuth2:
3399 - admin 4077 - admin
@@ -3422,11 +4100,13 @@ paths:
3422 description: successful operation 4100 description: successful operation
3423 '400': 4101 '400':
3424 description: should have either `npmName` or `path` set 4102 description: should have either `npmName` or `path` set
4103
3425 /plugins/update: 4104 /plugins/update:
3426 post: 4105 post:
3427 tags: 4106 tags:
3428 - Plugins 4107 - Plugins
3429 summary: Update a plugin 4108 summary: Update a plugin
4109 operationId: updatePlugin
3430 security: 4110 security:
3431 - OAuth2: 4111 - OAuth2:
3432 - admin 4112 - admin
@@ -3457,11 +4137,13 @@ paths:
3457 description: should have either `npmName` or `path` set 4137 description: should have either `npmName` or `path` set
3458 '404': 4138 '404':
3459 description: existing plugin not found 4139 description: existing plugin not found
4140
3460 /plugins/uninstall: 4141 /plugins/uninstall:
3461 post: 4142 post:
3462 tags: 4143 tags:
3463 - Plugins 4144 - Plugins
3464 summary: Uninstall a plugin 4145 summary: Uninstall a plugin
4146 operationId: uninstallPlugin
3465 security: 4147 security:
3466 - OAuth2: 4148 - OAuth2:
3467 - admin 4149 - admin
@@ -3482,11 +4164,13 @@ paths:
3482 description: successful operation 4164 description: successful operation
3483 '404': 4165 '404':
3484 description: existing plugin not found 4166 description: existing plugin not found
4167
3485 /plugins/{npmName}: 4168 /plugins/{npmName}:
3486 get: 4169 get:
3487 tags: 4170 tags:
3488 - Plugins 4171 - Plugins
3489 summary: Get a plugin 4172 summary: Get a plugin
4173 operationId: getPlugin
3490 security: 4174 security:
3491 - OAuth2: 4175 - OAuth2:
3492 - admin 4176 - admin
@@ -3501,6 +4185,7 @@ paths:
3501 $ref: '#/components/schemas/Plugin' 4185 $ref: '#/components/schemas/Plugin'
3502 '404': 4186 '404':
3503 description: plugin not found 4187 description: plugin not found
4188
3504 /plugins/{npmName}/settings: 4189 /plugins/{npmName}/settings:
3505 put: 4190 put:
3506 tags: 4191 tags:
@@ -3525,6 +4210,7 @@ paths:
3525 description: successful operation 4210 description: successful operation
3526 '404': 4211 '404':
3527 description: plugin not found 4212 description: plugin not found
4213
3528 /plugins/{npmName}/public-settings: 4214 /plugins/{npmName}/public-settings:
3529 get: 4215 get:
3530 tags: 4216 tags:
@@ -3542,6 +4228,7 @@ paths:
3542 additionalProperties: true 4228 additionalProperties: true
3543 '404': 4229 '404':
3544 description: plugin not found 4230 description: plugin not found
4231
3545 /plugins/{npmName}/registered-settings: 4232 /plugins/{npmName}/registered-settings:
3546 get: 4233 get:
3547 tags: 4234 tags:
@@ -3562,6 +4249,7 @@ paths:
3562 additionalProperties: true 4249 additionalProperties: true
3563 '404': 4250 '404':
3564 description: plugin not found 4251 description: plugin not found
4252
3565servers: 4253servers:
3566 - url: 'https://peertube2.cpy.re/api/v1' 4254 - url: 'https://peertube2.cpy.re/api/v1'
3567 description: Live Test Server (live data - latest nightly version) 4255 description: Live Test Server (live data - latest nightly version)
@@ -3740,9 +4428,7 @@ components:
3740 required: true 4428 required: true
3741 description: The user id 4429 description: The user id
3742 schema: 4430 schema:
3743 type: integer 4431 $ref: '#/components/schemas/id'
3744 minimum: 0
3745 example: 42
3746 idOrUUID: 4432 idOrUUID:
3747 name: id 4433 name: id
3748 in: path 4434 in: path
@@ -3750,38 +4436,43 @@ components:
3750 description: The object id or uuid 4436 description: The object id or uuid
3751 schema: 4437 schema:
3752 oneOf: 4438 oneOf:
3753 - type: integer 4439 - $ref: '#/components/schemas/id'
3754 minimum: 0
3755 example: 42
3756 - $ref: '#/components/schemas/UUIDv4' 4440 - $ref: '#/components/schemas/UUIDv4'
4441 playlistId:
4442 name: playlistId
4443 in: path
4444 required: true
4445 description: Playlist id
4446 schema:
4447 $ref: '#/components/schemas/VideoPlaylist/properties/id'
3757 playlistElementId: 4448 playlistElementId:
3758 name: playlistElementId 4449 name: playlistElementId
3759 in: path 4450 in: path
3760 required: true 4451 required: true
3761 description: Playlist element id 4452 description: Playlist element id
3762 schema: 4453 schema:
3763 type: integer 4454 $ref: '#/components/schemas/id'
3764 abuseId: 4455 abuseId:
3765 name: abuseId 4456 name: abuseId
3766 in: path 4457 in: path
3767 required: true 4458 required: true
3768 description: Abuse id 4459 description: Abuse id
3769 schema: 4460 schema:
3770 type: integer 4461 $ref: '#/components/schemas/Abuse/properties/id'
3771 abuseMessageId: 4462 abuseMessageId:
3772 name: abuseMessageId 4463 name: abuseMessageId
3773 in: path 4464 in: path
3774 required: true 4465 required: true
3775 description: Abuse message id 4466 description: Abuse message id
3776 schema: 4467 schema:
3777 type: integer 4468 $ref: '#/components/schemas/AbuseMessage/properties/id'
3778 captionLanguage: 4469 captionLanguage:
3779 name: captionLanguage 4470 name: captionLanguage
3780 in: path 4471 in: path
3781 required: true 4472 required: true
3782 description: The caption language 4473 description: The caption language
3783 schema: 4474 schema:
3784 type: string 4475 $ref: '#/components/schemas/VideoLanguageSet'
3785 channelHandle: 4476 channelHandle:
3786 name: channelHandle 4477 name: channelHandle
3787 in: path 4478 in: path
@@ -3811,7 +4502,7 @@ components:
3811 required: true 4502 required: true
3812 description: The comment id 4503 description: The comment id
3813 schema: 4504 schema:
3814 type: integer 4505 $ref: '#/components/schemas/VideoComment/properties/id'
3815 isLive: 4506 isLive:
3816 name: isLive 4507 name: isLive
3817 in: query 4508 in: query
@@ -3823,13 +4514,13 @@ components:
3823 name: categoryOneOf 4514 name: categoryOneOf
3824 in: query 4515 in: query
3825 required: false 4516 required: false
3826 description: category id of the video (see [/videos/categories](#tag/Video/paths/~1videos~1categories/get)) 4517 description: category id of the video (see [/videos/categories](#operation/getCategories))
3827 schema: 4518 schema:
3828 oneOf: 4519 oneOf:
3829 - type: integer 4520 - $ref: '#/components/schemas/VideoCategorySet'
3830 - type: array 4521 - type: array
3831 items: 4522 items:
3832 type: integer 4523 $ref: '#/components/schemas/VideoCategorySet'
3833 style: form 4524 style: form
3834 explode: false 4525 explode: false
3835 tagsOneOf: 4526 tagsOneOf:
@@ -3841,6 +4532,7 @@ components:
3841 oneOf: 4532 oneOf:
3842 - type: string 4533 - type: string
3843 - type: array 4534 - type: array
4535 maxItems: 5
3844 items: 4536 items:
3845 type: string 4537 type: string
3846 style: form 4538 style: form
@@ -3862,26 +4554,26 @@ components:
3862 name: languageOneOf 4554 name: languageOneOf
3863 in: query 4555 in: query
3864 required: false 4556 required: false
3865 description: language id of the video (see [/videos/languages](#tag/Video/paths/~1videos~1languages/get)). Use `_unknown` to filter on videos that don't have a video language 4557 description: language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language
3866 schema: 4558 schema:
3867 oneOf: 4559 oneOf:
3868 - type: string 4560 - $ref: '#/components/schemas/VideoLanguageSet'
3869 - type: array 4561 - type: array
3870 items: 4562 items:
3871 type: string 4563 $ref: '#/components/schemas/VideoLanguageSet'
3872 style: form 4564 style: form
3873 explode: false 4565 explode: false
3874 licenceOneOf: 4566 licenceOneOf:
3875 name: licenceOneOf 4567 name: licenceOneOf
3876 in: query 4568 in: query
3877 required: false 4569 required: false
3878 description: licence id of the video (see [/videos/licences](#tag/Video/paths/~1videos~1licences/get)) 4570 description: licence id of the video (see [/videos/licences](#operation/getLicences))
3879 schema: 4571 schema:
3880 oneOf: 4572 oneOf:
3881 - type: integer 4573 - $ref: '#/components/schemas/VideoLicenceSet'
3882 - type: array 4574 - type: array
3883 items: 4575 items:
3884 type: integer 4576 $ref: '#/components/schemas/VideoLicenceSet'
3885 style: form 4577 style: form
3886 explode: false 4578 explode: false
3887 skipCount: 4579 skipCount:
@@ -3957,61 +4649,114 @@ components:
3957 - activitypub-refresher 4649 - activitypub-refresher
3958 - video-redundancy 4650 - video-redundancy
3959 - video-live-ending 4651 - video-live-ending
4652 followState:
4653 name: state
4654 in: query
4655 schema:
4656 type: string
4657 enum:
4658 - pending
4659 - accepted
4660 actorType:
4661 name: actorType
4662 in: query
4663 schema:
4664 type: string
4665 enum:
4666 - Person
4667 - Application
4668 - Group
4669 - Service
4670 - Organization
3960 securitySchemes: 4671 securitySchemes:
3961 OAuth2: 4672 OAuth2:
3962 description: > 4673 description: |
3963 In the header: *Authorization: Bearer <token\>*
3964
3965
3966 Authenticating via OAuth requires the following steps: 4674 Authenticating via OAuth requires the following steps:
4675 - Have an activated account
4676 - [Generate] an access token for that account at `/api/v1/users/token`.
4677 - Make requests with the *Authorization: Bearer <token\>* header
4678 - Profit, depending on the role assigned to the account
3967 4679
4680 Note that the __access token is valid for 1 day__ and is given
4681 along with a __refresh token valid for 2 weeks__.
3968 4682
3969 - Have an account with sufficient authorization levels 4683 [Generate]: https://docs.joinpeertube.org/api-rest-getting-started
3970
3971 - [Generate](https://docs.joinpeertube.org/api-rest-getting-started) a
3972 Bearer Token
3973
3974 - Make Authenticated Requests
3975 type: oauth2 4684 type: oauth2
3976 flows: 4685 flows:
3977 password: 4686 password:
3978 tokenUrl: 'https://peertube.example.com/api/v1/users/token' 4687 tokenUrl: /api/v1/users/token
3979 scopes: 4688 scopes:
3980 admin: Admin scope 4689 admin: Admin scope
3981 moderator: Moderator scope 4690 moderator: Moderator scope
3982 user: User scope 4691 user: User scope
3983 schemas: 4692 schemas:
4693 # Resuable core properties
4694 id:
4695 type: integer
4696 minimum: 1
4697 example: 42
3984 UUIDv4: 4698 UUIDv4:
3985 type: string 4699 type: string
3986 format: uuid 4700 format: uuid
3987 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d 4701 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
3988 pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' 4702 pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
3989 # the regex above limits the length;
3990 # however, some tools might require explicit settings:
3991 minLength: 36 4703 minLength: 36
3992 maxLength: 36 4704 maxLength: 36
4705 username:
4706 type: string
4707 description: immutable name of the user, used to find or mention its actor
4708 example: chocobozzz
4709 pattern: '/^[a-z0-9._]+$/'
4710 minLength: 1
4711 maxLength: 50
4712 usernameChannel:
4713 type: string
4714 description: immutable name of the channel, used to interact with its actor
4715 example: framasoft_videos
4716 pattern: '/^[a-zA-Z0-9\\-_.:]+$/'
4717 minLength: 1
4718 maxLength: 50
4719 password:
4720 type: string
4721 format: password
4722 minLength: 6
4723 maxLength: 255
3993 4724
4725 VideoCategorySet:
4726 type: integer
4727 description: category id of the video (see [/videos/categories](#operation/getCategories))
4728 example: 15
3994 VideoConstantNumber-Category: 4729 VideoConstantNumber-Category:
3995 properties: 4730 properties:
3996 id: 4731 id:
3997 type: integer 4732 $ref: '#/components/schemas/VideoCategorySet'
3998 description: category id of the video (see [/videos/categories](#tag/Video/paths/~1videos~1categories/get))
3999 label: 4733 label:
4000 type: string 4734 type: string
4735 example: Science & Technology
4736
4737 VideoLicenceSet:
4738 type: integer
4739 description: licence id of the video (see [/videos/licences](#operation/getLicences))
4740 example: 2
4001 VideoConstantNumber-Licence: 4741 VideoConstantNumber-Licence:
4002 properties: 4742 properties:
4003 id: 4743 id:
4004 type: integer 4744 $ref: '#/components/schemas/VideoLicenceSet'
4005 description: licence id of the video (see [/videos/licences](#tag/Video/paths/~1videos~1licences/get))
4006 label: 4745 label:
4007 type: string 4746 type: string
4747 example: Attribution - Share Alike
4748
4749 VideoLanguageSet:
4750 type: string
4751 description: language id of the video (see [/videos/languages](#operation/getLanguages))
4752 example: en
4008 VideoConstantString-Language: 4753 VideoConstantString-Language:
4009 properties: 4754 properties:
4010 id: 4755 id:
4011 type: string 4756 $ref: '#/components/schemas/VideoLanguageSet'
4012 description: language id of the video (see [/videos/languages](#tag/Video/paths/~1videos~1languages/get))
4013 label: 4757 label:
4014 type: string 4758 type: string
4759 example: English
4015 4760
4016 VideoPlaylistPrivacySet: 4761 VideoPlaylistPrivacySet:
4017 type: integer 4762 type: integer
@@ -4019,7 +4764,7 @@ components:
4019 - 1 4764 - 1
4020 - 2 4765 - 2
4021 - 3 4766 - 3
4022 description: 'The video playlist privacy (Public = `1`, Unlisted = `2`, Private = `3`)' 4767 description: Video playlist privacy policy (see [/video-playlists/privacies])
4023 VideoPlaylistPrivacyConstant: 4768 VideoPlaylistPrivacyConstant:
4024 properties: 4769 properties:
4025 id: 4770 id:
@@ -4032,7 +4777,7 @@ components:
4032 enum: 4777 enum:
4033 - 1 4778 - 1
4034 - 2 4779 - 2
4035 description: 'The video playlist type (Regular = `1`, Watch Later = `2`)' 4780 description: The video playlist type (Regular = `1`, Watch Later = `2`)
4036 VideoPlaylistTypeConstant: 4781 VideoPlaylistTypeConstant:
4037 properties: 4782 properties:
4038 id: 4783 id:
@@ -4047,7 +4792,7 @@ components:
4047 - 2 4792 - 2
4048 - 3 4793 - 3
4049 - 4 4794 - 4
4050 description: 'The video privacy (Public = `1`, Unlisted = `2`, Private = `3`, Internal = `4`)' 4795 description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies))
4051 VideoPrivacyConstant: 4796 VideoPrivacyConstant:
4052 properties: 4797 properties:
4053 id: 4798 id:
@@ -4118,12 +4863,18 @@ components:
4118 - captions 4863 - captions
4119 example: [spamOrMisleading] 4864 example: [spamOrMisleading]
4120 4865
4866 VideoResolutionSet:
4867 type: integer
4868 description: |
4869 Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`)
4870
4871 `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos.
4872 example: 240
4121 VideoResolutionConstant: 4873 VideoResolutionConstant:
4874 description: resolutions and their labels for the video
4122 properties: 4875 properties:
4123 id: 4876 id:
4124 type: integer 4877 $ref: '#/components/schemas/VideoResolutionSet'
4125 description: 'Video resolution (240, 360, 720, 1080, 1440 or 2160)'
4126 example: 240
4127 label: 4878 label:
4128 type: string 4879 type: string
4129 example: 240p 4880 example: 240p
@@ -4158,7 +4909,7 @@ components:
4158 VideoChannelSummary: 4909 VideoChannelSummary:
4159 properties: 4910 properties:
4160 id: 4911 id:
4161 type: integer 4912 $ref: '#/components/schemas/id'
4162 name: 4913 name:
4163 type: string 4914 type: string
4164 displayName: 4915 displayName:
@@ -4179,21 +4930,28 @@ components:
4179 type: integer 4930 type: integer
4180 startTimestamp: 4931 startTimestamp:
4181 type: integer 4932 type: integer
4933 format: seconds
4182 stopTimestamp: 4934 stopTimestamp:
4183 type: integer 4935 type: integer
4936 format: seconds
4184 video: 4937 video:
4185 nullable: true 4938 nullable: true
4186 allOf: 4939 allOf:
4187 - $ref: '#/components/schemas/Video' 4940 - $ref: '#/components/schemas/Video'
4188 VideoFile: 4941 VideoFile:
4942 readOnly: true
4189 properties: 4943 properties:
4190 magnetUri: 4944 magnetUri:
4191 type: string 4945 type: string
4946 format: uri
4947 description: magnet URI allowing to resolve the video via BitTorrent without a metainfo file
4948 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
4949 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
4192 resolution: 4950 resolution:
4193 $ref: '#/components/schemas/VideoResolutionConstant' 4951 $ref: '#/components/schemas/VideoResolutionConstant'
4194 size: 4952 size:
4195 type: integer 4953 type: integer
4196 description: 'Video file size in bytes' 4954 description: Video file size in bytes
4197 torrentUrl: 4955 torrentUrl:
4198 type: string 4956 type: string
4199 description: Direct URL of the torrent file 4957 description: Direct URL of the torrent file
@@ -4212,15 +4970,17 @@ components:
4212 format: url 4970 format: url
4213 fps: 4971 fps:
4214 type: number 4972 type: number
4973 description: Frames per second of the video file
4215 metadataUrl: 4974 metadataUrl:
4216 type: string 4975 type: string
4217 format: url 4976 format: url
4977 description: URL dereferencing the output of ffprobe on the file
4218 VideoStreamingPlaylists: 4978 VideoStreamingPlaylists:
4219 allOf: 4979 allOf:
4220 - type: object 4980 - type: object
4221 properties: 4981 properties:
4222 id: 4982 id:
4223 type: integer 4983 $ref: '#/components/schemas/id'
4224 type: 4984 type:
4225 type: integer 4985 type: integer
4226 enum: 4986 enum:
@@ -4256,20 +5016,21 @@ components:
4256 VideoInfo: 5016 VideoInfo:
4257 properties: 5017 properties:
4258 id: 5018 id:
4259 type: integer 5019 $ref: '#/components/schemas/Video/properties/id'
4260 uuid: 5020 uuid:
4261 $ref: '#/components/schemas/UUIDv4' 5021 $ref: '#/components/schemas/Video/properties/uuid'
4262 name: 5022 name:
4263 type: string 5023 $ref: '#/components/schemas/Video/properties/name'
4264 minLength: 3
4265 maxLength: 120
4266 Video: 5024 Video:
4267 properties: 5025 properties:
4268 id: 5026 id:
4269 type: integer 5027 description: object id for the video
4270 example: 8 5028 allOf:
5029 - $ref: '#/components/schemas/id'
4271 uuid: 5030 uuid:
4272 $ref: '#/components/schemas/UUIDv4' 5031 description: universal identifier for the video, that can be used across instances
5032 allOf:
5033 - $ref: '#/components/schemas/UUIDv4'
4273 isLive: 5034 isLive:
4274 type: boolean 5035 type: boolean
4275 createdAt: 5036 createdAt:
@@ -4293,13 +5054,21 @@ components:
4293 example: 2010-10-01T10:52:46.396Z 5054 example: 2010-10-01T10:52:46.396Z
4294 description: used to represent a date of first publication, prior to the practical publication date of `publishedAt` 5055 description: used to represent a date of first publication, prior to the practical publication date of `publishedAt`
4295 category: 5056 category:
4296 $ref: '#/components/schemas/VideoConstantNumber-Category' 5057 allOf:
5058 - $ref: '#/components/schemas/VideoConstantNumber-Category'
5059 description: category in which the video is classified
4297 licence: 5060 licence:
4298 $ref: '#/components/schemas/VideoConstantNumber-Licence' 5061 allOf:
5062 - $ref: '#/components/schemas/VideoConstantNumber-Licence'
5063 description: licence under which the video is distributed
4299 language: 5064 language:
4300 $ref: '#/components/schemas/VideoConstantString-Language' 5065 allOf:
5066 - $ref: '#/components/schemas/VideoConstantString-Language'
5067 description: main language used in the video
4301 privacy: 5068 privacy:
4302 $ref: '#/components/schemas/VideoPrivacyConstant' 5069 allOf:
5070 - $ref: '#/components/schemas/VideoPrivacyConstant'
5071 description: privacy policy used to distribute the video
4303 description: 5072 description:
4304 type: string 5073 type: string
4305 example: | 5074 example: |
@@ -4313,11 +5082,13 @@ components:
4313 duration: 5082 duration:
4314 type: integer 5083 type: integer
4315 example: 1419 5084 example: 1419
5085 format: seconds
4316 description: duration of the video in seconds 5086 description: duration of the video in seconds
4317 isLocal: 5087 isLocal:
4318 type: boolean 5088 type: boolean
4319 name: 5089 name:
4320 type: string 5090 type: string
5091 description: title of the video
4321 example: What is PeerTube? 5092 example: What is PeerTube?
4322 minLength: 3 5093 minLength: 3
4323 maxLength: 120 5094 maxLength: 120
@@ -4345,7 +5116,9 @@ components:
4345 type: boolean 5116 type: boolean
4346 nullable: true 5117 nullable: true
4347 state: 5118 state:
4348 $ref: '#/components/schemas/VideoStateConstant' 5119 allOf:
5120 - $ref: '#/components/schemas/VideoStateConstant'
5121 description: represents the internal state of the video processing within the PeerTube instance
4349 scheduledUpdate: 5122 scheduledUpdate:
4350 nullable: true 5123 nullable: true
4351 allOf: 5124 allOf:
@@ -4378,7 +5151,7 @@ components:
4378 support: 5151 support:
4379 type: string 5152 type: string
4380 description: A text tell the audience how to support the video creator 5153 description: A text tell the audience how to support the video creator
4381 example: Please support my work on <insert crowdfunding plateform>! <3 5154 example: Please support our work on https://soutenir.framasoft.org/en/ <3
4382 minLength: 3 5155 minLength: 3
4383 maxLength: 1000 5156 maxLength: 1000
4384 channel: 5157 channel:
@@ -4403,6 +5176,9 @@ components:
4403 items: 5176 items:
4404 type: string 5177 type: string
4405 format: url 5178 format: url
5179 example:
5180 - https://peertube2.cpy.re/tracker/announce
5181 - wss://peertube2.cpy.re/tracker/socket
4406 files: 5182 files:
4407 type: array 5183 type: array
4408 items: 5184 items:
@@ -4424,7 +5200,7 @@ components:
4424 FileRedundancyInformation: 5200 FileRedundancyInformation:
4425 properties: 5201 properties:
4426 id: 5202 id:
4427 type: integer 5203 $ref: '#/components/schemas/id'
4428 fileUrl: 5204 fileUrl:
4429 type: string 5205 type: string
4430 format: url 5206 format: url
@@ -4449,7 +5225,7 @@ components:
4449 VideoRedundancy: 5225 VideoRedundancy:
4450 properties: 5226 properties:
4451 id: 5227 id:
4452 type: integer 5228 $ref: '#/components/schemas/id'
4453 name: 5229 name:
4454 type: string 5230 type: string
4455 url: 5231 url:
@@ -4480,38 +5256,86 @@ components:
4480 label: 5256 label:
4481 type: string 5257 type: string
4482 example: Pending 5258 example: Pending
5259 VideoCreateImport:
5260 allOf:
5261 - type: object
5262 additionalProperties: false
5263 oneOf:
5264 - properties:
5265 targetUrl:
5266 $ref: '#/components/schemas/VideoImport/properties/targetUrl'
5267 required: [targetUrl]
5268 - properties:
5269 magnetUri:
5270 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
5271 required: [magnetUri]
5272 - properties:
5273 torrentfile:
5274 $ref: '#/components/schemas/VideoImport/properties/torrentfile'
5275 required: [torrentfile]
5276 - $ref: '#/components/schemas/VideoUploadRequestCommon'
5277 required:
5278 - channelId
5279 - name
4483 VideoImport: 5280 VideoImport:
4484 properties: 5281 properties:
4485 id: 5282 id:
4486 type: integer 5283 readOnly: true
4487 example: 2 5284 allOf:
5285 - $ref: '#/components/schemas/id'
4488 targetUrl: 5286 targetUrl:
4489 type: string 5287 type: string
4490 format: url 5288 format: url
5289 description: remote URL where to find the import's source video
4491 example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d 5290 example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
4492 magnetUri: 5291 magnetUri:
4493 type: string 5292 type: string
4494 format: uri 5293 format: uri
5294 description: magnet URI allowing to resolve the import's source video
4495 example: magnet:?xs=https%3A%2F%2Fframatube.org%2Fstatic%2Ftorrents%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.torrent&xt=urn:btih:38b4747ff788b30bf61f59d1965cd38f9e48e01f&dn=What+is+PeerTube%3F&tr=wss%3A%2F%2Fframatube.org%2Ftracker%2Fsocket&tr=https%3A%2F%2Fframatube.org%2Ftracker%2Fannounce&ws=https%3A%2F%2Fframatube.org%2Fstatic%2Fwebseed%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.mp4 5295 example: magnet:?xs=https%3A%2F%2Fframatube.org%2Fstatic%2Ftorrents%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.torrent&xt=urn:btih:38b4747ff788b30bf61f59d1965cd38f9e48e01f&dn=What+is+PeerTube%3F&tr=wss%3A%2F%2Fframatube.org%2Ftracker%2Fsocket&tr=https%3A%2F%2Fframatube.org%2Ftracker%2Fannounce&ws=https%3A%2F%2Fframatube.org%2Fstatic%2Fwebseed%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.mp4
5296 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
5297 torrentfile:
5298 writeOnly: true
5299 type: string
5300 format: binary
5301 description: Torrent file containing only the video file
4496 torrentName: 5302 torrentName:
5303 readOnly: true
4497 type: string 5304 type: string
4498 state: 5305 state:
4499 $ref: '#/components/schemas/VideoImportStateConstant' 5306 readOnly: true
5307 allOf:
5308 - $ref: '#/components/schemas/VideoImportStateConstant'
4500 error: 5309 error:
5310 readOnly: true
4501 type: string 5311 type: string
4502 createdAt: 5312 createdAt:
5313 readOnly: true
4503 type: string 5314 type: string
4504 format: date-time 5315 format: date-time
4505 updatedAt: 5316 updatedAt:
5317 readOnly: true
4506 type: string 5318 type: string
4507 format: date-time 5319 format: date-time
4508 video: 5320 video:
4509 $ref: '#/components/schemas/Video' 5321 readOnly: true
5322 nullable: true
5323 allOf:
5324 - $ref: '#/components/schemas/Video'
5325 VideoImportsList:
5326 properties:
5327 total:
5328 type: integer
5329 example: 1
5330 data:
5331 type: array
5332 maxItems: 100
5333 items:
5334 $ref: '#/components/schemas/VideoImport'
4510 Abuse: 5335 Abuse:
4511 properties: 5336 properties:
4512 id: 5337 id:
4513 type: integer 5338 $ref: '#/components/schemas/id'
4514 example: 7
4515 reason: 5339 reason:
4516 type: string 5340 type: string
4517 example: The video is a spam 5341 example: The video is a spam
@@ -4536,11 +5360,11 @@ components:
4536 AbuseMessage: 5360 AbuseMessage:
4537 properties: 5361 properties:
4538 id: 5362 id:
4539 type: integer 5363 $ref: '#/components/schemas/id'
4540 message: 5364 message:
4541 type: string 5365 type: string
4542 minLength: 2 5366 minLength: 2
4543 maxLength: 3000 5367 maxLength: 3000
4544 byModerator: 5368 byModerator:
4545 type: boolean 5369 type: boolean
4546 createdAt: 5370 createdAt:
@@ -4551,9 +5375,9 @@ components:
4551 VideoBlacklist: 5375 VideoBlacklist:
4552 properties: 5376 properties:
4553 id: 5377 id:
4554 type: integer 5378 $ref: '#/components/schemas/id'
4555 videoId: 5379 videoId:
4556 type: integer 5380 $ref: '#/components/schemas/Video/properties/id'
4557 createdAt: 5381 createdAt:
4558 type: string 5382 type: string
4559 format: date-time 5383 format: date-time
@@ -4580,29 +5404,12 @@ components:
4580 type: integer 5404 type: integer
4581 nsfw: 5405 nsfw:
4582 type: boolean 5406 type: boolean
4583 VideoChannel:
4584 properties:
4585 displayName:
4586 type: string
4587 minLength: 1
4588 maxLength: 120
4589 description:
4590 type: string
4591 minLength: 3
4592 maxLength: 1000
4593 isLocal:
4594 type: boolean
4595 ownerAccount:
4596 type: object
4597 properties:
4598 id:
4599 type: integer
4600 uuid:
4601 $ref: '#/components/schemas/UUIDv4'
4602 VideoPlaylist: 5407 VideoPlaylist:
4603 properties: 5408 properties:
4604 id: 5409 id:
4605 type: integer 5410 $ref: '#/components/schemas/id'
5411 uuid:
5412 $ref: '#/components/schemas/UUIDv4'
4606 createdAt: 5413 createdAt:
4607 type: string 5414 type: string
4608 format: date-time 5415 format: date-time
@@ -4613,8 +5420,6 @@ components:
4613 type: string 5420 type: string
4614 minLength: 3 5421 minLength: 3
4615 maxLength: 1000 5422 maxLength: 1000
4616 uuid:
4617 $ref: '#/components/schemas/UUIDv4'
4618 displayName: 5423 displayName:
4619 type: string 5424 type: string
4620 minLength: 1 5425 minLength: 1
@@ -4623,6 +5428,7 @@ components:
4623 type: boolean 5428 type: boolean
4624 videoLength: 5429 videoLength:
4625 type: integer 5430 type: integer
5431 minimum: 0
4626 thumbnailPath: 5432 thumbnailPath:
4627 type: string 5433 type: string
4628 privacy: 5434 privacy:
@@ -4636,30 +5442,44 @@ components:
4636 VideoComment: 5442 VideoComment:
4637 properties: 5443 properties:
4638 id: 5444 id:
4639 type: integer 5445 $ref: '#/components/schemas/id'
4640 url: 5446 url:
4641 type: string 5447 type: string
4642 format: url 5448 format: url
4643 text: 5449 text:
4644 type: string 5450 type: string
5451 format: html
5452 description: Text of the comment
4645 minLength: 1 5453 minLength: 1
4646 maxLength: 10000 5454 example: This video is wonderful!
4647 threadId: 5455 threadId:
4648 type: integer 5456 $ref: '#/components/schemas/id'
4649 inReplyToCommentId: 5457 inReplyToCommentId:
4650 type: integer 5458 nullable: true
5459 allOf:
5460 - $ref: '#/components/schemas/id'
4651 videoId: 5461 videoId:
4652 type: integer 5462 $ref: '#/components/schemas/Video/properties/id'
4653 createdAt: 5463 createdAt:
4654 type: string 5464 type: string
4655 format: date-time 5465 format: date-time
4656 updatedAt: 5466 updatedAt:
4657 type: string 5467 type: string
4658 format: date-time 5468 format: date-time
5469 deletedAt:
5470 nullable: true
5471 type: string
5472 format: date-time
5473 default: null
5474 isDeleted:
5475 type: boolean
5476 default: false
4659 totalRepliesFromVideoAuthor: 5477 totalRepliesFromVideoAuthor:
4660 type: integer 5478 type: integer
5479 minimum: 0
4661 totalReplies: 5480 totalReplies:
4662 type: integer 5481 type: integer
5482 minimum: 0
4663 account: 5483 account:
4664 $ref: '#/components/schemas/Account' 5484 $ref: '#/components/schemas/Account'
4665 VideoCommentThreadTree: 5485 VideoCommentThreadTree:
@@ -4689,8 +5509,7 @@ components:
4689 ActorInfo: 5509 ActorInfo:
4690 properties: 5510 properties:
4691 id: 5511 id:
4692 type: integer 5512 $ref: '#/components/schemas/id'
4693 example: 11
4694 name: 5513 name:
4695 type: string 5514 type: string
4696 displayName: 5515 displayName:
@@ -4707,20 +5526,29 @@ components:
4707 Actor: 5526 Actor:
4708 properties: 5527 properties:
4709 id: 5528 id:
4710 type: integer 5529 $ref: '#/components/schemas/id'
4711 example: 11
4712 url: 5530 url:
4713 type: string 5531 type: string
4714 format: url 5532 format: url
4715 name: 5533 name:
4716 type: string 5534 description: immutable name of the actor, used to find or mention it
5535 allOf:
5536 - $ref: '#/components/schemas/username'
4717 host: 5537 host:
4718 type: string 5538 type: string
4719 format: hostname 5539 format: hostname
5540 description: server on which the actor is resident
5541 hostRedundancyAllowed:
5542 type: boolean
5543 description: whether this actor's host allows redundancy of its videos
4720 followingCount: 5544 followingCount:
4721 type: integer 5545 type: integer
5546 minimum: 0
5547 description: number of actors subscribed to by this actor, as seen by this instance
4722 followersCount: 5548 followersCount:
4723 type: integer 5549 type: integer
5550 minimum: 0
5551 description: number of followers of this actor, as seen by this instance
4724 createdAt: 5552 createdAt:
4725 type: string 5553 type: string
4726 format: date-time 5554 format: date-time
@@ -4734,16 +5562,22 @@ components:
4734 - $ref: '#/components/schemas/Actor' 5562 - $ref: '#/components/schemas/Actor'
4735 - properties: 5563 - properties:
4736 userId: 5564 userId:
4737 type: string 5565 description: object id for the user tied to this account
4738 example: 2 5566 allOf:
5567 - $ref: '#/components/schemas/User/properties/id'
4739 displayName: 5568 displayName:
4740 type: string 5569 type: string
5570 description: editable name of the account, displayed in its representations
5571 minLength: 3
5572 maxLength: 120
4741 description: 5573 description:
4742 type: string 5574 type: string
5575 description: text or bio displayed on the account's profile
4743 UserWatchingVideo: 5576 UserWatchingVideo:
4744 properties: 5577 properties:
4745 currentTime: 5578 currentTime:
4746 type: integer 5579 type: integer
5580 format: seconds
4747 description: timestamp within the video, in seconds 5581 description: timestamp within the video, in seconds
4748 example: 5 5582 example: 5
4749 ServerConfig: 5583 ServerConfig:
@@ -4831,7 +5665,7 @@ components:
4831 enabledResolutions: 5665 enabledResolutions:
4832 type: array 5666 type: array
4833 items: 5667 items:
4834 type: integer 5668 $ref: '#/components/schemas/VideoResolutionSet'
4835 import: 5669 import:
4836 type: object 5670 type: object
4837 properties: 5671 properties:
@@ -4916,8 +5750,10 @@ components:
4916 properties: 5750 properties:
4917 videoQuota: 5751 videoQuota:
4918 type: integer 5752 type: integer
5753 example: 16810141515
4919 videoQuotaDaily: 5754 videoQuotaDaily:
4920 type: integer 5755 type: integer
5756 example: 1681014151
4921 trending: 5757 trending:
4922 type: object 5758 type: object
4923 properties: 5759 properties:
@@ -4943,6 +5779,12 @@ components:
4943 indexUrl: 5779 indexUrl:
4944 type: string 5780 type: string
4945 format: url 5781 format: url
5782 homepage:
5783 type: object
5784 properties:
5785 enabled:
5786 type: boolean
5787
4946 ServerConfigAbout: 5788 ServerConfigAbout:
4947 properties: 5789 properties:
4948 instance: 5790 instance:
@@ -5032,25 +5874,44 @@ components:
5032 type: boolean 5874 type: boolean
5033 user: 5875 user:
5034 type: object 5876 type: object
5877 description: Settings that apply to new users, if registration is enabled
5035 properties: 5878 properties:
5036 videoQuota: 5879 videoQuota:
5037 type: integer 5880 type: integer
5881 example: 16810141515
5038 videoQuotaDaily: 5882 videoQuotaDaily:
5039 type: integer 5883 type: integer
5884 example: 1681014151
5040 transcoding: 5885 transcoding:
5041 type: object 5886 type: object
5887 description: Settings pertaining to transcoding jobs
5042 properties: 5888 properties:
5043 enabled: 5889 enabled:
5044 type: boolean 5890 type: boolean
5045 allowAdditionalExtensions: 5891 allowAdditionalExtensions:
5046 type: boolean 5892 type: boolean
5893 description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos
5047 allowAudioFiles: 5894 allowAudioFiles:
5048 type: boolean 5895 type: boolean
5896 description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file
5049 threads: 5897 threads:
5050 type: integer 5898 type: integer
5899 description: Amount of threads used by ffmpeg for 1 transcoding job
5900 concurrency:
5901 type: number
5902 description: Amount of transcoding jobs to execute in parallel
5903 profile:
5904 type: string
5905 enum:
5906 - default
5907 description: |
5908 New profiles can be added by plugins ; available in core PeerTube: 'default'.
5051 resolutions: 5909 resolutions:
5052 type: object 5910 type: object
5911 description: Resolutions to transcode _new videos_ to
5053 properties: 5912 properties:
5913 0p:
5914 type: boolean
5054 240p: 5915 240p:
5055 type: boolean 5916 type: boolean
5056 360p: 5917 360p:
@@ -5065,8 +5926,15 @@ components:
5065 type: boolean 5926 type: boolean
5066 2160p: 5927 2160p:
5067 type: boolean 5928 type: boolean
5929 webtorrent:
5930 type: object
5931 description: WebTorrent-specific settings
5932 properties:
5933 enabled:
5934 type: boolean
5068 hls: 5935 hls:
5069 type: object 5936 type: object
5937 description: HLS-specific settings
5070 properties: 5938 properties:
5071 enabled: 5939 enabled:
5072 type: boolean 5940 type: boolean
@@ -5107,10 +5975,16 @@ components:
5107 type: boolean 5975 type: boolean
5108 manualApproval: 5976 manualApproval:
5109 type: boolean 5977 type: boolean
5978
5979 CustomHomepage:
5980 properties:
5981 content:
5982 type: string
5983
5110 Follow: 5984 Follow:
5111 properties: 5985 properties:
5112 id: 5986 id:
5113 type: integer 5987 $ref: '#/components/schemas/id'
5114 follower: 5988 follower:
5115 $ref: '#/components/schemas/Actor' 5989 $ref: '#/components/schemas/Actor'
5116 following: 5990 following:
@@ -5133,6 +6007,7 @@ components:
5133 PredefinedAbuseReasons: 6007 PredefinedAbuseReasons:
5134 description: Reason categories that help triage reports 6008 description: Reason categories that help triage reports
5135 type: array 6009 type: array
6010 maxItems: 8
5136 items: 6011 items:
5137 type: string 6012 type: string
5138 enum: 6013 enum:
@@ -5148,9 +6023,7 @@ components:
5148 Job: 6023 Job:
5149 properties: 6024 properties:
5150 id: 6025 id:
5151 type: integer 6026 $ref: '#/components/schemas/id'
5152 minimum: 0
5153 example: 42
5154 state: 6027 state:
5155 type: string 6028 type: string
5156 enum: 6029 enum:
@@ -5194,24 +6067,124 @@ components:
5194 type: object 6067 type: object
5195 properties: 6068 properties:
5196 id: 6069 id:
5197 type: integer 6070 $ref: '#/components/schemas/id'
5198 example: 8
5199 account: 6071 account:
5200 type: object 6072 type: object
5201 properties: 6073 properties:
5202 id: 6074 id:
5203 type: integer 6075 $ref: '#/components/schemas/id'
5204 example: 37 6076 VideoUploadRequestCommon:
6077 properties:
6078 name:
6079 description: Video name
6080 type: string
6081 example: What is PeerTube?
6082 minLength: 3
6083 maxLength: 120
6084 channelId:
6085 description: Channel id that will contain this video
6086 type: integer
6087 example: 3
6088 minimum: 1
6089 privacy:
6090 $ref: '#/components/schemas/VideoPrivacySet'
6091 category:
6092 $ref: '#/components/schemas/VideoCategorySet'
6093 licence:
6094 $ref: '#/components/schemas/VideoLicenceSet'
6095 language:
6096 $ref: '#/components/schemas/VideoLanguageSet'
6097 description:
6098 description: Video description
6099 type: string
6100 example: |
6101 **[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)**
6102 waitTranscoding:
6103 description: Whether or not we wait transcoding before publish the video
6104 type: boolean
6105 support:
6106 description: A text tell the audience how to support the video creator
6107 example: Please support our work on https://soutenir.framasoft.org/en/ <3
6108 type: string
6109 nsfw:
6110 description: Whether or not this video contains sensitive content
6111 type: boolean
6112 tags:
6113 description: Video tags (maximum 5 tags each between 2 and 30 characters)
6114 type: array
6115 minItems: 1
6116 maxItems: 5
6117 uniqueItems: true
6118 example:
6119 - framasoft
6120 - peertube
6121 items:
6122 type: string
6123 minLength: 2
6124 maxLength: 30
6125 commentsEnabled:
6126 description: Enable or disable comments for this video
6127 type: boolean
6128 downloadEnabled:
6129 description: Enable or disable downloading for this video
6130 type: boolean
6131 originallyPublishedAt:
6132 description: Date when the content was originally published
6133 type: string
6134 format: date-time
6135 scheduleUpdate:
6136 $ref: '#/components/schemas/VideoScheduledUpdate'
6137 thumbnailfile:
6138 description: Video thumbnail file
6139 type: string
6140 format: binary
6141 previewfile:
6142 description: Video preview file
6143 type: string
6144 format: binary
6145 required:
6146 - channelId
6147 - name
6148 VideoUploadRequestLegacy:
6149 allOf:
6150 - $ref: '#/components/schemas/VideoUploadRequestCommon'
6151 - type: object
6152 required:
6153 - videofile
6154 properties:
6155 videofile:
6156 description: Video file
6157 type: string
6158 format: binary
6159 VideoUploadRequestResumable:
6160 allOf:
6161 - $ref: '#/components/schemas/VideoUploadRequestCommon'
6162 - type: object
6163 required:
6164 - filename
6165 properties:
6166 filename:
6167 description: Video filename including extension
6168 type: string
6169 format: filename
6170 example: what_is_peertube.mp4
6171 thumbnailfile:
6172 description: Video thumbnail file
6173 type: string
6174 format: binary
6175 previewfile:
6176 description: Video preview file
6177 type: string
6178 format: binary
5205 VideoUploadResponse: 6179 VideoUploadResponse:
5206 properties: 6180 properties:
5207 video: 6181 video:
5208 type: object 6182 type: object
5209 properties: 6183 properties:
5210 id: 6184 id:
5211 type: integer 6185 $ref: '#/components/schemas/Video/properties/id'
5212 example: 8
5213 uuid: 6186 uuid:
5214 $ref: '#/components/schemas/UUIDv4' 6187 $ref: '#/components/schemas/Video/properties/uuid'
5215 CommentThreadResponse: 6188 CommentThreadResponse:
5216 properties: 6189 properties:
5217 total: 6190 total:
@@ -5238,35 +6211,46 @@ components:
5238 $ref: '#/components/schemas/Video' 6211 $ref: '#/components/schemas/Video'
5239 User: 6212 User:
5240 properties: 6213 properties:
5241 id: 6214 account:
5242 type: integer 6215 $ref: '#/components/schemas/Account'
5243 readOnly: true 6216 autoPlayNextVideo:
5244 username: 6217 type: boolean
6218 description: Automatically start playing the upcoming video after the currently playing video
6219 autoPlayNextVideoPlaylist:
6220 type: boolean
6221 description: Automatically start playing the video on the playlist after the currently playing video
6222 autoPlayVideo:
6223 type: boolean
6224 description: Automatically start playing the video on the watch page
6225 blocked:
6226 type: boolean
6227 blockedReason:
6228 type: string
6229 createdAt:
5245 type: string 6230 type: string
5246 description: The user username
5247 minLength: 1
5248 maxLength: 50
5249 email: 6231 email:
5250 type: string 6232 type: string
5251 format: email 6233 format: email
5252 description: The user email 6234 description: The user email
6235 emailVerified:
6236 type: boolean
6237 description: Has the user confirmed their email address?
6238 id:
6239 allOf:
6240 - $ref: '#/components/schemas/id'
6241 readOnly: true
5253 pluginAuth: 6242 pluginAuth:
5254 type: string 6243 type: string
5255 description: Auth plugin to use to authenticate the user 6244 description: Auth plugin to use to authenticate the user
5256 theme: 6245 lastLoginDate:
5257 type: string 6246 type: string
5258 description: Theme enabled by this user 6247 format: date-time
5259 emailVerified: 6248 noInstanceConfigWarningModal:
6249 type: boolean
6250 noWelcomeModal:
5260 type: boolean 6251 type: boolean
5261 description: Has the user confirmed their email address?
5262 nsfwPolicy: 6252 nsfwPolicy:
5263 $ref: '#/components/schemas/NSFWPolicy' 6253 $ref: '#/components/schemas/NSFWPolicy'
5264 webtorrentEnabled:
5265 type: boolean
5266 description: Enable P2P in the player
5267 autoPlayVideo:
5268 type: boolean
5269 description: Automatically start playing the video on the watch page
5270 role: 6254 role:
5271 $ref: '#/components/schemas/UserRole' 6255 $ref: '#/components/schemas/UserRole'
5272 roleLabel: 6256 roleLabel:
@@ -5275,64 +6259,66 @@ components:
5275 - User 6259 - User
5276 - Moderator 6260 - Moderator
5277 - Administrator 6261 - Administrator
5278 videoQuota: 6262 theme:
5279 type: integer
5280 description: The user video quota
5281 videoQuotaDaily:
5282 type: integer
5283 description: The user daily video quota
5284 videosCount:
5285 type: integer
5286 abusesCount:
5287 type: integer
5288 abusesAcceptedCount:
5289 type: integer
5290 abusesCreatedCount:
5291 type: integer
5292 videoCommentsCount:
5293 type: integer
5294 noInstanceConfigWarningModal:
5295 type: boolean
5296 noWelcomeModal:
5297 type: boolean
5298 blocked:
5299 type: boolean
5300 blockedReason:
5301 type: string
5302 createdAt:
5303 type: string 6263 type: string
5304 account: 6264 description: Theme enabled by this user
5305 $ref: '#/components/schemas/Account' 6265 username:
6266 $ref: '#/components/schemas/username'
5306 videoChannels: 6267 videoChannels:
5307 type: array 6268 type: array
5308 items: 6269 items:
5309 $ref: '#/components/schemas/VideoChannel' 6270 $ref: '#/components/schemas/VideoChannel'
6271 videoQuota:
6272 type: integer
6273 description: The user video quota in bytes
6274 example: -1
6275 videoQuotaDaily:
6276 type: integer
6277 description: The user daily video quota in bytes
6278 example: -1
6279 webtorrentEnabled:
6280 type: boolean
6281 description: Enable P2P in the player
6282 UserWithStats:
6283 allOf:
6284 - $ref: '#/components/schemas/User'
6285 - properties:
6286 # optionally present fields: they require WITH_STATS scope
6287 videosCount:
6288 type: integer
6289 description: Count of videos published
6290 abusesCount:
6291 type: integer
6292 description: Count of reports/abuses of which the user is a target
6293 abusesAcceptedCount:
6294 type: integer
6295 description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team
6296 abusesCreatedCount:
6297 type: integer
6298 description: Count of reports/abuses created by the user
6299 videoCommentsCount:
6300 type: integer
6301 description: Count of comments published
5310 AddUser: 6302 AddUser:
5311 properties: 6303 properties:
5312 username: 6304 username:
5313 type: string 6305 $ref: '#/components/schemas/username'
5314 description: The user username
5315 minLength: 1
5316 maxLength: 50
5317 password: 6306 password:
5318 type: string 6307 $ref: '#/components/schemas/password'
5319 format: password
5320 description: The user password. If the smtp server is configured, you can leave empty and an email will be sent
5321 minLength: 6
5322 maxLength: 255
5323 email: 6308 email:
5324 type: string 6309 type: string
5325 format: email 6310 format: email
5326 description: The user email 6311 description: The user email
5327 videoQuota: 6312 videoQuota:
5328 type: integer 6313 type: integer
5329 description: The user video quota 6314 description: The user video quota in bytes
6315 example: -1
5330 videoQuotaDaily: 6316 videoQuotaDaily:
5331 type: integer 6317 type: integer
5332 description: The user daily video quota 6318 description: The user daily video quota in bytes
6319 example: -1
5333 channelName: 6320 channelName:
5334 type: string 6321 $ref: '#/components/schemas/usernameChannel'
5335 description: The user default channel username
5336 role: 6322 role:
5337 $ref: '#/components/schemas/UserRole' 6323 $ref: '#/components/schemas/UserRole'
5338 adminFlags: 6324 adminFlags:
@@ -5346,22 +6332,19 @@ components:
5346 - role 6332 - role
5347 UpdateUser: 6333 UpdateUser:
5348 properties: 6334 properties:
5349 id:
5350 type: string
5351 description: The user id
5352 email: 6335 email:
5353 type: string
5354 format: email
5355 description: The updated email of the user 6336 description: The updated email of the user
6337 allOf:
6338 - $ref: '#/components/schemas/User/properties/email'
5356 emailVerified: 6339 emailVerified:
5357 type: boolean 6340 type: boolean
5358 description: Set the email as verified 6341 description: Set the email as verified
5359 videoQuota: 6342 videoQuota:
5360 type: integer 6343 type: integer
5361 description: The updated video quota of the user 6344 description: The updated video quota of the user in bytes
5362 videoQuotaDaily: 6345 videoQuotaDaily:
5363 type: integer 6346 type: integer
5364 description: The updated daily video quota of the user 6347 description: The updated daily video quota of the user in bytes
5365 pluginAuth: 6348 pluginAuth:
5366 type: string 6349 type: string
5367 nullable: true 6350 nullable: true
@@ -5371,42 +6354,65 @@ components:
5371 $ref: '#/components/schemas/UserRole' 6354 $ref: '#/components/schemas/UserRole'
5372 adminFlags: 6355 adminFlags:
5373 $ref: '#/components/schemas/UserAdminFlags' 6356 $ref: '#/components/schemas/UserAdminFlags'
5374 required:
5375 - id
5376 UpdateMe: 6357 UpdateMe:
6358 # see shared/models/users/user-update-me.model.ts:
5377 properties: 6359 properties:
5378 password: 6360 password:
5379 type: string 6361 $ref: '#/components/schemas/password'
5380 format: password 6362 currentPassword:
5381 description: Your new password 6363 $ref: '#/components/schemas/password'
5382 minLength: 6
5383 maxLength: 255
5384 email: 6364 email:
6365 description: new email used for login and service communications
6366 allOf:
6367 - $ref: '#/components/schemas/User/properties/email'
6368 displayName:
5385 type: string 6369 type: string
5386 format: email 6370 description: new name of the user in its representations
5387 description: Your new email 6371 minLength: 3
6372 maxLength: 120
5388 displayNSFW: 6373 displayNSFW:
5389 type: string 6374 type: string
5390 description: Your new displayNSFW 6375 description: new NSFW display policy
5391 enum: 6376 enum:
5392 - 'true' 6377 - 'true'
5393 - 'false' 6378 - 'false'
5394 - both 6379 - both
6380 webTorrentEnabled:
6381 type: boolean
6382 description: whether to enable P2P in the player or not
5395 autoPlayVideo: 6383 autoPlayVideo:
5396 type: boolean 6384 type: boolean
5397 description: Your new autoPlayVideo 6385 description: new preference regarding playing videos automatically
5398 required: 6386 autoPlayNextVideo:
5399 - password 6387 type: boolean
5400 - email 6388 description: new preference regarding playing following videos automatically
5401 - displayNSFW 6389 autoPlayNextVideoPlaylist:
5402 - autoPlayVideo 6390 type: boolean
6391 description: new preference regarding playing following playlist videos automatically
6392 videosHistoryEnabled:
6393 type: boolean
6394 description: whether to keep track of watched history or not
6395 videoLanguages:
6396 type: array
6397 items:
6398 type: string
6399 description: list of languages to filter videos down to
6400 theme:
6401 type: string
6402 noInstanceConfigWarningModal:
6403 type: boolean
6404 noWelcomeModal:
6405 type: boolean
5403 GetMeVideoRating: 6406 GetMeVideoRating:
5404 properties: 6407 properties:
5405 id: 6408 id:
5406 type: string 6409 $ref: '#/components/schemas/id'
5407 description: Id of the video
5408 rating: 6410 rating:
5409 type: number 6411 type: string
6412 enum:
6413 - like
6414 - dislike
6415 - none
5410 description: Rating of the video 6416 description: Rating of the video
5411 required: 6417 required:
5412 - id 6418 - id
@@ -5416,85 +6422,170 @@ components:
5416 video: 6422 video:
5417 $ref: '#/components/schemas/Video' 6423 $ref: '#/components/schemas/Video'
5418 rating: 6424 rating:
5419 type: number 6425 type: string
5420 description: 'Rating of the video' 6426 enum:
6427 - like
6428 - dislike
6429 - none
6430 description: Rating of the video
5421 required: 6431 required:
5422 - video 6432 - video
5423 - rating 6433 - rating
5424 RegisterUser: 6434 RegisterUser:
5425 properties: 6435 properties:
5426 username: 6436 username:
5427 type: string 6437 description: immutable name of the user, used to find or mention its actor
5428 description: The username of the user 6438 allOf:
5429 minLength: 1 6439 - $ref: '#/components/schemas/username'
5430 maxLength: 50
5431 pattern: '/^[a-z0-9._]{1,50}$/'
5432 password: 6440 password:
5433 type: string 6441 $ref: '#/components/schemas/password'
5434 format: password
5435 description: The password of the user
5436 minLength: 6
5437 maxLength: 255
5438 email: 6442 email:
5439 type: string 6443 type: string
5440 format: email 6444 format: email
5441 description: The email of the user 6445 description: email of the user, used for login or service communications
5442 displayName: 6446 displayName:
5443 type: string 6447 type: string
5444 description: The user display name 6448 description: editable name of the user, displayed in its representations
5445 minLength: 1 6449 minLength: 1
5446 maxLength: 120 6450 maxLength: 120
5447 channel: 6451 channel:
5448 type: object 6452 type: object
6453 description: channel base information used to create the first channel of the user
5449 properties: 6454 properties:
5450 name: 6455 name:
5451 type: string 6456 $ref: '#/components/schemas/usernameChannel'
5452 description: The username for the default channel
5453 pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/'
5454 displayName: 6457 displayName:
5455 type: string 6458 $ref: '#/components/schemas/VideoChannel/properties/displayName'
5456 description: The display name for the default channel
5457 minLength: 1
5458 maxLength: 120
5459 required: 6459 required:
5460 - username 6460 - username
5461 - password 6461 - password
5462 - email 6462 - email
5463 6463
5464 VideoChannelCommon: 6464 OAuthClient:
5465 properties: 6465 properties:
6466 client_id:
6467 type: string
6468 pattern: /^[a-z0-9]$/
6469 maxLength: 32
6470 minLength: 32
6471 example: v1ikx5hnfop4mdpnci8nsqh93c45rldf
6472 client_secret:
6473 type: string
6474 pattern: /^[a-zA-Z0-9]$/
6475 maxLength: 32
6476 minLength: 32
6477 example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt
6478 OAuthToken-password:
6479 allOf:
6480 - $ref: '#/components/schemas/OAuthClient'
6481 - type: object
6482 properties:
6483 grant_type:
6484 type: string
6485 enum:
6486 - password
6487 - refresh_token
6488 default: password
6489 username:
6490 $ref: '#/components/schemas/User/properties/username'
6491 password:
6492 $ref: '#/components/schemas/password'
6493 required:
6494 - client_id
6495 - client_secret
6496 - grant_type
6497 - username
6498 - password
6499 OAuthToken-refresh_token:
6500 allOf:
6501 - $ref: '#/components/schemas/OAuthClient'
6502 - type: object
6503 properties:
6504 grant_type:
6505 type: string
6506 enum:
6507 - password
6508 - refresh_token
6509 default: password
6510 refresh_token:
6511 type: string
6512 example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7
6513 required:
6514 - client_id
6515 - client_secret
6516 - grant_type
6517 - refresh_token
6518
6519 VideoChannel:
6520 properties:
6521 # GET/POST/PUT properties
5466 displayName: 6522 displayName:
5467 type: string 6523 type: string
6524 description: editable name of the channel, displayed in its representations
6525 example: Videos of Framasoft
5468 minLength: 1 6526 minLength: 1
5469 maxLength: 120 6527 maxLength: 120
5470 description: 6528 description:
5471 type: string 6529 type: string
6530 example: Videos made with <3 by Framasoft
5472 minLength: 3 6531 minLength: 3
5473 maxLength: 1000 6532 maxLength: 1000
5474 support: 6533 support:
5475 type: string 6534 type: string
5476 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it' 6535 description: text shown by default on all videos of this channel, to tell the audience how to support it
5477 example: Please support my work on <insert crowdfunding plateform>! <3 6536 example: Please support our work on https://soutenir.framasoft.org/en/ <3
5478 minLength: 3 6537 minLength: 3
5479 maxLength: 1000 6538 maxLength: 1000
6539 # GET-only properties
6540 id:
6541 readOnly: true
6542 allOf:
6543 - $ref: '#/components/schemas/id'
6544 isLocal:
6545 readOnly: true
6546 type: boolean
6547 updatedAt:
6548 readOnly: true
6549 type: string
6550 format: date-time
6551 ownerAccount:
6552 readOnly: true
6553 nullable: true
6554 type: object
6555 properties:
6556 id:
6557 type: integer
6558 uuid:
6559 $ref: '#/components/schemas/UUIDv4'
5480 VideoChannelCreate: 6560 VideoChannelCreate:
5481 allOf: 6561 allOf:
5482 - $ref: '#/components/schemas/VideoChannelCommon' 6562 - $ref: '#/components/schemas/VideoChannel'
5483 - properties: 6563 - properties:
5484 name: 6564 name:
5485 type: string 6565 description: username of the channel to create
5486 minLength: 1 6566 allOf:
5487 maxLength: 120 6567 - $ref: '#/components/schemas/usernameChannel'
5488 required: 6568 required:
5489 - name 6569 - name
5490 - displayName 6570 - displayName
5491 VideoChannelUpdate: 6571 VideoChannelUpdate:
5492 allOf: 6572 allOf:
5493 - $ref: '#/components/schemas/VideoChannelCommon' 6573 - $ref: '#/components/schemas/VideoChannel'
5494 - properties: 6574 - properties:
5495 bulkVideosSupportUpdate: 6575 bulkVideosSupportUpdate:
5496 type: boolean 6576 type: boolean
5497 description: 'Update the support field for all videos of this channel' 6577 description: Update the support field for all videos of this channel
6578 VideoChannelList:
6579 properties:
6580 total:
6581 type: integer
6582 example: 1
6583 data:
6584 type: array
6585 items:
6586 allOf:
6587 - $ref: '#/components/schemas/VideoChannel'
6588 - $ref: '#/components/schemas/Actor'
5498 6589
5499 MRSSPeerLink: 6590 MRSSPeerLink:
5500 type: object 6591 type: object
@@ -5699,7 +6790,7 @@ components:
5699 Notification: 6790 Notification:
5700 properties: 6791 properties:
5701 id: 6792 id:
5702 type: integer 6793 $ref: '#/components/schemas/id'
5703 type: 6794 type:
5704 type: integer 6795 type: integer
5705 description: > 6796 description: >
@@ -5747,7 +6838,7 @@ components:
5747 type: object 6838 type: object
5748 properties: 6839 properties:
5749 id: 6840 id:
5750 type: integer 6841 $ref: '#/components/schemas/id'
5751 video: 6842 video:
5752 nullable: true 6843 nullable: true
5753 $ref: '#/components/schemas/VideoInfo' 6844 $ref: '#/components/schemas/VideoInfo'
@@ -5755,9 +6846,7 @@ components:
5755 type: string 6846 type: string
5756 nullable: true 6847 nullable: true
5757 magnetUri: 6848 magnetUri:
5758 type: string 6849 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
5759 format: uri
5760 nullable: true
5761 targetUri: 6850 targetUri:
5762 type: string 6851 type: string
5763 format: uri 6852 format: uri
@@ -5767,7 +6856,7 @@ components:
5767 type: object 6856 type: object
5768 properties: 6857 properties:
5769 id: 6858 id:
5770 type: integer 6859 $ref: '#/components/schemas/id'
5771 threadId: 6860 threadId:
5772 type: integer 6861 type: integer
5773 video: 6862 video:
@@ -5779,7 +6868,7 @@ components:
5779 type: object 6868 type: object
5780 properties: 6869 properties:
5781 id: 6870 id:
5782 type: integer 6871 $ref: '#/components/schemas/id'
5783 video: 6872 video:
5784 allOf: 6873 allOf:
5785 - $ref: '#/components/schemas/VideoInfo' 6874 - $ref: '#/components/schemas/VideoInfo'
@@ -5788,7 +6877,7 @@ components:
5788 type: object 6877 type: object
5789 properties: 6878 properties:
5790 id: 6879 id:
5791 type: integer 6880 $ref: '#/components/schemas/id'
5792 video: 6881 video:
5793 allOf: 6882 allOf:
5794 - $ref: '#/components/schemas/VideoInfo' 6883 - $ref: '#/components/schemas/VideoInfo'
@@ -5801,7 +6890,7 @@ components:
5801 nullable: true 6890 nullable: true
5802 properties: 6891 properties:
5803 id: 6892 id:
5804 type: integer 6893 $ref: '#/components/schemas/id'
5805 follower: 6894 follower:
5806 $ref: '#/components/schemas/ActorInfo' 6895 $ref: '#/components/schemas/ActorInfo'
5807 state: 6896 state:
diff --git a/support/doc/dependencies.md b/support/doc/dependencies.md
index 9666d72af..939772a9d 100644
--- a/support/doc/dependencies.md
+++ b/support/doc/dependencies.md
@@ -307,7 +307,7 @@ brew services run redis
307``` 307```
308 308
309On macOS, the `postgresql` user can be `_postgres` instead of `postgres`. 309On macOS, the `postgresql` user can be `_postgres` instead of `postgres`.
310If `sudo -u postgres createuser -P peertube` gives you an error, you can try `sudo -u _postgres createuser -U peertube`. 310If `sudo -u postgres createuser -P peertube` gives you an `unknown user: postgres` error, you can try `sudo -u _postgres createuser -U peertube`.
311 311
312## Gentoo 312## Gentoo
313 313
diff --git a/support/doc/development/monitoring.md b/support/doc/development/monitoring.md
new file mode 100644
index 000000000..8b637e079
--- /dev/null
+++ b/support/doc/development/monitoring.md
@@ -0,0 +1,17 @@
1# Monitoring
2
3## Client modules
4
5To open a report of client build:
6
7```
8$ npm run build -- --analyze-bundle && npm run client-report
9```
10
11## API benchmark
12
13To benchmark the REST API and save result in `benchmark.json`:
14
15```
16$ node dist/scripts/benchmark.js benchmark.json
17```
diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md
index 53d53c26d..d3b9db0ed 100644
--- a/support/doc/plugins/guide.md
+++ b/support/doc/plugins/guide.md
@@ -39,6 +39,7 @@
39 - [Build your plugin](#build-your-plugin) 39 - [Build your plugin](#build-your-plugin)
40 - [Test your plugin/theme](#test-your-plugintheme) 40 - [Test your plugin/theme](#test-your-plugintheme)
41 - [Publish](#publish) 41 - [Publish](#publish)
42 - [Unpublish](#unpublish)
42- [Plugin & Theme hooks/helpers API](#plugin--theme-hookshelpers-api) 43- [Plugin & Theme hooks/helpers API](#plugin--theme-hookshelpers-api)
43- [Tips](#tips) 44- [Tips](#tips)
44 - [Compatibility with PeerTube](#compatibility-with-peertube) 45 - [Compatibility with PeerTube](#compatibility-with-peertube)
@@ -261,8 +262,8 @@ function register ({
261 router.get('/ping', (req, res) => res.json({ message: 'pong' })) 262 router.get('/ping', (req, res) => res.json({ message: 'pong' }))
262 263
263 // Users are automatically authenticated 264 // Users are automatically authenticated
264 router.get('/auth', (res, res) => { 265 router.get('/auth', async (res, res) => {
265 const user = peertubeHelpers.user.getAuthUser(res) 266 const user = await peertubeHelpers.user.getAuthUser(res)
266 267
267 const isAdmin = user.role === 0 268 const isAdmin = user.role === 0
268 const isModerator = user.role === 1 269 const isModerator = user.role === 1
@@ -909,6 +910,14 @@ $ npm publish
909Every time you want to publish another version of your plugin/theme, just update the `version` key from the `package.json` 910Every time you want to publish another version of your plugin/theme, just update the `version` key from the `package.json`
910and republish it on NPM. Remember that the PeerTube index will take into account your new plugin/theme version after ~24 hours. 911and republish it on NPM. Remember that the PeerTube index will take into account your new plugin/theme version after ~24 hours.
911 912
913### Unpublish
914
915If for a particular reason you don't want to maintain your plugin/theme anymore
916you can deprecate it. The plugin index will automatically remove it preventing users to find/install it from the PeerTube admin interface:
917
918```bash
919$ npm deprecate peertube-plugin-xxx@"> 0.0.0" "explain here why you deprecate your plugin/theme"
920```
912 921
913## Plugin & Theme hooks/helpers API 922## Plugin & Theme hooks/helpers API
914 923
diff --git a/support/doc/production.md b/support/doc/production.md
index 8f3a17f12..81748ae16 100644
--- a/support/doc/production.md
+++ b/support/doc/production.md
@@ -38,6 +38,7 @@ or use `adduser` to create it interactively.
38Create the production database and a peertube user inside PostgreSQL: 38Create the production database and a peertube user inside PostgreSQL:
39 39
40``` 40```
41$ cd /var/www/peertube
41$ sudo -u postgres createuser -P peertube 42$ sudo -u postgres createuser -P peertube
42``` 43```
43 44
diff --git a/support/docker/production/.env b/support/docker/production/.env
index 3e19c3817..70743e0ec 100644
--- a/support/docker/production/.env
+++ b/support/docker/production/.env
@@ -8,6 +8,7 @@ POSTGRES_DB=peertube
8#PEERTUBE_DB_SUFFIX=_prod 8#PEERTUBE_DB_SUFFIX=_prod
9PEERTUBE_DB_USERNAME=<MY POSTGRES USERNAME> 9PEERTUBE_DB_USERNAME=<MY POSTGRES USERNAME>
10PEERTUBE_DB_PASSWORD=<MY POSTGRES PASSWORD> 10PEERTUBE_DB_PASSWORD=<MY POSTGRES PASSWORD>
11PEERTUBE_DB_SSL=false
11# Default to Postgres service name "postgres" in docker-compose.yml 12# Default to Postgres service name "postgres" in docker-compose.yml
12PEERTUBE_DB_HOSTNAME=postgres 13PEERTUBE_DB_HOSTNAME=postgres
13 14
diff --git a/support/docker/production/Dockerfile.buster b/support/docker/production/Dockerfile.buster
index b3822964d..2ff0591f9 100644
--- a/support/docker/production/Dockerfile.buster
+++ b/support/docker/production/Dockerfile.buster
@@ -7,7 +7,7 @@ ARG NPM_RUN_BUILD_OPTS
7 7
8# Install dependencies 8# Install dependencies
9RUN apt update \ 9RUN apt update \
10 && apt install -y --no-install-recommends openssl ffmpeg python ca-certificates gnupg gosu build-essential \ 10 && apt install -y --no-install-recommends openssl ffmpeg python ca-certificates gnupg gosu build-essential curl \
11 && gosu nobody true \ 11 && gosu nobody true \
12 && rm /var/lib/apt/lists/* -fR 12 && rm /var/lib/apt/lists/* -fR
13 13
diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml
index 8226715e0..0ed060bbf 100644
--- a/support/docker/production/config/custom-environment-variables.yaml
+++ b/support/docker/production/config/custom-environment-variables.yaml
@@ -19,6 +19,9 @@ database:
19 suffix: "PEERTUBE_DB_SUFFIX" 19 suffix: "PEERTUBE_DB_SUFFIX"
20 username: "PEERTUBE_DB_USERNAME" 20 username: "PEERTUBE_DB_USERNAME"
21 password: "PEERTUBE_DB_PASSWORD" 21 password: "PEERTUBE_DB_PASSWORD"
22 ssl:
23 __name: "PEERTUBE_DB_SSL"
24 __format: "json"
22 25
23redis: 26redis:
24 hostname: "PEERTUBE_REDIS_HOSTNAME" 27 hostname: "PEERTUBE_REDIS_HOSTNAME"
diff --git a/support/docker/production/config/production.yaml b/support/docker/production/config/production.yaml
index c97c37987..5cb39e268 100644
--- a/support/docker/production/config/production.yaml
+++ b/support/docker/production/config/production.yaml
@@ -62,7 +62,7 @@ storage:
62 client_overrides: '../data/client-overrides/' 62 client_overrides: '../data/client-overrides/'
63 63
64log: 64log:
65 level: 'info' # debug/info/warning/error 65 level: 'info' # 'debug' | 'info' | 'warn' | 'error'
66 66
67tracker: 67tracker:
68 enabled: true 68 enabled: true
diff --git a/support/nginx/peertube b/support/nginx/peertube
index 00ce1d0dc..7c95c130c 100644
--- a/support/nginx/peertube
+++ b/support/nginx/peertube
@@ -78,6 +78,13 @@ server {
78 try_files /dev/null @api; 78 try_files /dev/null @api;
79 } 79 }
80 80
81 location = /api/v1/videos/upload-resumable {
82 client_max_body_size 0;
83 proxy_request_buffering off;
84
85 try_files /dev/null @api;
86 }
87
81 location = /api/v1/videos/upload { 88 location = /api/v1/videos/upload {
82 limit_except POST HEAD { deny all; } 89 limit_except POST HEAD { deny all; }
83 90