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