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