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