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