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