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