]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/api/openapi.yaml
Update open api routes
[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
4784 description: Sort videos by criteria
4785 schema:
4786 type: string
4787 enum:
04b703f6 4788 - name
fd5af7a2
RK
4789 - -duration
4790 - -createdAt
4791 - -publishedAt
4792 - -views
4793 - -likes
4794 - -trending
923d3d5a 4795 - -hot
fd5af7a2
RK
4796 videosSearchSort:
4797 name: sort
4798 in: query
4799 required: false
4800 description: Sort videos by criteria
4801 schema:
4802 type: string
4803 enum:
04b703f6 4804 - name
fd5af7a2
RK
4805 - -duration
4806 - -createdAt
4807 - -publishedAt
4808 - -views
4809 - -likes
4810 - -match
71810d0b
RK
4811 commentsSort:
4812 name: sort
4813 in: query
4814 required: false
4815 description: Sort comments by criteria
4816 schema:
4817 type: string
4818 enum:
4819 - -createdAt
4820 - -totalReplies
fd5af7a2
RK
4821 blacklistsSort:
4822 name: sort
4823 in: query
4824 required: false
c756bae0 4825 description: Sort blocklists by criteria
fd5af7a2
RK
4826 schema:
4827 type: string
4828 enum:
4829 - -id
04b703f6 4830 - name
fd5af7a2
RK
4831 - -duration
4832 - -views
4833 - -likes
4834 - -dislikes
4835 - -uuid
4836 - -createdAt
8491293b
RK
4837 usersSearch:
4838 name: search
4839 in: query
4840 required: false
4841 description: Plain text search that will match with user usernames or emails
4842 schema:
4843 type: string
4844 usersBlocked:
4845 name: blocked
4846 in: query
4847 required: false
4848 description: Filter results down to (un)banned users
4849 schema:
4850 type: boolean
fd5af7a2
RK
4851 usersSort:
4852 name: sort
4853 in: query
4854 required: false
4855 description: Sort users by criteria
4856 schema:
4857 type: string
4858 enum:
4859 - -id
4860 - -username
4861 - -createdAt
4862 abusesSort:
4863 name: sort
4864 in: query
4865 required: false
4866 description: Sort abuses by criteria
4867 schema:
4868 type: string
4869 enum:
4870 - -id
4871 - -createdAt
4872 - -state
04b703f6
RK
4873 videoRedundanciesSort:
4874 name: sort
4875 in: query
4876 required: false
4877 description: Sort abuses by criteria
4878 schema:
4879 type: string
4880 enum:
4881 - name
906f46d0
C
4882 followersSort:
4883 name: sort
4884 in: query
4885 required: false
4886 description: Sort followers by criteria
4887 schema:
4888 type: string
4889 enum:
4890 - createdAt
3e9e6f2f
RK
4891 name:
4892 name: name
4893 in: path
4894 required: true
f2eb23cd 4895 description: The username or handle of the account
3e9e6f2f
RK
4896 schema:
4897 type: string
84f6e32c 4898 example: chocobozzz | chocobozzz@example.org
3e9e6f2f
RK
4899 id:
4900 name: id
4901 in: path
4902 required: true
419b520c 4903 description: Entity id
3e9e6f2f 4904 schema:
b8375da9 4905 $ref: '#/components/schemas/id'
cb9d028a 4906 idOrUUID:
3e9e6f2f
RK
4907 name: id
4908 in: path
4909 required: true
d4a8e7a6 4910 description: The object id, uuid or short uuid
3e9e6f2f 4911 schema:
84f6e32c 4912 oneOf:
b8375da9 4913 - $ref: '#/components/schemas/id'
f880a5e7 4914 - $ref: '#/components/schemas/UUIDv4'
d4a8e7a6 4915 - $ref: '#/components/schemas/shortUUID'
c00100b6
RK
4916 playlistId:
4917 name: playlistId
4918 in: path
4919 required: true
4920 description: Playlist id
4921 schema:
4922 $ref: '#/components/schemas/VideoPlaylist/properties/id'
c1843150
C
4923 playlistElementId:
4924 name: playlistElementId
4925 in: path
4926 required: true
4927 description: Playlist element id
4928 schema:
b8375da9 4929 $ref: '#/components/schemas/id'
50e16ccf
C
4930 abuseId:
4931 name: abuseId
4932 in: path
4933 required: true
310b5219 4934 description: Abuse id
50e16ccf 4935 schema:
b8375da9 4936 $ref: '#/components/schemas/Abuse/properties/id'
668b7f09
C
4937 abuseMessageId:
4938 name: abuseMessageId
4939 in: path
4940 required: true
4941 description: Abuse message id
4942 schema:
b8375da9 4943 $ref: '#/components/schemas/AbuseMessage/properties/id'
67ae04a5
C
4944 captionLanguage:
4945 name: captionLanguage
4946 in: path
4947 required: true
4948 description: The caption language
4949 schema:
b8375da9 4950 $ref: '#/components/schemas/VideoLanguageSet'
9ce3d302
C
4951 channelHandle:
4952 name: channelHandle
3e9e6f2f
RK
4953 in: path
4954 required: true
84f6e32c 4955 description: The video channel handle
3e9e6f2f
RK
4956 schema:
4957 type: string
84f6e32c 4958 example: my_username | my_username@example.com
cb9d028a
C
4959 subscriptionHandle:
4960 name: subscriptionHandle
4961 in: path
4962 required: true
84f6e32c 4963 description: The subscription handle
cb9d028a
C
4964 schema:
4965 type: string
84f6e32c 4966 example: my_username | my_username@example.com
cb9d028a 4967 threadId:
3e9e6f2f
RK
4968 name: threadId
4969 in: path
4970 required: true
cb9d028a
C
4971 description: The thread id (root comment id)
4972 schema:
85a60d8b 4973 type: integer
cb9d028a
C
4974 commentId:
4975 name: commentId
4976 in: path
4977 required: true
3e9e6f2f
RK
4978 description: The comment id
4979 schema:
b8375da9 4980 $ref: '#/components/schemas/VideoComment/properties/id'
1fd61899
C
4981 isLive:
4982 name: isLive
4983 in: query
4984 required: false
4985 description: whether or not the video is a live
4986 schema:
4987 type: boolean
fd5af7a2
RK
4988 categoryOneOf:
4989 name: categoryOneOf
4990 in: query
4991 required: false
40cfb36b 4992 description: category id of the video (see [/videos/categories](#operation/getCategories))
fd5af7a2
RK
4993 schema:
4994 oneOf:
b8375da9 4995 - $ref: '#/components/schemas/VideoCategorySet'
fd5af7a2
RK
4996 - type: array
4997 items:
b8375da9 4998 $ref: '#/components/schemas/VideoCategorySet'
2beb9895
RK
4999 style: form
5000 explode: false
fd5af7a2
RK
5001 tagsOneOf:
5002 name: tagsOneOf
5003 in: query
5004 required: false
5005 description: tag(s) of the video
5006 schema:
5007 oneOf:
5008 - type: string
5009 - type: array
f6d6e7f8 5010 maxItems: 5
fd5af7a2
RK
5011 items:
5012 type: string
2beb9895
RK
5013 style: form
5014 explode: false
fd5af7a2
RK
5015 tagsAllOf:
5016 name: tagsAllOf
5017 in: query
5018 required: false
5019 description: tag(s) of the video, where all should be present in the video
5020 schema:
5021 oneOf:
5022 - type: string
5023 - type: array
5024 items:
5025 type: string
2beb9895
RK
5026 style: form
5027 explode: false
fd5af7a2
RK
5028 languageOneOf:
5029 name: languageOneOf
5030 in: query
5031 required: false
40cfb36b 5032 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
5033 schema:
5034 oneOf:
b8375da9 5035 - $ref: '#/components/schemas/VideoLanguageSet'
fd5af7a2
RK
5036 - type: array
5037 items:
b8375da9 5038 $ref: '#/components/schemas/VideoLanguageSet'
2beb9895
RK
5039 style: form
5040 explode: false
fd5af7a2
RK
5041 licenceOneOf:
5042 name: licenceOneOf
5043 in: query
5044 required: false
40cfb36b 5045 description: licence id of the video (see [/videos/licences](#operation/getLicences))
fd5af7a2
RK
5046 schema:
5047 oneOf:
b8375da9 5048 - $ref: '#/components/schemas/VideoLicenceSet'
fd5af7a2
RK
5049 - type: array
5050 items:
b8375da9 5051 $ref: '#/components/schemas/VideoLicenceSet'
2beb9895
RK
5052 style: form
5053 explode: false
59c794a5
C
5054 skipCount:
5055 name: skipCount
5056 in: query
5057 required: false
5058 description: if you don't need the `total` in the response
5059 schema:
5060 type: string
5061 enum:
5062 - 'true'
5063 - 'false'
06746a8b 5064 default: 'false'
fd5af7a2
RK
5065 nsfw:
5066 name: nsfw
5067 in: query
5068 required: false
5069 description: whether to include nsfw videos, if any
5070 schema:
5071 type: string
5072 enum:
5073 - 'true'
5074 - 'false'
2760b454
C
5075 isLocal:
5076 name: isLocal
fd5af7a2
RK
5077 in: query
5078 required: false
fd5af7a2 5079 schema:
2760b454 5080 type: boolean
7e7d8e48 5081 description: '**PeerTube >= 4.0** Display only local or remote videos'
d324756e
C
5082 hasHLSFiles:
5083 name: hasHLSFiles
5084 in: query
5085 required: false
5086 schema:
5087 type: boolean
5088 description: '**PeerTube >= 4.0** Display only videos that have HLS files'
5089 hasWebtorrentFiles:
5090 name: hasWebtorrentFiles
5091 in: query
5092 required: false
5093 schema:
5094 type: boolean
5095 description: '**PeerTube >= 4.0** Display only videos that have WebTorrent files'
527a52ac
C
5096 privacyOneOf:
5097 name: privacyOneOf
5098 in: query
5099 required: false
5100 schema:
5101 $ref: '#/components/schemas/VideoPrivacySet'
5102 description: '**PeerTube >= 4.0** Display only videos in this specific privacy/privacies'
2760b454
C
5103 include:
5104 name: include
5105 in: query
5106 required: false
5107 schema:
5108 type: integer
fd5af7a2 5109 enum:
2760b454
C
5110 - 0
5111 - 1
5112 - 2
5113 - 4
5114 - 8
5115 description: >
7e7d8e48 5116 **PeerTube >= 4.0** Include additional videos in results (can be combined using bitwise or operator)
2760b454
C
5117
5118 - `0` NONE
5119
5120 - `1` NOT_PUBLISHED_STATE
5121
527a52ac 5122 - `2` BLACKLISTED
2760b454 5123
527a52ac 5124 - `4` BLOCKED_OWNER
2760b454 5125
527a52ac 5126 - `8` FILES
e76d5784
RK
5127 subscriptionsUris:
5128 name: uris
5129 in: query
5130 required: true
5131 description: list of uris to check if each is part of the user subscriptions
5132 schema:
5133 type: array
5134 items:
5135 type: string
84f6e32c
RK
5136 format: uri
5137 npmName:
5138 name: npmName
5139 in: path
5140 required: true
5141 description: name of the plugin/theme on npmjs.com or in its package.json
5142 schema:
5143 type: string
5144 example: peertube-plugin-auth-ldap
040d6896
RK
5145 jobType:
5146 name: jobType
5147 in: query
5148 required: false
5149 description: job type
5150 schema:
5151 type: string
5152 enum:
5153 - activitypub-follow
5154 - activitypub-http-broadcast
5155 - activitypub-http-fetcher
5156 - activitypub-http-unicast
5157 - email
5158 - video-transcoding
5159 - video-file-import
5160 - video-import
51353d9a 5161 - videos-views-stats
040d6896
RK
5162 - activitypub-refresher
5163 - video-redundancy
5164 - video-live-ending
06dc7a1b
RK
5165 followState:
5166 name: state
5167 in: query
5168 schema:
5169 type: string
5170 enum:
5171 - pending
5172 - accepted
5173 actorType:
5174 name: actorType
5175 in: query
5176 schema:
5177 type: string
5178 enum:
5179 - Person
5180 - Application
5181 - Group
5182 - Service
5183 - Organization
3e9e6f2f
RK
5184 securitySchemes:
5185 OAuth2:
3c5e02f3 5186 description: |
3e9e6f2f 5187 Authenticating via OAuth requires the following steps:
3c5e02f3 5188 - Have an activated account
e2464d22
RK
5189 - [Generate] an access token for that account at `/api/v1/users/token`.
5190 - Make requests with the *Authorization: Bearer <token\>* header
3c5e02f3 5191 - Profit, depending on the role assigned to the account
3e9e6f2f 5192
e2464d22 5193 Note that the __access token is valid for 1 day__ and is given
3c5e02f3 5194 along with a __refresh token valid for 2 weeks__.
e2464d22
RK
5195
5196 [Generate]: https://docs.joinpeertube.org/api-rest-getting-started
3e9e6f2f
RK
5197 type: oauth2
5198 flows:
5199 password:
e2464d22 5200 tokenUrl: /api/v1/users/token
3e9e6f2f
RK
5201 scopes:
5202 admin: Admin scope
5203 moderator: Moderator scope
5204 user: User scope
5205 schemas:
b8375da9
RK
5206 # Resuable core properties
5207 id:
5208 type: integer
5209 minimum: 1
5210 example: 42
f880a5e7
RK
5211 UUIDv4:
5212 type: string
5213 format: uuid
5214 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
5215 pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
f880a5e7
RK
5216 minLength: 36
5217 maxLength: 36
d4a8e7a6
C
5218 shortUUID:
5219 type: string
5220 description: translation of a uuid v4 with a bigger alphabet to have a shorter uuid
5221 example: 2y84q2MQUMWPbiEcxNXMgC
b8375da9
RK
5222 username:
5223 type: string
77b0c6b5 5224 description: immutable name of the user, used to find or mention its actor
b8375da9 5225 example: chocobozzz
e2464d22 5226 pattern: '/^[a-z0-9._]+$/'
b8375da9
RK
5227 minLength: 1
5228 maxLength: 50
5229 usernameChannel:
5230 type: string
77b0c6b5 5231 description: immutable name of the channel, used to interact with its actor
9a320a06 5232 example: framasoft_videos
e2464d22
RK
5233 pattern: '/^[a-zA-Z0-9\\-_.:]+$/'
5234 minLength: 1
5235 maxLength: 50
b8375da9
RK
5236 password:
5237 type: string
5238 format: password
b8375da9
RK
5239 minLength: 6
5240 maxLength: 255
f880a5e7 5241
40cfb36b
RK
5242 VideoCategorySet:
5243 type: integer
5244 description: category id of the video (see [/videos/categories](#operation/getCategories))
b8375da9 5245 example: 15
dfcb6f50 5246 VideoConstantNumber-Category:
3e9e6f2f
RK
5247 properties:
5248 id:
40cfb36b 5249 $ref: '#/components/schemas/VideoCategorySet'
3e9e6f2f
RK
5250 label:
5251 type: string
b8375da9 5252 example: Science & Technology
40cfb36b
RK
5253
5254 VideoLicenceSet:
5255 type: integer
5256 description: licence id of the video (see [/videos/licences](#operation/getLicences))
b8375da9 5257 example: 2
dfcb6f50
RK
5258 VideoConstantNumber-Licence:
5259 properties:
5260 id:
40cfb36b 5261 $ref: '#/components/schemas/VideoLicenceSet'
dfcb6f50
RK
5262 label:
5263 type: string
b8375da9
RK
5264 example: Attribution - Share Alike
5265
40cfb36b
RK
5266 VideoLanguageSet:
5267 type: string
5268 description: language id of the video (see [/videos/languages](#operation/getLanguages))
b8375da9 5269 example: en
dfcb6f50 5270 VideoConstantString-Language:
3e9e6f2f
RK
5271 properties:
5272 id:
40cfb36b 5273 $ref: '#/components/schemas/VideoLanguageSet'
3e9e6f2f
RK
5274 label:
5275 type: string
b8375da9 5276 example: English
c1843150
C
5277
5278 VideoPlaylistPrivacySet:
5279 type: integer
5280 enum:
5281 - 1
5282 - 2
5283 - 3
40cfb36b 5284 description: Video playlist privacy policy (see [/video-playlists/privacies])
c1843150
C
5285 VideoPlaylistPrivacyConstant:
5286 properties:
5287 id:
5288 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
5289 label:
5290 type: string
5291
5292 VideoPlaylistTypeSet:
5293 type: integer
5294 enum:
5295 - 1
5296 - 2
40cfb36b 5297 description: The video playlist type (Regular = `1`, Watch Later = `2`)
c1843150
C
5298 VideoPlaylistTypeConstant:
5299 properties:
5300 id:
5301 $ref: '#/components/schemas/VideoPlaylistTypeSet'
5302 label:
5303 type: string
5304
ee89e8fd
C
5305 VideoPrivacySet:
5306 type: integer
3e9e6f2f 5307 enum:
ee89e8fd
C
5308 - 1
5309 - 2
5310 - 3
c1843150 5311 - 4
40cfb36b 5312 description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies))
ee89e8fd
C
5313 VideoPrivacyConstant:
5314 properties:
5315 id:
c1843150 5316 $ref: '#/components/schemas/VideoPrivacySet'
ee89e8fd
C
5317 label:
5318 type: string
50e16ccf 5319
bdf70330
C
5320 BlockStatus:
5321 properties:
5322 accounts:
5323 type: object
5324 additionalProperties:
5325 x-additionalPropertiesName: account
5326 type: object
5327 properties:
5328 blockedByServer:
5329 type: boolean
5330 blockedByUser:
5331 type: boolean
5332 hosts:
5333 type: object
5334 additionalProperties:
5335 x-additionalPropertiesName: host
5336 type: object
5337 properties:
5338 blockedByServer:
5339 type: boolean
5340 blockedByUser:
5341 type: boolean
5342
0590bb46
C
5343 NSFWPolicy:
5344 type: string
5345 enum:
5346 - display
5347 - blur
5348 - do_not_list
5349
5350 UserRole:
06746a8b 5351 type: integer
0590bb46
C
5352 enum:
5353 - 0
5354 - 1
5355 - 2
06746a8b 5356 description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
2c318664 5357 example: 2
6d989edc
C
5358 UserAdminFlags:
5359 type: integer
5360 enum:
5361 - 0
5362 - 1
c756bae0 5363 description: 'Admin flags for the user (None = `0`, Bypass video blocklist = `1`)'
6d989edc 5364 example: 1
0590bb46 5365
f443a746
C
5366 LiveVideoLatencyMode:
5367 type: integer
5368 enum:
5369 - 1
5370 - 2
5371 - 3
5372 description: 'The live latency mode (Default = `1`, HIght latency = `2`, Small Latency = `3`)'
5373
5dce26d2
C
5374 VideoStateConstant:
5375 properties:
5376 id:
5377 type: integer
5378 enum:
5379 - 1
5380 - 2
5381 - 3
06746a8b 5382 description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
5dce26d2
C
5383 label:
5384 type: string
50e16ccf 5385
4f32032f 5386 AbuseStateSet:
50e16ccf
C
5387 type: integer
5388 enum:
5389 - 1
5390 - 2
5391 - 3
668b7f09 5392 description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)'
4f32032f 5393 AbuseStateConstant:
50e16ccf
C
5394 properties:
5395 id:
4f32032f 5396 $ref: '#/components/schemas/AbuseStateSet'
50e16ccf
C
5397 label:
5398 type: string
4f32032f 5399 AbusePredefinedReasons:
1ebddadd
RK
5400 type: array
5401 items:
5402 type: string
5403 enum:
5404 - violentOrAbusive
5405 - hatefulOrAbusive
5406 - spamOrMisleading
5407 - privacy
5408 - rights
5409 - serverRules
5410 - thumbnails
5411 - captions
84f6e32c 5412 example: [spamOrMisleading]
50e16ccf 5413
40cfb36b
RK
5414 VideoResolutionSet:
5415 type: integer
5416 description: |
5417 Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`)
5418
5419 `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos.
5420 example: 240
5dce26d2 5421 VideoResolutionConstant:
2c4876f2 5422 description: resolutions and their labels for the video
5dce26d2
C
5423 properties:
5424 id:
40cfb36b 5425 $ref: '#/components/schemas/VideoResolutionSet'
5dce26d2
C
5426 label:
5427 type: string
84f6e32c 5428 example: 240p
5dce26d2
C
5429 VideoScheduledUpdate:
5430 properties:
5431 privacy:
5432 $ref: '#/components/schemas/VideoPrivacySet'
5dce26d2
C
5433 updateAt:
5434 type: string
5435 format: date
5436 description: When to update the video
5437 required:
5438 - updateAt
c1843150 5439 AccountSummary:
5dce26d2
C
5440 properties:
5441 id:
06746a8b 5442 type: integer
5dce26d2
C
5443 name:
5444 type: string
5445 displayName:
5446 type: string
5447 url:
5448 type: string
84f6e32c 5449 format: url
5dce26d2
C
5450 host:
5451 type: string
84f6e32c 5452 format: hostname
d0800f76 5453 avatars:
5454 type: array
5455 items:
5456 $ref: '#/components/schemas/ActorImage'
5dce26d2
C
5457 VideoChannelSummary:
5458 properties:
5459 id:
b8375da9 5460 $ref: '#/components/schemas/id'
5dce26d2
C
5461 name:
5462 type: string
5463 displayName:
5464 type: string
5465 url:
5466 type: string
84f6e32c 5467 format: url
5dce26d2
C
5468 host:
5469 type: string
84f6e32c 5470 format: hostname
d0800f76 5471 avatars:
5472 type: array
5473 items:
5474 $ref: '#/components/schemas/ActorImage'
5dce26d2
C
5475 PlaylistElement:
5476 properties:
5477 position:
06746a8b 5478 type: integer
5dce26d2 5479 startTimestamp:
06746a8b 5480 type: integer
c00100b6 5481 format: seconds
5dce26d2 5482 stopTimestamp:
06746a8b 5483 type: integer
c00100b6 5484 format: seconds
bfbd9128
C
5485 video:
5486 nullable: true
c1843150
C
5487 allOf:
5488 - $ref: '#/components/schemas/Video'
5dce26d2 5489 VideoFile:
2c4876f2 5490 readOnly: true
5dce26d2
C
5491 properties:
5492 magnetUri:
5493 type: string
2c4876f2
RK
5494 format: uri
5495 description: magnet URI allowing to resolve the video via BitTorrent without a metainfo file
2c4876f2 5496 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
5dce26d2
C
5497 resolution:
5498 $ref: '#/components/schemas/VideoResolutionConstant'
5499 size:
06746a8b 5500 type: integer
2c4876f2 5501 description: Video file size in bytes
5dce26d2
C
5502 torrentUrl:
5503 type: string
e81af300 5504 description: Direct URL of the torrent file
84f6e32c 5505 format: url
0ad45af7 5506 torrentDownloadUrl:
5dce26d2 5507 type: string
e81af300 5508 description: URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog)
84f6e32c 5509 format: url
5dce26d2
C
5510 fileUrl:
5511 type: string
e81af300 5512 description: Direct URL of the video
84f6e32c 5513 format: url
5dce26d2
C
5514 fileDownloadUrl:
5515 type: string
e81af300 5516 description: URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog)
84f6e32c 5517 format: url
5dce26d2
C
5518 fps:
5519 type: number
2c4876f2 5520 description: Frames per second of the video file
63748ad0
C
5521 metadataUrl:
5522 type: string
84f6e32c 5523 format: url
2c4876f2 5524 description: URL dereferencing the output of ffprobe on the file
5dce26d2 5525 VideoStreamingPlaylists:
4ca669e3
RK
5526 allOf:
5527 - type: object
5528 properties:
5529 id:
b8375da9 5530 $ref: '#/components/schemas/id'
4ca669e3
RK
5531 type:
5532 type: integer
5533 enum:
5534 - 1
5535 description: |
5536 Playlist type:
5537 - `1`: HLS
5538 - $ref: '#/components/schemas/VideoStreamingPlaylists-HLS'
5539 VideoStreamingPlaylists-HLS:
5dce26d2 5540 properties:
5dce26d2
C
5541 playlistUrl:
5542 type: string
84f6e32c 5543 format: url
5dce26d2
C
5544 segmentsSha256Url:
5545 type: string
84f6e32c 5546 format: url
63748ad0
C
5547 files:
5548 type: array
c540d865
RK
5549 description: |
5550 Video files associated to this playlist.
5551
5552 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
5553 items:
5554 $ref: '#/components/schemas/VideoFile'
5dce26d2
C
5555 redundancies:
5556 type: array
5557 items:
5558 type: object
5559 properties:
5560 baseUrl:
5561 type: string
84f6e32c 5562 format: url
f4d59981
RK
5563 VideoInfo:
5564 properties:
5565 id:
b8375da9 5566 $ref: '#/components/schemas/Video/properties/id'
f4d59981 5567 uuid:
b8375da9 5568 $ref: '#/components/schemas/Video/properties/uuid'
f4d59981 5569 name:
b8375da9 5570 $ref: '#/components/schemas/Video/properties/name'
3e9e6f2f
RK
5571 Video:
5572 properties:
5573 id:
b8375da9
RK
5574 description: object id for the video
5575 allOf:
5576 - $ref: '#/components/schemas/id'
3e9e6f2f 5577 uuid:
b8375da9
RK
5578 description: universal identifier for the video, that can be used across instances
5579 allOf:
5580 - $ref: '#/components/schemas/UUIDv4'
d4a8e7a6
C
5581 shortUUID:
5582 allOf:
5583 - $ref: '#/components/schemas/shortUUID'
4e239e35
C
5584 isLive:
5585 type: boolean
3e9e6f2f
RK
5586 createdAt:
5587 type: string
84f6e32c 5588 format: date-time
0c114568
RK
5589 example: 2017-10-01T10:52:46.396Z
5590 description: time at which the video object was first drafted
3e9e6f2f
RK
5591 publishedAt:
5592 type: string
84f6e32c 5593 format: date-time
0c114568
RK
5594 example: 2018-10-01T10:52:46.396Z
5595 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
5596 updatedAt:
5597 type: string
84f6e32c 5598 format: date-time
0c114568
RK
5599 example: 2021-05-04T08:01:01.502Z
5600 description: last time the video's metadata was modified
5dce26d2
C
5601 originallyPublishedAt:
5602 type: string
84f6e32c 5603 format: date-time
0c114568
RK
5604 example: 2010-10-01T10:52:46.396Z
5605 description: used to represent a date of first publication, prior to the practical publication date of `publishedAt`
3e9e6f2f 5606 category:
b8375da9
RK
5607 allOf:
5608 - $ref: '#/components/schemas/VideoConstantNumber-Category'
5609 description: category in which the video is classified
3e9e6f2f 5610 licence:
b8375da9
RK
5611 allOf:
5612 - $ref: '#/components/schemas/VideoConstantNumber-Licence'
5613 description: licence under which the video is distributed
3e9e6f2f 5614 language:
b8375da9
RK
5615 allOf:
5616 - $ref: '#/components/schemas/VideoConstantString-Language'
5617 description: main language used in the video
3e9e6f2f 5618 privacy:
b8375da9
RK
5619 allOf:
5620 - $ref: '#/components/schemas/VideoPrivacyConstant'
5621 description: privacy policy used to distribute the video
3e9e6f2f
RK
5622 description:
5623 type: string
0c114568
RK
5624 example: |
5625 **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n
5626 **Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network, based on fr...
5627 minLength: 3
5628 maxLength: 250
5629 description: |
5630 truncated description of the video, written in Markdown.
5631 Resolve `descriptionPath` to get the full description of maximum `10000` characters.
3e9e6f2f 5632 duration:
06746a8b 5633 type: integer
84f6e32c 5634 example: 1419
c00100b6 5635 format: seconds
0c114568 5636 description: duration of the video in seconds
3e9e6f2f
RK
5637 isLocal:
5638 type: boolean
5639 name:
5640 type: string
b8375da9 5641 description: title of the video
84f6e32c 5642 example: What is PeerTube?
bdac0584
RK
5643 minLength: 3
5644 maxLength: 120
3e9e6f2f
RK
5645 thumbnailPath:
5646 type: string
84f6e32c 5647 example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
5648 previewPath:
5649 type: string
20dcfd74 5650 example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
5651 embedPath:
5652 type: string
84f6e32c 5653 example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
3e9e6f2f 5654 views:
06746a8b 5655 type: integer
84f6e32c 5656 example: 1337
3e9e6f2f 5657 likes:
06746a8b 5658 type: integer
84f6e32c 5659 example: 42
3e9e6f2f 5660 dislikes:
06746a8b 5661 type: integer
84f6e32c 5662 example: 7
3e9e6f2f
RK
5663 nsfw:
5664 type: boolean
5dce26d2
C
5665 waitTranscoding:
5666 type: boolean
5667 nullable: true
5668 state:
b8375da9
RK
5669 allOf:
5670 - $ref: '#/components/schemas/VideoStateConstant'
5671 description: represents the internal state of the video processing within the PeerTube instance
5dce26d2
C
5672 scheduledUpdate:
5673 nullable: true
c1843150
C
5674 allOf:
5675 - $ref: '#/components/schemas/VideoScheduledUpdate'
5dce26d2
C
5676 blacklisted:
5677 nullable: true
5678 type: boolean
5679 blacklistedReason:
5680 nullable: true
5681 type: string
3e9e6f2f 5682 account:
c1843150 5683 $ref: '#/components/schemas/AccountSummary'
5dce26d2
C
5684 channel:
5685 $ref: '#/components/schemas/VideoChannelSummary'
5686 userHistory:
5687 nullable: true
3e9e6f2f
RK
5688 type: object
5689 properties:
5dce26d2 5690 currentTime:
06746a8b 5691 type: integer
5dce26d2
C
5692 VideoDetails:
5693 allOf:
5694 - $ref: '#/components/schemas/Video'
5695 - type: object
5696 properties:
51353d9a
C
5697 viewers:
5698 type: integer
5699 description: If the video is a live, you have the amount of current viewers
5dce26d2 5700 descriptionPath:
3e9e6f2f 5701 type: string
0c114568
RK
5702 example: /api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180a6d/description
5703 description: path at which to get the full description of maximum `10000` characters
5dce26d2 5704 support:
3e9e6f2f 5705 type: string
00494d6e 5706 description: A text tell the audience how to support the video creator
9a320a06 5707 example: Please support our work on https://soutenir.framasoft.org/en/ <3
c540d865
RK
5708 minLength: 3
5709 maxLength: 1000
5dce26d2
C
5710 channel:
5711 $ref: '#/components/schemas/VideoChannel'
5712 account:
5713 $ref: '#/components/schemas/Account'
5714 tags:
bdac0584 5715 example: [flowers, gardening]
5dce26d2 5716 type: array
bdac0584
RK
5717 minItems: 1
5718 maxItems: 5
5dce26d2
C
5719 items:
5720 type: string
bdac0584
RK
5721 minLength: 2
5722 maxLength: 30
5dce26d2
C
5723 commentsEnabled:
5724 type: boolean
5725 downloadEnabled:
5726 type: boolean
5727 trackerUrls:
5728 type: array
5729 items:
5730 type: string
84f6e32c 5731 format: url
2c4876f2
RK
5732 example:
5733 - https://peertube2.cpy.re/tracker/announce
5734 - wss://peertube2.cpy.re/tracker/socket
c540d865
RK
5735 files:
5736 type: array
5737 items:
5738 $ref: '#/components/schemas/VideoFile'
5739 description: |
5740 WebTorrent/raw video files. If WebTorrent is disabled on the server:
5741
5742 - field will be empty
5743 - video files will be found in `streamingPlaylists[].files` field
5dce26d2
C
5744 streamingPlaylists:
5745 type: array
5746 items:
5747 $ref: '#/components/schemas/VideoStreamingPlaylists'
c540d865
RK
5748 description: |
5749 HLS playlists/manifest files. If HLS is disabled on the server:
5750
5751 - field will be empty
5752 - video files will be found in `files` field
04b703f6
RK
5753 FileRedundancyInformation:
5754 properties:
5755 id:
b8375da9 5756 $ref: '#/components/schemas/id'
04b703f6
RK
5757 fileUrl:
5758 type: string
84f6e32c 5759 format: url
04b703f6
RK
5760 strategy:
5761 type: string
84f6e32c
RK
5762 enum:
5763 - manual
5764 - most-views
5765 - trending
5766 - recently-added
04b703f6
RK
5767 size:
5768 type: integer
5769 createdAt:
5770 type: string
5771 format: date-time
5772 updatedAt:
5773 type: string
5774 format: date-time
5775 expiresOn:
5776 type: string
5777 format: date-time
5778 VideoRedundancy:
5779 properties:
5780 id:
b8375da9 5781 $ref: '#/components/schemas/id'
04b703f6
RK
5782 name:
5783 type: string
5784 url:
5785 type: string
84f6e32c 5786 format: url
04b703f6 5787 uuid:
f880a5e7 5788 $ref: '#/components/schemas/UUIDv4'
04b703f6
RK
5789 redundancies:
5790 type: object
5791 properties:
5792 files:
5793 type: array
5794 items:
1e904cde 5795 $ref: '#/components/schemas/FileRedundancyInformation'
04b703f6
RK
5796 streamingPlaylists:
5797 type: array
5798 items:
1e904cde 5799 $ref: '#/components/schemas/FileRedundancyInformation'
1f82e3e8
C
5800 VideoImportStateConstant:
5801 properties:
5802 id:
5803 type: integer
5804 enum:
5805 - 1
5806 - 2
5807 - 3
06746a8b 5808 description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
1f82e3e8
C
5809 label:
5810 type: string
84f6e32c 5811 example: Pending
ac2a5b54
RK
5812 VideoCreateImport:
5813 allOf:
5814 - type: object
5815 additionalProperties: false
5816 oneOf:
5817 - properties:
5818 targetUrl:
5819 $ref: '#/components/schemas/VideoImport/properties/targetUrl'
5820 required: [targetUrl]
5821 - properties:
5822 magnetUri:
5823 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
5824 required: [magnetUri]
5825 - properties:
5826 torrentfile:
5827 $ref: '#/components/schemas/VideoImport/properties/torrentfile'
5828 required: [torrentfile]
5829 - $ref: '#/components/schemas/VideoUploadRequestCommon'
5830 required:
5831 - channelId
5832 - name
1f82e3e8
C
5833 VideoImport:
5834 properties:
5835 id:
ac2a5b54
RK
5836 readOnly: true
5837 allOf:
5838 - $ref: '#/components/schemas/id'
1f82e3e8
C
5839 targetUrl:
5840 type: string
84f6e32c 5841 format: url
2c4876f2 5842 description: remote URL where to find the import's source video
84f6e32c 5843 example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
1f82e3e8
C
5844 magnetUri:
5845 type: string
84f6e32c 5846 format: uri
2c4876f2 5847 description: magnet URI allowing to resolve the import's source video
2c4876f2 5848 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
ac2a5b54
RK
5849 torrentfile:
5850 writeOnly: true
5851 type: string
5852 format: binary
5853 description: Torrent file containing only the video file
1f82e3e8 5854 torrentName:
ac2a5b54 5855 readOnly: true
1f82e3e8
C
5856 type: string
5857 state:
ac2a5b54
RK
5858 readOnly: true
5859 allOf:
5860 - $ref: '#/components/schemas/VideoImportStateConstant'
1f82e3e8 5861 error:
ac2a5b54 5862 readOnly: true
1f82e3e8
C
5863 type: string
5864 createdAt:
ac2a5b54 5865 readOnly: true
1f82e3e8 5866 type: string
84f6e32c 5867 format: date-time
1f82e3e8 5868 updatedAt:
ac2a5b54 5869 readOnly: true
1f82e3e8 5870 type: string
84f6e32c 5871 format: date-time
1f82e3e8 5872 video:
ac2a5b54 5873 readOnly: true
2c4876f2
RK
5874 nullable: true
5875 allOf:
5876 - $ref: '#/components/schemas/Video'
5844dde3
RK
5877 VideoImportsList:
5878 properties:
5879 total:
5880 type: integer
5881 example: 1
5882 data:
5883 type: array
5884 maxItems: 100
5885 items:
5886 $ref: '#/components/schemas/VideoImport'
668b7f09 5887 Abuse:
3e9e6f2f
RK
5888 properties:
5889 id:
b8375da9 5890 $ref: '#/components/schemas/id'
3e9e6f2f
RK
5891 reason:
5892 type: string
84f6e32c 5893 example: The video is a spam
4302058c
RK
5894 minLength: 2
5895 maxLength: 3000
1ebddadd 5896 predefinedReasons:
4f32032f 5897 $ref: '#/components/schemas/AbusePredefinedReasons'
3e9e6f2f
RK
5898 reporterAccount:
5899 $ref: '#/components/schemas/Account'
50e16ccf 5900 state:
4f32032f 5901 $ref: '#/components/schemas/AbuseStateConstant'
50e16ccf
C
5902 moderationComment:
5903 type: string
84f6e32c 5904 example: Decided to ban the server since it spams us regularly
4302058c
RK
5905 minLength: 2
5906 maxLength: 3000
3e9e6f2f 5907 video:
bdac0584 5908 $ref: '#/components/schemas/VideoInfo'
3e9e6f2f
RK
5909 createdAt:
5910 type: string
84f6e32c 5911 format: date-time
668b7f09
C
5912 AbuseMessage:
5913 properties:
5914 id:
b8375da9 5915 $ref: '#/components/schemas/id'
668b7f09
C
5916 message:
5917 type: string
4302058c 5918 minLength: 2
f6d6e7f8 5919 maxLength: 3000
668b7f09
C
5920 byModerator:
5921 type: boolean
5922 createdAt:
5923 type: string
5924 format: date-time
5925 account:
5926 $ref: '#/components/schemas/AccountSummary'
3e9e6f2f
RK
5927 VideoBlacklist:
5928 properties:
5929 id:
b8375da9 5930 $ref: '#/components/schemas/id'
3e9e6f2f 5931 videoId:
b8375da9 5932 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f
RK
5933 createdAt:
5934 type: string
84f6e32c 5935 format: date-time
3e9e6f2f
RK
5936 updatedAt:
5937 type: string
84f6e32c 5938 format: date-time
3e9e6f2f
RK
5939 name:
5940 type: string
4302058c
RK
5941 minLength: 3
5942 maxLength: 120
3e9e6f2f 5943 uuid:
f880a5e7 5944 $ref: '#/components/schemas/UUIDv4'
3e9e6f2f
RK
5945 description:
5946 type: string
4302058c
RK
5947 minLength: 3
5948 maxLength: 10000
3e9e6f2f 5949 duration:
06746a8b 5950 type: integer
3e9e6f2f 5951 views:
06746a8b 5952 type: integer
3e9e6f2f 5953 likes:
06746a8b 5954 type: integer
3e9e6f2f 5955 dislikes:
06746a8b 5956 type: integer
3e9e6f2f
RK
5957 nsfw:
5958 type: boolean
71810d0b
RK
5959 VideoPlaylist:
5960 properties:
5961 id:
b8375da9
RK
5962 $ref: '#/components/schemas/id'
5963 uuid:
5964 $ref: '#/components/schemas/UUIDv4'
d4a8e7a6
C
5965 shortUUID:
5966 allOf:
5967 - $ref: '#/components/schemas/shortUUID'
71810d0b
RK
5968 createdAt:
5969 type: string
84f6e32c 5970 format: date-time
71810d0b
RK
5971 updatedAt:
5972 type: string
84f6e32c 5973 format: date-time
71810d0b
RK
5974 description:
5975 type: string
4302058c
RK
5976 minLength: 3
5977 maxLength: 1000
71810d0b
RK
5978 displayName:
5979 type: string
4302058c
RK
5980 minLength: 1
5981 maxLength: 120
71810d0b
RK
5982 isLocal:
5983 type: boolean
5984 videoLength:
06746a8b 5985 type: integer
b8375da9 5986 minimum: 0
71810d0b
RK
5987 thumbnailPath:
5988 type: string
5989 privacy:
c1843150 5990 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
71810d0b 5991 type:
c1843150 5992 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
71810d0b 5993 ownerAccount:
c1843150
C
5994 $ref: '#/components/schemas/AccountSummary'
5995 videoChannel:
5996 $ref: '#/components/schemas/VideoChannelSummary'
3e9e6f2f
RK
5997 VideoComment:
5998 properties:
5999 id:
b8375da9 6000 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6001 url:
6002 type: string
84f6e32c 6003 format: url
3e9e6f2f
RK
6004 text:
6005 type: string
bf3c3fea
RK
6006 format: html
6007 description: Text of the comment
4302058c 6008 minLength: 1
bf3c3fea 6009 example: This video is wonderful!
3e9e6f2f 6010 threadId:
b8375da9 6011 $ref: '#/components/schemas/id'
bf3c3fea
RK
6012 inReplyToCommentId:
6013 nullable: true
6014 allOf:
6015 - $ref: '#/components/schemas/id'
3e9e6f2f 6016 videoId:
b8375da9 6017 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f
RK
6018 createdAt:
6019 type: string
84f6e32c 6020 format: date-time
3e9e6f2f
RK
6021 updatedAt:
6022 type: string
84f6e32c 6023 format: date-time
bf3c3fea
RK
6024 deletedAt:
6025 nullable: true
6026 type: string
6027 format: date-time
6028 default: null
6029 isDeleted:
6030 type: boolean
6031 default: false
5b0413dd 6032 totalRepliesFromVideoAuthor:
06746a8b 6033 type: integer
b8375da9 6034 minimum: 0
3e9e6f2f 6035 totalReplies:
06746a8b 6036 type: integer
b8375da9 6037 minimum: 0
3e9e6f2f
RK
6038 account:
6039 $ref: '#/components/schemas/Account'
6040 VideoCommentThreadTree:
6041 properties:
6042 comment:
6043 $ref: '#/components/schemas/VideoComment'
6044 children:
6045 type: array
6046 items:
6047 $ref: '#/components/schemas/VideoCommentThreadTree'
67ae04a5
C
6048 VideoCaption:
6049 properties:
6050 language:
dfcb6f50 6051 $ref: '#/components/schemas/VideoConstantString-Language'
67ae04a5
C
6052 captionPath:
6053 type: string
75cba40d 6054 ActorImage:
3e9e6f2f
RK
6055 properties:
6056 path:
6057 type: string
d0800f76 6058 width:
6059 type: integer
3e9e6f2f
RK
6060 createdAt:
6061 type: string
84f6e32c 6062 format: date-time
3e9e6f2f
RK
6063 updatedAt:
6064 type: string
84f6e32c 6065 format: date-time
f4d59981
RK
6066 ActorInfo:
6067 properties:
6068 id:
b8375da9 6069 $ref: '#/components/schemas/id'
f4d59981
RK
6070 name:
6071 type: string
6072 displayName:
6073 type: string
6074 host:
6075 type: string
84f6e32c 6076 format: hostname
d0800f76 6077 avatars:
6078 type: array
6079 items:
6080 $ref: '#/components/schemas/ActorImage'
3e9e6f2f
RK
6081 Actor:
6082 properties:
6083 id:
b8375da9 6084 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6085 url:
6086 type: string
84f6e32c 6087 format: url
3e9e6f2f 6088 name:
77b0c6b5 6089 description: immutable name of the actor, used to find or mention it
2c4876f2
RK
6090 allOf:
6091 - $ref: '#/components/schemas/username'
3e9e6f2f
RK
6092 host:
6093 type: string
84f6e32c 6094 format: hostname
2c4876f2 6095 description: server on which the actor is resident
045bcd0d
RK
6096 hostRedundancyAllowed:
6097 type: boolean
2c4876f2 6098 description: whether this actor's host allows redundancy of its videos
3e9e6f2f 6099 followingCount:
06746a8b 6100 type: integer
2c4876f2
RK
6101 minimum: 0
6102 description: number of actors subscribed to by this actor, as seen by this instance
3e9e6f2f 6103 followersCount:
06746a8b 6104 type: integer
2c4876f2
RK
6105 minimum: 0
6106 description: number of followers of this actor, as seen by this instance
3e9e6f2f
RK
6107 createdAt:
6108 type: string
84f6e32c 6109 format: date-time
3e9e6f2f
RK
6110 updatedAt:
6111 type: string
84f6e32c 6112 format: date-time
3e9e6f2f
RK
6113 Account:
6114 allOf:
6115 - $ref: '#/components/schemas/Actor'
6116 - properties:
2a8ae759 6117 userId:
2c4876f2
RK
6118 description: object id for the user tied to this account
6119 allOf:
6120 - $ref: '#/components/schemas/User/properties/id'
3e9e6f2f
RK
6121 displayName:
6122 type: string
77b0c6b5
RK
6123 description: editable name of the account, displayed in its representations
6124 minLength: 3
6125 maxLength: 120
2a8ae759
FS
6126 description:
6127 type: string
2c4876f2 6128 description: text or bio displayed on the account's profile
cf158e7e 6129 UserViewingVideo:
6441981b
RK
6130 properties:
6131 currentTime:
06746a8b 6132 type: integer
c00100b6 6133 format: seconds
84f6e32c
RK
6134 description: timestamp within the video, in seconds
6135 example: 5
cf158e7e
C
6136
6137 VideoStatsOverall:
6138 properties:
6139 averageWatchTime:
6140 type: number
6141 totalWatchTime:
6142 type: number
6143 viewersPeak:
6144 type: number
6145 viewersPeakDate:
6146 type: string
6147 format: date-time
6148 views:
6149 type: number
6150 likes:
6151 type: number
6152 dislikes:
6153 type: number
6154 comments:
6155 type: number
6156 countries:
6157 type: array
6158 items:
6159 type: object
6160 properties:
6161 isoCode:
6162 type: string
6163 viewers:
6164 type: number
6165
6166 VideoStatsRetention:
6167 properties:
6168 data:
6169 type: array
6170 items:
6171 type: object
6172 properties:
6173 second:
6174 type: number
6175 retentionPercent:
6176 type: number
6177
6178 VideoStatsTimeserie:
6179 properties:
6180 data:
6181 type: array
6182 items:
6183 type: object
6184 properties:
6185 date:
6186 type: string
6187 value:
6188 type: number
6189
3e9e6f2f
RK
6190 ServerConfig:
6191 properties:
2a8ae759
FS
6192 instance:
6193 type: object
6194 properties:
6195 name:
6196 type: string
6197 shortDescription:
6198 type: string
6199 defaultClientRoute:
6200 type: string
6201 isNSFW:
6202 type: boolean
6203 defaultNSFWPolicy:
6204 type: string
6205 customizations:
6206 type: object
6207 properties:
6208 javascript:
6209 type: string
6210 css:
6211 type: string
f30736c8
RK
6212 search:
6213 type: object
6214 properties:
6215 remoteUri:
6216 type: object
6217 properties:
6218 users:
6219 type: boolean
6220 anonymous:
6221 type: boolean
2a8ae759
FS
6222 plugin:
6223 type: object
6224 properties:
6225 registered:
6226 type: array
6227 items:
6228 type: string
6229 theme:
6230 type: object
6231 properties:
6232 registered:
6233 type: array
6234 items:
6235 type: string
6236 email:
6237 type: object
6238 properties:
6239 enabled:
6240 type: boolean
6241 contactForm:
6242 type: object
6243 properties:
6244 enabled:
6245 type: boolean
6246 serverVersion:
6247 type: string
6248 serverCommit:
6249 type: string
3e9e6f2f
RK
6250 signup:
6251 type: object
6252 properties:
6253 allowed:
6254 type: boolean
2a8ae759
FS
6255 allowedForCurrentIP:
6256 type: boolean
6257 requiresEmailVerification:
6258 type: boolean
3e9e6f2f
RK
6259 transcoding:
6260 type: object
6261 properties:
2a8ae759
FS
6262 hls:
6263 type: object
6264 properties:
6265 enabled:
6266 type: boolean
f30736c8
RK
6267 webtorrent:
6268 type: object
6269 properties:
6270 enabled:
6271 type: boolean
3e9e6f2f
RK
6272 enabledResolutions:
6273 type: array
6274 items:
40cfb36b 6275 $ref: '#/components/schemas/VideoResolutionSet'
2a8ae759
FS
6276 import:
6277 type: object
6278 properties:
6279 videos:
6280 type: object
6281 properties:
6282 http:
6283 type: object
6284 properties:
6285 enabled:
6286 type: boolean
6287 torrent:
6288 type: object
6289 properties:
6290 enabled:
6291 type: boolean
6292 autoBlacklist:
6293 type: object
6294 properties:
6295 videos:
6296 type: object
6297 properties:
6298 ofUsers:
6299 type: object
6300 properties:
6301 enabled:
6302 type: boolean
3e9e6f2f
RK
6303 avatar:
6304 type: object
6305 properties:
6306 file:
6307 type: object
6308 properties:
6309 size:
6310 type: object
6311 properties:
6312 max:
06746a8b 6313 type: integer
3e9e6f2f
RK
6314 extensions:
6315 type: array
6316 items:
6317 type: string
6318 video:
6319 type: object
6320 properties:
2a8ae759
FS
6321 image:
6322 type: object
6323 properties:
6324 extensions:
6325 type: array
6326 items:
6327 type: string
6328 size:
6329 type: object
6330 properties:
6331 max:
06746a8b 6332 type: integer
3e9e6f2f
RK
6333 file:
6334 type: object
6335 properties:
6336 extensions:
6337 type: array
6338 items:
6339 type: string
2a8ae759
FS
6340 videoCaption:
6341 type: object
6342 properties:
6343 file:
6344 type: object
6345 properties:
6346 size:
6347 type: object
6348 properties:
6349 max:
06746a8b 6350 type: integer
2a8ae759
FS
6351 extensions:
6352 type: array
6353 items:
6354 type: string
6355 user:
6356 type: object
6357 properties:
6358 videoQuota:
06746a8b 6359 type: integer
b8375da9 6360 example: 16810141515
2a8ae759 6361 videoQuotaDaily:
06746a8b 6362 type: integer
b8375da9 6363 example: 1681014151
2a8ae759
FS
6364 trending:
6365 type: object
6366 properties:
6367 videos:
6368 type: object
6369 properties:
6370 intervalDays:
06746a8b 6371 type: integer
2a8ae759 6372 tracker:
747b17c7 6373 type: object
2a8ae759
FS
6374 properties:
6375 enabled:
6376 type: boolean
f30736c8
RK
6377 followings:
6378 type: object
6379 properties:
6380 instance:
6381 type: object
6382 properties:
6383 autoFollowIndex:
6384 type: object
6385 properties:
6386 indexUrl:
6387 type: string
84f6e32c 6388 format: url
2539932e
C
6389 homepage:
6390 type: object
6391 properties:
6392 enabled:
6393 type: boolean
6394
2a8ae759
FS
6395 ServerConfigAbout:
6396 properties:
6397 instance:
6398 type: object
6399 properties:
6400 name:
6401 type: string
6402 shortDescription:
6403 type: string
6404 description:
6405 type: string
6406 terms:
6407 type: string
6408 ServerConfigCustom:
6409 properties:
6410 instance:
6411 type: object
6412 properties:
6413 name:
6414 type: string
6415 shortDescription:
6416 type: string
6417 description:
6418 type: string
6419 terms:
6420 type: string
6421 defaultClientRoute:
6422 type: string
6423 isNSFW:
6424 type: boolean
6425 defaultNSFWPolicy:
6426 type: string
6427 customizations:
6428 type: object
6429 properties:
6430 javascript:
6431 type: string
6432 css:
6433 type: string
6434 theme:
6435 type: object
6436 properties:
6437 default:
6438 type: string
6439 services:
6440 type: object
6441 properties:
6442 twitter:
6443 type: object
6444 properties:
6445 username:
6446 type: string
6447 whitelisted:
6448 type: boolean
6449 cache:
6450 type: object
6451 properties:
6452 previews:
6453 type: object
6454 properties:
6455 size:
06746a8b 6456 type: integer
2a8ae759
FS
6457 captions:
6458 type: object
6459 properties:
6460 size:
06746a8b 6461 type: integer
2a8ae759
FS
6462 signup:
6463 type: object
6464 properties:
6465 enabled:
6466 type: boolean
6467 limit:
06746a8b 6468 type: integer
2a8ae759
FS
6469 requiresEmailVerification:
6470 type: boolean
6471 admin:
6472 type: object
6473 properties:
6474 email:
6475 type: string
84f6e32c 6476 format: email
2a8ae759
FS
6477 contactForm:
6478 type: object
6479 properties:
6480 enabled:
6481 type: boolean
6482 user:
6483 type: object
40cfb36b 6484 description: Settings that apply to new users, if registration is enabled
2a8ae759
FS
6485 properties:
6486 videoQuota:
06746a8b 6487 type: integer
b8375da9 6488 example: 16810141515
2a8ae759 6489 videoQuotaDaily:
06746a8b 6490 type: integer
b8375da9 6491 example: 1681014151
2a8ae759
FS
6492 transcoding:
6493 type: object
40cfb36b 6494 description: Settings pertaining to transcoding jobs
2a8ae759
FS
6495 properties:
6496 enabled:
6497 type: boolean
6498 allowAdditionalExtensions:
6499 type: boolean
40cfb36b 6500 description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos
2a8ae759
FS
6501 allowAudioFiles:
6502 type: boolean
40cfb36b 6503 description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file
2a8ae759 6504 threads:
06746a8b 6505 type: integer
40cfb36b
RK
6506 description: Amount of threads used by ffmpeg for 1 transcoding job
6507 concurrency:
6508 type: number
6509 description: Amount of transcoding jobs to execute in parallel
6510 profile:
6511 type: string
6512 enum:
6513 - default
6514 description: |
6515 New profiles can be added by plugins ; available in core PeerTube: 'default'.
2a8ae759
FS
6516 resolutions:
6517 type: object
40cfb36b 6518 description: Resolutions to transcode _new videos_ to
2a8ae759 6519 properties:
40cfb36b
RK
6520 0p:
6521 type: boolean
8dd754c7
FC
6522 144p:
6523 type: boolean
2a8ae759
FS
6524 240p:
6525 type: boolean
6526 360p:
6527 type: boolean
6528 480p:
6529 type: boolean
6530 720p:
6531 type: boolean
6532 1080p:
6533 type: boolean
b7085c71
RK
6534 1440p:
6535 type: boolean
2a8ae759
FS
6536 2160p:
6537 type: boolean
40cfb36b
RK
6538 webtorrent:
6539 type: object
6540 description: WebTorrent-specific settings
6541 properties:
6542 enabled:
6543 type: boolean
2a8ae759
FS
6544 hls:
6545 type: object
40cfb36b 6546 description: HLS-specific settings
2a8ae759
FS
6547 properties:
6548 enabled:
6549 type: boolean
6550 import:
6551 type: object
6552 properties:
6553 videos:
6554 type: object
6555 properties:
6556 http:
6557 type: object
6558 properties:
6559 enabled:
6560 type: boolean
6561 torrent:
6562 type: object
6563 properties:
6564 enabled:
6565 type: boolean
6566 autoBlacklist:
6567 type: object
6568 properties:
6569 videos:
6570 type: object
6571 properties:
6572 ofUsers:
6573 type: object
6574 properties:
6575 enabled:
6576 type: boolean
6577 followers:
6578 type: object
6579 properties:
6580 instance:
6581 type: object
6582 properties:
6583 enabled:
6584 type: boolean
6585 manualApproval:
6586 type: boolean
2539932e
C
6587
6588 CustomHomepage:
6589 properties:
6590 content:
6591 type: string
6592
3e9e6f2f
RK
6593 Follow:
6594 properties:
6595 id:
b8375da9 6596 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6597 follower:
6598 $ref: '#/components/schemas/Actor'
6599 following:
6600 $ref: '#/components/schemas/Actor'
6601 score:
6602 type: number
04b703f6 6603 description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
3e9e6f2f
RK
6604 state:
6605 type: string
6606 enum:
6607 - pending
6608 - accepted
6609 createdAt:
6610 type: string
84f6e32c 6611 format: date-time
3e9e6f2f
RK
6612 updatedAt:
6613 type: string
84f6e32c 6614 format: date-time
e3489df9
C
6615
6616 PredefinedAbuseReasons:
6617 description: Reason categories that help triage reports
6618 type: array
f6d6e7f8 6619 maxItems: 8
e3489df9
C
6620 items:
6621 type: string
6622 enum:
6623 - violentOrAbusive
6624 - hatefulOrAbusive
6625 - spamOrMisleading
6626 - privacy
6627 - rights
6628 - serverRules
6629 - thumbnails
6630 - captions
6631
3e9e6f2f
RK
6632 Job:
6633 properties:
6634 id:
b8375da9 6635 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6636 state:
6637 type: string
6638 enum:
84f6e32c
RK
6639 - active
6640 - completed
6641 - failed
6642 - waiting
6643 - delayed
6644 type:
3e9e6f2f
RK
6645 type: string
6646 enum:
84f6e32c
RK
6647 - activitypub-http-unicast
6648 - activitypub-http-broadcast
6649 - activitypub-http-fetcher
6650 - activitypub-follow
6651 - video-file-import
6652 - video-transcoding
6653 - email
6654 - video-import
51353d9a 6655 - videos-views-stats
84f6e32c
RK
6656 - activitypub-refresher
6657 - video-redundancy
6658 data:
6659 type: object
6660 additionalProperties: true
6661 error:
6662 type: object
6663 additionalProperties: true
3e9e6f2f
RK
6664 createdAt:
6665 type: string
84f6e32c
RK
6666 format: date-time
6667 finishedOn:
3e9e6f2f 6668 type: string
84f6e32c
RK
6669 format: date-time
6670 processedOn:
6671 type: string
6672 format: date-time
3e9e6f2f
RK
6673 AddUserResponse:
6674 properties:
2c318664
RK
6675 user:
6676 type: object
6677 properties:
6678 id:
b8375da9 6679 $ref: '#/components/schemas/id'
2c318664
RK
6680 account:
6681 type: object
6682 properties:
6683 id:
b8375da9 6684 $ref: '#/components/schemas/id'
f6d6e7f8 6685 VideoUploadRequestCommon:
6686 properties:
6687 name:
6688 description: Video name
6689 type: string
b8375da9
RK
6690 example: What is PeerTube?
6691 minLength: 3
6692 maxLength: 120
f6d6e7f8 6693 channelId:
6694 description: Channel id that will contain this video
6695 type: integer
b8375da9
RK
6696 example: 3
6697 minimum: 1
f6d6e7f8 6698 privacy:
6699 $ref: '#/components/schemas/VideoPrivacySet'
6700 category:
40cfb36b 6701 $ref: '#/components/schemas/VideoCategorySet'
f6d6e7f8 6702 licence:
40cfb36b 6703 $ref: '#/components/schemas/VideoLicenceSet'
f6d6e7f8 6704 language:
40cfb36b 6705 $ref: '#/components/schemas/VideoLanguageSet'
f6d6e7f8 6706 description:
6707 description: Video description
6708 type: string
b8375da9
RK
6709 example: |
6710 **[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 6711 waitTranscoding:
6712 description: Whether or not we wait transcoding before publish the video
6713 type: boolean
6714 support:
6715 description: A text tell the audience how to support the video creator
9a320a06 6716 example: Please support our work on https://soutenir.framasoft.org/en/ <3
f6d6e7f8 6717 type: string
6718 nsfw:
6719 description: Whether or not this video contains sensitive content
6720 type: boolean
6721 tags:
6722 description: Video tags (maximum 5 tags each between 2 and 30 characters)
6723 type: array
6724 minItems: 1
6725 maxItems: 5
6726 uniqueItems: true
b8375da9
RK
6727 example:
6728 - framasoft
6729 - peertube
f6d6e7f8 6730 items:
6731 type: string
6732 minLength: 2
6733 maxLength: 30
6734 commentsEnabled:
6735 description: Enable or disable comments for this video
6736 type: boolean
6737 downloadEnabled:
6738 description: Enable or disable downloading for this video
6739 type: boolean
6740 originallyPublishedAt:
6741 description: Date when the content was originally published
6742 type: string
6743 format: date-time
6744 scheduleUpdate:
6745 $ref: '#/components/schemas/VideoScheduledUpdate'
6746 thumbnailfile:
6747 description: Video thumbnail file
6748 type: string
6749 format: binary
6750 previewfile:
6751 description: Video preview file
6752 type: string
6753 format: binary
6754 required:
6755 - channelId
6756 - name
6757 VideoUploadRequestLegacy:
6758 allOf:
6759 - $ref: '#/components/schemas/VideoUploadRequestCommon'
6760 - type: object
6761 required:
6762 - videofile
6763 properties:
6764 videofile:
6765 description: Video file
6766 type: string
6767 format: binary
6768 VideoUploadRequestResumable:
6769 allOf:
6770 - $ref: '#/components/schemas/VideoUploadRequestCommon'
6771 - type: object
6772 required:
6773 - filename
6774 properties:
6775 filename:
6776 description: Video filename including extension
6777 type: string
6778 format: filename
b8375da9 6779 example: what_is_peertube.mp4
f6d6e7f8 6780 thumbnailfile:
6781 description: Video thumbnail file
6782 type: string
6783 format: binary
6784 previewfile:
6785 description: Video preview file
6786 type: string
6787 format: binary
3e9e6f2f
RK
6788 VideoUploadResponse:
6789 properties:
6790 video:
6791 type: object
6792 properties:
6793 id:
b8375da9 6794 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f 6795 uuid:
b8375da9 6796 $ref: '#/components/schemas/Video/properties/uuid'
d4a8e7a6
C
6797 shortUUID:
6798 $ref: '#/components/schemas/Video/properties/shortUUID'
3e9e6f2f
RK
6799 CommentThreadResponse:
6800 properties:
6801 total:
06746a8b 6802 type: integer
84f6e32c 6803 example: 1
3e9e6f2f
RK
6804 data:
6805 type: array
84f6e32c 6806 maxItems: 100
3e9e6f2f
RK
6807 items:
6808 $ref: '#/components/schemas/VideoComment'
6809 CommentThreadPostResponse:
6810 properties:
6811 comment:
6812 $ref: '#/components/schemas/VideoComment'
048b6946
C
6813 VideoListResponse:
6814 properties:
6815 total:
06746a8b 6816 type: integer
84f6e32c 6817 example: 1
048b6946
C
6818 data:
6819 type: array
84f6e32c 6820 maxItems: 100
048b6946
C
6821 items:
6822 $ref: '#/components/schemas/Video'
84f6e32c
RK
6823 User:
6824 properties:
fd5586b3
RK
6825 account:
6826 $ref: '#/components/schemas/Account'
6827 autoPlayNextVideo:
6828 type: boolean
6829 description: Automatically start playing the upcoming video after the currently playing video
6830 autoPlayNextVideoPlaylist:
6831 type: boolean
6832 description: Automatically start playing the video on the playlist after the currently playing video
6833 autoPlayVideo:
6834 type: boolean
6835 description: Automatically start playing the video on the watch page
6836 blocked:
6837 type: boolean
6838 blockedReason:
6839 type: string
6840 createdAt:
84f6e32c 6841 type: string
84f6e32c
RK
6842 email:
6843 type: string
6844 format: email
6845 description: The user email
fd5586b3
RK
6846 emailVerified:
6847 type: boolean
6848 description: Has the user confirmed their email address?
6849 id:
2c4876f2
RK
6850 allOf:
6851 - $ref: '#/components/schemas/id'
fd5586b3 6852 readOnly: true
6d989edc
C
6853 pluginAuth:
6854 type: string
6855 description: Auth plugin to use to authenticate the user
fd5586b3 6856 lastLoginDate:
84f6e32c 6857 type: string
fd5586b3
RK
6858 format: date-time
6859 noInstanceConfigWarningModal:
6860 type: boolean
8f581725
C
6861 noAccountSetupWarningModal:
6862 type: boolean
fd5586b3 6863 noWelcomeModal:
84f6e32c 6864 type: boolean
84f6e32c
RK
6865 nsfwPolicy:
6866 $ref: '#/components/schemas/NSFWPolicy'
84f6e32c
RK
6867 role:
6868 $ref: '#/components/schemas/UserRole'
6869 roleLabel:
6870 type: string
6871 enum:
6872 - User
6873 - Moderator
6874 - Administrator
fd5586b3 6875 theme:
84f6e32c 6876 type: string
fd5586b3
RK
6877 description: Theme enabled by this user
6878 username:
b8375da9 6879 $ref: '#/components/schemas/username'
84f6e32c
RK
6880 videoChannels:
6881 type: array
6882 items:
6883 $ref: '#/components/schemas/VideoChannel'
fd5586b3
RK
6884 videoQuota:
6885 type: integer
6886 description: The user video quota in bytes
6887 example: -1
6888 videoQuotaDaily:
6889 type: integer
6890 description: The user daily video quota in bytes
6891 example: -1
a9bfa85d 6892 p2pEnabled:
fd5586b3
RK
6893 type: boolean
6894 description: Enable P2P in the player
6895 UserWithStats:
6896 allOf:
6897 - $ref: '#/components/schemas/User'
6898 - properties:
6899 # optionally present fields: they require WITH_STATS scope
6900 videosCount:
6901 type: integer
85a60d8b 6902 description: Count of videos published
fd5586b3
RK
6903 abusesCount:
6904 type: integer
6905 description: Count of reports/abuses of which the user is a target
6906 abusesAcceptedCount:
6907 type: integer
6908 description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team
6909 abusesCreatedCount:
6910 type: integer
6911 description: Count of reports/abuses created by the user
6912 videoCommentsCount:
6913 type: integer
6914 description: Count of comments published
3e9e6f2f
RK
6915 AddUser:
6916 properties:
6917 username:
b8375da9 6918 $ref: '#/components/schemas/username'
3e9e6f2f 6919 password:
b8375da9 6920 $ref: '#/components/schemas/password'
3e9e6f2f
RK
6921 email:
6922 type: string
84f6e32c
RK
6923 format: email
6924 description: The user email
3e9e6f2f 6925 videoQuota:
84f6e32c 6926 type: integer
b8375da9
RK
6927 description: The user video quota in bytes
6928 example: -1
fbe1bc2a 6929 videoQuotaDaily:
84f6e32c 6930 type: integer
b8375da9
RK
6931 description: The user daily video quota in bytes
6932 example: -1
6d989edc 6933 channelName:
b8375da9 6934 $ref: '#/components/schemas/usernameChannel'
3e9e6f2f 6935 role:
0590bb46 6936 $ref: '#/components/schemas/UserRole'
6d989edc
C
6937 adminFlags:
6938 $ref: '#/components/schemas/UserAdminFlags'
3e9e6f2f
RK
6939 required:
6940 - username
6941 - password
6942 - email
6943 - videoQuota
fbe1bc2a 6944 - videoQuotaDaily
3e9e6f2f
RK
6945 - role
6946 UpdateUser:
6947 properties:
3e9e6f2f 6948 email:
84f6e32c 6949 description: The updated email of the user
77b0c6b5
RK
6950 allOf:
6951 - $ref: '#/components/schemas/User/properties/email'
6d989edc
C
6952 emailVerified:
6953 type: boolean
6954 description: Set the email as verified
3e9e6f2f 6955 videoQuota:
84f6e32c 6956 type: integer
b8375da9 6957 description: The updated video quota of the user in bytes
fbe1bc2a 6958 videoQuotaDaily:
84f6e32c 6959 type: integer
b8375da9 6960 description: The updated daily video quota of the user in bytes
6d989edc
C
6961 pluginAuth:
6962 type: string
6963 nullable: true
6964 description: The auth plugin to use to authenticate the user
6965 example: 'peertube-plugin-auth-saml2'
3e9e6f2f 6966 role:
0590bb46 6967 $ref: '#/components/schemas/UserRole'
6d989edc
C
6968 adminFlags:
6969 $ref: '#/components/schemas/UserAdminFlags'
5097cbda
C
6970 password:
6971 $ref: '#/components/schemas/password'
3e9e6f2f 6972 UpdateMe:
77b0c6b5 6973 # see shared/models/users/user-update-me.model.ts:
3e9e6f2f
RK
6974 properties:
6975 password:
b8375da9 6976 $ref: '#/components/schemas/password'
77b0c6b5
RK
6977 currentPassword:
6978 $ref: '#/components/schemas/password'
3e9e6f2f 6979 email:
77b0c6b5
RK
6980 description: new email used for login and service communications
6981 allOf:
6982 - $ref: '#/components/schemas/User/properties/email'
6983 displayName:
3e9e6f2f 6984 type: string
77b0c6b5
RK
6985 description: new name of the user in its representations
6986 minLength: 3
6987 maxLength: 120
3e9e6f2f
RK
6988 displayNSFW:
6989 type: string
77b0c6b5 6990 description: new NSFW display policy
84f6e32c
RK
6991 enum:
6992 - 'true'
6993 - 'false'
6994 - both
a9bfa85d 6995 p2pEnabled:
77b0c6b5
RK
6996 type: boolean
6997 description: whether to enable P2P in the player or not
3e9e6f2f 6998 autoPlayVideo:
84f6e32c 6999 type: boolean
77b0c6b5
RK
7000 description: new preference regarding playing videos automatically
7001 autoPlayNextVideo:
7002 type: boolean
7003 description: new preference regarding playing following videos automatically
7004 autoPlayNextVideoPlaylist:
7005 type: boolean
7006 description: new preference regarding playing following playlist videos automatically
7007 videosHistoryEnabled:
7008 type: boolean
7009 description: whether to keep track of watched history or not
7010 videoLanguages:
7011 type: array
7012 items:
7013 type: string
7014 description: list of languages to filter videos down to
7015 theme:
7016 type: string
7017 noInstanceConfigWarningModal:
7018 type: boolean
8f581725
C
7019 noAccountSetupWarningModal:
7020 type: boolean
77b0c6b5
RK
7021 noWelcomeModal:
7022 type: boolean
3e9e6f2f
RK
7023 GetMeVideoRating:
7024 properties:
7025 id:
b8375da9 7026 $ref: '#/components/schemas/id'
3e9e6f2f 7027 rating:
30b40713
RK
7028 type: string
7029 enum:
7030 - like
7031 - dislike
7032 - none
84f6e32c 7033 description: Rating of the video
3e9e6f2f
RK
7034 required:
7035 - id
7036 - rating
c100a614
YB
7037 VideoRating:
7038 properties:
7039 video:
7040 $ref: '#/components/schemas/Video'
7041 rating:
30b40713
RK
7042 type: string
7043 enum:
7044 - like
7045 - dislike
7046 - none
7047 description: Rating of the video
c100a614
YB
7048 required:
7049 - video
7050 - rating
3e9e6f2f
RK
7051 RegisterUser:
7052 properties:
7053 username:
77b0c6b5
RK
7054 description: immutable name of the user, used to find or mention its actor
7055 allOf:
7056 - $ref: '#/components/schemas/username'
3e9e6f2f 7057 password:
b8375da9 7058 $ref: '#/components/schemas/password'
3e9e6f2f
RK
7059 email:
7060 type: string
84f6e32c 7061 format: email
77b0c6b5 7062 description: email of the user, used for login or service communications
1f20622f
C
7063 displayName:
7064 type: string
77b0c6b5 7065 description: editable name of the user, displayed in its representations
84f6e32c
RK
7066 minLength: 1
7067 maxLength: 120
1f20622f
C
7068 channel:
7069 type: object
77b0c6b5 7070 description: channel base information used to create the first channel of the user
1f20622f
C
7071 properties:
7072 name:
b8375da9 7073 $ref: '#/components/schemas/usernameChannel'
1f20622f 7074 displayName:
d0800f76 7075 type: string
3e9e6f2f
RK
7076 required:
7077 - username
7078 - password
7079 - email
4302058c 7080
e2464d22
RK
7081 OAuthClient:
7082 properties:
7083 client_id:
7084 type: string
7085 pattern: /^[a-z0-9]$/
7086 maxLength: 32
7087 minLength: 32
7088 example: v1ikx5hnfop4mdpnci8nsqh93c45rldf
7089 client_secret:
7090 type: string
7091 pattern: /^[a-zA-Z0-9]$/
7092 maxLength: 32
7093 minLength: 32
7094 example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt
7095 OAuthToken-password:
7096 allOf:
7097 - $ref: '#/components/schemas/OAuthClient'
7098 - type: object
7099 properties:
7100 grant_type:
7101 type: string
7102 enum:
7103 - password
7104 - refresh_token
7105 default: password
7106 username:
7107 $ref: '#/components/schemas/User/properties/username'
7108 password:
7109 $ref: '#/components/schemas/password'
7110 required:
7111 - client_id
7112 - client_secret
7113 - grant_type
7114 - username
7115 - password
7116 OAuthToken-refresh_token:
7117 allOf:
7118 - $ref: '#/components/schemas/OAuthClient'
7119 - type: object
7120 properties:
7121 grant_type:
7122 type: string
7123 enum:
7124 - password
7125 - refresh_token
7126 default: password
7127 refresh_token:
7128 type: string
7129 example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7
7130 required:
7131 - client_id
7132 - client_secret
7133 - grant_type
7134 - refresh_token
7135
b8375da9 7136 VideoChannel:
d0800f76 7137 allOf:
7138 - $ref: '#/components/schemas/Actor'
7139 - type: object
b8375da9 7140 properties:
d0800f76 7141 displayName:
7142 type: string
7143 description: editable name of the channel, displayed in its representations
7144 example: Videos of Framasoft
7145 minLength: 1
7146 maxLength: 120
7147 description:
7148 type: string
7149 example: Videos made with <3 by Framasoft
7150 minLength: 3
7151 maxLength: 1000
7152 support:
7153 type: string
7154 description: text shown by default on all videos of this channel, to tell the audience how to support it
7155 example: Please support our work on https://soutenir.framasoft.org/en/ <3
7156 minLength: 3
7157 maxLength: 1000
7158 isLocal:
7159 readOnly: true
7160 type: boolean
7161 updatedAt:
7162 readOnly: true
7163 type: string
7164 format: date-time
7165 banners:
7166 type: array
7167 items:
7168 $ref: '#/components/schemas/ActorImage'
7169 ownerAccount:
7170 readOnly: true
7171 nullable: true
7172 type: object
7173 properties:
7174 id:
7175 type: integer
7176 uuid:
7177 $ref: '#/components/schemas/UUIDv4'
4302058c
RK
7178 VideoChannelCreate:
7179 allOf:
b8375da9 7180 - $ref: '#/components/schemas/VideoChannel'
4302058c
RK
7181 - properties:
7182 name:
b8375da9
RK
7183 description: username of the channel to create
7184 allOf:
7185 - $ref: '#/components/schemas/usernameChannel'
7d14d4d2
C
7186 required:
7187 - name
7188 - displayName
7189 VideoChannelUpdate:
4302058c 7190 allOf:
b8375da9 7191 - $ref: '#/components/schemas/VideoChannel'
4302058c
RK
7192 - properties:
7193 bulkVideosSupportUpdate:
7194 type: boolean
b8375da9 7195 description: Update the support field for all videos of this channel
045bcd0d
RK
7196 VideoChannelList:
7197 properties:
7198 total:
7199 type: integer
7200 example: 1
7201 data:
7202 type: array
7203 items:
7204 allOf:
7205 - $ref: '#/components/schemas/VideoChannel'
7206 - $ref: '#/components/schemas/Actor'
1569a818 7207
06746a8b
RK
7208 MRSSPeerLink:
7209 type: object
7210 xml:
7211 name: 'media:peerLink'
7212 properties:
7213 href:
7214 type: string
7215 xml:
7216 attribute: true
7217 type:
7218 type: string
7219 enum:
7220 - application/x-bittorrent
7221 xml:
7222 attribute: true
7223 MRSSGroupContent:
7224 type: object
7225 xml:
7226 name: 'media:content'
7227 properties:
7228 url:
7229 type: string
84f6e32c 7230 format: url
06746a8b
RK
7231 xml:
7232 attribute: true
7233 fileSize:
7234 type: integer
7235 xml:
7236 attribute: true
7237 type:
7238 type: string
7239 xml:
7240 attribute: true
7241 framerate:
7242 type: integer
7243 xml:
7244 attribute: true
7245 duration:
7246 type: integer
7247 xml:
7248 attribute: true
7249 height:
7250 type: integer
7251 xml:
7252 attribute: true
7253 lang:
7254 type: string
7255 xml:
7256 attribute: true
7257 VideoCommentsForXML:
7258 type: array
7259 xml:
7260 wrapped: true
7261 name: 'channel'
7262 items:
7263 type: object
7264 xml:
7265 name: 'item'
7266 properties:
7267 link:
7268 type: string
84f6e32c 7269 format: url
06746a8b
RK
7270 guid:
7271 type: string
7272 pubDate:
7273 type: string
7274 format: date-time
7275 'content:encoded':
7276 type: string
7277 'dc:creator':
7278 type: string
7279 VideosForXML:
7280 type: array
7281 xml:
7282 wrapped: true
7283 name: 'channel'
7284 items:
7285 type: object
7286 xml:
7287 name: 'item'
7288 properties:
7289 link:
7290 type: string
84f6e32c 7291 format: url
06746a8b
RK
7292 description: video watch page URL
7293 guid:
7294 type: string
7295 description: video canonical URL
7296 pubDate:
7297 type: string
7298 format: date-time
7299 description: video publication date
7300 description:
7301 type: string
7302 description: video description
7303 'content:encoded':
7304 type: string
7305 description: video description
7306 'dc:creator':
7307 type: string
7308 description: publisher user name
7309 'media:category':
7310 type: integer
7311 description: video category (MRSS)
7312 'media:community':
7313 type: object
7314 description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
7315 properties:
7316 'media:statistics':
7317 type: object
7318 properties:
7319 views:
7320 type: integer
7321 xml:
7322 attribute: true
7323 'media:embed':
7324 type: object
7325 properties:
7326 url:
7327 type: string
84f6e32c 7328 format: url
06746a8b
RK
7329 description: video embed path, relative to the canonical URL domain (MRSS)
7330 xml:
7331 attribute: true
7332 'media:player':
7333 type: object
7334 properties:
7335 url:
7336 type: string
84f6e32c 7337 format: url
06746a8b
RK
7338 description: video watch path, relative to the canonical URL domain (MRSS)
7339 xml:
7340 attribute: true
7341 'media:thumbnail':
7342 type: object
7343 properties:
7344 url:
7345 type: string
84f6e32c 7346 format: url
06746a8b
RK
7347 xml:
7348 attribute: true
7349 height:
7350 type: integer
7351 xml:
7352 attribute: true
7353 width:
7354 type: integer
7355 xml:
7356 attribute: true
7357 'media:title':
7358 type: string
7359 description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
7360 'media:description':
7361 type: string
7362 'media:rating':
7363 type: string
7364 enum:
7365 - nonadult
7366 - adult
7367 description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
7368 'enclosure':
7369 type: object
7370 description: main streamable file for the video
7371 properties:
7372 url:
7373 type: string
84f6e32c 7374 format: url
06746a8b
RK
7375 xml:
7376 attribute: true
7377 type:
7378 type: string
7379 enum:
7380 - application/x-bittorrent
7381 xml:
7382 attribute: true
7383 length:
7384 type: integer
7385 xml:
7386 attribute: true
7387 'media:group':
7388 type: array
7389 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)
7390 items:
7391 anyOf:
7392 - $ref: '#/components/schemas/MRSSPeerLink'
f4d59981
RK
7393 - $ref: '#/components/schemas/MRSSGroupContent'
7394 NotificationSettingValue:
7395 type: integer
7396 description: >
7397 Notification type
84f6e32c 7398
f4d59981 7399 - `0` NONE
84f6e32c 7400
f4d59981 7401 - `1` WEB
84f6e32c 7402
f4d59981
RK
7403 - `2` EMAIL
7404 enum:
7405 - 0
7406 - 1
2760b454 7407 - 2
f4d59981
RK
7408 Notification:
7409 properties:
7410 id:
b8375da9 7411 $ref: '#/components/schemas/id'
f4d59981
RK
7412 type:
7413 type: integer
7414 description: >
7415 Notification type, following the `UserNotificationType` enum:
84f6e32c 7416
f4d59981 7417 - `1` NEW_VIDEO_FROM_SUBSCRIPTION
84f6e32c 7418
f4d59981 7419 - `2` NEW_COMMENT_ON_MY_VIDEO
84f6e32c 7420
310b5219 7421 - `3` NEW_ABUSE_FOR_MODERATORS
84f6e32c 7422
f4d59981 7423 - `4` BLACKLIST_ON_MY_VIDEO
84f6e32c 7424
f4d59981 7425 - `5` UNBLACKLIST_ON_MY_VIDEO
84f6e32c 7426
f4d59981 7427 - `6` MY_VIDEO_PUBLISHED
84f6e32c 7428
f4d59981 7429 - `7` MY_VIDEO_IMPORT_SUCCESS
84f6e32c 7430
f4d59981 7431 - `8` MY_VIDEO_IMPORT_ERROR
84f6e32c 7432
f4d59981 7433 - `9` NEW_USER_REGISTRATION
84f6e32c 7434
f4d59981 7435 - `10` NEW_FOLLOW
84f6e32c 7436
f4d59981 7437 - `11` COMMENT_MENTION
84f6e32c 7438
f4d59981 7439 - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
84f6e32c 7440
f4d59981 7441 - `13` NEW_INSTANCE_FOLLOWER
84f6e32c 7442
f4d59981 7443 - `14` AUTO_INSTANCE_FOLLOWING
5097cbda 7444
597da8dd 7445 - `15` ABUSE_STATE_CHANGE
5097cbda 7446
597da8dd 7447 - `16` ABUSE_NEW_MESSAGE
5097cbda 7448
597da8dd 7449 - `17` NEW_PLUGIN_VERSION
5097cbda 7450
597da8dd 7451 - `18` NEW_PEERTUBE_VERSION
f4d59981
RK
7452 read:
7453 type: boolean
7454 video:
7455 nullable: true
7456 allOf:
7457 - $ref: '#/components/schemas/VideoInfo'
7458 - type: object
7459 properties:
7460 channel:
7461 $ref: '#/components/schemas/ActorInfo'
7462 videoImport:
7463 nullable: true
7464 type: object
7465 properties:
7466 id:
b8375da9 7467 $ref: '#/components/schemas/id'
f4d59981
RK
7468 video:
7469 nullable: true
7470 $ref: '#/components/schemas/VideoInfo'
7471 torrentName:
7472 type: string
7473 nullable: true
7474 magnetUri:
2c4876f2 7475 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
f4d59981
RK
7476 targetUri:
7477 type: string
84f6e32c 7478 format: uri
f4d59981
RK
7479 nullable: true
7480 comment:
7481 nullable: true
7482 type: object
7483 properties:
7484 id:
b8375da9 7485 $ref: '#/components/schemas/id'
f4d59981
RK
7486 threadId:
7487 type: integer
7488 video:
7489 $ref: '#/components/schemas/VideoInfo'
7490 account:
7491 $ref: '#/components/schemas/ActorInfo'
7492 videoAbuse:
7493 nullable: true
7494 type: object
7495 properties:
7496 id:
b8375da9 7497 $ref: '#/components/schemas/id'
f4d59981
RK
7498 video:
7499 allOf:
7500 - $ref: '#/components/schemas/VideoInfo'
7501 videoBlacklist:
7502 nullable: true
7503 type: object
7504 properties:
7505 id:
b8375da9 7506 $ref: '#/components/schemas/id'
f4d59981
RK
7507 video:
7508 allOf:
7509 - $ref: '#/components/schemas/VideoInfo'
7510 account:
7511 nullable: true
7512 allOf:
7513 - $ref: '#/components/schemas/ActorInfo'
7514 actorFollow:
7515 type: object
7516 nullable: true
7517 properties:
7518 id:
b8375da9 7519 $ref: '#/components/schemas/id'
f4d59981
RK
7520 follower:
7521 $ref: '#/components/schemas/ActorInfo'
7522 state:
7523 type: string
7524 enum:
7525 - pending
7526 - accepted
7527 following:
7528 type: object
7529 properties:
7530 type:
7531 type: string
7532 enum:
7533 - account
7534 - channel
7535 - instance
7536 name:
7537 type: string
7538 displayName:
7539 type: string
7540 host:
7541 type: string
84f6e32c 7542 format: hostname
f4d59981
RK
7543 createdAt:
7544 type: string
7545 format: date-time
7546 updatedAt:
7547 type: string
7548 format: date-time
7549 NotificationListResponse:
7550 properties:
7551 total:
7552 type: integer
84f6e32c 7553 example: 1
f4d59981
RK
7554 data:
7555 type: array
84f6e32c 7556 maxItems: 100
f4d59981 7557 items:
7461d440
RK
7558 $ref: '#/components/schemas/Notification'
7559 Plugin:
7560 properties:
7561 name:
7562 type: string
84f6e32c 7563 example: peertube-plugin-auth-ldap
7461d440
RK
7564 type:
7565 type: integer
84f6e32c
RK
7566 description: >
7567 - `1`: PLUGIN
7568
7569 - `2`: THEME
7461d440
RK
7570 enum:
7571 - 1
7572 - 2
7573 latestVersion:
7574 type: string
84f6e32c 7575 example: 0.0.3
7461d440
RK
7576 version:
7577 type: string
84f6e32c 7578 example: 0.0.1
7461d440
RK
7579 enabled:
7580 type: boolean
7581 uninstalled:
7582 type: boolean
7583 peertubeEngine:
7584 type: string
84f6e32c 7585 example: 2.2.0
7461d440
RK
7586 description:
7587 type: string
7588 homepage:
7589 type: string
84f6e32c
RK
7590 format: url
7591 example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap
7461d440
RK
7592 settings:
7593 type: object
7594 additionalProperties: true
7595 createdAt:
7596 type: string
7597 format: date-time
7598 updatedAt:
7599 type: string
7600 format: date-time
7601 PluginResponse:
7602 properties:
7603 total:
7604 type: integer
84f6e32c 7605 example: 1
7461d440
RK
7606 data:
7607 type: array
84f6e32c 7608 maxItems: 100
7461d440 7609 items:
2c318664 7610 $ref: '#/components/schemas/Plugin'
4e239e35
C
7611
7612 LiveVideoUpdate:
7613 properties:
7614 saveReplay:
7615 type: boolean
bb4ba6d9
C
7616 permanentLive:
7617 description: User can stream multiple times in a permanent live
7618 type: boolean
f443a746
C
7619 latencyMode:
7620 description: User can select live latency mode if enabled by the instance
7621 $ref: '#/components/schemas/LiveVideoLatencyMode'
4e239e35
C
7622
7623 LiveVideoResponse:
7624 properties:
7625 rtmpUrl:
7626 type: string
df1db951
C
7627 rtmpsUrl:
7628 type: string
4e239e35
C
7629 streamKey:
7630 type: string
7631 description: RTMP stream key to use to stream into this live video
7632 saveReplay:
7633 type: boolean
bb4ba6d9
C
7634 permanentLive:
7635 description: User can stream multiple times in a permanent live
7636 type: boolean
f443a746
C
7637 latencyMode:
7638 description: User can select live latency mode if enabled by the instance
7639 $ref: '#/components/schemas/LiveVideoLatencyMode'
75cba40d 7640
2c318664
RK
7641 callbacks:
7642 searchIndex:
c00f96ce 7643 'https://search.example.org/api/v1/search/videos':
2c318664
RK
7644 post:
7645 summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`
7646 responses:
7647 '200':
7648 description: successful operation
7649 content:
7650 application/json:
7651 schema:
1e904cde 7652 $ref: '#/components/schemas/VideoListResponse'