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