]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/api/openapi.yaml
Include video file id in API
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
CommitLineData
3e9e6f2f 1openapi: 3.0.0
1569a818 2info:
5e1c08eb 3 title: PeerTube
597da8dd 4 version: 4.0.0
2963c343
RK
5 contact:
6 name: PeerTube Community
e2464d22 7 url: https://joinpeertube.org
2963c343
RK
8 license:
9 name: AGPLv3.0
e2464d22 10 url: https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE
2963c343 11 x-logo:
e2464d22 12 url: https://joinpeertube.org/img/brand.png
5776f78e 13 altText: PeerTube Project Homepage
2963c343 14 description: |
b029d58a 15 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite
06746a8b 16 HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with
5776f78e 17 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
06746a8b
RK
18 which generates a client SDK in the language of your choice - we generate some client SDKs automatically:
19
20 - [Python](https://framagit.org/framasoft/peertube/clients/python)
21 - [Go](https://framagit.org/framasoft/peertube/clients/go)
22 - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin)
3e9e6f2f 23
3c5e02f3 24 See the [REST API quick start](https://docs.joinpeertube.org/api-rest-getting-started) for a few
e2adb8cb 25 examples of using the PeerTube API.
b029d58a 26
2963c343 27 # Authentication
002df381 28
3c5e02f3 29 When you sign up for an account on a PeerTube instance, you are given the possibility
e2464d22
RK
30 to generate sessions on it, and authenticate there using an access token. Only __one
31 access token can currently be used at a time__.
5776f78e 32
84f6e32c
RK
33 ## Roles
34
35 Accounts are given permissions based on their role. There are three roles on
9817060f 36 PeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/admin-managing-users?id=roles) for a detail of their permissions.
84f6e32c 37
5776f78e 38 # Errors
002df381 39
5776f78e 40 The API uses standard HTTP status codes to indicate the success or failure
76148b27 41 of the API call, completed by a [RFC7807-compliant](https://tools.ietf.org/html/rfc7807) response body.
5776f78e
RK
42
43 ```
b036eb05 44 HTTP 1.1 404 Not Found
76148b27 45 Content-Type: application/problem+json; charset=utf-8
b036eb05 46
5776f78e 47 {
76148b27 48 "detail": "Video not found",
1cfbdd30 49 "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo",
76148b27
RK
50 "status": 404,
51 "title": "Not Found",
52 "type": "about:blank"
de3876b8
RK
53 }
54 ```
55
81628e50
RK
56 We provide error `type` values for [a growing number of cases](https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/server/server-error-code.enum.ts),
57 but it is still optional. Types are used to disambiguate errors that bear the same status code
58 and are non-obvious:
59
60 ```
61 HTTP 1.1 403 Forbidden
62 Content-Type: application/problem+json; charset=utf-8
63
64 {
65 "detail": "Cannot get this video regarding follow constraints",
66 "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo",
67 "status": 403,
68 "title": "Forbidden",
69 "type": "https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/does_not_respect_follow_constraints"
70 }
71 ```
72
73 Here a 403 error could otherwise mean that the video is private or blocklisted.
b036eb05
RK
74
75 ### Validation errors
76
77 Each parameter is evaluated on its own against a set of rules before the route validator
76148b27 78 proceeds with potential testing involving parameter combinations. Errors coming from validation
81628e50 79 errors appear earlier and benefit from a more detailed error description:
9a320a06 80
de3876b8 81 ```
b036eb05 82 HTTP 1.1 400 Bad Request
76148b27 83 Content-Type: application/problem+json; charset=utf-8
b036eb05 84
de3876b8 85 {
76148b27 86 "detail": "Incorrect request parameters: id",
1cfbdd30 87 "docs": "https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo",
76148b27
RK
88 "instance": "/api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180",
89 "invalid-params": {
3f71c4c0 90 "id": {
76148b27
RK
91 "location": "params",
92 "msg": "Invalid value",
de3876b8 93 "param": "id",
76148b27 94 "value": "9c9de5e8-0a1e-484a-b099-e80766180"
de3876b8 95 }
76148b27
RK
96 },
97 "status": 400,
98 "title": "Bad Request",
99 "type": "about:blank"
5776f78e
RK
100 }
101 ```
3c5e02f3 102
b036eb05 103 Where `id` is the name of the field concerned by the error, within the route definition.
76148b27
RK
104 `invalid-params.<field>.location` can be either 'params', 'body', 'header', 'query' or 'cookies', and
105 `invalid-params.<field>.value` reports the value that didn't pass validation whose `invalid-params.<field>.msg`
b036eb05
RK
106 is about.
107
81628e50
RK
108 ### Deprecated error fields
109
110 Some fields could be included with previous versions. They are still included but their use is deprecated:
111 - `error`: superseded by `detail`
112 - `code`: superseded by `type` (which is now an URI)
113
3c5e02f3
RK
114 # Rate limits
115
30b40713 116 We are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators:
3c5e02f3 117
0ae3ebb0
RK
118 | Endpoint (prefix: `/api/v1`) | Calls | Time frame |
119 |------------------------------|---------------|--------------|
120 | `/*` | 50 | 10 seconds |
121 | `POST /users/token` | 15 | 5 minutes |
122 | `POST /users/register` | 2<sup>*</sup> | 5 minutes |
123 | `POST /users/ask-send-verify-email` | 3 | 5 minutes |
3c5e02f3 124
bf3c3fea 125 Depending on the endpoint, <sup>*</sup>failed requests are not taken into account. A service
3c5e02f3
RK
126 limit is announced by a `429 Too Many Requests` status code.
127
52fe9526
RK
128 You can get details about the current state of your rate limit by reading the
129 following headers:
3c5e02f3
RK
130
131 | Header | Description |
132 |-------------------------|------------------------------------------------------------|
9a320a06
RK
133 | `X-RateLimit-Limit` | Number of max requests allowed in the current time period |
134 | `X-RateLimit-Remaining` | Number of remaining requests in the current time period |
135 | `X-RateLimit-Reset` | Timestamp of end of current time period as UNIX timestamp |
136 | `Retry-After` | Seconds to delay after the first `429` is received |
0ae3ebb0
RK
137
138 # CORS
139
140 This API features [Cross-Origin Resource Sharing (CORS)](https://fetch.spec.whatwg.org/),
141 allowing cross-domain communication from the browser for some routes:
85a60d8b 142
e2464d22
RK
143 | Endpoint |
144 |------------------------- ---|
145 | `/api/*` |
146 | `/download/*` |
147 | `/lazy-static/*` |
148 | `/live/segments-sha256/*` |
149 | `/.well-known/webfinger` |
0ae3ebb0
RK
150
151 In addition, all routes serving ActivityPub are CORS-enabled for all origins.
6441981b 152externalDocs:
512a5759 153 url: https://docs.joinpeertube.org/api-rest-reference.html
2963c343 154tags:
e2464d22
RK
155 - name: Register
156 description: |
157 As a visitor, you can use this API to open an account (if registrations are open on
85a60d8b 158 that PeerTube instance). As an admin, you should use the dedicated [User creation
e2adb8cb 159 API](#operation/addUser) instead.
e2464d22
RK
160 - name: Session
161 x-displayName: Login/Logout
162 description: |
163 Sessions deal with access tokens over time. Only __one session token can currently be used at a time__.
2963c343 164 - name: Accounts
3e9e6f2f 165 description: >
1e904cde 166 Accounts encompass remote accounts discovered across the federation,
84f6e32c
RK
167 and correspond to the main Actor, along with video channels a user can create, which
168 are also Actors.
169
170 When a comment is posted, it is done with your Account's Actor.
171 - name: Users
172 description: >
173 Using some features of PeerTube require authentication, for which User
3e9e6f2f 174 provide different levels of permission as well as associated user
84f6e32c
RK
175 information. Each user has a corresponding local Account for federation.
176 - name: My User
177 description: >
178 Operations related to your own User, when logged-in.
179 - name: My Subscriptions
180 description: >
181 Operations related to your subscriptions to video channels, their
182 new videos, and how to keep up to date with their latest publications!
3520d385
A
183 - name: My History
184 description: >
bb4ba6d9 185 Operations related to your watch history.
84f6e32c
RK
186 - name: My Notifications
187 description: >
188 Notifications following new videos, follows or reports. They allow you
189 to keep track of the interactions and overall important information that
190 concerns you. You MAY set per-notification type delivery preference, to
191 receive the info either by mail, by in-browser notification or both.
2963c343 192 - name: Config
3e9e6f2f
RK
193 description: >
194 Each server exposes public information regarding supported videos and
195 options.
2963c343 196 - name: Job
3e9e6f2f
RK
197 description: >
198 Jobs are long-running tasks enqueued and processed by the instance
5776f78e 199 itself. No additional worker registration is currently available.
b029d58a 200 - name: Instance Follows
3e9e6f2f
RK
201 description: >
202 Managing servers which the instance interacts with is crucial to the
5776f78e 203 concept of federation in PeerTube and external video indexation. The PeerTube
1fd12c7c 204 server then deals with inter-server ActivityPub operations and propagates
2963c343
RK
205 information across its social graph by posting activities to actors' inbox
206 endpoints.
84f6e32c 207 externalDocs:
9817060f 208 url: https://docs.joinpeertube.org/admin-following-instances?id=instances-follows
04b703f6
RK
209 - name: Instance Redundancy
210 description: >
211 Redundancy is part of the inter-server solidarity that PeerTube fosters.
212 Manage the list of instances you wish to help by seeding their videos according
213 to the policy of video selection of your choice. Note that you have a similar functionality
f6d6e7f8 214 to mirror individual videos, see [video mirroring](#tag/Video-Mirroring).
84f6e32c 215 externalDocs:
9817060f 216 url: https://docs.joinpeertube.org/admin-following-instances?id=instances-redundancy
7461d440
RK
217 - name: Plugins
218 description: >
84f6e32c
RK
219 Managing plugins installed from a local path or from NPM, or search for new ones.
220 externalDocs:
9817060f 221 url: https://docs.joinpeertube.org/api-plugins
310b5219 222 - name: Abuses
2963c343 223 description: |
310b5219 224 Abuses deal with reports of local or remote videos/comments/accounts alike.
2963c343
RK
225 - name: Video
226 description: |
227 Operations dealing with listing, uploading, fetching or modifying videos.
f6d6e7f8 228 - name: Video Upload
229 description: |
230 Operations dealing with adding video or audio. PeerTube supports two upload modes, and three import modes.
231
232 ### Upload
233
40cfb36b
RK
234 - [_legacy_](#operation/uploadLegacy), where the video file is sent in a single request
235 - [_resumable_](#operation/uploadResumableInit), where the video file is sent in chunks
f6d6e7f8 236
237 You can upload videos more reliably by using the resumable variant. Its protocol lets
238 you resume an upload operation after a network interruption or other transmission failure,
239 saving time and bandwidth in the event of network failures.
240
241 Favor using resumable uploads in any of the following cases:
242 - You are transferring large files
243 - The likelihood of a network interruption is high
244 - Uploads are originating from a device with a low-bandwidth or unstable Internet connection,
245 such as a mobile device
246
247 ### Import
248
249 - _URL_-based: where the URL points to any service supported by [youtube-dl](https://ytdl-org.github.io/youtube-dl/)
7a4fd56c 250 - _magnet_-based: where the URI resolves to a BitTorrent resource containing a single supported video file
251 - _torrent_-based: where the metainfo file resolves to a BitTorrent resource containing a single supported video file
f6d6e7f8 252
253 The import function is practical when the desired video/audio is available online. It makes PeerTube
254 download it for you, saving you as much bandwidth and avoiding any instability or limitation your network might have.
419b520c
C
255 - name: Video Imports
256 description: Operations dealing with listing, adding and removing video imports.
f6d6e7f8 257 - name: Video Captions
258 description: Operations dealing with listing, adding and removing closed captions of a video.
259 - name: Video Channels
260 description: Operations dealing with the creation, modification and listing of videos within a channel.
261 - name: Video Comments
262 description: >
263 Operations dealing with comments to a video. Comments are organized in threads: adding a
264 comment in response to the video starts a thread, adding a reply to a comment adds it to
265 its root comment thread.
266 - name: Video Blocks
267 description: Operations dealing with blocking videos (removing them from view and preventing interactions).
268 - name: Video Rates
269 description: Like/dislike a video.
270 - name: Video Playlists
271 description: Operations dealing with playlists of videos. Playlists are bound to users and/or channels.
ad5db104
C
272 - name: Video Files
273 description: Operations on video files
274 - name: Video Transcoding
275 description: Video transcoding related operations
cf158e7e
C
276 - name: Video stats
277 description: Video statistics
f6d6e7f8 278 - name: Feeds
279 description: Server syndication feeds
2963c343
RK
280 - name: Search
281 description: |
ad031145 282 The search helps to find _videos_ or _channels_ from within the instance and beyond.
2963c343
RK
283 Videos from other instances federated by the instance (that is, instances
284 followed by the instance) can be found via keywords and other criteria of
285 the advanced search.
ad031145
C
286
287 Administrators can also enable the use of a remote search system, indexing
288 videos and channels not could be not federated by the instance.
2539932e
C
289 - name: Homepage
290 description: Get and update the custom homepage
f6d6e7f8 291 - name: Video Mirroring
292 description: |
293 PeerTube instances can mirror videos from one another, and help distribute some videos.
294
b8375da9 295 For importing videos as your own, refer to [video imports](#operation/importVideo).
b44b5a83
C
296 - name: Stats
297 description: |
298 Statistics
299
5776f78e 300x-tagGroups:
e2464d22
RK
301 - name: Auth
302 tags:
303 - Register
304 - Session
5776f78e
RK
305 - name: Accounts
306 tags:
307 - Accounts
b029d58a 308 - Users
1f82e3e8 309 - My User
b029d58a 310 - My Subscriptions
f4d59981 311 - My Notifications
3520d385 312 - My History
5776f78e
RK
313 - name: Videos
314 tags:
315 - Video
f6d6e7f8 316 - Video Upload
419b520c 317 - Video Imports
04b703f6 318 - Video Captions
b029d58a
C
319 - Video Channels
320 - Video Comments
b029d58a
C
321 - Video Rates
322 - Video Playlists
cf158e7e 323 - Video Stats
b029d58a 324 - Video Ownership Change
04b703f6 325 - Video Mirroring
ad5db104
C
326 - Video Files
327 - Video Transcoding
4e239e35 328 - Live Videos
06746a8b 329 - Feeds
b029d58a
C
330 - name: Search
331 tags:
332 - Search
5776f78e
RK
333 - name: Moderation
334 tags:
310b5219 335 - Abuses
1ebddadd 336 - Video Blocks
06746a8b
RK
337 - Account Blocks
338 - Server Blocks
42b40636 339 - name: Instance
5776f78e
RK
340 tags:
341 - Config
42b40636 342 - Homepage
b029d58a 343 - Instance Follows
04b703f6 344 - Instance Redundancy
7461d440 345 - Plugins
b44b5a83 346 - Stats
42b40636 347 - Logs
5776f78e 348 - Job
1569a818 349paths:
ad9e39fb 350 '/accounts/{name}':
1569a818
DG
351 get:
352 tags:
353 - Accounts
b029d58a 354 summary: Get an account
3f71c4c0 355 operationId: getAccount
1569a818 356 parameters:
3e9e6f2f 357 - $ref: '#/components/parameters/name'
1569a818
DG
358 responses:
359 '200':
360 description: successful operation
3e9e6f2f
RK
361 content:
362 application/json:
363 schema:
364 $ref: '#/components/schemas/Account'
06746a8b
RK
365 '404':
366 description: account not found
3f71c4c0 367
ad9e39fb 368 '/accounts/{name}/videos':
6b738c7a
C
369 get:
370 tags:
371 - Accounts
2963c343 372 - Video
b029d58a 373 summary: 'List videos of an account'
3f71c4c0 374 operationId: getAccountVideos
6b738c7a 375 parameters:
3e9e6f2f 376 - $ref: '#/components/parameters/name'
59c794a5 377 - $ref: '#/components/parameters/categoryOneOf'
1fd61899 378 - $ref: '#/components/parameters/isLive'
59c794a5
C
379 - $ref: '#/components/parameters/tagsOneOf'
380 - $ref: '#/components/parameters/tagsAllOf'
381 - $ref: '#/components/parameters/licenceOneOf'
382 - $ref: '#/components/parameters/languageOneOf'
383 - $ref: '#/components/parameters/nsfw'
2760b454
C
384 - $ref: '#/components/parameters/isLocal'
385 - $ref: '#/components/parameters/include'
527a52ac 386 - $ref: '#/components/parameters/privacyOneOf'
d324756e
C
387 - $ref: '#/components/parameters/hasHLSFiles'
388 - $ref: '#/components/parameters/hasWebtorrentFiles'
59c794a5
C
389 - $ref: '#/components/parameters/skipCount'
390 - $ref: '#/components/parameters/start'
391 - $ref: '#/components/parameters/count'
392 - $ref: '#/components/parameters/videosSort'
6b738c7a
C
393 responses:
394 '200':
395 description: successful operation
3e9e6f2f
RK
396 content:
397 application/json:
398 schema:
048b6946 399 $ref: '#/components/schemas/VideoListResponse'
40cfb36b 400 x-codeSamples:
2963c343
RK
401 - lang: JavaScript
402 source: |
8f9e8be1 403 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
2963c343
RK
404 .then(function(response) {
405 return response.json()
406 }).then(function(data) {
407 console.log(data)
408 })
8f9e8be1
RK
409 - lang: Shell
410 source: |
0579dee3
JK
411 ## DEPENDENCIES: jq
412 curl -s https://peertube2.cpy.re/api/v1/accounts/{name}/videos | jq
5776f78e
RK
413 - lang: Ruby
414 source: |
5776f78e 415 require 'net/http'
f6d51cfe 416 require 'json'
5776f78e 417
f6d51cfe 418 uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
5776f78e 419
f6d51cfe 420 http = Net::HTTP.new(uri.host, uri.port)
5776f78e 421 http.use_ssl = true
5776f78e 422
f6d51cfe
MDB
423 response = http.get(uri.request_uri)
424
425 puts JSON.parse(response.read_body)
5776f78e
RK
426 - lang: Python
427 source: |
f6d51cfe 428 import requests
5776f78e 429
f6d51cfe
MDB
430 r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
431 json = r.json()
5776f78e 432
f6d51cfe 433 print(json)
3f71c4c0 434
906f46d0
C
435 '/accounts/{name}/followers':
436 get:
437 tags:
438 - Accounts
439 summary: 'List followers of an account'
440 security:
441 - OAuth2: []
442 operationId: getAccountFollowers
443 parameters:
444 - $ref: '#/components/parameters/name'
445 - $ref: '#/components/parameters/start'
446 - $ref: '#/components/parameters/count'
447 - $ref: '#/components/parameters/followersSort'
448 - $ref: '#/components/parameters/search'
449 responses:
450 '200':
451 description: successful operation
452 content:
453 application/json:
454 schema:
455 type: object
456 properties:
457 total:
458 type: integer
459 example: 1
460 data:
461 type: array
462 items:
463 $ref: '#/components/schemas/Follow'
464
1569a818
DG
465 /accounts:
466 get:
467 tags:
468 - Accounts
b029d58a 469 summary: List accounts
3f71c4c0 470 operationId: getAccounts
2a8ae759
FS
471 parameters:
472 - $ref: '#/components/parameters/start'
473 - $ref: '#/components/parameters/count'
474 - $ref: '#/components/parameters/sort'
1569a818
DG
475 responses:
476 '200':
477 description: successful operation
3e9e6f2f 478 content:
8f9e8be1 479 'application/json':
3e9e6f2f
RK
480 schema:
481 type: array
482 items:
483 $ref: '#/components/schemas/Account'
3f71c4c0 484
1569a818
DG
485 /config:
486 get:
487 tags:
488 - Config
b029d58a 489 summary: Get instance public configuration
3f71c4c0 490 operationId: getConfig
1569a818
DG
491 responses:
492 '200':
493 description: successful operation
3e9e6f2f
RK
494 content:
495 application/json:
496 schema:
497 $ref: '#/components/schemas/ServerConfig'
40cfb36b
RK
498 examples:
499 nightly:
500 externalValue: https://peertube2.cpy.re/api/v1/config
3f71c4c0 501
6441981b
RK
502 /config/about:
503 get:
b029d58a 504 summary: Get instance "About" information
3f71c4c0 505 operationId: getAbout
6441981b
RK
506 tags:
507 - Config
508 responses:
509 '200':
510 description: successful operation
2a8ae759
FS
511 content:
512 application/json:
513 schema:
514 $ref: '#/components/schemas/ServerConfigAbout'
40cfb36b
RK
515 examples:
516 nightly:
517 externalValue: https://peertube2.cpy.re/api/v1/config/about
3f71c4c0 518
6441981b
RK
519 /config/custom:
520 get:
b029d58a 521 summary: Get instance runtime configuration
3f71c4c0 522 operationId: getCustomConfig
6441981b
RK
523 tags:
524 - Config
525 security:
526 - OAuth2:
64b5c247 527 - admin
6441981b
RK
528 responses:
529 '200':
530 description: successful operation
2a8ae759
FS
531 content:
532 application/json:
533 schema:
534 $ref: '#/components/schemas/ServerConfigCustom'
6441981b 535 put:
b029d58a 536 summary: Set instance runtime configuration
3f71c4c0 537 operationId: putCustomConfig
6441981b
RK
538 tags:
539 - Config
540 security:
541 - OAuth2:
64b5c247 542 - admin
6441981b
RK
543 responses:
544 '200':
545 description: successful operation
84f6e32c
RK
546 '400':
547 x-summary: field inconsistencies
548 description: >
549 Arises when:
550 - the emailer is disabled and the instance is open to registrations
551 - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled
6441981b 552 delete:
b029d58a 553 summary: Delete instance runtime configuration
3f71c4c0 554 operationId: delCustomConfig
6441981b
RK
555 tags:
556 - Config
557 security:
558 - OAuth2:
64b5c247 559 - admin
6441981b
RK
560 responses:
561 '200':
562 description: successful operation
3f71c4c0 563
2539932e
C
564 /custom-pages/homepage/instance:
565 get:
566 summary: Get instance custom homepage
567 tags:
568 - Homepage
569 responses:
570 '404':
571 description: No homepage set
572 '200':
573 description: successful operation
574 content:
575 application/json:
576 schema:
577 $ref: '#/components/schemas/CustomHomepage'
578 put:
579 summary: Set instance custom homepage
580 tags:
581 - Homepage
582 security:
583 - OAuth2:
584 - admin
585 requestBody:
586 content:
587 application/json:
588 schema:
589 type: object
590 properties:
591 content:
592 type: string
593 description: content of the homepage, that will be injected in the client
594 responses:
595 '204':
596 description: successful operation
597
419b520c
C
598 /jobs/pause:
599 post:
600 summary: Pause job queue
601 security:
602 - OAuth2:
603 - admin
604 tags:
605 - Job
606 responses:
607 '204':
608 description: successful operation
609
610 /jobs/resume:
611 post:
612 summary: Resume job queue
613 security:
614 - OAuth2:
615 - admin
616 tags:
617 - Job
618 responses:
619 '204':
620 description: successful operation
621
d216b538 622 /jobs/{state}:
1569a818 623 get:
b029d58a 624 summary: List instance jobs
3f71c4c0 625 operationId: getJobs
94ff4c23 626 security:
3e9e6f2f 627 - OAuth2:
64b5c247 628 - admin
1569a818
DG
629 tags:
630 - Job
44cb3b85
DG
631 parameters:
632 - name: state
633 in: path
634 required: true
040d6896 635 description: The state of the job ('' for for no filter)
3e9e6f2f
RK
636 schema:
637 type: string
65f02679 638 enum:
040d6896 639 - ''
65f02679
RK
640 - active
641 - completed
642 - failed
643 - waiting
644 - delayed
040d6896 645 - $ref: '#/components/parameters/jobType'
3e9e6f2f
RK
646 - $ref: '#/components/parameters/start'
647 - $ref: '#/components/parameters/count'
648 - $ref: '#/components/parameters/sort'
1569a818
DG
649 responses:
650 '200':
651 description: successful operation
3e9e6f2f
RK
652 content:
653 application/json:
654 schema:
84f6e32c
RK
655 type: object
656 properties:
657 total:
658 type: integer
659 example: 1
660 data:
661 type: array
662 maxItems: 100
663 items:
664 $ref: '#/components/schemas/Job'
06dc7a1b
RK
665
666 /server/followers:
667 get:
668 tags:
669 - Instance Follows
670 summary: List instances following the server
671 parameters:
672 - $ref: '#/components/parameters/followState'
673 - $ref: '#/components/parameters/actorType'
674 - $ref: '#/components/parameters/start'
675 - $ref: '#/components/parameters/count'
676 - $ref: '#/components/parameters/sort'
677 responses:
678 '200':
679 description: successful operation
680 content:
681 application/json:
682 schema:
683 type: object
684 properties:
685 total:
686 type: integer
687 example: 1
688 data:
689 type: array
690 items:
691 $ref: '#/components/schemas/Follow'
3f71c4c0 692
06dc7a1b 693 '/server/followers/{nameWithHost}':
1569a818 694 delete:
06dc7a1b 695 summary: Remove or reject a follower to your server
94ff4c23 696 security:
3e9e6f2f 697 - OAuth2:
06746a8b 698 - admin
1569a818 699 tags:
b029d58a 700 - Instance Follows
1569a818 701 parameters:
06dc7a1b 702 - name: nameWithHost
1569a818
DG
703 in: path
704 required: true
06dc7a1b 705 description: The remote actor handle to remove from your followers
3e9e6f2f
RK
706 schema:
707 type: string
06dc7a1b 708 format: email
1569a818 709 responses:
06dc7a1b 710 '204':
1569a818 711 description: successful operation
06dc7a1b
RK
712 '404':
713 description: follower not found
3f71c4c0 714
06dc7a1b
RK
715 '/server/followers/{nameWithHost}/reject':
716 post:
717 summary: Reject a pending follower to your server
718 security:
719 - OAuth2:
720 - admin
1569a818 721 tags:
b029d58a 722 - Instance Follows
44cb3b85 723 parameters:
06dc7a1b
RK
724 - name: nameWithHost
725 in: path
726 required: true
727 description: The remote actor handle to remove from your followers
728 schema:
729 type: string
730 format: email
1569a818 731 responses:
06dc7a1b 732 '204':
1569a818 733 description: successful operation
06dc7a1b
RK
734 '404':
735 description: follower not found
3f71c4c0 736
06dc7a1b
RK
737 '/server/followers/{nameWithHost}/accept':
738 post:
739 summary: Accept a pending follower to your server
740 security:
741 - OAuth2:
742 - admin
743 tags:
744 - Instance Follows
745 parameters:
746 - name: nameWithHost
747 in: path
748 required: true
749 description: The remote actor handle to remove from your followers
750 schema:
751 type: string
752 format: email
753 responses:
754 '204':
755 description: successful operation
756 '404':
757 description: follower not found
758
1569a818
DG
759 /server/following:
760 get:
761 tags:
b029d58a 762 - Instance Follows
f4d59981 763 summary: List instances followed by the server
44cb3b85 764 parameters:
06dc7a1b
RK
765 - $ref: '#/components/parameters/followState'
766 - $ref: '#/components/parameters/actorType'
3e9e6f2f
RK
767 - $ref: '#/components/parameters/start'
768 - $ref: '#/components/parameters/count'
769 - $ref: '#/components/parameters/sort'
1569a818
DG
770 responses:
771 '200':
772 description: successful operation
3e9e6f2f
RK
773 content:
774 application/json:
775 schema:
06dc7a1b
RK
776 type: object
777 properties:
778 total:
779 type: integer
780 example: 1
781 data:
782 type: array
783 items:
784 $ref: '#/components/schemas/Follow'
1569a818 785 post:
94ff4c23 786 security:
3e9e6f2f 787 - OAuth2:
64b5c247 788 - admin
1569a818 789 tags:
b029d58a 790 - Instance Follows
4d029ef8 791 summary: Follow a list of actors (PeerTube instance, channel or account)
1569a818
DG
792 responses:
793 '204':
c1843150 794 description: successful operation
f4d59981
RK
795 '500':
796 description: cannot follow a non-HTTPS server
3e9e6f2f
RK
797 requestBody:
798 content:
799 application/json:
800 schema:
f4d59981
RK
801 type: object
802 properties:
803 hosts:
804 type: array
805 items:
806 type: string
84f6e32c 807 format: hostname
f4d59981 808 uniqueItems: true
4d029ef8
C
809 handles:
810 type: array
811 items:
812 type: string
813 uniqueItems: true
3f71c4c0 814
4d029ef8 815 '/server/following/{hostOrHandle}':
06dc7a1b 816 delete:
4d029ef8 817 summary: Unfollow an actor (PeerTube instance, channel or account)
06dc7a1b
RK
818 security:
819 - OAuth2:
820 - admin
821 tags:
822 - Instance Follows
823 parameters:
4d029ef8 824 - name: hostOrHandle
06dc7a1b
RK
825 in: path
826 required: true
4d029ef8 827 description: The hostOrHandle to unfollow
06dc7a1b
RK
828 schema:
829 type: string
06dc7a1b
RK
830 responses:
831 '204':
832 description: successful operation
833 '404':
4d029ef8 834 description: host or handle not found
06dc7a1b 835
1569a818
DG
836 /users:
837 post:
b029d58a 838 summary: Create a user
e2adb8cb 839 operationId: addUser
94ff4c23 840 security:
3e9e6f2f 841 - OAuth2:
64b5c247 842 - admin
1569a818 843 tags:
b029d58a 844 - Users
1569a818 845 responses:
1e904cde 846 '200':
2c318664 847 description: user created
3e9e6f2f
RK
848 content:
849 application/json:
850 schema:
851 $ref: '#/components/schemas/AddUserResponse'
2c318664
RK
852 links:
853 # GET /users/{id}
e2adb8cb
RK
854 GetUser:
855 operationId: getUser
2c318664
RK
856 parameters:
857 id: '$response.body#/user/id'
858 # PUT /users/{id}
e2adb8cb
RK
859 PutUser:
860 operationId: putUser
2c318664
RK
861 parameters:
862 id: '$response.body#/user/id'
863 # DELETE /users/{id}
e2adb8cb
RK
864 DelUser:
865 operationId: delUser
2c318664
RK
866 parameters:
867 id: '$response.body#/user/id'
868 '403':
869 description: insufficient authority to create an admin or moderator
3e9e6f2f
RK
870 requestBody:
871 content:
872 application/json:
873 schema:
874 $ref: '#/components/schemas/AddUser'
b8375da9
RK
875 description: |
876 If the smtp server is configured, you can leave the password empty and an email will be sent
877 asking the user to set it first.
3e9e6f2f 878 required: true
1569a818 879 get:
b029d58a 880 summary: List users
3f71c4c0 881 operationId: getUsers
94ff4c23 882 security:
8491293b
RK
883 - OAuth2:
884 - admin
1569a818 885 tags:
b029d58a 886 - Users
44cb3b85 887 parameters:
8491293b
RK
888 - $ref: '#/components/parameters/usersSearch'
889 - $ref: '#/components/parameters/usersBlocked'
3e9e6f2f
RK
890 - $ref: '#/components/parameters/start'
891 - $ref: '#/components/parameters/count'
fd5af7a2 892 - $ref: '#/components/parameters/usersSort'
1569a818
DG
893 responses:
894 '200':
895 description: successful operation
3e9e6f2f
RK
896 content:
897 application/json:
898 schema:
899 type: array
900 items:
901 $ref: '#/components/schemas/User'
3f71c4c0 902
1569a818 903 '/users/{id}':
2c318664
RK
904 parameters:
905 - $ref: '#/components/parameters/id'
1569a818 906 delete:
b029d58a 907 summary: Delete a user
94ff4c23 908 security:
3e9e6f2f 909 - OAuth2:
64b5c247 910 - admin
1569a818 911 tags:
b029d58a 912 - Users
e2adb8cb 913 operationId: delUser
1569a818
DG
914 responses:
915 '204':
c1843150 916 description: successful operation
1569a818 917 get:
b029d58a 918 summary: Get a user
94ff4c23 919 security:
3e9e6f2f 920 - OAuth2: []
1569a818 921 tags:
b029d58a 922 - Users
e2adb8cb 923 operationId: getUser
fd5586b3
RK
924 parameters:
925 - name: withStats
926 in: query
927 description: include statistics about the user (only available as a moderator/admin)
928 schema:
929 type: boolean
1569a818
DG
930 responses:
931 '200':
fd5586b3
RK
932 x-summary: successful operation
933 description: |
934 As an admin/moderator, you can request a response augmented with statistics about the user's
935 moderation relations and videos usage, by using the `withStats` parameter.
3e9e6f2f
RK
936 content:
937 application/json:
938 schema:
fd5586b3
RK
939 oneOf:
940 - $ref: '#/components/schemas/User'
941 - $ref: '#/components/schemas/UserWithStats'
1569a818 942 put:
b029d58a 943 summary: Update a user
94ff4c23 944 security:
3e9e6f2f 945 - OAuth2: []
1569a818 946 tags:
b029d58a 947 - Users
e2adb8cb 948 operationId: putUser
1569a818
DG
949 responses:
950 '204':
c1843150 951 description: successful operation
3e9e6f2f
RK
952 requestBody:
953 content:
954 application/json:
955 schema:
956 $ref: '#/components/schemas/UpdateUser'
957 required: true
e2464d22
RK
958
959 /oauth-clients/local:
960 get:
961 summary: Login prerequisite
3f71c4c0 962 description: You need to retrieve a client id and secret before [logging in](#operation/getOAuthToken).
e2464d22
RK
963 operationId: getOAuthClient
964 tags:
965 - Session
966 responses:
967 '200':
968 description: successful operation
969 content:
970 application/json:
971 schema:
972 $ref: '#/components/schemas/OAuthClient'
973 links:
974 UseOAuthClientToLogin:
975 operationId: getOAuthToken
976 parameters:
977 client_id: '$response.body#/client_id'
978 client_secret: '$response.body#/client_secret'
3cf8874f
RK
979 x-codeSamples:
980 - lang: Shell
981 source: |
982 API="https://peertube2.cpy.re/api/v1"
983
984 ## AUTH
985 curl -s "$API/oauth-clients/local"
3f71c4c0 986
e2464d22
RK
987 /users/token:
988 post:
989 summary: Login
990 operationId: getOAuthToken
991 description: With your [client id and secret](#operation/getOAuthClient), you can retrieve an access and refresh tokens.
992 tags:
993 - Session
994 requestBody:
995 content:
996 application/x-www-form-urlencoded:
997 schema:
998 oneOf:
999 - $ref: '#/components/schemas/OAuthToken-password'
1000 - $ref: '#/components/schemas/OAuthToken-refresh_token'
1001 discriminator:
1002 propertyName: grant_type
1003 mapping:
1004 password: '#/components/schemas/OAuthToken-password'
1005 refresh_token: '#/components/schemas/OAuthToken-refresh_token'
1006 responses:
1007 '200':
1008 description: successful operation
1009 content:
1010 application/json:
1011 schema:
1012 type: object
1013 properties:
1014 token_type:
1015 type: string
1016 example: Bearer
1017 access_token:
1018 type: string
1019 example: 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0
1020 description: valid for 1 day
1021 refresh_token:
1022 type: string
1023 example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7
1024 description: valid for 2 weeks
1025 expires_in:
1026 type: integer
1027 minimum: 0
1028 example: 14399
1029 refresh_token_expires_in:
1030 type: integer
1031 minimum: 0
1032 example: 1209600
81628e50
RK
1033 '400':
1034 x-summary: client or credentials are invalid
1035 description: |
1036 Disambiguate via `type`:
1037 - `invalid_client` for an unmatched `client_id`
1038 - `invalid_grant` for unmatched credentials
a31e9b18
RK
1039 '401':
1040 x-summary: token expired
1041 description: |
1042 Disambiguate via `type`:
1043 - default value for a regular authentication failure
1044 - `invalid_token` for an expired token
3cf8874f
RK
1045 x-codeSamples:
1046 - lang: Shell
1047 source: |
1048 ## DEPENDENCIES: jq
1049 API="https://peertube2.cpy.re/api/v1"
1050 USERNAME="<your_username>"
1051 PASSWORD="<your_password>"
1052
1053 ## AUTH
1054 client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id")
1055 client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret")
1056 curl -s "$API/users/token" \
1057 --data client_id="$client_id" \
1058 --data client_secret="$client_secret" \
1059 --data grant_type=password \
1060 --data username="$USERNAME" \
1061 --data password="$PASSWORD" \
1062 | jq -r ".access_token"
3f71c4c0 1063
e2464d22
RK
1064 /users/revoke-token:
1065 post:
1066 summary: Logout
1067 description: Revokes your access token and its associated refresh token, destroying your current session.
1068 operationId: revokeOAuthToken
1069 tags:
1070 - Session
1071 security:
1072 - OAuth2: []
1073 responses:
1074 '200':
1075 description: successful operation
1076
1f82e3e8
C
1077 /users/register:
1078 post:
1079 summary: Register a user
3f71c4c0 1080 operationId: registerUser
1f82e3e8 1081 tags:
b029d58a 1082 - Users
e2464d22 1083 - Register
1f82e3e8
C
1084 responses:
1085 '204':
c1843150 1086 description: successful operation
1f82e3e8
C
1087 requestBody:
1088 content:
1089 application/json:
1090 schema:
1091 $ref: '#/components/schemas/RegisterUser'
1092 required: true
3f71c4c0 1093
e2464d22
RK
1094 /users/{id}/verify-email:
1095 post:
1096 summary: Verify a user
3f71c4c0 1097 operationId: verifyUser
e2464d22
RK
1098 description: |
1099 Following a user registration, the new user will receive an email asking to click a link
85a60d8b 1100 containing a secret.
e2464d22
RK
1101 tags:
1102 - Users
1103 - Register
1104 parameters:
1105 - $ref: '#/components/parameters/id'
1106 requestBody:
1107 content:
1108 application/json:
1109 schema:
1110 type: object
1111 properties:
1112 verificationString:
1113 type: string
1114 format: url
1115 isPendingEmail:
1116 type: boolean
1117 required:
1118 - verificationString
1119 responses:
1120 '204':
1121 description: successful operation
1122 '403':
1123 description: invalid verification string
1124 '404':
1125 description: user not found
3f71c4c0 1126
e2464d22
RK
1127 /users/ask-send-verify-email:
1128 post:
1129 summary: Resend user verification link
3f71c4c0 1130 operationId: resendEmailToVerifyUser
e2464d22
RK
1131 tags:
1132 - Users
1133 - Register
1134 responses:
1135 '204':
1136 description: successful operation
1137
1569a818
DG
1138 /users/me:
1139 get:
b029d58a 1140 summary: Get my user information
3f71c4c0 1141 operationId: getUserInfo
94ff4c23 1142 security:
e76d5784
RK
1143 - OAuth2:
1144 - user
1569a818 1145 tags:
1f82e3e8 1146 - My User
1569a818
DG
1147 responses:
1148 '200':
1149 description: successful operation
3e9e6f2f
RK
1150 content:
1151 application/json:
1152 schema:
1153 type: array
1154 items:
1155 $ref: '#/components/schemas/User'
1569a818 1156 put:
b029d58a 1157 summary: Update my user information
3f71c4c0 1158 operationId: putUserInfo
94ff4c23 1159 security:
e76d5784
RK
1160 - OAuth2:
1161 - user
1569a818 1162 tags:
1f82e3e8 1163 - My User
1569a818
DG
1164 responses:
1165 '204':
37db4176 1166 description: successful operation
3e9e6f2f
RK
1167 requestBody:
1168 content:
1169 application/json:
1170 schema:
1171 $ref: '#/components/schemas/UpdateMe'
1172 required: true
3f71c4c0 1173
1f82e3e8
C
1174 /users/me/videos/imports:
1175 get:
b029d58a 1176 summary: Get video imports of my user
1f82e3e8
C
1177 security:
1178 - OAuth2:
64b5c247 1179 - user
1f82e3e8 1180 tags:
b029d58a 1181 - Videos
1f82e3e8
C
1182 - My User
1183 parameters:
1184 - $ref: '#/components/parameters/start'
1185 - $ref: '#/components/parameters/count'
1186 - $ref: '#/components/parameters/sort'
1187 responses:
1188 '200':
1189 description: successful operation
1190 content:
1191 application/json:
1192 schema:
5844dde3 1193 $ref: '#/components/schemas/VideoImportsList'
3f71c4c0 1194
1569a818
DG
1195 /users/me/video-quota-used:
1196 get:
b029d58a 1197 summary: Get my user used quota
94ff4c23 1198 security:
e76d5784
RK
1199 - OAuth2:
1200 - user
1569a818 1201 tags:
1f82e3e8 1202 - My User
1569a818
DG
1203 responses:
1204 '200':
1205 description: successful operation
3e9e6f2f
RK
1206 content:
1207 application/json:
1208 schema:
30b40713
RK
1209 type: object
1210 properties:
1211 videoQuotaUsed:
1212 type: number
b8375da9 1213 description: The user video quota used so far in bytes
30b40713
RK
1214 example: 16810141515
1215 videoQuotaUsedDaily:
1216 type: number
b8375da9 1217 description: The user video quota used today in bytes
30b40713 1218 example: 1681014151
3f71c4c0 1219
1569a818
DG
1220 '/users/me/videos/{videoId}/rating':
1221 get:
50e16ccf 1222 summary: Get rate of my user for a video
94ff4c23 1223 security:
3e9e6f2f 1224 - OAuth2: []
1569a818 1225 tags:
1f82e3e8 1226 - My User
b029d58a 1227 - Video Rates
1569a818
DG
1228 parameters:
1229 - name: videoId
1230 in: path
1231 required: true
b8375da9 1232 description: The video id
3e9e6f2f 1233 schema:
b8375da9 1234 $ref: '#/components/schemas/Video/properties/id'
1569a818
DG
1235 responses:
1236 '200':
1237 description: successful operation
3e9e6f2f
RK
1238 content:
1239 application/json:
1240 schema:
1241 $ref: '#/components/schemas/GetMeVideoRating'
3f71c4c0 1242
1569a818
DG
1243 /users/me/videos:
1244 get:
b029d58a 1245 summary: Get videos of my user
94ff4c23 1246 security:
e76d5784
RK
1247 - OAuth2:
1248 - user
1569a818 1249 tags:
1f82e3e8 1250 - My User
b029d58a 1251 - Videos
44cb3b85 1252 parameters:
3e9e6f2f
RK
1253 - $ref: '#/components/parameters/start'
1254 - $ref: '#/components/parameters/count'
1255 - $ref: '#/components/parameters/sort'
1569a818
DG
1256 responses:
1257 '200':
1258 description: successful operation
3e9e6f2f
RK
1259 content:
1260 application/json:
1261 schema:
048b6946 1262 $ref: '#/components/schemas/VideoListResponse'
3f71c4c0 1263
e76d5784
RK
1264 /users/me/subscriptions:
1265 get:
b029d58a 1266 summary: Get my user subscriptions
e76d5784
RK
1267 security:
1268 - OAuth2:
64b5c247 1269 - user
e76d5784 1270 tags:
b029d58a 1271 - My Subscriptions
e76d5784
RK
1272 parameters:
1273 - $ref: '#/components/parameters/start'
1274 - $ref: '#/components/parameters/count'
1275 - $ref: '#/components/parameters/sort'
1276 responses:
1277 '200':
1278 description: successful operation
045bcd0d
RK
1279 content:
1280 application/json:
1281 schema:
1282 $ref: '#/components/schemas/VideoChannelList'
e76d5784 1283 post:
2c318664
RK
1284 tags:
1285 - My Subscriptions
b029d58a 1286 summary: Add subscription to my user
e76d5784
RK
1287 security:
1288 - OAuth2:
64b5c247 1289 - user
2c318664
RK
1290 requestBody:
1291 content:
1292 application/json:
1293 schema:
1294 type: object
1295 properties:
1296 uri:
1297 type: string
1298 format: uri
1299 description: uri of the video channels to subscribe to
1300 required:
1301 - uri
1302 examples:
1303 default:
1304 value:
1305 uri: 008a0e54-375d-49d0-8379-143202e24152@video.lqdn.fr
e76d5784
RK
1306 responses:
1307 '200':
1308 description: successful operation
3f71c4c0 1309
e76d5784
RK
1310 /users/me/subscriptions/exist:
1311 get:
b029d58a 1312 summary: Get if subscriptions exist for my user
e76d5784
RK
1313 security:
1314 - OAuth2:
64b5c247 1315 - user
e76d5784 1316 tags:
b029d58a 1317 - My Subscriptions
e76d5784
RK
1318 parameters:
1319 - $ref: '#/components/parameters/subscriptionsUris'
1320 responses:
1321 '200':
1322 description: successful operation
1323 content:
1324 application/json:
1325 schema:
1326 type: object
3f71c4c0 1327
e76d5784
RK
1328 /users/me/subscriptions/videos:
1329 get:
b029d58a 1330 summary: List videos of subscriptions of my user
e76d5784
RK
1331 security:
1332 - OAuth2:
1333 - user
1334 tags:
b029d58a
C
1335 - My Subscriptions
1336 - Videos
e76d5784 1337 parameters:
59c794a5 1338 - $ref: '#/components/parameters/categoryOneOf'
1fd61899 1339 - $ref: '#/components/parameters/isLive'
59c794a5
C
1340 - $ref: '#/components/parameters/tagsOneOf'
1341 - $ref: '#/components/parameters/tagsAllOf'
1342 - $ref: '#/components/parameters/licenceOneOf'
1343 - $ref: '#/components/parameters/languageOneOf'
1344 - $ref: '#/components/parameters/nsfw'
2760b454
C
1345 - $ref: '#/components/parameters/isLocal'
1346 - $ref: '#/components/parameters/include'
527a52ac 1347 - $ref: '#/components/parameters/privacyOneOf'
d324756e
C
1348 - $ref: '#/components/parameters/hasHLSFiles'
1349 - $ref: '#/components/parameters/hasWebtorrentFiles'
59c794a5 1350 - $ref: '#/components/parameters/skipCount'
e76d5784
RK
1351 - $ref: '#/components/parameters/start'
1352 - $ref: '#/components/parameters/count'
59c794a5 1353 - $ref: '#/components/parameters/videosSort'
e76d5784
RK
1354 responses:
1355 '200':
1356 description: successful operation
1357 content:
1358 application/json:
1359 schema:
048b6946 1360 $ref: '#/components/schemas/VideoListResponse'
3f71c4c0 1361
cb9d028a 1362 '/users/me/subscriptions/{subscriptionHandle}':
e76d5784 1363 get:
b029d58a 1364 summary: Get subscription of my user
e76d5784
RK
1365 security:
1366 - OAuth2:
64b5c247 1367 - user
e76d5784 1368 tags:
b029d58a 1369 - My Subscriptions
cb9d028a
C
1370 parameters:
1371 - $ref: '#/components/parameters/subscriptionHandle'
e76d5784
RK
1372 responses:
1373 '200':
1374 description: successful operation
1375 content:
1376 application/json:
1377 schema:
1378 $ref: '#/components/schemas/VideoChannel'
1379 delete:
b029d58a 1380 summary: Delete subscription of my user
e76d5784
RK
1381 security:
1382 - OAuth2:
64b5c247 1383 - user
e76d5784 1384 tags:
b029d58a 1385 - My Subscriptions
cb9d028a
C
1386 parameters:
1387 - $ref: '#/components/parameters/subscriptionHandle'
e76d5784
RK
1388 responses:
1389 '200':
1390 description: successful operation
3f71c4c0 1391
f4d59981
RK
1392 /users/me/notifications:
1393 get:
1394 summary: List my notifications
1395 security:
1396 - OAuth2: []
1397 tags:
1398 - My Notifications
1399 parameters:
1400 - name: unread
1401 in: query
1402 description: only list unread notifications
1403 schema:
1404 type: boolean
1405 - $ref: '#/components/parameters/start'
1406 - $ref: '#/components/parameters/count'
1407 - $ref: '#/components/parameters/sort'
1408 responses:
1409 '200':
1410 description: successful operation
1411 content:
1412 application/json:
1413 schema:
1414 $ref: '#/components/schemas/NotificationListResponse'
3f71c4c0 1415
f4d59981
RK
1416 /users/me/notifications/read:
1417 post:
1418 summary: Mark notifications as read by their id
1419 security:
1420 - OAuth2: []
1421 tags:
1422 - My Notifications
1423 requestBody:
1424 content:
2c318664 1425 application/json:
f4d59981
RK
1426 schema:
1427 type: object
1428 properties:
1429 ids:
1430 type: array
1431 description: ids of the notifications to mark as read
1432 items:
1433 type: integer
1434 required:
1435 - ids
1436 responses:
1437 '204':
1438 description: successful operation
3f71c4c0 1439
f4d59981
RK
1440 /users/me/notifications/read-all:
1441 post:
1442 summary: Mark all my notification as read
1443 security:
1444 - OAuth2: []
1445 tags:
1446 - My Notifications
1447 responses:
1448 '204':
1449 description: successful operation
3f71c4c0 1450
f4d59981
RK
1451 /users/me/notification-settings:
1452 put:
1453 summary: Update my notification settings
1454 security:
1455 - OAuth2: []
1456 tags:
1457 - My Notifications
1458 requestBody:
1459 content:
2c318664 1460 application/json:
f4d59981
RK
1461 schema:
1462 type: object
1463 properties:
1464 newVideoFromSubscription:
1465 $ref: '#/components/schemas/NotificationSettingValue'
1466 newCommentOnMyVideo:
1467 $ref: '#/components/schemas/NotificationSettingValue'
4f32032f 1468 abuseAsModerator:
f4d59981
RK
1469 $ref: '#/components/schemas/NotificationSettingValue'
1470 videoAutoBlacklistAsModerator:
1471 $ref: '#/components/schemas/NotificationSettingValue'
1472 blacklistOnMyVideo:
1473 $ref: '#/components/schemas/NotificationSettingValue'
1474 myVideoPublished:
1475 $ref: '#/components/schemas/NotificationSettingValue'
1476 myVideoImportFinished:
1477 $ref: '#/components/schemas/NotificationSettingValue'
1478 newFollow:
1479 $ref: '#/components/schemas/NotificationSettingValue'
1480 newUserRegistration:
1481 $ref: '#/components/schemas/NotificationSettingValue'
1482 commentMention:
1483 $ref: '#/components/schemas/NotificationSettingValue'
1484 newInstanceFollower:
1485 $ref: '#/components/schemas/NotificationSettingValue'
1486 autoInstanceFollowing:
1487 $ref: '#/components/schemas/NotificationSettingValue'
1488 responses:
1489 '204':
1490 description: successful operation
3f71c4c0 1491
3520d385
A
1492 /users/me/history/videos:
1493 get:
1494 summary: List watched videos history
1495 security:
1496 - OAuth2: []
1497 tags:
1498 - My History
1499 parameters:
1500 - $ref: '#/components/parameters/start'
1501 - $ref: '#/components/parameters/count'
d8b34ee5 1502 - $ref: '#/components/parameters/search'
3520d385
A
1503 responses:
1504 '200':
1505 description: successful operation
1506 content:
1507 application/json:
1508 schema:
1509 $ref: '#/components/schemas/VideoListResponse'
3f71c4c0 1510
7177b46c
C
1511 /users/me/history/videos/{videoId}:
1512 delete:
1513 summary: Delete history element
1514 security:
1515 - OAuth2: []
1516 tags:
1517 - My History
1518 parameters:
1519 - name: videoId
1520 in: path
1521 required: true
1522 schema:
1523 $ref: '#/components/schemas/Video/properties/id'
1524 responses:
1525 '204':
1526 description: successful operation
1527
3520d385
A
1528 /users/me/history/videos/remove:
1529 post:
1530 summary: Clear video history
1531 security:
1532 - OAuth2: []
1533 tags:
1534 - My History
1535 requestBody:
1536 content:
1537 multipart/form-data:
1538 schema:
1539 type: object
1540 properties:
1541 beforeDate:
1542 description: history before this date will be deleted
1543 type: string
1544 format: date-time
1545 responses:
1546 '204':
1547 description: successful operation
3f71c4c0 1548
1569a818
DG
1549 /users/me/avatar/pick:
1550 post:
b029d58a 1551 summary: Update my user avatar
94ff4c23 1552 security:
3e9e6f2f 1553 - OAuth2: []
1569a818 1554 tags:
1f82e3e8 1555 - My User
1569a818
DG
1556 responses:
1557 '200':
1558 description: successful operation
3e9e6f2f
RK
1559 content:
1560 application/json:
1561 schema:
75cba40d
C
1562 type: object
1563 properties:
d0800f76 1564 avatars:
1565 type: array
1566 items:
1567 $ref: '#/components/schemas/ActorImage'
d4132d3f
RK
1568 '413':
1569 description: image file too large
1570 headers:
1571 X-File-Maximum-Size:
1572 schema:
1573 type: string
1574 format: Nginx size
1575 description: Maximum file size for the avatar
3e9e6f2f
RK
1576 requestBody:
1577 content:
1578 multipart/form-data:
1579 schema:
1580 type: object
1581 properties:
1582 avatarfile:
b8375da9 1583 description: The file to upload
3e9e6f2f
RK
1584 type: string
1585 format: binary
1586 encoding:
0ad45af7 1587 avatarfile:
3e9e6f2f 1588 contentType: image/png, image/jpeg
3f71c4c0 1589
75cba40d
C
1590 /users/me/avatar:
1591 delete:
1592 summary: Delete my avatar
1593 security:
1594 - OAuth2: []
1595 tags:
1596 - My User
1597 responses:
1598 '204':
1599 description: successful operation
1600
b029d58a
C
1601 /videos/ownership:
1602 get:
1603 summary: List video ownership changes
1604 tags:
1605 - Video Ownership Change
1606 security:
1607 - OAuth2: []
1608 responses:
1609 '200':
1610 description: successful operation
3f71c4c0 1611
b029d58a
C
1612 '/videos/ownership/{id}/accept':
1613 post:
1614 summary: Accept ownership change request
1615 tags:
1616 - Video Ownership Change
1617 security:
1618 - OAuth2: []
1619 parameters:
1620 - $ref: '#/components/parameters/idOrUUID'
1621 responses:
1622 '204':
c1843150 1623 description: successful operation
06746a8b
RK
1624 '403':
1625 description: cannot terminate an ownership change of another user
1626 '404':
b25fdc73 1627 description: video ownership change not found
3f71c4c0 1628
b029d58a
C
1629 '/videos/ownership/{id}/refuse':
1630 post:
1631 summary: Refuse ownership change request
1632 tags:
1633 - Video Ownership Change
1634 security:
1635 - OAuth2: []
1636 parameters:
1637 - $ref: '#/components/parameters/idOrUUID'
1638 responses:
1639 '204':
c1843150 1640 description: successful operation
06746a8b
RK
1641 '403':
1642 description: cannot terminate an ownership change of another user
1643 '404':
b25fdc73 1644 description: video ownership change not found
3f71c4c0 1645
b029d58a
C
1646 '/videos/{id}/give-ownership':
1647 post:
1648 summary: Request ownership change
1649 tags:
1650 - Video Ownership Change
1651 security:
1652 - OAuth2: []
1653 parameters:
1654 - $ref: '#/components/parameters/idOrUUID'
1655 requestBody:
1656 required: true
1657 content:
1658 application/x-www-form-urlencoded:
1659 schema:
1660 type: object
1661 properties:
1662 username:
1663 type: string
1664 required:
1665 - username
1666 responses:
1667 '204':
c1843150 1668 description: successful operation
b029d58a 1669 '400':
06746a8b
RK
1670 description: changing video ownership to a remote account is not supported yet
1671 '404':
1672 description: video not found
3f71c4c0 1673
c360c494 1674 /videos:
1569a818 1675 get:
b029d58a 1676 summary: List videos
e2adb8cb 1677 operationId: getVideos
1569a818
DG
1678 tags:
1679 - Video
44cb3b85 1680 parameters:
fd5af7a2 1681 - $ref: '#/components/parameters/categoryOneOf'
1fd61899 1682 - $ref: '#/components/parameters/isLive'
fd5af7a2
RK
1683 - $ref: '#/components/parameters/tagsOneOf'
1684 - $ref: '#/components/parameters/tagsAllOf'
1685 - $ref: '#/components/parameters/licenceOneOf'
1686 - $ref: '#/components/parameters/languageOneOf'
1687 - $ref: '#/components/parameters/nsfw'
2760b454
C
1688 - $ref: '#/components/parameters/isLocal'
1689 - $ref: '#/components/parameters/include'
527a52ac 1690 - $ref: '#/components/parameters/privacyOneOf'
d324756e
C
1691 - $ref: '#/components/parameters/hasHLSFiles'
1692 - $ref: '#/components/parameters/hasWebtorrentFiles'
59c794a5 1693 - $ref: '#/components/parameters/skipCount'
3e9e6f2f
RK
1694 - $ref: '#/components/parameters/start'
1695 - $ref: '#/components/parameters/count'
fd5af7a2 1696 - $ref: '#/components/parameters/videosSort'
1569a818
DG
1697 responses:
1698 '200':
1699 description: successful operation
3e9e6f2f
RK
1700 content:
1701 application/json:
1702 schema:
048b6946 1703 $ref: '#/components/schemas/VideoListResponse'
3f71c4c0 1704
c360c494 1705 /videos/categories:
1569a818 1706 get:
b029d58a 1707 summary: List available video categories
40cfb36b 1708 operationId: getCategories
1569a818
DG
1709 tags:
1710 - Video
1569a818
DG
1711 responses:
1712 '200':
1713 description: successful operation
3e9e6f2f
RK
1714 content:
1715 application/json:
1716 schema:
1717 type: array
1718 items:
1719 type: string
84f6e32c
RK
1720 examples:
1721 nightly:
1722 externalValue: https://peertube2.cpy.re/api/v1/videos/categories
3f71c4c0 1723
c360c494 1724 /videos/licences:
1569a818 1725 get:
b029d58a 1726 summary: List available video licences
40cfb36b 1727 operationId: getLicences
1569a818
DG
1728 tags:
1729 - Video
1569a818
DG
1730 responses:
1731 '200':
1732 description: successful operation
3e9e6f2f
RK
1733 content:
1734 application/json:
1735 schema:
1736 type: array
1737 items:
1738 type: string
84f6e32c
RK
1739 examples:
1740 nightly:
1741 externalValue: https://peertube2.cpy.re/api/v1/videos/licences
3f71c4c0 1742
c360c494 1743 /videos/languages:
1569a818 1744 get:
b029d58a 1745 summary: List available video languages
40cfb36b 1746 operationId: getLanguages
1569a818
DG
1747 tags:
1748 - Video
1569a818
DG
1749 responses:
1750 '200':
1751 description: successful operation
3e9e6f2f
RK
1752 content:
1753 application/json:
1754 schema:
1755 type: array
1756 items:
1757 type: string
84f6e32c
RK
1758 examples:
1759 nightly:
1760 externalValue: https://peertube2.cpy.re/api/v1/videos/languages
3f71c4c0 1761
c360c494 1762 /videos/privacies:
1569a818 1763 get:
40cfb36b
RK
1764 summary: List available video privacy policies
1765 operationId: getPrivacyPolicies
1569a818
DG
1766 tags:
1767 - Video
1569a818
DG
1768 responses:
1769 '200':
1770 description: successful operation
3e9e6f2f
RK
1771 content:
1772 application/json:
1773 schema:
1774 type: array
1775 items:
1776 type: string
84f6e32c
RK
1777 examples:
1778 nightly:
1779 externalValue: https://peertube2.cpy.re/api/v1/videos/privacies
3f71c4c0 1780
3e9e6f2f 1781 '/videos/{id}':
1569a818 1782 put:
b029d58a 1783 summary: Update a video
3f71c4c0 1784 operationId: putVideo
94ff4c23 1785 security:
3e9e6f2f 1786 - OAuth2: []
1569a818
DG
1787 tags:
1788 - Video
1569a818 1789 parameters:
cb9d028a 1790 - $ref: '#/components/parameters/idOrUUID'
1569a818 1791 responses:
37db4176 1792 '204':
1569a818 1793 description: successful operation
3e9e6f2f
RK
1794 requestBody:
1795 content:
1796 multipart/form-data:
1797 schema:
1798 type: object
1799 properties:
1800 thumbnailfile:
1801 description: Video thumbnail file
1802 type: string
0ad45af7 1803 format: binary
3e9e6f2f
RK
1804 previewfile:
1805 description: Video preview file
1806 type: string
0ad45af7 1807 format: binary
3e9e6f2f 1808 category:
40cfb36b 1809 $ref: '#/components/schemas/VideoCategorySet'
3e9e6f2f 1810 licence:
40cfb36b 1811 $ref: '#/components/schemas/VideoLicenceSet'
3e9e6f2f 1812 language:
40cfb36b 1813 $ref: '#/components/schemas/VideoLanguageSet'
c1843150
C
1814 privacy:
1815 $ref: '#/components/schemas/VideoPrivacySet'
3e9e6f2f
RK
1816 description:
1817 description: Video description
1818 type: string
1819 waitTranscoding:
1820 description: Whether or not we wait transcoding before publish the video
1821 type: string
1822 support:
00494d6e 1823 description: A text tell the audience how to support the video creator
9a320a06 1824 example: Please support our work on https://soutenir.framasoft.org/en/ <3
3e9e6f2f
RK
1825 type: string
1826 nsfw:
1827 description: Whether or not this video contains sensitive content
84f6e32c 1828 type: boolean
3e9e6f2f
RK
1829 name:
1830 description: Video name
1831 type: string
bdac0584
RK
1832 minLength: 3
1833 maxLength: 120
3e9e6f2f 1834 tags:
12fed49e 1835 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1fd12c7c 1836 type: array
07d02f6d
FS
1837 minItems: 1
1838 maxItems: 5
1fd12c7c
C
1839 items:
1840 type: string
07d02f6d
FS
1841 minLength: 2
1842 maxLength: 30
3e9e6f2f
RK
1843 commentsEnabled:
1844 description: Enable or disable comments for this video
84f6e32c 1845 type: boolean
2370d9cc 1846 downloadEnabled:
1847 description: Enable or disable downloading for this video
1848 type: boolean
37db4176
FS
1849 originallyPublishedAt:
1850 description: Date when the content was originally published
1851 type: string
1852 format: date-time
5dce26d2
C
1853 scheduleUpdate:
1854 $ref: '#/components/schemas/VideoScheduledUpdate'
0ad45af7
FS
1855 encoding:
1856 thumbnailfile:
1857 contentType: image/jpeg
1858 previewfile:
1859 contentType: image/jpeg
1569a818 1860 get:
b029d58a 1861 summary: Get a video
3f71c4c0 1862 operationId: getVideo
1569a818
DG
1863 tags:
1864 - Video
1569a818 1865 parameters:
cb9d028a 1866 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1867 responses:
1868 '200':
1869 description: successful operation
3e9e6f2f
RK
1870 content:
1871 application/json:
1872 schema:
5dce26d2 1873 $ref: '#/components/schemas/VideoDetails'
1569a818 1874 delete:
b029d58a 1875 summary: Delete a video
3f71c4c0 1876 operationId: delVideo
94ff4c23 1877 security:
3e9e6f2f 1878 - OAuth2: []
1569a818
DG
1879 tags:
1880 - Video
1569a818 1881 parameters:
cb9d028a 1882 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1883 responses:
1884 '204':
c1843150 1885 description: successful operation
3f71c4c0 1886
3e9e6f2f 1887 '/videos/{id}/description':
1569a818 1888 get:
b029d58a 1889 summary: Get complete video description
3f71c4c0 1890 operationId: getVideoDesc
1569a818
DG
1891 tags:
1892 - Video
1569a818 1893 parameters:
cb9d028a 1894 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1895 responses:
1896 '200':
1897 description: successful operation
3e9e6f2f
RK
1898 content:
1899 application/json:
1900 schema:
b8375da9 1901 nullable: true
3e9e6f2f 1902 type: string
b8375da9
RK
1903 minLength: 3
1904 maxLength: 10000
1905 example: |
1906 **[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)**
3f71c4c0 1907
2e401e85 1908 '/videos/{id}/source':
1909 post:
1910 summary: Get video source file metadata
1911 operationId: getVideoSource
1912 tags:
1913 - Video
1914 parameters:
1915 - $ref: '#/components/parameters/idOrUUID'
1916 responses:
1917 '200':
1918 description: successful operation
1919 content:
1920 application/json:
1921 schema:
1922 $ref: '#/components/schemas/VideoSource'
1923
3e9e6f2f 1924 '/videos/{id}/views':
1569a818 1925 post:
cf158e7e
C
1926 summary: Notify user is watching a video
1927 description: Call this endpoint regularly (every 5-10 seconds for example) to notify the server the user is watching the video. After a while, PeerTube will increase video's viewers counter. If the user is authenticated, PeerTube will also store the current player time.
c756bae0 1928 operationId: addView
1569a818
DG
1929 tags:
1930 - Video
1569a818 1931 parameters:
cb9d028a 1932 - $ref: '#/components/parameters/idOrUUID'
cf158e7e
C
1933 requestBody:
1934 content:
1935 application/json:
1936 schema:
1937 $ref: '#/components/schemas/UserViewingVideo'
1938 required: true
1569a818
DG
1939 responses:
1940 '204':
c1843150 1941 description: successful operation
3f71c4c0 1942
6441981b
RK
1943 '/videos/{id}/watching':
1944 put:
b029d58a 1945 summary: Set watching progress of a video
cf158e7e
C
1946 deprecated: true
1947 description: This endpoint has been deprecated. Use `/videos/{id}/views` instead
6441981b
RK
1948 tags:
1949 - Video
1950 security:
1951 - OAuth2: []
1952 parameters:
cb9d028a 1953 - $ref: '#/components/parameters/idOrUUID'
6441981b
RK
1954 requestBody:
1955 content:
1956 application/json:
1957 schema:
cf158e7e 1958 $ref: '#/components/schemas/UserViewingVideo'
6441981b
RK
1959 required: true
1960 responses:
1961 '204':
c1843150 1962 description: successful operation
3f71c4c0 1963
cf158e7e
C
1964 '/videos/{id}/stats/overall':
1965 get:
1966 summary: Get overall stats of a video
1967 tags:
1968 - Video Stats
1969 security:
1970 - OAuth2: []
1971 parameters:
1972 - $ref: '#/components/parameters/idOrUUID'
49f0468d
C
1973 - name: startDate
1974 in: query
1975 description: Filter stats by start date
1976 schema:
1977 type: string
1978 format: date-time
1979 - name: endDate
1980 in: query
1981 description: Filter stats by end date
1982 schema:
1983 type: string
1984 format: date-time
cf158e7e
C
1985 responses:
1986 '200':
1987 description: successful operation
1988 content:
1989 application/json:
1990 schema:
1991 $ref: '#/components/schemas/VideoStatsOverall'
1992
1993 '/videos/{id}/stats/retention':
1994 get:
1995 summary: Get retention stats of a video
1996 tags:
1997 - Video Stats
1998 security:
1999 - OAuth2: []
2000 parameters:
2001 - $ref: '#/components/parameters/idOrUUID'
2002 responses:
2003 '200':
2004 description: successful operation
2005 content:
2006 application/json:
2007 schema:
2008 $ref: '#/components/schemas/VideoStatsRetention'
2009
2010 '/videos/{id}/stats/timeseries/{metric}':
2011 get:
2012 summary: Get timeserie stats of a video
2013 tags:
2014 - Video Stats
2015 security:
2016 - OAuth2: []
2017 parameters:
2018 - $ref: '#/components/parameters/idOrUUID'
2019 -
2020 name: metric
2021 in: path
2022 required: true
2023 description: The metric to get
2024 schema:
2025 type: string
2026 enum:
2027 - 'viewers'
2028 - 'aggregateWatchTime'
49f0468d
C
2029 - name: startDate
2030 in: query
2031 description: Filter stats by start date
2032 schema:
2033 type: string
2034 format: date-time
2035 - name: endDate
2036 in: query
2037 description: Filter stats by end date
2038 schema:
2039 type: string
2040 format: date-time
cf158e7e
C
2041 responses:
2042 '200':
2043 description: successful operation
2044 content:
2045 application/json:
2046 schema:
2047 $ref: '#/components/schemas/VideoStatsTimeserie'
2048
c360c494 2049 /videos/upload:
1569a818 2050 post:
b029d58a 2051 summary: Upload a video
f6d6e7f8 2052 description: Uses a single request to upload a video.
40cfb36b 2053 operationId: uploadLegacy
94ff4c23 2054 security:
3e9e6f2f 2055 - OAuth2: []
1569a818
DG
2056 tags:
2057 - Video
f6d6e7f8 2058 - Video Upload
1569a818
DG
2059 responses:
2060 '200':
2061 description: successful operation
3e9e6f2f
RK
2062 content:
2063 application/json:
2064 schema:
2065 $ref: '#/components/schemas/VideoUploadResponse'
06bcfbd9 2066 '403':
f2eb23cd 2067 description: video didn't pass upload filter
06bcfbd9 2068 '408':
84f6e32c 2069 description: upload has timed out
d4132d3f 2070 '413':
c756bae0
RK
2071 x-summary: video file too large, due to quota or max body size limit set by the reverse-proxy
2072 description: |
2073 If the response has no body, it means the reverse-proxy didn't let it through. Otherwise disambiguate via `type`:
7a4fd56c 2074 - `quota_reached` for quota limits whether daily or global
d4132d3f
RK
2075 headers:
2076 X-File-Maximum-Size:
2077 schema:
2078 type: string
2079 format: Nginx size
2080 description: Maximum file size for the video
f2eb23cd
RK
2081 '415':
2082 description: video type unsupported
06bcfbd9 2083 '422':
f2eb23cd 2084 description: video unreadable
3e9e6f2f
RK
2085 requestBody:
2086 content:
2087 multipart/form-data:
2088 schema:
f6d6e7f8 2089 $ref: '#/components/schemas/VideoUploadRequestLegacy'
0ad45af7
FS
2090 encoding:
2091 videofile:
2092 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
2093 thumbnailfile:
2094 contentType: image/jpeg
2095 previewfile:
2096 contentType: image/jpeg
40cfb36b 2097 x-codeSamples:
8f9e8be1
RK
2098 - lang: Shell
2099 source: |
0579dee3 2100 ## DEPENDENCIES: jq
8f9e8be1
RK
2101 USERNAME="<your_username>"
2102 PASSWORD="<your_password>"
2103 FILE_PATH="<your_file_path>"
2104 CHANNEL_ID="<your_channel_id>"
8f9e8be1 2105 NAME="<video_name>"
3cf8874f 2106 API="https://peertube2.cpy.re/api/v1"
8f9e8be1 2107
8f9e8be1 2108 ## AUTH
3cf8874f
RK
2109 client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id")
2110 client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret")
2111 token=$(curl -s "$API/users/token" \
0579dee3
JK
2112 --data client_id="$client_id" \
2113 --data client_secret="$client_secret" \
2114 --data grant_type=password \
0579dee3
JK
2115 --data username="$USERNAME" \
2116 --data password="$PASSWORD" \
8f9e8be1 2117 | jq -r ".access_token")
3cf8874f 2118
8f9e8be1 2119 ## VIDEO UPLOAD
3cf8874f 2120 curl -s "$API/videos/upload" \
0579dee3
JK
2121 -H "Authorization: Bearer $token" \
2122 --max-time 600 \
2123 --form videofile=@"$FILE_PATH" \
2124 --form channelId=$CHANNEL_ID \
2125 --form name="$NAME"
3f71c4c0 2126
f6d6e7f8 2127 /videos/upload-resumable:
2128 post:
2129 summary: Initialize the resumable upload of a video
2130 description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to initialize the upload of a video
40cfb36b 2131 operationId: uploadResumableInit
f6d6e7f8 2132 security:
2133 - OAuth2: []
2134 tags:
2135 - Video
2136 - Video Upload
2137 parameters:
2138 - name: X-Upload-Content-Length
2139 in: header
2140 schema:
2141 type: number
2142 example: 2469036
2143 required: true
2144 description: Number of bytes that will be uploaded in subsequent requests. Set this value to the size of the file you are uploading.
2145 - name: X-Upload-Content-Type
2146 in: header
2147 schema:
2148 type: string
2149 format: mimetype
2150 example: video/mp4
2151 required: true
2152 description: MIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary.
2153 requestBody:
2154 content:
2155 application/json:
2156 schema:
2157 $ref: '#/components/schemas/VideoUploadRequestResumable'
2158 responses:
2159 '200':
2160 description: file already exists, send a [`resume`](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) request instead
2161 '201':
2162 description: created
2163 headers:
2164 Location:
2165 schema:
2166 type: string
2167 format: url
2168 example: /api/v1/videos/upload-resumable?upload_id=471e97554f21dec3b8bb5d4602939c51
2169 Content-Length:
2170 schema:
2171 type: number
2172 example: 0
f6d6e7f8 2173 '413':
c756bae0
RK
2174 x-summary: video file too large, due to quota, absolute max file size or concurrent partial upload limit
2175 description: |
2176 Disambiguate via `type`:
2177 - `max_file_size_reached` for the absolute file size limit
2178 - `quota_reached` for quota limits whether daily or global
f6d6e7f8 2179 '415':
2180 description: video type unsupported
2181 put:
2182 summary: Send chunk for the resumable upload of a video
2183 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
40cfb36b 2184 operationId: uploadResumable
f6d6e7f8 2185 security:
2186 - OAuth2: []
2187 tags:
2188 - Video
2189 - Video Upload
2190 parameters:
2191 - name: upload_id
c215e627 2192 in: query
f6d6e7f8 2193 required: true
2194 description: |
b4a4bcd2 2195 Created session id to proceed with. If you didn't send chunks in the last hour, it is
f6d6e7f8 2196 not valid anymore and you need to initialize a new upload.
2197 schema:
2198 type: string
2199 - name: Content-Range
2200 in: header
2201 schema:
2202 type: string
2203 example: bytes 0-262143/2469036
2204 required: true
2205 description: |
2206 Specifies the bytes in the file that the request is uploading.
2207
2208 For example, a value of `bytes 0-262143/1000000` shows that the request is sending the first
2209 262144 bytes (256 x 1024) in a 2,469,036 byte file.
2210 - name: Content-Length
2211 in: header
2212 schema:
2213 type: number
2214 example: 262144
2215 required: true
2216 description: |
2217 Size of the chunk that the request is sending.
2218
f6d6e7f8 2219 Remember that larger chunks are more efficient. PeerTube's web client uses chunks varying from
2220 1048576 bytes (~1MB) and increases or reduces size depending on connection health.
2221 requestBody:
2222 content:
2223 application/octet-stream:
2224 schema:
2225 type: string
2226 format: binary
2227 responses:
2228 '200':
2229 description: last chunk received
2230 headers:
2231 Content-Length:
2232 schema:
2233 type: number
2234 content:
2235 application/json:
2236 schema:
2237 $ref: '#/components/schemas/VideoUploadResponse'
2238 '308':
2239 description: resume incomplete
2240 headers:
2241 Range:
2242 schema:
2243 type: string
2244 example: bytes=0-262143
2245 Content-Length:
2246 schema:
2247 type: number
2248 example: 0
2249 '403':
2250 description: video didn't pass upload filter
c756bae0
RK
2251 '404':
2252 description: upload not found
2253 '409':
2254 description: chunk doesn't match range
f6d6e7f8 2255 '422':
2256 description: video unreadable
c756bae0
RK
2257 '429':
2258 description: too many concurrent requests
276250f0
RK
2259 '503':
2260 description: upload is already being processed
2261 headers:
2262 'Retry-After':
2263 schema:
2264 type: number
2265 example: 300
f6d6e7f8 2266 delete:
2267 summary: Cancel the resumable upload of a video, deleting any data uploaded so far
2268 description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the upload of a video
40cfb36b 2269 operationId: uploadResumableCancel
f6d6e7f8 2270 security:
2271 - OAuth2: []
2272 tags:
2273 - Video
2274 - Video Upload
2275 parameters:
2276 - name: upload_id
c215e627 2277 in: query
f6d6e7f8 2278 required: true
2279 description: |
2280 Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is
2281 not valid anymore and the upload session has already been deleted with its data ;-)
2282 schema:
2283 type: string
2284 - name: Content-Length
2285 in: header
2286 required: true
2287 schema:
2288 type: number
2289 example: 0
2290 responses:
2291 '204':
2292 description: upload cancelled
2293 headers:
2294 Content-Length:
2295 schema:
2296 type: number
2297 example: 0
c756bae0
RK
2298 '404':
2299 description: upload not found
3f71c4c0 2300
28c8e63e
C
2301 /videos/imports:
2302 post:
b029d58a
C
2303 summary: Import a video
2304 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
40cfb36b 2305 operationId: importVideo
28c8e63e
C
2306 security:
2307 - OAuth2: []
2308 tags:
419b520c 2309 - Video Imports
f6d6e7f8 2310 - Video Upload
28c8e63e
C
2311 requestBody:
2312 content:
2313 multipart/form-data:
2314 schema:
ac2a5b54 2315 $ref: '#/components/schemas/VideoCreateImport'
0ad45af7
FS
2316 encoding:
2317 torrentfile:
2318 contentType: application/x-bittorrent
2319 thumbnailfile:
2320 contentType: image/jpeg
2321 previewfile:
2322 contentType: image/jpeg
06746a8b
RK
2323 responses:
2324 '200':
2325 description: successful operation
2326 content:
2327 application/json:
2328 schema:
2329 $ref: '#/components/schemas/VideoUploadResponse'
06746a8b
RK
2330 '400':
2331 description: '`magnetUri` or `targetUrl` or a torrent file missing'
f2eb23cd
RK
2332 '403':
2333 description: video didn't pass pre-import filter
2334 '409':
2335 description: HTTP or Torrent/magnetURI import not enabled
668b7f09 2336
419b520c
C
2337 /videos/imports/{id}/cancel:
2338 post:
2339 summary: Cancel video import
2340 description: Cancel a pending video import
2341 security:
2342 - OAuth2: []
2343 tags:
2344 - Video Imports
2345 parameters:
2346 - $ref: '#/components/parameters/id'
2347 responses:
2348 '204':
2349 description: successful operation
2350
2351 /videos/imports/{id}:
2352 delete:
2353 summary: Delete video import
2354 description: Delete ended video import
2355 security:
2356 - OAuth2: []
2357 tags:
2358 - Video Imports
2359 parameters:
2360 - $ref: '#/components/parameters/id'
2361 responses:
2362 '204':
2363 description: successful operation
2364
4e239e35
C
2365 /videos/live:
2366 post:
2367 summary: Create a live
e2adb8cb 2368 operationId: addLive
4e239e35
C
2369 security:
2370 - OAuth2: []
2371 tags:
2372 - Live Videos
2373 - Video
2374 responses:
2375 '200':
2376 description: successful operation
2377 content:
2378 application/json:
2379 schema:
2380 $ref: '#/components/schemas/VideoUploadResponse'
c756bae0
RK
2381 '400':
2382 x-summary: validation error, or conflicting `saveReplay` and `permanentLive` parameter set
2383 description: |
2384 Disambiguate via `type`:
2385 - default type for a validation error
2386 - `live_conflicting_permanent_and_save_replay` for conflicting parameters set
4e239e35 2387 '403':
c756bae0
RK
2388 x-summary: live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded
2389 description: |
2390 Disambiguate via `type`:
2391 - `live_not_enabled` for a disabled live feature
2392 - `live_not_allowing_replay` for a disabled replay feature
2393 - `max_instance_lives_limit_reached` for the absolute concurrent live limit
2394 - `max_user_lives_limit_reached` for the user concurrent live limit
4e239e35
C
2395 requestBody:
2396 content:
2397 multipart/form-data:
2398 schema:
2399 type: object
2400 properties:
2401 channelId:
2402 description: Channel id that will contain this live video
2403 type: integer
2404 saveReplay:
2405 type: boolean
bb4ba6d9
C
2406 permanentLive:
2407 description: User can stream multiple times in a permanent live
2408 type: boolean
f443a746
C
2409 latencyMode:
2410 description: User can select live latency mode if enabled by the instance
2411 $ref: '#/components/schemas/LiveVideoLatencyMode'
4e239e35
C
2412 thumbnailfile:
2413 description: Live video/replay thumbnail file
2414 type: string
2415 format: binary
2416 previewfile:
2417 description: Live video/replay preview file
2418 type: string
2419 format: binary
2420 privacy:
2421 $ref: '#/components/schemas/VideoPrivacySet'
2422 category:
40cfb36b 2423 $ref: '#/components/schemas/VideoCategorySet'
4e239e35 2424 licence:
40cfb36b 2425 $ref: '#/components/schemas/VideoLicenceSet'
4e239e35 2426 language:
40cfb36b 2427 $ref: '#/components/schemas/VideoLanguageSet'
4e239e35
C
2428 description:
2429 description: Live video/replay description
2430 type: string
2431 support:
2432 description: A text tell the audience how to support the creator
9a320a06 2433 example: Please support our work on https://soutenir.framasoft.org/en/ <3
4e239e35
C
2434 type: string
2435 nsfw:
2436 description: Whether or not this live video/replay contains sensitive content
2437 type: boolean
2438 name:
2439 description: Live video/replay name
2440 type: string
bdac0584
RK
2441 minLength: 3
2442 maxLength: 120
4e239e35
C
2443 tags:
2444 description: Live video/replay tags (maximum 5 tags each between 2 and 30 characters)
2445 type: array
2446 minItems: 1
2447 maxItems: 5
2448 items:
2449 type: string
2450 minLength: 2
2451 maxLength: 30
2452 commentsEnabled:
2453 description: Enable or disable comments for this live video/replay
2454 type: boolean
2455 downloadEnabled:
2370d9cc 2456 description: Enable or disable downloading for the replay of this live video
4e239e35
C
2457 type: boolean
2458 required:
2459 - channelId
2460 - name
2461 encoding:
2462 thumbnailfile:
2463 contentType: image/jpeg
2464 previewfile:
2465 contentType: image/jpeg
2466
2467 /videos/live/{id}:
2468 get:
f6d6e7f8 2469 summary: Get information about a live
40cfb36b 2470 operationId: getLiveId
4e239e35
C
2471 security:
2472 - OAuth2: []
2473 tags:
2474 - Live Videos
2475 - Video
2476 parameters:
2477 - $ref: '#/components/parameters/idOrUUID'
2478 responses:
2479 '200':
2480 description: successful operation
2481 content:
2482 application/json:
2483 schema:
2484 $ref: '#/components/schemas/LiveVideoResponse'
2485 put:
f6d6e7f8 2486 summary: Update information about a live
40cfb36b 2487 operationId: updateLiveId
4e239e35
C
2488 security:
2489 - OAuth2: []
2490 tags:
2491 - Live Videos
2492 - Video
2493 parameters:
2494 - $ref: '#/components/parameters/idOrUUID'
2495 requestBody:
2496 content:
2497 application/json:
2498 schema:
2499 $ref: '#/components/schemas/LiveVideoUpdate'
2500 responses:
2501 '204':
b8375da9 2502 description: successful operation
4e239e35 2503 '400':
b8375da9 2504 description: bad parameters or trying to update a live that has already started
4e239e35 2505 '403':
b8375da9 2506 description: trying to save replay of the live but saving replay is not enabled on the instance
26e3e98f
C
2507 /videos/live/{id}/sessions:
2508 get:
2509 summary: List live sessions
2510 description: List all sessions created in a particular live
2511 security:
2512 - OAuth2: []
2513 tags:
2514 - Live Videos
2515 parameters:
2516 - $ref: '#/components/parameters/idOrUUID'
2517 responses:
2518 '200':
2519 description: successful operation
2520 content:
2521 application/json:
2522 schema:
2523 type: object
2524 properties:
2525 total:
2526 type: integer
2527 example: 1
2528 data:
2529 type: array
2530 items:
2531 $ref: '#/components/schemas/LiveVideoSessionResponse'
2532 /videos/{id}/live-session:
2533 get:
2534 summary: Get live session of a replay
2535 description: If the video is a replay of a live, you can find the associated live session using this endpoint
2536 security:
2537 - OAuth2: []
2538 tags:
2539 - Live Videos
2540 parameters:
2541 - $ref: '#/components/parameters/idOrUUID'
2542 responses:
2543 '200':
2544 description: successful operation
2545 content:
2546 application/json:
2547 schema:
2548 $ref: '#/components/schemas/LiveVideoSessionResponse'
4e239e35 2549
668b7f09
C
2550 /users/me/abuses:
2551 get:
2552 summary: List my abuses
985ece57 2553 operationId: getMyAbuses
668b7f09
C
2554 security:
2555 - OAuth2: []
2556 tags:
2557 - Abuses
2558 - My User
2559 parameters:
2560 - name: id
2561 in: query
2562 description: only list the report with this id
2563 schema:
2564 type: integer
2565 - name: state
2566 in: query
2567 schema:
2568 $ref: '#/components/schemas/AbuseStateSet'
985ece57 2569 - $ref: '#/components/parameters/abusesSort'
668b7f09
C
2570 - $ref: '#/components/parameters/start'
2571 - $ref: '#/components/parameters/count'
668b7f09
C
2572 responses:
2573 '200':
2574 description: successful operation
2575 content:
2576 application/json:
2577 schema:
985ece57
RK
2578 type: object
2579 properties:
2580 total:
2581 type: integer
2582 example: 1
2583 data:
2584 type: array
2585 items:
2586 $ref: '#/components/schemas/Abuse'
668b7f09 2587
e3489df9 2588 /abuses:
1569a818 2589 get:
310b5219 2590 summary: List abuses
985ece57 2591 operationId: getAbuses
94ff4c23 2592 security:
b029d58a 2593 - OAuth2:
06746a8b
RK
2594 - admin
2595 - moderator
1569a818 2596 tags:
310b5219 2597 - Abuses
44cb3b85 2598 parameters:
84f6e32c
RK
2599 - name: id
2600 in: query
2601 description: only list the report with this id
2602 schema:
2603 type: integer
2604 - name: predefinedReason
2605 in: query
2606 description: predefined reason the listed reports should contain
2607 schema:
e3489df9 2608 $ref: '#/components/schemas/PredefinedAbuseReasons'
84f6e32c
RK
2609 - name: search
2610 in: query
2611 description: plain search that will match with video titles, reporter names and more
2612 schema:
2613 type: string
2614 - name: state
2615 in: query
84f6e32c 2616 schema:
668b7f09 2617 $ref: '#/components/schemas/AbuseStateSet'
84f6e32c
RK
2618 - name: searchReporter
2619 in: query
2620 description: only list reports of a specific reporter
2621 schema:
2622 type: string
2623 - name: searchReportee
2624 description: only list reports of a specific reportee
2625 in: query
2626 schema:
2627 type: string
2628 - name: searchVideo
2629 in: query
2630 description: only list reports of a specific video
2631 schema:
2632 type: string
2633 - name: searchVideoChannel
2634 in: query
2635 description: only list reports of a specific video channel
2636 schema:
2637 type: string
17b07dc5
C
2638 - name: videoIs
2639 in: query
c756bae0 2640 description: only list deleted or blocklisted videos
17b07dc5
C
2641 schema:
2642 type: string
2643 enum:
2644 - 'deleted'
2645 - 'blacklisted'
2646 - name: filter
2647 in: query
2648 description: only list account, comment or video reports
2649 schema:
2650 type: string
2651 enum:
2652 - 'video'
2653 - 'comment'
2654 - 'account'
3e9e6f2f
RK
2655 - $ref: '#/components/parameters/start'
2656 - $ref: '#/components/parameters/count'
fd5af7a2 2657 - $ref: '#/components/parameters/abusesSort'
1569a818
DG
2658 responses:
2659 '200':
2660 description: successful operation
3e9e6f2f
RK
2661 content:
2662 application/json:
2663 schema:
985ece57
RK
2664 type: object
2665 properties:
2666 total:
2667 type: integer
2668 example: 1
2669 data:
2670 type: array
2671 items:
2672 $ref: '#/components/schemas/Abuse'
1569a818 2673 post:
b029d58a 2674 summary: Report an abuse
94ff4c23 2675 security:
3e9e6f2f 2676 - OAuth2: []
1569a818 2677 tags:
310b5219 2678 - Abuses
50e16ccf 2679 requestBody:
1ebddadd 2680 required: true
50e16ccf
C
2681 content:
2682 application/json:
2683 schema:
2684 type: object
2685 properties:
2686 reason:
2687 description: Reason why the user reports this video
2688 type: string
4302058c
RK
2689 minLength: 2
2690 maxLength: 3000
1ebddadd 2691 predefinedReasons:
e3489df9 2692 $ref: '#/components/schemas/PredefinedAbuseReasons'
e3489df9
C
2693 video:
2694 type: object
2695 properties:
2696 id:
2697 description: Video id to report
b8375da9
RK
2698 allOf:
2699 - $ref: '#/components/schemas/Video/properties/id'
e3489df9
C
2700 startAt:
2701 type: integer
c00100b6 2702 format: seconds
e3489df9
C
2703 description: Timestamp in the video that marks the beginning of the report
2704 minimum: 0
2705 endAt:
2706 type: integer
c00100b6 2707 format: seconds
e3489df9
C
2708 description: Timestamp in the video that marks the ending of the report
2709 minimum: 0
2710 comment:
2711 type: object
2712 properties:
2713 id:
2714 description: Comment id to report
b8375da9
RK
2715 allOf:
2716 - $ref: '#/components/schemas/VideoComment/properties/id'
e3489df9
C
2717 account:
2718 type: object
2719 properties:
2720 id:
2721 description: Account id to report
b8375da9 2722 type: integer
1ebddadd
RK
2723 required:
2724 - reason
50e16ccf 2725 responses:
65cb01a2 2726 '200':
50e16ccf 2727 description: successful operation
65cb01a2
RK
2728 content:
2729 application/json:
2730 schema:
2731 type: object
2732 properties:
2733 abuse:
2734 type: object
2735 properties:
2736 id:
2737 $ref: '#/components/schemas/id'
84f6e32c
RK
2738 '400':
2739 description: incorrect request parameters
3f71c4c0 2740
e3489df9 2741 '/abuses/{abuseId}':
50e16ccf
C
2742 put:
2743 summary: Update an abuse
2744 security:
2745 - OAuth2:
2746 - admin
2747 - moderator
2748 tags:
310b5219 2749 - Abuses
50e16ccf 2750 parameters:
50e16ccf
C
2751 - $ref: '#/components/parameters/abuseId'
2752 requestBody:
2753 content:
2754 application/json:
2755 schema:
2756 type: object
2757 properties:
2758 state:
4f32032f 2759 $ref: '#/components/schemas/AbuseStateSet'
50e16ccf
C
2760 moderationComment:
2761 type: string
84f6e32c 2762 description: Update the report comment visible only to the moderation team
4302058c
RK
2763 minLength: 2
2764 maxLength: 3000
84f6e32c
RK
2765 responses:
2766 '204':
2767 description: successful operation
2768 '404':
310b5219 2769 description: abuse not found
50e16ccf 2770 delete:
84f6e32c 2771 tags:
310b5219 2772 - Abuses
50e16ccf
C
2773 summary: Delete an abuse
2774 security:
2775 - OAuth2:
64b5c247
RK
2776 - admin
2777 - moderator
84f6e32c 2778 parameters:
84f6e32c 2779 - $ref: '#/components/parameters/abuseId'
50e16ccf
C
2780 responses:
2781 '204':
2782 description: successful operation
06746a8b
RK
2783 '404':
2784 description: block not found
3f71c4c0 2785
668b7f09
C
2786 '/abuses/{abuseId}/messages':
2787 get:
2788 summary: List messages of an abuse
2789 security:
2790 - OAuth2: []
2791 tags:
2792 - Abuses
2793 parameters:
2794 - $ref: '#/components/parameters/abuseId'
2795 responses:
2796 '200':
2797 description: successful operation
2798 content:
2799 application/json:
2800 schema:
c76ecc3f
RK
2801 type: object
2802 properties:
2803 total:
2804 type: integer
2805 example: 1
2806 data:
2807 type: array
2808 items:
2809 $ref: '#/components/schemas/AbuseMessage'
668b7f09
C
2810 post:
2811 summary: Add message to an abuse
2812 security:
2813 - OAuth2: []
2814 tags:
2815 - Abuses
fcc4466e
C
2816 parameters:
2817 - $ref: '#/components/parameters/abuseId'
668b7f09
C
2818 requestBody:
2819 required: true
2820 content:
2821 application/json:
2822 schema:
2823 type: object
2824 properties:
2825 message:
2826 description: Message to send
2827 type: string
4302058c
RK
2828 minLength: 2
2829 maxLength: 3000
668b7f09
C
2830 required:
2831 - message
2832 responses:
2833 '200':
2834 description: successful operation
2835 '400':
2836 description: incorrect request parameters
3f71c4c0 2837
668b7f09
C
2838 '/abuses/{abuseId}/messages/{abuseMessageId}':
2839 delete:
2840 summary: Delete an abuse message
2841 security:
2842 - OAuth2: []
2843 tags:
2844 - Abuses
2845 parameters:
2846 - $ref: '#/components/parameters/abuseId'
2847 - $ref: '#/components/parameters/abuseMessageId'
2848 responses:
2849 '204':
2850 description: successful operation
50e16ccf 2851
3e9e6f2f 2852 '/videos/{id}/blacklist':
1569a818 2853 post:
06746a8b 2854 summary: Block a video
3f71c4c0 2855 operationId: addVideoBlock
94ff4c23 2856 security:
3e9e6f2f 2857 - OAuth2:
64b5c247
RK
2858 - admin
2859 - moderator
1569a818 2860 tags:
06746a8b 2861 - Video Blocks
1569a818 2862 parameters:
cb9d028a 2863 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
2864 responses:
2865 '204':
c1843150 2866 description: successful operation
1569a818 2867 delete:
06746a8b 2868 summary: Unblock a video by its id
3f71c4c0 2869 operationId: delVideoBlock
94ff4c23 2870 security:
3e9e6f2f 2871 - OAuth2:
64b5c247
RK
2872 - admin
2873 - moderator
1569a818 2874 tags:
06746a8b 2875 - Video Blocks
1569a818 2876 parameters:
cb9d028a 2877 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
2878 responses:
2879 '204':
c1843150 2880 description: successful operation
06746a8b
RK
2881 '404':
2882 description: block not found
3f71c4c0 2883
c360c494 2884 /videos/blacklist:
1569a818 2885 get:
06746a8b
RK
2886 tags:
2887 - Video Blocks
f4d59981 2888 summary: List video blocks
3f71c4c0 2889 operationId: getVideoBlocks
94ff4c23 2890 security:
3e9e6f2f 2891 - OAuth2:
64b5c247
RK
2892 - admin
2893 - moderator
44cb3b85 2894 parameters:
84f6e32c
RK
2895 - name: type
2896 in: query
2897 description: >
2898 list only blocks that match this type:
2899
2900 - `1`: manual block
2901
2902 - `2`: automatic block that needs review
2903 schema:
2904 type: integer
2905 enum:
2906 - 1
2907 - 2
2908 - name: search
2909 in: query
2910 description: plain search that will match with video titles, and more
2911 schema:
2912 type: string
3e9e6f2f
RK
2913 - $ref: '#/components/parameters/start'
2914 - $ref: '#/components/parameters/count'
fd5af7a2 2915 - $ref: '#/components/parameters/blacklistsSort'
1569a818
DG
2916 responses:
2917 '200':
2918 description: successful operation
3e9e6f2f
RK
2919 content:
2920 application/json:
2921 schema:
84f6e32c
RK
2922 type: object
2923 properties:
2924 total:
2925 type: integer
2926 example: 1
2927 data:
2928 type: array
2929 items:
2930 $ref: '#/components/schemas/VideoBlacklist'
3f71c4c0 2931
67ae04a5
C
2932 /videos/{id}/captions:
2933 get:
b029d58a 2934 summary: List captions of a video
3f71c4c0 2935 operationId: getVideoCaptions
67ae04a5 2936 tags:
04b703f6 2937 - Video Captions
67ae04a5 2938 parameters:
cb9d028a 2939 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
2940 responses:
2941 '200':
2942 description: successful operation
2943 content:
2944 application/json:
2945 schema:
2946 type: object
2947 properties:
2948 total:
2949 type: integer
84f6e32c 2950 example: 1
67ae04a5
C
2951 data:
2952 type: array
2953 items:
2954 $ref: '#/components/schemas/VideoCaption'
3f71c4c0 2955
67ae04a5
C
2956 /videos/{id}/captions/{captionLanguage}:
2957 put:
2958 summary: Add or replace a video caption
3f71c4c0 2959 operationId: addVideoCaption
64b5c247
RK
2960 security:
2961 - OAuth2:
2962 - user
67ae04a5 2963 tags:
04b703f6 2964 - Video Captions
67ae04a5 2965 parameters:
cb9d028a 2966 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
2967 - $ref: '#/components/parameters/captionLanguage'
2968 requestBody:
2969 content:
2970 multipart/form-data:
2971 schema:
2972 type: object
2973 properties:
2974 captionfile:
2975 description: The file to upload.
2976 type: string
2977 format: binary
0ad45af7
FS
2978 encoding:
2979 captionfile:
205ed5b7 2980 contentType: text/vtt, application/x-subrip, text/plain
67ae04a5
C
2981 responses:
2982 '204':
c1843150 2983 description: successful operation
06746a8b
RK
2984 '404':
2985 description: video or language not found
67ae04a5
C
2986 delete:
2987 summary: Delete a video caption
3f71c4c0 2988 operationId: delVideoCaption
64b5c247
RK
2989 security:
2990 - OAuth2:
2991 - user
67ae04a5 2992 tags:
04b703f6 2993 - Video Captions
67ae04a5 2994 parameters:
cb9d028a 2995 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
2996 - $ref: '#/components/parameters/captionLanguage'
2997 responses:
2998 '204':
c1843150 2999 description: successful operation
06746a8b
RK
3000 '404':
3001 description: video or language or caption for that language not found
3f71c4c0 3002
48dce1c9 3003 /video-channels:
1569a818 3004 get:
b029d58a 3005 summary: List video channels
9a320a06 3006 operationId: getVideoChannels
1569a818 3007 tags:
b029d58a 3008 - Video Channels
44cb3b85 3009 parameters:
3e9e6f2f
RK
3010 - $ref: '#/components/parameters/start'
3011 - $ref: '#/components/parameters/count'
3012 - $ref: '#/components/parameters/sort'
1569a818
DG
3013 responses:
3014 '200':
3015 description: successful operation
3e9e6f2f
RK
3016 content:
3017 application/json:
3018 schema:
045bcd0d 3019 $ref: '#/components/schemas/VideoChannelList'
1569a818 3020 post:
b029d58a 3021 summary: Create a video channel
3f71c4c0 3022 operationId: addVideoChannel
94ff4c23 3023 security:
3e9e6f2f 3024 - OAuth2: []
1569a818 3025 tags:
b029d58a 3026 - Video Channels
1569a818
DG
3027 responses:
3028 '204':
c1843150 3029 description: successful operation
9a320a06
RK
3030 content:
3031 application/json:
3032 schema:
3033 type: object
3034 properties:
3035 videoChannel:
3036 type: object
3037 properties:
3038 id:
d0800f76 3039 $ref: '#/components/schemas/id'
3e9e6f2f 3040 requestBody:
7d14d4d2
C
3041 content:
3042 application/json:
3043 schema:
3044 $ref: '#/components/schemas/VideoChannelCreate'
3f71c4c0 3045
9ce3d302 3046 '/video-channels/{channelHandle}':
1569a818 3047 get:
b029d58a 3048 summary: Get a video channel
9a320a06 3049 operationId: getVideoChannel
1569a818 3050 tags:
b029d58a 3051 - Video Channels
1569a818 3052 parameters:
9ce3d302 3053 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
3054 responses:
3055 '200':
3056 description: successful operation
3e9e6f2f
RK
3057 content:
3058 application/json:
3059 schema:
3060 $ref: '#/components/schemas/VideoChannel'
1569a818 3061 put:
b029d58a 3062 summary: Update a video channel
3f71c4c0 3063 operationId: putVideoChannel
94ff4c23 3064 security:
3e9e6f2f 3065 - OAuth2: []
1569a818 3066 tags:
b029d58a 3067 - Video Channels
1569a818 3068 parameters:
9ce3d302 3069 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
3070 responses:
3071 '204':
c1843150 3072 description: successful operation
3e9e6f2f 3073 requestBody:
7d14d4d2
C
3074 content:
3075 application/json:
3076 schema:
3077 $ref: '#/components/schemas/VideoChannelUpdate'
1569a818 3078 delete:
b029d58a 3079 summary: Delete a video channel
3f71c4c0 3080 operationId: delVideoChannel
94ff4c23 3081 security:
3e9e6f2f 3082 - OAuth2: []
1569a818 3083 tags:
b029d58a 3084 - Video Channels
1569a818 3085 parameters:
9ce3d302 3086 - $ref: '#/components/parameters/channelHandle'
cc918ac3
C
3087 responses:
3088 '204':
c1843150 3089 description: successful operation
3f71c4c0 3090
9ce3d302 3091 '/video-channels/{channelHandle}/videos':
cc918ac3 3092 get:
b029d58a 3093 summary: List videos of a video channel
3f71c4c0 3094 operationId: getVideoChannelVideos
cc918ac3 3095 tags:
048b6946 3096 - Video
b029d58a 3097 - Video Channels
cc918ac3 3098 parameters:
9ce3d302 3099 - $ref: '#/components/parameters/channelHandle'
59c794a5 3100 - $ref: '#/components/parameters/categoryOneOf'
1fd61899 3101 - $ref: '#/components/parameters/isLive'
59c794a5
C
3102 - $ref: '#/components/parameters/tagsOneOf'
3103 - $ref: '#/components/parameters/tagsAllOf'
3104 - $ref: '#/components/parameters/licenceOneOf'
3105 - $ref: '#/components/parameters/languageOneOf'
3106 - $ref: '#/components/parameters/nsfw'
2760b454
C
3107 - $ref: '#/components/parameters/isLocal'
3108 - $ref: '#/components/parameters/include'
527a52ac 3109 - $ref: '#/components/parameters/privacyOneOf'
d324756e
C
3110 - $ref: '#/components/parameters/hasHLSFiles'
3111 - $ref: '#/components/parameters/hasWebtorrentFiles'
59c794a5
C
3112 - $ref: '#/components/parameters/skipCount'
3113 - $ref: '#/components/parameters/start'
3114 - $ref: '#/components/parameters/count'
3115 - $ref: '#/components/parameters/videosSort'
1569a818 3116 responses:
cc918ac3 3117 '200':
1569a818 3118 description: successful operation
3e9e6f2f
RK
3119 content:
3120 application/json:
3121 schema:
048b6946 3122 $ref: '#/components/schemas/VideoListResponse'
3f71c4c0 3123
906f46d0
C
3124 '/video-channels/{channelHandle}/followers':
3125 get:
3126 tags:
3127 - Video Channels
3128 summary: 'List followers of a video channel'
3129 security:
3130 - OAuth2: []
3131 operationId: getVideoChannelFollowers
3132 parameters:
3133 - $ref: '#/components/parameters/channelHandle'
3134 - $ref: '#/components/parameters/start'
3135 - $ref: '#/components/parameters/count'
3136 - $ref: '#/components/parameters/followersSort'
3137 - $ref: '#/components/parameters/search'
3138 responses:
3139 '200':
3140 description: successful operation
3141 content:
3142 application/json:
3143 schema:
3144 type: object
3145 properties:
3146 total:
3147 type: integer
3148 example: 1
3149 data:
3150 type: array
3151 items:
3152 $ref: '#/components/schemas/Follow'
3153
75cba40d
C
3154 '/video-channels/{channelHandle}/avatar/pick':
3155 post:
3156 summary: Update channel avatar
3157 security:
3158 - OAuth2: []
3159 tags:
3160 - Video Channels
3161 parameters:
3162 - $ref: '#/components/parameters/channelHandle'
3163 responses:
3164 '200':
3165 description: successful operation
3166 content:
3167 application/json:
3168 schema:
3169 type: object
3170 properties:
d0800f76 3171 avatars:
3172 type: array
3173 items:
3174 $ref: '#/components/schemas/ActorImage'
75cba40d
C
3175 '413':
3176 description: image file too large
3177 headers:
3178 X-File-Maximum-Size:
3179 schema:
3180 type: string
3181 format: Nginx size
3182 description: Maximum file size for the avatar
3183 requestBody:
3184 content:
3185 multipart/form-data:
3186 schema:
3187 type: object
3188 properties:
3189 avatarfile:
3190 description: The file to upload.
3191 type: string
3192 format: binary
3193 encoding:
3194 avatarfile:
3195 contentType: image/png, image/jpeg
3f71c4c0 3196
75cba40d
C
3197 '/video-channels/{channelHandle}/avatar':
3198 delete:
3199 summary: Delete channel avatar
3200 security:
3201 - OAuth2: []
3202 tags:
3203 - Video Channels
3204 parameters:
3205 - $ref: '#/components/parameters/channelHandle'
3206 responses:
3207 '204':
3208 description: successful operation
3209
75cba40d
C
3210 '/video-channels/{channelHandle}/banner/pick':
3211 post:
3212 summary: Update channel banner
3213 security:
3214 - OAuth2: []
3215 tags:
3216 - Video Channels
3217 parameters:
3218 - $ref: '#/components/parameters/channelHandle'
3219 responses:
3220 '200':
3221 description: successful operation
3222 content:
3223 application/json:
3224 schema:
3225 type: object
3226 properties:
d0800f76 3227 banners:
3228 type: array
3229 items:
3230 $ref: '#/components/schemas/ActorImage'
75cba40d
C
3231 '413':
3232 description: image file too large
3233 headers:
3234 X-File-Maximum-Size:
3235 schema:
3236 type: string
3237 format: Nginx size
3238 description: Maximum file size for the banner
3239 requestBody:
3240 content:
3241 multipart/form-data:
3242 schema:
3243 type: object
3244 properties:
3245 bannerfile:
3246 description: The file to upload.
3247 type: string
3248 format: binary
3249 encoding:
3250 bannerfile:
3251 contentType: image/png, image/jpeg
3f71c4c0 3252
75cba40d
C
3253 '/video-channels/{channelHandle}/banner':
3254 delete:
3255 summary: Delete channel banner
3256 security:
3257 - OAuth2: []
3258 tags:
3259 - Video Channels
3260 parameters:
3261 - $ref: '#/components/parameters/channelHandle'
3262 responses:
3263 '204':
3264 description: successful operation
c1843150
C
3265
3266 /video-playlists/privacies:
3267 get:
40cfb36b
RK
3268 summary: List available playlist privacy policies
3269 operationId: getPlaylistPrivacyPolicies
c1843150
C
3270 tags:
3271 - Video Playlists
3272 responses:
3273 '200':
3274 description: successful operation
3275 content:
3276 application/json:
3277 schema:
3278 type: array
3279 items:
3280 type: string
84f6e32c
RK
3281 examples:
3282 nightly:
3283 externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies
c1843150 3284
71810d0b
RK
3285 /video-playlists:
3286 get:
b029d58a 3287 summary: List video playlists
40cfb36b 3288 operationId: getPlaylists
71810d0b 3289 tags:
b029d58a 3290 - Video Playlists
71810d0b
RK
3291 parameters:
3292 - $ref: '#/components/parameters/start'
3293 - $ref: '#/components/parameters/count'
3294 - $ref: '#/components/parameters/sort'
3295 responses:
3296 '200':
3297 description: successful operation
3298 content:
3299 application/json:
3300 schema:
84f6e32c
RK
3301 type: object
3302 properties:
3303 total:
3304 type: integer
3305 example: 1
3306 data:
3307 type: array
3308 items:
3309 $ref: '#/components/schemas/VideoPlaylist'
c1843150
C
3310 post:
3311 summary: Create a video playlist
b8375da9 3312 description: If the video playlist is set as public, `videoChannelId` is mandatory.
e2adb8cb 3313 operationId: addPlaylist
c1843150
C
3314 security:
3315 - OAuth2: []
3316 tags:
3317 - Video Playlists
3318 responses:
3319 '200':
3320 description: successful operation
3321 content:
3322 application/json:
3323 schema:
3324 type: object
3325 properties:
3326 videoPlaylist:
3327 type: object
3328 properties:
3329 id:
b8375da9 3330 $ref: '#/components/schemas/VideoPlaylist/properties/id'
c1843150 3331 uuid:
b8375da9 3332 $ref: '#/components/schemas/VideoPlaylist/properties/uuid'
d4a8e7a6
C
3333 shortUUID:
3334 $ref: '#/components/schemas/VideoPlaylist/properties/shortUUID'
c1843150
C
3335 requestBody:
3336 content:
3337 multipart/form-data:
3338 schema:
3339 type: object
3340 properties:
3341 displayName:
3342 description: Video playlist display name
3343 type: string
bdac0584
RK
3344 minLength: 1
3345 maxLength: 120
c1843150
C
3346 thumbnailfile:
3347 description: Video playlist thumbnail file
3348 type: string
3349 format: binary
3350 privacy:
3351 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
3352 description:
3353 description: Video playlist description
3354 type: string
b8375da9
RK
3355 minLength: 3
3356 maxLength: 1000
c1843150 3357 videoChannelId:
b8375da9
RK
3358 allOf:
3359 - $ref: '#/components/schemas/id'
c1843150 3360 description: Video channel in which the playlist will be published
c1843150
C
3361 required:
3362 - displayName
2c318664
RK
3363 encoding:
3364 thumbnailfile:
3365 contentType: image/jpeg
c1843150 3366
c00100b6 3367 /video-playlists/{playlistId}:
c1843150
C
3368 get:
3369 summary: Get a video playlist
3370 tags:
3371 - Video Playlists
3372 parameters:
c00100b6 3373 - $ref: '#/components/parameters/playlistId'
c1843150
C
3374 responses:
3375 '200':
3376 description: successful operation
3377 content:
3378 application/json:
3379 schema:
3380 $ref: '#/components/schemas/VideoPlaylist'
3381 put:
3382 summary: Update a video playlist
3383 description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
3384 security:
3385 - OAuth2: []
3386 tags:
3387 - Video Playlists
3388 responses:
3389 '204':
3390 description: successful operation
3391 parameters:
c00100b6 3392 - $ref: '#/components/parameters/playlistId'
c1843150
C
3393 requestBody:
3394 content:
3395 multipart/form-data:
3396 schema:
3397 type: object
3398 properties:
3399 displayName:
3400 description: Video playlist display name
3401 type: string
bdac0584
RK
3402 minLength: 1
3403 maxLength: 120
c1843150
C
3404 thumbnailfile:
3405 description: Video playlist thumbnail file
3406 type: string
3407 format: binary
3408 privacy:
3409 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
3410 description:
3411 description: Video playlist description
3412 type: string
3413 videoChannelId:
b8375da9
RK
3414 allOf:
3415 - $ref: '#/components/schemas/id'
c1843150 3416 description: Video channel in which the playlist will be published
2c318664
RK
3417 encoding:
3418 thumbnailfile:
3419 contentType: image/jpeg
c1843150
C
3420 delete:
3421 summary: Delete a video playlist
3422 security:
3423 - OAuth2: []
3424 tags:
3425 - Video Playlists
3426 parameters:
c00100b6 3427 - $ref: '#/components/parameters/playlistId'
c1843150
C
3428 responses:
3429 '204':
3430 description: successful operation
3431
c00100b6 3432 /video-playlists/{playlistId}/videos:
c1843150
C
3433 get:
3434 summary: 'List videos of a playlist'
e2adb8cb 3435 operationId: getVideoPlaylistVideos
c1843150
C
3436 tags:
3437 - Videos
3438 - Video Playlists
3439 parameters:
c00100b6 3440 - $ref: '#/components/parameters/playlistId'
9c58375c
J
3441 - $ref: '#/components/parameters/start'
3442 - $ref: '#/components/parameters/count'
c1843150
C
3443 responses:
3444 '200':
3445 description: successful operation
3446 content:
3447 application/json:
3448 schema:
3449 $ref: '#/components/schemas/VideoListResponse'
3450 post:
c00100b6 3451 summary: Add a video in a playlist
e2adb8cb 3452 operationId: addVideoPlaylistVideo
c1843150
C
3453 security:
3454 - OAuth2: []
3455 tags:
3456 - Videos
3457 - Video Playlists
3458 parameters:
c00100b6 3459 - $ref: '#/components/parameters/playlistId'
c1843150
C
3460 responses:
3461 '200':
3462 description: successful operation
3463 content:
3464 application/json:
3465 schema:
3466 type: object
3467 properties:
3468 videoPlaylistElement:
3469 type: object
3470 properties:
3471 id:
06746a8b 3472 type: integer
c00100b6 3473 example: 2
c1843150
C
3474 requestBody:
3475 content:
3476 application/json:
3477 schema:
3478 type: object
3479 properties:
3480 videoId:
c00100b6
RK
3481 oneOf:
3482 - $ref: '#/components/schemas/Video/properties/uuid'
b8375da9
RK
3483 - $ref: '#/components/schemas/Video/properties/id'
3484 description: Video to add in the playlist
c1843150 3485 startTimestamp:
06746a8b 3486 type: integer
c00100b6
RK
3487 format: seconds
3488 description: Start the video at this specific timestamp
c1843150 3489 stopTimestamp:
06746a8b 3490 type: integer
c00100b6
RK
3491 format: seconds
3492 description: Stop the video at this specific timestamp
c1843150
C
3493 required:
3494 - videoId
3495
c00100b6 3496 /video-playlists/{playlistId}/videos/reorder:
c1843150
C
3497 post:
3498 summary: 'Reorder a playlist'
e2adb8cb 3499 operationId: reorderVideoPlaylist
c1843150
C
3500 security:
3501 - OAuth2: []
3502 tags:
3503 - Video Playlists
3504 parameters:
c00100b6 3505 - $ref: '#/components/parameters/playlistId'
c1843150
C
3506 responses:
3507 '204':
3508 description: successful operation
3509 requestBody:
3510 content:
3511 application/json:
3512 schema:
3513 type: object
3514 properties:
3515 startPosition:
06746a8b
RK
3516 type: integer
3517 description: 'Start position of the element to reorder'
3518 minimum: 1
c1843150 3519 insertAfterPosition:
06746a8b
RK
3520 type: integer
3521 description: 'New position for the block to reorder, to add the block before the first element'
3522 minimum: 0
c1843150 3523 reorderLength:
06746a8b
RK
3524 type: integer
3525 description: 'How many element from `startPosition` to reorder'
3526 minimum: 1
c1843150
C
3527 required:
3528 - startPosition
3529 - insertAfterPosition
3530
c00100b6 3531 /video-playlists/{playlistId}/videos/{playlistElementId}:
c1843150 3532 put:
c00100b6 3533 summary: Update a playlist element
e2adb8cb 3534 operationId: putVideoPlaylistVideo
c1843150
C
3535 security:
3536 - OAuth2: []
3537 tags:
3538 - Video Playlists
3539 parameters:
c00100b6 3540 - $ref: '#/components/parameters/playlistId'
c1843150
C
3541 - $ref: '#/components/parameters/playlistElementId'
3542 responses:
3543 '204':
3544 description: successful operation
3545 requestBody:
3546 content:
3547 application/json:
3548 schema:
3549 type: object
3550 properties:
3551 startTimestamp:
06746a8b 3552 type: integer
c00100b6
RK
3553 format: seconds
3554 description: Start the video at this specific timestamp
c1843150 3555 stopTimestamp:
06746a8b 3556 type: integer
c00100b6
RK
3557 format: seconds
3558 description: Stop the video at this specific timestamp
c1843150 3559 delete:
c00100b6 3560 summary: Delete an element from a playlist
e2adb8cb 3561 operationId: delVideoPlaylistVideo
c1843150
C
3562 security:
3563 - OAuth2: []
3564 tags:
3565 - Video Playlists
3566 parameters:
c00100b6 3567 - $ref: '#/components/parameters/playlistId'
c1843150
C
3568 - $ref: '#/components/parameters/playlistElementId'
3569 responses:
3570 '204':
3571 description: successful operation
3572
0590bb46
C
3573 '/users/me/video-playlists/videos-exist':
3574 get:
c00100b6 3575 summary: Check video exists in my playlists
0590bb46
C
3576 security:
3577 - OAuth2: []
3578 tags:
3579 - Video Playlists
3580 parameters:
3581 - name: videoIds
3582 in: query
3583 required: true
3584 description: The video ids to check
3585 schema:
3586 type: array
3587 items:
b8375da9 3588 $ref: '#/components/schemas/Video/properties/id'
0590bb46
C
3589 responses:
3590 '200':
3591 description: successful operation
3592 content:
3593 application/json:
3594 schema:
3595 type: object
3596 properties:
3597 videoId:
3598 type: array
3599 items:
3600 type: object
3601 properties:
3602 playlistElementId:
06746a8b 3603 type: integer
0590bb46 3604 playlistId:
06746a8b 3605 type: integer
0590bb46 3606 startTimestamp:
06746a8b 3607 type: integer
c00100b6 3608 format: seconds
0590bb46 3609 stopTimestamp:
06746a8b 3610 type: integer
c00100b6 3611 format: seconds
0590bb46 3612
3e9e6f2f 3613 '/accounts/{name}/video-channels':
6b738c7a 3614 get:
b029d58a 3615 summary: List video channels of an account
6b738c7a 3616 tags:
b029d58a
C
3617 - Video Channels
3618 - Accounts
6b738c7a 3619 parameters:
3e9e6f2f 3620 - $ref: '#/components/parameters/name'
84f6e32c
RK
3621 - name: withStats
3622 in: query
c6f8ca4d 3623 description: include daily view statistics for the last 30 days and total views (only if authentified as the account user)
84f6e32c
RK
3624 schema:
3625 type: boolean
3626 - $ref: '#/components/parameters/start'
3627 - $ref: '#/components/parameters/count'
3628 - $ref: '#/components/parameters/sort'
6b738c7a
C
3629 responses:
3630 '200':
3631 description: successful operation
3e9e6f2f
RK
3632 content:
3633 application/json:
3634 schema:
045bcd0d 3635 $ref: '#/components/schemas/VideoChannelList'
3f71c4c0 3636
c100a614
YB
3637 '/accounts/{name}/ratings':
3638 get:
b029d58a 3639 summary: List ratings of an account
c100a614
YB
3640 security:
3641 - OAuth2: []
3642 tags:
b029d58a 3643 - Accounts
c100a614 3644 parameters:
cb9d028a 3645 - $ref: '#/components/parameters/name'
c100a614
YB
3646 - $ref: '#/components/parameters/start'
3647 - $ref: '#/components/parameters/count'
3648 - $ref: '#/components/parameters/sort'
3649 - name: rating
3650 in: query
3651 required: false
b3d1054e 3652 description: Optionally filter which ratings to retrieve
c100a614
YB
3653 schema:
3654 type: string
3655 enum:
3656 - like
3657 - dislike
3658 responses:
3659 '200':
3660 description: successful operation
3661 content:
3662 application/json:
3663 schema:
3664 type: array
3665 items:
3666 $ref: '#/components/schemas/VideoRating'
3f71c4c0 3667
3e9e6f2f 3668 '/videos/{id}/comment-threads':
1569a818 3669 get:
b029d58a 3670 summary: List threads of a video
1569a818 3671 tags:
b029d58a 3672 - Video Comments
1569a818 3673 parameters:
cb9d028a 3674 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f
RK
3675 - $ref: '#/components/parameters/start'
3676 - $ref: '#/components/parameters/count'
71810d0b 3677 - $ref: '#/components/parameters/commentsSort'
1569a818
DG
3678 responses:
3679 '200':
3680 description: successful operation
3e9e6f2f
RK
3681 content:
3682 application/json:
3683 schema:
3684 $ref: '#/components/schemas/CommentThreadResponse'
1569a818 3685 post:
b029d58a 3686 summary: Create a thread
94ff4c23 3687 security:
3e9e6f2f 3688 - OAuth2: []
1569a818 3689 tags:
b029d58a 3690 - Video Comments
1569a818 3691 parameters:
cb9d028a 3692 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
3693 responses:
3694 '200':
3695 description: successful operation
3e9e6f2f
RK
3696 content:
3697 application/json:
3698 schema:
3699 $ref: '#/components/schemas/CommentThreadPostResponse'
2c318664
RK
3700 '404':
3701 description: video does not exist
98639806
C
3702 requestBody:
3703 content:
3704 application/json:
3705 schema:
3706 type: object
3707 properties:
3708 text:
bf3c3fea
RK
3709 allOf:
3710 - $ref: '#/components/schemas/VideoComment/properties/text'
3711 format: markdown
3712 maxLength: 10000
98639806
C
3713 required:
3714 - text
3715
3e9e6f2f 3716 '/videos/{id}/comment-threads/{threadId}':
1569a818 3717 get:
b029d58a 3718 summary: Get a thread
1569a818 3719 tags:
b029d58a 3720 - Video Comments
1569a818 3721 parameters:
cb9d028a
C
3722 - $ref: '#/components/parameters/idOrUUID'
3723 - $ref: '#/components/parameters/threadId'
1569a818
DG
3724 responses:
3725 '200':
3726 description: successful operation
3e9e6f2f
RK
3727 content:
3728 application/json:
3729 schema:
3730 $ref: '#/components/schemas/VideoCommentThreadTree'
3f71c4c0 3731
3e9e6f2f 3732 '/videos/{id}/comments/{commentId}':
1569a818 3733 post:
b029d58a 3734 summary: Reply to a thread of a video
94ff4c23 3735 security:
3e9e6f2f 3736 - OAuth2: []
1569a818 3737 tags:
b029d58a 3738 - Video Comments
1569a818 3739 parameters:
cb9d028a 3740 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f 3741 - $ref: '#/components/parameters/commentId'
1569a818
DG
3742 responses:
3743 '200':
3744 description: successful operation
3e9e6f2f
RK
3745 content:
3746 application/json:
3747 schema:
3748 $ref: '#/components/schemas/CommentThreadPostResponse'
2c318664
RK
3749 '404':
3750 description: thread or video does not exist
98639806
C
3751 requestBody:
3752 content:
3753 application/json:
3754 schema:
3755 type: object
3756 properties:
3757 text:
bf3c3fea
RK
3758 allOf:
3759 - $ref: '#/components/schemas/VideoComment/properties/text'
3760 format: markdown
3761 maxLength: 10000
98639806
C
3762 required:
3763 - text
1569a818 3764 delete:
b029d58a 3765 summary: Delete a comment or a reply
94ff4c23 3766 security:
3e9e6f2f 3767 - OAuth2: []
1569a818 3768 tags:
b029d58a 3769 - Video Comments
1569a818 3770 parameters:
cb9d028a 3771 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f 3772 - $ref: '#/components/parameters/commentId'
1569a818
DG
3773 responses:
3774 '204':
c1843150 3775 description: successful operation
84f6e32c
RK
3776 '403':
3777 description: cannot remove comment of another user
3778 '404':
3779 description: comment or video does not exist
3780 '409':
3781 description: comment is already deleted
3f71c4c0 3782
3e9e6f2f 3783 '/videos/{id}/rate':
1569a818 3784 put:
b029d58a 3785 summary: Like/dislike a video
94ff4c23 3786 security:
3e9e6f2f 3787 - OAuth2: []
1569a818 3788 tags:
b029d58a 3789 - Video Rates
1569a818 3790 parameters:
cb9d028a 3791 - $ref: '#/components/parameters/idOrUUID'
4c440ced
RK
3792 requestBody:
3793 content:
3794 application/json:
3795 schema:
3796 type: object
3797 properties:
3798 rating:
3799 type: string
3800 enum:
3801 - like
3802 - dislike
9a320a06
RK
3803 required:
3804 - rating
1569a818 3805 responses:
ad5db104
C
3806 '204':
3807 description: successful operation
3808 '404':
3809 description: video does not exist
3810
3811 '/videos/{id}/hls':
3812 delete:
3813 summary: Delete video HLS files
3814 security:
3815 - OAuth2:
3816 - admin
3817 tags:
3818 - Video Files
3819 operationId: delVideoHLS
3820 parameters:
3821 - $ref: '#/components/parameters/idOrUUID'
3822 responses:
3823 '204':
3824 description: successful operation
3825 '404':
3826 description: video does not exist
3827 '/videos/{id}/webtorrent':
3828 delete:
3829 summary: Delete video WebTorrent files
3830 security:
3831 - OAuth2:
3832 - admin
3833 tags:
3834 - Video Files
3835 operationId: delVideoWebTorrent
3836 parameters:
3837 - $ref: '#/components/parameters/idOrUUID'
3838 responses:
3839 '204':
3840 description: successful operation
3841 '404':
3842 description: video does not exist
3843
3844 '/videos/{id}/transcoding':
3845 post:
3846 summary: Create a transcoding job
3847 security:
3848 - OAuth2:
3849 - admin
3850 tags:
3851 - Video Transcoding
3852 operationId: createVideoTranscoding
3853 parameters:
3854 - $ref: '#/components/parameters/idOrUUID'
3855 requestBody:
3856 content:
3857 application/json:
3858 schema:
3859 type: object
3860 properties:
3861 transcodingType:
3862 type: string
3863 enum:
3864 - hls
3865 - webtorrent
3866 required:
3867 - transcodingType
3868 responses:
1569a818 3869 '204':
c1843150 3870 description: successful operation
2c318664
RK
3871 '404':
3872 description: video does not exist
3f71c4c0 3873
fb72c193
DL
3874 /search/videos:
3875 get:
3876 tags:
3877 - Search
b029d58a 3878 summary: Search videos
e2adb8cb 3879 operationId: searchVideos
fb72c193 3880 parameters:
84f6e32c
RK
3881 - name: search
3882 in: query
3883 required: true
3884 allowEmptyValue: false
3885 description: >
3886 String to search. If the user can make a remote URI search, and the string is an URI then the
3887 PeerTube instance will fetch the remote object and add it to its database. Then,
3888 you can use the REST API to fetch the complete video information and interact with it.
3889 schema:
3890 type: string
59c794a5 3891 - $ref: '#/components/parameters/categoryOneOf'
1fd61899 3892 - $ref: '#/components/parameters/isLive'
59c794a5
C
3893 - $ref: '#/components/parameters/tagsOneOf'
3894 - $ref: '#/components/parameters/tagsAllOf'
3895 - $ref: '#/components/parameters/licenceOneOf'
3896 - $ref: '#/components/parameters/languageOneOf'
3897 - $ref: '#/components/parameters/nsfw'
2760b454
C
3898 - $ref: '#/components/parameters/isLocal'
3899 - $ref: '#/components/parameters/include'
527a52ac 3900 - $ref: '#/components/parameters/privacyOneOf'
d324756e
C
3901 - $ref: '#/components/parameters/hasHLSFiles'
3902 - $ref: '#/components/parameters/hasWebtorrentFiles'
59c794a5 3903 - $ref: '#/components/parameters/skipCount'
3e9e6f2f
RK
3904 - $ref: '#/components/parameters/start'
3905 - $ref: '#/components/parameters/count'
ad031145 3906 - $ref: '#/components/parameters/searchTarget'
fd5af7a2 3907 - $ref: '#/components/parameters/videosSearchSort'
ad031145
C
3908 - name: startDate
3909 in: query
ad031145
C
3910 description: Get videos that are published after this date
3911 schema:
3912 type: string
3913 format: date-time
3914 - name: endDate
3915 in: query
ad031145
C
3916 description: Get videos that are published before this date
3917 schema:
3918 type: string
3919 format: date-time
3920 - name: originallyPublishedStartDate
3921 in: query
ad031145 3922 description: Get videos that are originally published after this date
3e9e6f2f
RK
3923 schema:
3924 type: string
ad031145
C
3925 format: date-time
3926 - name: originallyPublishedEndDate
3927 in: query
ad031145
C
3928 description: Get videos that are originally published before this date
3929 schema:
3930 type: string
3931 format: date-time
3932 - name: durationMin
3933 in: query
ad031145
C
3934 description: Get videos that have this minimum duration
3935 schema:
06746a8b 3936 type: integer
ad031145
C
3937 - name: durationMax
3938 in: query
ad031145
C
3939 description: Get videos that have this maximum duration
3940 schema:
06746a8b 3941 type: integer
2c318664
RK
3942 callbacks:
3943 'searchTarget === search-index':
3944 $ref: '#/components/callbacks/searchIndex'
fb72c193
DL
3945 responses:
3946 '200':
3947 description: successful operation
3e9e6f2f
RK
3948 content:
3949 application/json:
3950 schema:
048b6946 3951 $ref: '#/components/schemas/VideoListResponse'
2c318664
RK
3952 '500':
3953 description: search index unavailable
3f71c4c0 3954
ad031145
C
3955 /search/video-channels:
3956 get:
3957 tags:
3958 - Search
3959 summary: Search channels
e2adb8cb 3960 operationId: searchChannels
ad031145 3961 parameters:
ad031145
C
3962 - name: search
3963 in: query
3964 required: true
3965 description: >
3966 String to search. If the user can make a remote URI search, and the string is an URI then the
3967 PeerTube instance will fetch the remote object and add it to its database. Then,
3968 you can use the REST API to fetch the complete channel information and interact with it.
3969 schema:
3970 type: string
84f6e32c
RK
3971 - $ref: '#/components/parameters/start'
3972 - $ref: '#/components/parameters/count'
3973 - $ref: '#/components/parameters/searchTarget'
3974 - $ref: '#/components/parameters/sort'
2c318664
RK
3975 callbacks:
3976 'searchTarget === search-index':
3977 $ref: '#/components/callbacks/searchIndex'
ad031145
C
3978 responses:
3979 '200':
3980 description: successful operation
3981 content:
3982 application/json:
3983 schema:
045bcd0d 3984 $ref: '#/components/schemas/VideoChannelList'
2c318664
RK
3985 '500':
3986 description: search index unavailable
37a44fc9
C
3987
3988 /search/video-playlists:
3989 get:
3990 tags:
3991 - Search
3992 summary: Search playlists
3993 operationId: searchPlaylists
3994 parameters:
3995 - name: search
3996 in: query
3997 required: true
3998 description: >
3999 String to search. If the user can make a remote URI search, and the string is an URI then the
4000 PeerTube instance will fetch the remote object and add it to its database. Then,
4001 you can use the REST API to fetch the complete playlist information and interact with it.
4002 schema:
4003 type: string
4004 - $ref: '#/components/parameters/start'
4005 - $ref: '#/components/parameters/count'
4006 - $ref: '#/components/parameters/searchTarget'
4007 - $ref: '#/components/parameters/sort'
4008 callbacks:
4009 'searchTarget === search-index':
4010 $ref: '#/components/callbacks/searchIndex'
4011 responses:
4012 '200':
4013 description: successful operation
4014 content:
4015 application/json:
4016 schema:
4017 type: object
4018 properties:
4019 total:
4020 type: integer
4021 example: 1
4022 data:
4023 type: array
4024 items:
4025 $ref: '#/components/schemas/VideoPlaylist'
4026 '500':
4027 description: search index unavailable
da35b419 4028
bdf70330
C
4029 /blocklist/status:
4030 get:
4031 tags:
4032 - Account Blocks
4033 - Server Blocks
4034 summary: Get block status of accounts/hosts
4035 parameters:
4036 -
4037 name: 'accounts'
4038 in: query
4039 description: 'Check if these accounts are blocked'
4040 example: [ 'goofy@example.com', 'donald@example.com' ]
4041 schema:
4042 type: array
4043 items:
4044 type: string
4045 -
4046 name: 'hosts'
4047 in: query
4048 description: 'Check if these hosts are blocked'
4049 example: [ 'example.com' ]
4050 schema:
4051 type: array
4052 items:
4053 type: string
4054 responses:
4055 '200':
4056 description: successful operation
4057 content:
4058 'application/json':
4059 schema:
4060 $ref: '#/components/schemas/BlockStatus'
4061
da35b419 4062 /server/blocklist/accounts:
06746a8b
RK
4063 get:
4064 tags:
4065 - Account Blocks
4066 summary: List account blocks
4067 security:
4068 - OAuth2:
4069 - admin
4070 parameters:
4071 - $ref: '#/components/parameters/start'
4072 - $ref: '#/components/parameters/count'
4073 - $ref: '#/components/parameters/sort'
4074 responses:
4075 '200':
4076 description: successful operation
4077 post:
4078 tags:
4079 - Account Blocks
4080 summary: Block an account
4081 security:
4082 - OAuth2:
4083 - admin
4084 requestBody:
4085 content:
4086 application/json:
4087 schema:
4088 type: object
4089 properties:
4090 accountName:
4091 type: string
84f6e32c 4092 example: chocobozzz@example.org
06746a8b
RK
4093 description: account to block, in the form `username@domain`
4094 required:
4095 - accountName
4096 responses:
4097 '200':
4098 description: successful operation
4099 '409':
4100 description: self-blocking forbidden
3f71c4c0 4101
da35b419 4102 '/server/blocklist/accounts/{accountName}':
06746a8b
RK
4103 delete:
4104 tags:
4105 - Account Blocks
4106 summary: Unblock an account by its handle
4107 security:
4108 - OAuth2:
4109 - admin
4110 parameters:
4111 - name: accountName
4112 in: path
4113 required: true
4114 description: account to unblock, in the form `username@domain`
4115 schema:
4116 type: string
4117 responses:
4118 '201':
4119 description: successful operation
4120 '404':
4121 description: account or account block does not exist
da35b419
RK
4122
4123 /server/blocklist/servers:
06746a8b
RK
4124 get:
4125 tags:
4126 - Server Blocks
4127 summary: List server blocks
4128 security:
4129 - OAuth2:
4130 - admin
4131 parameters:
4132 - $ref: '#/components/parameters/start'
4133 - $ref: '#/components/parameters/count'
4134 - $ref: '#/components/parameters/sort'
4135 responses:
4136 '200':
4137 description: successful operation
4138 post:
4139 tags:
4140 - Server Blocks
4141 summary: Block a server
4142 security:
4143 - OAuth2:
4144 - admin
4145 requestBody:
4146 content:
4147 application/json:
4148 schema:
4149 type: object
4150 properties:
84f6e32c 4151 host:
06746a8b 4152 type: string
84f6e32c 4153 format: hostname
06746a8b
RK
4154 description: server domain to block
4155 required:
84f6e32c 4156 - host
06746a8b 4157 responses:
ca98c8f8 4158 '204':
06746a8b
RK
4159 description: successful operation
4160 '409':
4161 description: self-blocking forbidden
3f71c4c0 4162
da35b419 4163 '/server/blocklist/servers/{host}':
06746a8b
RK
4164 delete:
4165 tags:
4166 - Server Blocks
4167 summary: Unblock a server by its domain
4168 security:
4169 - OAuth2:
4170 - admin
4171 parameters:
4172 - name: host
4173 in: path
4174 required: true
4175 description: server domain to unblock
4176 schema:
4177 type: string
84f6e32c 4178 format: hostname
06746a8b 4179 responses:
ca98c8f8 4180 '204':
06746a8b
RK
4181 description: successful operation
4182 '404':
4183 description: account block does not exist
da35b419 4184
a4ce4223 4185 /server/redundancy/{host}:
04b703f6
RK
4186 put:
4187 tags:
4188 - Instance Redundancy
4189 summary: Update a server redundancy policy
4190 security:
4191 - OAuth2:
4192 - admin
4193 parameters:
4194 - name: host
4195 in: path
4196 required: true
4197 description: server domain to mirror
4198 schema:
4199 type: string
84f6e32c 4200 format: hostname
04b703f6
RK
4201 requestBody:
4202 content:
4203 application/json:
4204 schema:
4205 type: object
4206 properties:
4207 redundancyAllowed:
4208 type: boolean
4209 description: allow mirroring of the host's local videos
4210 required:
4211 - redundancyAllowed
4212 responses:
4213 '204':
4214 description: successful operation
4215 '404':
4216 description: server is not already known
3f71c4c0 4217
a4ce4223 4218 /server/redundancy/videos:
04b703f6
RK
4219 get:
4220 tags:
4221 - Video Mirroring
4222 summary: List videos being mirrored
e2adb8cb 4223 operationId: getMirroredVideos
04b703f6
RK
4224 security:
4225 - OAuth2:
4226 - admin
4227 parameters:
4228 - name: target
4229 in: query
4230 required: true
4231 description: direction of the mirror
4232 schema:
4233 type: string
4234 enum:
4235 - my-videos
4236 - remote-videos
4237 - $ref: '#/components/parameters/start'
4238 - $ref: '#/components/parameters/count'
4239 - $ref: '#/components/parameters/videoRedundanciesSort'
4240 responses:
4241 '200':
4242 description: successful operation
4243 content:
4244 application/json:
4245 schema:
4246 type: array
4247 items:
4248 $ref: '#/components/schemas/VideoRedundancy'
4249 post:
4250 tags:
4251 - Video Mirroring
4252 summary: Mirror a video
e2adb8cb 4253 operationId: putMirroredVideo
04b703f6
RK
4254 security:
4255 - OAuth2:
4256 - admin
4257 requestBody:
4258 content:
4259 application/json:
4260 schema:
4261 type: object
4262 properties:
4263 videoId:
b8375da9 4264 $ref: '#/components/schemas/Video/properties/id'
04b703f6
RK
4265 required:
4266 - videoId
4267 responses:
4268 '204':
4269 description: successful operation
4270 '400':
4271 description: cannot mirror a local video
4272 '404':
4273 description: video does not exist
4274 '409':
4275 description: video is already mirrored
3f71c4c0 4276
a4ce4223 4277 /server/redundancy/videos/{redundancyId}:
04b703f6
RK
4278 delete:
4279 tags:
4280 - Video Mirroring
4281 summary: Delete a mirror done on a video
e2adb8cb 4282 operationId: delMirroredVideo
04b703f6
RK
4283 security:
4284 - OAuth2:
4285 - admin
4286 parameters:
4287 - name: redundancyId
4288 in: path
4289 required: true
4290 description: id of an existing redundancy on a video
4291 schema:
4292 type: string
4293 responses:
4294 '204':
4295 description: successful operation
4296 '404':
4297 description: video redundancy not found
da35b419 4298
b44b5a83
C
4299 /server/stats:
4300 get:
4301 tags:
4302 - Stats
4303 summary: Get instance stats
4304 description: Get instance public statistics. This endpoint is cached.
4305 operationId: getInstanceStats
4306 responses:
4307 '200':
4308 description: successful operation
4309 content:
4310 application/json:
4311 schema:
4312 $ref: '#/components/schemas/ServerStats'
4313
42b40636
C
4314 /server/logs/client:
4315 post:
4316 tags:
4317 - Logs
4318 summary: Send client log
4319 operationId: sendClientLog
4320 requestBody:
4321 content:
4322 application/json:
4323 schema:
4324 $ref: '#/components/schemas/SendClientLog'
4325 responses:
4326 '204':
4327 description: successful operation
4328
4329 /server/logs:
4330 get:
4331 tags:
4332 - Logs
4333 summary: Get instance logs
4334 operationId: getInstanceLogs
4335 security:
4336 - OAuth2:
4337 - admin
4338 responses:
4339 '200':
4340 description: successful operation
4341 content:
4342 application/json:
4343 schema:
4344 type: array
4345 items:
4346 type: string
4347
4348 /server/audit-logs:
4349 get:
4350 tags:
4351 - Logs
4352 summary: Get instance audit logs
4353 operationId: getInstanceAuditLogs
4354 security:
4355 - OAuth2:
4356 - admin
4357 responses:
4358 '200':
4359 description: successful operation
4360 content:
4361 application/json:
4362 schema:
4363 type: array
4364 items:
4365 type: string
b44b5a83 4366
06746a8b
RK
4367 '/feeds/video-comments.{format}':
4368 get:
4369 tags:
4370 - Feeds
4371 summary: List comments on videos
e2adb8cb 4372 operationId: getSyndicatedComments
06746a8b
RK
4373 parameters:
4374 - name: format
4375 in: path
4376 required: true
00494d6e 4377 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
06746a8b
RK
4378 schema:
4379 type: string
4380 enum:
4381 - xml
4382 - rss
4383 - rss2
4384 - atom
4385 - atom1
4386 - json
4387 - json1
4388 - name: videoId
d73810be 4389 in: query
06746a8b
RK
4390 description: 'limit listing to a specific video'
4391 schema:
4392 type: string
00494d6e
RK
4393 - name: accountId
4394 in: query
4395 description: 'limit listing to a specific account'
4396 schema:
4397 type: string
4398 - name: accountName
4399 in: query
4400 description: 'limit listing to a specific account'
4401 schema:
4402 type: string
4403 - name: videoChannelId
4404 in: query
4405 description: 'limit listing to a specific video channel'
4406 schema:
4407 type: string
4408 - name: videoChannelName
4409 in: query
4410 description: 'limit listing to a specific video channel'
4411 schema:
4412 type: string
06746a8b
RK
4413 responses:
4414 '204':
4415 description: successful operation
4416 headers:
4417 Cache-Control:
4418 schema:
4419 type: string
4420 default: 'max-age=900' # 15 min cache
4421 content:
4422 application/xml:
4423 schema:
4424 $ref: '#/components/schemas/VideoCommentsForXML'
64df4b65
RK
4425 examples:
4426 nightly:
4427 externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local
06746a8b
RK
4428 application/rss+xml:
4429 schema:
4430 $ref: '#/components/schemas/VideoCommentsForXML'
64df4b65
RK
4431 examples:
4432 nightly:
4433 externalValue: https://peertube2.cpy.re/feeds/video-comments.rss?filter=local
06746a8b
RK
4434 text/xml:
4435 schema:
4436 $ref: '#/components/schemas/VideoCommentsForXML'
64df4b65
RK
4437 examples:
4438 nightly:
4439 externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local
06746a8b
RK
4440 application/atom+xml:
4441 schema:
4442 $ref: '#/components/schemas/VideoCommentsForXML'
64df4b65
RK
4443 examples:
4444 nightly:
4445 externalValue: https://peertube2.cpy.re/feeds/video-comments.atom?filter=local
06746a8b
RK
4446 application/json:
4447 schema:
4448 type: object
64df4b65
RK
4449 examples:
4450 nightly:
4451 externalValue: https://peertube2.cpy.re/feeds/video-comments.json?filter=local
00494d6e
RK
4452 '400':
4453 x-summary: field inconsistencies
4454 description: >
4455 Arises when:
4456 - videoId filter is mixed with a channel filter
4457 '404':
4458 description: video, video channel or account not found
06746a8b
RK
4459 '406':
4460 description: accept header unsupported
3f71c4c0 4461
06746a8b
RK
4462 '/feeds/videos.{format}':
4463 get:
4464 tags:
4465 - Feeds
4466 summary: List videos
e2adb8cb 4467 operationId: getSyndicatedVideos
06746a8b
RK
4468 parameters:
4469 - name: format
4470 in: path
4471 required: true
00494d6e 4472 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
06746a8b
RK
4473 schema:
4474 type: string
4475 enum:
4476 - xml
4477 - rss
4478 - rss2
4479 - atom
4480 - atom1
4481 - json
4482 - json1
4483 - name: accountId
d73810be 4484 in: query
06746a8b
RK
4485 description: 'limit listing to a specific account'
4486 schema:
4487 type: string
4488 - name: accountName
d73810be 4489 in: query
06746a8b
RK
4490 description: 'limit listing to a specific account'
4491 schema:
4492 type: string
4493 - name: videoChannelId
d73810be 4494 in: query
06746a8b
RK
4495 description: 'limit listing to a specific video channel'
4496 schema:
4497 type: string
4498 - name: videoChannelName
d73810be 4499 in: query
06746a8b
RK
4500 description: 'limit listing to a specific video channel'
4501 schema:
4502 type: string
84f6e32c
RK
4503 - $ref: '#/components/parameters/sort'
4504 - $ref: '#/components/parameters/nsfw'
2760b454
C
4505 - $ref: '#/components/parameters/isLocal'
4506 - $ref: '#/components/parameters/include'
527a52ac 4507 - $ref: '#/components/parameters/privacyOneOf'
d324756e
C
4508 - $ref: '#/components/parameters/hasHLSFiles'
4509 - $ref: '#/components/parameters/hasWebtorrentFiles'
06746a8b
RK
4510 responses:
4511 '204':
4512 description: successful operation
4513 headers:
4514 Cache-Control:
4515 schema:
4516 type: string
4517 default: 'max-age=900' # 15 min cache
4518 content:
4519 application/xml:
4520 schema:
4521 $ref: '#/components/schemas/VideosForXML'
84f6e32c
RK
4522 examples:
4523 nightly:
4524 externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
06746a8b
RK
4525 application/rss+xml:
4526 schema:
4527 $ref: '#/components/schemas/VideosForXML'
64df4b65
RK
4528 examples:
4529 nightly:
4530 externalValue: https://peertube2.cpy.re/feeds/videos.rss?filter=local
06746a8b
RK
4531 text/xml:
4532 schema:
4533 $ref: '#/components/schemas/VideosForXML'
64df4b65
RK
4534 examples:
4535 nightly:
4536 externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
06746a8b
RK
4537 application/atom+xml:
4538 schema:
4539 $ref: '#/components/schemas/VideosForXML'
64df4b65
RK
4540 examples:
4541 nightly:
4542 externalValue: https://peertube2.cpy.re/feeds/videos.atom?filter=local
06746a8b
RK
4543 application/json:
4544 schema:
4545 type: object
64df4b65
RK
4546 examples:
4547 nightly:
4548 externalValue: https://peertube2.cpy.re/feeds/videos.json?filter=local
00494d6e
RK
4549 '404':
4550 description: video channel or account not found
06746a8b
RK
4551 '406':
4552 description: accept header unsupported
3f71c4c0 4553
64df4b65
RK
4554 '/feeds/subscriptions.{format}':
4555 get:
4556 tags:
4557 - Feeds
4558 - Account
4559 summary: List videos of subscriptions tied to a token
e2adb8cb 4560 operationId: getSyndicatedSubscriptionVideos
64df4b65
RK
4561 parameters:
4562 - name: format
4563 in: path
4564 required: true
4565 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
4566 schema:
4567 type: string
4568 enum:
4569 - xml
4570 - rss
4571 - rss2
4572 - atom
4573 - atom1
4574 - json
4575 - json1
4576 - name: accountId
4577 in: query
4578 description: limit listing to a specific account
4579 schema:
4580 type: string
4581 required: true
4582 - name: token
4583 in: query
4584 description: private token allowing access
4585 schema:
4586 type: string
4587 required: true
4588 - $ref: '#/components/parameters/sort'
4589 - $ref: '#/components/parameters/nsfw'
2760b454
C
4590 - $ref: '#/components/parameters/isLocal'
4591 - $ref: '#/components/parameters/include'
527a52ac 4592 - $ref: '#/components/parameters/privacyOneOf'
d324756e
C
4593 - $ref: '#/components/parameters/hasHLSFiles'
4594 - $ref: '#/components/parameters/hasWebtorrentFiles'
64df4b65
RK
4595 responses:
4596 '204':
4597 description: successful operation
4598 headers:
4599 Cache-Control:
4600 schema:
4601 type: string
4602 default: 'max-age=900' # 15 min cache
4603 content:
4604 application/xml:
4605 schema:
4606 $ref: '#/components/schemas/VideosForXML'
4607 application/rss+xml:
4608 schema:
4609 $ref: '#/components/schemas/VideosForXML'
4610 text/xml:
4611 schema:
4612 $ref: '#/components/schemas/VideosForXML'
4613 application/atom+xml:
4614 schema:
4615 $ref: '#/components/schemas/VideosForXML'
4616 application/json:
4617 schema:
4618 type: object
4619 '406':
4620 description: accept header unsupported
3f71c4c0 4621
7461d440
RK
4622 /plugins:
4623 get:
4624 tags:
4625 - Plugins
4626 summary: List plugins
e2adb8cb 4627 operationId: getPlugins
7461d440
RK
4628 security:
4629 - OAuth2:
4630 - admin
4631 parameters:
4632 - name: pluginType
4633 in: query
4634 schema:
4635 type: integer
4636 - name: uninstalled
4637 in: query
4638 schema:
4639 type: boolean
4640 - $ref: '#/components/parameters/start'
4641 - $ref: '#/components/parameters/count'
4642 - $ref: '#/components/parameters/sort'
4643 responses:
4644 '200':
4645 description: successful operation
4646 content:
4647 application/json:
4648 schema:
4649 $ref: '#/components/schemas/PluginResponse'
3f71c4c0 4650
7461d440
RK
4651 /plugins/available:
4652 get:
4653 tags:
4654 - Plugins
4655 summary: List available plugins
e2adb8cb 4656 operationId: getAvailablePlugins
7461d440
RK
4657 security:
4658 - OAuth2:
4659 - admin
4660 parameters:
4661 - name: search
4662 in: query
4663 schema:
4664 type: string
4665 - name: pluginType
4666 in: query
4667 schema:
4668 type: integer
4669 - name: currentPeerTubeEngine
4670 in: query
4671 schema:
4672 type: string
4673 - $ref: '#/components/parameters/start'
4674 - $ref: '#/components/parameters/count'
4675 - $ref: '#/components/parameters/sort'
4676 responses:
4677 '200':
4678 description: successful operation
4679 content:
4680 application/json:
4681 schema:
4682 $ref: '#/components/schemas/PluginResponse'
4683 '503':
4684 description: plugin index unavailable
3f71c4c0 4685
7461d440
RK
4686 /plugins/install:
4687 post:
4688 tags:
4689 - Plugins
4690 summary: Install a plugin
e2adb8cb 4691 operationId: addPlugin
7461d440
RK
4692 security:
4693 - OAuth2:
4694 - admin
4695 requestBody:
4696 content:
4697 application/json:
4698 schema:
4699 oneOf:
4700 - type: object
4701 properties:
4702 npmName:
4703 type: string
84f6e32c 4704 example: peertube-plugin-auth-ldap
7461d440
RK
4705 required:
4706 - npmName
4707 additionalProperties: false
4708 - type: object
4709 properties:
4710 path:
4711 type: string
4712 required:
4713 - path
4714 additionalProperties: false
4715 responses:
4716 '204':
4717 description: successful operation
4718 '400':
4719 description: should have either `npmName` or `path` set
3f71c4c0 4720
7461d440
RK
4721 /plugins/update:
4722 post:
4723 tags:
4724 - Plugins
4725 summary: Update a plugin
e2adb8cb 4726 operationId: updatePlugin
7461d440
RK
4727 security:
4728 - OAuth2:
4729 - admin
4730 requestBody:
4731 content:
4732 application/json:
4733 schema:
4734 oneOf:
4735 - type: object
4736 properties:
4737 npmName:
4738 type: string
84f6e32c 4739 example: peertube-plugin-auth-ldap
7461d440
RK
4740 required:
4741 - npmName
4742 additionalProperties: false
4743 - type: object
4744 properties:
4745 path:
4746 type: string
4747 required:
4748 - path
4749 additionalProperties: false
4750 responses:
4751 '204':
4752 description: successful operation
4753 '400':
4754 description: should have either `npmName` or `path` set
4755 '404':
4756 description: existing plugin not found
3f71c4c0 4757
7461d440
RK
4758 /plugins/uninstall:
4759 post:
4760 tags:
4761 - Plugins
4762 summary: Uninstall a plugin
e2adb8cb 4763 operationId: uninstallPlugin
7461d440
RK
4764 security:
4765 - OAuth2:
4766 - admin
4767 requestBody:
4768 content:
4769 application/json:
4770 schema:
4771 type: object
4772 properties:
4773 npmName:
4774 type: string
84f6e32c
RK
4775 description: name of the plugin/theme in its package.json
4776 example: peertube-plugin-auth-ldap
7461d440
RK
4777 required:
4778 - npmName
4779 responses:
4780 '204':
4781 description: successful operation
4782 '404':
4783 description: existing plugin not found
3f71c4c0 4784
7461d440
RK
4785 /plugins/{npmName}:
4786 get:
4787 tags:
4788 - Plugins
4789 summary: Get a plugin
e2adb8cb 4790 operationId: getPlugin
7461d440
RK
4791 security:
4792 - OAuth2:
4793 - admin
4794 parameters:
84f6e32c 4795 - $ref: '#/components/parameters/npmName'
7461d440
RK
4796 responses:
4797 '200':
4798 description: successful operation
4799 content:
4800 application/json:
4801 schema:
4802 $ref: '#/components/schemas/Plugin'
4803 '404':
4804 description: plugin not found
3f71c4c0 4805
7461d440
RK
4806 /plugins/{npmName}/settings:
4807 put:
4808 tags:
4809 - Plugins
4810 summary: Set a plugin's settings
4811 security:
4812 - OAuth2:
4813 - admin
4814 parameters:
84f6e32c 4815 - $ref: '#/components/parameters/npmName'
7461d440
RK
4816 requestBody:
4817 content:
4818 application/json:
4819 schema:
4820 type: object
4821 properties:
4822 settings:
4823 type: object
4824 additionalProperties: true
4825 responses:
4826 '204':
4827 description: successful operation
4828 '404':
4829 description: plugin not found
3f71c4c0 4830
7461d440
RK
4831 /plugins/{npmName}/public-settings:
4832 get:
4833 tags:
4834 - Plugins
4835 summary: Get a plugin's public settings
7461d440 4836 parameters:
84f6e32c 4837 - $ref: '#/components/parameters/npmName'
7461d440
RK
4838 responses:
4839 '200':
4840 description: successful operation
4841 content:
4842 application/json:
4843 schema:
4844 type: object
4845 additionalProperties: true
4846 '404':
4847 description: plugin not found
3f71c4c0 4848
7461d440
RK
4849 /plugins/{npmName}/registered-settings:
4850 get:
4851 tags:
4852 - Plugins
4853 summary: Get a plugin's registered settings
4854 security:
4855 - OAuth2:
4856 - admin
4857 parameters:
84f6e32c 4858 - $ref: '#/components/parameters/npmName'
7461d440
RK
4859 responses:
4860 '200':
4861 description: successful operation
4862 content:
4863 application/json:
4864 schema:
4865 type: object
4866 additionalProperties: true
4867 '404':
4868 description: plugin not found
3f71c4c0 4869
3e9e6f2f 4870servers:
8f9e8be1 4871 - url: 'https://peertube2.cpy.re/api/v1'
f4d59981 4872 description: Live Test Server (live data - latest nightly version)
6441981b 4873 - url: 'https://peertube3.cpy.re/api/v1'
b029d58a 4874 description: Live Test Server (live data - latest RC version)
f4d59981
RK
4875 - url: 'https://peertube.cpy.re/api/v1'
4876 description: Live Test Server (live data - stable version)
3e9e6f2f
RK
4877components:
4878 parameters:
4879 start:
4880 name: start
4881 in: query
4882 required: false
06746a8b 4883 description: Offset used to paginate results
3e9e6f2f 4884 schema:
06746a8b 4885 type: integer
84f6e32c 4886 minimum: 0
3e9e6f2f
RK
4887 count:
4888 name: count
4889 in: query
4890 required: false
06746a8b 4891 description: "Number of items to return"
3e9e6f2f 4892 schema:
06746a8b 4893 type: integer
84f6e32c 4894 default: 15
06746a8b
RK
4895 maximum: 100
4896 minimum: 1
3e9e6f2f
RK
4897 sort:
4898 name: sort
4899 in: query
4900 required: false
84f6e32c 4901 description: Sort column
3e9e6f2f
RK
4902 schema:
4903 type: string
84f6e32c 4904 example: -createdAt
8491293b
RK
4905 search:
4906 name: search
4907 in: query
4908 required: false
4909 description: Plain text search, applied to various parts of the model depending on endpoint
4910 schema:
4911 type: string
ad031145
C
4912 searchTarget:
4913 name: searchTarget
4914 in: query
4915 required: false
4916 description: >
4917 If the administrator enabled search index support, you can override the default search target.
4918
4919
4920 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
84f6e32c 4921 It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
ad031145
C
4922 * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
4923 then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
4924 After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
84f6e32c 4925 * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch
ad031145
C
4926 the data from the origin instance API
4927 schema:
4928 type: string
4929 enum:
4930 - 'local'
4931 - 'search-index'
fd5af7a2
RK
4932 videosSort:
4933 name: sort
4934 in: query
4935 required: false
fd5af7a2
RK
4936 schema:
4937 type: string
4938 enum:
d09ed46e
C
4939 - name
4940 - -duration
4941 - -createdAt
4942 - -publishedAt
4943 - -views
4944 - -likes
4945 - -trending
4946 - -hot
4947 - -best
4948 description: >
4949 Sort videos by criteria (prefixing with `-` means `DESC` order):
4950 * `hot` - Adaptation of Reddit "hot" algorithm taking into account video views, likes, dislikes and comments and publication date
4951 * `best` - Same than `hot`, but also takes into account user video history
4952 * `trending` - Sort videos by recent views ("recent" is defined by the admin)
4953 * `views` - Sort videos using their `views` counter
4954 * `publishedAt` - Sort by video publication date (when it became publicly available)
fd5af7a2
RK
4955 videosSearchSort:
4956 name: sort
4957 in: query
4958 required: false
d09ed46e
C
4959 description: >
4960 Sort videos by criteria (prefixing with `-` means `DESC` order):
fd5af7a2
RK
4961 schema:
4962 type: string
4963 enum:
04b703f6 4964 - name
fd5af7a2
RK
4965 - -duration
4966 - -createdAt
4967 - -publishedAt
4968 - -views
4969 - -likes
4970 - -match
71810d0b
RK
4971 commentsSort:
4972 name: sort
4973 in: query
4974 required: false
4975 description: Sort comments by criteria
4976 schema:
4977 type: string
4978 enum:
4979 - -createdAt
4980 - -totalReplies
fd5af7a2
RK
4981 blacklistsSort:
4982 name: sort
4983 in: query
4984 required: false
c756bae0 4985 description: Sort blocklists by criteria
fd5af7a2
RK
4986 schema:
4987 type: string
4988 enum:
4989 - -id
04b703f6 4990 - name
fd5af7a2
RK
4991 - -duration
4992 - -views
4993 - -likes
4994 - -dislikes
4995 - -uuid
4996 - -createdAt
8491293b
RK
4997 usersSearch:
4998 name: search
4999 in: query
5000 required: false
5001 description: Plain text search that will match with user usernames or emails
5002 schema:
5003 type: string
5004 usersBlocked:
5005 name: blocked
5006 in: query
5007 required: false
5008 description: Filter results down to (un)banned users
5009 schema:
5010 type: boolean
fd5af7a2
RK
5011 usersSort:
5012 name: sort
5013 in: query
5014 required: false
5015 description: Sort users by criteria
5016 schema:
5017 type: string
5018 enum:
5019 - -id
5020 - -username
5021 - -createdAt
5022 abusesSort:
5023 name: sort
5024 in: query
5025 required: false
5026 description: Sort abuses by criteria
5027 schema:
5028 type: string
5029 enum:
5030 - -id
5031 - -createdAt
5032 - -state
04b703f6
RK
5033 videoRedundanciesSort:
5034 name: sort
5035 in: query
5036 required: false
5037 description: Sort abuses by criteria
5038 schema:
5039 type: string
5040 enum:
5041 - name
906f46d0
C
5042 followersSort:
5043 name: sort
5044 in: query
5045 required: false
5046 description: Sort followers by criteria
5047 schema:
5048 type: string
5049 enum:
5050 - createdAt
3e9e6f2f
RK
5051 name:
5052 name: name
5053 in: path
5054 required: true
f2eb23cd 5055 description: The username or handle of the account
3e9e6f2f
RK
5056 schema:
5057 type: string
84f6e32c 5058 example: chocobozzz | chocobozzz@example.org
3e9e6f2f
RK
5059 id:
5060 name: id
5061 in: path
5062 required: true
419b520c 5063 description: Entity id
3e9e6f2f 5064 schema:
b8375da9 5065 $ref: '#/components/schemas/id'
cb9d028a 5066 idOrUUID:
3e9e6f2f
RK
5067 name: id
5068 in: path
5069 required: true
d4a8e7a6 5070 description: The object id, uuid or short uuid
3e9e6f2f 5071 schema:
84f6e32c 5072 oneOf:
b8375da9 5073 - $ref: '#/components/schemas/id'
f880a5e7 5074 - $ref: '#/components/schemas/UUIDv4'
d4a8e7a6 5075 - $ref: '#/components/schemas/shortUUID'
c00100b6
RK
5076 playlistId:
5077 name: playlistId
5078 in: path
5079 required: true
5080 description: Playlist id
5081 schema:
5082 $ref: '#/components/schemas/VideoPlaylist/properties/id'
c1843150
C
5083 playlistElementId:
5084 name: playlistElementId
5085 in: path
5086 required: true
5087 description: Playlist element id
5088 schema:
b8375da9 5089 $ref: '#/components/schemas/id'
50e16ccf
C
5090 abuseId:
5091 name: abuseId
5092 in: path
5093 required: true
310b5219 5094 description: Abuse id
50e16ccf 5095 schema:
b8375da9 5096 $ref: '#/components/schemas/Abuse/properties/id'
668b7f09
C
5097 abuseMessageId:
5098 name: abuseMessageId
5099 in: path
5100 required: true
5101 description: Abuse message id
5102 schema:
b8375da9 5103 $ref: '#/components/schemas/AbuseMessage/properties/id'
67ae04a5
C
5104 captionLanguage:
5105 name: captionLanguage
5106 in: path
5107 required: true
5108 description: The caption language
5109 schema:
b8375da9 5110 $ref: '#/components/schemas/VideoLanguageSet'
9ce3d302
C
5111 channelHandle:
5112 name: channelHandle
3e9e6f2f
RK
5113 in: path
5114 required: true
84f6e32c 5115 description: The video channel handle
3e9e6f2f
RK
5116 schema:
5117 type: string
84f6e32c 5118 example: my_username | my_username@example.com
cb9d028a
C
5119 subscriptionHandle:
5120 name: subscriptionHandle
5121 in: path
5122 required: true
84f6e32c 5123 description: The subscription handle
cb9d028a
C
5124 schema:
5125 type: string
84f6e32c 5126 example: my_username | my_username@example.com
cb9d028a 5127 threadId:
3e9e6f2f
RK
5128 name: threadId
5129 in: path
5130 required: true
cb9d028a
C
5131 description: The thread id (root comment id)
5132 schema:
85a60d8b 5133 type: integer
cb9d028a
C
5134 commentId:
5135 name: commentId
5136 in: path
5137 required: true
3e9e6f2f
RK
5138 description: The comment id
5139 schema:
b8375da9 5140 $ref: '#/components/schemas/VideoComment/properties/id'
1fd61899
C
5141 isLive:
5142 name: isLive
5143 in: query
5144 required: false
5145 description: whether or not the video is a live
5146 schema:
5147 type: boolean
fd5af7a2
RK
5148 categoryOneOf:
5149 name: categoryOneOf
5150 in: query
5151 required: false
40cfb36b 5152 description: category id of the video (see [/videos/categories](#operation/getCategories))
fd5af7a2
RK
5153 schema:
5154 oneOf:
b8375da9 5155 - $ref: '#/components/schemas/VideoCategorySet'
fd5af7a2
RK
5156 - type: array
5157 items:
b8375da9 5158 $ref: '#/components/schemas/VideoCategorySet'
2beb9895
RK
5159 style: form
5160 explode: false
fd5af7a2
RK
5161 tagsOneOf:
5162 name: tagsOneOf
5163 in: query
5164 required: false
5165 description: tag(s) of the video
5166 schema:
5167 oneOf:
5168 - type: string
5169 - type: array
f6d6e7f8 5170 maxItems: 5
fd5af7a2
RK
5171 items:
5172 type: string
2beb9895
RK
5173 style: form
5174 explode: false
fd5af7a2
RK
5175 tagsAllOf:
5176 name: tagsAllOf
5177 in: query
5178 required: false
5179 description: tag(s) of the video, where all should be present in the video
5180 schema:
5181 oneOf:
5182 - type: string
5183 - type: array
5184 items:
5185 type: string
2beb9895
RK
5186 style: form
5187 explode: false
fd5af7a2
RK
5188 languageOneOf:
5189 name: languageOneOf
5190 in: query
5191 required: false
40cfb36b 5192 description: language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language
fd5af7a2
RK
5193 schema:
5194 oneOf:
b8375da9 5195 - $ref: '#/components/schemas/VideoLanguageSet'
fd5af7a2
RK
5196 - type: array
5197 items:
b8375da9 5198 $ref: '#/components/schemas/VideoLanguageSet'
2beb9895
RK
5199 style: form
5200 explode: false
fd5af7a2
RK
5201 licenceOneOf:
5202 name: licenceOneOf
5203 in: query
5204 required: false
40cfb36b 5205 description: licence id of the video (see [/videos/licences](#operation/getLicences))
fd5af7a2
RK
5206 schema:
5207 oneOf:
b8375da9 5208 - $ref: '#/components/schemas/VideoLicenceSet'
fd5af7a2
RK
5209 - type: array
5210 items:
b8375da9 5211 $ref: '#/components/schemas/VideoLicenceSet'
2beb9895
RK
5212 style: form
5213 explode: false
59c794a5
C
5214 skipCount:
5215 name: skipCount
5216 in: query
5217 required: false
5218 description: if you don't need the `total` in the response
5219 schema:
5220 type: string
5221 enum:
5222 - 'true'
5223 - 'false'
06746a8b 5224 default: 'false'
fd5af7a2
RK
5225 nsfw:
5226 name: nsfw
5227 in: query
5228 required: false
5229 description: whether to include nsfw videos, if any
5230 schema:
5231 type: string
5232 enum:
5233 - 'true'
5234 - 'false'
2760b454
C
5235 isLocal:
5236 name: isLocal
fd5af7a2
RK
5237 in: query
5238 required: false
fd5af7a2 5239 schema:
2760b454 5240 type: boolean
7e7d8e48 5241 description: '**PeerTube >= 4.0** Display only local or remote videos'
d324756e
C
5242 hasHLSFiles:
5243 name: hasHLSFiles
5244 in: query
5245 required: false
5246 schema:
5247 type: boolean
5248 description: '**PeerTube >= 4.0** Display only videos that have HLS files'
5249 hasWebtorrentFiles:
5250 name: hasWebtorrentFiles
5251 in: query
5252 required: false
5253 schema:
5254 type: boolean
5255 description: '**PeerTube >= 4.0** Display only videos that have WebTorrent files'
527a52ac
C
5256 privacyOneOf:
5257 name: privacyOneOf
5258 in: query
5259 required: false
5260 schema:
5261 $ref: '#/components/schemas/VideoPrivacySet'
5262 description: '**PeerTube >= 4.0** Display only videos in this specific privacy/privacies'
2760b454
C
5263 include:
5264 name: include
5265 in: query
5266 required: false
5267 schema:
5268 type: integer
fd5af7a2 5269 enum:
2760b454
C
5270 - 0
5271 - 1
5272 - 2
5273 - 4
5274 - 8
5275 description: >
7e7d8e48 5276 **PeerTube >= 4.0** Include additional videos in results (can be combined using bitwise or operator)
2760b454
C
5277
5278 - `0` NONE
5279
5280 - `1` NOT_PUBLISHED_STATE
5281
527a52ac 5282 - `2` BLACKLISTED
2760b454 5283
527a52ac 5284 - `4` BLOCKED_OWNER
2760b454 5285
527a52ac 5286 - `8` FILES
e76d5784
RK
5287 subscriptionsUris:
5288 name: uris
5289 in: query
5290 required: true
5291 description: list of uris to check if each is part of the user subscriptions
5292 schema:
5293 type: array
5294 items:
5295 type: string
84f6e32c
RK
5296 format: uri
5297 npmName:
5298 name: npmName
5299 in: path
5300 required: true
5301 description: name of the plugin/theme on npmjs.com or in its package.json
5302 schema:
5303 type: string
5304 example: peertube-plugin-auth-ldap
040d6896
RK
5305 jobType:
5306 name: jobType
5307 in: query
5308 required: false
5309 description: job type
5310 schema:
5311 type: string
5312 enum:
5313 - activitypub-follow
5314 - activitypub-http-broadcast
5315 - activitypub-http-fetcher
5316 - activitypub-http-unicast
5317 - email
5318 - video-transcoding
5319 - video-file-import
5320 - video-import
51353d9a 5321 - videos-views-stats
040d6896
RK
5322 - activitypub-refresher
5323 - video-redundancy
5324 - video-live-ending
06dc7a1b
RK
5325 followState:
5326 name: state
5327 in: query
5328 schema:
5329 type: string
5330 enum:
5331 - pending
5332 - accepted
5333 actorType:
5334 name: actorType
5335 in: query
5336 schema:
5337 type: string
5338 enum:
5339 - Person
5340 - Application
5341 - Group
5342 - Service
5343 - Organization
3e9e6f2f
RK
5344 securitySchemes:
5345 OAuth2:
3c5e02f3 5346 description: |
3e9e6f2f 5347 Authenticating via OAuth requires the following steps:
3c5e02f3 5348 - Have an activated account
e2464d22
RK
5349 - [Generate] an access token for that account at `/api/v1/users/token`.
5350 - Make requests with the *Authorization: Bearer <token\>* header
3c5e02f3 5351 - Profit, depending on the role assigned to the account
3e9e6f2f 5352
e2464d22 5353 Note that the __access token is valid for 1 day__ and is given
3c5e02f3 5354 along with a __refresh token valid for 2 weeks__.
e2464d22
RK
5355
5356 [Generate]: https://docs.joinpeertube.org/api-rest-getting-started
3e9e6f2f
RK
5357 type: oauth2
5358 flows:
5359 password:
e2464d22 5360 tokenUrl: /api/v1/users/token
3e9e6f2f
RK
5361 scopes:
5362 admin: Admin scope
5363 moderator: Moderator scope
5364 user: User scope
5365 schemas:
7a4fd56c 5366 # Reusable core properties
b8375da9
RK
5367 id:
5368 type: integer
5369 minimum: 1
5370 example: 42
f880a5e7
RK
5371 UUIDv4:
5372 type: string
5373 format: uuid
5374 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
5375 pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
f880a5e7
RK
5376 minLength: 36
5377 maxLength: 36
d4a8e7a6
C
5378 shortUUID:
5379 type: string
5380 description: translation of a uuid v4 with a bigger alphabet to have a shorter uuid
5381 example: 2y84q2MQUMWPbiEcxNXMgC
b8375da9
RK
5382 username:
5383 type: string
77b0c6b5 5384 description: immutable name of the user, used to find or mention its actor
b8375da9 5385 example: chocobozzz
e2464d22 5386 pattern: '/^[a-z0-9._]+$/'
b8375da9
RK
5387 minLength: 1
5388 maxLength: 50
5389 usernameChannel:
5390 type: string
77b0c6b5 5391 description: immutable name of the channel, used to interact with its actor
9a320a06 5392 example: framasoft_videos
e2464d22
RK
5393 pattern: '/^[a-zA-Z0-9\\-_.:]+$/'
5394 minLength: 1
5395 maxLength: 50
b8375da9
RK
5396 password:
5397 type: string
5398 format: password
b8375da9
RK
5399 minLength: 6
5400 maxLength: 255
f880a5e7 5401
40cfb36b
RK
5402 VideoCategorySet:
5403 type: integer
5404 description: category id of the video (see [/videos/categories](#operation/getCategories))
b8375da9 5405 example: 15
dfcb6f50 5406 VideoConstantNumber-Category:
3e9e6f2f
RK
5407 properties:
5408 id:
40cfb36b 5409 $ref: '#/components/schemas/VideoCategorySet'
3e9e6f2f
RK
5410 label:
5411 type: string
b8375da9 5412 example: Science & Technology
40cfb36b
RK
5413
5414 VideoLicenceSet:
5415 type: integer
5416 description: licence id of the video (see [/videos/licences](#operation/getLicences))
b8375da9 5417 example: 2
dfcb6f50
RK
5418 VideoConstantNumber-Licence:
5419 properties:
5420 id:
40cfb36b 5421 $ref: '#/components/schemas/VideoLicenceSet'
dfcb6f50
RK
5422 label:
5423 type: string
b8375da9
RK
5424 example: Attribution - Share Alike
5425
40cfb36b
RK
5426 VideoLanguageSet:
5427 type: string
5428 description: language id of the video (see [/videos/languages](#operation/getLanguages))
b8375da9 5429 example: en
dfcb6f50 5430 VideoConstantString-Language:
3e9e6f2f
RK
5431 properties:
5432 id:
40cfb36b 5433 $ref: '#/components/schemas/VideoLanguageSet'
3e9e6f2f
RK
5434 label:
5435 type: string
b8375da9 5436 example: English
c1843150
C
5437
5438 VideoPlaylistPrivacySet:
5439 type: integer
5440 enum:
5441 - 1
5442 - 2
5443 - 3
40cfb36b 5444 description: Video playlist privacy policy (see [/video-playlists/privacies])
c1843150
C
5445 VideoPlaylistPrivacyConstant:
5446 properties:
5447 id:
5448 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
5449 label:
5450 type: string
5451
5452 VideoPlaylistTypeSet:
5453 type: integer
5454 enum:
5455 - 1
5456 - 2
40cfb36b 5457 description: The video playlist type (Regular = `1`, Watch Later = `2`)
c1843150
C
5458 VideoPlaylistTypeConstant:
5459 properties:
5460 id:
5461 $ref: '#/components/schemas/VideoPlaylistTypeSet'
5462 label:
5463 type: string
5464
ee89e8fd
C
5465 VideoPrivacySet:
5466 type: integer
3e9e6f2f 5467 enum:
ee89e8fd
C
5468 - 1
5469 - 2
5470 - 3
c1843150 5471 - 4
40cfb36b 5472 description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies))
ee89e8fd
C
5473 VideoPrivacyConstant:
5474 properties:
5475 id:
c1843150 5476 $ref: '#/components/schemas/VideoPrivacySet'
ee89e8fd
C
5477 label:
5478 type: string
50e16ccf 5479
bdf70330
C
5480 BlockStatus:
5481 properties:
5482 accounts:
5483 type: object
5484 additionalProperties:
5485 x-additionalPropertiesName: account
5486 type: object
5487 properties:
5488 blockedByServer:
5489 type: boolean
5490 blockedByUser:
5491 type: boolean
5492 hosts:
5493 type: object
5494 additionalProperties:
5495 x-additionalPropertiesName: host
5496 type: object
5497 properties:
5498 blockedByServer:
5499 type: boolean
5500 blockedByUser:
5501 type: boolean
5502
0590bb46
C
5503 NSFWPolicy:
5504 type: string
5505 enum:
5506 - display
5507 - blur
5508 - do_not_list
5509
5510 UserRole:
06746a8b 5511 type: integer
0590bb46
C
5512 enum:
5513 - 0
5514 - 1
5515 - 2
06746a8b 5516 description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
2c318664 5517 example: 2
6d989edc
C
5518 UserAdminFlags:
5519 type: integer
5520 enum:
5521 - 0
5522 - 1
c756bae0 5523 description: 'Admin flags for the user (None = `0`, Bypass video blocklist = `1`)'
6d989edc 5524 example: 1
0590bb46 5525
f443a746
C
5526 LiveVideoLatencyMode:
5527 type: integer
5528 enum:
5529 - 1
5530 - 2
5531 - 3
7a4fd56c 5532 description: 'The live latency mode (Default = `1`, High latency = `2`, Small Latency = `3`)'
f443a746 5533
5dce26d2
C
5534 VideoStateConstant:
5535 properties:
5536 id:
5537 type: integer
5538 enum:
5539 - 1
5540 - 2
5541 - 3
acc6a1cb
C
5542 - 4
5543 - 5
5544 - 6
5545 - 7
5546 - 8
5547 - 9
5548 description: |
5549 The video state:
5550 - `1`: Published
5551 - `2`: To transcode
5552 - `3`: To import
5553 - `4`: Waiting for live stream
5554 - `5`: Live ended
5555 - `6`: To move to an external storage (object storage...)
5556 - `7`: Transcoding failed
5557 - `8`: Moving to an external storage failed
5558 - `9`: To edit using studio edition feature
5dce26d2
C
5559 label:
5560 type: string
50e16ccf 5561
4f32032f 5562 AbuseStateSet:
50e16ccf
C
5563 type: integer
5564 enum:
5565 - 1
5566 - 2
5567 - 3
668b7f09 5568 description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)'
4f32032f 5569 AbuseStateConstant:
50e16ccf
C
5570 properties:
5571 id:
4f32032f 5572 $ref: '#/components/schemas/AbuseStateSet'
50e16ccf
C
5573 label:
5574 type: string
4f32032f 5575 AbusePredefinedReasons:
1ebddadd
RK
5576 type: array
5577 items:
5578 type: string
5579 enum:
5580 - violentOrAbusive
5581 - hatefulOrAbusive
5582 - spamOrMisleading
5583 - privacy
5584 - rights
5585 - serverRules
5586 - thumbnails
5587 - captions
84f6e32c 5588 example: [spamOrMisleading]
50e16ccf 5589
40cfb36b
RK
5590 VideoResolutionSet:
5591 type: integer
5592 description: |
5593 Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`)
5594
5595 `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos.
5596 example: 240
5dce26d2 5597 VideoResolutionConstant:
2c4876f2 5598 description: resolutions and their labels for the video
5dce26d2
C
5599 properties:
5600 id:
40cfb36b 5601 $ref: '#/components/schemas/VideoResolutionSet'
5dce26d2
C
5602 label:
5603 type: string
84f6e32c 5604 example: 240p
5dce26d2
C
5605 VideoScheduledUpdate:
5606 properties:
5607 privacy:
5608 $ref: '#/components/schemas/VideoPrivacySet'
5dce26d2
C
5609 updateAt:
5610 type: string
5611 format: date
5612 description: When to update the video
5613 required:
5614 - updateAt
c1843150 5615 AccountSummary:
5dce26d2
C
5616 properties:
5617 id:
06746a8b 5618 type: integer
5dce26d2
C
5619 name:
5620 type: string
5621 displayName:
5622 type: string
5623 url:
5624 type: string
84f6e32c 5625 format: url
5dce26d2
C
5626 host:
5627 type: string
84f6e32c 5628 format: hostname
d0800f76 5629 avatars:
5630 type: array
5631 items:
5632 $ref: '#/components/schemas/ActorImage'
5dce26d2
C
5633 VideoChannelSummary:
5634 properties:
5635 id:
b8375da9 5636 $ref: '#/components/schemas/id'
5dce26d2
C
5637 name:
5638 type: string
5639 displayName:
5640 type: string
5641 url:
5642 type: string
84f6e32c 5643 format: url
5dce26d2
C
5644 host:
5645 type: string
84f6e32c 5646 format: hostname
d0800f76 5647 avatars:
5648 type: array
5649 items:
5650 $ref: '#/components/schemas/ActorImage'
5dce26d2
C
5651 PlaylistElement:
5652 properties:
5653 position:
06746a8b 5654 type: integer
5dce26d2 5655 startTimestamp:
06746a8b 5656 type: integer
c00100b6 5657 format: seconds
5dce26d2 5658 stopTimestamp:
06746a8b 5659 type: integer
c00100b6 5660 format: seconds
bfbd9128
C
5661 video:
5662 nullable: true
c1843150
C
5663 allOf:
5664 - $ref: '#/components/schemas/Video'
5dce26d2 5665 VideoFile:
2c4876f2 5666 readOnly: true
5dce26d2 5667 properties:
12d84abe
C
5668 id:
5669 $ref: '#/components/schemas/id'
5dce26d2
C
5670 magnetUri:
5671 type: string
2c4876f2
RK
5672 format: uri
5673 description: magnet URI allowing to resolve the video via BitTorrent without a metainfo file
2c4876f2 5674 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
5dce26d2
C
5675 resolution:
5676 $ref: '#/components/schemas/VideoResolutionConstant'
5677 size:
06746a8b 5678 type: integer
2c4876f2 5679 description: Video file size in bytes
5dce26d2
C
5680 torrentUrl:
5681 type: string
e81af300 5682 description: Direct URL of the torrent file
84f6e32c 5683 format: url
0ad45af7 5684 torrentDownloadUrl:
5dce26d2 5685 type: string
e81af300 5686 description: URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog)
84f6e32c 5687 format: url
5dce26d2
C
5688 fileUrl:
5689 type: string
e81af300 5690 description: Direct URL of the video
84f6e32c 5691 format: url
5dce26d2
C
5692 fileDownloadUrl:
5693 type: string
e81af300 5694 description: URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog)
84f6e32c 5695 format: url
5dce26d2
C
5696 fps:
5697 type: number
2c4876f2 5698 description: Frames per second of the video file
63748ad0
C
5699 metadataUrl:
5700 type: string
84f6e32c 5701 format: url
2c4876f2 5702 description: URL dereferencing the output of ffprobe on the file
5dce26d2 5703 VideoStreamingPlaylists:
4ca669e3
RK
5704 allOf:
5705 - type: object
5706 properties:
5707 id:
b8375da9 5708 $ref: '#/components/schemas/id'
4ca669e3
RK
5709 type:
5710 type: integer
5711 enum:
5712 - 1
5713 description: |
5714 Playlist type:
5715 - `1`: HLS
5716 - $ref: '#/components/schemas/VideoStreamingPlaylists-HLS'
5717 VideoStreamingPlaylists-HLS:
5dce26d2 5718 properties:
5dce26d2
C
5719 playlistUrl:
5720 type: string
84f6e32c 5721 format: url
5dce26d2
C
5722 segmentsSha256Url:
5723 type: string
84f6e32c 5724 format: url
63748ad0
C
5725 files:
5726 type: array
c540d865
RK
5727 description: |
5728 Video files associated to this playlist.
5729
5730 The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.)
63748ad0
C
5731 items:
5732 $ref: '#/components/schemas/VideoFile'
5dce26d2
C
5733 redundancies:
5734 type: array
5735 items:
5736 type: object
5737 properties:
5738 baseUrl:
5739 type: string
84f6e32c 5740 format: url
f4d59981
RK
5741 VideoInfo:
5742 properties:
5743 id:
b8375da9 5744 $ref: '#/components/schemas/Video/properties/id'
f4d59981 5745 uuid:
b8375da9 5746 $ref: '#/components/schemas/Video/properties/uuid'
f4d59981 5747 name:
b8375da9 5748 $ref: '#/components/schemas/Video/properties/name'
3e9e6f2f
RK
5749 Video:
5750 properties:
5751 id:
b8375da9
RK
5752 description: object id for the video
5753 allOf:
5754 - $ref: '#/components/schemas/id'
3e9e6f2f 5755 uuid:
b8375da9
RK
5756 description: universal identifier for the video, that can be used across instances
5757 allOf:
5758 - $ref: '#/components/schemas/UUIDv4'
d4a8e7a6
C
5759 shortUUID:
5760 allOf:
5761 - $ref: '#/components/schemas/shortUUID'
4e239e35
C
5762 isLive:
5763 type: boolean
3e9e6f2f
RK
5764 createdAt:
5765 type: string
84f6e32c 5766 format: date-time
0c114568
RK
5767 example: 2017-10-01T10:52:46.396Z
5768 description: time at which the video object was first drafted
3e9e6f2f
RK
5769 publishedAt:
5770 type: string
84f6e32c 5771 format: date-time
0c114568
RK
5772 example: 2018-10-01T10:52:46.396Z
5773 description: time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution.
3e9e6f2f
RK
5774 updatedAt:
5775 type: string
84f6e32c 5776 format: date-time
0c114568
RK
5777 example: 2021-05-04T08:01:01.502Z
5778 description: last time the video's metadata was modified
5dce26d2
C
5779 originallyPublishedAt:
5780 type: string
84f6e32c 5781 format: date-time
0c114568
RK
5782 example: 2010-10-01T10:52:46.396Z
5783 description: used to represent a date of first publication, prior to the practical publication date of `publishedAt`
3e9e6f2f 5784 category:
b8375da9
RK
5785 allOf:
5786 - $ref: '#/components/schemas/VideoConstantNumber-Category'
5787 description: category in which the video is classified
3e9e6f2f 5788 licence:
b8375da9
RK
5789 allOf:
5790 - $ref: '#/components/schemas/VideoConstantNumber-Licence'
5791 description: licence under which the video is distributed
3e9e6f2f 5792 language:
b8375da9
RK
5793 allOf:
5794 - $ref: '#/components/schemas/VideoConstantString-Language'
5795 description: main language used in the video
3e9e6f2f 5796 privacy:
b8375da9
RK
5797 allOf:
5798 - $ref: '#/components/schemas/VideoPrivacyConstant'
5799 description: privacy policy used to distribute the video
3e9e6f2f
RK
5800 description:
5801 type: string
0c114568
RK
5802 example: |
5803 **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n
5804 **Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network, based on fr...
5805 minLength: 3
5806 maxLength: 250
5807 description: |
5808 truncated description of the video, written in Markdown.
5809 Resolve `descriptionPath` to get the full description of maximum `10000` characters.
3e9e6f2f 5810 duration:
06746a8b 5811 type: integer
84f6e32c 5812 example: 1419
c00100b6 5813 format: seconds
0c114568 5814 description: duration of the video in seconds
3e9e6f2f
RK
5815 isLocal:
5816 type: boolean
5817 name:
5818 type: string
b8375da9 5819 description: title of the video
84f6e32c 5820 example: What is PeerTube?
bdac0584
RK
5821 minLength: 3
5822 maxLength: 120
3e9e6f2f
RK
5823 thumbnailPath:
5824 type: string
84f6e32c 5825 example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
5826 previewPath:
5827 type: string
20dcfd74 5828 example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
5829 embedPath:
5830 type: string
84f6e32c 5831 example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
3e9e6f2f 5832 views:
06746a8b 5833 type: integer
84f6e32c 5834 example: 1337
3e9e6f2f 5835 likes:
06746a8b 5836 type: integer
84f6e32c 5837 example: 42
3e9e6f2f 5838 dislikes:
06746a8b 5839 type: integer
84f6e32c 5840 example: 7
3e9e6f2f
RK
5841 nsfw:
5842 type: boolean
5dce26d2
C
5843 waitTranscoding:
5844 type: boolean
5845 nullable: true
5846 state:
b8375da9
RK
5847 allOf:
5848 - $ref: '#/components/schemas/VideoStateConstant'
5849 description: represents the internal state of the video processing within the PeerTube instance
5dce26d2
C
5850 scheduledUpdate:
5851 nullable: true
c1843150
C
5852 allOf:
5853 - $ref: '#/components/schemas/VideoScheduledUpdate'
5dce26d2
C
5854 blacklisted:
5855 nullable: true
5856 type: boolean
5857 blacklistedReason:
5858 nullable: true
5859 type: string
3e9e6f2f 5860 account:
c1843150 5861 $ref: '#/components/schemas/AccountSummary'
5dce26d2
C
5862 channel:
5863 $ref: '#/components/schemas/VideoChannelSummary'
5864 userHistory:
5865 nullable: true
3e9e6f2f
RK
5866 type: object
5867 properties:
5dce26d2 5868 currentTime:
06746a8b 5869 type: integer
5dce26d2
C
5870 VideoDetails:
5871 allOf:
5872 - $ref: '#/components/schemas/Video'
5873 - type: object
5874 properties:
51353d9a
C
5875 viewers:
5876 type: integer
5877 description: If the video is a live, you have the amount of current viewers
5dce26d2 5878 descriptionPath:
3e9e6f2f 5879 type: string
0c114568
RK
5880 example: /api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180a6d/description
5881 description: path at which to get the full description of maximum `10000` characters
5dce26d2 5882 support:
3e9e6f2f 5883 type: string
00494d6e 5884 description: A text tell the audience how to support the video creator
9a320a06 5885 example: Please support our work on https://soutenir.framasoft.org/en/ <3
c540d865
RK
5886 minLength: 3
5887 maxLength: 1000
5dce26d2
C
5888 channel:
5889 $ref: '#/components/schemas/VideoChannel'
5890 account:
5891 $ref: '#/components/schemas/Account'
5892 tags:
bdac0584 5893 example: [flowers, gardening]
5dce26d2 5894 type: array
bdac0584
RK
5895 minItems: 1
5896 maxItems: 5
5dce26d2
C
5897 items:
5898 type: string
bdac0584
RK
5899 minLength: 2
5900 maxLength: 30
5dce26d2
C
5901 commentsEnabled:
5902 type: boolean
5903 downloadEnabled:
5904 type: boolean
5905 trackerUrls:
5906 type: array
5907 items:
5908 type: string
84f6e32c 5909 format: url
2c4876f2
RK
5910 example:
5911 - https://peertube2.cpy.re/tracker/announce
5912 - wss://peertube2.cpy.re/tracker/socket
c540d865
RK
5913 files:
5914 type: array
5915 items:
5916 $ref: '#/components/schemas/VideoFile'
5917 description: |
5918 WebTorrent/raw video files. If WebTorrent is disabled on the server:
5919
5920 - field will be empty
5921 - video files will be found in `streamingPlaylists[].files` field
5dce26d2
C
5922 streamingPlaylists:
5923 type: array
5924 items:
5925 $ref: '#/components/schemas/VideoStreamingPlaylists'
c540d865
RK
5926 description: |
5927 HLS playlists/manifest files. If HLS is disabled on the server:
5928
5929 - field will be empty
5930 - video files will be found in `files` field
04b703f6
RK
5931 FileRedundancyInformation:
5932 properties:
5933 id:
b8375da9 5934 $ref: '#/components/schemas/id'
04b703f6
RK
5935 fileUrl:
5936 type: string
84f6e32c 5937 format: url
04b703f6
RK
5938 strategy:
5939 type: string
84f6e32c
RK
5940 enum:
5941 - manual
5942 - most-views
5943 - trending
5944 - recently-added
04b703f6
RK
5945 size:
5946 type: integer
5947 createdAt:
5948 type: string
5949 format: date-time
5950 updatedAt:
5951 type: string
5952 format: date-time
5953 expiresOn:
5954 type: string
5955 format: date-time
5956 VideoRedundancy:
5957 properties:
5958 id:
b8375da9 5959 $ref: '#/components/schemas/id'
04b703f6
RK
5960 name:
5961 type: string
5962 url:
5963 type: string
84f6e32c 5964 format: url
04b703f6 5965 uuid:
f880a5e7 5966 $ref: '#/components/schemas/UUIDv4'
04b703f6
RK
5967 redundancies:
5968 type: object
5969 properties:
5970 files:
5971 type: array
5972 items:
1e904cde 5973 $ref: '#/components/schemas/FileRedundancyInformation'
04b703f6
RK
5974 streamingPlaylists:
5975 type: array
5976 items:
1e904cde 5977 $ref: '#/components/schemas/FileRedundancyInformation'
1f82e3e8
C
5978 VideoImportStateConstant:
5979 properties:
5980 id:
5981 type: integer
5982 enum:
5983 - 1
5984 - 2
5985 - 3
06746a8b 5986 description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
1f82e3e8
C
5987 label:
5988 type: string
84f6e32c 5989 example: Pending
ac2a5b54
RK
5990 VideoCreateImport:
5991 allOf:
5992 - type: object
5993 additionalProperties: false
5994 oneOf:
5995 - properties:
5996 targetUrl:
5997 $ref: '#/components/schemas/VideoImport/properties/targetUrl'
5998 required: [targetUrl]
5999 - properties:
6000 magnetUri:
6001 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
6002 required: [magnetUri]
6003 - properties:
6004 torrentfile:
6005 $ref: '#/components/schemas/VideoImport/properties/torrentfile'
6006 required: [torrentfile]
6007 - $ref: '#/components/schemas/VideoUploadRequestCommon'
6008 required:
6009 - channelId
6010 - name
1f82e3e8
C
6011 VideoImport:
6012 properties:
6013 id:
ac2a5b54
RK
6014 readOnly: true
6015 allOf:
6016 - $ref: '#/components/schemas/id'
1f82e3e8
C
6017 targetUrl:
6018 type: string
84f6e32c 6019 format: url
2c4876f2 6020 description: remote URL where to find the import's source video
84f6e32c 6021 example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
1f82e3e8
C
6022 magnetUri:
6023 type: string
84f6e32c 6024 format: uri
2c4876f2 6025 description: magnet URI allowing to resolve the import's source video
2c4876f2 6026 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
ac2a5b54
RK
6027 torrentfile:
6028 writeOnly: true
6029 type: string
6030 format: binary
6031 description: Torrent file containing only the video file
1f82e3e8 6032 torrentName:
ac2a5b54 6033 readOnly: true
1f82e3e8
C
6034 type: string
6035 state:
ac2a5b54
RK
6036 readOnly: true
6037 allOf:
6038 - $ref: '#/components/schemas/VideoImportStateConstant'
1f82e3e8 6039 error:
ac2a5b54 6040 readOnly: true
1f82e3e8
C
6041 type: string
6042 createdAt:
ac2a5b54 6043 readOnly: true
1f82e3e8 6044 type: string
84f6e32c 6045 format: date-time
1f82e3e8 6046 updatedAt:
ac2a5b54 6047 readOnly: true
1f82e3e8 6048 type: string
84f6e32c 6049 format: date-time
1f82e3e8 6050 video:
ac2a5b54 6051 readOnly: true
2c4876f2
RK
6052 nullable: true
6053 allOf:
6054 - $ref: '#/components/schemas/Video'
5844dde3
RK
6055 VideoImportsList:
6056 properties:
6057 total:
6058 type: integer
6059 example: 1
6060 data:
6061 type: array
6062 maxItems: 100
6063 items:
6064 $ref: '#/components/schemas/VideoImport'
668b7f09 6065 Abuse:
3e9e6f2f
RK
6066 properties:
6067 id:
b8375da9 6068 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6069 reason:
6070 type: string
84f6e32c 6071 example: The video is a spam
4302058c
RK
6072 minLength: 2
6073 maxLength: 3000
1ebddadd 6074 predefinedReasons:
4f32032f 6075 $ref: '#/components/schemas/AbusePredefinedReasons'
3e9e6f2f
RK
6076 reporterAccount:
6077 $ref: '#/components/schemas/Account'
50e16ccf 6078 state:
4f32032f 6079 $ref: '#/components/schemas/AbuseStateConstant'
50e16ccf
C
6080 moderationComment:
6081 type: string
84f6e32c 6082 example: Decided to ban the server since it spams us regularly
4302058c
RK
6083 minLength: 2
6084 maxLength: 3000
3e9e6f2f 6085 video:
bdac0584 6086 $ref: '#/components/schemas/VideoInfo'
3e9e6f2f
RK
6087 createdAt:
6088 type: string
84f6e32c 6089 format: date-time
668b7f09
C
6090 AbuseMessage:
6091 properties:
6092 id:
b8375da9 6093 $ref: '#/components/schemas/id'
668b7f09
C
6094 message:
6095 type: string
4302058c 6096 minLength: 2
f6d6e7f8 6097 maxLength: 3000
668b7f09
C
6098 byModerator:
6099 type: boolean
6100 createdAt:
6101 type: string
6102 format: date-time
6103 account:
6104 $ref: '#/components/schemas/AccountSummary'
3e9e6f2f
RK
6105 VideoBlacklist:
6106 properties:
6107 id:
b8375da9 6108 $ref: '#/components/schemas/id'
3e9e6f2f 6109 videoId:
b8375da9 6110 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f
RK
6111 createdAt:
6112 type: string
84f6e32c 6113 format: date-time
3e9e6f2f
RK
6114 updatedAt:
6115 type: string
84f6e32c 6116 format: date-time
3e9e6f2f
RK
6117 name:
6118 type: string
4302058c
RK
6119 minLength: 3
6120 maxLength: 120
3e9e6f2f 6121 uuid:
f880a5e7 6122 $ref: '#/components/schemas/UUIDv4'
3e9e6f2f
RK
6123 description:
6124 type: string
4302058c
RK
6125 minLength: 3
6126 maxLength: 10000
3e9e6f2f 6127 duration:
06746a8b 6128 type: integer
3e9e6f2f 6129 views:
06746a8b 6130 type: integer
3e9e6f2f 6131 likes:
06746a8b 6132 type: integer
3e9e6f2f 6133 dislikes:
06746a8b 6134 type: integer
3e9e6f2f
RK
6135 nsfw:
6136 type: boolean
71810d0b
RK
6137 VideoPlaylist:
6138 properties:
6139 id:
b8375da9
RK
6140 $ref: '#/components/schemas/id'
6141 uuid:
6142 $ref: '#/components/schemas/UUIDv4'
d4a8e7a6
C
6143 shortUUID:
6144 allOf:
6145 - $ref: '#/components/schemas/shortUUID'
71810d0b
RK
6146 createdAt:
6147 type: string
84f6e32c 6148 format: date-time
71810d0b
RK
6149 updatedAt:
6150 type: string
84f6e32c 6151 format: date-time
71810d0b
RK
6152 description:
6153 type: string
4302058c
RK
6154 minLength: 3
6155 maxLength: 1000
71810d0b
RK
6156 displayName:
6157 type: string
4302058c
RK
6158 minLength: 1
6159 maxLength: 120
71810d0b
RK
6160 isLocal:
6161 type: boolean
6162 videoLength:
06746a8b 6163 type: integer
b8375da9 6164 minimum: 0
71810d0b
RK
6165 thumbnailPath:
6166 type: string
6167 privacy:
c1843150 6168 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
71810d0b 6169 type:
c1843150 6170 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
71810d0b 6171 ownerAccount:
c1843150
C
6172 $ref: '#/components/schemas/AccountSummary'
6173 videoChannel:
6174 $ref: '#/components/schemas/VideoChannelSummary'
3e9e6f2f
RK
6175 VideoComment:
6176 properties:
6177 id:
b8375da9 6178 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6179 url:
6180 type: string
84f6e32c 6181 format: url
3e9e6f2f
RK
6182 text:
6183 type: string
bf3c3fea
RK
6184 format: html
6185 description: Text of the comment
4302058c 6186 minLength: 1
bf3c3fea 6187 example: This video is wonderful!
3e9e6f2f 6188 threadId:
b8375da9 6189 $ref: '#/components/schemas/id'
bf3c3fea
RK
6190 inReplyToCommentId:
6191 nullable: true
6192 allOf:
6193 - $ref: '#/components/schemas/id'
3e9e6f2f 6194 videoId:
b8375da9 6195 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f
RK
6196 createdAt:
6197 type: string
84f6e32c 6198 format: date-time
3e9e6f2f
RK
6199 updatedAt:
6200 type: string
84f6e32c 6201 format: date-time
bf3c3fea
RK
6202 deletedAt:
6203 nullable: true
6204 type: string
6205 format: date-time
6206 default: null
6207 isDeleted:
6208 type: boolean
6209 default: false
5b0413dd 6210 totalRepliesFromVideoAuthor:
06746a8b 6211 type: integer
b8375da9 6212 minimum: 0
3e9e6f2f 6213 totalReplies:
06746a8b 6214 type: integer
b8375da9 6215 minimum: 0
3e9e6f2f
RK
6216 account:
6217 $ref: '#/components/schemas/Account'
6218 VideoCommentThreadTree:
6219 properties:
6220 comment:
6221 $ref: '#/components/schemas/VideoComment'
6222 children:
6223 type: array
6224 items:
6225 $ref: '#/components/schemas/VideoCommentThreadTree'
67ae04a5
C
6226 VideoCaption:
6227 properties:
6228 language:
dfcb6f50 6229 $ref: '#/components/schemas/VideoConstantString-Language'
67ae04a5
C
6230 captionPath:
6231 type: string
2e401e85 6232 VideoSource:
6233 properties:
6234 filename:
6235 type: string
75cba40d 6236 ActorImage:
3e9e6f2f
RK
6237 properties:
6238 path:
6239 type: string
d0800f76 6240 width:
6241 type: integer
3e9e6f2f
RK
6242 createdAt:
6243 type: string
84f6e32c 6244 format: date-time
3e9e6f2f
RK
6245 updatedAt:
6246 type: string
84f6e32c 6247 format: date-time
f4d59981
RK
6248 ActorInfo:
6249 properties:
6250 id:
b8375da9 6251 $ref: '#/components/schemas/id'
f4d59981
RK
6252 name:
6253 type: string
6254 displayName:
6255 type: string
6256 host:
6257 type: string
84f6e32c 6258 format: hostname
d0800f76 6259 avatars:
6260 type: array
6261 items:
6262 $ref: '#/components/schemas/ActorImage'
3e9e6f2f
RK
6263 Actor:
6264 properties:
6265 id:
b8375da9 6266 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6267 url:
6268 type: string
84f6e32c 6269 format: url
3e9e6f2f 6270 name:
77b0c6b5 6271 description: immutable name of the actor, used to find or mention it
2c4876f2
RK
6272 allOf:
6273 - $ref: '#/components/schemas/username'
3e9e6f2f
RK
6274 host:
6275 type: string
84f6e32c 6276 format: hostname
2c4876f2 6277 description: server on which the actor is resident
045bcd0d
RK
6278 hostRedundancyAllowed:
6279 type: boolean
2c4876f2 6280 description: whether this actor's host allows redundancy of its videos
3e9e6f2f 6281 followingCount:
06746a8b 6282 type: integer
2c4876f2
RK
6283 minimum: 0
6284 description: number of actors subscribed to by this actor, as seen by this instance
3e9e6f2f 6285 followersCount:
06746a8b 6286 type: integer
2c4876f2
RK
6287 minimum: 0
6288 description: number of followers of this actor, as seen by this instance
3e9e6f2f
RK
6289 createdAt:
6290 type: string
84f6e32c 6291 format: date-time
3e9e6f2f
RK
6292 updatedAt:
6293 type: string
84f6e32c 6294 format: date-time
3e9e6f2f
RK
6295 Account:
6296 allOf:
6297 - $ref: '#/components/schemas/Actor'
6298 - properties:
2a8ae759 6299 userId:
2c4876f2
RK
6300 description: object id for the user tied to this account
6301 allOf:
6302 - $ref: '#/components/schemas/User/properties/id'
3e9e6f2f
RK
6303 displayName:
6304 type: string
77b0c6b5
RK
6305 description: editable name of the account, displayed in its representations
6306 minLength: 3
6307 maxLength: 120
2a8ae759
FS
6308 description:
6309 type: string
2c4876f2 6310 description: text or bio displayed on the account's profile
cf158e7e 6311 UserViewingVideo:
bfbdfc58
C
6312 required:
6313 - currentTime
6441981b
RK
6314 properties:
6315 currentTime:
06746a8b 6316 type: integer
c00100b6 6317 format: seconds
84f6e32c
RK
6318 description: timestamp within the video, in seconds
6319 example: 5
bfbdfc58
C
6320 viewEvent:
6321 type: string
6322 enum:
6323 - seek
6324 description: >
6325 Event since last viewing call:
6326 * `seek` - If the user seeked the video
cf158e7e
C
6327
6328 VideoStatsOverall:
6329 properties:
6330 averageWatchTime:
6331 type: number
6332 totalWatchTime:
6333 type: number
6334 viewersPeak:
6335 type: number
6336 viewersPeakDate:
6337 type: string
6338 format: date-time
cf158e7e
C
6339 countries:
6340 type: array
6341 items:
6342 type: object
6343 properties:
6344 isoCode:
6345 type: string
6346 viewers:
6347 type: number
6348
6349 VideoStatsRetention:
6350 properties:
6351 data:
6352 type: array
6353 items:
6354 type: object
6355 properties:
6356 second:
6357 type: number
6358 retentionPercent:
6359 type: number
6360
6361 VideoStatsTimeserie:
6362 properties:
6363 data:
6364 type: array
6365 items:
6366 type: object
6367 properties:
6368 date:
6369 type: string
6370 value:
6371 type: number
6372
3e9e6f2f
RK
6373 ServerConfig:
6374 properties:
2a8ae759
FS
6375 instance:
6376 type: object
6377 properties:
6378 name:
6379 type: string
6380 shortDescription:
6381 type: string
6382 defaultClientRoute:
6383 type: string
6384 isNSFW:
6385 type: boolean
6386 defaultNSFWPolicy:
6387 type: string
6388 customizations:
6389 type: object
6390 properties:
6391 javascript:
6392 type: string
6393 css:
6394 type: string
f30736c8
RK
6395 search:
6396 type: object
6397 properties:
6398 remoteUri:
6399 type: object
6400 properties:
6401 users:
6402 type: boolean
6403 anonymous:
6404 type: boolean
2a8ae759
FS
6405 plugin:
6406 type: object
6407 properties:
6408 registered:
6409 type: array
6410 items:
6411 type: string
6412 theme:
6413 type: object
6414 properties:
6415 registered:
6416 type: array
6417 items:
6418 type: string
6419 email:
6420 type: object
6421 properties:
6422 enabled:
6423 type: boolean
6424 contactForm:
6425 type: object
6426 properties:
6427 enabled:
6428 type: boolean
6429 serverVersion:
6430 type: string
6431 serverCommit:
6432 type: string
3e9e6f2f
RK
6433 signup:
6434 type: object
6435 properties:
6436 allowed:
6437 type: boolean
2a8ae759
FS
6438 allowedForCurrentIP:
6439 type: boolean
6440 requiresEmailVerification:
6441 type: boolean
3e9e6f2f
RK
6442 transcoding:
6443 type: object
6444 properties:
2a8ae759
FS
6445 hls:
6446 type: object
6447 properties:
6448 enabled:
6449 type: boolean
f30736c8
RK
6450 webtorrent:
6451 type: object
6452 properties:
6453 enabled:
6454 type: boolean
3e9e6f2f
RK
6455 enabledResolutions:
6456 type: array
6457 items:
40cfb36b 6458 $ref: '#/components/schemas/VideoResolutionSet'
2a8ae759
FS
6459 import:
6460 type: object
6461 properties:
6462 videos:
6463 type: object
6464 properties:
6465 http:
6466 type: object
6467 properties:
6468 enabled:
6469 type: boolean
6470 torrent:
6471 type: object
6472 properties:
6473 enabled:
6474 type: boolean
6475 autoBlacklist:
6476 type: object
6477 properties:
6478 videos:
6479 type: object
6480 properties:
6481 ofUsers:
6482 type: object
6483 properties:
6484 enabled:
6485 type: boolean
3e9e6f2f
RK
6486 avatar:
6487 type: object
6488 properties:
6489 file:
6490 type: object
6491 properties:
6492 size:
6493 type: object
6494 properties:
6495 max:
06746a8b 6496 type: integer
3e9e6f2f
RK
6497 extensions:
6498 type: array
6499 items:
6500 type: string
6501 video:
6502 type: object
6503 properties:
2a8ae759
FS
6504 image:
6505 type: object
6506 properties:
6507 extensions:
6508 type: array
6509 items:
6510 type: string
6511 size:
6512 type: object
6513 properties:
6514 max:
06746a8b 6515 type: integer
3e9e6f2f
RK
6516 file:
6517 type: object
6518 properties:
6519 extensions:
6520 type: array
6521 items:
6522 type: string
2a8ae759
FS
6523 videoCaption:
6524 type: object
6525 properties:
6526 file:
6527 type: object
6528 properties:
6529 size:
6530 type: object
6531 properties:
6532 max:
06746a8b 6533 type: integer
2a8ae759
FS
6534 extensions:
6535 type: array
6536 items:
6537 type: string
6538 user:
6539 type: object
6540 properties:
6541 videoQuota:
06746a8b 6542 type: integer
b8375da9 6543 example: 16810141515
2a8ae759 6544 videoQuotaDaily:
06746a8b 6545 type: integer
b8375da9 6546 example: 1681014151
2a8ae759
FS
6547 trending:
6548 type: object
6549 properties:
6550 videos:
6551 type: object
6552 properties:
6553 intervalDays:
06746a8b 6554 type: integer
2a8ae759 6555 tracker:
747b17c7 6556 type: object
2a8ae759
FS
6557 properties:
6558 enabled:
6559 type: boolean
f30736c8
RK
6560 followings:
6561 type: object
6562 properties:
6563 instance:
6564 type: object
6565 properties:
6566 autoFollowIndex:
6567 type: object
6568 properties:
6569 indexUrl:
6570 type: string
84f6e32c 6571 format: url
2539932e
C
6572 homepage:
6573 type: object
6574 properties:
6575 enabled:
6576 type: boolean
6577
42b40636
C
6578 SendClientLog:
6579 properties:
6580 message:
6581 type: string
6582 url:
6583 type: string
6584 description: URL of the current user page
6585 level:
6586 enum:
6587 - error
6588 - warn
6589 stackTrace:
6590 type: string
6591 description: Stack trace of the error if there is one
6592 userAgent:
6593 type: string
6594 description: User agent of the web browser that sends the message
6595 meta:
6596 type: string
6597 description: Additional information regarding this log
6598 required:
6599 - message
6600 - url
6601 - level
6602
b44b5a83
C
6603 ServerStats:
6604 properties:
6605 totalUsers:
6606 type: number
6607 totalDailyActiveUsers:
6608 type: number
6609 totalWeeklyActiveUsers:
6610 type: number
6611 totalMonthlyActiveUsers:
6612 type: number
6613 totalLocalVideos:
6614 type: number
6615 totalLocalVideoViews:
6616 type: number
6617 description: Total video views made on the instance
6618 totalLocalVideoComments:
6619 type: number
6620 description: Total comments made by local users
6621 totalLocalVideoFilesSize:
6622 type: number
6623 totalVideos:
6624 type: number
6625 totalVideoComments:
6626 type: number
6627 totalLocalVideoChannels:
6628 type: number
6629 totalLocalDailyActiveVideoChannels:
6630 type: number
6631 totalLocalWeeklyActiveVideoChannels:
6632 type: number
6633 totalLocalMonthlyActiveVideoChannels:
6634 type: number
6635 totalLocalPlaylists:
6636 type: number
6637 totalInstanceFollowers:
6638 type: number
6639 totalInstanceFollowing:
6640 type: number
6641 videosRedundancy:
6642 type: array
6643 items:
6644 type: object
6645 properties:
6646 strategy:
6647 type: string
6648 totalSize:
6649 type: number
6650 totalUsed:
6651 type: number
6652 totalVideoFiles:
6653 type: number
6654 totalVideos:
6655 type: number
6656 totalActivityPubMessagesProcessed:
6657 type: number
6658 totalActivityPubMessagesSuccesses:
6659 type: number
6660 totalActivityPubMessagesErrors:
6661 type: number
6662
6663 activityPubMessagesProcessedPerSecond:
6664 type: number
6665 totalActivityPubMessagesWaiting:
6666 type: number
6667
2a8ae759
FS
6668 ServerConfigAbout:
6669 properties:
6670 instance:
6671 type: object
6672 properties:
6673 name:
6674 type: string
6675 shortDescription:
6676 type: string
6677 description:
6678 type: string
6679 terms:
6680 type: string
6681 ServerConfigCustom:
6682 properties:
6683 instance:
6684 type: object
6685 properties:
6686 name:
6687 type: string
6688 shortDescription:
6689 type: string
6690 description:
6691 type: string
6692 terms:
6693 type: string
6694 defaultClientRoute:
6695 type: string
6696 isNSFW:
6697 type: boolean
6698 defaultNSFWPolicy:
6699 type: string
6700 customizations:
6701 type: object
6702 properties:
6703 javascript:
6704 type: string
6705 css:
6706 type: string
6707 theme:
6708 type: object
6709 properties:
6710 default:
6711 type: string
6712 services:
6713 type: object
6714 properties:
6715 twitter:
6716 type: object
6717 properties:
6718 username:
6719 type: string
6720 whitelisted:
6721 type: boolean
6722 cache:
6723 type: object
6724 properties:
6725 previews:
6726 type: object
6727 properties:
6728 size:
06746a8b 6729 type: integer
2a8ae759
FS
6730 captions:
6731 type: object
6732 properties:
6733 size:
06746a8b 6734 type: integer
2a8ae759
FS
6735 signup:
6736 type: object
6737 properties:
6738 enabled:
6739 type: boolean
6740 limit:
06746a8b 6741 type: integer
2a8ae759
FS
6742 requiresEmailVerification:
6743 type: boolean
6744 admin:
6745 type: object
6746 properties:
6747 email:
6748 type: string
84f6e32c 6749 format: email
2a8ae759
FS
6750 contactForm:
6751 type: object
6752 properties:
6753 enabled:
6754 type: boolean
6755 user:
6756 type: object
40cfb36b 6757 description: Settings that apply to new users, if registration is enabled
2a8ae759
FS
6758 properties:
6759 videoQuota:
06746a8b 6760 type: integer
b8375da9 6761 example: 16810141515
2a8ae759 6762 videoQuotaDaily:
06746a8b 6763 type: integer
b8375da9 6764 example: 1681014151
2a8ae759
FS
6765 transcoding:
6766 type: object
40cfb36b 6767 description: Settings pertaining to transcoding jobs
2a8ae759
FS
6768 properties:
6769 enabled:
6770 type: boolean
6771 allowAdditionalExtensions:
6772 type: boolean
40cfb36b 6773 description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos
2a8ae759
FS
6774 allowAudioFiles:
6775 type: boolean
40cfb36b 6776 description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file
2a8ae759 6777 threads:
06746a8b 6778 type: integer
40cfb36b
RK
6779 description: Amount of threads used by ffmpeg for 1 transcoding job
6780 concurrency:
6781 type: number
6782 description: Amount of transcoding jobs to execute in parallel
6783 profile:
6784 type: string
6785 enum:
6786 - default
6787 description: |
6788 New profiles can be added by plugins ; available in core PeerTube: 'default'.
2a8ae759
FS
6789 resolutions:
6790 type: object
40cfb36b 6791 description: Resolutions to transcode _new videos_ to
2a8ae759 6792 properties:
40cfb36b
RK
6793 0p:
6794 type: boolean
8dd754c7
FC
6795 144p:
6796 type: boolean
2a8ae759
FS
6797 240p:
6798 type: boolean
6799 360p:
6800 type: boolean
6801 480p:
6802 type: boolean
6803 720p:
6804 type: boolean
6805 1080p:
6806 type: boolean
b7085c71
RK
6807 1440p:
6808 type: boolean
2a8ae759
FS
6809 2160p:
6810 type: boolean
40cfb36b
RK
6811 webtorrent:
6812 type: object
6813 description: WebTorrent-specific settings
6814 properties:
6815 enabled:
6816 type: boolean
2a8ae759
FS
6817 hls:
6818 type: object
40cfb36b 6819 description: HLS-specific settings
2a8ae759
FS
6820 properties:
6821 enabled:
6822 type: boolean
6823 import:
6824 type: object
6825 properties:
6826 videos:
6827 type: object
6828 properties:
6829 http:
6830 type: object
6831 properties:
6832 enabled:
6833 type: boolean
6834 torrent:
6835 type: object
6836 properties:
6837 enabled:
6838 type: boolean
6839 autoBlacklist:
6840 type: object
6841 properties:
6842 videos:
6843 type: object
6844 properties:
6845 ofUsers:
6846 type: object
6847 properties:
6848 enabled:
6849 type: boolean
6850 followers:
6851 type: object
6852 properties:
6853 instance:
6854 type: object
6855 properties:
6856 enabled:
6857 type: boolean
6858 manualApproval:
6859 type: boolean
2539932e
C
6860
6861 CustomHomepage:
6862 properties:
6863 content:
6864 type: string
6865
3e9e6f2f
RK
6866 Follow:
6867 properties:
6868 id:
b8375da9 6869 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6870 follower:
6871 $ref: '#/components/schemas/Actor'
6872 following:
6873 $ref: '#/components/schemas/Actor'
6874 score:
6875 type: number
04b703f6 6876 description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
3e9e6f2f
RK
6877 state:
6878 type: string
6879 enum:
6880 - pending
6881 - accepted
6882 createdAt:
6883 type: string
84f6e32c 6884 format: date-time
3e9e6f2f
RK
6885 updatedAt:
6886 type: string
84f6e32c 6887 format: date-time
e3489df9
C
6888
6889 PredefinedAbuseReasons:
6890 description: Reason categories that help triage reports
6891 type: array
f6d6e7f8 6892 maxItems: 8
e3489df9
C
6893 items:
6894 type: string
6895 enum:
6896 - violentOrAbusive
6897 - hatefulOrAbusive
6898 - spamOrMisleading
6899 - privacy
6900 - rights
6901 - serverRules
6902 - thumbnails
6903 - captions
6904
3e9e6f2f
RK
6905 Job:
6906 properties:
6907 id:
b8375da9 6908 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6909 state:
6910 type: string
6911 enum:
84f6e32c
RK
6912 - active
6913 - completed
6914 - failed
6915 - waiting
6916 - delayed
6917 type:
3e9e6f2f
RK
6918 type: string
6919 enum:
84f6e32c
RK
6920 - activitypub-http-unicast
6921 - activitypub-http-broadcast
6922 - activitypub-http-fetcher
6923 - activitypub-follow
6924 - video-file-import
6925 - video-transcoding
6926 - email
6927 - video-import
51353d9a 6928 - videos-views-stats
84f6e32c
RK
6929 - activitypub-refresher
6930 - video-redundancy
6931 data:
6932 type: object
6933 additionalProperties: true
6934 error:
6935 type: object
6936 additionalProperties: true
3e9e6f2f
RK
6937 createdAt:
6938 type: string
84f6e32c
RK
6939 format: date-time
6940 finishedOn:
3e9e6f2f 6941 type: string
84f6e32c
RK
6942 format: date-time
6943 processedOn:
6944 type: string
6945 format: date-time
3e9e6f2f
RK
6946 AddUserResponse:
6947 properties:
2c318664
RK
6948 user:
6949 type: object
6950 properties:
6951 id:
b8375da9 6952 $ref: '#/components/schemas/id'
2c318664
RK
6953 account:
6954 type: object
6955 properties:
6956 id:
b8375da9 6957 $ref: '#/components/schemas/id'
f6d6e7f8 6958 VideoUploadRequestCommon:
6959 properties:
6960 name:
6961 description: Video name
6962 type: string
b8375da9
RK
6963 example: What is PeerTube?
6964 minLength: 3
6965 maxLength: 120
f6d6e7f8 6966 channelId:
6967 description: Channel id that will contain this video
6968 type: integer
b8375da9
RK
6969 example: 3
6970 minimum: 1
f6d6e7f8 6971 privacy:
6972 $ref: '#/components/schemas/VideoPrivacySet'
6973 category:
40cfb36b 6974 $ref: '#/components/schemas/VideoCategorySet'
f6d6e7f8 6975 licence:
40cfb36b 6976 $ref: '#/components/schemas/VideoLicenceSet'
f6d6e7f8 6977 language:
40cfb36b 6978 $ref: '#/components/schemas/VideoLanguageSet'
f6d6e7f8 6979 description:
6980 description: Video description
6981 type: string
b8375da9
RK
6982 example: |
6983 **[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)**
f6d6e7f8 6984 waitTranscoding:
6985 description: Whether or not we wait transcoding before publish the video
6986 type: boolean
6987 support:
6988 description: A text tell the audience how to support the video creator
9a320a06 6989 example: Please support our work on https://soutenir.framasoft.org/en/ <3
f6d6e7f8 6990 type: string
6991 nsfw:
6992 description: Whether or not this video contains sensitive content
6993 type: boolean
6994 tags:
6995 description: Video tags (maximum 5 tags each between 2 and 30 characters)
6996 type: array
6997 minItems: 1
6998 maxItems: 5
6999 uniqueItems: true
b8375da9
RK
7000 example:
7001 - framasoft
7002 - peertube
f6d6e7f8 7003 items:
7004 type: string
7005 minLength: 2
7006 maxLength: 30
7007 commentsEnabled:
7008 description: Enable or disable comments for this video
7009 type: boolean
7010 downloadEnabled:
7011 description: Enable or disable downloading for this video
7012 type: boolean
7013 originallyPublishedAt:
7014 description: Date when the content was originally published
7015 type: string
7016 format: date-time
7017 scheduleUpdate:
7018 $ref: '#/components/schemas/VideoScheduledUpdate'
7019 thumbnailfile:
7020 description: Video thumbnail file
7021 type: string
7022 format: binary
7023 previewfile:
7024 description: Video preview file
7025 type: string
7026 format: binary
7027 required:
7028 - channelId
7029 - name
7030 VideoUploadRequestLegacy:
7031 allOf:
7032 - $ref: '#/components/schemas/VideoUploadRequestCommon'
7033 - type: object
7034 required:
7035 - videofile
7036 properties:
7037 videofile:
7038 description: Video file
7039 type: string
7040 format: binary
7041 VideoUploadRequestResumable:
7042 allOf:
7043 - $ref: '#/components/schemas/VideoUploadRequestCommon'
7044 - type: object
7045 required:
7046 - filename
7047 properties:
7048 filename:
7049 description: Video filename including extension
7050 type: string
7051 format: filename
b8375da9 7052 example: what_is_peertube.mp4
f6d6e7f8 7053 thumbnailfile:
7054 description: Video thumbnail file
7055 type: string
7056 format: binary
7057 previewfile:
7058 description: Video preview file
7059 type: string
7060 format: binary
3e9e6f2f
RK
7061 VideoUploadResponse:
7062 properties:
7063 video:
7064 type: object
7065 properties:
7066 id:
b8375da9 7067 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f 7068 uuid:
b8375da9 7069 $ref: '#/components/schemas/Video/properties/uuid'
d4a8e7a6
C
7070 shortUUID:
7071 $ref: '#/components/schemas/Video/properties/shortUUID'
3e9e6f2f
RK
7072 CommentThreadResponse:
7073 properties:
7074 total:
06746a8b 7075 type: integer
84f6e32c 7076 example: 1
3e9e6f2f
RK
7077 data:
7078 type: array
84f6e32c 7079 maxItems: 100
3e9e6f2f
RK
7080 items:
7081 $ref: '#/components/schemas/VideoComment'
7082 CommentThreadPostResponse:
7083 properties:
7084 comment:
7085 $ref: '#/components/schemas/VideoComment'
048b6946
C
7086 VideoListResponse:
7087 properties:
7088 total:
06746a8b 7089 type: integer
84f6e32c 7090 example: 1
048b6946
C
7091 data:
7092 type: array
84f6e32c 7093 maxItems: 100
048b6946
C
7094 items:
7095 $ref: '#/components/schemas/Video'
84f6e32c
RK
7096 User:
7097 properties:
fd5586b3
RK
7098 account:
7099 $ref: '#/components/schemas/Account'
7100 autoPlayNextVideo:
7101 type: boolean
7102 description: Automatically start playing the upcoming video after the currently playing video
7103 autoPlayNextVideoPlaylist:
7104 type: boolean
7105 description: Automatically start playing the video on the playlist after the currently playing video
7106 autoPlayVideo:
7107 type: boolean
7108 description: Automatically start playing the video on the watch page
7109 blocked:
7110 type: boolean
7111 blockedReason:
7112 type: string
7113 createdAt:
84f6e32c 7114 type: string
84f6e32c
RK
7115 email:
7116 type: string
7117 format: email
7118 description: The user email
fd5586b3
RK
7119 emailVerified:
7120 type: boolean
7121 description: Has the user confirmed their email address?
7122 id:
2c4876f2
RK
7123 allOf:
7124 - $ref: '#/components/schemas/id'
fd5586b3 7125 readOnly: true
6d989edc
C
7126 pluginAuth:
7127 type: string
7128 description: Auth plugin to use to authenticate the user
fd5586b3 7129 lastLoginDate:
84f6e32c 7130 type: string
fd5586b3
RK
7131 format: date-time
7132 noInstanceConfigWarningModal:
7133 type: boolean
8f581725
C
7134 noAccountSetupWarningModal:
7135 type: boolean
fd5586b3 7136 noWelcomeModal:
84f6e32c 7137 type: boolean
84f6e32c
RK
7138 nsfwPolicy:
7139 $ref: '#/components/schemas/NSFWPolicy'
84f6e32c
RK
7140 role:
7141 $ref: '#/components/schemas/UserRole'
7142 roleLabel:
7143 type: string
7144 enum:
7145 - User
7146 - Moderator
7147 - Administrator
fd5586b3 7148 theme:
84f6e32c 7149 type: string
fd5586b3
RK
7150 description: Theme enabled by this user
7151 username:
b8375da9 7152 $ref: '#/components/schemas/username'
84f6e32c
RK
7153 videoChannels:
7154 type: array
7155 items:
7156 $ref: '#/components/schemas/VideoChannel'
fd5586b3
RK
7157 videoQuota:
7158 type: integer
7159 description: The user video quota in bytes
7160 example: -1
7161 videoQuotaDaily:
7162 type: integer
7163 description: The user daily video quota in bytes
7164 example: -1
a9bfa85d 7165 p2pEnabled:
fd5586b3
RK
7166 type: boolean
7167 description: Enable P2P in the player
7168 UserWithStats:
7169 allOf:
7170 - $ref: '#/components/schemas/User'
7171 - properties:
7172 # optionally present fields: they require WITH_STATS scope
7173 videosCount:
7174 type: integer
85a60d8b 7175 description: Count of videos published
fd5586b3
RK
7176 abusesCount:
7177 type: integer
7178 description: Count of reports/abuses of which the user is a target
7179 abusesAcceptedCount:
7180 type: integer
7181 description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team
7182 abusesCreatedCount:
7183 type: integer
7184 description: Count of reports/abuses created by the user
7185 videoCommentsCount:
7186 type: integer
7187 description: Count of comments published
3e9e6f2f
RK
7188 AddUser:
7189 properties:
7190 username:
b8375da9 7191 $ref: '#/components/schemas/username'
3e9e6f2f 7192 password:
b8375da9 7193 $ref: '#/components/schemas/password'
3e9e6f2f
RK
7194 email:
7195 type: string
84f6e32c
RK
7196 format: email
7197 description: The user email
3e9e6f2f 7198 videoQuota:
84f6e32c 7199 type: integer
b8375da9
RK
7200 description: The user video quota in bytes
7201 example: -1
fbe1bc2a 7202 videoQuotaDaily:
84f6e32c 7203 type: integer
b8375da9
RK
7204 description: The user daily video quota in bytes
7205 example: -1
6d989edc 7206 channelName:
b8375da9 7207 $ref: '#/components/schemas/usernameChannel'
3e9e6f2f 7208 role:
0590bb46 7209 $ref: '#/components/schemas/UserRole'
6d989edc
C
7210 adminFlags:
7211 $ref: '#/components/schemas/UserAdminFlags'
3e9e6f2f
RK
7212 required:
7213 - username
7214 - password
7215 - email
7216 - videoQuota
fbe1bc2a 7217 - videoQuotaDaily
3e9e6f2f
RK
7218 - role
7219 UpdateUser:
7220 properties:
3e9e6f2f 7221 email:
84f6e32c 7222 description: The updated email of the user
77b0c6b5
RK
7223 allOf:
7224 - $ref: '#/components/schemas/User/properties/email'
6d989edc
C
7225 emailVerified:
7226 type: boolean
7227 description: Set the email as verified
3e9e6f2f 7228 videoQuota:
84f6e32c 7229 type: integer
b8375da9 7230 description: The updated video quota of the user in bytes
fbe1bc2a 7231 videoQuotaDaily:
84f6e32c 7232 type: integer
b8375da9 7233 description: The updated daily video quota of the user in bytes
6d989edc
C
7234 pluginAuth:
7235 type: string
7236 nullable: true
7237 description: The auth plugin to use to authenticate the user
7238 example: 'peertube-plugin-auth-saml2'
3e9e6f2f 7239 role:
0590bb46 7240 $ref: '#/components/schemas/UserRole'
6d989edc
C
7241 adminFlags:
7242 $ref: '#/components/schemas/UserAdminFlags'
5097cbda
C
7243 password:
7244 $ref: '#/components/schemas/password'
3e9e6f2f 7245 UpdateMe:
77b0c6b5 7246 # see shared/models/users/user-update-me.model.ts:
3e9e6f2f
RK
7247 properties:
7248 password:
b8375da9 7249 $ref: '#/components/schemas/password'
77b0c6b5
RK
7250 currentPassword:
7251 $ref: '#/components/schemas/password'
3e9e6f2f 7252 email:
77b0c6b5
RK
7253 description: new email used for login and service communications
7254 allOf:
7255 - $ref: '#/components/schemas/User/properties/email'
7256 displayName:
3e9e6f2f 7257 type: string
77b0c6b5
RK
7258 description: new name of the user in its representations
7259 minLength: 3
7260 maxLength: 120
3e9e6f2f
RK
7261 displayNSFW:
7262 type: string
77b0c6b5 7263 description: new NSFW display policy
84f6e32c
RK
7264 enum:
7265 - 'true'
7266 - 'false'
7267 - both
a9bfa85d 7268 p2pEnabled:
77b0c6b5
RK
7269 type: boolean
7270 description: whether to enable P2P in the player or not
3e9e6f2f 7271 autoPlayVideo:
84f6e32c 7272 type: boolean
77b0c6b5
RK
7273 description: new preference regarding playing videos automatically
7274 autoPlayNextVideo:
7275 type: boolean
7276 description: new preference regarding playing following videos automatically
7277 autoPlayNextVideoPlaylist:
7278 type: boolean
7279 description: new preference regarding playing following playlist videos automatically
7280 videosHistoryEnabled:
7281 type: boolean
7282 description: whether to keep track of watched history or not
7283 videoLanguages:
7284 type: array
7285 items:
7286 type: string
7287 description: list of languages to filter videos down to
7288 theme:
7289 type: string
7290 noInstanceConfigWarningModal:
7291 type: boolean
8f581725
C
7292 noAccountSetupWarningModal:
7293 type: boolean
77b0c6b5
RK
7294 noWelcomeModal:
7295 type: boolean
3e9e6f2f
RK
7296 GetMeVideoRating:
7297 properties:
7298 id:
b8375da9 7299 $ref: '#/components/schemas/id'
3e9e6f2f 7300 rating:
30b40713
RK
7301 type: string
7302 enum:
7303 - like
7304 - dislike
7305 - none
84f6e32c 7306 description: Rating of the video
3e9e6f2f
RK
7307 required:
7308 - id
7309 - rating
c100a614
YB
7310 VideoRating:
7311 properties:
7312 video:
7313 $ref: '#/components/schemas/Video'
7314 rating:
30b40713
RK
7315 type: string
7316 enum:
7317 - like
7318 - dislike
7319 - none
7320 description: Rating of the video
c100a614
YB
7321 required:
7322 - video
7323 - rating
3e9e6f2f
RK
7324 RegisterUser:
7325 properties:
7326 username:
77b0c6b5
RK
7327 description: immutable name of the user, used to find or mention its actor
7328 allOf:
7329 - $ref: '#/components/schemas/username'
3e9e6f2f 7330 password:
b8375da9 7331 $ref: '#/components/schemas/password'
3e9e6f2f
RK
7332 email:
7333 type: string
84f6e32c 7334 format: email
77b0c6b5 7335 description: email of the user, used for login or service communications
1f20622f
C
7336 displayName:
7337 type: string
77b0c6b5 7338 description: editable name of the user, displayed in its representations
84f6e32c
RK
7339 minLength: 1
7340 maxLength: 120
1f20622f
C
7341 channel:
7342 type: object
77b0c6b5 7343 description: channel base information used to create the first channel of the user
1f20622f
C
7344 properties:
7345 name:
b8375da9 7346 $ref: '#/components/schemas/usernameChannel'
1f20622f 7347 displayName:
d0800f76 7348 type: string
3e9e6f2f
RK
7349 required:
7350 - username
7351 - password
7352 - email
4302058c 7353
e2464d22
RK
7354 OAuthClient:
7355 properties:
7356 client_id:
7357 type: string
7358 pattern: /^[a-z0-9]$/
7359 maxLength: 32
7360 minLength: 32
7361 example: v1ikx5hnfop4mdpnci8nsqh93c45rldf
7362 client_secret:
7363 type: string
7364 pattern: /^[a-zA-Z0-9]$/
7365 maxLength: 32
7366 minLength: 32
7367 example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt
7368 OAuthToken-password:
7369 allOf:
7370 - $ref: '#/components/schemas/OAuthClient'
7371 - type: object
7372 properties:
7373 grant_type:
7374 type: string
7375 enum:
7376 - password
7377 - refresh_token
7378 default: password
7379 username:
7380 $ref: '#/components/schemas/User/properties/username'
7381 password:
7382 $ref: '#/components/schemas/password'
7383 required:
7384 - client_id
7385 - client_secret
7386 - grant_type
7387 - username
7388 - password
7389 OAuthToken-refresh_token:
7390 allOf:
7391 - $ref: '#/components/schemas/OAuthClient'
7392 - type: object
7393 properties:
7394 grant_type:
7395 type: string
7396 enum:
7397 - password
7398 - refresh_token
7399 default: password
7400 refresh_token:
7401 type: string
7402 example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7
7403 required:
7404 - client_id
7405 - client_secret
7406 - grant_type
7407 - refresh_token
7408
b8375da9 7409 VideoChannel:
d0800f76 7410 allOf:
7411 - $ref: '#/components/schemas/Actor'
7412 - type: object
b8375da9 7413 properties:
d0800f76 7414 displayName:
7415 type: string
7416 description: editable name of the channel, displayed in its representations
7417 example: Videos of Framasoft
7418 minLength: 1
7419 maxLength: 120
7420 description:
7421 type: string
7422 example: Videos made with <3 by Framasoft
7423 minLength: 3
7424 maxLength: 1000
7425 support:
7426 type: string
7427 description: text shown by default on all videos of this channel, to tell the audience how to support it
7428 example: Please support our work on https://soutenir.framasoft.org/en/ <3
7429 minLength: 3
7430 maxLength: 1000
7431 isLocal:
7432 readOnly: true
7433 type: boolean
7434 updatedAt:
7435 readOnly: true
7436 type: string
7437 format: date-time
7438 banners:
7439 type: array
7440 items:
7441 $ref: '#/components/schemas/ActorImage'
7442 ownerAccount:
7443 readOnly: true
7444 nullable: true
7445 type: object
7446 properties:
7447 id:
7448 type: integer
7449 uuid:
7450 $ref: '#/components/schemas/UUIDv4'
4302058c
RK
7451 VideoChannelCreate:
7452 allOf:
b8375da9 7453 - $ref: '#/components/schemas/VideoChannel'
4302058c
RK
7454 - properties:
7455 name:
b8375da9
RK
7456 description: username of the channel to create
7457 allOf:
7458 - $ref: '#/components/schemas/usernameChannel'
7d14d4d2
C
7459 required:
7460 - name
7461 - displayName
7462 VideoChannelUpdate:
4302058c 7463 allOf:
b8375da9 7464 - $ref: '#/components/schemas/VideoChannel'
4302058c
RK
7465 - properties:
7466 bulkVideosSupportUpdate:
7467 type: boolean
b8375da9 7468 description: Update the support field for all videos of this channel
045bcd0d
RK
7469 VideoChannelList:
7470 properties:
7471 total:
7472 type: integer
7473 example: 1
7474 data:
7475 type: array
7476 items:
7477 allOf:
7478 - $ref: '#/components/schemas/VideoChannel'
7479 - $ref: '#/components/schemas/Actor'
1569a818 7480
06746a8b
RK
7481 MRSSPeerLink:
7482 type: object
7483 xml:
7484 name: 'media:peerLink'
7485 properties:
7486 href:
7487 type: string
7488 xml:
7489 attribute: true
7490 type:
7491 type: string
7492 enum:
7493 - application/x-bittorrent
7494 xml:
7495 attribute: true
7496 MRSSGroupContent:
7497 type: object
7498 xml:
7499 name: 'media:content'
7500 properties:
7501 url:
7502 type: string
84f6e32c 7503 format: url
06746a8b
RK
7504 xml:
7505 attribute: true
7506 fileSize:
7507 type: integer
7508 xml:
7509 attribute: true
7510 type:
7511 type: string
7512 xml:
7513 attribute: true
7514 framerate:
7515 type: integer
7516 xml:
7517 attribute: true
7518 duration:
7519 type: integer
7520 xml:
7521 attribute: true
7522 height:
7523 type: integer
7524 xml:
7525 attribute: true
7526 lang:
7527 type: string
7528 xml:
7529 attribute: true
7530 VideoCommentsForXML:
7531 type: array
7532 xml:
7533 wrapped: true
7534 name: 'channel'
7535 items:
7536 type: object
7537 xml:
7538 name: 'item'
7539 properties:
7540 link:
7541 type: string
84f6e32c 7542 format: url
06746a8b
RK
7543 guid:
7544 type: string
7545 pubDate:
7546 type: string
7547 format: date-time
7548 'content:encoded':
7549 type: string
7550 'dc:creator':
7551 type: string
7552 VideosForXML:
7553 type: array
7554 xml:
7555 wrapped: true
7556 name: 'channel'
7557 items:
7558 type: object
7559 xml:
7560 name: 'item'
7561 properties:
7562 link:
7563 type: string
84f6e32c 7564 format: url
06746a8b
RK
7565 description: video watch page URL
7566 guid:
7567 type: string
7568 description: video canonical URL
7569 pubDate:
7570 type: string
7571 format: date-time
7572 description: video publication date
7573 description:
7574 type: string
7575 description: video description
7576 'content:encoded':
7577 type: string
7578 description: video description
7579 'dc:creator':
7580 type: string
7581 description: publisher user name
7582 'media:category':
7583 type: integer
7584 description: video category (MRSS)
7585 'media:community':
7586 type: object
7587 description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
7588 properties:
7589 'media:statistics':
7590 type: object
7591 properties:
7592 views:
7593 type: integer
7594 xml:
7595 attribute: true
7596 'media:embed':
7597 type: object
7598 properties:
7599 url:
7600 type: string
84f6e32c 7601 format: url
06746a8b
RK
7602 description: video embed path, relative to the canonical URL domain (MRSS)
7603 xml:
7604 attribute: true
7605 'media:player':
7606 type: object
7607 properties:
7608 url:
7609 type: string
84f6e32c 7610 format: url
06746a8b
RK
7611 description: video watch path, relative to the canonical URL domain (MRSS)
7612 xml:
7613 attribute: true
7614 'media:thumbnail':
7615 type: object
7616 properties:
7617 url:
7618 type: string
84f6e32c 7619 format: url
06746a8b
RK
7620 xml:
7621 attribute: true
7622 height:
7623 type: integer
7624 xml:
7625 attribute: true
7626 width:
7627 type: integer
7628 xml:
7629 attribute: true
7630 'media:title':
7631 type: string
7632 description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
7633 'media:description':
7634 type: string
7635 'media:rating':
7636 type: string
7637 enum:
7638 - nonadult
7639 - adult
7640 description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
7641 'enclosure':
7642 type: object
7643 description: main streamable file for the video
7644 properties:
7645 url:
7646 type: string
84f6e32c 7647 format: url
06746a8b
RK
7648 xml:
7649 attribute: true
7650 type:
7651 type: string
7652 enum:
7653 - application/x-bittorrent
7654 xml:
7655 attribute: true
7656 length:
7657 type: integer
7658 xml:
7659 attribute: true
7660 'media:group':
7661 type: array
7662 description: list of streamable files for the video. see [media:peerLink](https://www.rssboard.org/media-rss#media-peerlink) and [media:content](https://www.rssboard.org/media-rss#media-content) or (MRSS)
7663 items:
7664 anyOf:
7665 - $ref: '#/components/schemas/MRSSPeerLink'
f4d59981
RK
7666 - $ref: '#/components/schemas/MRSSGroupContent'
7667 NotificationSettingValue:
7668 type: integer
7669 description: >
7670 Notification type
84f6e32c 7671
f4d59981 7672 - `0` NONE
84f6e32c 7673
f4d59981 7674 - `1` WEB
84f6e32c 7675
f4d59981
RK
7676 - `2` EMAIL
7677 enum:
7678 - 0
7679 - 1
2760b454 7680 - 2
f4d59981
RK
7681 Notification:
7682 properties:
7683 id:
b8375da9 7684 $ref: '#/components/schemas/id'
f4d59981
RK
7685 type:
7686 type: integer
7687 description: >
7688 Notification type, following the `UserNotificationType` enum:
84f6e32c 7689
f4d59981 7690 - `1` NEW_VIDEO_FROM_SUBSCRIPTION
84f6e32c 7691
f4d59981 7692 - `2` NEW_COMMENT_ON_MY_VIDEO
84f6e32c 7693
310b5219 7694 - `3` NEW_ABUSE_FOR_MODERATORS
84f6e32c 7695
f4d59981 7696 - `4` BLACKLIST_ON_MY_VIDEO
84f6e32c 7697
f4d59981 7698 - `5` UNBLACKLIST_ON_MY_VIDEO
84f6e32c 7699
f4d59981 7700 - `6` MY_VIDEO_PUBLISHED
84f6e32c 7701
f4d59981 7702 - `7` MY_VIDEO_IMPORT_SUCCESS
84f6e32c 7703
f4d59981 7704 - `8` MY_VIDEO_IMPORT_ERROR
84f6e32c 7705
f4d59981 7706 - `9` NEW_USER_REGISTRATION
84f6e32c 7707
f4d59981 7708 - `10` NEW_FOLLOW
84f6e32c 7709
f4d59981 7710 - `11` COMMENT_MENTION
84f6e32c 7711
f4d59981 7712 - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
84f6e32c 7713
f4d59981 7714 - `13` NEW_INSTANCE_FOLLOWER
84f6e32c 7715
f4d59981 7716 - `14` AUTO_INSTANCE_FOLLOWING
5097cbda 7717
597da8dd 7718 - `15` ABUSE_STATE_CHANGE
5097cbda 7719
597da8dd 7720 - `16` ABUSE_NEW_MESSAGE
5097cbda 7721
597da8dd 7722 - `17` NEW_PLUGIN_VERSION
5097cbda 7723
597da8dd 7724 - `18` NEW_PEERTUBE_VERSION
f4d59981
RK
7725 read:
7726 type: boolean
7727 video:
7728 nullable: true
7729 allOf:
7730 - $ref: '#/components/schemas/VideoInfo'
7731 - type: object
7732 properties:
7733 channel:
7734 $ref: '#/components/schemas/ActorInfo'
7735 videoImport:
7736 nullable: true
7737 type: object
7738 properties:
7739 id:
b8375da9 7740 $ref: '#/components/schemas/id'
f4d59981
RK
7741 video:
7742 nullable: true
7743 $ref: '#/components/schemas/VideoInfo'
7744 torrentName:
7745 type: string
7746 nullable: true
7747 magnetUri:
2c4876f2 7748 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
f4d59981
RK
7749 targetUri:
7750 type: string
84f6e32c 7751 format: uri
f4d59981
RK
7752 nullable: true
7753 comment:
7754 nullable: true
7755 type: object
7756 properties:
7757 id:
b8375da9 7758 $ref: '#/components/schemas/id'
f4d59981
RK
7759 threadId:
7760 type: integer
7761 video:
7762 $ref: '#/components/schemas/VideoInfo'
7763 account:
7764 $ref: '#/components/schemas/ActorInfo'
7765 videoAbuse:
7766 nullable: true
7767 type: object
7768 properties:
7769 id:
b8375da9 7770 $ref: '#/components/schemas/id'
f4d59981
RK
7771 video:
7772 allOf:
7773 - $ref: '#/components/schemas/VideoInfo'
7774 videoBlacklist:
7775 nullable: true
7776 type: object
7777 properties:
7778 id:
b8375da9 7779 $ref: '#/components/schemas/id'
f4d59981
RK
7780 video:
7781 allOf:
7782 - $ref: '#/components/schemas/VideoInfo'
7783 account:
7784 nullable: true
7785 allOf:
7786 - $ref: '#/components/schemas/ActorInfo'
7787 actorFollow:
7788 type: object
7789 nullable: true
7790 properties:
7791 id:
b8375da9 7792 $ref: '#/components/schemas/id'
f4d59981
RK
7793 follower:
7794 $ref: '#/components/schemas/ActorInfo'
7795 state:
7796 type: string
7797 enum:
7798 - pending
7799 - accepted
7800 following:
7801 type: object
7802 properties:
7803 type:
7804 type: string
7805 enum:
7806 - account
7807 - channel
7808 - instance
7809 name:
7810 type: string
7811 displayName:
7812 type: string
7813 host:
7814 type: string
84f6e32c 7815 format: hostname
f4d59981
RK
7816 createdAt:
7817 type: string
7818 format: date-time
7819 updatedAt:
7820 type: string
7821 format: date-time
7822 NotificationListResponse:
7823 properties:
7824 total:
7825 type: integer
84f6e32c 7826 example: 1
f4d59981
RK
7827 data:
7828 type: array
84f6e32c 7829 maxItems: 100
f4d59981 7830 items:
7461d440
RK
7831 $ref: '#/components/schemas/Notification'
7832 Plugin:
7833 properties:
7834 name:
7835 type: string
84f6e32c 7836 example: peertube-plugin-auth-ldap
7461d440
RK
7837 type:
7838 type: integer
84f6e32c
RK
7839 description: >
7840 - `1`: PLUGIN
7841
7842 - `2`: THEME
7461d440
RK
7843 enum:
7844 - 1
7845 - 2
7846 latestVersion:
7847 type: string
84f6e32c 7848 example: 0.0.3
7461d440
RK
7849 version:
7850 type: string
84f6e32c 7851 example: 0.0.1
7461d440
RK
7852 enabled:
7853 type: boolean
7854 uninstalled:
7855 type: boolean
7856 peertubeEngine:
7857 type: string
84f6e32c 7858 example: 2.2.0
7461d440
RK
7859 description:
7860 type: string
7861 homepage:
7862 type: string
84f6e32c
RK
7863 format: url
7864 example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap
7461d440
RK
7865 settings:
7866 type: object
7867 additionalProperties: true
7868 createdAt:
7869 type: string
7870 format: date-time
7871 updatedAt:
7872 type: string
7873 format: date-time
7874 PluginResponse:
7875 properties:
7876 total:
7877 type: integer
84f6e32c 7878 example: 1
7461d440
RK
7879 data:
7880 type: array
84f6e32c 7881 maxItems: 100
7461d440 7882 items:
2c318664 7883 $ref: '#/components/schemas/Plugin'
4e239e35
C
7884
7885 LiveVideoUpdate:
7886 properties:
7887 saveReplay:
7888 type: boolean
bb4ba6d9
C
7889 permanentLive:
7890 description: User can stream multiple times in a permanent live
7891 type: boolean
f443a746
C
7892 latencyMode:
7893 description: User can select live latency mode if enabled by the instance
7894 $ref: '#/components/schemas/LiveVideoLatencyMode'
4e239e35
C
7895
7896 LiveVideoResponse:
7897 properties:
7898 rtmpUrl:
7899 type: string
961cbe42 7900 description: Included in the response if an appropriate token is provided
df1db951
C
7901 rtmpsUrl:
7902 type: string
961cbe42 7903 description: Included in the response if an appropriate token is provided
4e239e35
C
7904 streamKey:
7905 type: string
961cbe42 7906 description: RTMP stream key to use to stream into this live video. Included in the response if an appropriate token is provided
4e239e35
C
7907 saveReplay:
7908 type: boolean
bb4ba6d9
C
7909 permanentLive:
7910 description: User can stream multiple times in a permanent live
7911 type: boolean
f443a746
C
7912 latencyMode:
7913 description: User can select live latency mode if enabled by the instance
7914 $ref: '#/components/schemas/LiveVideoLatencyMode'
75cba40d 7915
26e3e98f
C
7916 LiveVideoSessionResponse:
7917 properties:
7918 id:
7919 type: integer
7920 startDate:
7921 type: string
7922 format: date-time
7923 description: Start date of the live session
7924 endDate:
7925 type: string
7926 format: date-time
7927 nullable: true
7928 description: End date of the live session
7929 error:
7930 type: integer
7931 enum:
7932 - 1
7933 - 2
7934 - 3
7935 - 4
7936 - 5
7937 nullable: true
7938 description: >
7a4fd56c 7939 Error type if an error occurred during the live session:
26e3e98f
C
7940 - `1`: Bad socket health (transcoding is too slow)
7941 - `2`: Max duration exceeded
7942 - `3`: Quota exceeded
7943 - `4`: Quota FFmpeg error
7944 - `5`: Video has been blacklisted during the live
7945 replayVideo:
7946 type: object
7947 description: Video replay information
7948 properties:
7949 id:
7950 type: number
7951 uuid:
7952 $ref: '#/components/schemas/UUIDv4'
7953 shortUUID:
7954 $ref: '#/components/schemas/shortUUID'
7955
2c318664
RK
7956 callbacks:
7957 searchIndex:
c00f96ce 7958 'https://search.example.org/api/v1/search/videos':
2c318664
RK
7959 post:
7960 summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`
7961 responses:
7962 '200':
7963 description: successful operation
7964 content:
7965 application/json:
7966 schema:
1e904cde 7967 $ref: '#/components/schemas/VideoListResponse'