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