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