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