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