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