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