]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/api/openapi.yaml
Add playback metric endpoint sent to OTEL
[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
fd3c2e87
C
5012 /metrics/playback:
5013 post:
5014 summary: Create playback metrics
5015 description: These metrics are exposed by OpenTelemetry metrics exporter if enabled.
5016 tags:
5017 - Stats
5018 requestBody:
5019 content:
5020 application/json:
5021 schema:
5022 $ref: '#/components/schemas/PlaybackMetricCreate'
5023 responses:
5024 '204':
5025 description: successful operation
5026
3e9e6f2f 5027servers:
8f9e8be1 5028 - url: 'https://peertube2.cpy.re/api/v1'
f4d59981 5029 description: Live Test Server (live data - latest nightly version)
6441981b 5030 - url: 'https://peertube3.cpy.re/api/v1'
b029d58a 5031 description: Live Test Server (live data - latest RC version)
f4d59981
RK
5032 - url: 'https://peertube.cpy.re/api/v1'
5033 description: Live Test Server (live data - stable version)
3e9e6f2f
RK
5034components:
5035 parameters:
5036 start:
5037 name: start
5038 in: query
5039 required: false
06746a8b 5040 description: Offset used to paginate results
3e9e6f2f 5041 schema:
06746a8b 5042 type: integer
84f6e32c 5043 minimum: 0
3e9e6f2f
RK
5044 count:
5045 name: count
5046 in: query
5047 required: false
06746a8b 5048 description: "Number of items to return"
3e9e6f2f 5049 schema:
06746a8b 5050 type: integer
84f6e32c 5051 default: 15
06746a8b
RK
5052 maximum: 100
5053 minimum: 1
3e9e6f2f
RK
5054 sort:
5055 name: sort
5056 in: query
5057 required: false
84f6e32c 5058 description: Sort column
3e9e6f2f
RK
5059 schema:
5060 type: string
84f6e32c 5061 example: -createdAt
8491293b
RK
5062 search:
5063 name: search
5064 in: query
5065 required: false
5066 description: Plain text search, applied to various parts of the model depending on endpoint
5067 schema:
5068 type: string
ad031145
C
5069 searchTarget:
5070 name: searchTarget
5071 in: query
5072 required: false
5073 description: >
5074 If the administrator enabled search index support, you can override the default search target.
5075
5076
5077 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
84f6e32c 5078 It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
ad031145
C
5079 * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
5080 then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
5081 After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
84f6e32c 5082 * 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
5083 the data from the origin instance API
5084 schema:
5085 type: string
5086 enum:
5087 - 'local'
5088 - 'search-index'
fd5af7a2
RK
5089 videosSort:
5090 name: sort
5091 in: query
5092 required: false
fd5af7a2
RK
5093 schema:
5094 type: string
5095 enum:
d09ed46e
C
5096 - name
5097 - -duration
5098 - -createdAt
5099 - -publishedAt
5100 - -views
5101 - -likes
5102 - -trending
5103 - -hot
5104 - -best
5105 description: >
5106 Sort videos by criteria (prefixing with `-` means `DESC` order):
5107 * `hot` - Adaptation of Reddit "hot" algorithm taking into account video views, likes, dislikes and comments and publication date
5108 * `best` - Same than `hot`, but also takes into account user video history
5109 * `trending` - Sort videos by recent views ("recent" is defined by the admin)
5110 * `views` - Sort videos using their `views` counter
5111 * `publishedAt` - Sort by video publication date (when it became publicly available)
fd5af7a2
RK
5112 videosSearchSort:
5113 name: sort
5114 in: query
5115 required: false
d09ed46e
C
5116 description: >
5117 Sort videos by criteria (prefixing with `-` means `DESC` order):
fd5af7a2
RK
5118 schema:
5119 type: string
5120 enum:
04b703f6 5121 - name
fd5af7a2
RK
5122 - -duration
5123 - -createdAt
5124 - -publishedAt
5125 - -views
5126 - -likes
5127 - -match
71810d0b
RK
5128 commentsSort:
5129 name: sort
5130 in: query
5131 required: false
5132 description: Sort comments by criteria
5133 schema:
5134 type: string
5135 enum:
5136 - -createdAt
5137 - -totalReplies
fd5af7a2
RK
5138 blacklistsSort:
5139 name: sort
5140 in: query
5141 required: false
c756bae0 5142 description: Sort blocklists by criteria
fd5af7a2
RK
5143 schema:
5144 type: string
5145 enum:
5146 - -id
04b703f6 5147 - name
fd5af7a2
RK
5148 - -duration
5149 - -views
5150 - -likes
5151 - -dislikes
5152 - -uuid
5153 - -createdAt
8491293b
RK
5154 usersSearch:
5155 name: search
5156 in: query
5157 required: false
5158 description: Plain text search that will match with user usernames or emails
5159 schema:
5160 type: string
5161 usersBlocked:
5162 name: blocked
5163 in: query
5164 required: false
5165 description: Filter results down to (un)banned users
5166 schema:
5167 type: boolean
fd5af7a2
RK
5168 usersSort:
5169 name: sort
5170 in: query
5171 required: false
5172 description: Sort users by criteria
5173 schema:
5174 type: string
5175 enum:
5176 - -id
5177 - -username
5178 - -createdAt
5179 abusesSort:
5180 name: sort
5181 in: query
5182 required: false
5183 description: Sort abuses by criteria
5184 schema:
5185 type: string
5186 enum:
5187 - -id
5188 - -createdAt
5189 - -state
04b703f6
RK
5190 videoRedundanciesSort:
5191 name: sort
5192 in: query
5193 required: false
5194 description: Sort abuses by criteria
5195 schema:
5196 type: string
5197 enum:
5198 - name
906f46d0
C
5199 followersSort:
5200 name: sort
5201 in: query
5202 required: false
5203 description: Sort followers by criteria
5204 schema:
5205 type: string
5206 enum:
5207 - createdAt
3e9e6f2f
RK
5208 name:
5209 name: name
5210 in: path
5211 required: true
f2eb23cd 5212 description: The username or handle of the account
3e9e6f2f
RK
5213 schema:
5214 type: string
84f6e32c 5215 example: chocobozzz | chocobozzz@example.org
3e9e6f2f
RK
5216 id:
5217 name: id
5218 in: path
5219 required: true
419b520c 5220 description: Entity id
3e9e6f2f 5221 schema:
b8375da9 5222 $ref: '#/components/schemas/id'
cb9d028a 5223 idOrUUID:
3e9e6f2f
RK
5224 name: id
5225 in: path
5226 required: true
d4a8e7a6 5227 description: The object id, uuid or short uuid
3e9e6f2f 5228 schema:
84f6e32c 5229 oneOf:
b8375da9 5230 - $ref: '#/components/schemas/id'
f880a5e7 5231 - $ref: '#/components/schemas/UUIDv4'
d4a8e7a6 5232 - $ref: '#/components/schemas/shortUUID'
c00100b6
RK
5233 playlistId:
5234 name: playlistId
5235 in: path
5236 required: true
5237 description: Playlist id
5238 schema:
5239 $ref: '#/components/schemas/VideoPlaylist/properties/id'
c1843150
C
5240 playlistElementId:
5241 name: playlistElementId
5242 in: path
5243 required: true
5244 description: Playlist element id
5245 schema:
b8375da9 5246 $ref: '#/components/schemas/id'
50e16ccf
C
5247 abuseId:
5248 name: abuseId
5249 in: path
5250 required: true
310b5219 5251 description: Abuse id
50e16ccf 5252 schema:
b8375da9 5253 $ref: '#/components/schemas/Abuse/properties/id'
668b7f09
C
5254 abuseMessageId:
5255 name: abuseMessageId
5256 in: path
5257 required: true
5258 description: Abuse message id
5259 schema:
b8375da9 5260 $ref: '#/components/schemas/AbuseMessage/properties/id'
67ae04a5
C
5261 captionLanguage:
5262 name: captionLanguage
5263 in: path
5264 required: true
5265 description: The caption language
5266 schema:
b8375da9 5267 $ref: '#/components/schemas/VideoLanguageSet'
9ce3d302
C
5268 channelHandle:
5269 name: channelHandle
3e9e6f2f
RK
5270 in: path
5271 required: true
84f6e32c 5272 description: The video channel handle
3e9e6f2f
RK
5273 schema:
5274 type: string
84f6e32c 5275 example: my_username | my_username@example.com
2a491182
F
5276 channelSyncId:
5277 name: channelSyncId
5278 in: path
5279 required: true
5280 description: Channel Sync id
5281 schema:
5282 $ref: '#/components/schemas/Abuse/properties/id'
cb9d028a
C
5283 subscriptionHandle:
5284 name: subscriptionHandle
5285 in: path
5286 required: true
84f6e32c 5287 description: The subscription handle
cb9d028a
C
5288 schema:
5289 type: string
84f6e32c 5290 example: my_username | my_username@example.com
cb9d028a 5291 threadId:
3e9e6f2f
RK
5292 name: threadId
5293 in: path
5294 required: true
cb9d028a
C
5295 description: The thread id (root comment id)
5296 schema:
85a60d8b 5297 type: integer
cb9d028a
C
5298 commentId:
5299 name: commentId
5300 in: path
5301 required: true
3e9e6f2f
RK
5302 description: The comment id
5303 schema:
b8375da9 5304 $ref: '#/components/schemas/VideoComment/properties/id'
1fd61899
C
5305 isLive:
5306 name: isLive
5307 in: query
5308 required: false
5309 description: whether or not the video is a live
5310 schema:
5311 type: boolean
fd5af7a2
RK
5312 categoryOneOf:
5313 name: categoryOneOf
5314 in: query
5315 required: false
40cfb36b 5316 description: category id of the video (see [/videos/categories](#operation/getCategories))
fd5af7a2
RK
5317 schema:
5318 oneOf:
b8375da9 5319 - $ref: '#/components/schemas/VideoCategorySet'
fd5af7a2
RK
5320 - type: array
5321 items:
b8375da9 5322 $ref: '#/components/schemas/VideoCategorySet'
2beb9895
RK
5323 style: form
5324 explode: false
fd5af7a2
RK
5325 tagsOneOf:
5326 name: tagsOneOf
5327 in: query
5328 required: false
5329 description: tag(s) of the video
5330 schema:
5331 oneOf:
5332 - type: string
5333 - type: array
f6d6e7f8 5334 maxItems: 5
fd5af7a2
RK
5335 items:
5336 type: string
2beb9895
RK
5337 style: form
5338 explode: false
fd5af7a2
RK
5339 tagsAllOf:
5340 name: tagsAllOf
5341 in: query
5342 required: false
5343 description: tag(s) of the video, where all should be present in the video
5344 schema:
5345 oneOf:
5346 - type: string
5347 - type: array
5348 items:
5349 type: string
2beb9895
RK
5350 style: form
5351 explode: false
fd5af7a2
RK
5352 languageOneOf:
5353 name: languageOneOf
5354 in: query
5355 required: false
40cfb36b 5356 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
5357 schema:
5358 oneOf:
b8375da9 5359 - $ref: '#/components/schemas/VideoLanguageSet'
fd5af7a2
RK
5360 - type: array
5361 items:
b8375da9 5362 $ref: '#/components/schemas/VideoLanguageSet'
2beb9895
RK
5363 style: form
5364 explode: false
fd5af7a2
RK
5365 licenceOneOf:
5366 name: licenceOneOf
5367 in: query
5368 required: false
40cfb36b 5369 description: licence id of the video (see [/videos/licences](#operation/getLicences))
fd5af7a2
RK
5370 schema:
5371 oneOf:
b8375da9 5372 - $ref: '#/components/schemas/VideoLicenceSet'
fd5af7a2
RK
5373 - type: array
5374 items:
b8375da9 5375 $ref: '#/components/schemas/VideoLicenceSet'
2beb9895
RK
5376 style: form
5377 explode: false
59c794a5
C
5378 skipCount:
5379 name: skipCount
5380 in: query
5381 required: false
5382 description: if you don't need the `total` in the response
5383 schema:
5384 type: string
5385 enum:
5386 - 'true'
5387 - 'false'
06746a8b 5388 default: 'false'
fd5af7a2
RK
5389 nsfw:
5390 name: nsfw
5391 in: query
5392 required: false
5393 description: whether to include nsfw videos, if any
5394 schema:
5395 type: string
5396 enum:
5397 - 'true'
5398 - 'false'
2760b454
C
5399 isLocal:
5400 name: isLocal
fd5af7a2
RK
5401 in: query
5402 required: false
fd5af7a2 5403 schema:
2760b454 5404 type: boolean
7e7d8e48 5405 description: '**PeerTube >= 4.0** Display only local or remote videos'
d324756e
C
5406 hasHLSFiles:
5407 name: hasHLSFiles
5408 in: query
5409 required: false
5410 schema:
5411 type: boolean
5412 description: '**PeerTube >= 4.0** Display only videos that have HLS files'
5413 hasWebtorrentFiles:
5414 name: hasWebtorrentFiles
5415 in: query
5416 required: false
5417 schema:
5418 type: boolean
5419 description: '**PeerTube >= 4.0** Display only videos that have WebTorrent files'
527a52ac
C
5420 privacyOneOf:
5421 name: privacyOneOf
5422 in: query
5423 required: false
5424 schema:
5425 $ref: '#/components/schemas/VideoPrivacySet'
5426 description: '**PeerTube >= 4.0** Display only videos in this specific privacy/privacies'
2760b454
C
5427 include:
5428 name: include
5429 in: query
5430 required: false
5431 schema:
5432 type: integer
fd5af7a2 5433 enum:
2760b454
C
5434 - 0
5435 - 1
5436 - 2
5437 - 4
5438 - 8
5439 description: >
7e7d8e48 5440 **PeerTube >= 4.0** Include additional videos in results (can be combined using bitwise or operator)
2760b454
C
5441
5442 - `0` NONE
5443
5444 - `1` NOT_PUBLISHED_STATE
5445
527a52ac 5446 - `2` BLACKLISTED
2760b454 5447
527a52ac 5448 - `4` BLOCKED_OWNER
2760b454 5449
527a52ac 5450 - `8` FILES
e76d5784
RK
5451 subscriptionsUris:
5452 name: uris
5453 in: query
5454 required: true
5455 description: list of uris to check if each is part of the user subscriptions
5456 schema:
5457 type: array
5458 items:
5459 type: string
84f6e32c
RK
5460 format: uri
5461 npmName:
5462 name: npmName
5463 in: path
5464 required: true
5465 description: name of the plugin/theme on npmjs.com or in its package.json
5466 schema:
5467 type: string
5468 example: peertube-plugin-auth-ldap
040d6896
RK
5469 jobType:
5470 name: jobType
5471 in: query
5472 required: false
5473 description: job type
5474 schema:
5475 type: string
5476 enum:
5477 - activitypub-follow
5478 - activitypub-http-broadcast
5479 - activitypub-http-fetcher
5480 - activitypub-http-unicast
5481 - email
5482 - video-transcoding
5483 - video-file-import
5484 - video-import
51353d9a 5485 - videos-views-stats
040d6896
RK
5486 - activitypub-refresher
5487 - video-redundancy
5488 - video-live-ending
2a491182 5489 - video-channel-import
06dc7a1b
RK
5490 followState:
5491 name: state
5492 in: query
5493 schema:
5494 type: string
5495 enum:
5496 - pending
5497 - accepted
5498 actorType:
5499 name: actorType
5500 in: query
5501 schema:
5502 type: string
5503 enum:
5504 - Person
5505 - Application
5506 - Group
5507 - Service
5508 - Organization
3e9e6f2f
RK
5509 securitySchemes:
5510 OAuth2:
3c5e02f3 5511 description: |
3e9e6f2f 5512 Authenticating via OAuth requires the following steps:
3c5e02f3 5513 - Have an activated account
e2464d22
RK
5514 - [Generate] an access token for that account at `/api/v1/users/token`.
5515 - Make requests with the *Authorization: Bearer <token\>* header
3c5e02f3 5516 - Profit, depending on the role assigned to the account
3e9e6f2f 5517
e2464d22 5518 Note that the __access token is valid for 1 day__ and is given
3c5e02f3 5519 along with a __refresh token valid for 2 weeks__.
e2464d22
RK
5520
5521 [Generate]: https://docs.joinpeertube.org/api-rest-getting-started
3e9e6f2f
RK
5522 type: oauth2
5523 flows:
5524 password:
e2464d22 5525 tokenUrl: /api/v1/users/token
3e9e6f2f
RK
5526 scopes:
5527 admin: Admin scope
5528 moderator: Moderator scope
5529 user: User scope
5530 schemas:
7a4fd56c 5531 # Reusable core properties
b8375da9
RK
5532 id:
5533 type: integer
5534 minimum: 1
5535 example: 42
f880a5e7
RK
5536 UUIDv4:
5537 type: string
5538 format: uuid
5539 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
5540 pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
f880a5e7
RK
5541 minLength: 36
5542 maxLength: 36
d4a8e7a6
C
5543 shortUUID:
5544 type: string
5545 description: translation of a uuid v4 with a bigger alphabet to have a shorter uuid
5546 example: 2y84q2MQUMWPbiEcxNXMgC
b8375da9
RK
5547 username:
5548 type: string
77b0c6b5 5549 description: immutable name of the user, used to find or mention its actor
b8375da9 5550 example: chocobozzz
e2464d22 5551 pattern: '/^[a-z0-9._]+$/'
b8375da9
RK
5552 minLength: 1
5553 maxLength: 50
5554 usernameChannel:
5555 type: string
77b0c6b5 5556 description: immutable name of the channel, used to interact with its actor
9a320a06 5557 example: framasoft_videos
e2464d22
RK
5558 pattern: '/^[a-zA-Z0-9\\-_.:]+$/'
5559 minLength: 1
5560 maxLength: 50
b8375da9
RK
5561 password:
5562 type: string
5563 format: password
b8375da9
RK
5564 minLength: 6
5565 maxLength: 255
f880a5e7 5566
40cfb36b
RK
5567 VideoCategorySet:
5568 type: integer
5569 description: category id of the video (see [/videos/categories](#operation/getCategories))
b8375da9 5570 example: 15
dfcb6f50 5571 VideoConstantNumber-Category:
3e9e6f2f
RK
5572 properties:
5573 id:
40cfb36b 5574 $ref: '#/components/schemas/VideoCategorySet'
3e9e6f2f
RK
5575 label:
5576 type: string
b8375da9 5577 example: Science & Technology
40cfb36b
RK
5578
5579 VideoLicenceSet:
5580 type: integer
5581 description: licence id of the video (see [/videos/licences](#operation/getLicences))
b8375da9 5582 example: 2
dfcb6f50
RK
5583 VideoConstantNumber-Licence:
5584 properties:
5585 id:
40cfb36b 5586 $ref: '#/components/schemas/VideoLicenceSet'
dfcb6f50
RK
5587 label:
5588 type: string
b8375da9
RK
5589 example: Attribution - Share Alike
5590
40cfb36b
RK
5591 VideoLanguageSet:
5592 type: string
5593 description: language id of the video (see [/videos/languages](#operation/getLanguages))
b8375da9 5594 example: en
dfcb6f50 5595 VideoConstantString-Language:
3e9e6f2f
RK
5596 properties:
5597 id:
40cfb36b 5598 $ref: '#/components/schemas/VideoLanguageSet'
3e9e6f2f
RK
5599 label:
5600 type: string
b8375da9 5601 example: English
c1843150
C
5602
5603 VideoPlaylistPrivacySet:
5604 type: integer
5605 enum:
5606 - 1
5607 - 2
5608 - 3
40cfb36b 5609 description: Video playlist privacy policy (see [/video-playlists/privacies])
c1843150
C
5610 VideoPlaylistPrivacyConstant:
5611 properties:
5612 id:
5613 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
5614 label:
5615 type: string
5616
5617 VideoPlaylistTypeSet:
5618 type: integer
5619 enum:
5620 - 1
5621 - 2
40cfb36b 5622 description: The video playlist type (Regular = `1`, Watch Later = `2`)
c1843150
C
5623 VideoPlaylistTypeConstant:
5624 properties:
5625 id:
5626 $ref: '#/components/schemas/VideoPlaylistTypeSet'
5627 label:
5628 type: string
5629
ee89e8fd
C
5630 VideoPrivacySet:
5631 type: integer
3e9e6f2f 5632 enum:
ee89e8fd
C
5633 - 1
5634 - 2
5635 - 3
c1843150 5636 - 4
40cfb36b 5637 description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies))
ee89e8fd
C
5638 VideoPrivacyConstant:
5639 properties:
5640 id:
c1843150 5641 $ref: '#/components/schemas/VideoPrivacySet'
ee89e8fd
C
5642 label:
5643 type: string
50e16ccf 5644
bdf70330
C
5645 BlockStatus:
5646 properties:
5647 accounts:
5648 type: object
5649 additionalProperties:
5650 x-additionalPropertiesName: account
5651 type: object
5652 properties:
5653 blockedByServer:
5654 type: boolean
5655 blockedByUser:
5656 type: boolean
5657 hosts:
5658 type: object
5659 additionalProperties:
5660 x-additionalPropertiesName: host
5661 type: object
5662 properties:
5663 blockedByServer:
5664 type: boolean
5665 blockedByUser:
5666 type: boolean
5667
0590bb46
C
5668 NSFWPolicy:
5669 type: string
5670 enum:
5671 - display
5672 - blur
5673 - do_not_list
5674
5675 UserRole:
06746a8b 5676 type: integer
0590bb46
C
5677 enum:
5678 - 0
5679 - 1
5680 - 2
06746a8b 5681 description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
2c318664 5682 example: 2
6d989edc
C
5683 UserAdminFlags:
5684 type: integer
5685 enum:
5686 - 0
5687 - 1
c756bae0 5688 description: 'Admin flags for the user (None = `0`, Bypass video blocklist = `1`)'
6d989edc 5689 example: 1
0590bb46 5690
f443a746
C
5691 LiveVideoLatencyMode:
5692 type: integer
5693 enum:
5694 - 1
5695 - 2
5696 - 3
7a4fd56c 5697 description: 'The live latency mode (Default = `1`, High latency = `2`, Small Latency = `3`)'
f443a746 5698
5dce26d2
C
5699 VideoStateConstant:
5700 properties:
5701 id:
5702 type: integer
5703 enum:
5704 - 1
5705 - 2
5706 - 3
acc6a1cb
C
5707 - 4
5708 - 5
5709 - 6
5710 - 7
5711 - 8
5712 - 9
5713 description: |
5714 The video state:
5715 - `1`: Published
5716 - `2`: To transcode
5717 - `3`: To import
5718 - `4`: Waiting for live stream
5719 - `5`: Live ended
5720 - `6`: To move to an external storage (object storage...)
5721 - `7`: Transcoding failed
5722 - `8`: Moving to an external storage failed
5723 - `9`: To edit using studio edition feature
5dce26d2
C
5724 label:
5725 type: string
50e16ccf 5726
4f32032f 5727 AbuseStateSet:
50e16ccf
C
5728 type: integer
5729 enum:
5730 - 1
5731 - 2
5732 - 3
668b7f09 5733 description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)'
4f32032f 5734 AbuseStateConstant:
50e16ccf
C
5735 properties:
5736 id:
4f32032f 5737 $ref: '#/components/schemas/AbuseStateSet'
50e16ccf
C
5738 label:
5739 type: string
4f32032f 5740 AbusePredefinedReasons:
1ebddadd
RK
5741 type: array
5742 items:
5743 type: string
5744 enum:
5745 - violentOrAbusive
5746 - hatefulOrAbusive
5747 - spamOrMisleading
5748 - privacy
5749 - rights
5750 - serverRules
5751 - thumbnails
5752 - captions
84f6e32c 5753 example: [spamOrMisleading]
50e16ccf 5754
40cfb36b
RK
5755 VideoResolutionSet:
5756 type: integer
5757 description: |
5758 Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`)
5759
5760 `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos.
5761 example: 240
5dce26d2 5762 VideoResolutionConstant:
2c4876f2 5763 description: resolutions and their labels for the video
5dce26d2
C
5764 properties:
5765 id:
40cfb36b 5766 $ref: '#/components/schemas/VideoResolutionSet'
5dce26d2
C
5767 label:
5768 type: string
84f6e32c 5769 example: 240p
5dce26d2
C
5770 VideoScheduledUpdate:
5771 properties:
5772 privacy:
5773 $ref: '#/components/schemas/VideoPrivacySet'
5dce26d2
C
5774 updateAt:
5775 type: string
5776 format: date
5777 description: When to update the video
5778 required:
5779 - updateAt
c1843150 5780 AccountSummary:
5dce26d2
C
5781 properties:
5782 id:
06746a8b 5783 type: integer
5dce26d2
C
5784 name:
5785 type: string
5786 displayName:
5787 type: string
5788 url:
5789 type: string
84f6e32c 5790 format: url
5dce26d2
C
5791 host:
5792 type: string
84f6e32c 5793 format: hostname
d0800f76 5794 avatars:
5795 type: array
5796 items:
5797 $ref: '#/components/schemas/ActorImage'
5dce26d2
C
5798 VideoChannelSummary:
5799 properties:
5800 id:
b8375da9 5801 $ref: '#/components/schemas/id'
5dce26d2
C
5802 name:
5803 type: string
5804 displayName:
5805 type: string
5806 url:
5807 type: string
84f6e32c 5808 format: url
5dce26d2
C
5809 host:
5810 type: string
84f6e32c 5811 format: hostname
d0800f76 5812 avatars:
5813 type: array
5814 items:
5815 $ref: '#/components/schemas/ActorImage'
5dce26d2
C
5816 PlaylistElement:
5817 properties:
5818 position:
06746a8b 5819 type: integer
5dce26d2 5820 startTimestamp:
06746a8b 5821 type: integer
c00100b6 5822 format: seconds
5dce26d2 5823 stopTimestamp:
06746a8b 5824 type: integer
c00100b6 5825 format: seconds
bfbd9128
C
5826 video:
5827 nullable: true
c1843150
C
5828 allOf:
5829 - $ref: '#/components/schemas/Video'
5dce26d2 5830 VideoFile:
2c4876f2 5831 readOnly: true
5dce26d2 5832 properties:
12d84abe
C
5833 id:
5834 $ref: '#/components/schemas/id'
5dce26d2
C
5835 magnetUri:
5836 type: string
2c4876f2
RK
5837 format: uri
5838 description: magnet URI allowing to resolve the video via BitTorrent without a metainfo file
2c4876f2 5839 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
5dce26d2
C
5840 resolution:
5841 $ref: '#/components/schemas/VideoResolutionConstant'
5842 size:
06746a8b 5843 type: integer
2c4876f2 5844 description: Video file size in bytes
5dce26d2
C
5845 torrentUrl:
5846 type: string
e81af300 5847 description: Direct URL of the torrent file
84f6e32c 5848 format: url
0ad45af7 5849 torrentDownloadUrl:
5dce26d2 5850 type: string
e81af300 5851 description: URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog)
84f6e32c 5852 format: url
5dce26d2
C
5853 fileUrl:
5854 type: string
e81af300 5855 description: Direct URL of the video
84f6e32c 5856 format: url
5dce26d2
C
5857 fileDownloadUrl:
5858 type: string
e81af300 5859 description: URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog)
84f6e32c 5860 format: url
5dce26d2
C
5861 fps:
5862 type: number
2c4876f2 5863 description: Frames per second of the video file
63748ad0
C
5864 metadataUrl:
5865 type: string
84f6e32c 5866 format: url
2c4876f2 5867 description: URL dereferencing the output of ffprobe on the file
5dce26d2 5868 VideoStreamingPlaylists:
4ca669e3
RK
5869 allOf:
5870 - type: object
5871 properties:
5872 id:
b8375da9 5873 $ref: '#/components/schemas/id'
4ca669e3
RK
5874 type:
5875 type: integer
5876 enum:
5877 - 1
5878 description: |
5879 Playlist type:
5880 - `1`: HLS
5881 - $ref: '#/components/schemas/VideoStreamingPlaylists-HLS'
5882 VideoStreamingPlaylists-HLS:
5dce26d2 5883 properties:
5dce26d2
C
5884 playlistUrl:
5885 type: string
84f6e32c 5886 format: url
5dce26d2
C
5887 segmentsSha256Url:
5888 type: string
84f6e32c 5889 format: url
63748ad0
C
5890 files:
5891 type: array
c540d865
RK
5892 description: |
5893 Video files associated to this playlist.
5894
5895 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
5896 items:
5897 $ref: '#/components/schemas/VideoFile'
5dce26d2
C
5898 redundancies:
5899 type: array
5900 items:
5901 type: object
5902 properties:
5903 baseUrl:
5904 type: string
84f6e32c 5905 format: url
f4d59981
RK
5906 VideoInfo:
5907 properties:
5908 id:
b8375da9 5909 $ref: '#/components/schemas/Video/properties/id'
f4d59981 5910 uuid:
b8375da9 5911 $ref: '#/components/schemas/Video/properties/uuid'
f4d59981 5912 name:
b8375da9 5913 $ref: '#/components/schemas/Video/properties/name'
3e9e6f2f
RK
5914 Video:
5915 properties:
5916 id:
b8375da9
RK
5917 description: object id for the video
5918 allOf:
5919 - $ref: '#/components/schemas/id'
3e9e6f2f 5920 uuid:
b8375da9
RK
5921 description: universal identifier for the video, that can be used across instances
5922 allOf:
5923 - $ref: '#/components/schemas/UUIDv4'
d4a8e7a6
C
5924 shortUUID:
5925 allOf:
5926 - $ref: '#/components/schemas/shortUUID'
4e239e35
C
5927 isLive:
5928 type: boolean
3e9e6f2f
RK
5929 createdAt:
5930 type: string
84f6e32c 5931 format: date-time
0c114568
RK
5932 example: 2017-10-01T10:52:46.396Z
5933 description: time at which the video object was first drafted
3e9e6f2f
RK
5934 publishedAt:
5935 type: string
84f6e32c 5936 format: date-time
0c114568
RK
5937 example: 2018-10-01T10:52:46.396Z
5938 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
5939 updatedAt:
5940 type: string
84f6e32c 5941 format: date-time
0c114568
RK
5942 example: 2021-05-04T08:01:01.502Z
5943 description: last time the video's metadata was modified
5dce26d2
C
5944 originallyPublishedAt:
5945 type: string
84f6e32c 5946 format: date-time
0c114568
RK
5947 example: 2010-10-01T10:52:46.396Z
5948 description: used to represent a date of first publication, prior to the practical publication date of `publishedAt`
3e9e6f2f 5949 category:
b8375da9
RK
5950 allOf:
5951 - $ref: '#/components/schemas/VideoConstantNumber-Category'
5952 description: category in which the video is classified
3e9e6f2f 5953 licence:
b8375da9
RK
5954 allOf:
5955 - $ref: '#/components/schemas/VideoConstantNumber-Licence'
5956 description: licence under which the video is distributed
3e9e6f2f 5957 language:
b8375da9
RK
5958 allOf:
5959 - $ref: '#/components/schemas/VideoConstantString-Language'
5960 description: main language used in the video
3e9e6f2f 5961 privacy:
b8375da9
RK
5962 allOf:
5963 - $ref: '#/components/schemas/VideoPrivacyConstant'
5964 description: privacy policy used to distribute the video
3e9e6f2f
RK
5965 description:
5966 type: string
0c114568
RK
5967 example: |
5968 **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n
5969 **Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network, based on fr...
5970 minLength: 3
5971 maxLength: 250
5972 description: |
5973 truncated description of the video, written in Markdown.
5974 Resolve `descriptionPath` to get the full description of maximum `10000` characters.
3e9e6f2f 5975 duration:
06746a8b 5976 type: integer
84f6e32c 5977 example: 1419
c00100b6 5978 format: seconds
0c114568 5979 description: duration of the video in seconds
3e9e6f2f
RK
5980 isLocal:
5981 type: boolean
5982 name:
5983 type: string
b8375da9 5984 description: title of the video
84f6e32c 5985 example: What is PeerTube?
bdac0584
RK
5986 minLength: 3
5987 maxLength: 120
3e9e6f2f
RK
5988 thumbnailPath:
5989 type: string
84f6e32c 5990 example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
5991 previewPath:
5992 type: string
20dcfd74 5993 example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
5994 embedPath:
5995 type: string
84f6e32c 5996 example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
3e9e6f2f 5997 views:
06746a8b 5998 type: integer
84f6e32c 5999 example: 1337
3e9e6f2f 6000 likes:
06746a8b 6001 type: integer
84f6e32c 6002 example: 42
3e9e6f2f 6003 dislikes:
06746a8b 6004 type: integer
84f6e32c 6005 example: 7
3e9e6f2f
RK
6006 nsfw:
6007 type: boolean
5dce26d2
C
6008 waitTranscoding:
6009 type: boolean
6010 nullable: true
6011 state:
b8375da9
RK
6012 allOf:
6013 - $ref: '#/components/schemas/VideoStateConstant'
6014 description: represents the internal state of the video processing within the PeerTube instance
5dce26d2
C
6015 scheduledUpdate:
6016 nullable: true
c1843150
C
6017 allOf:
6018 - $ref: '#/components/schemas/VideoScheduledUpdate'
5dce26d2
C
6019 blacklisted:
6020 nullable: true
6021 type: boolean
6022 blacklistedReason:
6023 nullable: true
6024 type: string
3e9e6f2f 6025 account:
c1843150 6026 $ref: '#/components/schemas/AccountSummary'
5dce26d2
C
6027 channel:
6028 $ref: '#/components/schemas/VideoChannelSummary'
6029 userHistory:
6030 nullable: true
3e9e6f2f
RK
6031 type: object
6032 properties:
5dce26d2 6033 currentTime:
06746a8b 6034 type: integer
5dce26d2
C
6035 VideoDetails:
6036 allOf:
6037 - $ref: '#/components/schemas/Video'
6038 - type: object
6039 properties:
51353d9a
C
6040 viewers:
6041 type: integer
6042 description: If the video is a live, you have the amount of current viewers
5dce26d2 6043 descriptionPath:
3e9e6f2f 6044 type: string
0c114568
RK
6045 example: /api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180a6d/description
6046 description: path at which to get the full description of maximum `10000` characters
5dce26d2 6047 support:
3e9e6f2f 6048 type: string
00494d6e 6049 description: A text tell the audience how to support the video creator
9a320a06 6050 example: Please support our work on https://soutenir.framasoft.org/en/ <3
c540d865
RK
6051 minLength: 3
6052 maxLength: 1000
5dce26d2
C
6053 channel:
6054 $ref: '#/components/schemas/VideoChannel'
6055 account:
6056 $ref: '#/components/schemas/Account'
6057 tags:
bdac0584 6058 example: [flowers, gardening]
5dce26d2 6059 type: array
bdac0584
RK
6060 minItems: 1
6061 maxItems: 5
5dce26d2
C
6062 items:
6063 type: string
bdac0584
RK
6064 minLength: 2
6065 maxLength: 30
5dce26d2
C
6066 commentsEnabled:
6067 type: boolean
6068 downloadEnabled:
6069 type: boolean
6070 trackerUrls:
6071 type: array
6072 items:
6073 type: string
84f6e32c 6074 format: url
2c4876f2
RK
6075 example:
6076 - https://peertube2.cpy.re/tracker/announce
6077 - wss://peertube2.cpy.re/tracker/socket
c540d865
RK
6078 files:
6079 type: array
6080 items:
6081 $ref: '#/components/schemas/VideoFile'
6082 description: |
6083 WebTorrent/raw video files. If WebTorrent is disabled on the server:
6084
6085 - field will be empty
6086 - video files will be found in `streamingPlaylists[].files` field
5dce26d2
C
6087 streamingPlaylists:
6088 type: array
6089 items:
6090 $ref: '#/components/schemas/VideoStreamingPlaylists'
c540d865
RK
6091 description: |
6092 HLS playlists/manifest files. If HLS is disabled on the server:
6093
6094 - field will be empty
6095 - video files will be found in `files` field
04b703f6
RK
6096 FileRedundancyInformation:
6097 properties:
6098 id:
b8375da9 6099 $ref: '#/components/schemas/id'
04b703f6
RK
6100 fileUrl:
6101 type: string
84f6e32c 6102 format: url
04b703f6
RK
6103 strategy:
6104 type: string
84f6e32c
RK
6105 enum:
6106 - manual
6107 - most-views
6108 - trending
6109 - recently-added
04b703f6
RK
6110 size:
6111 type: integer
6112 createdAt:
6113 type: string
6114 format: date-time
6115 updatedAt:
6116 type: string
6117 format: date-time
6118 expiresOn:
6119 type: string
6120 format: date-time
6121 VideoRedundancy:
6122 properties:
6123 id:
b8375da9 6124 $ref: '#/components/schemas/id'
04b703f6
RK
6125 name:
6126 type: string
6127 url:
6128 type: string
84f6e32c 6129 format: url
04b703f6 6130 uuid:
f880a5e7 6131 $ref: '#/components/schemas/UUIDv4'
04b703f6
RK
6132 redundancies:
6133 type: object
6134 properties:
6135 files:
6136 type: array
6137 items:
1e904cde 6138 $ref: '#/components/schemas/FileRedundancyInformation'
04b703f6
RK
6139 streamingPlaylists:
6140 type: array
6141 items:
1e904cde 6142 $ref: '#/components/schemas/FileRedundancyInformation'
1f82e3e8
C
6143 VideoImportStateConstant:
6144 properties:
6145 id:
6146 type: integer
6147 enum:
6148 - 1
6149 - 2
6150 - 3
06746a8b 6151 description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
1f82e3e8
C
6152 label:
6153 type: string
84f6e32c 6154 example: Pending
ac2a5b54
RK
6155 VideoCreateImport:
6156 allOf:
6157 - type: object
6158 additionalProperties: false
6159 oneOf:
6160 - properties:
6161 targetUrl:
6162 $ref: '#/components/schemas/VideoImport/properties/targetUrl'
6163 required: [targetUrl]
6164 - properties:
6165 magnetUri:
6166 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
6167 required: [magnetUri]
6168 - properties:
6169 torrentfile:
6170 $ref: '#/components/schemas/VideoImport/properties/torrentfile'
6171 required: [torrentfile]
6172 - $ref: '#/components/schemas/VideoUploadRequestCommon'
6173 required:
6174 - channelId
6175 - name
1f82e3e8
C
6176 VideoImport:
6177 properties:
6178 id:
ac2a5b54
RK
6179 readOnly: true
6180 allOf:
6181 - $ref: '#/components/schemas/id'
1f82e3e8
C
6182 targetUrl:
6183 type: string
84f6e32c 6184 format: url
2c4876f2 6185 description: remote URL where to find the import's source video
84f6e32c 6186 example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
1f82e3e8
C
6187 magnetUri:
6188 type: string
84f6e32c 6189 format: uri
2c4876f2 6190 description: magnet URI allowing to resolve the import's source video
2c4876f2 6191 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
ac2a5b54
RK
6192 torrentfile:
6193 writeOnly: true
6194 type: string
6195 format: binary
6196 description: Torrent file containing only the video file
1f82e3e8 6197 torrentName:
ac2a5b54 6198 readOnly: true
1f82e3e8
C
6199 type: string
6200 state:
ac2a5b54
RK
6201 readOnly: true
6202 allOf:
6203 - $ref: '#/components/schemas/VideoImportStateConstant'
1f82e3e8 6204 error:
ac2a5b54 6205 readOnly: true
1f82e3e8
C
6206 type: string
6207 createdAt:
ac2a5b54 6208 readOnly: true
1f82e3e8 6209 type: string
84f6e32c 6210 format: date-time
1f82e3e8 6211 updatedAt:
ac2a5b54 6212 readOnly: true
1f82e3e8 6213 type: string
84f6e32c 6214 format: date-time
1f82e3e8 6215 video:
ac2a5b54 6216 readOnly: true
2c4876f2
RK
6217 nullable: true
6218 allOf:
6219 - $ref: '#/components/schemas/Video'
5844dde3
RK
6220 VideoImportsList:
6221 properties:
6222 total:
6223 type: integer
6224 example: 1
6225 data:
6226 type: array
6227 maxItems: 100
6228 items:
6229 $ref: '#/components/schemas/VideoImport'
668b7f09 6230 Abuse:
3e9e6f2f
RK
6231 properties:
6232 id:
b8375da9 6233 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6234 reason:
6235 type: string
84f6e32c 6236 example: The video is a spam
4302058c
RK
6237 minLength: 2
6238 maxLength: 3000
1ebddadd 6239 predefinedReasons:
4f32032f 6240 $ref: '#/components/schemas/AbusePredefinedReasons'
3e9e6f2f
RK
6241 reporterAccount:
6242 $ref: '#/components/schemas/Account'
50e16ccf 6243 state:
4f32032f 6244 $ref: '#/components/schemas/AbuseStateConstant'
50e16ccf
C
6245 moderationComment:
6246 type: string
84f6e32c 6247 example: Decided to ban the server since it spams us regularly
4302058c
RK
6248 minLength: 2
6249 maxLength: 3000
3e9e6f2f 6250 video:
bdac0584 6251 $ref: '#/components/schemas/VideoInfo'
3e9e6f2f
RK
6252 createdAt:
6253 type: string
84f6e32c 6254 format: date-time
668b7f09
C
6255 AbuseMessage:
6256 properties:
6257 id:
b8375da9 6258 $ref: '#/components/schemas/id'
668b7f09
C
6259 message:
6260 type: string
4302058c 6261 minLength: 2
f6d6e7f8 6262 maxLength: 3000
668b7f09
C
6263 byModerator:
6264 type: boolean
6265 createdAt:
6266 type: string
6267 format: date-time
6268 account:
6269 $ref: '#/components/schemas/AccountSummary'
3e9e6f2f
RK
6270 VideoBlacklist:
6271 properties:
6272 id:
b8375da9 6273 $ref: '#/components/schemas/id'
3e9e6f2f 6274 videoId:
b8375da9 6275 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f
RK
6276 createdAt:
6277 type: string
84f6e32c 6278 format: date-time
3e9e6f2f
RK
6279 updatedAt:
6280 type: string
84f6e32c 6281 format: date-time
3e9e6f2f
RK
6282 name:
6283 type: string
4302058c
RK
6284 minLength: 3
6285 maxLength: 120
3e9e6f2f 6286 uuid:
f880a5e7 6287 $ref: '#/components/schemas/UUIDv4'
3e9e6f2f
RK
6288 description:
6289 type: string
4302058c
RK
6290 minLength: 3
6291 maxLength: 10000
3e9e6f2f 6292 duration:
06746a8b 6293 type: integer
3e9e6f2f 6294 views:
06746a8b 6295 type: integer
3e9e6f2f 6296 likes:
06746a8b 6297 type: integer
3e9e6f2f 6298 dislikes:
06746a8b 6299 type: integer
3e9e6f2f
RK
6300 nsfw:
6301 type: boolean
71810d0b
RK
6302 VideoPlaylist:
6303 properties:
6304 id:
b8375da9
RK
6305 $ref: '#/components/schemas/id'
6306 uuid:
6307 $ref: '#/components/schemas/UUIDv4'
d4a8e7a6
C
6308 shortUUID:
6309 allOf:
6310 - $ref: '#/components/schemas/shortUUID'
71810d0b
RK
6311 createdAt:
6312 type: string
84f6e32c 6313 format: date-time
71810d0b
RK
6314 updatedAt:
6315 type: string
84f6e32c 6316 format: date-time
71810d0b
RK
6317 description:
6318 type: string
4302058c
RK
6319 minLength: 3
6320 maxLength: 1000
71810d0b
RK
6321 displayName:
6322 type: string
4302058c
RK
6323 minLength: 1
6324 maxLength: 120
71810d0b
RK
6325 isLocal:
6326 type: boolean
6327 videoLength:
06746a8b 6328 type: integer
b8375da9 6329 minimum: 0
71810d0b
RK
6330 thumbnailPath:
6331 type: string
6332 privacy:
c1843150 6333 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
71810d0b 6334 type:
c1843150 6335 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
71810d0b 6336 ownerAccount:
c1843150
C
6337 $ref: '#/components/schemas/AccountSummary'
6338 videoChannel:
6339 $ref: '#/components/schemas/VideoChannelSummary'
3e9e6f2f
RK
6340 VideoComment:
6341 properties:
6342 id:
b8375da9 6343 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6344 url:
6345 type: string
84f6e32c 6346 format: url
3e9e6f2f
RK
6347 text:
6348 type: string
bf3c3fea
RK
6349 format: html
6350 description: Text of the comment
4302058c 6351 minLength: 1
bf3c3fea 6352 example: This video is wonderful!
3e9e6f2f 6353 threadId:
b8375da9 6354 $ref: '#/components/schemas/id'
bf3c3fea
RK
6355 inReplyToCommentId:
6356 nullable: true
6357 allOf:
6358 - $ref: '#/components/schemas/id'
3e9e6f2f 6359 videoId:
b8375da9 6360 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f
RK
6361 createdAt:
6362 type: string
84f6e32c 6363 format: date-time
3e9e6f2f
RK
6364 updatedAt:
6365 type: string
84f6e32c 6366 format: date-time
bf3c3fea
RK
6367 deletedAt:
6368 nullable: true
6369 type: string
6370 format: date-time
6371 default: null
6372 isDeleted:
6373 type: boolean
6374 default: false
5b0413dd 6375 totalRepliesFromVideoAuthor:
06746a8b 6376 type: integer
b8375da9 6377 minimum: 0
3e9e6f2f 6378 totalReplies:
06746a8b 6379 type: integer
b8375da9 6380 minimum: 0
3e9e6f2f
RK
6381 account:
6382 $ref: '#/components/schemas/Account'
6383 VideoCommentThreadTree:
6384 properties:
6385 comment:
6386 $ref: '#/components/schemas/VideoComment'
6387 children:
6388 type: array
6389 items:
6390 $ref: '#/components/schemas/VideoCommentThreadTree'
67ae04a5
C
6391 VideoCaption:
6392 properties:
6393 language:
dfcb6f50 6394 $ref: '#/components/schemas/VideoConstantString-Language'
67ae04a5
C
6395 captionPath:
6396 type: string
2e401e85 6397 VideoSource:
6398 properties:
6399 filename:
6400 type: string
75cba40d 6401 ActorImage:
3e9e6f2f
RK
6402 properties:
6403 path:
6404 type: string
d0800f76 6405 width:
6406 type: integer
3e9e6f2f
RK
6407 createdAt:
6408 type: string
84f6e32c 6409 format: date-time
3e9e6f2f
RK
6410 updatedAt:
6411 type: string
84f6e32c 6412 format: date-time
f4d59981
RK
6413 ActorInfo:
6414 properties:
6415 id:
b8375da9 6416 $ref: '#/components/schemas/id'
f4d59981
RK
6417 name:
6418 type: string
6419 displayName:
6420 type: string
6421 host:
6422 type: string
84f6e32c 6423 format: hostname
d0800f76 6424 avatars:
6425 type: array
6426 items:
6427 $ref: '#/components/schemas/ActorImage'
3e9e6f2f
RK
6428 Actor:
6429 properties:
6430 id:
b8375da9 6431 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6432 url:
6433 type: string
84f6e32c 6434 format: url
3e9e6f2f 6435 name:
77b0c6b5 6436 description: immutable name of the actor, used to find or mention it
2c4876f2
RK
6437 allOf:
6438 - $ref: '#/components/schemas/username'
3e9e6f2f
RK
6439 host:
6440 type: string
84f6e32c 6441 format: hostname
2c4876f2 6442 description: server on which the actor is resident
045bcd0d
RK
6443 hostRedundancyAllowed:
6444 type: boolean
2c4876f2 6445 description: whether this actor's host allows redundancy of its videos
3e9e6f2f 6446 followingCount:
06746a8b 6447 type: integer
2c4876f2
RK
6448 minimum: 0
6449 description: number of actors subscribed to by this actor, as seen by this instance
3e9e6f2f 6450 followersCount:
06746a8b 6451 type: integer
2c4876f2
RK
6452 minimum: 0
6453 description: number of followers of this actor, as seen by this instance
3e9e6f2f
RK
6454 createdAt:
6455 type: string
84f6e32c 6456 format: date-time
3e9e6f2f
RK
6457 updatedAt:
6458 type: string
84f6e32c 6459 format: date-time
3e9e6f2f
RK
6460 Account:
6461 allOf:
6462 - $ref: '#/components/schemas/Actor'
6463 - properties:
2a8ae759 6464 userId:
2c4876f2
RK
6465 description: object id for the user tied to this account
6466 allOf:
6467 - $ref: '#/components/schemas/User/properties/id'
3e9e6f2f
RK
6468 displayName:
6469 type: string
77b0c6b5
RK
6470 description: editable name of the account, displayed in its representations
6471 minLength: 3
6472 maxLength: 120
2a8ae759
FS
6473 description:
6474 type: string
2c4876f2 6475 description: text or bio displayed on the account's profile
cf158e7e 6476 UserViewingVideo:
bfbdfc58
C
6477 required:
6478 - currentTime
6441981b
RK
6479 properties:
6480 currentTime:
06746a8b 6481 type: integer
c00100b6 6482 format: seconds
84f6e32c
RK
6483 description: timestamp within the video, in seconds
6484 example: 5
bfbdfc58
C
6485 viewEvent:
6486 type: string
6487 enum:
6488 - seek
6489 description: >
6490 Event since last viewing call:
6491 * `seek` - If the user seeked the video
cf158e7e
C
6492
6493 VideoStatsOverall:
6494 properties:
6495 averageWatchTime:
6496 type: number
6497 totalWatchTime:
6498 type: number
6499 viewersPeak:
6500 type: number
6501 viewersPeakDate:
6502 type: string
6503 format: date-time
cf158e7e
C
6504 countries:
6505 type: array
6506 items:
6507 type: object
6508 properties:
6509 isoCode:
6510 type: string
6511 viewers:
6512 type: number
6513
6514 VideoStatsRetention:
6515 properties:
6516 data:
6517 type: array
6518 items:
6519 type: object
6520 properties:
6521 second:
6522 type: number
6523 retentionPercent:
6524 type: number
6525
6526 VideoStatsTimeserie:
6527 properties:
6528 data:
6529 type: array
6530 items:
6531 type: object
6532 properties:
6533 date:
6534 type: string
6535 value:
6536 type: number
6537
3e9e6f2f
RK
6538 ServerConfig:
6539 properties:
2a8ae759
FS
6540 instance:
6541 type: object
6542 properties:
6543 name:
6544 type: string
6545 shortDescription:
6546 type: string
6547 defaultClientRoute:
6548 type: string
6549 isNSFW:
6550 type: boolean
6551 defaultNSFWPolicy:
6552 type: string
6553 customizations:
6554 type: object
6555 properties:
6556 javascript:
6557 type: string
6558 css:
6559 type: string
f30736c8
RK
6560 search:
6561 type: object
6562 properties:
6563 remoteUri:
6564 type: object
6565 properties:
6566 users:
6567 type: boolean
6568 anonymous:
6569 type: boolean
2a8ae759
FS
6570 plugin:
6571 type: object
6572 properties:
6573 registered:
6574 type: array
6575 items:
6576 type: string
6577 theme:
6578 type: object
6579 properties:
6580 registered:
6581 type: array
6582 items:
6583 type: string
6584 email:
6585 type: object
6586 properties:
6587 enabled:
6588 type: boolean
6589 contactForm:
6590 type: object
6591 properties:
6592 enabled:
6593 type: boolean
6594 serverVersion:
6595 type: string
6596 serverCommit:
6597 type: string
3e9e6f2f
RK
6598 signup:
6599 type: object
6600 properties:
6601 allowed:
6602 type: boolean
2a8ae759
FS
6603 allowedForCurrentIP:
6604 type: boolean
6605 requiresEmailVerification:
6606 type: boolean
3e9e6f2f
RK
6607 transcoding:
6608 type: object
6609 properties:
2a8ae759
FS
6610 hls:
6611 type: object
6612 properties:
6613 enabled:
6614 type: boolean
f30736c8
RK
6615 webtorrent:
6616 type: object
6617 properties:
6618 enabled:
6619 type: boolean
3e9e6f2f
RK
6620 enabledResolutions:
6621 type: array
6622 items:
40cfb36b 6623 $ref: '#/components/schemas/VideoResolutionSet'
2a8ae759
FS
6624 import:
6625 type: object
6626 properties:
6627 videos:
6628 type: object
6629 properties:
6630 http:
6631 type: object
6632 properties:
6633 enabled:
6634 type: boolean
6635 torrent:
6636 type: object
6637 properties:
6638 enabled:
6639 type: boolean
2a491182
F
6640 videoChannelSynchronization:
6641 type: object
6642 properties:
6643 enabled:
6644 type: boolean
2a8ae759
FS
6645 autoBlacklist:
6646 type: object
6647 properties:
6648 videos:
6649 type: object
6650 properties:
6651 ofUsers:
6652 type: object
6653 properties:
6654 enabled:
6655 type: boolean
3e9e6f2f
RK
6656 avatar:
6657 type: object
6658 properties:
6659 file:
6660 type: object
6661 properties:
6662 size:
6663 type: object
6664 properties:
6665 max:
06746a8b 6666 type: integer
3e9e6f2f
RK
6667 extensions:
6668 type: array
6669 items:
6670 type: string
6671 video:
6672 type: object
6673 properties:
2a8ae759
FS
6674 image:
6675 type: object
6676 properties:
6677 extensions:
6678 type: array
6679 items:
6680 type: string
6681 size:
6682 type: object
6683 properties:
6684 max:
06746a8b 6685 type: integer
3e9e6f2f
RK
6686 file:
6687 type: object
6688 properties:
6689 extensions:
6690 type: array
6691 items:
6692 type: string
2a8ae759
FS
6693 videoCaption:
6694 type: object
6695 properties:
6696 file:
6697 type: object
6698 properties:
6699 size:
6700 type: object
6701 properties:
6702 max:
06746a8b 6703 type: integer
2a8ae759
FS
6704 extensions:
6705 type: array
6706 items:
6707 type: string
6708 user:
6709 type: object
6710 properties:
6711 videoQuota:
06746a8b 6712 type: integer
b8375da9 6713 example: 16810141515
2a8ae759 6714 videoQuotaDaily:
06746a8b 6715 type: integer
b8375da9 6716 example: 1681014151
2a8ae759
FS
6717 trending:
6718 type: object
6719 properties:
6720 videos:
6721 type: object
6722 properties:
6723 intervalDays:
06746a8b 6724 type: integer
2a8ae759 6725 tracker:
747b17c7 6726 type: object
2a8ae759
FS
6727 properties:
6728 enabled:
6729 type: boolean
f30736c8
RK
6730 followings:
6731 type: object
6732 properties:
6733 instance:
6734 type: object
6735 properties:
6736 autoFollowIndex:
6737 type: object
6738 properties:
6739 indexUrl:
6740 type: string
84f6e32c 6741 format: url
2539932e
C
6742 homepage:
6743 type: object
6744 properties:
6745 enabled:
6746 type: boolean
6747
42b40636
C
6748 SendClientLog:
6749 properties:
6750 message:
6751 type: string
6752 url:
6753 type: string
6754 description: URL of the current user page
6755 level:
6756 enum:
6757 - error
6758 - warn
6759 stackTrace:
6760 type: string
6761 description: Stack trace of the error if there is one
6762 userAgent:
6763 type: string
6764 description: User agent of the web browser that sends the message
6765 meta:
6766 type: string
6767 description: Additional information regarding this log
6768 required:
6769 - message
6770 - url
6771 - level
6772
b44b5a83
C
6773 ServerStats:
6774 properties:
6775 totalUsers:
6776 type: number
6777 totalDailyActiveUsers:
6778 type: number
6779 totalWeeklyActiveUsers:
6780 type: number
6781 totalMonthlyActiveUsers:
6782 type: number
6783 totalLocalVideos:
6784 type: number
6785 totalLocalVideoViews:
6786 type: number
6787 description: Total video views made on the instance
6788 totalLocalVideoComments:
6789 type: number
6790 description: Total comments made by local users
6791 totalLocalVideoFilesSize:
6792 type: number
6793 totalVideos:
6794 type: number
6795 totalVideoComments:
6796 type: number
6797 totalLocalVideoChannels:
6798 type: number
6799 totalLocalDailyActiveVideoChannels:
6800 type: number
6801 totalLocalWeeklyActiveVideoChannels:
6802 type: number
6803 totalLocalMonthlyActiveVideoChannels:
6804 type: number
6805 totalLocalPlaylists:
6806 type: number
6807 totalInstanceFollowers:
6808 type: number
6809 totalInstanceFollowing:
6810 type: number
6811 videosRedundancy:
6812 type: array
6813 items:
6814 type: object
6815 properties:
6816 strategy:
6817 type: string
6818 totalSize:
6819 type: number
6820 totalUsed:
6821 type: number
6822 totalVideoFiles:
6823 type: number
6824 totalVideos:
6825 type: number
6826 totalActivityPubMessagesProcessed:
6827 type: number
6828 totalActivityPubMessagesSuccesses:
6829 type: number
6830 totalActivityPubMessagesErrors:
6831 type: number
6832
6833 activityPubMessagesProcessedPerSecond:
6834 type: number
6835 totalActivityPubMessagesWaiting:
6836 type: number
6837
2a8ae759
FS
6838 ServerConfigAbout:
6839 properties:
6840 instance:
6841 type: object
6842 properties:
6843 name:
6844 type: string
6845 shortDescription:
6846 type: string
6847 description:
6848 type: string
6849 terms:
6850 type: string
6851 ServerConfigCustom:
6852 properties:
6853 instance:
6854 type: object
6855 properties:
6856 name:
6857 type: string
6858 shortDescription:
6859 type: string
6860 description:
6861 type: string
6862 terms:
6863 type: string
6864 defaultClientRoute:
6865 type: string
6866 isNSFW:
6867 type: boolean
6868 defaultNSFWPolicy:
6869 type: string
6870 customizations:
6871 type: object
6872 properties:
6873 javascript:
6874 type: string
6875 css:
6876 type: string
6877 theme:
6878 type: object
6879 properties:
6880 default:
6881 type: string
6882 services:
6883 type: object
6884 properties:
6885 twitter:
6886 type: object
6887 properties:
6888 username:
6889 type: string
6890 whitelisted:
6891 type: boolean
6892 cache:
6893 type: object
6894 properties:
6895 previews:
6896 type: object
6897 properties:
6898 size:
06746a8b 6899 type: integer
2a8ae759
FS
6900 captions:
6901 type: object
6902 properties:
6903 size:
06746a8b 6904 type: integer
2a8ae759
FS
6905 signup:
6906 type: object
6907 properties:
6908 enabled:
6909 type: boolean
6910 limit:
06746a8b 6911 type: integer
2a8ae759
FS
6912 requiresEmailVerification:
6913 type: boolean
6914 admin:
6915 type: object
6916 properties:
6917 email:
6918 type: string
84f6e32c 6919 format: email
2a8ae759
FS
6920 contactForm:
6921 type: object
6922 properties:
6923 enabled:
6924 type: boolean
6925 user:
6926 type: object
40cfb36b 6927 description: Settings that apply to new users, if registration is enabled
2a8ae759
FS
6928 properties:
6929 videoQuota:
06746a8b 6930 type: integer
b8375da9 6931 example: 16810141515
2a8ae759 6932 videoQuotaDaily:
06746a8b 6933 type: integer
b8375da9 6934 example: 1681014151
2a8ae759
FS
6935 transcoding:
6936 type: object
40cfb36b 6937 description: Settings pertaining to transcoding jobs
2a8ae759
FS
6938 properties:
6939 enabled:
6940 type: boolean
6941 allowAdditionalExtensions:
6942 type: boolean
40cfb36b 6943 description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos
2a8ae759
FS
6944 allowAudioFiles:
6945 type: boolean
40cfb36b 6946 description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file
2a8ae759 6947 threads:
06746a8b 6948 type: integer
40cfb36b
RK
6949 description: Amount of threads used by ffmpeg for 1 transcoding job
6950 concurrency:
6951 type: number
6952 description: Amount of transcoding jobs to execute in parallel
6953 profile:
6954 type: string
6955 enum:
6956 - default
6957 description: |
6958 New profiles can be added by plugins ; available in core PeerTube: 'default'.
2a8ae759
FS
6959 resolutions:
6960 type: object
40cfb36b 6961 description: Resolutions to transcode _new videos_ to
2a8ae759 6962 properties:
40cfb36b
RK
6963 0p:
6964 type: boolean
8dd754c7
FC
6965 144p:
6966 type: boolean
2a8ae759
FS
6967 240p:
6968 type: boolean
6969 360p:
6970 type: boolean
6971 480p:
6972 type: boolean
6973 720p:
6974 type: boolean
6975 1080p:
6976 type: boolean
b7085c71
RK
6977 1440p:
6978 type: boolean
2a8ae759
FS
6979 2160p:
6980 type: boolean
40cfb36b
RK
6981 webtorrent:
6982 type: object
6983 description: WebTorrent-specific settings
6984 properties:
6985 enabled:
6986 type: boolean
2a8ae759
FS
6987 hls:
6988 type: object
40cfb36b 6989 description: HLS-specific settings
2a8ae759
FS
6990 properties:
6991 enabled:
6992 type: boolean
6993 import:
6994 type: object
6995 properties:
6996 videos:
6997 type: object
6998 properties:
6999 http:
7000 type: object
7001 properties:
7002 enabled:
7003 type: boolean
7004 torrent:
7005 type: object
7006 properties:
7007 enabled:
7008 type: boolean
2a491182
F
7009 video_channel_synchronization:
7010 type: object
7011 properties:
7012 enabled:
7013 type: boolean
2a8ae759
FS
7014 autoBlacklist:
7015 type: object
7016 properties:
7017 videos:
7018 type: object
7019 properties:
7020 ofUsers:
7021 type: object
7022 properties:
7023 enabled:
7024 type: boolean
7025 followers:
7026 type: object
7027 properties:
7028 instance:
7029 type: object
7030 properties:
7031 enabled:
7032 type: boolean
7033 manualApproval:
7034 type: boolean
2539932e
C
7035
7036 CustomHomepage:
7037 properties:
7038 content:
7039 type: string
7040
3e9e6f2f
RK
7041 Follow:
7042 properties:
7043 id:
b8375da9 7044 $ref: '#/components/schemas/id'
3e9e6f2f
RK
7045 follower:
7046 $ref: '#/components/schemas/Actor'
7047 following:
7048 $ref: '#/components/schemas/Actor'
7049 score:
7050 type: number
04b703f6 7051 description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
3e9e6f2f
RK
7052 state:
7053 type: string
7054 enum:
7055 - pending
7056 - accepted
7057 createdAt:
7058 type: string
84f6e32c 7059 format: date-time
3e9e6f2f
RK
7060 updatedAt:
7061 type: string
84f6e32c 7062 format: date-time
e3489df9
C
7063
7064 PredefinedAbuseReasons:
7065 description: Reason categories that help triage reports
7066 type: array
f6d6e7f8 7067 maxItems: 8
e3489df9
C
7068 items:
7069 type: string
7070 enum:
7071 - violentOrAbusive
7072 - hatefulOrAbusive
7073 - spamOrMisleading
7074 - privacy
7075 - rights
7076 - serverRules
7077 - thumbnails
7078 - captions
7079
3e9e6f2f
RK
7080 Job:
7081 properties:
7082 id:
b8375da9 7083 $ref: '#/components/schemas/id'
3e9e6f2f
RK
7084 state:
7085 type: string
7086 enum:
84f6e32c
RK
7087 - active
7088 - completed
7089 - failed
7090 - waiting
7091 - delayed
7092 type:
3e9e6f2f
RK
7093 type: string
7094 enum:
84f6e32c
RK
7095 - activitypub-http-unicast
7096 - activitypub-http-broadcast
7097 - activitypub-http-fetcher
7098 - activitypub-follow
7099 - video-file-import
7100 - video-transcoding
7101 - email
7102 - video-import
51353d9a 7103 - videos-views-stats
84f6e32c
RK
7104 - activitypub-refresher
7105 - video-redundancy
2a491182 7106 - video-channel-import
84f6e32c
RK
7107 data:
7108 type: object
7109 additionalProperties: true
7110 error:
7111 type: object
7112 additionalProperties: true
3e9e6f2f
RK
7113 createdAt:
7114 type: string
84f6e32c
RK
7115 format: date-time
7116 finishedOn:
3e9e6f2f 7117 type: string
84f6e32c
RK
7118 format: date-time
7119 processedOn:
7120 type: string
7121 format: date-time
3e9e6f2f
RK
7122 AddUserResponse:
7123 properties:
2c318664
RK
7124 user:
7125 type: object
7126 properties:
7127 id:
b8375da9 7128 $ref: '#/components/schemas/id'
2c318664
RK
7129 account:
7130 type: object
7131 properties:
7132 id:
b8375da9 7133 $ref: '#/components/schemas/id'
f6d6e7f8 7134 VideoUploadRequestCommon:
7135 properties:
7136 name:
7137 description: Video name
7138 type: string
b8375da9
RK
7139 example: What is PeerTube?
7140 minLength: 3
7141 maxLength: 120
f6d6e7f8 7142 channelId:
7143 description: Channel id that will contain this video
7144 type: integer
b8375da9
RK
7145 example: 3
7146 minimum: 1
f6d6e7f8 7147 privacy:
7148 $ref: '#/components/schemas/VideoPrivacySet'
7149 category:
40cfb36b 7150 $ref: '#/components/schemas/VideoCategorySet'
f6d6e7f8 7151 licence:
40cfb36b 7152 $ref: '#/components/schemas/VideoLicenceSet'
f6d6e7f8 7153 language:
40cfb36b 7154 $ref: '#/components/schemas/VideoLanguageSet'
f6d6e7f8 7155 description:
7156 description: Video description
7157 type: string
b8375da9
RK
7158 example: |
7159 **[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 7160 waitTranscoding:
7161 description: Whether or not we wait transcoding before publish the video
7162 type: boolean
7163 support:
7164 description: A text tell the audience how to support the video creator
9a320a06 7165 example: Please support our work on https://soutenir.framasoft.org/en/ <3
f6d6e7f8 7166 type: string
7167 nsfw:
7168 description: Whether or not this video contains sensitive content
7169 type: boolean
7170 tags:
7171 description: Video tags (maximum 5 tags each between 2 and 30 characters)
7172 type: array
7173 minItems: 1
7174 maxItems: 5
7175 uniqueItems: true
b8375da9
RK
7176 example:
7177 - framasoft
7178 - peertube
f6d6e7f8 7179 items:
7180 type: string
7181 minLength: 2
7182 maxLength: 30
7183 commentsEnabled:
7184 description: Enable or disable comments for this video
7185 type: boolean
7186 downloadEnabled:
7187 description: Enable or disable downloading for this video
7188 type: boolean
7189 originallyPublishedAt:
7190 description: Date when the content was originally published
7191 type: string
7192 format: date-time
7193 scheduleUpdate:
7194 $ref: '#/components/schemas/VideoScheduledUpdate'
7195 thumbnailfile:
7196 description: Video thumbnail file
7197 type: string
7198 format: binary
7199 previewfile:
7200 description: Video preview file
7201 type: string
7202 format: binary
7203 required:
7204 - channelId
7205 - name
7206 VideoUploadRequestLegacy:
7207 allOf:
7208 - $ref: '#/components/schemas/VideoUploadRequestCommon'
7209 - type: object
7210 required:
7211 - videofile
7212 properties:
7213 videofile:
7214 description: Video file
7215 type: string
7216 format: binary
7217 VideoUploadRequestResumable:
7218 allOf:
7219 - $ref: '#/components/schemas/VideoUploadRequestCommon'
7220 - type: object
7221 required:
7222 - filename
7223 properties:
7224 filename:
7225 description: Video filename including extension
7226 type: string
7227 format: filename
b8375da9 7228 example: what_is_peertube.mp4
f6d6e7f8 7229 thumbnailfile:
7230 description: Video thumbnail file
7231 type: string
7232 format: binary
7233 previewfile:
7234 description: Video preview file
7235 type: string
7236 format: binary
3e9e6f2f
RK
7237 VideoUploadResponse:
7238 properties:
7239 video:
7240 type: object
7241 properties:
7242 id:
b8375da9 7243 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f 7244 uuid:
b8375da9 7245 $ref: '#/components/schemas/Video/properties/uuid'
d4a8e7a6
C
7246 shortUUID:
7247 $ref: '#/components/schemas/Video/properties/shortUUID'
3e9e6f2f
RK
7248 CommentThreadResponse:
7249 properties:
7250 total:
06746a8b 7251 type: integer
84f6e32c 7252 example: 1
3e9e6f2f
RK
7253 data:
7254 type: array
84f6e32c 7255 maxItems: 100
3e9e6f2f
RK
7256 items:
7257 $ref: '#/components/schemas/VideoComment'
7258 CommentThreadPostResponse:
7259 properties:
7260 comment:
7261 $ref: '#/components/schemas/VideoComment'
048b6946
C
7262 VideoListResponse:
7263 properties:
7264 total:
06746a8b 7265 type: integer
84f6e32c 7266 example: 1
048b6946
C
7267 data:
7268 type: array
84f6e32c 7269 maxItems: 100
048b6946
C
7270 items:
7271 $ref: '#/components/schemas/Video'
84f6e32c
RK
7272 User:
7273 properties:
fd5586b3
RK
7274 account:
7275 $ref: '#/components/schemas/Account'
7276 autoPlayNextVideo:
7277 type: boolean
7278 description: Automatically start playing the upcoming video after the currently playing video
7279 autoPlayNextVideoPlaylist:
7280 type: boolean
7281 description: Automatically start playing the video on the playlist after the currently playing video
7282 autoPlayVideo:
7283 type: boolean
7284 description: Automatically start playing the video on the watch page
7285 blocked:
7286 type: boolean
7287 blockedReason:
7288 type: string
7289 createdAt:
84f6e32c 7290 type: string
84f6e32c
RK
7291 email:
7292 type: string
7293 format: email
7294 description: The user email
fd5586b3
RK
7295 emailVerified:
7296 type: boolean
7297 description: Has the user confirmed their email address?
7298 id:
2c4876f2
RK
7299 allOf:
7300 - $ref: '#/components/schemas/id'
fd5586b3 7301 readOnly: true
6d989edc
C
7302 pluginAuth:
7303 type: string
7304 description: Auth plugin to use to authenticate the user
fd5586b3 7305 lastLoginDate:
84f6e32c 7306 type: string
fd5586b3
RK
7307 format: date-time
7308 noInstanceConfigWarningModal:
7309 type: boolean
8f581725
C
7310 noAccountSetupWarningModal:
7311 type: boolean
fd5586b3 7312 noWelcomeModal:
84f6e32c 7313 type: boolean
84f6e32c
RK
7314 nsfwPolicy:
7315 $ref: '#/components/schemas/NSFWPolicy'
84f6e32c
RK
7316 role:
7317 $ref: '#/components/schemas/UserRole'
7318 roleLabel:
7319 type: string
7320 enum:
7321 - User
7322 - Moderator
7323 - Administrator
fd5586b3 7324 theme:
84f6e32c 7325 type: string
fd5586b3
RK
7326 description: Theme enabled by this user
7327 username:
b8375da9 7328 $ref: '#/components/schemas/username'
84f6e32c
RK
7329 videoChannels:
7330 type: array
7331 items:
7332 $ref: '#/components/schemas/VideoChannel'
fd5586b3
RK
7333 videoQuota:
7334 type: integer
7335 description: The user video quota in bytes
7336 example: -1
7337 videoQuotaDaily:
7338 type: integer
7339 description: The user daily video quota in bytes
7340 example: -1
a9bfa85d 7341 p2pEnabled:
fd5586b3
RK
7342 type: boolean
7343 description: Enable P2P in the player
7344 UserWithStats:
7345 allOf:
7346 - $ref: '#/components/schemas/User'
7347 - properties:
7348 # optionally present fields: they require WITH_STATS scope
7349 videosCount:
7350 type: integer
85a60d8b 7351 description: Count of videos published
fd5586b3
RK
7352 abusesCount:
7353 type: integer
7354 description: Count of reports/abuses of which the user is a target
7355 abusesAcceptedCount:
7356 type: integer
7357 description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team
7358 abusesCreatedCount:
7359 type: integer
7360 description: Count of reports/abuses created by the user
7361 videoCommentsCount:
7362 type: integer
7363 description: Count of comments published
3e9e6f2f
RK
7364 AddUser:
7365 properties:
7366 username:
b8375da9 7367 $ref: '#/components/schemas/username'
3e9e6f2f 7368 password:
b8375da9 7369 $ref: '#/components/schemas/password'
3e9e6f2f
RK
7370 email:
7371 type: string
84f6e32c
RK
7372 format: email
7373 description: The user email
3e9e6f2f 7374 videoQuota:
84f6e32c 7375 type: integer
b8375da9
RK
7376 description: The user video quota in bytes
7377 example: -1
fbe1bc2a 7378 videoQuotaDaily:
84f6e32c 7379 type: integer
b8375da9
RK
7380 description: The user daily video quota in bytes
7381 example: -1
6d989edc 7382 channelName:
b8375da9 7383 $ref: '#/components/schemas/usernameChannel'
3e9e6f2f 7384 role:
0590bb46 7385 $ref: '#/components/schemas/UserRole'
6d989edc
C
7386 adminFlags:
7387 $ref: '#/components/schemas/UserAdminFlags'
3e9e6f2f
RK
7388 required:
7389 - username
7390 - password
7391 - email
7392 - videoQuota
fbe1bc2a 7393 - videoQuotaDaily
3e9e6f2f
RK
7394 - role
7395 UpdateUser:
7396 properties:
3e9e6f2f 7397 email:
84f6e32c 7398 description: The updated email of the user
77b0c6b5
RK
7399 allOf:
7400 - $ref: '#/components/schemas/User/properties/email'
6d989edc
C
7401 emailVerified:
7402 type: boolean
7403 description: Set the email as verified
3e9e6f2f 7404 videoQuota:
84f6e32c 7405 type: integer
b8375da9 7406 description: The updated video quota of the user in bytes
fbe1bc2a 7407 videoQuotaDaily:
84f6e32c 7408 type: integer
b8375da9 7409 description: The updated daily video quota of the user in bytes
6d989edc
C
7410 pluginAuth:
7411 type: string
7412 nullable: true
7413 description: The auth plugin to use to authenticate the user
7414 example: 'peertube-plugin-auth-saml2'
3e9e6f2f 7415 role:
0590bb46 7416 $ref: '#/components/schemas/UserRole'
6d989edc
C
7417 adminFlags:
7418 $ref: '#/components/schemas/UserAdminFlags'
5097cbda
C
7419 password:
7420 $ref: '#/components/schemas/password'
3e9e6f2f 7421 UpdateMe:
77b0c6b5 7422 # see shared/models/users/user-update-me.model.ts:
3e9e6f2f
RK
7423 properties:
7424 password:
b8375da9 7425 $ref: '#/components/schemas/password'
77b0c6b5
RK
7426 currentPassword:
7427 $ref: '#/components/schemas/password'
3e9e6f2f 7428 email:
77b0c6b5
RK
7429 description: new email used for login and service communications
7430 allOf:
7431 - $ref: '#/components/schemas/User/properties/email'
7432 displayName:
3e9e6f2f 7433 type: string
77b0c6b5
RK
7434 description: new name of the user in its representations
7435 minLength: 3
7436 maxLength: 120
3e9e6f2f
RK
7437 displayNSFW:
7438 type: string
77b0c6b5 7439 description: new NSFW display policy
84f6e32c
RK
7440 enum:
7441 - 'true'
7442 - 'false'
7443 - both
a9bfa85d 7444 p2pEnabled:
77b0c6b5
RK
7445 type: boolean
7446 description: whether to enable P2P in the player or not
3e9e6f2f 7447 autoPlayVideo:
84f6e32c 7448 type: boolean
77b0c6b5
RK
7449 description: new preference regarding playing videos automatically
7450 autoPlayNextVideo:
7451 type: boolean
7452 description: new preference regarding playing following videos automatically
7453 autoPlayNextVideoPlaylist:
7454 type: boolean
7455 description: new preference regarding playing following playlist videos automatically
7456 videosHistoryEnabled:
7457 type: boolean
7458 description: whether to keep track of watched history or not
7459 videoLanguages:
7460 type: array
7461 items:
7462 type: string
7463 description: list of languages to filter videos down to
7464 theme:
7465 type: string
7466 noInstanceConfigWarningModal:
7467 type: boolean
8f581725
C
7468 noAccountSetupWarningModal:
7469 type: boolean
77b0c6b5
RK
7470 noWelcomeModal:
7471 type: boolean
3e9e6f2f
RK
7472 GetMeVideoRating:
7473 properties:
7474 id:
b8375da9 7475 $ref: '#/components/schemas/id'
3e9e6f2f 7476 rating:
30b40713
RK
7477 type: string
7478 enum:
7479 - like
7480 - dislike
7481 - none
84f6e32c 7482 description: Rating of the video
3e9e6f2f
RK
7483 required:
7484 - id
7485 - rating
c100a614
YB
7486 VideoRating:
7487 properties:
7488 video:
7489 $ref: '#/components/schemas/Video'
7490 rating:
30b40713
RK
7491 type: string
7492 enum:
7493 - like
7494 - dislike
7495 - none
7496 description: Rating of the video
c100a614
YB
7497 required:
7498 - video
7499 - rating
3e9e6f2f
RK
7500 RegisterUser:
7501 properties:
7502 username:
77b0c6b5
RK
7503 description: immutable name of the user, used to find or mention its actor
7504 allOf:
7505 - $ref: '#/components/schemas/username'
3e9e6f2f 7506 password:
b8375da9 7507 $ref: '#/components/schemas/password'
3e9e6f2f
RK
7508 email:
7509 type: string
84f6e32c 7510 format: email
77b0c6b5 7511 description: email of the user, used for login or service communications
1f20622f
C
7512 displayName:
7513 type: string
77b0c6b5 7514 description: editable name of the user, displayed in its representations
84f6e32c
RK
7515 minLength: 1
7516 maxLength: 120
1f20622f
C
7517 channel:
7518 type: object
77b0c6b5 7519 description: channel base information used to create the first channel of the user
1f20622f
C
7520 properties:
7521 name:
b8375da9 7522 $ref: '#/components/schemas/usernameChannel'
1f20622f 7523 displayName:
d0800f76 7524 type: string
3e9e6f2f
RK
7525 required:
7526 - username
7527 - password
7528 - email
4302058c 7529
e2464d22
RK
7530 OAuthClient:
7531 properties:
7532 client_id:
7533 type: string
7534 pattern: /^[a-z0-9]$/
7535 maxLength: 32
7536 minLength: 32
7537 example: v1ikx5hnfop4mdpnci8nsqh93c45rldf
7538 client_secret:
7539 type: string
7540 pattern: /^[a-zA-Z0-9]$/
7541 maxLength: 32
7542 minLength: 32
7543 example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt
7544 OAuthToken-password:
7545 allOf:
7546 - $ref: '#/components/schemas/OAuthClient'
7547 - type: object
7548 properties:
7549 grant_type:
7550 type: string
7551 enum:
7552 - password
7553 - refresh_token
7554 default: password
7555 username:
7556 $ref: '#/components/schemas/User/properties/username'
7557 password:
7558 $ref: '#/components/schemas/password'
7559 required:
7560 - client_id
7561 - client_secret
7562 - grant_type
7563 - username
7564 - password
7565 OAuthToken-refresh_token:
7566 allOf:
7567 - $ref: '#/components/schemas/OAuthClient'
7568 - type: object
7569 properties:
7570 grant_type:
7571 type: string
7572 enum:
7573 - password
7574 - refresh_token
7575 default: password
7576 refresh_token:
7577 type: string
7578 example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7
7579 required:
7580 - client_id
7581 - client_secret
7582 - grant_type
7583 - refresh_token
7584
b8375da9 7585 VideoChannel:
d0800f76 7586 allOf:
7587 - $ref: '#/components/schemas/Actor'
7588 - type: object
b8375da9 7589 properties:
d0800f76 7590 displayName:
7591 type: string
7592 description: editable name of the channel, displayed in its representations
7593 example: Videos of Framasoft
7594 minLength: 1
7595 maxLength: 120
7596 description:
7597 type: string
7598 example: Videos made with <3 by Framasoft
7599 minLength: 3
7600 maxLength: 1000
7601 support:
7602 type: string
7603 description: text shown by default on all videos of this channel, to tell the audience how to support it
7604 example: Please support our work on https://soutenir.framasoft.org/en/ <3
7605 minLength: 3
7606 maxLength: 1000
7607 isLocal:
7608 readOnly: true
7609 type: boolean
7610 updatedAt:
7611 readOnly: true
7612 type: string
7613 format: date-time
7614 banners:
7615 type: array
7616 items:
7617 $ref: '#/components/schemas/ActorImage'
7618 ownerAccount:
7619 readOnly: true
7620 nullable: true
7621 type: object
7622 properties:
7623 id:
7624 type: integer
7625 uuid:
7626 $ref: '#/components/schemas/UUIDv4'
2a491182 7627
4302058c
RK
7628 VideoChannelCreate:
7629 allOf:
b8375da9 7630 - $ref: '#/components/schemas/VideoChannel'
4302058c
RK
7631 - properties:
7632 name:
b8375da9
RK
7633 description: username of the channel to create
7634 allOf:
7635 - $ref: '#/components/schemas/usernameChannel'
7d14d4d2
C
7636 required:
7637 - name
7638 - displayName
7639 VideoChannelUpdate:
4302058c 7640 allOf:
b8375da9 7641 - $ref: '#/components/schemas/VideoChannel'
4302058c
RK
7642 - properties:
7643 bulkVideosSupportUpdate:
7644 type: boolean
b8375da9 7645 description: Update the support field for all videos of this channel
045bcd0d
RK
7646 VideoChannelList:
7647 properties:
7648 total:
7649 type: integer
7650 example: 1
7651 data:
7652 type: array
7653 items:
7654 allOf:
7655 - $ref: '#/components/schemas/VideoChannel'
7656 - $ref: '#/components/schemas/Actor'
1569a818 7657
87cd9397
C
7658 ImportVideosInChannelCreate:
7659 type: object
7660 properties:
7661 externalChannelUrl:
7662 type: string
7663 example: https://youtube.com/c/UC_myfancychannel
7664 videoChannelSyncId:
7665 type: integer
7666 description: If part of a channel sync process, specify its id to assign video imports to this channel synchronization
7667 required:
7668 - 'externalChannelUrl'
7669
2a491182
F
7670 VideoChannelSync:
7671 type: object
7672 properties:
7673 id:
7674 $ref: '#/components/schemas/id'
7675 state:
7676 type: object
7677 properties:
7678 id:
7679 type: integer
7680 example: 2
7681 label:
7682 type: string
7683 example: PROCESSING
7684 externalChannelUrl:
7685 type: string
7686 example: 'https://youtube.com/c/UC_myfancychannel'
7687 createdAt:
7688 type: string
7689 format: date-time
7690 lastSyncAt:
7691 type: string
7692 format: date-time
7693 nullable: true
7694 channel:
7695 $ref: '#/components/schemas/VideoChannel'
7696 VideoChannelSyncList:
7697 type: object
7698 properties:
7699 total:
7700 type: integer
7701 example: 1
7702 data:
7703 type: array
7704 items:
7705 allOf:
7706 - $ref: '#/components/schemas/VideoChannelSync'
7707 VideoChannelSyncCreate:
7708 type: object
7709 properties:
7710 externalChannelUrl:
7711 type: string
7712 example: https://youtube.com/c/UC_myfancychannel
7713 videoChannelId:
7714 $ref: '#/components/schemas/id'
06746a8b
RK
7715 MRSSPeerLink:
7716 type: object
7717 xml:
7718 name: 'media:peerLink'
7719 properties:
7720 href:
7721 type: string
7722 xml:
7723 attribute: true
7724 type:
7725 type: string
7726 enum:
7727 - application/x-bittorrent
7728 xml:
7729 attribute: true
7730 MRSSGroupContent:
7731 type: object
7732 xml:
7733 name: 'media:content'
7734 properties:
7735 url:
7736 type: string
84f6e32c 7737 format: url
06746a8b
RK
7738 xml:
7739 attribute: true
7740 fileSize:
7741 type: integer
7742 xml:
7743 attribute: true
7744 type:
7745 type: string
7746 xml:
7747 attribute: true
7748 framerate:
7749 type: integer
7750 xml:
7751 attribute: true
7752 duration:
7753 type: integer
7754 xml:
7755 attribute: true
7756 height:
7757 type: integer
7758 xml:
7759 attribute: true
7760 lang:
7761 type: string
7762 xml:
7763 attribute: true
7764 VideoCommentsForXML:
7765 type: array
7766 xml:
7767 wrapped: true
7768 name: 'channel'
7769 items:
7770 type: object
7771 xml:
7772 name: 'item'
7773 properties:
7774 link:
7775 type: string
84f6e32c 7776 format: url
06746a8b
RK
7777 guid:
7778 type: string
7779 pubDate:
7780 type: string
7781 format: date-time
7782 'content:encoded':
7783 type: string
7784 'dc:creator':
7785 type: string
7786 VideosForXML:
7787 type: array
7788 xml:
7789 wrapped: true
7790 name: 'channel'
7791 items:
7792 type: object
7793 xml:
7794 name: 'item'
7795 properties:
7796 link:
7797 type: string
84f6e32c 7798 format: url
06746a8b
RK
7799 description: video watch page URL
7800 guid:
7801 type: string
7802 description: video canonical URL
7803 pubDate:
7804 type: string
7805 format: date-time
7806 description: video publication date
7807 description:
7808 type: string
7809 description: video description
7810 'content:encoded':
7811 type: string
7812 description: video description
7813 'dc:creator':
7814 type: string
7815 description: publisher user name
7816 'media:category':
7817 type: integer
7818 description: video category (MRSS)
7819 'media:community':
7820 type: object
7821 description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
7822 properties:
7823 'media:statistics':
7824 type: object
7825 properties:
7826 views:
7827 type: integer
7828 xml:
7829 attribute: true
7830 'media:embed':
7831 type: object
7832 properties:
7833 url:
7834 type: string
84f6e32c 7835 format: url
06746a8b
RK
7836 description: video embed path, relative to the canonical URL domain (MRSS)
7837 xml:
7838 attribute: true
7839 'media:player':
7840 type: object
7841 properties:
7842 url:
7843 type: string
84f6e32c 7844 format: url
06746a8b
RK
7845 description: video watch path, relative to the canonical URL domain (MRSS)
7846 xml:
7847 attribute: true
7848 'media:thumbnail':
7849 type: object
7850 properties:
7851 url:
7852 type: string
84f6e32c 7853 format: url
06746a8b
RK
7854 xml:
7855 attribute: true
7856 height:
7857 type: integer
7858 xml:
7859 attribute: true
7860 width:
7861 type: integer
7862 xml:
7863 attribute: true
7864 'media:title':
7865 type: string
7866 description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
7867 'media:description':
7868 type: string
7869 'media:rating':
7870 type: string
7871 enum:
7872 - nonadult
7873 - adult
7874 description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
7875 'enclosure':
7876 type: object
7877 description: main streamable file for the video
7878 properties:
7879 url:
7880 type: string
84f6e32c 7881 format: url
06746a8b
RK
7882 xml:
7883 attribute: true
7884 type:
7885 type: string
7886 enum:
7887 - application/x-bittorrent
7888 xml:
7889 attribute: true
7890 length:
7891 type: integer
7892 xml:
7893 attribute: true
7894 'media:group':
7895 type: array
7896 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)
7897 items:
7898 anyOf:
7899 - $ref: '#/components/schemas/MRSSPeerLink'
f4d59981
RK
7900 - $ref: '#/components/schemas/MRSSGroupContent'
7901 NotificationSettingValue:
7902 type: integer
7903 description: >
7904 Notification type
84f6e32c 7905
f4d59981 7906 - `0` NONE
84f6e32c 7907
f4d59981 7908 - `1` WEB
84f6e32c 7909
f4d59981
RK
7910 - `2` EMAIL
7911 enum:
7912 - 0
7913 - 1
2760b454 7914 - 2
f4d59981
RK
7915 Notification:
7916 properties:
7917 id:
b8375da9 7918 $ref: '#/components/schemas/id'
f4d59981
RK
7919 type:
7920 type: integer
7921 description: >
7922 Notification type, following the `UserNotificationType` enum:
84f6e32c 7923
f4d59981 7924 - `1` NEW_VIDEO_FROM_SUBSCRIPTION
84f6e32c 7925
f4d59981 7926 - `2` NEW_COMMENT_ON_MY_VIDEO
84f6e32c 7927
310b5219 7928 - `3` NEW_ABUSE_FOR_MODERATORS
84f6e32c 7929
f4d59981 7930 - `4` BLACKLIST_ON_MY_VIDEO
84f6e32c 7931
f4d59981 7932 - `5` UNBLACKLIST_ON_MY_VIDEO
84f6e32c 7933
f4d59981 7934 - `6` MY_VIDEO_PUBLISHED
84f6e32c 7935
f4d59981 7936 - `7` MY_VIDEO_IMPORT_SUCCESS
84f6e32c 7937
f4d59981 7938 - `8` MY_VIDEO_IMPORT_ERROR
84f6e32c 7939
f4d59981 7940 - `9` NEW_USER_REGISTRATION
84f6e32c 7941
f4d59981 7942 - `10` NEW_FOLLOW
84f6e32c 7943
f4d59981 7944 - `11` COMMENT_MENTION
84f6e32c 7945
f4d59981 7946 - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
84f6e32c 7947
f4d59981 7948 - `13` NEW_INSTANCE_FOLLOWER
84f6e32c 7949
f4d59981 7950 - `14` AUTO_INSTANCE_FOLLOWING
5097cbda 7951
597da8dd 7952 - `15` ABUSE_STATE_CHANGE
5097cbda 7953
597da8dd 7954 - `16` ABUSE_NEW_MESSAGE
5097cbda 7955
597da8dd 7956 - `17` NEW_PLUGIN_VERSION
5097cbda 7957
597da8dd 7958 - `18` NEW_PEERTUBE_VERSION
f4d59981
RK
7959 read:
7960 type: boolean
7961 video:
7962 nullable: true
7963 allOf:
7964 - $ref: '#/components/schemas/VideoInfo'
7965 - type: object
7966 properties:
7967 channel:
7968 $ref: '#/components/schemas/ActorInfo'
7969 videoImport:
7970 nullable: true
7971 type: object
7972 properties:
7973 id:
b8375da9 7974 $ref: '#/components/schemas/id'
f4d59981
RK
7975 video:
7976 nullable: true
7977 $ref: '#/components/schemas/VideoInfo'
7978 torrentName:
7979 type: string
7980 nullable: true
7981 magnetUri:
2c4876f2 7982 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
f4d59981
RK
7983 targetUri:
7984 type: string
84f6e32c 7985 format: uri
f4d59981
RK
7986 nullable: true
7987 comment:
7988 nullable: true
7989 type: object
7990 properties:
7991 id:
b8375da9 7992 $ref: '#/components/schemas/id'
f4d59981
RK
7993 threadId:
7994 type: integer
7995 video:
7996 $ref: '#/components/schemas/VideoInfo'
7997 account:
7998 $ref: '#/components/schemas/ActorInfo'
7999 videoAbuse:
8000 nullable: true
8001 type: object
8002 properties:
8003 id:
b8375da9 8004 $ref: '#/components/schemas/id'
f4d59981
RK
8005 video:
8006 allOf:
8007 - $ref: '#/components/schemas/VideoInfo'
8008 videoBlacklist:
8009 nullable: true
8010 type: object
8011 properties:
8012 id:
b8375da9 8013 $ref: '#/components/schemas/id'
f4d59981
RK
8014 video:
8015 allOf:
8016 - $ref: '#/components/schemas/VideoInfo'
8017 account:
8018 nullable: true
8019 allOf:
8020 - $ref: '#/components/schemas/ActorInfo'
8021 actorFollow:
8022 type: object
8023 nullable: true
8024 properties:
8025 id:
b8375da9 8026 $ref: '#/components/schemas/id'
f4d59981
RK
8027 follower:
8028 $ref: '#/components/schemas/ActorInfo'
8029 state:
8030 type: string
8031 enum:
8032 - pending
8033 - accepted
8034 following:
8035 type: object
8036 properties:
8037 type:
8038 type: string
8039 enum:
8040 - account
8041 - channel
8042 - instance
8043 name:
8044 type: string
8045 displayName:
8046 type: string
8047 host:
8048 type: string
84f6e32c 8049 format: hostname
f4d59981
RK
8050 createdAt:
8051 type: string
8052 format: date-time
8053 updatedAt:
8054 type: string
8055 format: date-time
8056 NotificationListResponse:
8057 properties:
8058 total:
8059 type: integer
84f6e32c 8060 example: 1
f4d59981
RK
8061 data:
8062 type: array
84f6e32c 8063 maxItems: 100
f4d59981 8064 items:
7461d440
RK
8065 $ref: '#/components/schemas/Notification'
8066 Plugin:
8067 properties:
8068 name:
8069 type: string
84f6e32c 8070 example: peertube-plugin-auth-ldap
7461d440
RK
8071 type:
8072 type: integer
84f6e32c
RK
8073 description: >
8074 - `1`: PLUGIN
8075
8076 - `2`: THEME
7461d440
RK
8077 enum:
8078 - 1
8079 - 2
8080 latestVersion:
8081 type: string
84f6e32c 8082 example: 0.0.3
7461d440
RK
8083 version:
8084 type: string
84f6e32c 8085 example: 0.0.1
7461d440
RK
8086 enabled:
8087 type: boolean
8088 uninstalled:
8089 type: boolean
8090 peertubeEngine:
8091 type: string
84f6e32c 8092 example: 2.2.0
7461d440
RK
8093 description:
8094 type: string
8095 homepage:
8096 type: string
84f6e32c
RK
8097 format: url
8098 example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap
7461d440
RK
8099 settings:
8100 type: object
8101 additionalProperties: true
8102 createdAt:
8103 type: string
8104 format: date-time
8105 updatedAt:
8106 type: string
8107 format: date-time
8108 PluginResponse:
8109 properties:
8110 total:
8111 type: integer
84f6e32c 8112 example: 1
7461d440
RK
8113 data:
8114 type: array
84f6e32c 8115 maxItems: 100
7461d440 8116 items:
2c318664 8117 $ref: '#/components/schemas/Plugin'
4e239e35
C
8118
8119 LiveVideoUpdate:
8120 properties:
8121 saveReplay:
8122 type: boolean
bb4ba6d9
C
8123 permanentLive:
8124 description: User can stream multiple times in a permanent live
8125 type: boolean
f443a746
C
8126 latencyMode:
8127 description: User can select live latency mode if enabled by the instance
8128 $ref: '#/components/schemas/LiveVideoLatencyMode'
4e239e35
C
8129
8130 LiveVideoResponse:
8131 properties:
8132 rtmpUrl:
8133 type: string
961cbe42 8134 description: Included in the response if an appropriate token is provided
df1db951
C
8135 rtmpsUrl:
8136 type: string
961cbe42 8137 description: Included in the response if an appropriate token is provided
4e239e35
C
8138 streamKey:
8139 type: string
961cbe42 8140 description: RTMP stream key to use to stream into this live video. Included in the response if an appropriate token is provided
4e239e35
C
8141 saveReplay:
8142 type: boolean
bb4ba6d9
C
8143 permanentLive:
8144 description: User can stream multiple times in a permanent live
8145 type: boolean
f443a746
C
8146 latencyMode:
8147 description: User can select live latency mode if enabled by the instance
8148 $ref: '#/components/schemas/LiveVideoLatencyMode'
75cba40d 8149
f9079a78
C
8150 VideoStudioCreateTask:
8151 type: array
8152 items:
8153 anyOf:
8154 -
8155 title: cut
8156 type: object
8157 properties:
8158 name:
8159 type: string
8160 enum:
8161 - 'cut'
8162 options:
8163 type: object
8164 properties:
8165 start:
8166 type: integer
8167 end:
8168 type: integer
8169 -
8170 title: add-intro
8171 type: object
8172 properties:
8173 name:
8174 type: string
8175 enum:
8176 - 'add-intro'
8177 options:
8178 type: object
8179 properties:
8180 file:
8181 type: string
8182 format: binary
8183 -
8184 title: add-outro
8185 type: object
8186 properties:
8187 name:
8188 type: string
8189 enum:
8190 - 'add-outro'
8191 options:
8192 type: object
8193 properties:
8194 file:
8195 type: string
8196 format: binary
8197 -
8198 title: add-watermark
8199 type: object
8200 properties:
8201 name:
8202 type: string
8203 enum:
8204 - 'add-watermark'
8205 options:
8206 type: object
8207 properties:
8208 file:
8209 type: string
8210 format: binary
8211
26e3e98f 8212 LiveVideoSessionResponse:
fd3c2e87
C
8213 properties:
8214 id:
8215 type: integer
8216 startDate:
8217 type: string
8218 format: date-time
8219 description: Start date of the live session
8220 endDate:
8221 type: string
8222 format: date-time
8223 nullable: true
8224 description: End date of the live session
8225 error:
8226 type: integer
8227 enum:
8228 - 1
8229 - 2
8230 - 3
8231 - 4
8232 - 5
8233 nullable: true
8234 description: >
8235 Error type if an error occurred during the live session:
8236 - `1`: Bad socket health (transcoding is too slow)
8237 - `2`: Max duration exceeded
8238 - `3`: Quota exceeded
8239 - `4`: Quota FFmpeg error
8240 - `5`: Video has been blacklisted during the live
8241 replayVideo:
8242 type: object
8243 description: Video replay information
8244 properties:
8245 id:
8246 type: number
8247 uuid:
8248 $ref: '#/components/schemas/UUIDv4'
8249 shortUUID:
8250 $ref: '#/components/schemas/shortUUID'
8251
8252 PlaybackMetricCreate:
8253 properties:
8254 playerMode:
8255 type: string
8256 enum:
8257 - 'p2p-media-loader'
8258 - 'webtorrent'
8259 resolution:
8260 type: number
8261 description: Current player video resolution
8262 fps:
8263 type: number
8264 description: Current player video fps
8265 resolutionChanges:
8266 type: number
8267 description: How many resolution changes occured since the last metric creation
8268 errors:
8269 type: number
8270 description: How many errors occured since the last metric creation
8271 downloadedBytesP2P:
8272 type: number
8273 description: How many bytes were downloaded with P2P since the last metric creation
8274 downloadedBytesHTTP:
8275 type: number
8276 description: How many bytes were downloaded with HTTP since the last metric creation
8277 uploadedBytesP2P:
8278 type: number
8279 description: How many bytes were uploaded with P2P since the last metric creation
8280 videoId:
8281 oneOf:
8282 - $ref: '#/components/schemas/id'
8283 - $ref: '#/components/schemas/UUIDv4'
8284 - $ref: '#/components/schemas/shortUUID'
8285 required:
8286 - playerMode
8287 - resolutionChanges
8288 - errors
8289 - downloadedBytesP2P
8290 - downloadedBytesHTTP
8291 - uploadedBytesP2P
8292 - videoId
26e3e98f 8293
2c318664
RK
8294 callbacks:
8295 searchIndex:
c00f96ce 8296 'https://search.example.org/api/v1/search/videos':
2c318664
RK
8297 post:
8298 summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`
8299 responses:
8300 '200':
8301 description: successful operation
8302 content:
8303 application/json:
8304 schema:
1e904cde 8305 $ref: '#/components/schemas/VideoListResponse'