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