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