]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/api/openapi.yaml
Fix HTTP fallback with no webtorrent files
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
CommitLineData
3e9e6f2f 1openapi: 3.0.0
1569a818 2info:
5e1c08eb 3 title: PeerTube
deecf337 4 version: 3.3.0-rc.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
2370d9cc 1743 downloadEnabled:
1744 description: Enable or disable downloading for this video
1745 type: boolean
37db4176
FS
1746 originallyPublishedAt:
1747 description: Date when the content was originally published
1748 type: string
1749 format: date-time
5dce26d2
C
1750 scheduleUpdate:
1751 $ref: '#/components/schemas/VideoScheduledUpdate'
0ad45af7
FS
1752 encoding:
1753 thumbnailfile:
1754 contentType: image/jpeg
1755 previewfile:
1756 contentType: image/jpeg
1569a818 1757 get:
b029d58a 1758 summary: Get a video
3f71c4c0 1759 operationId: getVideo
1569a818
DG
1760 tags:
1761 - Video
1569a818 1762 parameters:
cb9d028a 1763 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1764 responses:
1765 '200':
1766 description: successful operation
3e9e6f2f
RK
1767 content:
1768 application/json:
1769 schema:
5dce26d2 1770 $ref: '#/components/schemas/VideoDetails'
1569a818 1771 delete:
b029d58a 1772 summary: Delete a video
3f71c4c0 1773 operationId: delVideo
94ff4c23 1774 security:
3e9e6f2f 1775 - OAuth2: []
1569a818
DG
1776 tags:
1777 - Video
1569a818 1778 parameters:
cb9d028a 1779 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1780 responses:
1781 '204':
c1843150 1782 description: successful operation
3f71c4c0 1783
3e9e6f2f 1784 '/videos/{id}/description':
1569a818 1785 get:
b029d58a 1786 summary: Get complete video description
3f71c4c0 1787 operationId: getVideoDesc
1569a818
DG
1788 tags:
1789 - Video
1569a818 1790 parameters:
cb9d028a 1791 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1792 responses:
1793 '200':
1794 description: successful operation
3e9e6f2f
RK
1795 content:
1796 application/json:
1797 schema:
b8375da9 1798 nullable: true
3e9e6f2f 1799 type: string
b8375da9
RK
1800 minLength: 3
1801 maxLength: 10000
1802 example: |
1803 **[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 1804
3e9e6f2f 1805 '/videos/{id}/views':
1569a818 1806 post:
b029d58a 1807 summary: Add a view to a video
c756bae0 1808 operationId: addView
1569a818
DG
1809 tags:
1810 - Video
1569a818 1811 parameters:
cb9d028a 1812 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1813 responses:
1814 '204':
c1843150 1815 description: successful operation
3f71c4c0 1816
6441981b
RK
1817 '/videos/{id}/watching':
1818 put:
b029d58a 1819 summary: Set watching progress of a video
c756bae0 1820 operationId: setProgress
6441981b
RK
1821 tags:
1822 - Video
1823 security:
1824 - OAuth2: []
1825 parameters:
cb9d028a 1826 - $ref: '#/components/parameters/idOrUUID'
6441981b
RK
1827 requestBody:
1828 content:
1829 application/json:
1830 schema:
1831 $ref: '#/components/schemas/UserWatchingVideo'
1832 required: true
1833 responses:
1834 '204':
c1843150 1835 description: successful operation
3f71c4c0 1836
c360c494 1837 /videos/upload:
1569a818 1838 post:
b029d58a 1839 summary: Upload a video
f6d6e7f8 1840 description: Uses a single request to upload a video.
40cfb36b 1841 operationId: uploadLegacy
94ff4c23 1842 security:
3e9e6f2f 1843 - OAuth2: []
1569a818
DG
1844 tags:
1845 - Video
f6d6e7f8 1846 - Video Upload
1569a818
DG
1847 responses:
1848 '200':
1849 description: successful operation
3e9e6f2f
RK
1850 content:
1851 application/json:
1852 schema:
1853 $ref: '#/components/schemas/VideoUploadResponse'
06bcfbd9 1854 '403':
f2eb23cd 1855 description: video didn't pass upload filter
06bcfbd9 1856 '408':
84f6e32c 1857 description: upload has timed out
d4132d3f 1858 '413':
c756bae0
RK
1859 x-summary: video file too large, due to quota or max body size limit set by the reverse-proxy
1860 description: |
1861 If the response has no body, it means the reverse-proxy didn't let it through. Otherwise disambiguate via `type`:
1862 - `quota_reached` for quota limits wether daily or global
d4132d3f
RK
1863 headers:
1864 X-File-Maximum-Size:
1865 schema:
1866 type: string
1867 format: Nginx size
1868 description: Maximum file size for the video
f2eb23cd
RK
1869 '415':
1870 description: video type unsupported
06bcfbd9 1871 '422':
f2eb23cd 1872 description: video unreadable
3e9e6f2f
RK
1873 requestBody:
1874 content:
1875 multipart/form-data:
1876 schema:
f6d6e7f8 1877 $ref: '#/components/schemas/VideoUploadRequestLegacy'
0ad45af7
FS
1878 encoding:
1879 videofile:
1880 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
1881 thumbnailfile:
1882 contentType: image/jpeg
1883 previewfile:
1884 contentType: image/jpeg
40cfb36b 1885 x-codeSamples:
8f9e8be1
RK
1886 - lang: Shell
1887 source: |
0579dee3 1888 ## DEPENDENCIES: jq
8f9e8be1
RK
1889 USERNAME="<your_username>"
1890 PASSWORD="<your_password>"
1891 FILE_PATH="<your_file_path>"
1892 CHANNEL_ID="<your_channel_id>"
8f9e8be1 1893 NAME="<video_name>"
3cf8874f 1894 API="https://peertube2.cpy.re/api/v1"
8f9e8be1 1895
8f9e8be1 1896 ## AUTH
3cf8874f
RK
1897 client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id")
1898 client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret")
1899 token=$(curl -s "$API/users/token" \
0579dee3
JK
1900 --data client_id="$client_id" \
1901 --data client_secret="$client_secret" \
1902 --data grant_type=password \
0579dee3
JK
1903 --data username="$USERNAME" \
1904 --data password="$PASSWORD" \
8f9e8be1 1905 | jq -r ".access_token")
3cf8874f 1906
8f9e8be1 1907 ## VIDEO UPLOAD
3cf8874f 1908 curl -s "$API/videos/upload" \
0579dee3
JK
1909 -H "Authorization: Bearer $token" \
1910 --max-time 600 \
1911 --form videofile=@"$FILE_PATH" \
1912 --form channelId=$CHANNEL_ID \
1913 --form name="$NAME"
3f71c4c0 1914
f6d6e7f8 1915 /videos/upload-resumable:
1916 post:
1917 summary: Initialize the resumable upload of a video
1918 description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to initialize the upload of a video
40cfb36b 1919 operationId: uploadResumableInit
f6d6e7f8 1920 security:
1921 - OAuth2: []
1922 tags:
1923 - Video
1924 - Video Upload
1925 parameters:
1926 - name: X-Upload-Content-Length
1927 in: header
1928 schema:
1929 type: number
1930 example: 2469036
1931 required: true
1932 description: Number of bytes that will be uploaded in subsequent requests. Set this value to the size of the file you are uploading.
1933 - name: X-Upload-Content-Type
1934 in: header
1935 schema:
1936 type: string
1937 format: mimetype
1938 example: video/mp4
1939 required: true
1940 description: MIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary.
1941 requestBody:
1942 content:
1943 application/json:
1944 schema:
1945 $ref: '#/components/schemas/VideoUploadRequestResumable'
1946 responses:
1947 '200':
1948 description: file already exists, send a [`resume`](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) request instead
1949 '201':
1950 description: created
1951 headers:
1952 Location:
1953 schema:
1954 type: string
1955 format: url
1956 example: /api/v1/videos/upload-resumable?upload_id=471e97554f21dec3b8bb5d4602939c51
1957 Content-Length:
1958 schema:
1959 type: number
1960 example: 0
f6d6e7f8 1961 '413':
c756bae0
RK
1962 x-summary: video file too large, due to quota, absolute max file size or concurrent partial upload limit
1963 description: |
1964 Disambiguate via `type`:
1965 - `max_file_size_reached` for the absolute file size limit
1966 - `quota_reached` for quota limits whether daily or global
f6d6e7f8 1967 '415':
1968 description: video type unsupported
1969 put:
1970 summary: Send chunk for the resumable upload of a video
1971 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 1972 operationId: uploadResumable
f6d6e7f8 1973 security:
1974 - OAuth2: []
1975 tags:
1976 - Video
1977 - Video Upload
1978 parameters:
1979 - name: upload_id
c215e627 1980 in: query
f6d6e7f8 1981 required: true
1982 description: |
1983 Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is
1984 not valid anymore and you need to initialize a new upload.
1985 schema:
1986 type: string
1987 - name: Content-Range
1988 in: header
1989 schema:
1990 type: string
1991 example: bytes 0-262143/2469036
1992 required: true
1993 description: |
1994 Specifies the bytes in the file that the request is uploading.
1995
1996 For example, a value of `bytes 0-262143/1000000` shows that the request is sending the first
1997 262144 bytes (256 x 1024) in a 2,469,036 byte file.
1998 - name: Content-Length
1999 in: header
2000 schema:
2001 type: number
2002 example: 262144
2003 required: true
2004 description: |
2005 Size of the chunk that the request is sending.
2006
2007 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)
2008 doesn't mandate for chunks to have the same size throughout the upload sequence.
2009
2010 Remember that larger chunks are more efficient. PeerTube's web client uses chunks varying from
2011 1048576 bytes (~1MB) and increases or reduces size depending on connection health.
2012 requestBody:
2013 content:
2014 application/octet-stream:
2015 schema:
2016 type: string
2017 format: binary
2018 responses:
2019 '200':
2020 description: last chunk received
2021 headers:
2022 Content-Length:
2023 schema:
2024 type: number
2025 content:
2026 application/json:
2027 schema:
2028 $ref: '#/components/schemas/VideoUploadResponse'
2029 '308':
2030 description: resume incomplete
2031 headers:
2032 Range:
2033 schema:
2034 type: string
2035 example: bytes=0-262143
2036 Content-Length:
2037 schema:
2038 type: number
2039 example: 0
2040 '403':
2041 description: video didn't pass upload filter
c756bae0
RK
2042 '404':
2043 description: upload not found
2044 '409':
2045 description: chunk doesn't match range
f6d6e7f8 2046 '422':
2047 description: video unreadable
c756bae0
RK
2048 '429':
2049 description: too many concurrent requests
f6d6e7f8 2050 delete:
2051 summary: Cancel the resumable upload of a video, deleting any data uploaded so far
2052 description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the upload of a video
40cfb36b 2053 operationId: uploadResumableCancel
f6d6e7f8 2054 security:
2055 - OAuth2: []
2056 tags:
2057 - Video
2058 - Video Upload
2059 parameters:
2060 - name: upload_id
c215e627 2061 in: query
f6d6e7f8 2062 required: true
2063 description: |
2064 Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is
2065 not valid anymore and the upload session has already been deleted with its data ;-)
2066 schema:
2067 type: string
2068 - name: Content-Length
2069 in: header
2070 required: true
2071 schema:
2072 type: number
2073 example: 0
2074 responses:
2075 '204':
2076 description: upload cancelled
2077 headers:
2078 Content-Length:
2079 schema:
2080 type: number
2081 example: 0
c756bae0
RK
2082 '404':
2083 description: upload not found
3f71c4c0 2084
28c8e63e
C
2085 /videos/imports:
2086 post:
b029d58a
C
2087 summary: Import a video
2088 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
40cfb36b 2089 operationId: importVideo
28c8e63e
C
2090 security:
2091 - OAuth2: []
2092 tags:
2093 - Video
f6d6e7f8 2094 - Video Upload
28c8e63e
C
2095 requestBody:
2096 content:
2097 multipart/form-data:
2098 schema:
ac2a5b54 2099 $ref: '#/components/schemas/VideoCreateImport'
0ad45af7
FS
2100 encoding:
2101 torrentfile:
2102 contentType: application/x-bittorrent
2103 thumbnailfile:
2104 contentType: image/jpeg
2105 previewfile:
2106 contentType: image/jpeg
06746a8b
RK
2107 responses:
2108 '200':
2109 description: successful operation
2110 content:
2111 application/json:
2112 schema:
2113 $ref: '#/components/schemas/VideoUploadResponse'
06746a8b
RK
2114 '400':
2115 description: '`magnetUri` or `targetUrl` or a torrent file missing'
f2eb23cd
RK
2116 '403':
2117 description: video didn't pass pre-import filter
2118 '409':
2119 description: HTTP or Torrent/magnetURI import not enabled
668b7f09 2120
4e239e35
C
2121 /videos/live:
2122 post:
2123 summary: Create a live
e2adb8cb 2124 operationId: addLive
4e239e35
C
2125 security:
2126 - OAuth2: []
2127 tags:
2128 - Live Videos
2129 - Video
2130 responses:
2131 '200':
2132 description: successful operation
2133 content:
2134 application/json:
2135 schema:
2136 $ref: '#/components/schemas/VideoUploadResponse'
c756bae0
RK
2137 '400':
2138 x-summary: validation error, or conflicting `saveReplay` and `permanentLive` parameter set
2139 description: |
2140 Disambiguate via `type`:
2141 - default type for a validation error
2142 - `live_conflicting_permanent_and_save_replay` for conflicting parameters set
4e239e35 2143 '403':
c756bae0
RK
2144 x-summary: live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded
2145 description: |
2146 Disambiguate via `type`:
2147 - `live_not_enabled` for a disabled live feature
2148 - `live_not_allowing_replay` for a disabled replay feature
2149 - `max_instance_lives_limit_reached` for the absolute concurrent live limit
2150 - `max_user_lives_limit_reached` for the user concurrent live limit
4e239e35
C
2151 requestBody:
2152 content:
2153 multipart/form-data:
2154 schema:
2155 type: object
2156 properties:
2157 channelId:
2158 description: Channel id that will contain this live video
2159 type: integer
2160 saveReplay:
2161 type: boolean
bb4ba6d9
C
2162 permanentLive:
2163 description: User can stream multiple times in a permanent live
2164 type: boolean
4e239e35
C
2165 thumbnailfile:
2166 description: Live video/replay thumbnail file
2167 type: string
2168 format: binary
2169 previewfile:
2170 description: Live video/replay preview file
2171 type: string
2172 format: binary
2173 privacy:
2174 $ref: '#/components/schemas/VideoPrivacySet'
2175 category:
40cfb36b 2176 $ref: '#/components/schemas/VideoCategorySet'
4e239e35 2177 licence:
40cfb36b 2178 $ref: '#/components/schemas/VideoLicenceSet'
4e239e35 2179 language:
40cfb36b 2180 $ref: '#/components/schemas/VideoLanguageSet'
4e239e35
C
2181 description:
2182 description: Live video/replay description
2183 type: string
2184 support:
2185 description: A text tell the audience how to support the creator
9a320a06 2186 example: Please support our work on https://soutenir.framasoft.org/en/ <3
4e239e35
C
2187 type: string
2188 nsfw:
2189 description: Whether or not this live video/replay contains sensitive content
2190 type: boolean
2191 name:
2192 description: Live video/replay name
2193 type: string
bdac0584
RK
2194 minLength: 3
2195 maxLength: 120
4e239e35
C
2196 tags:
2197 description: Live video/replay tags (maximum 5 tags each between 2 and 30 characters)
2198 type: array
2199 minItems: 1
2200 maxItems: 5
2201 items:
2202 type: string
2203 minLength: 2
2204 maxLength: 30
2205 commentsEnabled:
2206 description: Enable or disable comments for this live video/replay
2207 type: boolean
2208 downloadEnabled:
2370d9cc 2209 description: Enable or disable downloading for the replay of this live video
4e239e35
C
2210 type: boolean
2211 required:
2212 - channelId
2213 - name
2214 encoding:
2215 thumbnailfile:
2216 contentType: image/jpeg
2217 previewfile:
2218 contentType: image/jpeg
2219
2220 /videos/live/{id}:
2221 get:
f6d6e7f8 2222 summary: Get information about a live
40cfb36b 2223 operationId: getLiveId
4e239e35
C
2224 security:
2225 - OAuth2: []
2226 tags:
2227 - Live Videos
2228 - Video
2229 parameters:
2230 - $ref: '#/components/parameters/idOrUUID'
2231 responses:
2232 '200':
2233 description: successful operation
2234 content:
2235 application/json:
2236 schema:
2237 $ref: '#/components/schemas/LiveVideoResponse'
2238 put:
f6d6e7f8 2239 summary: Update information about a live
40cfb36b 2240 operationId: updateLiveId
4e239e35
C
2241 security:
2242 - OAuth2: []
2243 tags:
2244 - Live Videos
2245 - Video
2246 parameters:
2247 - $ref: '#/components/parameters/idOrUUID'
2248 requestBody:
2249 content:
2250 application/json:
2251 schema:
2252 $ref: '#/components/schemas/LiveVideoUpdate'
2253 responses:
2254 '204':
b8375da9 2255 description: successful operation
4e239e35 2256 '400':
b8375da9 2257 description: bad parameters or trying to update a live that has already started
4e239e35 2258 '403':
b8375da9 2259 description: trying to save replay of the live but saving replay is not enabled on the instance
4e239e35 2260
668b7f09
C
2261 /users/me/abuses:
2262 get:
2263 summary: List my abuses
985ece57 2264 operationId: getMyAbuses
668b7f09
C
2265 security:
2266 - OAuth2: []
2267 tags:
2268 - Abuses
2269 - My User
2270 parameters:
2271 - name: id
2272 in: query
2273 description: only list the report with this id
2274 schema:
2275 type: integer
2276 - name: state
2277 in: query
2278 schema:
2279 $ref: '#/components/schemas/AbuseStateSet'
985ece57 2280 - $ref: '#/components/parameters/abusesSort'
668b7f09
C
2281 - $ref: '#/components/parameters/start'
2282 - $ref: '#/components/parameters/count'
668b7f09
C
2283 responses:
2284 '200':
2285 description: successful operation
2286 content:
2287 application/json:
2288 schema:
985ece57
RK
2289 type: object
2290 properties:
2291 total:
2292 type: integer
2293 example: 1
2294 data:
2295 type: array
2296 items:
2297 $ref: '#/components/schemas/Abuse'
668b7f09 2298
e3489df9 2299 /abuses:
1569a818 2300 get:
310b5219 2301 summary: List abuses
985ece57 2302 operationId: getAbuses
94ff4c23 2303 security:
b029d58a 2304 - OAuth2:
06746a8b
RK
2305 - admin
2306 - moderator
1569a818 2307 tags:
310b5219 2308 - Abuses
44cb3b85 2309 parameters:
84f6e32c
RK
2310 - name: id
2311 in: query
2312 description: only list the report with this id
2313 schema:
2314 type: integer
2315 - name: predefinedReason
2316 in: query
2317 description: predefined reason the listed reports should contain
2318 schema:
e3489df9 2319 $ref: '#/components/schemas/PredefinedAbuseReasons'
84f6e32c
RK
2320 - name: search
2321 in: query
2322 description: plain search that will match with video titles, reporter names and more
2323 schema:
2324 type: string
2325 - name: state
2326 in: query
84f6e32c 2327 schema:
668b7f09 2328 $ref: '#/components/schemas/AbuseStateSet'
84f6e32c
RK
2329 - name: searchReporter
2330 in: query
2331 description: only list reports of a specific reporter
2332 schema:
2333 type: string
2334 - name: searchReportee
2335 description: only list reports of a specific reportee
2336 in: query
2337 schema:
2338 type: string
2339 - name: searchVideo
2340 in: query
2341 description: only list reports of a specific video
2342 schema:
2343 type: string
2344 - name: searchVideoChannel
2345 in: query
2346 description: only list reports of a specific video channel
2347 schema:
2348 type: string
17b07dc5
C
2349 - name: videoIs
2350 in: query
c756bae0 2351 description: only list deleted or blocklisted videos
17b07dc5
C
2352 schema:
2353 type: string
2354 enum:
2355 - 'deleted'
2356 - 'blacklisted'
2357 - name: filter
2358 in: query
2359 description: only list account, comment or video reports
2360 schema:
2361 type: string
2362 enum:
2363 - 'video'
2364 - 'comment'
2365 - 'account'
3e9e6f2f
RK
2366 - $ref: '#/components/parameters/start'
2367 - $ref: '#/components/parameters/count'
fd5af7a2 2368 - $ref: '#/components/parameters/abusesSort'
1569a818
DG
2369 responses:
2370 '200':
2371 description: successful operation
3e9e6f2f
RK
2372 content:
2373 application/json:
2374 schema:
985ece57
RK
2375 type: object
2376 properties:
2377 total:
2378 type: integer
2379 example: 1
2380 data:
2381 type: array
2382 items:
2383 $ref: '#/components/schemas/Abuse'
1569a818 2384 post:
b029d58a 2385 summary: Report an abuse
94ff4c23 2386 security:
3e9e6f2f 2387 - OAuth2: []
1569a818 2388 tags:
310b5219 2389 - Abuses
50e16ccf 2390 requestBody:
1ebddadd 2391 required: true
50e16ccf
C
2392 content:
2393 application/json:
2394 schema:
2395 type: object
2396 properties:
2397 reason:
2398 description: Reason why the user reports this video
2399 type: string
4302058c
RK
2400 minLength: 2
2401 maxLength: 3000
1ebddadd 2402 predefinedReasons:
e3489df9 2403 $ref: '#/components/schemas/PredefinedAbuseReasons'
e3489df9
C
2404 video:
2405 type: object
2406 properties:
2407 id:
2408 description: Video id to report
b8375da9
RK
2409 allOf:
2410 - $ref: '#/components/schemas/Video/properties/id'
e3489df9
C
2411 startAt:
2412 type: integer
c00100b6 2413 format: seconds
e3489df9
C
2414 description: Timestamp in the video that marks the beginning of the report
2415 minimum: 0
2416 endAt:
2417 type: integer
c00100b6 2418 format: seconds
e3489df9
C
2419 description: Timestamp in the video that marks the ending of the report
2420 minimum: 0
2421 comment:
2422 type: object
2423 properties:
2424 id:
2425 description: Comment id to report
b8375da9
RK
2426 allOf:
2427 - $ref: '#/components/schemas/VideoComment/properties/id'
e3489df9
C
2428 account:
2429 type: object
2430 properties:
2431 id:
2432 description: Account id to report
b8375da9 2433 type: integer
1ebddadd
RK
2434 required:
2435 - reason
50e16ccf 2436 responses:
65cb01a2 2437 '200':
50e16ccf 2438 description: successful operation
65cb01a2
RK
2439 content:
2440 application/json:
2441 schema:
2442 type: object
2443 properties:
2444 abuse:
2445 type: object
2446 properties:
2447 id:
2448 $ref: '#/components/schemas/id'
84f6e32c
RK
2449 '400':
2450 description: incorrect request parameters
3f71c4c0 2451
e3489df9 2452 '/abuses/{abuseId}':
50e16ccf
C
2453 put:
2454 summary: Update an abuse
2455 security:
2456 - OAuth2:
2457 - admin
2458 - moderator
2459 tags:
310b5219 2460 - Abuses
50e16ccf 2461 parameters:
50e16ccf
C
2462 - $ref: '#/components/parameters/abuseId'
2463 requestBody:
2464 content:
2465 application/json:
2466 schema:
2467 type: object
2468 properties:
2469 state:
4f32032f 2470 $ref: '#/components/schemas/AbuseStateSet'
50e16ccf
C
2471 moderationComment:
2472 type: string
84f6e32c 2473 description: Update the report comment visible only to the moderation team
4302058c
RK
2474 minLength: 2
2475 maxLength: 3000
84f6e32c
RK
2476 responses:
2477 '204':
2478 description: successful operation
2479 '404':
310b5219 2480 description: abuse not found
50e16ccf 2481 delete:
84f6e32c 2482 tags:
310b5219 2483 - Abuses
50e16ccf
C
2484 summary: Delete an abuse
2485 security:
2486 - OAuth2:
64b5c247
RK
2487 - admin
2488 - moderator
84f6e32c 2489 parameters:
84f6e32c 2490 - $ref: '#/components/parameters/abuseId'
50e16ccf
C
2491 responses:
2492 '204':
2493 description: successful operation
06746a8b
RK
2494 '404':
2495 description: block not found
3f71c4c0 2496
668b7f09
C
2497 '/abuses/{abuseId}/messages':
2498 get:
2499 summary: List messages of an abuse
2500 security:
2501 - OAuth2: []
2502 tags:
2503 - Abuses
2504 parameters:
2505 - $ref: '#/components/parameters/abuseId'
2506 responses:
2507 '200':
2508 description: successful operation
2509 content:
2510 application/json:
2511 schema:
c76ecc3f
RK
2512 type: object
2513 properties:
2514 total:
2515 type: integer
2516 example: 1
2517 data:
2518 type: array
2519 items:
2520 $ref: '#/components/schemas/AbuseMessage'
668b7f09
C
2521 post:
2522 summary: Add message to an abuse
2523 security:
2524 - OAuth2: []
2525 tags:
2526 - Abuses
fcc4466e
C
2527 parameters:
2528 - $ref: '#/components/parameters/abuseId'
668b7f09
C
2529 requestBody:
2530 required: true
2531 content:
2532 application/json:
2533 schema:
2534 type: object
2535 properties:
2536 message:
2537 description: Message to send
2538 type: string
4302058c
RK
2539 minLength: 2
2540 maxLength: 3000
668b7f09
C
2541 required:
2542 - message
2543 responses:
2544 '200':
2545 description: successful operation
2546 '400':
2547 description: incorrect request parameters
3f71c4c0 2548
668b7f09
C
2549 '/abuses/{abuseId}/messages/{abuseMessageId}':
2550 delete:
2551 summary: Delete an abuse message
2552 security:
2553 - OAuth2: []
2554 tags:
2555 - Abuses
2556 parameters:
2557 - $ref: '#/components/parameters/abuseId'
2558 - $ref: '#/components/parameters/abuseMessageId'
2559 responses:
2560 '204':
2561 description: successful operation
50e16ccf 2562
3e9e6f2f 2563 '/videos/{id}/blacklist':
1569a818 2564 post:
06746a8b 2565 summary: Block a video
3f71c4c0 2566 operationId: addVideoBlock
94ff4c23 2567 security:
3e9e6f2f 2568 - OAuth2:
64b5c247
RK
2569 - admin
2570 - moderator
1569a818 2571 tags:
06746a8b 2572 - Video Blocks
1569a818 2573 parameters:
cb9d028a 2574 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
2575 responses:
2576 '204':
c1843150 2577 description: successful operation
1569a818 2578 delete:
06746a8b 2579 summary: Unblock a video by its id
3f71c4c0 2580 operationId: delVideoBlock
94ff4c23 2581 security:
3e9e6f2f 2582 - OAuth2:
64b5c247
RK
2583 - admin
2584 - moderator
1569a818 2585 tags:
06746a8b 2586 - Video Blocks
1569a818 2587 parameters:
cb9d028a 2588 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
2589 responses:
2590 '204':
c1843150 2591 description: successful operation
06746a8b
RK
2592 '404':
2593 description: block not found
3f71c4c0 2594
c360c494 2595 /videos/blacklist:
1569a818 2596 get:
06746a8b
RK
2597 tags:
2598 - Video Blocks
f4d59981 2599 summary: List video blocks
3f71c4c0 2600 operationId: getVideoBlocks
94ff4c23 2601 security:
3e9e6f2f 2602 - OAuth2:
64b5c247
RK
2603 - admin
2604 - moderator
44cb3b85 2605 parameters:
84f6e32c
RK
2606 - name: type
2607 in: query
2608 description: >
2609 list only blocks that match this type:
2610
2611 - `1`: manual block
2612
2613 - `2`: automatic block that needs review
2614 schema:
2615 type: integer
2616 enum:
2617 - 1
2618 - 2
2619 - name: search
2620 in: query
2621 description: plain search that will match with video titles, and more
2622 schema:
2623 type: string
3e9e6f2f
RK
2624 - $ref: '#/components/parameters/start'
2625 - $ref: '#/components/parameters/count'
fd5af7a2 2626 - $ref: '#/components/parameters/blacklistsSort'
1569a818
DG
2627 responses:
2628 '200':
2629 description: successful operation
3e9e6f2f
RK
2630 content:
2631 application/json:
2632 schema:
84f6e32c
RK
2633 type: object
2634 properties:
2635 total:
2636 type: integer
2637 example: 1
2638 data:
2639 type: array
2640 items:
2641 $ref: '#/components/schemas/VideoBlacklist'
3f71c4c0 2642
67ae04a5
C
2643 /videos/{id}/captions:
2644 get:
b029d58a 2645 summary: List captions of a video
3f71c4c0 2646 operationId: getVideoCaptions
67ae04a5 2647 tags:
04b703f6 2648 - Video Captions
67ae04a5 2649 parameters:
cb9d028a 2650 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
2651 responses:
2652 '200':
2653 description: successful operation
2654 content:
2655 application/json:
2656 schema:
2657 type: object
2658 properties:
2659 total:
2660 type: integer
84f6e32c 2661 example: 1
67ae04a5
C
2662 data:
2663 type: array
2664 items:
2665 $ref: '#/components/schemas/VideoCaption'
3f71c4c0 2666
67ae04a5
C
2667 /videos/{id}/captions/{captionLanguage}:
2668 put:
2669 summary: Add or replace a video caption
3f71c4c0 2670 operationId: addVideoCaption
64b5c247
RK
2671 security:
2672 - OAuth2:
2673 - user
67ae04a5 2674 tags:
04b703f6 2675 - Video Captions
67ae04a5 2676 parameters:
cb9d028a 2677 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
2678 - $ref: '#/components/parameters/captionLanguage'
2679 requestBody:
2680 content:
2681 multipart/form-data:
2682 schema:
2683 type: object
2684 properties:
2685 captionfile:
2686 description: The file to upload.
2687 type: string
2688 format: binary
0ad45af7
FS
2689 encoding:
2690 captionfile:
205ed5b7 2691 contentType: text/vtt, application/x-subrip, text/plain
67ae04a5
C
2692 responses:
2693 '204':
c1843150 2694 description: successful operation
06746a8b
RK
2695 '404':
2696 description: video or language not found
67ae04a5
C
2697 delete:
2698 summary: Delete a video caption
3f71c4c0 2699 operationId: delVideoCaption
64b5c247
RK
2700 security:
2701 - OAuth2:
2702 - user
67ae04a5 2703 tags:
04b703f6 2704 - Video Captions
67ae04a5 2705 parameters:
cb9d028a 2706 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
2707 - $ref: '#/components/parameters/captionLanguage'
2708 responses:
2709 '204':
c1843150 2710 description: successful operation
06746a8b
RK
2711 '404':
2712 description: video or language or caption for that language not found
3f71c4c0 2713
48dce1c9 2714 /video-channels:
1569a818 2715 get:
b029d58a 2716 summary: List video channels
9a320a06 2717 operationId: getVideoChannels
1569a818 2718 tags:
b029d58a 2719 - Video Channels
44cb3b85 2720 parameters:
3e9e6f2f
RK
2721 - $ref: '#/components/parameters/start'
2722 - $ref: '#/components/parameters/count'
2723 - $ref: '#/components/parameters/sort'
1569a818
DG
2724 responses:
2725 '200':
2726 description: successful operation
3e9e6f2f
RK
2727 content:
2728 application/json:
2729 schema:
045bcd0d 2730 $ref: '#/components/schemas/VideoChannelList'
1569a818 2731 post:
b029d58a 2732 summary: Create a video channel
3f71c4c0 2733 operationId: addVideoChannel
94ff4c23 2734 security:
3e9e6f2f 2735 - OAuth2: []
1569a818 2736 tags:
b029d58a 2737 - Video Channels
1569a818
DG
2738 responses:
2739 '204':
c1843150 2740 description: successful operation
9a320a06
RK
2741 content:
2742 application/json:
2743 schema:
2744 type: object
2745 properties:
2746 videoChannel:
2747 type: object
2748 properties:
2749 id:
2750 $ref: '#/components/schemas/VideoChannel/properties/id'
3e9e6f2f 2751 requestBody:
7d14d4d2
C
2752 content:
2753 application/json:
2754 schema:
2755 $ref: '#/components/schemas/VideoChannelCreate'
3f71c4c0 2756
9ce3d302 2757 '/video-channels/{channelHandle}':
1569a818 2758 get:
b029d58a 2759 summary: Get a video channel
9a320a06 2760 operationId: getVideoChannel
1569a818 2761 tags:
b029d58a 2762 - Video Channels
1569a818 2763 parameters:
9ce3d302 2764 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
2765 responses:
2766 '200':
2767 description: successful operation
3e9e6f2f
RK
2768 content:
2769 application/json:
2770 schema:
2771 $ref: '#/components/schemas/VideoChannel'
1569a818 2772 put:
b029d58a 2773 summary: Update a video channel
3f71c4c0 2774 operationId: putVideoChannel
94ff4c23 2775 security:
3e9e6f2f 2776 - OAuth2: []
1569a818 2777 tags:
b029d58a 2778 - Video Channels
1569a818 2779 parameters:
9ce3d302 2780 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
2781 responses:
2782 '204':
c1843150 2783 description: successful operation
3e9e6f2f 2784 requestBody:
7d14d4d2
C
2785 content:
2786 application/json:
2787 schema:
2788 $ref: '#/components/schemas/VideoChannelUpdate'
1569a818 2789 delete:
b029d58a 2790 summary: Delete a video channel
3f71c4c0 2791 operationId: delVideoChannel
94ff4c23 2792 security:
3e9e6f2f 2793 - OAuth2: []
1569a818 2794 tags:
b029d58a 2795 - Video Channels
1569a818 2796 parameters:
9ce3d302 2797 - $ref: '#/components/parameters/channelHandle'
cc918ac3
C
2798 responses:
2799 '204':
c1843150 2800 description: successful operation
3f71c4c0 2801
9ce3d302 2802 '/video-channels/{channelHandle}/videos':
cc918ac3 2803 get:
b029d58a 2804 summary: List videos of a video channel
3f71c4c0 2805 operationId: getVideoChannelVideos
cc918ac3 2806 tags:
048b6946 2807 - Video
b029d58a 2808 - Video Channels
cc918ac3 2809 parameters:
9ce3d302 2810 - $ref: '#/components/parameters/channelHandle'
59c794a5 2811 - $ref: '#/components/parameters/categoryOneOf'
1fd61899 2812 - $ref: '#/components/parameters/isLive'
59c794a5
C
2813 - $ref: '#/components/parameters/tagsOneOf'
2814 - $ref: '#/components/parameters/tagsAllOf'
2815 - $ref: '#/components/parameters/licenceOneOf'
2816 - $ref: '#/components/parameters/languageOneOf'
2817 - $ref: '#/components/parameters/nsfw'
2818 - $ref: '#/components/parameters/filter'
2819 - $ref: '#/components/parameters/skipCount'
2820 - $ref: '#/components/parameters/start'
2821 - $ref: '#/components/parameters/count'
2822 - $ref: '#/components/parameters/videosSort'
1569a818 2823 responses:
cc918ac3 2824 '200':
1569a818 2825 description: successful operation
3e9e6f2f
RK
2826 content:
2827 application/json:
2828 schema:
048b6946 2829 $ref: '#/components/schemas/VideoListResponse'
3f71c4c0 2830
75cba40d
C
2831 '/video-channels/{channelHandle}/avatar/pick':
2832 post:
2833 summary: Update channel avatar
2834 security:
2835 - OAuth2: []
2836 tags:
2837 - Video Channels
2838 parameters:
2839 - $ref: '#/components/parameters/channelHandle'
2840 responses:
2841 '200':
2842 description: successful operation
2843 content:
2844 application/json:
2845 schema:
2846 type: object
2847 properties:
2848 avatar:
2849 $ref: '#/components/schemas/ActorImage'
2850 '413':
2851 description: image file too large
2852 headers:
2853 X-File-Maximum-Size:
2854 schema:
2855 type: string
2856 format: Nginx size
2857 description: Maximum file size for the avatar
2858 requestBody:
2859 content:
2860 multipart/form-data:
2861 schema:
2862 type: object
2863 properties:
2864 avatarfile:
2865 description: The file to upload.
2866 type: string
2867 format: binary
2868 encoding:
2869 avatarfile:
2870 contentType: image/png, image/jpeg
3f71c4c0 2871
75cba40d
C
2872 '/video-channels/{channelHandle}/avatar':
2873 delete:
2874 summary: Delete channel avatar
2875 security:
2876 - OAuth2: []
2877 tags:
2878 - Video Channels
2879 parameters:
2880 - $ref: '#/components/parameters/channelHandle'
2881 responses:
2882 '204':
2883 description: successful operation
2884
75cba40d
C
2885 '/video-channels/{channelHandle}/banner/pick':
2886 post:
2887 summary: Update channel banner
2888 security:
2889 - OAuth2: []
2890 tags:
2891 - Video Channels
2892 parameters:
2893 - $ref: '#/components/parameters/channelHandle'
2894 responses:
2895 '200':
2896 description: successful operation
2897 content:
2898 application/json:
2899 schema:
2900 type: object
2901 properties:
2902 banner:
2903 $ref: '#/components/schemas/ActorImage'
2904 '413':
2905 description: image file too large
2906 headers:
2907 X-File-Maximum-Size:
2908 schema:
2909 type: string
2910 format: Nginx size
2911 description: Maximum file size for the banner
2912 requestBody:
2913 content:
2914 multipart/form-data:
2915 schema:
2916 type: object
2917 properties:
2918 bannerfile:
2919 description: The file to upload.
2920 type: string
2921 format: binary
2922 encoding:
2923 bannerfile:
2924 contentType: image/png, image/jpeg
3f71c4c0 2925
75cba40d
C
2926 '/video-channels/{channelHandle}/banner':
2927 delete:
2928 summary: Delete channel banner
2929 security:
2930 - OAuth2: []
2931 tags:
2932 - Video Channels
2933 parameters:
2934 - $ref: '#/components/parameters/channelHandle'
2935 responses:
2936 '204':
2937 description: successful operation
c1843150
C
2938
2939 /video-playlists/privacies:
2940 get:
40cfb36b
RK
2941 summary: List available playlist privacy policies
2942 operationId: getPlaylistPrivacyPolicies
c1843150
C
2943 tags:
2944 - Video Playlists
2945 responses:
2946 '200':
2947 description: successful operation
2948 content:
2949 application/json:
2950 schema:
2951 type: array
2952 items:
2953 type: string
84f6e32c
RK
2954 examples:
2955 nightly:
2956 externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies
c1843150 2957
71810d0b
RK
2958 /video-playlists:
2959 get:
b029d58a 2960 summary: List video playlists
40cfb36b 2961 operationId: getPlaylists
71810d0b 2962 tags:
b029d58a 2963 - Video Playlists
71810d0b
RK
2964 parameters:
2965 - $ref: '#/components/parameters/start'
2966 - $ref: '#/components/parameters/count'
2967 - $ref: '#/components/parameters/sort'
2968 responses:
2969 '200':
2970 description: successful operation
2971 content:
2972 application/json:
2973 schema:
84f6e32c
RK
2974 type: object
2975 properties:
2976 total:
2977 type: integer
2978 example: 1
2979 data:
2980 type: array
2981 items:
2982 $ref: '#/components/schemas/VideoPlaylist'
c1843150
C
2983 post:
2984 summary: Create a video playlist
b8375da9 2985 description: If the video playlist is set as public, `videoChannelId` is mandatory.
e2adb8cb 2986 operationId: addPlaylist
c1843150
C
2987 security:
2988 - OAuth2: []
2989 tags:
2990 - Video Playlists
2991 responses:
2992 '200':
2993 description: successful operation
2994 content:
2995 application/json:
2996 schema:
2997 type: object
2998 properties:
2999 videoPlaylist:
3000 type: object
3001 properties:
3002 id:
b8375da9 3003 $ref: '#/components/schemas/VideoPlaylist/properties/id'
c1843150 3004 uuid:
b8375da9 3005 $ref: '#/components/schemas/VideoPlaylist/properties/uuid'
d4a8e7a6
C
3006 shortUUID:
3007 $ref: '#/components/schemas/VideoPlaylist/properties/shortUUID'
c1843150
C
3008 requestBody:
3009 content:
3010 multipart/form-data:
3011 schema:
3012 type: object
3013 properties:
3014 displayName:
3015 description: Video playlist display name
3016 type: string
bdac0584
RK
3017 minLength: 1
3018 maxLength: 120
c1843150
C
3019 thumbnailfile:
3020 description: Video playlist thumbnail file
3021 type: string
3022 format: binary
3023 privacy:
3024 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
3025 description:
3026 description: Video playlist description
3027 type: string
b8375da9
RK
3028 minLength: 3
3029 maxLength: 1000
c1843150 3030 videoChannelId:
b8375da9
RK
3031 allOf:
3032 - $ref: '#/components/schemas/id'
c1843150 3033 description: Video channel in which the playlist will be published
c1843150
C
3034 required:
3035 - displayName
2c318664
RK
3036 encoding:
3037 thumbnailfile:
3038 contentType: image/jpeg
c1843150 3039
c00100b6 3040 /video-playlists/{playlistId}:
c1843150
C
3041 get:
3042 summary: Get a video playlist
3043 tags:
3044 - Video Playlists
3045 parameters:
c00100b6 3046 - $ref: '#/components/parameters/playlistId'
c1843150
C
3047 responses:
3048 '200':
3049 description: successful operation
3050 content:
3051 application/json:
3052 schema:
3053 $ref: '#/components/schemas/VideoPlaylist'
3054 put:
3055 summary: Update a video playlist
3056 description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
3057 security:
3058 - OAuth2: []
3059 tags:
3060 - Video Playlists
3061 responses:
3062 '204':
3063 description: successful operation
3064 parameters:
c00100b6 3065 - $ref: '#/components/parameters/playlistId'
c1843150
C
3066 requestBody:
3067 content:
3068 multipart/form-data:
3069 schema:
3070 type: object
3071 properties:
3072 displayName:
3073 description: Video playlist display name
3074 type: string
bdac0584
RK
3075 minLength: 1
3076 maxLength: 120
c1843150
C
3077 thumbnailfile:
3078 description: Video playlist thumbnail file
3079 type: string
3080 format: binary
3081 privacy:
3082 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
3083 description:
3084 description: Video playlist description
3085 type: string
3086 videoChannelId:
b8375da9
RK
3087 allOf:
3088 - $ref: '#/components/schemas/id'
c1843150 3089 description: Video channel in which the playlist will be published
2c318664
RK
3090 encoding:
3091 thumbnailfile:
3092 contentType: image/jpeg
c1843150
C
3093 delete:
3094 summary: Delete a video playlist
3095 security:
3096 - OAuth2: []
3097 tags:
3098 - Video Playlists
3099 parameters:
c00100b6 3100 - $ref: '#/components/parameters/playlistId'
c1843150
C
3101 responses:
3102 '204':
3103 description: successful operation
3104
c00100b6 3105 /video-playlists/{playlistId}/videos:
c1843150
C
3106 get:
3107 summary: 'List videos of a playlist'
e2adb8cb 3108 operationId: getVideoPlaylistVideos
c1843150
C
3109 tags:
3110 - Videos
3111 - Video Playlists
3112 parameters:
c00100b6 3113 - $ref: '#/components/parameters/playlistId'
c1843150
C
3114 responses:
3115 '200':
3116 description: successful operation
3117 content:
3118 application/json:
3119 schema:
3120 $ref: '#/components/schemas/VideoListResponse'
3121 post:
c00100b6 3122 summary: Add a video in a playlist
e2adb8cb 3123 operationId: addVideoPlaylistVideo
c1843150
C
3124 security:
3125 - OAuth2: []
3126 tags:
3127 - Videos
3128 - Video Playlists
3129 parameters:
c00100b6 3130 - $ref: '#/components/parameters/playlistId'
c1843150
C
3131 responses:
3132 '200':
3133 description: successful operation
3134 content:
3135 application/json:
3136 schema:
3137 type: object
3138 properties:
3139 videoPlaylistElement:
3140 type: object
3141 properties:
3142 id:
06746a8b 3143 type: integer
c00100b6 3144 example: 2
c1843150
C
3145 requestBody:
3146 content:
3147 application/json:
3148 schema:
3149 type: object
3150 properties:
3151 videoId:
c00100b6
RK
3152 oneOf:
3153 - $ref: '#/components/schemas/Video/properties/uuid'
b8375da9
RK
3154 - $ref: '#/components/schemas/Video/properties/id'
3155 description: Video to add in the playlist
c1843150 3156 startTimestamp:
06746a8b 3157 type: integer
c00100b6
RK
3158 format: seconds
3159 description: Start the video at this specific timestamp
c1843150 3160 stopTimestamp:
06746a8b 3161 type: integer
c00100b6
RK
3162 format: seconds
3163 description: Stop the video at this specific timestamp
c1843150
C
3164 required:
3165 - videoId
3166
c00100b6 3167 /video-playlists/{playlistId}/videos/reorder:
c1843150
C
3168 post:
3169 summary: 'Reorder a playlist'
e2adb8cb 3170 operationId: reorderVideoPlaylist
c1843150
C
3171 security:
3172 - OAuth2: []
3173 tags:
3174 - Video Playlists
3175 parameters:
c00100b6 3176 - $ref: '#/components/parameters/playlistId'
c1843150
C
3177 responses:
3178 '204':
3179 description: successful operation
3180 requestBody:
3181 content:
3182 application/json:
3183 schema:
3184 type: object
3185 properties:
3186 startPosition:
06746a8b
RK
3187 type: integer
3188 description: 'Start position of the element to reorder'
3189 minimum: 1
c1843150 3190 insertAfterPosition:
06746a8b
RK
3191 type: integer
3192 description: 'New position for the block to reorder, to add the block before the first element'
3193 minimum: 0
c1843150 3194 reorderLength:
06746a8b
RK
3195 type: integer
3196 description: 'How many element from `startPosition` to reorder'
3197 minimum: 1
c1843150
C
3198 required:
3199 - startPosition
3200 - insertAfterPosition
3201
c00100b6 3202 /video-playlists/{playlistId}/videos/{playlistElementId}:
c1843150 3203 put:
c00100b6 3204 summary: Update a playlist element
e2adb8cb 3205 operationId: putVideoPlaylistVideo
c1843150
C
3206 security:
3207 - OAuth2: []
3208 tags:
3209 - Video Playlists
3210 parameters:
c00100b6 3211 - $ref: '#/components/parameters/playlistId'
c1843150
C
3212 - $ref: '#/components/parameters/playlistElementId'
3213 responses:
3214 '204':
3215 description: successful operation
3216 requestBody:
3217 content:
3218 application/json:
3219 schema:
3220 type: object
3221 properties:
3222 startTimestamp:
06746a8b 3223 type: integer
c00100b6
RK
3224 format: seconds
3225 description: Start the video at this specific timestamp
c1843150 3226 stopTimestamp:
06746a8b 3227 type: integer
c00100b6
RK
3228 format: seconds
3229 description: Stop the video at this specific timestamp
c1843150 3230 delete:
c00100b6 3231 summary: Delete an element from a playlist
e2adb8cb 3232 operationId: delVideoPlaylistVideo
c1843150
C
3233 security:
3234 - OAuth2: []
3235 tags:
3236 - Video Playlists
3237 parameters:
c00100b6 3238 - $ref: '#/components/parameters/playlistId'
c1843150
C
3239 - $ref: '#/components/parameters/playlistElementId'
3240 responses:
3241 '204':
3242 description: successful operation
3243
0590bb46
C
3244 '/users/me/video-playlists/videos-exist':
3245 get:
c00100b6 3246 summary: Check video exists in my playlists
0590bb46
C
3247 security:
3248 - OAuth2: []
3249 tags:
3250 - Video Playlists
3251 parameters:
3252 - name: videoIds
3253 in: query
3254 required: true
3255 description: The video ids to check
3256 schema:
3257 type: array
3258 items:
b8375da9 3259 $ref: '#/components/schemas/Video/properties/id'
0590bb46
C
3260 responses:
3261 '200':
3262 description: successful operation
3263 content:
3264 application/json:
3265 schema:
3266 type: object
3267 properties:
3268 videoId:
3269 type: array
3270 items:
3271 type: object
3272 properties:
3273 playlistElementId:
06746a8b 3274 type: integer
0590bb46 3275 playlistId:
06746a8b 3276 type: integer
0590bb46 3277 startTimestamp:
06746a8b 3278 type: integer
c00100b6 3279 format: seconds
0590bb46 3280 stopTimestamp:
06746a8b 3281 type: integer
c00100b6 3282 format: seconds
0590bb46 3283
3e9e6f2f 3284 '/accounts/{name}/video-channels':
6b738c7a 3285 get:
b029d58a 3286 summary: List video channels of an account
6b738c7a 3287 tags:
b029d58a
C
3288 - Video Channels
3289 - Accounts
6b738c7a 3290 parameters:
3e9e6f2f 3291 - $ref: '#/components/parameters/name'
84f6e32c
RK
3292 - name: withStats
3293 in: query
3294 description: include view statistics for the last 30 days (only if authentified as the account user)
3295 schema:
3296 type: boolean
3297 - $ref: '#/components/parameters/start'
3298 - $ref: '#/components/parameters/count'
3299 - $ref: '#/components/parameters/sort'
6b738c7a
C
3300 responses:
3301 '200':
3302 description: successful operation
3e9e6f2f
RK
3303 content:
3304 application/json:
3305 schema:
045bcd0d 3306 $ref: '#/components/schemas/VideoChannelList'
3f71c4c0 3307
c100a614
YB
3308 '/accounts/{name}/ratings':
3309 get:
b029d58a 3310 summary: List ratings of an account
c100a614
YB
3311 security:
3312 - OAuth2: []
3313 tags:
b029d58a 3314 - Accounts
c100a614 3315 parameters:
cb9d028a 3316 - $ref: '#/components/parameters/name'
c100a614
YB
3317 - $ref: '#/components/parameters/start'
3318 - $ref: '#/components/parameters/count'
3319 - $ref: '#/components/parameters/sort'
3320 - name: rating
3321 in: query
3322 required: false
b3d1054e 3323 description: Optionally filter which ratings to retrieve
c100a614
YB
3324 schema:
3325 type: string
3326 enum:
3327 - like
3328 - dislike
3329 responses:
3330 '200':
3331 description: successful operation
3332 content:
3333 application/json:
3334 schema:
3335 type: array
3336 items:
3337 $ref: '#/components/schemas/VideoRating'
3f71c4c0 3338
3e9e6f2f 3339 '/videos/{id}/comment-threads':
1569a818 3340 get:
b029d58a 3341 summary: List threads of a video
1569a818 3342 tags:
b029d58a 3343 - Video Comments
1569a818 3344 parameters:
cb9d028a 3345 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f
RK
3346 - $ref: '#/components/parameters/start'
3347 - $ref: '#/components/parameters/count'
71810d0b 3348 - $ref: '#/components/parameters/commentsSort'
1569a818
DG
3349 responses:
3350 '200':
3351 description: successful operation
3e9e6f2f
RK
3352 content:
3353 application/json:
3354 schema:
3355 $ref: '#/components/schemas/CommentThreadResponse'
1569a818 3356 post:
b029d58a 3357 summary: Create a thread
94ff4c23 3358 security:
3e9e6f2f 3359 - OAuth2: []
1569a818 3360 tags:
b029d58a 3361 - Video Comments
1569a818 3362 parameters:
cb9d028a 3363 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
3364 responses:
3365 '200':
3366 description: successful operation
3e9e6f2f
RK
3367 content:
3368 application/json:
3369 schema:
3370 $ref: '#/components/schemas/CommentThreadPostResponse'
2c318664
RK
3371 '404':
3372 description: video does not exist
98639806
C
3373 requestBody:
3374 content:
3375 application/json:
3376 schema:
3377 type: object
3378 properties:
3379 text:
bf3c3fea
RK
3380 allOf:
3381 - $ref: '#/components/schemas/VideoComment/properties/text'
3382 format: markdown
3383 maxLength: 10000
98639806
C
3384 required:
3385 - text
3386
3e9e6f2f 3387 '/videos/{id}/comment-threads/{threadId}':
1569a818 3388 get:
b029d58a 3389 summary: Get a thread
1569a818 3390 tags:
b029d58a 3391 - Video Comments
1569a818 3392 parameters:
cb9d028a
C
3393 - $ref: '#/components/parameters/idOrUUID'
3394 - $ref: '#/components/parameters/threadId'
1569a818
DG
3395 responses:
3396 '200':
3397 description: successful operation
3e9e6f2f
RK
3398 content:
3399 application/json:
3400 schema:
3401 $ref: '#/components/schemas/VideoCommentThreadTree'
3f71c4c0 3402
3e9e6f2f 3403 '/videos/{id}/comments/{commentId}':
1569a818 3404 post:
b029d58a 3405 summary: Reply to a thread of a video
94ff4c23 3406 security:
3e9e6f2f 3407 - OAuth2: []
1569a818 3408 tags:
b029d58a 3409 - Video Comments
1569a818 3410 parameters:
cb9d028a 3411 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f 3412 - $ref: '#/components/parameters/commentId'
1569a818
DG
3413 responses:
3414 '200':
3415 description: successful operation
3e9e6f2f
RK
3416 content:
3417 application/json:
3418 schema:
3419 $ref: '#/components/schemas/CommentThreadPostResponse'
2c318664
RK
3420 '404':
3421 description: thread or video does not exist
98639806
C
3422 requestBody:
3423 content:
3424 application/json:
3425 schema:
3426 type: object
3427 properties:
3428 text:
bf3c3fea
RK
3429 allOf:
3430 - $ref: '#/components/schemas/VideoComment/properties/text'
3431 format: markdown
3432 maxLength: 10000
98639806
C
3433 required:
3434 - text
1569a818 3435 delete:
b029d58a 3436 summary: Delete a comment or a reply
94ff4c23 3437 security:
3e9e6f2f 3438 - OAuth2: []
1569a818 3439 tags:
b029d58a 3440 - Video Comments
1569a818 3441 parameters:
cb9d028a 3442 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f 3443 - $ref: '#/components/parameters/commentId'
1569a818
DG
3444 responses:
3445 '204':
c1843150 3446 description: successful operation
84f6e32c
RK
3447 '403':
3448 description: cannot remove comment of another user
3449 '404':
3450 description: comment or video does not exist
3451 '409':
3452 description: comment is already deleted
3f71c4c0 3453
3e9e6f2f 3454 '/videos/{id}/rate':
1569a818 3455 put:
b029d58a 3456 summary: Like/dislike a video
94ff4c23 3457 security:
3e9e6f2f 3458 - OAuth2: []
1569a818 3459 tags:
b029d58a 3460 - Video Rates
1569a818 3461 parameters:
cb9d028a 3462 - $ref: '#/components/parameters/idOrUUID'
4c440ced
RK
3463 requestBody:
3464 content:
3465 application/json:
3466 schema:
3467 type: object
3468 properties:
3469 rating:
3470 type: string
3471 enum:
3472 - like
3473 - dislike
9a320a06
RK
3474 required:
3475 - rating
1569a818
DG
3476 responses:
3477 '204':
c1843150 3478 description: successful operation
2c318664
RK
3479 '404':
3480 description: video does not exist
3f71c4c0 3481
fb72c193
DL
3482 /search/videos:
3483 get:
3484 tags:
3485 - Search
b029d58a 3486 summary: Search videos
e2adb8cb 3487 operationId: searchVideos
fb72c193 3488 parameters:
84f6e32c
RK
3489 - name: search
3490 in: query
3491 required: true
3492 allowEmptyValue: false
3493 description: >
3494 String to search. If the user can make a remote URI search, and the string is an URI then the
3495 PeerTube instance will fetch the remote object and add it to its database. Then,
3496 you can use the REST API to fetch the complete video information and interact with it.
3497 schema:
3498 type: string
59c794a5 3499 - $ref: '#/components/parameters/categoryOneOf'
1fd61899 3500 - $ref: '#/components/parameters/isLive'
59c794a5
C
3501 - $ref: '#/components/parameters/tagsOneOf'
3502 - $ref: '#/components/parameters/tagsAllOf'
3503 - $ref: '#/components/parameters/licenceOneOf'
3504 - $ref: '#/components/parameters/languageOneOf'
3505 - $ref: '#/components/parameters/nsfw'
3506 - $ref: '#/components/parameters/filter'
3507 - $ref: '#/components/parameters/skipCount'
3e9e6f2f
RK
3508 - $ref: '#/components/parameters/start'
3509 - $ref: '#/components/parameters/count'
ad031145 3510 - $ref: '#/components/parameters/searchTarget'
fd5af7a2 3511 - $ref: '#/components/parameters/videosSearchSort'
ad031145
C
3512 - name: startDate
3513 in: query
ad031145
C
3514 description: Get videos that are published after this date
3515 schema:
3516 type: string
3517 format: date-time
3518 - name: endDate
3519 in: query
ad031145
C
3520 description: Get videos that are published before this date
3521 schema:
3522 type: string
3523 format: date-time
3524 - name: originallyPublishedStartDate
3525 in: query
ad031145 3526 description: Get videos that are originally published after this date
3e9e6f2f
RK
3527 schema:
3528 type: string
ad031145
C
3529 format: date-time
3530 - name: originallyPublishedEndDate
3531 in: query
ad031145
C
3532 description: Get videos that are originally published before this date
3533 schema:
3534 type: string
3535 format: date-time
3536 - name: durationMin
3537 in: query
ad031145
C
3538 description: Get videos that have this minimum duration
3539 schema:
06746a8b 3540 type: integer
ad031145
C
3541 - name: durationMax
3542 in: query
ad031145
C
3543 description: Get videos that have this maximum duration
3544 schema:
06746a8b 3545 type: integer
2c318664
RK
3546 callbacks:
3547 'searchTarget === search-index':
3548 $ref: '#/components/callbacks/searchIndex'
fb72c193
DL
3549 responses:
3550 '200':
3551 description: successful operation
3e9e6f2f
RK
3552 content:
3553 application/json:
3554 schema:
048b6946 3555 $ref: '#/components/schemas/VideoListResponse'
2c318664
RK
3556 '500':
3557 description: search index unavailable
3f71c4c0 3558
ad031145
C
3559 /search/video-channels:
3560 get:
3561 tags:
3562 - Search
3563 summary: Search channels
e2adb8cb 3564 operationId: searchChannels
ad031145 3565 parameters:
ad031145
C
3566 - name: search
3567 in: query
3568 required: true
3569 description: >
3570 String to search. If the user can make a remote URI search, and the string is an URI then the
3571 PeerTube instance will fetch the remote object and add it to its database. Then,
3572 you can use the REST API to fetch the complete channel information and interact with it.
3573 schema:
3574 type: string
84f6e32c
RK
3575 - $ref: '#/components/parameters/start'
3576 - $ref: '#/components/parameters/count'
3577 - $ref: '#/components/parameters/searchTarget'
3578 - $ref: '#/components/parameters/sort'
2c318664
RK
3579 callbacks:
3580 'searchTarget === search-index':
3581 $ref: '#/components/callbacks/searchIndex'
ad031145
C
3582 responses:
3583 '200':
3584 description: successful operation
3585 content:
3586 application/json:
3587 schema:
045bcd0d 3588 $ref: '#/components/schemas/VideoChannelList'
2c318664
RK
3589 '500':
3590 description: search index unavailable
37a44fc9
C
3591
3592 /search/video-playlists:
3593 get:
3594 tags:
3595 - Search
3596 summary: Search playlists
3597 operationId: searchPlaylists
3598 parameters:
3599 - name: search
3600 in: query
3601 required: true
3602 description: >
3603 String to search. If the user can make a remote URI search, and the string is an URI then the
3604 PeerTube instance will fetch the remote object and add it to its database. Then,
3605 you can use the REST API to fetch the complete playlist information and interact with it.
3606 schema:
3607 type: string
3608 - $ref: '#/components/parameters/start'
3609 - $ref: '#/components/parameters/count'
3610 - $ref: '#/components/parameters/searchTarget'
3611 - $ref: '#/components/parameters/sort'
3612 callbacks:
3613 'searchTarget === search-index':
3614 $ref: '#/components/callbacks/searchIndex'
3615 responses:
3616 '200':
3617 description: successful operation
3618 content:
3619 application/json:
3620 schema:
3621 type: object
3622 properties:
3623 total:
3624 type: integer
3625 example: 1
3626 data:
3627 type: array
3628 items:
3629 $ref: '#/components/schemas/VideoPlaylist'
3630 '500':
3631 description: search index unavailable
da35b419
RK
3632
3633 /server/blocklist/accounts:
06746a8b
RK
3634 get:
3635 tags:
3636 - Account Blocks
3637 summary: List account blocks
3638 security:
3639 - OAuth2:
3640 - admin
3641 parameters:
3642 - $ref: '#/components/parameters/start'
3643 - $ref: '#/components/parameters/count'
3644 - $ref: '#/components/parameters/sort'
3645 responses:
3646 '200':
3647 description: successful operation
3648 post:
3649 tags:
3650 - Account Blocks
3651 summary: Block an account
3652 security:
3653 - OAuth2:
3654 - admin
3655 requestBody:
3656 content:
3657 application/json:
3658 schema:
3659 type: object
3660 properties:
3661 accountName:
3662 type: string
84f6e32c 3663 example: chocobozzz@example.org
06746a8b
RK
3664 description: account to block, in the form `username@domain`
3665 required:
3666 - accountName
3667 responses:
3668 '200':
3669 description: successful operation
3670 '409':
3671 description: self-blocking forbidden
3f71c4c0 3672
da35b419 3673 '/server/blocklist/accounts/{accountName}':
06746a8b
RK
3674 delete:
3675 tags:
3676 - Account Blocks
3677 summary: Unblock an account by its handle
3678 security:
3679 - OAuth2:
3680 - admin
3681 parameters:
3682 - name: accountName
3683 in: path
3684 required: true
3685 description: account to unblock, in the form `username@domain`
3686 schema:
3687 type: string
3688 responses:
3689 '201':
3690 description: successful operation
3691 '404':
3692 description: account or account block does not exist
da35b419
RK
3693
3694 /server/blocklist/servers:
06746a8b
RK
3695 get:
3696 tags:
3697 - Server Blocks
3698 summary: List server blocks
3699 security:
3700 - OAuth2:
3701 - admin
3702 parameters:
3703 - $ref: '#/components/parameters/start'
3704 - $ref: '#/components/parameters/count'
3705 - $ref: '#/components/parameters/sort'
3706 responses:
3707 '200':
3708 description: successful operation
3709 post:
3710 tags:
3711 - Server Blocks
3712 summary: Block a server
3713 security:
3714 - OAuth2:
3715 - admin
3716 requestBody:
3717 content:
3718 application/json:
3719 schema:
3720 type: object
3721 properties:
84f6e32c 3722 host:
06746a8b 3723 type: string
84f6e32c 3724 format: hostname
06746a8b
RK
3725 description: server domain to block
3726 required:
84f6e32c 3727 - host
06746a8b 3728 responses:
ca98c8f8 3729 '204':
06746a8b
RK
3730 description: successful operation
3731 '409':
3732 description: self-blocking forbidden
3f71c4c0 3733
da35b419 3734 '/server/blocklist/servers/{host}':
06746a8b
RK
3735 delete:
3736 tags:
3737 - Server Blocks
3738 summary: Unblock a server by its domain
3739 security:
3740 - OAuth2:
3741 - admin
3742 parameters:
3743 - name: host
3744 in: path
3745 required: true
3746 description: server domain to unblock
3747 schema:
3748 type: string
84f6e32c 3749 format: hostname
06746a8b 3750 responses:
ca98c8f8 3751 '204':
06746a8b
RK
3752 description: successful operation
3753 '404':
3754 description: account block does not exist
da35b419 3755
a4ce4223 3756 /server/redundancy/{host}:
04b703f6
RK
3757 put:
3758 tags:
3759 - Instance Redundancy
3760 summary: Update a server redundancy policy
3761 security:
3762 - OAuth2:
3763 - admin
3764 parameters:
3765 - name: host
3766 in: path
3767 required: true
3768 description: server domain to mirror
3769 schema:
3770 type: string
84f6e32c 3771 format: hostname
04b703f6
RK
3772 requestBody:
3773 content:
3774 application/json:
3775 schema:
3776 type: object
3777 properties:
3778 redundancyAllowed:
3779 type: boolean
3780 description: allow mirroring of the host's local videos
3781 required:
3782 - redundancyAllowed
3783 responses:
3784 '204':
3785 description: successful operation
3786 '404':
3787 description: server is not already known
3f71c4c0 3788
a4ce4223 3789 /server/redundancy/videos:
04b703f6
RK
3790 get:
3791 tags:
3792 - Video Mirroring
3793 summary: List videos being mirrored
e2adb8cb 3794 operationId: getMirroredVideos
04b703f6
RK
3795 security:
3796 - OAuth2:
3797 - admin
3798 parameters:
3799 - name: target
3800 in: query
3801 required: true
3802 description: direction of the mirror
3803 schema:
3804 type: string
3805 enum:
3806 - my-videos
3807 - remote-videos
3808 - $ref: '#/components/parameters/start'
3809 - $ref: '#/components/parameters/count'
3810 - $ref: '#/components/parameters/videoRedundanciesSort'
3811 responses:
3812 '200':
3813 description: successful operation
3814 content:
3815 application/json:
3816 schema:
3817 type: array
3818 items:
3819 $ref: '#/components/schemas/VideoRedundancy'
3820 post:
3821 tags:
3822 - Video Mirroring
3823 summary: Mirror a video
e2adb8cb 3824 operationId: putMirroredVideo
04b703f6
RK
3825 security:
3826 - OAuth2:
3827 - admin
3828 requestBody:
3829 content:
3830 application/json:
3831 schema:
3832 type: object
3833 properties:
3834 videoId:
b8375da9 3835 $ref: '#/components/schemas/Video/properties/id'
04b703f6
RK
3836 required:
3837 - videoId
3838 responses:
3839 '204':
3840 description: successful operation
3841 '400':
3842 description: cannot mirror a local video
3843 '404':
3844 description: video does not exist
3845 '409':
3846 description: video is already mirrored
3f71c4c0 3847
a4ce4223 3848 /server/redundancy/videos/{redundancyId}:
04b703f6
RK
3849 delete:
3850 tags:
3851 - Video Mirroring
3852 summary: Delete a mirror done on a video
e2adb8cb 3853 operationId: delMirroredVideo
04b703f6
RK
3854 security:
3855 - OAuth2:
3856 - admin
3857 parameters:
3858 - name: redundancyId
3859 in: path
3860 required: true
3861 description: id of an existing redundancy on a video
3862 schema:
3863 type: string
3864 responses:
3865 '204':
3866 description: successful operation
3867 '404':
3868 description: video redundancy not found
da35b419 3869
06746a8b
RK
3870 '/feeds/video-comments.{format}':
3871 get:
3872 tags:
3873 - Feeds
3874 summary: List comments on videos
e2adb8cb 3875 operationId: getSyndicatedComments
06746a8b
RK
3876 parameters:
3877 - name: format
3878 in: path
3879 required: true
00494d6e 3880 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
06746a8b
RK
3881 schema:
3882 type: string
3883 enum:
3884 - xml
3885 - rss
3886 - rss2
3887 - atom
3888 - atom1
3889 - json
3890 - json1
3891 - name: videoId
d73810be 3892 in: query
06746a8b
RK
3893 description: 'limit listing to a specific video'
3894 schema:
3895 type: string
00494d6e
RK
3896 - name: accountId
3897 in: query
3898 description: 'limit listing to a specific account'
3899 schema:
3900 type: string
3901 - name: accountName
3902 in: query
3903 description: 'limit listing to a specific account'
3904 schema:
3905 type: string
3906 - name: videoChannelId
3907 in: query
3908 description: 'limit listing to a specific video channel'
3909 schema:
3910 type: string
3911 - name: videoChannelName
3912 in: query
3913 description: 'limit listing to a specific video channel'
3914 schema:
3915 type: string
06746a8b
RK
3916 responses:
3917 '204':
3918 description: successful operation
3919 headers:
3920 Cache-Control:
3921 schema:
3922 type: string
3923 default: 'max-age=900' # 15 min cache
3924 content:
3925 application/xml:
3926 schema:
3927 $ref: '#/components/schemas/VideoCommentsForXML'
64df4b65
RK
3928 examples:
3929 nightly:
3930 externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local
06746a8b
RK
3931 application/rss+xml:
3932 schema:
3933 $ref: '#/components/schemas/VideoCommentsForXML'
64df4b65
RK
3934 examples:
3935 nightly:
3936 externalValue: https://peertube2.cpy.re/feeds/video-comments.rss?filter=local
06746a8b
RK
3937 text/xml:
3938 schema:
3939 $ref: '#/components/schemas/VideoCommentsForXML'
64df4b65
RK
3940 examples:
3941 nightly:
3942 externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local
06746a8b
RK
3943 application/atom+xml:
3944 schema:
3945 $ref: '#/components/schemas/VideoCommentsForXML'
64df4b65
RK
3946 examples:
3947 nightly:
3948 externalValue: https://peertube2.cpy.re/feeds/video-comments.atom?filter=local
06746a8b
RK
3949 application/json:
3950 schema:
3951 type: object
64df4b65
RK
3952 examples:
3953 nightly:
3954 externalValue: https://peertube2.cpy.re/feeds/video-comments.json?filter=local
00494d6e
RK
3955 '400':
3956 x-summary: field inconsistencies
3957 description: >
3958 Arises when:
3959 - videoId filter is mixed with a channel filter
3960 '404':
3961 description: video, video channel or account not found
06746a8b
RK
3962 '406':
3963 description: accept header unsupported
3f71c4c0 3964
06746a8b
RK
3965 '/feeds/videos.{format}':
3966 get:
3967 tags:
3968 - Feeds
3969 summary: List videos
e2adb8cb 3970 operationId: getSyndicatedVideos
06746a8b
RK
3971 parameters:
3972 - name: format
3973 in: path
3974 required: true
00494d6e 3975 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
06746a8b
RK
3976 schema:
3977 type: string
3978 enum:
3979 - xml
3980 - rss
3981 - rss2
3982 - atom
3983 - atom1
3984 - json
3985 - json1
3986 - name: accountId
d73810be 3987 in: query
06746a8b
RK
3988 description: 'limit listing to a specific account'
3989 schema:
3990 type: string
3991 - name: accountName
d73810be 3992 in: query
06746a8b
RK
3993 description: 'limit listing to a specific account'
3994 schema:
3995 type: string
3996 - name: videoChannelId
d73810be 3997 in: query
06746a8b
RK
3998 description: 'limit listing to a specific video channel'
3999 schema:
4000 type: string
4001 - name: videoChannelName
d73810be 4002 in: query
06746a8b
RK
4003 description: 'limit listing to a specific video channel'
4004 schema:
4005 type: string
84f6e32c
RK
4006 - $ref: '#/components/parameters/sort'
4007 - $ref: '#/components/parameters/nsfw'
4008 - $ref: '#/components/parameters/filter'
06746a8b
RK
4009 responses:
4010 '204':
4011 description: successful operation
4012 headers:
4013 Cache-Control:
4014 schema:
4015 type: string
4016 default: 'max-age=900' # 15 min cache
4017 content:
4018 application/xml:
4019 schema:
4020 $ref: '#/components/schemas/VideosForXML'
84f6e32c
RK
4021 examples:
4022 nightly:
4023 externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
06746a8b
RK
4024 application/rss+xml:
4025 schema:
4026 $ref: '#/components/schemas/VideosForXML'
64df4b65
RK
4027 examples:
4028 nightly:
4029 externalValue: https://peertube2.cpy.re/feeds/videos.rss?filter=local
06746a8b
RK
4030 text/xml:
4031 schema:
4032 $ref: '#/components/schemas/VideosForXML'
64df4b65
RK
4033 examples:
4034 nightly:
4035 externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
06746a8b
RK
4036 application/atom+xml:
4037 schema:
4038 $ref: '#/components/schemas/VideosForXML'
64df4b65
RK
4039 examples:
4040 nightly:
4041 externalValue: https://peertube2.cpy.re/feeds/videos.atom?filter=local
06746a8b
RK
4042 application/json:
4043 schema:
4044 type: object
64df4b65
RK
4045 examples:
4046 nightly:
4047 externalValue: https://peertube2.cpy.re/feeds/videos.json?filter=local
00494d6e
RK
4048 '404':
4049 description: video channel or account not found
06746a8b
RK
4050 '406':
4051 description: accept header unsupported
3f71c4c0 4052
64df4b65
RK
4053 '/feeds/subscriptions.{format}':
4054 get:
4055 tags:
4056 - Feeds
4057 - Account
4058 summary: List videos of subscriptions tied to a token
e2adb8cb 4059 operationId: getSyndicatedSubscriptionVideos
64df4b65
RK
4060 parameters:
4061 - name: format
4062 in: path
4063 required: true
4064 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
4065 schema:
4066 type: string
4067 enum:
4068 - xml
4069 - rss
4070 - rss2
4071 - atom
4072 - atom1
4073 - json
4074 - json1
4075 - name: accountId
4076 in: query
4077 description: limit listing to a specific account
4078 schema:
4079 type: string
4080 required: true
4081 - name: token
4082 in: query
4083 description: private token allowing access
4084 schema:
4085 type: string
4086 required: true
4087 - $ref: '#/components/parameters/sort'
4088 - $ref: '#/components/parameters/nsfw'
4089 - $ref: '#/components/parameters/filter'
4090 responses:
4091 '204':
4092 description: successful operation
4093 headers:
4094 Cache-Control:
4095 schema:
4096 type: string
4097 default: 'max-age=900' # 15 min cache
4098 content:
4099 application/xml:
4100 schema:
4101 $ref: '#/components/schemas/VideosForXML'
4102 application/rss+xml:
4103 schema:
4104 $ref: '#/components/schemas/VideosForXML'
4105 text/xml:
4106 schema:
4107 $ref: '#/components/schemas/VideosForXML'
4108 application/atom+xml:
4109 schema:
4110 $ref: '#/components/schemas/VideosForXML'
4111 application/json:
4112 schema:
4113 type: object
4114 '406':
4115 description: accept header unsupported
3f71c4c0 4116
7461d440
RK
4117 /plugins:
4118 get:
4119 tags:
4120 - Plugins
4121 summary: List plugins
e2adb8cb 4122 operationId: getPlugins
7461d440
RK
4123 security:
4124 - OAuth2:
4125 - admin
4126 parameters:
4127 - name: pluginType
4128 in: query
4129 schema:
4130 type: integer
4131 - name: uninstalled
4132 in: query
4133 schema:
4134 type: boolean
4135 - $ref: '#/components/parameters/start'
4136 - $ref: '#/components/parameters/count'
4137 - $ref: '#/components/parameters/sort'
4138 responses:
4139 '200':
4140 description: successful operation
4141 content:
4142 application/json:
4143 schema:
4144 $ref: '#/components/schemas/PluginResponse'
3f71c4c0 4145
7461d440
RK
4146 /plugins/available:
4147 get:
4148 tags:
4149 - Plugins
4150 summary: List available plugins
e2adb8cb 4151 operationId: getAvailablePlugins
7461d440
RK
4152 security:
4153 - OAuth2:
4154 - admin
4155 parameters:
4156 - name: search
4157 in: query
4158 schema:
4159 type: string
4160 - name: pluginType
4161 in: query
4162 schema:
4163 type: integer
4164 - name: currentPeerTubeEngine
4165 in: query
4166 schema:
4167 type: string
4168 - $ref: '#/components/parameters/start'
4169 - $ref: '#/components/parameters/count'
4170 - $ref: '#/components/parameters/sort'
4171 responses:
4172 '200':
4173 description: successful operation
4174 content:
4175 application/json:
4176 schema:
4177 $ref: '#/components/schemas/PluginResponse'
4178 '503':
4179 description: plugin index unavailable
3f71c4c0 4180
7461d440
RK
4181 /plugins/install:
4182 post:
4183 tags:
4184 - Plugins
4185 summary: Install a plugin
e2adb8cb 4186 operationId: addPlugin
7461d440
RK
4187 security:
4188 - OAuth2:
4189 - admin
4190 requestBody:
4191 content:
4192 application/json:
4193 schema:
4194 oneOf:
4195 - type: object
4196 properties:
4197 npmName:
4198 type: string
84f6e32c 4199 example: peertube-plugin-auth-ldap
7461d440
RK
4200 required:
4201 - npmName
4202 additionalProperties: false
4203 - type: object
4204 properties:
4205 path:
4206 type: string
4207 required:
4208 - path
4209 additionalProperties: false
4210 responses:
4211 '204':
4212 description: successful operation
4213 '400':
4214 description: should have either `npmName` or `path` set
3f71c4c0 4215
7461d440
RK
4216 /plugins/update:
4217 post:
4218 tags:
4219 - Plugins
4220 summary: Update a plugin
e2adb8cb 4221 operationId: updatePlugin
7461d440
RK
4222 security:
4223 - OAuth2:
4224 - admin
4225 requestBody:
4226 content:
4227 application/json:
4228 schema:
4229 oneOf:
4230 - type: object
4231 properties:
4232 npmName:
4233 type: string
84f6e32c 4234 example: peertube-plugin-auth-ldap
7461d440
RK
4235 required:
4236 - npmName
4237 additionalProperties: false
4238 - type: object
4239 properties:
4240 path:
4241 type: string
4242 required:
4243 - path
4244 additionalProperties: false
4245 responses:
4246 '204':
4247 description: successful operation
4248 '400':
4249 description: should have either `npmName` or `path` set
4250 '404':
4251 description: existing plugin not found
3f71c4c0 4252
7461d440
RK
4253 /plugins/uninstall:
4254 post:
4255 tags:
4256 - Plugins
4257 summary: Uninstall a plugin
e2adb8cb 4258 operationId: uninstallPlugin
7461d440
RK
4259 security:
4260 - OAuth2:
4261 - admin
4262 requestBody:
4263 content:
4264 application/json:
4265 schema:
4266 type: object
4267 properties:
4268 npmName:
4269 type: string
84f6e32c
RK
4270 description: name of the plugin/theme in its package.json
4271 example: peertube-plugin-auth-ldap
7461d440
RK
4272 required:
4273 - npmName
4274 responses:
4275 '204':
4276 description: successful operation
4277 '404':
4278 description: existing plugin not found
3f71c4c0 4279
7461d440
RK
4280 /plugins/{npmName}:
4281 get:
4282 tags:
4283 - Plugins
4284 summary: Get a plugin
e2adb8cb 4285 operationId: getPlugin
7461d440
RK
4286 security:
4287 - OAuth2:
4288 - admin
4289 parameters:
84f6e32c 4290 - $ref: '#/components/parameters/npmName'
7461d440
RK
4291 responses:
4292 '200':
4293 description: successful operation
4294 content:
4295 application/json:
4296 schema:
4297 $ref: '#/components/schemas/Plugin'
4298 '404':
4299 description: plugin not found
3f71c4c0 4300
7461d440
RK
4301 /plugins/{npmName}/settings:
4302 put:
4303 tags:
4304 - Plugins
4305 summary: Set a plugin's settings
4306 security:
4307 - OAuth2:
4308 - admin
4309 parameters:
84f6e32c 4310 - $ref: '#/components/parameters/npmName'
7461d440
RK
4311 requestBody:
4312 content:
4313 application/json:
4314 schema:
4315 type: object
4316 properties:
4317 settings:
4318 type: object
4319 additionalProperties: true
4320 responses:
4321 '204':
4322 description: successful operation
4323 '404':
4324 description: plugin not found
3f71c4c0 4325
7461d440
RK
4326 /plugins/{npmName}/public-settings:
4327 get:
4328 tags:
4329 - Plugins
4330 summary: Get a plugin's public settings
7461d440 4331 parameters:
84f6e32c 4332 - $ref: '#/components/parameters/npmName'
7461d440
RK
4333 responses:
4334 '200':
4335 description: successful operation
4336 content:
4337 application/json:
4338 schema:
4339 type: object
4340 additionalProperties: true
4341 '404':
4342 description: plugin not found
3f71c4c0 4343
7461d440
RK
4344 /plugins/{npmName}/registered-settings:
4345 get:
4346 tags:
4347 - Plugins
4348 summary: Get a plugin's registered settings
4349 security:
4350 - OAuth2:
4351 - admin
4352 parameters:
84f6e32c 4353 - $ref: '#/components/parameters/npmName'
7461d440
RK
4354 responses:
4355 '200':
4356 description: successful operation
4357 content:
4358 application/json:
4359 schema:
4360 type: object
4361 additionalProperties: true
4362 '404':
4363 description: plugin not found
3f71c4c0 4364
3e9e6f2f 4365servers:
8f9e8be1 4366 - url: 'https://peertube2.cpy.re/api/v1'
f4d59981 4367 description: Live Test Server (live data - latest nightly version)
6441981b 4368 - url: 'https://peertube3.cpy.re/api/v1'
b029d58a 4369 description: Live Test Server (live data - latest RC version)
f4d59981
RK
4370 - url: 'https://peertube.cpy.re/api/v1'
4371 description: Live Test Server (live data - stable version)
3e9e6f2f
RK
4372components:
4373 parameters:
4374 start:
4375 name: start
4376 in: query
4377 required: false
06746a8b 4378 description: Offset used to paginate results
3e9e6f2f 4379 schema:
06746a8b 4380 type: integer
84f6e32c 4381 minimum: 0
3e9e6f2f
RK
4382 count:
4383 name: count
4384 in: query
4385 required: false
06746a8b 4386 description: "Number of items to return"
3e9e6f2f 4387 schema:
06746a8b 4388 type: integer
84f6e32c 4389 default: 15
06746a8b
RK
4390 maximum: 100
4391 minimum: 1
3e9e6f2f
RK
4392 sort:
4393 name: sort
4394 in: query
4395 required: false
84f6e32c 4396 description: Sort column
3e9e6f2f
RK
4397 schema:
4398 type: string
84f6e32c 4399 example: -createdAt
8491293b
RK
4400 search:
4401 name: search
4402 in: query
4403 required: false
4404 description: Plain text search, applied to various parts of the model depending on endpoint
4405 schema:
4406 type: string
ad031145
C
4407 searchTarget:
4408 name: searchTarget
4409 in: query
4410 required: false
4411 description: >
4412 If the administrator enabled search index support, you can override the default search target.
4413
4414
4415 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
84f6e32c 4416 It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
ad031145
C
4417 * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
4418 then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
4419 After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
84f6e32c 4420 * 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
4421 the data from the origin instance API
4422 schema:
4423 type: string
4424 enum:
4425 - 'local'
4426 - 'search-index'
fd5af7a2
RK
4427 videosSort:
4428 name: sort
4429 in: query
4430 required: false
4431 description: Sort videos by criteria
4432 schema:
4433 type: string
4434 enum:
04b703f6 4435 - name
fd5af7a2
RK
4436 - -duration
4437 - -createdAt
4438 - -publishedAt
4439 - -views
4440 - -likes
4441 - -trending
923d3d5a 4442 - -hot
fd5af7a2
RK
4443 videosSearchSort:
4444 name: sort
4445 in: query
4446 required: false
4447 description: Sort videos by criteria
4448 schema:
4449 type: string
4450 enum:
04b703f6 4451 - name
fd5af7a2
RK
4452 - -duration
4453 - -createdAt
4454 - -publishedAt
4455 - -views
4456 - -likes
4457 - -match
71810d0b
RK
4458 commentsSort:
4459 name: sort
4460 in: query
4461 required: false
4462 description: Sort comments by criteria
4463 schema:
4464 type: string
4465 enum:
4466 - -createdAt
4467 - -totalReplies
fd5af7a2
RK
4468 blacklistsSort:
4469 name: sort
4470 in: query
4471 required: false
c756bae0 4472 description: Sort blocklists by criteria
fd5af7a2
RK
4473 schema:
4474 type: string
4475 enum:
4476 - -id
04b703f6 4477 - name
fd5af7a2
RK
4478 - -duration
4479 - -views
4480 - -likes
4481 - -dislikes
4482 - -uuid
4483 - -createdAt
8491293b
RK
4484 usersSearch:
4485 name: search
4486 in: query
4487 required: false
4488 description: Plain text search that will match with user usernames or emails
4489 schema:
4490 type: string
4491 usersBlocked:
4492 name: blocked
4493 in: query
4494 required: false
4495 description: Filter results down to (un)banned users
4496 schema:
4497 type: boolean
fd5af7a2
RK
4498 usersSort:
4499 name: sort
4500 in: query
4501 required: false
4502 description: Sort users by criteria
4503 schema:
4504 type: string
4505 enum:
4506 - -id
4507 - -username
4508 - -createdAt
4509 abusesSort:
4510 name: sort
4511 in: query
4512 required: false
4513 description: Sort abuses by criteria
4514 schema:
4515 type: string
4516 enum:
4517 - -id
4518 - -createdAt
4519 - -state
04b703f6
RK
4520 videoRedundanciesSort:
4521 name: sort
4522 in: query
4523 required: false
4524 description: Sort abuses by criteria
4525 schema:
4526 type: string
4527 enum:
4528 - name
3e9e6f2f
RK
4529 name:
4530 name: name
4531 in: path
4532 required: true
f2eb23cd 4533 description: The username or handle of the account
3e9e6f2f
RK
4534 schema:
4535 type: string
84f6e32c 4536 example: chocobozzz | chocobozzz@example.org
3e9e6f2f
RK
4537 id:
4538 name: id
4539 in: path
4540 required: true
4541 description: The user id
4542 schema:
b8375da9 4543 $ref: '#/components/schemas/id'
cb9d028a 4544 idOrUUID:
3e9e6f2f
RK
4545 name: id
4546 in: path
4547 required: true
d4a8e7a6 4548 description: The object id, uuid or short uuid
3e9e6f2f 4549 schema:
84f6e32c 4550 oneOf:
b8375da9 4551 - $ref: '#/components/schemas/id'
f880a5e7 4552 - $ref: '#/components/schemas/UUIDv4'
d4a8e7a6 4553 - $ref: '#/components/schemas/shortUUID'
c00100b6
RK
4554 playlistId:
4555 name: playlistId
4556 in: path
4557 required: true
4558 description: Playlist id
4559 schema:
4560 $ref: '#/components/schemas/VideoPlaylist/properties/id'
c1843150
C
4561 playlistElementId:
4562 name: playlistElementId
4563 in: path
4564 required: true
4565 description: Playlist element id
4566 schema:
b8375da9 4567 $ref: '#/components/schemas/id'
50e16ccf
C
4568 abuseId:
4569 name: abuseId
4570 in: path
4571 required: true
310b5219 4572 description: Abuse id
50e16ccf 4573 schema:
b8375da9 4574 $ref: '#/components/schemas/Abuse/properties/id'
668b7f09
C
4575 abuseMessageId:
4576 name: abuseMessageId
4577 in: path
4578 required: true
4579 description: Abuse message id
4580 schema:
b8375da9 4581 $ref: '#/components/schemas/AbuseMessage/properties/id'
67ae04a5
C
4582 captionLanguage:
4583 name: captionLanguage
4584 in: path
4585 required: true
4586 description: The caption language
4587 schema:
b8375da9 4588 $ref: '#/components/schemas/VideoLanguageSet'
9ce3d302
C
4589 channelHandle:
4590 name: channelHandle
3e9e6f2f
RK
4591 in: path
4592 required: true
84f6e32c 4593 description: The video channel handle
3e9e6f2f
RK
4594 schema:
4595 type: string
84f6e32c 4596 example: my_username | my_username@example.com
cb9d028a
C
4597 subscriptionHandle:
4598 name: subscriptionHandle
4599 in: path
4600 required: true
84f6e32c 4601 description: The subscription handle
cb9d028a
C
4602 schema:
4603 type: string
84f6e32c 4604 example: my_username | my_username@example.com
cb9d028a 4605 threadId:
3e9e6f2f
RK
4606 name: threadId
4607 in: path
4608 required: true
cb9d028a
C
4609 description: The thread id (root comment id)
4610 schema:
85a60d8b 4611 type: integer
cb9d028a
C
4612 commentId:
4613 name: commentId
4614 in: path
4615 required: true
3e9e6f2f
RK
4616 description: The comment id
4617 schema:
b8375da9 4618 $ref: '#/components/schemas/VideoComment/properties/id'
1fd61899
C
4619 isLive:
4620 name: isLive
4621 in: query
4622 required: false
4623 description: whether or not the video is a live
4624 schema:
4625 type: boolean
fd5af7a2
RK
4626 categoryOneOf:
4627 name: categoryOneOf
4628 in: query
4629 required: false
40cfb36b 4630 description: category id of the video (see [/videos/categories](#operation/getCategories))
fd5af7a2
RK
4631 schema:
4632 oneOf:
b8375da9 4633 - $ref: '#/components/schemas/VideoCategorySet'
fd5af7a2
RK
4634 - type: array
4635 items:
b8375da9 4636 $ref: '#/components/schemas/VideoCategorySet'
2beb9895
RK
4637 style: form
4638 explode: false
fd5af7a2
RK
4639 tagsOneOf:
4640 name: tagsOneOf
4641 in: query
4642 required: false
4643 description: tag(s) of the video
4644 schema:
4645 oneOf:
4646 - type: string
4647 - type: array
f6d6e7f8 4648 maxItems: 5
fd5af7a2
RK
4649 items:
4650 type: string
2beb9895
RK
4651 style: form
4652 explode: false
fd5af7a2
RK
4653 tagsAllOf:
4654 name: tagsAllOf
4655 in: query
4656 required: false
4657 description: tag(s) of the video, where all should be present in the video
4658 schema:
4659 oneOf:
4660 - type: string
4661 - type: array
4662 items:
4663 type: string
2beb9895
RK
4664 style: form
4665 explode: false
fd5af7a2
RK
4666 languageOneOf:
4667 name: languageOneOf
4668 in: query
4669 required: false
40cfb36b 4670 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
4671 schema:
4672 oneOf:
b8375da9 4673 - $ref: '#/components/schemas/VideoLanguageSet'
fd5af7a2
RK
4674 - type: array
4675 items:
b8375da9 4676 $ref: '#/components/schemas/VideoLanguageSet'
2beb9895
RK
4677 style: form
4678 explode: false
fd5af7a2
RK
4679 licenceOneOf:
4680 name: licenceOneOf
4681 in: query
4682 required: false
40cfb36b 4683 description: licence id of the video (see [/videos/licences](#operation/getLicences))
fd5af7a2
RK
4684 schema:
4685 oneOf:
b8375da9 4686 - $ref: '#/components/schemas/VideoLicenceSet'
fd5af7a2
RK
4687 - type: array
4688 items:
b8375da9 4689 $ref: '#/components/schemas/VideoLicenceSet'
2beb9895
RK
4690 style: form
4691 explode: false
59c794a5
C
4692 skipCount:
4693 name: skipCount
4694 in: query
4695 required: false
4696 description: if you don't need the `total` in the response
4697 schema:
4698 type: string
4699 enum:
4700 - 'true'
4701 - 'false'
06746a8b 4702 default: 'false'
fd5af7a2
RK
4703 nsfw:
4704 name: nsfw
4705 in: query
4706 required: false
4707 description: whether to include nsfw videos, if any
4708 schema:
4709 type: string
4710 enum:
4711 - 'true'
4712 - 'false'
4713 filter:
4714 name: filter
4715 in: query
4716 required: false
4717 description: >
0aa52e17 4718 Special filters which might require special rights:
fd5af7a2
RK
4719 * `local` - only videos local to the instance
4720 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
0aa52e17 4721 * `all` - all videos, showing private and unlisted videos (requires Admin privileges)
fd5af7a2
RK
4722 schema:
4723 type: string
4724 enum:
4725 - local
4726 - all-local
e76d5784
RK
4727 subscriptionsUris:
4728 name: uris
4729 in: query
4730 required: true
4731 description: list of uris to check if each is part of the user subscriptions
4732 schema:
4733 type: array
4734 items:
4735 type: string
84f6e32c
RK
4736 format: uri
4737 npmName:
4738 name: npmName
4739 in: path
4740 required: true
4741 description: name of the plugin/theme on npmjs.com or in its package.json
4742 schema:
4743 type: string
4744 example: peertube-plugin-auth-ldap
040d6896
RK
4745 jobType:
4746 name: jobType
4747 in: query
4748 required: false
4749 description: job type
4750 schema:
4751 type: string
4752 enum:
4753 - activitypub-follow
4754 - activitypub-http-broadcast
4755 - activitypub-http-fetcher
4756 - activitypub-http-unicast
4757 - email
4758 - video-transcoding
4759 - video-file-import
4760 - video-import
4761 - videos-views
4762 - activitypub-refresher
4763 - video-redundancy
4764 - video-live-ending
06dc7a1b
RK
4765 followState:
4766 name: state
4767 in: query
4768 schema:
4769 type: string
4770 enum:
4771 - pending
4772 - accepted
4773 actorType:
4774 name: actorType
4775 in: query
4776 schema:
4777 type: string
4778 enum:
4779 - Person
4780 - Application
4781 - Group
4782 - Service
4783 - Organization
3e9e6f2f
RK
4784 securitySchemes:
4785 OAuth2:
3c5e02f3 4786 description: |
3e9e6f2f 4787 Authenticating via OAuth requires the following steps:
3c5e02f3 4788 - Have an activated account
e2464d22
RK
4789 - [Generate] an access token for that account at `/api/v1/users/token`.
4790 - Make requests with the *Authorization: Bearer <token\>* header
3c5e02f3 4791 - Profit, depending on the role assigned to the account
3e9e6f2f 4792
e2464d22 4793 Note that the __access token is valid for 1 day__ and is given
3c5e02f3 4794 along with a __refresh token valid for 2 weeks__.
e2464d22
RK
4795
4796 [Generate]: https://docs.joinpeertube.org/api-rest-getting-started
3e9e6f2f
RK
4797 type: oauth2
4798 flows:
4799 password:
e2464d22 4800 tokenUrl: /api/v1/users/token
3e9e6f2f
RK
4801 scopes:
4802 admin: Admin scope
4803 moderator: Moderator scope
4804 user: User scope
4805 schemas:
b8375da9
RK
4806 # Resuable core properties
4807 id:
4808 type: integer
4809 minimum: 1
4810 example: 42
f880a5e7
RK
4811 UUIDv4:
4812 type: string
4813 format: uuid
4814 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4815 pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
f880a5e7
RK
4816 minLength: 36
4817 maxLength: 36
d4a8e7a6
C
4818 shortUUID:
4819 type: string
4820 description: translation of a uuid v4 with a bigger alphabet to have a shorter uuid
4821 example: 2y84q2MQUMWPbiEcxNXMgC
b8375da9
RK
4822 username:
4823 type: string
77b0c6b5 4824 description: immutable name of the user, used to find or mention its actor
b8375da9 4825 example: chocobozzz
e2464d22 4826 pattern: '/^[a-z0-9._]+$/'
b8375da9
RK
4827 minLength: 1
4828 maxLength: 50
4829 usernameChannel:
4830 type: string
77b0c6b5 4831 description: immutable name of the channel, used to interact with its actor
9a320a06 4832 example: framasoft_videos
e2464d22
RK
4833 pattern: '/^[a-zA-Z0-9\\-_.:]+$/'
4834 minLength: 1
4835 maxLength: 50
b8375da9
RK
4836 password:
4837 type: string
4838 format: password
b8375da9
RK
4839 minLength: 6
4840 maxLength: 255
f880a5e7 4841
40cfb36b
RK
4842 VideoCategorySet:
4843 type: integer
4844 description: category id of the video (see [/videos/categories](#operation/getCategories))
b8375da9 4845 example: 15
dfcb6f50 4846 VideoConstantNumber-Category:
3e9e6f2f
RK
4847 properties:
4848 id:
40cfb36b 4849 $ref: '#/components/schemas/VideoCategorySet'
3e9e6f2f
RK
4850 label:
4851 type: string
b8375da9 4852 example: Science & Technology
40cfb36b
RK
4853
4854 VideoLicenceSet:
4855 type: integer
4856 description: licence id of the video (see [/videos/licences](#operation/getLicences))
b8375da9 4857 example: 2
dfcb6f50
RK
4858 VideoConstantNumber-Licence:
4859 properties:
4860 id:
40cfb36b 4861 $ref: '#/components/schemas/VideoLicenceSet'
dfcb6f50
RK
4862 label:
4863 type: string
b8375da9
RK
4864 example: Attribution - Share Alike
4865
40cfb36b
RK
4866 VideoLanguageSet:
4867 type: string
4868 description: language id of the video (see [/videos/languages](#operation/getLanguages))
b8375da9 4869 example: en
dfcb6f50 4870 VideoConstantString-Language:
3e9e6f2f
RK
4871 properties:
4872 id:
40cfb36b 4873 $ref: '#/components/schemas/VideoLanguageSet'
3e9e6f2f
RK
4874 label:
4875 type: string
b8375da9 4876 example: English
c1843150
C
4877
4878 VideoPlaylistPrivacySet:
4879 type: integer
4880 enum:
4881 - 1
4882 - 2
4883 - 3
40cfb36b 4884 description: Video playlist privacy policy (see [/video-playlists/privacies])
c1843150
C
4885 VideoPlaylistPrivacyConstant:
4886 properties:
4887 id:
4888 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
4889 label:
4890 type: string
4891
4892 VideoPlaylistTypeSet:
4893 type: integer
4894 enum:
4895 - 1
4896 - 2
40cfb36b 4897 description: The video playlist type (Regular = `1`, Watch Later = `2`)
c1843150
C
4898 VideoPlaylistTypeConstant:
4899 properties:
4900 id:
4901 $ref: '#/components/schemas/VideoPlaylistTypeSet'
4902 label:
4903 type: string
4904
ee89e8fd
C
4905 VideoPrivacySet:
4906 type: integer
3e9e6f2f 4907 enum:
ee89e8fd
C
4908 - 1
4909 - 2
4910 - 3
c1843150 4911 - 4
40cfb36b 4912 description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies))
ee89e8fd
C
4913 VideoPrivacyConstant:
4914 properties:
4915 id:
c1843150 4916 $ref: '#/components/schemas/VideoPrivacySet'
ee89e8fd
C
4917 label:
4918 type: string
50e16ccf 4919
0590bb46
C
4920 NSFWPolicy:
4921 type: string
4922 enum:
4923 - display
4924 - blur
4925 - do_not_list
4926
4927 UserRole:
06746a8b 4928 type: integer
0590bb46
C
4929 enum:
4930 - 0
4931 - 1
4932 - 2
06746a8b 4933 description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
2c318664 4934 example: 2
6d989edc
C
4935 UserAdminFlags:
4936 type: integer
4937 enum:
4938 - 0
4939 - 1
c756bae0 4940 description: 'Admin flags for the user (None = `0`, Bypass video blocklist = `1`)'
6d989edc 4941 example: 1
0590bb46 4942
5dce26d2
C
4943 VideoStateConstant:
4944 properties:
4945 id:
4946 type: integer
4947 enum:
4948 - 1
4949 - 2
4950 - 3
06746a8b 4951 description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
5dce26d2
C
4952 label:
4953 type: string
50e16ccf 4954
4f32032f 4955 AbuseStateSet:
50e16ccf
C
4956 type: integer
4957 enum:
4958 - 1
4959 - 2
4960 - 3
668b7f09 4961 description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)'
4f32032f 4962 AbuseStateConstant:
50e16ccf
C
4963 properties:
4964 id:
4f32032f 4965 $ref: '#/components/schemas/AbuseStateSet'
50e16ccf
C
4966 label:
4967 type: string
4f32032f 4968 AbusePredefinedReasons:
1ebddadd
RK
4969 type: array
4970 items:
4971 type: string
4972 enum:
4973 - violentOrAbusive
4974 - hatefulOrAbusive
4975 - spamOrMisleading
4976 - privacy
4977 - rights
4978 - serverRules
4979 - thumbnails
4980 - captions
84f6e32c 4981 example: [spamOrMisleading]
50e16ccf 4982
40cfb36b
RK
4983 VideoResolutionSet:
4984 type: integer
4985 description: |
4986 Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`)
4987
4988 `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos.
4989 example: 240
5dce26d2 4990 VideoResolutionConstant:
2c4876f2 4991 description: resolutions and their labels for the video
5dce26d2
C
4992 properties:
4993 id:
40cfb36b 4994 $ref: '#/components/schemas/VideoResolutionSet'
5dce26d2
C
4995 label:
4996 type: string
84f6e32c 4997 example: 240p
5dce26d2
C
4998 VideoScheduledUpdate:
4999 properties:
5000 privacy:
5001 $ref: '#/components/schemas/VideoPrivacySet'
5dce26d2
C
5002 updateAt:
5003 type: string
5004 format: date
5005 description: When to update the video
5006 required:
5007 - updateAt
c1843150 5008 AccountSummary:
5dce26d2
C
5009 properties:
5010 id:
06746a8b 5011 type: integer
5dce26d2
C
5012 name:
5013 type: string
5014 displayName:
5015 type: string
5016 url:
5017 type: string
84f6e32c 5018 format: url
5dce26d2
C
5019 host:
5020 type: string
84f6e32c 5021 format: hostname
5dce26d2
C
5022 avatar:
5023 nullable: true
c1843150 5024 allOf:
75cba40d 5025 - $ref: '#/components/schemas/ActorImage'
5dce26d2
C
5026 VideoChannelSummary:
5027 properties:
5028 id:
b8375da9 5029 $ref: '#/components/schemas/id'
5dce26d2
C
5030 name:
5031 type: string
5032 displayName:
5033 type: string
5034 url:
5035 type: string
84f6e32c 5036 format: url
5dce26d2
C
5037 host:
5038 type: string
84f6e32c 5039 format: hostname
5dce26d2
C
5040 avatar:
5041 nullable: true
c1843150 5042 allOf:
75cba40d 5043 - $ref: '#/components/schemas/ActorImage'
5dce26d2
C
5044 PlaylistElement:
5045 properties:
5046 position:
06746a8b 5047 type: integer
5dce26d2 5048 startTimestamp:
06746a8b 5049 type: integer
c00100b6 5050 format: seconds
5dce26d2 5051 stopTimestamp:
06746a8b 5052 type: integer
c00100b6 5053 format: seconds
bfbd9128
C
5054 video:
5055 nullable: true
c1843150
C
5056 allOf:
5057 - $ref: '#/components/schemas/Video'
5dce26d2 5058 VideoFile:
2c4876f2 5059 readOnly: true
5dce26d2
C
5060 properties:
5061 magnetUri:
5062 type: string
2c4876f2
RK
5063 format: uri
5064 description: magnet URI allowing to resolve the video via BitTorrent without a metainfo file
5065 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
5066 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
5dce26d2
C
5067 resolution:
5068 $ref: '#/components/schemas/VideoResolutionConstant'
5069 size:
06746a8b 5070 type: integer
2c4876f2 5071 description: Video file size in bytes
5dce26d2
C
5072 torrentUrl:
5073 type: string
e81af300 5074 description: Direct URL of the torrent file
84f6e32c 5075 format: url
0ad45af7 5076 torrentDownloadUrl:
5dce26d2 5077 type: string
e81af300 5078 description: URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog)
84f6e32c 5079 format: url
5dce26d2
C
5080 fileUrl:
5081 type: string
e81af300 5082 description: Direct URL of the video
84f6e32c 5083 format: url
5dce26d2
C
5084 fileDownloadUrl:
5085 type: string
e81af300 5086 description: URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog)
84f6e32c 5087 format: url
5dce26d2
C
5088 fps:
5089 type: number
2c4876f2 5090 description: Frames per second of the video file
63748ad0
C
5091 metadataUrl:
5092 type: string
84f6e32c 5093 format: url
2c4876f2 5094 description: URL dereferencing the output of ffprobe on the file
5dce26d2 5095 VideoStreamingPlaylists:
4ca669e3
RK
5096 allOf:
5097 - type: object
5098 properties:
5099 id:
b8375da9 5100 $ref: '#/components/schemas/id'
4ca669e3
RK
5101 type:
5102 type: integer
5103 enum:
5104 - 1
5105 description: |
5106 Playlist type:
5107 - `1`: HLS
5108 - $ref: '#/components/schemas/VideoStreamingPlaylists-HLS'
5109 VideoStreamingPlaylists-HLS:
5dce26d2 5110 properties:
5dce26d2
C
5111 playlistUrl:
5112 type: string
84f6e32c 5113 format: url
5dce26d2
C
5114 segmentsSha256Url:
5115 type: string
84f6e32c 5116 format: url
63748ad0
C
5117 files:
5118 type: array
c540d865
RK
5119 description: |
5120 Video files associated to this playlist.
5121
5122 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
5123 items:
5124 $ref: '#/components/schemas/VideoFile'
5dce26d2
C
5125 redundancies:
5126 type: array
5127 items:
5128 type: object
5129 properties:
5130 baseUrl:
5131 type: string
84f6e32c 5132 format: url
f4d59981
RK
5133 VideoInfo:
5134 properties:
5135 id:
b8375da9 5136 $ref: '#/components/schemas/Video/properties/id'
f4d59981 5137 uuid:
b8375da9 5138 $ref: '#/components/schemas/Video/properties/uuid'
f4d59981 5139 name:
b8375da9 5140 $ref: '#/components/schemas/Video/properties/name'
3e9e6f2f
RK
5141 Video:
5142 properties:
5143 id:
b8375da9
RK
5144 description: object id for the video
5145 allOf:
5146 - $ref: '#/components/schemas/id'
3e9e6f2f 5147 uuid:
b8375da9
RK
5148 description: universal identifier for the video, that can be used across instances
5149 allOf:
5150 - $ref: '#/components/schemas/UUIDv4'
d4a8e7a6
C
5151 shortUUID:
5152 allOf:
5153 - $ref: '#/components/schemas/shortUUID'
4e239e35
C
5154 isLive:
5155 type: boolean
3e9e6f2f
RK
5156 createdAt:
5157 type: string
84f6e32c 5158 format: date-time
0c114568
RK
5159 example: 2017-10-01T10:52:46.396Z
5160 description: time at which the video object was first drafted
3e9e6f2f
RK
5161 publishedAt:
5162 type: string
84f6e32c 5163 format: date-time
0c114568
RK
5164 example: 2018-10-01T10:52:46.396Z
5165 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
5166 updatedAt:
5167 type: string
84f6e32c 5168 format: date-time
0c114568
RK
5169 example: 2021-05-04T08:01:01.502Z
5170 description: last time the video's metadata was modified
5dce26d2
C
5171 originallyPublishedAt:
5172 type: string
84f6e32c 5173 format: date-time
0c114568
RK
5174 example: 2010-10-01T10:52:46.396Z
5175 description: used to represent a date of first publication, prior to the practical publication date of `publishedAt`
3e9e6f2f 5176 category:
b8375da9
RK
5177 allOf:
5178 - $ref: '#/components/schemas/VideoConstantNumber-Category'
5179 description: category in which the video is classified
3e9e6f2f 5180 licence:
b8375da9
RK
5181 allOf:
5182 - $ref: '#/components/schemas/VideoConstantNumber-Licence'
5183 description: licence under which the video is distributed
3e9e6f2f 5184 language:
b8375da9
RK
5185 allOf:
5186 - $ref: '#/components/schemas/VideoConstantString-Language'
5187 description: main language used in the video
3e9e6f2f 5188 privacy:
b8375da9
RK
5189 allOf:
5190 - $ref: '#/components/schemas/VideoPrivacyConstant'
5191 description: privacy policy used to distribute the video
3e9e6f2f
RK
5192 description:
5193 type: string
0c114568
RK
5194 example: |
5195 **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n
5196 **Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network, based on fr...
5197 minLength: 3
5198 maxLength: 250
5199 description: |
5200 truncated description of the video, written in Markdown.
5201 Resolve `descriptionPath` to get the full description of maximum `10000` characters.
3e9e6f2f 5202 duration:
06746a8b 5203 type: integer
84f6e32c 5204 example: 1419
c00100b6 5205 format: seconds
0c114568 5206 description: duration of the video in seconds
3e9e6f2f
RK
5207 isLocal:
5208 type: boolean
5209 name:
5210 type: string
b8375da9 5211 description: title of the video
84f6e32c 5212 example: What is PeerTube?
bdac0584
RK
5213 minLength: 3
5214 maxLength: 120
3e9e6f2f
RK
5215 thumbnailPath:
5216 type: string
84f6e32c 5217 example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
5218 previewPath:
5219 type: string
20dcfd74 5220 example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
5221 embedPath:
5222 type: string
84f6e32c 5223 example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
3e9e6f2f 5224 views:
06746a8b 5225 type: integer
84f6e32c 5226 example: 1337
3e9e6f2f 5227 likes:
06746a8b 5228 type: integer
84f6e32c 5229 example: 42
3e9e6f2f 5230 dislikes:
06746a8b 5231 type: integer
84f6e32c 5232 example: 7
3e9e6f2f
RK
5233 nsfw:
5234 type: boolean
5dce26d2
C
5235 waitTranscoding:
5236 type: boolean
5237 nullable: true
5238 state:
b8375da9
RK
5239 allOf:
5240 - $ref: '#/components/schemas/VideoStateConstant'
5241 description: represents the internal state of the video processing within the PeerTube instance
5dce26d2
C
5242 scheduledUpdate:
5243 nullable: true
c1843150
C
5244 allOf:
5245 - $ref: '#/components/schemas/VideoScheduledUpdate'
5dce26d2
C
5246 blacklisted:
5247 nullable: true
5248 type: boolean
5249 blacklistedReason:
5250 nullable: true
5251 type: string
3e9e6f2f 5252 account:
c1843150 5253 $ref: '#/components/schemas/AccountSummary'
5dce26d2
C
5254 channel:
5255 $ref: '#/components/schemas/VideoChannelSummary'
5256 userHistory:
5257 nullable: true
3e9e6f2f
RK
5258 type: object
5259 properties:
5dce26d2 5260 currentTime:
06746a8b 5261 type: integer
5dce26d2
C
5262 VideoDetails:
5263 allOf:
5264 - $ref: '#/components/schemas/Video'
5265 - type: object
5266 properties:
5267 descriptionPath:
3e9e6f2f 5268 type: string
0c114568
RK
5269 example: /api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180a6d/description
5270 description: path at which to get the full description of maximum `10000` characters
5dce26d2 5271 support:
3e9e6f2f 5272 type: string
00494d6e 5273 description: A text tell the audience how to support the video creator
9a320a06 5274 example: Please support our work on https://soutenir.framasoft.org/en/ <3
c540d865
RK
5275 minLength: 3
5276 maxLength: 1000
5dce26d2
C
5277 channel:
5278 $ref: '#/components/schemas/VideoChannel'
5279 account:
5280 $ref: '#/components/schemas/Account'
5281 tags:
bdac0584 5282 example: [flowers, gardening]
5dce26d2 5283 type: array
bdac0584
RK
5284 minItems: 1
5285 maxItems: 5
5dce26d2
C
5286 items:
5287 type: string
bdac0584
RK
5288 minLength: 2
5289 maxLength: 30
5dce26d2
C
5290 commentsEnabled:
5291 type: boolean
5292 downloadEnabled:
5293 type: boolean
5294 trackerUrls:
5295 type: array
5296 items:
5297 type: string
84f6e32c 5298 format: url
2c4876f2
RK
5299 example:
5300 - https://peertube2.cpy.re/tracker/announce
5301 - wss://peertube2.cpy.re/tracker/socket
c540d865
RK
5302 files:
5303 type: array
5304 items:
5305 $ref: '#/components/schemas/VideoFile'
5306 description: |
5307 WebTorrent/raw video files. If WebTorrent is disabled on the server:
5308
5309 - field will be empty
5310 - video files will be found in `streamingPlaylists[].files` field
5dce26d2
C
5311 streamingPlaylists:
5312 type: array
5313 items:
5314 $ref: '#/components/schemas/VideoStreamingPlaylists'
c540d865
RK
5315 description: |
5316 HLS playlists/manifest files. If HLS is disabled on the server:
5317
5318 - field will be empty
5319 - video files will be found in `files` field
04b703f6
RK
5320 FileRedundancyInformation:
5321 properties:
5322 id:
b8375da9 5323 $ref: '#/components/schemas/id'
04b703f6
RK
5324 fileUrl:
5325 type: string
84f6e32c 5326 format: url
04b703f6
RK
5327 strategy:
5328 type: string
84f6e32c
RK
5329 enum:
5330 - manual
5331 - most-views
5332 - trending
5333 - recently-added
04b703f6
RK
5334 size:
5335 type: integer
5336 createdAt:
5337 type: string
5338 format: date-time
5339 updatedAt:
5340 type: string
5341 format: date-time
5342 expiresOn:
5343 type: string
5344 format: date-time
5345 VideoRedundancy:
5346 properties:
5347 id:
b8375da9 5348 $ref: '#/components/schemas/id'
04b703f6
RK
5349 name:
5350 type: string
5351 url:
5352 type: string
84f6e32c 5353 format: url
04b703f6 5354 uuid:
f880a5e7 5355 $ref: '#/components/schemas/UUIDv4'
04b703f6
RK
5356 redundancies:
5357 type: object
5358 properties:
5359 files:
5360 type: array
5361 items:
1e904cde 5362 $ref: '#/components/schemas/FileRedundancyInformation'
04b703f6
RK
5363 streamingPlaylists:
5364 type: array
5365 items:
1e904cde 5366 $ref: '#/components/schemas/FileRedundancyInformation'
1f82e3e8
C
5367 VideoImportStateConstant:
5368 properties:
5369 id:
5370 type: integer
5371 enum:
5372 - 1
5373 - 2
5374 - 3
06746a8b 5375 description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
1f82e3e8
C
5376 label:
5377 type: string
84f6e32c 5378 example: Pending
ac2a5b54
RK
5379 VideoCreateImport:
5380 allOf:
5381 - type: object
5382 additionalProperties: false
5383 oneOf:
5384 - properties:
5385 targetUrl:
5386 $ref: '#/components/schemas/VideoImport/properties/targetUrl'
5387 required: [targetUrl]
5388 - properties:
5389 magnetUri:
5390 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
5391 required: [magnetUri]
5392 - properties:
5393 torrentfile:
5394 $ref: '#/components/schemas/VideoImport/properties/torrentfile'
5395 required: [torrentfile]
5396 - $ref: '#/components/schemas/VideoUploadRequestCommon'
5397 required:
5398 - channelId
5399 - name
1f82e3e8
C
5400 VideoImport:
5401 properties:
5402 id:
ac2a5b54
RK
5403 readOnly: true
5404 allOf:
5405 - $ref: '#/components/schemas/id'
1f82e3e8
C
5406 targetUrl:
5407 type: string
84f6e32c 5408 format: url
2c4876f2 5409 description: remote URL where to find the import's source video
84f6e32c 5410 example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
1f82e3e8
C
5411 magnetUri:
5412 type: string
84f6e32c 5413 format: uri
2c4876f2 5414 description: magnet URI allowing to resolve the import's source video
84f6e32c 5415 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 5416 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
ac2a5b54
RK
5417 torrentfile:
5418 writeOnly: true
5419 type: string
5420 format: binary
5421 description: Torrent file containing only the video file
1f82e3e8 5422 torrentName:
ac2a5b54 5423 readOnly: true
1f82e3e8
C
5424 type: string
5425 state:
ac2a5b54
RK
5426 readOnly: true
5427 allOf:
5428 - $ref: '#/components/schemas/VideoImportStateConstant'
1f82e3e8 5429 error:
ac2a5b54 5430 readOnly: true
1f82e3e8
C
5431 type: string
5432 createdAt:
ac2a5b54 5433 readOnly: true
1f82e3e8 5434 type: string
84f6e32c 5435 format: date-time
1f82e3e8 5436 updatedAt:
ac2a5b54 5437 readOnly: true
1f82e3e8 5438 type: string
84f6e32c 5439 format: date-time
1f82e3e8 5440 video:
ac2a5b54 5441 readOnly: true
2c4876f2
RK
5442 nullable: true
5443 allOf:
5444 - $ref: '#/components/schemas/Video'
5844dde3
RK
5445 VideoImportsList:
5446 properties:
5447 total:
5448 type: integer
5449 example: 1
5450 data:
5451 type: array
5452 maxItems: 100
5453 items:
5454 $ref: '#/components/schemas/VideoImport'
668b7f09 5455 Abuse:
3e9e6f2f
RK
5456 properties:
5457 id:
b8375da9 5458 $ref: '#/components/schemas/id'
3e9e6f2f
RK
5459 reason:
5460 type: string
84f6e32c 5461 example: The video is a spam
4302058c
RK
5462 minLength: 2
5463 maxLength: 3000
1ebddadd 5464 predefinedReasons:
4f32032f 5465 $ref: '#/components/schemas/AbusePredefinedReasons'
3e9e6f2f
RK
5466 reporterAccount:
5467 $ref: '#/components/schemas/Account'
50e16ccf 5468 state:
4f32032f 5469 $ref: '#/components/schemas/AbuseStateConstant'
50e16ccf
C
5470 moderationComment:
5471 type: string
84f6e32c 5472 example: Decided to ban the server since it spams us regularly
4302058c
RK
5473 minLength: 2
5474 maxLength: 3000
3e9e6f2f 5475 video:
bdac0584 5476 $ref: '#/components/schemas/VideoInfo'
3e9e6f2f
RK
5477 createdAt:
5478 type: string
84f6e32c 5479 format: date-time
668b7f09
C
5480 AbuseMessage:
5481 properties:
5482 id:
b8375da9 5483 $ref: '#/components/schemas/id'
668b7f09
C
5484 message:
5485 type: string
4302058c 5486 minLength: 2
f6d6e7f8 5487 maxLength: 3000
668b7f09
C
5488 byModerator:
5489 type: boolean
5490 createdAt:
5491 type: string
5492 format: date-time
5493 account:
5494 $ref: '#/components/schemas/AccountSummary'
3e9e6f2f
RK
5495 VideoBlacklist:
5496 properties:
5497 id:
b8375da9 5498 $ref: '#/components/schemas/id'
3e9e6f2f 5499 videoId:
b8375da9 5500 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f
RK
5501 createdAt:
5502 type: string
84f6e32c 5503 format: date-time
3e9e6f2f
RK
5504 updatedAt:
5505 type: string
84f6e32c 5506 format: date-time
3e9e6f2f
RK
5507 name:
5508 type: string
4302058c
RK
5509 minLength: 3
5510 maxLength: 120
3e9e6f2f 5511 uuid:
f880a5e7 5512 $ref: '#/components/schemas/UUIDv4'
3e9e6f2f
RK
5513 description:
5514 type: string
4302058c
RK
5515 minLength: 3
5516 maxLength: 10000
3e9e6f2f 5517 duration:
06746a8b 5518 type: integer
3e9e6f2f 5519 views:
06746a8b 5520 type: integer
3e9e6f2f 5521 likes:
06746a8b 5522 type: integer
3e9e6f2f 5523 dislikes:
06746a8b 5524 type: integer
3e9e6f2f
RK
5525 nsfw:
5526 type: boolean
71810d0b
RK
5527 VideoPlaylist:
5528 properties:
5529 id:
b8375da9
RK
5530 $ref: '#/components/schemas/id'
5531 uuid:
5532 $ref: '#/components/schemas/UUIDv4'
d4a8e7a6
C
5533 shortUUID:
5534 allOf:
5535 - $ref: '#/components/schemas/shortUUID'
71810d0b
RK
5536 createdAt:
5537 type: string
84f6e32c 5538 format: date-time
71810d0b
RK
5539 updatedAt:
5540 type: string
84f6e32c 5541 format: date-time
71810d0b
RK
5542 description:
5543 type: string
4302058c
RK
5544 minLength: 3
5545 maxLength: 1000
71810d0b
RK
5546 displayName:
5547 type: string
4302058c
RK
5548 minLength: 1
5549 maxLength: 120
71810d0b
RK
5550 isLocal:
5551 type: boolean
5552 videoLength:
06746a8b 5553 type: integer
b8375da9 5554 minimum: 0
71810d0b
RK
5555 thumbnailPath:
5556 type: string
5557 privacy:
c1843150 5558 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
71810d0b 5559 type:
c1843150 5560 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
71810d0b 5561 ownerAccount:
c1843150
C
5562 $ref: '#/components/schemas/AccountSummary'
5563 videoChannel:
5564 $ref: '#/components/schemas/VideoChannelSummary'
3e9e6f2f
RK
5565 VideoComment:
5566 properties:
5567 id:
b8375da9 5568 $ref: '#/components/schemas/id'
3e9e6f2f
RK
5569 url:
5570 type: string
84f6e32c 5571 format: url
3e9e6f2f
RK
5572 text:
5573 type: string
bf3c3fea
RK
5574 format: html
5575 description: Text of the comment
4302058c 5576 minLength: 1
bf3c3fea 5577 example: This video is wonderful!
3e9e6f2f 5578 threadId:
b8375da9 5579 $ref: '#/components/schemas/id'
bf3c3fea
RK
5580 inReplyToCommentId:
5581 nullable: true
5582 allOf:
5583 - $ref: '#/components/schemas/id'
3e9e6f2f 5584 videoId:
b8375da9 5585 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f
RK
5586 createdAt:
5587 type: string
84f6e32c 5588 format: date-time
3e9e6f2f
RK
5589 updatedAt:
5590 type: string
84f6e32c 5591 format: date-time
bf3c3fea
RK
5592 deletedAt:
5593 nullable: true
5594 type: string
5595 format: date-time
5596 default: null
5597 isDeleted:
5598 type: boolean
5599 default: false
5b0413dd 5600 totalRepliesFromVideoAuthor:
06746a8b 5601 type: integer
b8375da9 5602 minimum: 0
3e9e6f2f 5603 totalReplies:
06746a8b 5604 type: integer
b8375da9 5605 minimum: 0
3e9e6f2f
RK
5606 account:
5607 $ref: '#/components/schemas/Account'
5608 VideoCommentThreadTree:
5609 properties:
5610 comment:
5611 $ref: '#/components/schemas/VideoComment'
5612 children:
5613 type: array
5614 items:
5615 $ref: '#/components/schemas/VideoCommentThreadTree'
67ae04a5
C
5616 VideoCaption:
5617 properties:
5618 language:
dfcb6f50 5619 $ref: '#/components/schemas/VideoConstantString-Language'
67ae04a5
C
5620 captionPath:
5621 type: string
75cba40d 5622 ActorImage:
3e9e6f2f
RK
5623 properties:
5624 path:
5625 type: string
5626 createdAt:
5627 type: string
84f6e32c 5628 format: date-time
3e9e6f2f
RK
5629 updatedAt:
5630 type: string
84f6e32c 5631 format: date-time
f4d59981
RK
5632 ActorInfo:
5633 properties:
5634 id:
b8375da9 5635 $ref: '#/components/schemas/id'
f4d59981
RK
5636 name:
5637 type: string
5638 displayName:
5639 type: string
5640 host:
5641 type: string
84f6e32c 5642 format: hostname
f4d59981
RK
5643 avatar:
5644 nullable: true
5645 type: object
5646 properties:
5647 path:
5648 type: string
3e9e6f2f
RK
5649 Actor:
5650 properties:
5651 id:
b8375da9 5652 $ref: '#/components/schemas/id'
3e9e6f2f
RK
5653 url:
5654 type: string
84f6e32c 5655 format: url
3e9e6f2f 5656 name:
77b0c6b5 5657 description: immutable name of the actor, used to find or mention it
2c4876f2
RK
5658 allOf:
5659 - $ref: '#/components/schemas/username'
3e9e6f2f
RK
5660 host:
5661 type: string
84f6e32c 5662 format: hostname
2c4876f2 5663 description: server on which the actor is resident
045bcd0d
RK
5664 hostRedundancyAllowed:
5665 type: boolean
2c4876f2 5666 description: whether this actor's host allows redundancy of its videos
3e9e6f2f 5667 followingCount:
06746a8b 5668 type: integer
2c4876f2
RK
5669 minimum: 0
5670 description: number of actors subscribed to by this actor, as seen by this instance
3e9e6f2f 5671 followersCount:
06746a8b 5672 type: integer
2c4876f2
RK
5673 minimum: 0
5674 description: number of followers of this actor, as seen by this instance
3e9e6f2f
RK
5675 createdAt:
5676 type: string
84f6e32c 5677 format: date-time
3e9e6f2f
RK
5678 updatedAt:
5679 type: string
84f6e32c 5680 format: date-time
3e9e6f2f 5681 avatar:
75cba40d 5682 $ref: '#/components/schemas/ActorImage'
3e9e6f2f
RK
5683 Account:
5684 allOf:
5685 - $ref: '#/components/schemas/Actor'
5686 - properties:
2a8ae759 5687 userId:
2c4876f2
RK
5688 description: object id for the user tied to this account
5689 allOf:
5690 - $ref: '#/components/schemas/User/properties/id'
3e9e6f2f
RK
5691 displayName:
5692 type: string
77b0c6b5
RK
5693 description: editable name of the account, displayed in its representations
5694 minLength: 3
5695 maxLength: 120
2a8ae759
FS
5696 description:
5697 type: string
2c4876f2 5698 description: text or bio displayed on the account's profile
6441981b
RK
5699 UserWatchingVideo:
5700 properties:
5701 currentTime:
06746a8b 5702 type: integer
c00100b6 5703 format: seconds
84f6e32c
RK
5704 description: timestamp within the video, in seconds
5705 example: 5
3e9e6f2f
RK
5706 ServerConfig:
5707 properties:
2a8ae759
FS
5708 instance:
5709 type: object
5710 properties:
5711 name:
5712 type: string
5713 shortDescription:
5714 type: string
5715 defaultClientRoute:
5716 type: string
5717 isNSFW:
5718 type: boolean
5719 defaultNSFWPolicy:
5720 type: string
5721 customizations:
5722 type: object
5723 properties:
5724 javascript:
5725 type: string
5726 css:
5727 type: string
f30736c8
RK
5728 search:
5729 type: object
5730 properties:
5731 remoteUri:
5732 type: object
5733 properties:
5734 users:
5735 type: boolean
5736 anonymous:
5737 type: boolean
2a8ae759
FS
5738 plugin:
5739 type: object
5740 properties:
5741 registered:
5742 type: array
5743 items:
5744 type: string
5745 theme:
5746 type: object
5747 properties:
5748 registered:
5749 type: array
5750 items:
5751 type: string
5752 email:
5753 type: object
5754 properties:
5755 enabled:
5756 type: boolean
5757 contactForm:
5758 type: object
5759 properties:
5760 enabled:
5761 type: boolean
5762 serverVersion:
5763 type: string
5764 serverCommit:
5765 type: string
3e9e6f2f
RK
5766 signup:
5767 type: object
5768 properties:
5769 allowed:
5770 type: boolean
2a8ae759
FS
5771 allowedForCurrentIP:
5772 type: boolean
5773 requiresEmailVerification:
5774 type: boolean
3e9e6f2f
RK
5775 transcoding:
5776 type: object
5777 properties:
2a8ae759
FS
5778 hls:
5779 type: object
5780 properties:
5781 enabled:
5782 type: boolean
f30736c8
RK
5783 webtorrent:
5784 type: object
5785 properties:
5786 enabled:
5787 type: boolean
3e9e6f2f
RK
5788 enabledResolutions:
5789 type: array
5790 items:
40cfb36b 5791 $ref: '#/components/schemas/VideoResolutionSet'
2a8ae759
FS
5792 import:
5793 type: object
5794 properties:
5795 videos:
5796 type: object
5797 properties:
5798 http:
5799 type: object
5800 properties:
5801 enabled:
5802 type: boolean
5803 torrent:
5804 type: object
5805 properties:
5806 enabled:
5807 type: boolean
5808 autoBlacklist:
5809 type: object
5810 properties:
5811 videos:
5812 type: object
5813 properties:
5814 ofUsers:
5815 type: object
5816 properties:
5817 enabled:
5818 type: boolean
3e9e6f2f
RK
5819 avatar:
5820 type: object
5821 properties:
5822 file:
5823 type: object
5824 properties:
5825 size:
5826 type: object
5827 properties:
5828 max:
06746a8b 5829 type: integer
3e9e6f2f
RK
5830 extensions:
5831 type: array
5832 items:
5833 type: string
5834 video:
5835 type: object
5836 properties:
2a8ae759
FS
5837 image:
5838 type: object
5839 properties:
5840 extensions:
5841 type: array
5842 items:
5843 type: string
5844 size:
5845 type: object
5846 properties:
5847 max:
06746a8b 5848 type: integer
3e9e6f2f
RK
5849 file:
5850 type: object
5851 properties:
5852 extensions:
5853 type: array
5854 items:
5855 type: string
2a8ae759
FS
5856 videoCaption:
5857 type: object
5858 properties:
5859 file:
5860 type: object
5861 properties:
5862 size:
5863 type: object
5864 properties:
5865 max:
06746a8b 5866 type: integer
2a8ae759
FS
5867 extensions:
5868 type: array
5869 items:
5870 type: string
5871 user:
5872 type: object
5873 properties:
5874 videoQuota:
06746a8b 5875 type: integer
b8375da9 5876 example: 16810141515
2a8ae759 5877 videoQuotaDaily:
06746a8b 5878 type: integer
b8375da9 5879 example: 1681014151
2a8ae759
FS
5880 trending:
5881 type: object
5882 properties:
5883 videos:
5884 type: object
5885 properties:
5886 intervalDays:
06746a8b 5887 type: integer
2a8ae759 5888 tracker:
747b17c7 5889 type: object
2a8ae759
FS
5890 properties:
5891 enabled:
5892 type: boolean
f30736c8
RK
5893 followings:
5894 type: object
5895 properties:
5896 instance:
5897 type: object
5898 properties:
5899 autoFollowIndex:
5900 type: object
5901 properties:
5902 indexUrl:
5903 type: string
84f6e32c 5904 format: url
2539932e
C
5905 homepage:
5906 type: object
5907 properties:
5908 enabled:
5909 type: boolean
5910
2a8ae759
FS
5911 ServerConfigAbout:
5912 properties:
5913 instance:
5914 type: object
5915 properties:
5916 name:
5917 type: string
5918 shortDescription:
5919 type: string
5920 description:
5921 type: string
5922 terms:
5923 type: string
5924 ServerConfigCustom:
5925 properties:
5926 instance:
5927 type: object
5928 properties:
5929 name:
5930 type: string
5931 shortDescription:
5932 type: string
5933 description:
5934 type: string
5935 terms:
5936 type: string
5937 defaultClientRoute:
5938 type: string
5939 isNSFW:
5940 type: boolean
5941 defaultNSFWPolicy:
5942 type: string
5943 customizations:
5944 type: object
5945 properties:
5946 javascript:
5947 type: string
5948 css:
5949 type: string
5950 theme:
5951 type: object
5952 properties:
5953 default:
5954 type: string
5955 services:
5956 type: object
5957 properties:
5958 twitter:
5959 type: object
5960 properties:
5961 username:
5962 type: string
5963 whitelisted:
5964 type: boolean
5965 cache:
5966 type: object
5967 properties:
5968 previews:
5969 type: object
5970 properties:
5971 size:
06746a8b 5972 type: integer
2a8ae759
FS
5973 captions:
5974 type: object
5975 properties:
5976 size:
06746a8b 5977 type: integer
2a8ae759
FS
5978 signup:
5979 type: object
5980 properties:
5981 enabled:
5982 type: boolean
5983 limit:
06746a8b 5984 type: integer
2a8ae759
FS
5985 requiresEmailVerification:
5986 type: boolean
5987 admin:
5988 type: object
5989 properties:
5990 email:
5991 type: string
84f6e32c 5992 format: email
2a8ae759
FS
5993 contactForm:
5994 type: object
5995 properties:
5996 enabled:
5997 type: boolean
5998 user:
5999 type: object
40cfb36b 6000 description: Settings that apply to new users, if registration is enabled
2a8ae759
FS
6001 properties:
6002 videoQuota:
06746a8b 6003 type: integer
b8375da9 6004 example: 16810141515
2a8ae759 6005 videoQuotaDaily:
06746a8b 6006 type: integer
b8375da9 6007 example: 1681014151
2a8ae759
FS
6008 transcoding:
6009 type: object
40cfb36b 6010 description: Settings pertaining to transcoding jobs
2a8ae759
FS
6011 properties:
6012 enabled:
6013 type: boolean
6014 allowAdditionalExtensions:
6015 type: boolean
40cfb36b 6016 description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos
2a8ae759
FS
6017 allowAudioFiles:
6018 type: boolean
40cfb36b 6019 description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file
2a8ae759 6020 threads:
06746a8b 6021 type: integer
40cfb36b
RK
6022 description: Amount of threads used by ffmpeg for 1 transcoding job
6023 concurrency:
6024 type: number
6025 description: Amount of transcoding jobs to execute in parallel
6026 profile:
6027 type: string
6028 enum:
6029 - default
6030 description: |
6031 New profiles can be added by plugins ; available in core PeerTube: 'default'.
2a8ae759
FS
6032 resolutions:
6033 type: object
40cfb36b 6034 description: Resolutions to transcode _new videos_ to
2a8ae759 6035 properties:
40cfb36b
RK
6036 0p:
6037 type: boolean
2a8ae759
FS
6038 240p:
6039 type: boolean
6040 360p:
6041 type: boolean
6042 480p:
6043 type: boolean
6044 720p:
6045 type: boolean
6046 1080p:
6047 type: boolean
b7085c71
RK
6048 1440p:
6049 type: boolean
2a8ae759
FS
6050 2160p:
6051 type: boolean
40cfb36b
RK
6052 webtorrent:
6053 type: object
6054 description: WebTorrent-specific settings
6055 properties:
6056 enabled:
6057 type: boolean
2a8ae759
FS
6058 hls:
6059 type: object
40cfb36b 6060 description: HLS-specific settings
2a8ae759
FS
6061 properties:
6062 enabled:
6063 type: boolean
6064 import:
6065 type: object
6066 properties:
6067 videos:
6068 type: object
6069 properties:
6070 http:
6071 type: object
6072 properties:
6073 enabled:
6074 type: boolean
6075 torrent:
6076 type: object
6077 properties:
6078 enabled:
6079 type: boolean
6080 autoBlacklist:
6081 type: object
6082 properties:
6083 videos:
6084 type: object
6085 properties:
6086 ofUsers:
6087 type: object
6088 properties:
6089 enabled:
6090 type: boolean
6091 followers:
6092 type: object
6093 properties:
6094 instance:
6095 type: object
6096 properties:
6097 enabled:
6098 type: boolean
6099 manualApproval:
6100 type: boolean
2539932e
C
6101
6102 CustomHomepage:
6103 properties:
6104 content:
6105 type: string
6106
3e9e6f2f
RK
6107 Follow:
6108 properties:
6109 id:
b8375da9 6110 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6111 follower:
6112 $ref: '#/components/schemas/Actor'
6113 following:
6114 $ref: '#/components/schemas/Actor'
6115 score:
6116 type: number
04b703f6 6117 description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
3e9e6f2f
RK
6118 state:
6119 type: string
6120 enum:
6121 - pending
6122 - accepted
6123 createdAt:
6124 type: string
84f6e32c 6125 format: date-time
3e9e6f2f
RK
6126 updatedAt:
6127 type: string
84f6e32c 6128 format: date-time
e3489df9
C
6129
6130 PredefinedAbuseReasons:
6131 description: Reason categories that help triage reports
6132 type: array
f6d6e7f8 6133 maxItems: 8
e3489df9
C
6134 items:
6135 type: string
6136 enum:
6137 - violentOrAbusive
6138 - hatefulOrAbusive
6139 - spamOrMisleading
6140 - privacy
6141 - rights
6142 - serverRules
6143 - thumbnails
6144 - captions
6145
3e9e6f2f
RK
6146 Job:
6147 properties:
6148 id:
b8375da9 6149 $ref: '#/components/schemas/id'
3e9e6f2f
RK
6150 state:
6151 type: string
6152 enum:
84f6e32c
RK
6153 - active
6154 - completed
6155 - failed
6156 - waiting
6157 - delayed
6158 type:
3e9e6f2f
RK
6159 type: string
6160 enum:
84f6e32c
RK
6161 - activitypub-http-unicast
6162 - activitypub-http-broadcast
6163 - activitypub-http-fetcher
6164 - activitypub-follow
6165 - video-file-import
6166 - video-transcoding
6167 - email
6168 - video-import
6169 - videos-views
6170 - activitypub-refresher
6171 - video-redundancy
6172 data:
6173 type: object
6174 additionalProperties: true
6175 error:
6176 type: object
6177 additionalProperties: true
3e9e6f2f
RK
6178 createdAt:
6179 type: string
84f6e32c
RK
6180 format: date-time
6181 finishedOn:
3e9e6f2f 6182 type: string
84f6e32c
RK
6183 format: date-time
6184 processedOn:
6185 type: string
6186 format: date-time
3e9e6f2f
RK
6187 AddUserResponse:
6188 properties:
2c318664
RK
6189 user:
6190 type: object
6191 properties:
6192 id:
b8375da9 6193 $ref: '#/components/schemas/id'
2c318664
RK
6194 account:
6195 type: object
6196 properties:
6197 id:
b8375da9 6198 $ref: '#/components/schemas/id'
f6d6e7f8 6199 VideoUploadRequestCommon:
6200 properties:
6201 name:
6202 description: Video name
6203 type: string
b8375da9
RK
6204 example: What is PeerTube?
6205 minLength: 3
6206 maxLength: 120
f6d6e7f8 6207 channelId:
6208 description: Channel id that will contain this video
6209 type: integer
b8375da9
RK
6210 example: 3
6211 minimum: 1
f6d6e7f8 6212 privacy:
6213 $ref: '#/components/schemas/VideoPrivacySet'
6214 category:
40cfb36b 6215 $ref: '#/components/schemas/VideoCategorySet'
f6d6e7f8 6216 licence:
40cfb36b 6217 $ref: '#/components/schemas/VideoLicenceSet'
f6d6e7f8 6218 language:
40cfb36b 6219 $ref: '#/components/schemas/VideoLanguageSet'
f6d6e7f8 6220 description:
6221 description: Video description
6222 type: string
b8375da9
RK
6223 example: |
6224 **[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 6225 waitTranscoding:
6226 description: Whether or not we wait transcoding before publish the video
6227 type: boolean
6228 support:
6229 description: A text tell the audience how to support the video creator
9a320a06 6230 example: Please support our work on https://soutenir.framasoft.org/en/ <3
f6d6e7f8 6231 type: string
6232 nsfw:
6233 description: Whether or not this video contains sensitive content
6234 type: boolean
6235 tags:
6236 description: Video tags (maximum 5 tags each between 2 and 30 characters)
6237 type: array
6238 minItems: 1
6239 maxItems: 5
6240 uniqueItems: true
b8375da9
RK
6241 example:
6242 - framasoft
6243 - peertube
f6d6e7f8 6244 items:
6245 type: string
6246 minLength: 2
6247 maxLength: 30
6248 commentsEnabled:
6249 description: Enable or disable comments for this video
6250 type: boolean
6251 downloadEnabled:
6252 description: Enable or disable downloading for this video
6253 type: boolean
6254 originallyPublishedAt:
6255 description: Date when the content was originally published
6256 type: string
6257 format: date-time
6258 scheduleUpdate:
6259 $ref: '#/components/schemas/VideoScheduledUpdate'
6260 thumbnailfile:
6261 description: Video thumbnail file
6262 type: string
6263 format: binary
6264 previewfile:
6265 description: Video preview file
6266 type: string
6267 format: binary
6268 required:
6269 - channelId
6270 - name
6271 VideoUploadRequestLegacy:
6272 allOf:
6273 - $ref: '#/components/schemas/VideoUploadRequestCommon'
6274 - type: object
6275 required:
6276 - videofile
6277 properties:
6278 videofile:
6279 description: Video file
6280 type: string
6281 format: binary
6282 VideoUploadRequestResumable:
6283 allOf:
6284 - $ref: '#/components/schemas/VideoUploadRequestCommon'
6285 - type: object
6286 required:
6287 - filename
6288 properties:
6289 filename:
6290 description: Video filename including extension
6291 type: string
6292 format: filename
b8375da9 6293 example: what_is_peertube.mp4
f6d6e7f8 6294 thumbnailfile:
6295 description: Video thumbnail file
6296 type: string
6297 format: binary
6298 previewfile:
6299 description: Video preview file
6300 type: string
6301 format: binary
3e9e6f2f
RK
6302 VideoUploadResponse:
6303 properties:
6304 video:
6305 type: object
6306 properties:
6307 id:
b8375da9 6308 $ref: '#/components/schemas/Video/properties/id'
3e9e6f2f 6309 uuid:
b8375da9 6310 $ref: '#/components/schemas/Video/properties/uuid'
d4a8e7a6
C
6311 shortUUID:
6312 $ref: '#/components/schemas/Video/properties/shortUUID'
3e9e6f2f
RK
6313 CommentThreadResponse:
6314 properties:
6315 total:
06746a8b 6316 type: integer
84f6e32c 6317 example: 1
3e9e6f2f
RK
6318 data:
6319 type: array
84f6e32c 6320 maxItems: 100
3e9e6f2f
RK
6321 items:
6322 $ref: '#/components/schemas/VideoComment'
6323 CommentThreadPostResponse:
6324 properties:
6325 comment:
6326 $ref: '#/components/schemas/VideoComment'
048b6946
C
6327 VideoListResponse:
6328 properties:
6329 total:
06746a8b 6330 type: integer
84f6e32c 6331 example: 1
048b6946
C
6332 data:
6333 type: array
84f6e32c 6334 maxItems: 100
048b6946
C
6335 items:
6336 $ref: '#/components/schemas/Video'
84f6e32c
RK
6337 User:
6338 properties:
fd5586b3
RK
6339 account:
6340 $ref: '#/components/schemas/Account'
6341 autoPlayNextVideo:
6342 type: boolean
6343 description: Automatically start playing the upcoming video after the currently playing video
6344 autoPlayNextVideoPlaylist:
6345 type: boolean
6346 description: Automatically start playing the video on the playlist after the currently playing video
6347 autoPlayVideo:
6348 type: boolean
6349 description: Automatically start playing the video on the watch page
6350 blocked:
6351 type: boolean
6352 blockedReason:
6353 type: string
6354 createdAt:
84f6e32c 6355 type: string
84f6e32c
RK
6356 email:
6357 type: string
6358 format: email
6359 description: The user email
fd5586b3
RK
6360 emailVerified:
6361 type: boolean
6362 description: Has the user confirmed their email address?
6363 id:
2c4876f2
RK
6364 allOf:
6365 - $ref: '#/components/schemas/id'
fd5586b3 6366 readOnly: true
6d989edc
C
6367 pluginAuth:
6368 type: string
6369 description: Auth plugin to use to authenticate the user
fd5586b3 6370 lastLoginDate:
84f6e32c 6371 type: string
fd5586b3
RK
6372 format: date-time
6373 noInstanceConfigWarningModal:
6374 type: boolean
6375 noWelcomeModal:
84f6e32c 6376 type: boolean
84f6e32c
RK
6377 nsfwPolicy:
6378 $ref: '#/components/schemas/NSFWPolicy'
84f6e32c
RK
6379 role:
6380 $ref: '#/components/schemas/UserRole'
6381 roleLabel:
6382 type: string
6383 enum:
6384 - User
6385 - Moderator
6386 - Administrator
fd5586b3 6387 theme:
84f6e32c 6388 type: string
fd5586b3
RK
6389 description: Theme enabled by this user
6390 username:
b8375da9 6391 $ref: '#/components/schemas/username'
84f6e32c
RK
6392 videoChannels:
6393 type: array
6394 items:
6395 $ref: '#/components/schemas/VideoChannel'
fd5586b3
RK
6396 videoQuota:
6397 type: integer
6398 description: The user video quota in bytes
6399 example: -1
6400 videoQuotaDaily:
6401 type: integer
6402 description: The user daily video quota in bytes
6403 example: -1
6404 webtorrentEnabled:
6405 type: boolean
6406 description: Enable P2P in the player
6407 UserWithStats:
6408 allOf:
6409 - $ref: '#/components/schemas/User'
6410 - properties:
6411 # optionally present fields: they require WITH_STATS scope
6412 videosCount:
6413 type: integer
85a60d8b 6414 description: Count of videos published
fd5586b3
RK
6415 abusesCount:
6416 type: integer
6417 description: Count of reports/abuses of which the user is a target
6418 abusesAcceptedCount:
6419 type: integer
6420 description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team
6421 abusesCreatedCount:
6422 type: integer
6423 description: Count of reports/abuses created by the user
6424 videoCommentsCount:
6425 type: integer
6426 description: Count of comments published
3e9e6f2f
RK
6427 AddUser:
6428 properties:
6429 username:
b8375da9 6430 $ref: '#/components/schemas/username'
3e9e6f2f 6431 password:
b8375da9 6432 $ref: '#/components/schemas/password'
3e9e6f2f
RK
6433 email:
6434 type: string
84f6e32c
RK
6435 format: email
6436 description: The user email
3e9e6f2f 6437 videoQuota:
84f6e32c 6438 type: integer
b8375da9
RK
6439 description: The user video quota in bytes
6440 example: -1
fbe1bc2a 6441 videoQuotaDaily:
84f6e32c 6442 type: integer
b8375da9
RK
6443 description: The user daily video quota in bytes
6444 example: -1
6d989edc 6445 channelName:
b8375da9 6446 $ref: '#/components/schemas/usernameChannel'
3e9e6f2f 6447 role:
0590bb46 6448 $ref: '#/components/schemas/UserRole'
6d989edc
C
6449 adminFlags:
6450 $ref: '#/components/schemas/UserAdminFlags'
3e9e6f2f
RK
6451 required:
6452 - username
6453 - password
6454 - email
6455 - videoQuota
fbe1bc2a 6456 - videoQuotaDaily
3e9e6f2f
RK
6457 - role
6458 UpdateUser:
6459 properties:
3e9e6f2f 6460 email:
84f6e32c 6461 description: The updated email of the user
77b0c6b5
RK
6462 allOf:
6463 - $ref: '#/components/schemas/User/properties/email'
6d989edc
C
6464 emailVerified:
6465 type: boolean
6466 description: Set the email as verified
3e9e6f2f 6467 videoQuota:
84f6e32c 6468 type: integer
b8375da9 6469 description: The updated video quota of the user in bytes
fbe1bc2a 6470 videoQuotaDaily:
84f6e32c 6471 type: integer
b8375da9 6472 description: The updated daily video quota of the user in bytes
6d989edc
C
6473 pluginAuth:
6474 type: string
6475 nullable: true
6476 description: The auth plugin to use to authenticate the user
6477 example: 'peertube-plugin-auth-saml2'
3e9e6f2f 6478 role:
0590bb46 6479 $ref: '#/components/schemas/UserRole'
6d989edc
C
6480 adminFlags:
6481 $ref: '#/components/schemas/UserAdminFlags'
3e9e6f2f 6482 UpdateMe:
77b0c6b5 6483 # see shared/models/users/user-update-me.model.ts:
3e9e6f2f
RK
6484 properties:
6485 password:
b8375da9 6486 $ref: '#/components/schemas/password'
77b0c6b5
RK
6487 currentPassword:
6488 $ref: '#/components/schemas/password'
3e9e6f2f 6489 email:
77b0c6b5
RK
6490 description: new email used for login and service communications
6491 allOf:
6492 - $ref: '#/components/schemas/User/properties/email'
6493 displayName:
3e9e6f2f 6494 type: string
77b0c6b5
RK
6495 description: new name of the user in its representations
6496 minLength: 3
6497 maxLength: 120
3e9e6f2f
RK
6498 displayNSFW:
6499 type: string
77b0c6b5 6500 description: new NSFW display policy
84f6e32c
RK
6501 enum:
6502 - 'true'
6503 - 'false'
6504 - both
77b0c6b5
RK
6505 webTorrentEnabled:
6506 type: boolean
6507 description: whether to enable P2P in the player or not
3e9e6f2f 6508 autoPlayVideo:
84f6e32c 6509 type: boolean
77b0c6b5
RK
6510 description: new preference regarding playing videos automatically
6511 autoPlayNextVideo:
6512 type: boolean
6513 description: new preference regarding playing following videos automatically
6514 autoPlayNextVideoPlaylist:
6515 type: boolean
6516 description: new preference regarding playing following playlist videos automatically
6517 videosHistoryEnabled:
6518 type: boolean
6519 description: whether to keep track of watched history or not
6520 videoLanguages:
6521 type: array
6522 items:
6523 type: string
6524 description: list of languages to filter videos down to
6525 theme:
6526 type: string
6527 noInstanceConfigWarningModal:
6528 type: boolean
6529 noWelcomeModal:
6530 type: boolean
3e9e6f2f
RK
6531 GetMeVideoRating:
6532 properties:
6533 id:
b8375da9 6534 $ref: '#/components/schemas/id'
3e9e6f2f 6535 rating:
30b40713
RK
6536 type: string
6537 enum:
6538 - like
6539 - dislike
6540 - none
84f6e32c 6541 description: Rating of the video
3e9e6f2f
RK
6542 required:
6543 - id
6544 - rating
c100a614
YB
6545 VideoRating:
6546 properties:
6547 video:
6548 $ref: '#/components/schemas/Video'
6549 rating:
30b40713
RK
6550 type: string
6551 enum:
6552 - like
6553 - dislike
6554 - none
6555 description: Rating of the video
c100a614
YB
6556 required:
6557 - video
6558 - rating
3e9e6f2f
RK
6559 RegisterUser:
6560 properties:
6561 username:
77b0c6b5
RK
6562 description: immutable name of the user, used to find or mention its actor
6563 allOf:
6564 - $ref: '#/components/schemas/username'
3e9e6f2f 6565 password:
b8375da9 6566 $ref: '#/components/schemas/password'
3e9e6f2f
RK
6567 email:
6568 type: string
84f6e32c 6569 format: email
77b0c6b5 6570 description: email of the user, used for login or service communications
1f20622f
C
6571 displayName:
6572 type: string
77b0c6b5 6573 description: editable name of the user, displayed in its representations
84f6e32c
RK
6574 minLength: 1
6575 maxLength: 120
1f20622f
C
6576 channel:
6577 type: object
77b0c6b5 6578 description: channel base information used to create the first channel of the user
1f20622f
C
6579 properties:
6580 name:
b8375da9 6581 $ref: '#/components/schemas/usernameChannel'
1f20622f 6582 displayName:
77b0c6b5 6583 $ref: '#/components/schemas/VideoChannel/properties/displayName'
3e9e6f2f
RK
6584 required:
6585 - username
6586 - password
6587 - email
4302058c 6588
e2464d22
RK
6589 OAuthClient:
6590 properties:
6591 client_id:
6592 type: string
6593 pattern: /^[a-z0-9]$/
6594 maxLength: 32
6595 minLength: 32
6596 example: v1ikx5hnfop4mdpnci8nsqh93c45rldf
6597 client_secret:
6598 type: string
6599 pattern: /^[a-zA-Z0-9]$/
6600 maxLength: 32
6601 minLength: 32
6602 example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt
6603 OAuthToken-password:
6604 allOf:
6605 - $ref: '#/components/schemas/OAuthClient'
6606 - type: object
6607 properties:
6608 grant_type:
6609 type: string
6610 enum:
6611 - password
6612 - refresh_token
6613 default: password
6614 username:
6615 $ref: '#/components/schemas/User/properties/username'
6616 password:
6617 $ref: '#/components/schemas/password'
6618 required:
6619 - client_id
6620 - client_secret
6621 - grant_type
6622 - username
6623 - password
6624 OAuthToken-refresh_token:
6625 allOf:
6626 - $ref: '#/components/schemas/OAuthClient'
6627 - type: object
6628 properties:
6629 grant_type:
6630 type: string
6631 enum:
6632 - password
6633 - refresh_token
6634 default: password
6635 refresh_token:
6636 type: string
6637 example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7
6638 required:
6639 - client_id
6640 - client_secret
6641 - grant_type
6642 - refresh_token
6643
b8375da9 6644 VideoChannel:
3e9e6f2f 6645 properties:
b8375da9 6646 # GET/POST/PUT properties
7d14d4d2
C
6647 displayName:
6648 type: string
77b0c6b5 6649 description: editable name of the channel, displayed in its representations
b8375da9 6650 example: Videos of Framasoft
4302058c
RK
6651 minLength: 1
6652 maxLength: 120
3e9e6f2f
RK
6653 description:
6654 type: string
b8375da9 6655 example: Videos made with <3 by Framasoft
4302058c
RK
6656 minLength: 3
6657 maxLength: 1000
7d14d4d2
C
6658 support:
6659 type: string
b8375da9 6660 description: text shown by default on all videos of this channel, to tell the audience how to support it
9a320a06 6661 example: Please support our work on https://soutenir.framasoft.org/en/ <3
4302058c
RK
6662 minLength: 3
6663 maxLength: 1000
b8375da9
RK
6664 # GET-only properties
6665 id:
6666 readOnly: true
6667 allOf:
6668 - $ref: '#/components/schemas/id'
6669 isLocal:
6670 readOnly: true
6671 type: boolean
6672 updatedAt:
6673 readOnly: true
6674 type: string
6675 format: date-time
6676 ownerAccount:
6677 readOnly: true
6678 nullable: true
6679 type: object
6680 properties:
6681 id:
6682 type: integer
6683 uuid:
6684 $ref: '#/components/schemas/UUIDv4'
4302058c
RK
6685 VideoChannelCreate:
6686 allOf:
b8375da9 6687 - $ref: '#/components/schemas/VideoChannel'
4302058c
RK
6688 - properties:
6689 name:
b8375da9
RK
6690 description: username of the channel to create
6691 allOf:
6692 - $ref: '#/components/schemas/usernameChannel'
7d14d4d2
C
6693 required:
6694 - name
6695 - displayName
6696 VideoChannelUpdate:
4302058c 6697 allOf:
b8375da9 6698 - $ref: '#/components/schemas/VideoChannel'
4302058c
RK
6699 - properties:
6700 bulkVideosSupportUpdate:
6701 type: boolean
b8375da9 6702 description: Update the support field for all videos of this channel
045bcd0d
RK
6703 VideoChannelList:
6704 properties:
6705 total:
6706 type: integer
6707 example: 1
6708 data:
6709 type: array
6710 items:
6711 allOf:
6712 - $ref: '#/components/schemas/VideoChannel'
6713 - $ref: '#/components/schemas/Actor'
1569a818 6714
06746a8b
RK
6715 MRSSPeerLink:
6716 type: object
6717 xml:
6718 name: 'media:peerLink'
6719 properties:
6720 href:
6721 type: string
6722 xml:
6723 attribute: true
6724 type:
6725 type: string
6726 enum:
6727 - application/x-bittorrent
6728 xml:
6729 attribute: true
6730 MRSSGroupContent:
6731 type: object
6732 xml:
6733 name: 'media:content'
6734 properties:
6735 url:
6736 type: string
84f6e32c 6737 format: url
06746a8b
RK
6738 xml:
6739 attribute: true
6740 fileSize:
6741 type: integer
6742 xml:
6743 attribute: true
6744 type:
6745 type: string
6746 xml:
6747 attribute: true
6748 framerate:
6749 type: integer
6750 xml:
6751 attribute: true
6752 duration:
6753 type: integer
6754 xml:
6755 attribute: true
6756 height:
6757 type: integer
6758 xml:
6759 attribute: true
6760 lang:
6761 type: string
6762 xml:
6763 attribute: true
6764 VideoCommentsForXML:
6765 type: array
6766 xml:
6767 wrapped: true
6768 name: 'channel'
6769 items:
6770 type: object
6771 xml:
6772 name: 'item'
6773 properties:
6774 link:
6775 type: string
84f6e32c 6776 format: url
06746a8b
RK
6777 guid:
6778 type: string
6779 pubDate:
6780 type: string
6781 format: date-time
6782 'content:encoded':
6783 type: string
6784 'dc:creator':
6785 type: string
6786 VideosForXML:
6787 type: array
6788 xml:
6789 wrapped: true
6790 name: 'channel'
6791 items:
6792 type: object
6793 xml:
6794 name: 'item'
6795 properties:
6796 link:
6797 type: string
84f6e32c 6798 format: url
06746a8b
RK
6799 description: video watch page URL
6800 guid:
6801 type: string
6802 description: video canonical URL
6803 pubDate:
6804 type: string
6805 format: date-time
6806 description: video publication date
6807 description:
6808 type: string
6809 description: video description
6810 'content:encoded':
6811 type: string
6812 description: video description
6813 'dc:creator':
6814 type: string
6815 description: publisher user name
6816 'media:category':
6817 type: integer
6818 description: video category (MRSS)
6819 'media:community':
6820 type: object
6821 description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
6822 properties:
6823 'media:statistics':
6824 type: object
6825 properties:
6826 views:
6827 type: integer
6828 xml:
6829 attribute: true
6830 'media:embed':
6831 type: object
6832 properties:
6833 url:
6834 type: string
84f6e32c 6835 format: url
06746a8b
RK
6836 description: video embed path, relative to the canonical URL domain (MRSS)
6837 xml:
6838 attribute: true
6839 'media:player':
6840 type: object
6841 properties:
6842 url:
6843 type: string
84f6e32c 6844 format: url
06746a8b
RK
6845 description: video watch path, relative to the canonical URL domain (MRSS)
6846 xml:
6847 attribute: true
6848 'media:thumbnail':
6849 type: object
6850 properties:
6851 url:
6852 type: string
84f6e32c 6853 format: url
06746a8b
RK
6854 xml:
6855 attribute: true
6856 height:
6857 type: integer
6858 xml:
6859 attribute: true
6860 width:
6861 type: integer
6862 xml:
6863 attribute: true
6864 'media:title':
6865 type: string
6866 description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
6867 'media:description':
6868 type: string
6869 'media:rating':
6870 type: string
6871 enum:
6872 - nonadult
6873 - adult
6874 description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
6875 'enclosure':
6876 type: object
6877 description: main streamable file for the video
6878 properties:
6879 url:
6880 type: string
84f6e32c 6881 format: url
06746a8b
RK
6882 xml:
6883 attribute: true
6884 type:
6885 type: string
6886 enum:
6887 - application/x-bittorrent
6888 xml:
6889 attribute: true
6890 length:
6891 type: integer
6892 xml:
6893 attribute: true
6894 'media:group':
6895 type: array
6896 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)
6897 items:
6898 anyOf:
6899 - $ref: '#/components/schemas/MRSSPeerLink'
f4d59981
RK
6900 - $ref: '#/components/schemas/MRSSGroupContent'
6901 NotificationSettingValue:
6902 type: integer
6903 description: >
6904 Notification type
84f6e32c 6905
f4d59981 6906 - `0` NONE
84f6e32c 6907
f4d59981 6908 - `1` WEB
84f6e32c 6909
f4d59981
RK
6910 - `2` EMAIL
6911 enum:
6912 - 0
6913 - 1
6914 - 3
6915 Notification:
6916 properties:
6917 id:
b8375da9 6918 $ref: '#/components/schemas/id'
f4d59981
RK
6919 type:
6920 type: integer
6921 description: >
6922 Notification type, following the `UserNotificationType` enum:
84f6e32c 6923
f4d59981 6924 - `1` NEW_VIDEO_FROM_SUBSCRIPTION
84f6e32c 6925
f4d59981 6926 - `2` NEW_COMMENT_ON_MY_VIDEO
84f6e32c 6927
310b5219 6928 - `3` NEW_ABUSE_FOR_MODERATORS
84f6e32c 6929
f4d59981 6930 - `4` BLACKLIST_ON_MY_VIDEO
84f6e32c 6931
f4d59981 6932 - `5` UNBLACKLIST_ON_MY_VIDEO
84f6e32c 6933
f4d59981 6934 - `6` MY_VIDEO_PUBLISHED
84f6e32c 6935
f4d59981 6936 - `7` MY_VIDEO_IMPORT_SUCCESS
84f6e32c 6937
f4d59981 6938 - `8` MY_VIDEO_IMPORT_ERROR
84f6e32c 6939
f4d59981 6940 - `9` NEW_USER_REGISTRATION
84f6e32c 6941
f4d59981 6942 - `10` NEW_FOLLOW
84f6e32c 6943
f4d59981 6944 - `11` COMMENT_MENTION
84f6e32c 6945
f4d59981 6946 - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
84f6e32c 6947
f4d59981 6948 - `13` NEW_INSTANCE_FOLLOWER
84f6e32c 6949
f4d59981
RK
6950 - `14` AUTO_INSTANCE_FOLLOWING
6951 read:
6952 type: boolean
6953 video:
6954 nullable: true
6955 allOf:
6956 - $ref: '#/components/schemas/VideoInfo'
6957 - type: object
6958 properties:
6959 channel:
6960 $ref: '#/components/schemas/ActorInfo'
6961 videoImport:
6962 nullable: true
6963 type: object
6964 properties:
6965 id:
b8375da9 6966 $ref: '#/components/schemas/id'
f4d59981
RK
6967 video:
6968 nullable: true
6969 $ref: '#/components/schemas/VideoInfo'
6970 torrentName:
6971 type: string
6972 nullable: true
6973 magnetUri:
2c4876f2 6974 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
f4d59981
RK
6975 targetUri:
6976 type: string
84f6e32c 6977 format: uri
f4d59981
RK
6978 nullable: true
6979 comment:
6980 nullable: true
6981 type: object
6982 properties:
6983 id:
b8375da9 6984 $ref: '#/components/schemas/id'
f4d59981
RK
6985 threadId:
6986 type: integer
6987 video:
6988 $ref: '#/components/schemas/VideoInfo'
6989 account:
6990 $ref: '#/components/schemas/ActorInfo'
6991 videoAbuse:
6992 nullable: true
6993 type: object
6994 properties:
6995 id:
b8375da9 6996 $ref: '#/components/schemas/id'
f4d59981
RK
6997 video:
6998 allOf:
6999 - $ref: '#/components/schemas/VideoInfo'
7000 videoBlacklist:
7001 nullable: true
7002 type: object
7003 properties:
7004 id:
b8375da9 7005 $ref: '#/components/schemas/id'
f4d59981
RK
7006 video:
7007 allOf:
7008 - $ref: '#/components/schemas/VideoInfo'
7009 account:
7010 nullable: true
7011 allOf:
7012 - $ref: '#/components/schemas/ActorInfo'
7013 actorFollow:
7014 type: object
7015 nullable: true
7016 properties:
7017 id:
b8375da9 7018 $ref: '#/components/schemas/id'
f4d59981
RK
7019 follower:
7020 $ref: '#/components/schemas/ActorInfo'
7021 state:
7022 type: string
7023 enum:
7024 - pending
7025 - accepted
7026 following:
7027 type: object
7028 properties:
7029 type:
7030 type: string
7031 enum:
7032 - account
7033 - channel
7034 - instance
7035 name:
7036 type: string
7037 displayName:
7038 type: string
7039 host:
7040 type: string
84f6e32c 7041 format: hostname
f4d59981
RK
7042 createdAt:
7043 type: string
7044 format: date-time
7045 updatedAt:
7046 type: string
7047 format: date-time
7048 NotificationListResponse:
7049 properties:
7050 total:
7051 type: integer
84f6e32c 7052 example: 1
f4d59981
RK
7053 data:
7054 type: array
84f6e32c 7055 maxItems: 100
f4d59981 7056 items:
7461d440
RK
7057 $ref: '#/components/schemas/Notification'
7058 Plugin:
7059 properties:
7060 name:
7061 type: string
84f6e32c 7062 example: peertube-plugin-auth-ldap
7461d440
RK
7063 type:
7064 type: integer
84f6e32c
RK
7065 description: >
7066 - `1`: PLUGIN
7067
7068 - `2`: THEME
7461d440
RK
7069 enum:
7070 - 1
7071 - 2
7072 latestVersion:
7073 type: string
84f6e32c 7074 example: 0.0.3
7461d440
RK
7075 version:
7076 type: string
84f6e32c 7077 example: 0.0.1
7461d440
RK
7078 enabled:
7079 type: boolean
7080 uninstalled:
7081 type: boolean
7082 peertubeEngine:
7083 type: string
84f6e32c 7084 example: 2.2.0
7461d440
RK
7085 description:
7086 type: string
7087 homepage:
7088 type: string
84f6e32c
RK
7089 format: url
7090 example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap
7461d440
RK
7091 settings:
7092 type: object
7093 additionalProperties: true
7094 createdAt:
7095 type: string
7096 format: date-time
7097 updatedAt:
7098 type: string
7099 format: date-time
7100 PluginResponse:
7101 properties:
7102 total:
7103 type: integer
84f6e32c 7104 example: 1
7461d440
RK
7105 data:
7106 type: array
84f6e32c 7107 maxItems: 100
7461d440 7108 items:
2c318664 7109 $ref: '#/components/schemas/Plugin'
4e239e35
C
7110
7111 LiveVideoUpdate:
7112 properties:
7113 saveReplay:
7114 type: boolean
bb4ba6d9
C
7115 permanentLive:
7116 description: User can stream multiple times in a permanent live
7117 type: boolean
4e239e35
C
7118
7119 LiveVideoResponse:
7120 properties:
7121 rtmpUrl:
7122 type: string
7123 streamKey:
7124 type: string
7125 description: RTMP stream key to use to stream into this live video
7126 saveReplay:
7127 type: boolean
bb4ba6d9
C
7128 permanentLive:
7129 description: User can stream multiple times in a permanent live
7130 type: boolean
4e239e35 7131
75cba40d
C
7132
7133
2c318664
RK
7134 callbacks:
7135 searchIndex:
c00f96ce 7136 'https://search.example.org/api/v1/search/videos':
2c318664
RK
7137 post:
7138 summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`
7139 responses:
7140 '200':
7141 description: successful operation
7142 content:
7143 application/json:
7144 schema:
1e904cde 7145 $ref: '#/components/schemas/VideoListResponse'