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