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