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