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