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