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