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