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