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