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