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