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