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