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