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