]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/doc/api/openapi.yaml
fd227353d91251ec3617a37178645ff73c2ec4eb
[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 description: Timestamp in the video that marks the beginning of the report
1980 minimum: 0
1981 endAt:
1982 type: integer
1983 description: Timestamp in the video that marks the ending of the report
1984 minimum: 0
1985 comment:
1986 type: object
1987 properties:
1988 id:
1989 description: Comment id to report
1990 allOf:
1991 - $ref: '#/components/schemas/VideoComment/properties/id'
1992 account:
1993 type: object
1994 properties:
1995 id:
1996 description: Account id to report
1997 type: integer
1998 required:
1999 - reason
2000 responses:
2001 '204':
2002 description: successful operation
2003 '400':
2004 description: incorrect request parameters
2005 '/abuses/{abuseId}':
2006 put:
2007 summary: Update an abuse
2008 security:
2009 - OAuth2:
2010 - admin
2011 - moderator
2012 tags:
2013 - Abuses
2014 parameters:
2015 - $ref: '#/components/parameters/abuseId'
2016 requestBody:
2017 content:
2018 application/json:
2019 schema:
2020 type: object
2021 properties:
2022 state:
2023 $ref: '#/components/schemas/AbuseStateSet'
2024 moderationComment:
2025 type: string
2026 description: Update the report comment visible only to the moderation team
2027 minLength: 2
2028 maxLength: 3000
2029 responses:
2030 '204':
2031 description: successful operation
2032 '404':
2033 description: abuse not found
2034 delete:
2035 tags:
2036 - Abuses
2037 summary: Delete an abuse
2038 security:
2039 - OAuth2:
2040 - admin
2041 - moderator
2042 parameters:
2043 - $ref: '#/components/parameters/abuseId'
2044 responses:
2045 '204':
2046 description: successful operation
2047 '404':
2048 description: block not found
2049 '/abuses/{abuseId}/messages':
2050 get:
2051 summary: List messages of an abuse
2052 security:
2053 - OAuth2: []
2054 tags:
2055 - Abuses
2056 parameters:
2057 - $ref: '#/components/parameters/abuseId'
2058 responses:
2059 '200':
2060 description: successful operation
2061 content:
2062 application/json:
2063 schema:
2064 type: array
2065 items:
2066 $ref: '#/components/schemas/AbuseMessage'
2067
2068 post:
2069 summary: Add message to an abuse
2070 security:
2071 - OAuth2: []
2072 tags:
2073 - Abuses
2074 parameters:
2075 - $ref: '#/components/parameters/abuseId'
2076 requestBody:
2077 required: true
2078 content:
2079 application/json:
2080 schema:
2081 type: object
2082 properties:
2083 message:
2084 description: Message to send
2085 type: string
2086 minLength: 2
2087 maxLength: 3000
2088 required:
2089 - message
2090 responses:
2091 '200':
2092 description: successful operation
2093 '400':
2094 description: incorrect request parameters
2095 '/abuses/{abuseId}/messages/{abuseMessageId}':
2096 delete:
2097 summary: Delete an abuse message
2098 security:
2099 - OAuth2: []
2100 tags:
2101 - Abuses
2102 parameters:
2103 - $ref: '#/components/parameters/abuseId'
2104 - $ref: '#/components/parameters/abuseMessageId'
2105 responses:
2106 '204':
2107 description: successful operation
2108
2109 '/videos/{id}/blacklist':
2110 post:
2111 summary: Block a video
2112 security:
2113 - OAuth2:
2114 - admin
2115 - moderator
2116 tags:
2117 - Video Blocks
2118 parameters:
2119 - $ref: '#/components/parameters/idOrUUID'
2120 responses:
2121 '204':
2122 description: successful operation
2123 delete:
2124 summary: Unblock a video by its id
2125 security:
2126 - OAuth2:
2127 - admin
2128 - moderator
2129 tags:
2130 - Video Blocks
2131 parameters:
2132 - $ref: '#/components/parameters/idOrUUID'
2133 responses:
2134 '204':
2135 description: successful operation
2136 '404':
2137 description: block not found
2138 /videos/blacklist:
2139 get:
2140 tags:
2141 - Video Blocks
2142 summary: List video blocks
2143 security:
2144 - OAuth2:
2145 - admin
2146 - moderator
2147 parameters:
2148 - name: type
2149 in: query
2150 description: >
2151 list only blocks that match this type:
2152
2153 - `1`: manual block
2154
2155 - `2`: automatic block that needs review
2156 schema:
2157 type: integer
2158 enum:
2159 - 1
2160 - 2
2161 - name: search
2162 in: query
2163 description: plain search that will match with video titles, and more
2164 schema:
2165 type: string
2166 - $ref: '#/components/parameters/start'
2167 - $ref: '#/components/parameters/count'
2168 - $ref: '#/components/parameters/blacklistsSort'
2169 responses:
2170 '200':
2171 description: successful operation
2172 content:
2173 application/json:
2174 schema:
2175 type: object
2176 properties:
2177 total:
2178 type: integer
2179 example: 1
2180 data:
2181 type: array
2182 items:
2183 $ref: '#/components/schemas/VideoBlacklist'
2184 /videos/{id}/captions:
2185 get:
2186 summary: List captions of a video
2187 tags:
2188 - Video Captions
2189 parameters:
2190 - $ref: '#/components/parameters/idOrUUID'
2191 responses:
2192 '200':
2193 description: successful operation
2194 content:
2195 application/json:
2196 schema:
2197 type: object
2198 properties:
2199 total:
2200 type: integer
2201 example: 1
2202 data:
2203 type: array
2204 items:
2205 $ref: '#/components/schemas/VideoCaption'
2206 /videos/{id}/captions/{captionLanguage}:
2207 put:
2208 summary: Add or replace a video caption
2209 security:
2210 - OAuth2:
2211 - user
2212 tags:
2213 - Video Captions
2214 parameters:
2215 - $ref: '#/components/parameters/idOrUUID'
2216 - $ref: '#/components/parameters/captionLanguage'
2217 requestBody:
2218 content:
2219 multipart/form-data:
2220 schema:
2221 type: object
2222 properties:
2223 captionfile:
2224 description: The file to upload.
2225 type: string
2226 format: binary
2227 encoding:
2228 captionfile:
2229 contentType: text/vtt, application/x-subrip, text/plain
2230 responses:
2231 '204':
2232 description: successful operation
2233 '404':
2234 description: video or language not found
2235 delete:
2236 summary: Delete a video caption
2237 security:
2238 - OAuth2:
2239 - user
2240 tags:
2241 - Video Captions
2242 parameters:
2243 - $ref: '#/components/parameters/idOrUUID'
2244 - $ref: '#/components/parameters/captionLanguage'
2245 responses:
2246 '204':
2247 description: successful operation
2248 '404':
2249 description: video or language or caption for that language not found
2250 /video-channels:
2251 get:
2252 summary: List video channels
2253 operationId: getVideoChannels
2254 tags:
2255 - Video Channels
2256 parameters:
2257 - $ref: '#/components/parameters/start'
2258 - $ref: '#/components/parameters/count'
2259 - $ref: '#/components/parameters/sort'
2260 responses:
2261 '200':
2262 description: successful operation
2263 content:
2264 application/json:
2265 schema:
2266 $ref: '#/components/schemas/VideoChannelList'
2267 post:
2268 summary: Create a video channel
2269 operationId: createVideoChannel
2270 security:
2271 - OAuth2: []
2272 tags:
2273 - Video Channels
2274 responses:
2275 '204':
2276 description: successful operation
2277 content:
2278 application/json:
2279 schema:
2280 type: object
2281 properties:
2282 videoChannel:
2283 type: object
2284 properties:
2285 id:
2286 $ref: '#/components/schemas/VideoChannel/properties/id'
2287 requestBody:
2288 content:
2289 application/json:
2290 schema:
2291 $ref: '#/components/schemas/VideoChannelCreate'
2292 '/video-channels/{channelHandle}':
2293 get:
2294 summary: Get a video channel
2295 operationId: getVideoChannel
2296 tags:
2297 - Video Channels
2298 parameters:
2299 - $ref: '#/components/parameters/channelHandle'
2300 responses:
2301 '200':
2302 description: successful operation
2303 content:
2304 application/json:
2305 schema:
2306 $ref: '#/components/schemas/VideoChannel'
2307 put:
2308 summary: Update a video channel
2309 security:
2310 - OAuth2: []
2311 tags:
2312 - Video Channels
2313 parameters:
2314 - $ref: '#/components/parameters/channelHandle'
2315 responses:
2316 '204':
2317 description: successful operation
2318 requestBody:
2319 content:
2320 application/json:
2321 schema:
2322 $ref: '#/components/schemas/VideoChannelUpdate'
2323 delete:
2324 summary: Delete a video channel
2325 security:
2326 - OAuth2: []
2327 tags:
2328 - Video Channels
2329 parameters:
2330 - $ref: '#/components/parameters/channelHandle'
2331 responses:
2332 '204':
2333 description: successful operation
2334 '/video-channels/{channelHandle}/videos':
2335 get:
2336 summary: List videos of a video channel
2337 tags:
2338 - Video
2339 - Video Channels
2340 parameters:
2341 - $ref: '#/components/parameters/channelHandle'
2342 - $ref: '#/components/parameters/categoryOneOf'
2343 - $ref: '#/components/parameters/isLive'
2344 - $ref: '#/components/parameters/tagsOneOf'
2345 - $ref: '#/components/parameters/tagsAllOf'
2346 - $ref: '#/components/parameters/licenceOneOf'
2347 - $ref: '#/components/parameters/languageOneOf'
2348 - $ref: '#/components/parameters/nsfw'
2349 - $ref: '#/components/parameters/filter'
2350 - $ref: '#/components/parameters/skipCount'
2351 - $ref: '#/components/parameters/start'
2352 - $ref: '#/components/parameters/count'
2353 - $ref: '#/components/parameters/videosSort'
2354 responses:
2355 '200':
2356 description: successful operation
2357 content:
2358 application/json:
2359 schema:
2360 $ref: '#/components/schemas/VideoListResponse'
2361 '/video-channels/{channelHandle}/avatar/pick':
2362 post:
2363 summary: Update channel avatar
2364 security:
2365 - OAuth2: []
2366 tags:
2367 - Video Channels
2368 parameters:
2369 - $ref: '#/components/parameters/channelHandle'
2370 responses:
2371 '200':
2372 description: successful operation
2373 content:
2374 application/json:
2375 schema:
2376 type: object
2377 properties:
2378 avatar:
2379 $ref: '#/components/schemas/ActorImage'
2380 '413':
2381 description: image file too large
2382 headers:
2383 X-File-Maximum-Size:
2384 schema:
2385 type: string
2386 format: Nginx size
2387 description: Maximum file size for the avatar
2388 requestBody:
2389 content:
2390 multipart/form-data:
2391 schema:
2392 type: object
2393 properties:
2394 avatarfile:
2395 description: The file to upload.
2396 type: string
2397 format: binary
2398 encoding:
2399 avatarfile:
2400 contentType: image/png, image/jpeg
2401 '/video-channels/{channelHandle}/avatar':
2402 delete:
2403 summary: Delete channel avatar
2404 security:
2405 - OAuth2: []
2406 tags:
2407 - Video Channels
2408 parameters:
2409 - $ref: '#/components/parameters/channelHandle'
2410 responses:
2411 '204':
2412 description: successful operation
2413
2414
2415 '/video-channels/{channelHandle}/banner/pick':
2416 post:
2417 summary: Update channel banner
2418 security:
2419 - OAuth2: []
2420 tags:
2421 - Video Channels
2422 parameters:
2423 - $ref: '#/components/parameters/channelHandle'
2424 responses:
2425 '200':
2426 description: successful operation
2427 content:
2428 application/json:
2429 schema:
2430 type: object
2431 properties:
2432 banner:
2433 $ref: '#/components/schemas/ActorImage'
2434 '413':
2435 description: image file too large
2436 headers:
2437 X-File-Maximum-Size:
2438 schema:
2439 type: string
2440 format: Nginx size
2441 description: Maximum file size for the banner
2442 requestBody:
2443 content:
2444 multipart/form-data:
2445 schema:
2446 type: object
2447 properties:
2448 bannerfile:
2449 description: The file to upload.
2450 type: string
2451 format: binary
2452 encoding:
2453 bannerfile:
2454 contentType: image/png, image/jpeg
2455 '/video-channels/{channelHandle}/banner':
2456 delete:
2457 summary: Delete channel banner
2458 security:
2459 - OAuth2: []
2460 tags:
2461 - Video Channels
2462 parameters:
2463 - $ref: '#/components/parameters/channelHandle'
2464 responses:
2465 '204':
2466 description: successful operation
2467
2468 /video-playlists/privacies:
2469 get:
2470 summary: List available playlist privacy policies
2471 operationId: getPlaylistPrivacyPolicies
2472 tags:
2473 - Video Playlists
2474 responses:
2475 '200':
2476 description: successful operation
2477 content:
2478 application/json:
2479 schema:
2480 type: array
2481 items:
2482 type: string
2483 examples:
2484 nightly:
2485 externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies
2486
2487 /video-playlists:
2488 get:
2489 summary: List video playlists
2490 operationId: getPlaylists
2491 tags:
2492 - Video Playlists
2493 parameters:
2494 - $ref: '#/components/parameters/start'
2495 - $ref: '#/components/parameters/count'
2496 - $ref: '#/components/parameters/sort'
2497 responses:
2498 '200':
2499 description: successful operation
2500 content:
2501 application/json:
2502 schema:
2503 type: object
2504 properties:
2505 total:
2506 type: integer
2507 example: 1
2508 data:
2509 type: array
2510 items:
2511 $ref: '#/components/schemas/VideoPlaylist'
2512 post:
2513 summary: Create a video playlist
2514 description: If the video playlist is set as public, `videoChannelId` is mandatory.
2515 operationId: createPlaylist
2516 security:
2517 - OAuth2: []
2518 tags:
2519 - Video Playlists
2520 responses:
2521 '200':
2522 description: successful operation
2523 content:
2524 application/json:
2525 schema:
2526 type: object
2527 properties:
2528 videoPlaylist:
2529 type: object
2530 properties:
2531 id:
2532 $ref: '#/components/schemas/VideoPlaylist/properties/id'
2533 uuid:
2534 $ref: '#/components/schemas/VideoPlaylist/properties/uuid'
2535 requestBody:
2536 content:
2537 multipart/form-data:
2538 schema:
2539 type: object
2540 properties:
2541 displayName:
2542 description: Video playlist display name
2543 type: string
2544 minLength: 1
2545 maxLength: 120
2546 thumbnailfile:
2547 description: Video playlist thumbnail file
2548 type: string
2549 format: binary
2550 privacy:
2551 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2552 description:
2553 description: Video playlist description
2554 type: string
2555 minLength: 3
2556 maxLength: 1000
2557 videoChannelId:
2558 allOf:
2559 - $ref: '#/components/schemas/id'
2560 description: Video channel in which the playlist will be published
2561 required:
2562 - displayName
2563 encoding:
2564 thumbnailfile:
2565 contentType: image/jpeg
2566
2567 /video-playlists/{id}:
2568 get:
2569 summary: Get a video playlist
2570 tags:
2571 - Video Playlists
2572 parameters:
2573 - $ref: '#/components/parameters/idOrUUID'
2574 responses:
2575 '200':
2576 description: successful operation
2577 content:
2578 application/json:
2579 schema:
2580 $ref: '#/components/schemas/VideoPlaylist'
2581 put:
2582 summary: Update a video playlist
2583 description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
2584 security:
2585 - OAuth2: []
2586 tags:
2587 - Video Playlists
2588 responses:
2589 '204':
2590 description: successful operation
2591 parameters:
2592 - $ref: '#/components/parameters/idOrUUID'
2593 requestBody:
2594 content:
2595 multipart/form-data:
2596 schema:
2597 type: object
2598 properties:
2599 displayName:
2600 description: Video playlist display name
2601 type: string
2602 minLength: 1
2603 maxLength: 120
2604 thumbnailfile:
2605 description: Video playlist thumbnail file
2606 type: string
2607 format: binary
2608 privacy:
2609 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2610 description:
2611 description: Video playlist description
2612 type: string
2613 videoChannelId:
2614 allOf:
2615 - $ref: '#/components/schemas/id'
2616 description: Video channel in which the playlist will be published
2617 encoding:
2618 thumbnailfile:
2619 contentType: image/jpeg
2620 delete:
2621 summary: Delete a video playlist
2622 security:
2623 - OAuth2: []
2624 tags:
2625 - Video Playlists
2626 parameters:
2627 - $ref: '#/components/parameters/idOrUUID'
2628 responses:
2629 '204':
2630 description: successful operation
2631
2632 /video-playlists/{id}/videos:
2633 get:
2634 summary: 'List videos of a playlist'
2635 tags:
2636 - Videos
2637 - Video Playlists
2638 parameters:
2639 - $ref: '#/components/parameters/idOrUUID'
2640 responses:
2641 '200':
2642 description: successful operation
2643 content:
2644 application/json:
2645 schema:
2646 $ref: '#/components/schemas/VideoListResponse'
2647 post:
2648 summary: 'Add a video in a playlist'
2649 security:
2650 - OAuth2: []
2651 tags:
2652 - Videos
2653 - Video Playlists
2654 parameters:
2655 - $ref: '#/components/parameters/idOrUUID'
2656 responses:
2657 '200':
2658 description: successful operation
2659 content:
2660 application/json:
2661 schema:
2662 type: object
2663 properties:
2664 videoPlaylistElement:
2665 type: object
2666 properties:
2667 id:
2668 type: integer
2669 requestBody:
2670 content:
2671 application/json:
2672 schema:
2673 type: object
2674 properties:
2675 videoId:
2676 allOf:
2677 - $ref: '#/components/schemas/Video/properties/id'
2678 description: Video to add in the playlist
2679 startTimestamp:
2680 type: integer
2681 description: Start the video at this specific timestamp (in seconds)
2682 stopTimestamp:
2683 type: integer
2684 description: Stop the video at this specific timestamp (in seconds)
2685 required:
2686 - videoId
2687
2688 /video-playlists/{id}/videos/reorder:
2689 post:
2690 summary: 'Reorder a playlist'
2691 security:
2692 - OAuth2: []
2693 tags:
2694 - Video Playlists
2695 parameters:
2696 - $ref: '#/components/parameters/idOrUUID'
2697 responses:
2698 '204':
2699 description: successful operation
2700 requestBody:
2701 content:
2702 application/json:
2703 schema:
2704 type: object
2705 properties:
2706 startPosition:
2707 type: integer
2708 description: 'Start position of the element to reorder'
2709 minimum: 1
2710 insertAfterPosition:
2711 type: integer
2712 description: 'New position for the block to reorder, to add the block before the first element'
2713 minimum: 0
2714 reorderLength:
2715 type: integer
2716 description: 'How many element from `startPosition` to reorder'
2717 minimum: 1
2718 required:
2719 - startPosition
2720 - insertAfterPosition
2721
2722 /video-playlists/{id}/videos/{playlistElementId}:
2723 put:
2724 summary: 'Update a playlist element'
2725 security:
2726 - OAuth2: []
2727 tags:
2728 - Video Playlists
2729 parameters:
2730 - $ref: '#/components/parameters/idOrUUID'
2731 - $ref: '#/components/parameters/playlistElementId'
2732 responses:
2733 '204':
2734 description: successful operation
2735 requestBody:
2736 content:
2737 application/json:
2738 schema:
2739 type: object
2740 properties:
2741 startTimestamp:
2742 type: integer
2743 description: 'Start the video at this specific timestamp (in seconds)'
2744 stopTimestamp:
2745 type: integer
2746 description: 'Stop the video at this specific timestamp (in seconds)'
2747 delete:
2748 summary: 'Delete an element from a playlist'
2749 security:
2750 - OAuth2: []
2751 tags:
2752 - Video Playlists
2753 parameters:
2754 - $ref: '#/components/parameters/idOrUUID'
2755 - $ref: '#/components/parameters/playlistElementId'
2756 responses:
2757 '204':
2758 description: successful operation
2759
2760 '/users/me/video-playlists/videos-exist':
2761 get:
2762 summary: 'Check video exists in my playlists'
2763 security:
2764 - OAuth2: []
2765 tags:
2766 - Video Playlists
2767 parameters:
2768 - name: videoIds
2769 in: query
2770 required: true
2771 description: The video ids to check
2772 schema:
2773 type: array
2774 items:
2775 $ref: '#/components/schemas/Video/properties/id'
2776 responses:
2777 '200':
2778 description: successful operation
2779 content:
2780 application/json:
2781 schema:
2782 type: object
2783 properties:
2784 videoId:
2785 type: array
2786 items:
2787 type: object
2788 properties:
2789 playlistElementId:
2790 type: integer
2791 playlistId:
2792 type: integer
2793 startTimestamp:
2794 type: integer
2795 stopTimestamp:
2796 type: integer
2797
2798 '/accounts/{name}/video-channels':
2799 get:
2800 summary: List video channels of an account
2801 tags:
2802 - Video Channels
2803 - Accounts
2804 parameters:
2805 - $ref: '#/components/parameters/name'
2806 - name: withStats
2807 in: query
2808 description: include view statistics for the last 30 days (only if authentified as the account user)
2809 schema:
2810 type: boolean
2811 - $ref: '#/components/parameters/start'
2812 - $ref: '#/components/parameters/count'
2813 - $ref: '#/components/parameters/sort'
2814 responses:
2815 '200':
2816 description: successful operation
2817 content:
2818 application/json:
2819 schema:
2820 $ref: '#/components/schemas/VideoChannelList'
2821 '/accounts/{name}/ratings':
2822 get:
2823 summary: List ratings of an account
2824 security:
2825 - OAuth2: []
2826 tags:
2827 - Accounts
2828 parameters:
2829 - $ref: '#/components/parameters/name'
2830 - $ref: '#/components/parameters/start'
2831 - $ref: '#/components/parameters/count'
2832 - $ref: '#/components/parameters/sort'
2833 - name: rating
2834 in: query
2835 required: false
2836 description: Optionally filter which ratings to retrieve
2837 schema:
2838 type: string
2839 enum:
2840 - like
2841 - dislike
2842 responses:
2843 '200':
2844 description: successful operation
2845 content:
2846 application/json:
2847 schema:
2848 type: array
2849 items:
2850 $ref: '#/components/schemas/VideoRating'
2851 '/videos/{id}/comment-threads':
2852 get:
2853 summary: List threads of a video
2854 tags:
2855 - Video Comments
2856 parameters:
2857 - $ref: '#/components/parameters/idOrUUID'
2858 - $ref: '#/components/parameters/start'
2859 - $ref: '#/components/parameters/count'
2860 - $ref: '#/components/parameters/commentsSort'
2861 responses:
2862 '200':
2863 description: successful operation
2864 content:
2865 application/json:
2866 schema:
2867 $ref: '#/components/schemas/CommentThreadResponse'
2868 post:
2869 summary: Create a thread
2870 security:
2871 - OAuth2: []
2872 tags:
2873 - Video Comments
2874 parameters:
2875 - $ref: '#/components/parameters/idOrUUID'
2876 responses:
2877 '200':
2878 description: successful operation
2879 content:
2880 application/json:
2881 schema:
2882 $ref: '#/components/schemas/CommentThreadPostResponse'
2883 '404':
2884 description: video does not exist
2885 requestBody:
2886 content:
2887 application/json:
2888 schema:
2889 type: object
2890 properties:
2891 text:
2892 allOf:
2893 - $ref: '#/components/schemas/VideoComment/properties/text'
2894 format: markdown
2895 maxLength: 10000
2896 required:
2897 - text
2898
2899 '/videos/{id}/comment-threads/{threadId}':
2900 get:
2901 summary: Get a thread
2902 tags:
2903 - Video Comments
2904 parameters:
2905 - $ref: '#/components/parameters/idOrUUID'
2906 - $ref: '#/components/parameters/threadId'
2907 responses:
2908 '200':
2909 description: successful operation
2910 content:
2911 application/json:
2912 schema:
2913 $ref: '#/components/schemas/VideoCommentThreadTree'
2914 '/videos/{id}/comments/{commentId}':
2915 post:
2916 summary: Reply to a thread of a video
2917 security:
2918 - OAuth2: []
2919 tags:
2920 - Video Comments
2921 parameters:
2922 - $ref: '#/components/parameters/idOrUUID'
2923 - $ref: '#/components/parameters/commentId'
2924 responses:
2925 '200':
2926 description: successful operation
2927 content:
2928 application/json:
2929 schema:
2930 $ref: '#/components/schemas/CommentThreadPostResponse'
2931 '404':
2932 description: thread or video does not exist
2933 requestBody:
2934 content:
2935 application/json:
2936 schema:
2937 type: object
2938 properties:
2939 text:
2940 allOf:
2941 - $ref: '#/components/schemas/VideoComment/properties/text'
2942 format: markdown
2943 maxLength: 10000
2944 required:
2945 - text
2946
2947 delete:
2948 summary: Delete a comment or a reply
2949 security:
2950 - OAuth2: []
2951 tags:
2952 - Video Comments
2953 parameters:
2954 - $ref: '#/components/parameters/idOrUUID'
2955 - $ref: '#/components/parameters/commentId'
2956 responses:
2957 '204':
2958 description: successful operation
2959 '403':
2960 description: cannot remove comment of another user
2961 '404':
2962 description: comment or video does not exist
2963 '409':
2964 description: comment is already deleted
2965 '/videos/{id}/rate':
2966 put:
2967 summary: Like/dislike a video
2968 security:
2969 - OAuth2: []
2970 tags:
2971 - Video Rates
2972 parameters:
2973 - $ref: '#/components/parameters/idOrUUID'
2974 requestBody:
2975 content:
2976 application/json:
2977 schema:
2978 type: object
2979 properties:
2980 rating:
2981 type: string
2982 enum:
2983 - like
2984 - dislike
2985 required:
2986 - rating
2987 responses:
2988 '204':
2989 description: successful operation
2990 '404':
2991 description: video does not exist
2992 /search/videos:
2993 get:
2994 tags:
2995 - Search
2996 summary: Search videos
2997 parameters:
2998 - name: search
2999 in: query
3000 required: true
3001 allowEmptyValue: false
3002 description: >
3003 String to search. If the user can make a remote URI search, and the string is an URI then the
3004 PeerTube instance will fetch the remote object and add it to its database. Then,
3005 you can use the REST API to fetch the complete video information and interact with it.
3006 schema:
3007 type: string
3008 - $ref: '#/components/parameters/categoryOneOf'
3009 - $ref: '#/components/parameters/isLive'
3010 - $ref: '#/components/parameters/tagsOneOf'
3011 - $ref: '#/components/parameters/tagsAllOf'
3012 - $ref: '#/components/parameters/licenceOneOf'
3013 - $ref: '#/components/parameters/languageOneOf'
3014 - $ref: '#/components/parameters/nsfw'
3015 - $ref: '#/components/parameters/filter'
3016 - $ref: '#/components/parameters/skipCount'
3017 - $ref: '#/components/parameters/start'
3018 - $ref: '#/components/parameters/count'
3019 - $ref: '#/components/parameters/searchTarget'
3020 - $ref: '#/components/parameters/videosSearchSort'
3021 - name: startDate
3022 in: query
3023 description: Get videos that are published after this date
3024 schema:
3025 type: string
3026 format: date-time
3027 - name: endDate
3028 in: query
3029 description: Get videos that are published before this date
3030 schema:
3031 type: string
3032 format: date-time
3033 - name: originallyPublishedStartDate
3034 in: query
3035 description: Get videos that are originally published after this date
3036 schema:
3037 type: string
3038 format: date-time
3039 - name: originallyPublishedEndDate
3040 in: query
3041 description: Get videos that are originally published before this date
3042 schema:
3043 type: string
3044 format: date-time
3045 - name: durationMin
3046 in: query
3047 description: Get videos that have this minimum duration
3048 schema:
3049 type: integer
3050 - name: durationMax
3051 in: query
3052 description: Get videos that have this maximum duration
3053 schema:
3054 type: integer
3055 callbacks:
3056 'searchTarget === search-index':
3057 $ref: '#/components/callbacks/searchIndex'
3058 responses:
3059 '200':
3060 description: successful operation
3061 content:
3062 application/json:
3063 schema:
3064 $ref: '#/components/schemas/VideoListResponse'
3065 '500':
3066 description: search index unavailable
3067 /search/video-channels:
3068 get:
3069 tags:
3070 - Search
3071 summary: Search channels
3072 parameters:
3073 - name: search
3074 in: query
3075 required: true
3076 description: >
3077 String to search. If the user can make a remote URI search, and the string is an URI then the
3078 PeerTube instance will fetch the remote object and add it to its database. Then,
3079 you can use the REST API to fetch the complete channel information and interact with it.
3080 schema:
3081 type: string
3082 - $ref: '#/components/parameters/start'
3083 - $ref: '#/components/parameters/count'
3084 - $ref: '#/components/parameters/searchTarget'
3085 - $ref: '#/components/parameters/sort'
3086 callbacks:
3087 'searchTarget === search-index':
3088 $ref: '#/components/callbacks/searchIndex'
3089 responses:
3090 '200':
3091 description: successful operation
3092 content:
3093 application/json:
3094 schema:
3095 $ref: '#/components/schemas/VideoChannelList'
3096 '500':
3097 description: search index unavailable
3098 /blocklist/accounts:
3099 get:
3100 tags:
3101 - Account Blocks
3102 summary: List account blocks
3103 security:
3104 - OAuth2:
3105 - admin
3106 parameters:
3107 - $ref: '#/components/parameters/start'
3108 - $ref: '#/components/parameters/count'
3109 - $ref: '#/components/parameters/sort'
3110 responses:
3111 '200':
3112 description: successful operation
3113 post:
3114 tags:
3115 - Account Blocks
3116 summary: Block an account
3117 security:
3118 - OAuth2:
3119 - admin
3120 requestBody:
3121 content:
3122 application/json:
3123 schema:
3124 type: object
3125 properties:
3126 accountName:
3127 type: string
3128 example: chocobozzz@example.org
3129 description: account to block, in the form `username@domain`
3130 required:
3131 - accountName
3132 responses:
3133 '200':
3134 description: successful operation
3135 '409':
3136 description: self-blocking forbidden
3137 '/blocklist/accounts/{accountName}':
3138 delete:
3139 tags:
3140 - Account Blocks
3141 summary: Unblock an account by its handle
3142 security:
3143 - OAuth2:
3144 - admin
3145 parameters:
3146 - name: accountName
3147 in: path
3148 required: true
3149 description: account to unblock, in the form `username@domain`
3150 schema:
3151 type: string
3152 responses:
3153 '201':
3154 description: successful operation
3155 '404':
3156 description: account or account block does not exist
3157 /blocklist/servers:
3158 get:
3159 tags:
3160 - Server Blocks
3161 summary: List server blocks
3162 security:
3163 - OAuth2:
3164 - admin
3165 parameters:
3166 - $ref: '#/components/parameters/start'
3167 - $ref: '#/components/parameters/count'
3168 - $ref: '#/components/parameters/sort'
3169 responses:
3170 '200':
3171 description: successful operation
3172 post:
3173 tags:
3174 - Server Blocks
3175 summary: Block a server
3176 security:
3177 - OAuth2:
3178 - admin
3179 requestBody:
3180 content:
3181 application/json:
3182 schema:
3183 type: object
3184 properties:
3185 host:
3186 type: string
3187 format: hostname
3188 description: server domain to block
3189 required:
3190 - host
3191 responses:
3192 '200':
3193 description: successful operation
3194 '409':
3195 description: self-blocking forbidden
3196 '/blocklist/servers/{host}':
3197 delete:
3198 tags:
3199 - Server Blocks
3200 summary: Unblock a server by its domain
3201 security:
3202 - OAuth2:
3203 - admin
3204 parameters:
3205 - name: host
3206 in: path
3207 required: true
3208 description: server domain to unblock
3209 schema:
3210 type: string
3211 format: hostname
3212 responses:
3213 '201':
3214 description: successful operation
3215 '404':
3216 description: account block does not exist
3217 /redundancy/{host}:
3218 put:
3219 tags:
3220 - Instance Redundancy
3221 summary: Update a server redundancy policy
3222 security:
3223 - OAuth2:
3224 - admin
3225 parameters:
3226 - name: host
3227 in: path
3228 required: true
3229 description: server domain to mirror
3230 schema:
3231 type: string
3232 format: hostname
3233 requestBody:
3234 content:
3235 application/json:
3236 schema:
3237 type: object
3238 properties:
3239 redundancyAllowed:
3240 type: boolean
3241 description: allow mirroring of the host's local videos
3242 required:
3243 - redundancyAllowed
3244 responses:
3245 '204':
3246 description: successful operation
3247 '404':
3248 description: server is not already known
3249 /redundancy/videos:
3250 get:
3251 tags:
3252 - Video Mirroring
3253 summary: List videos being mirrored
3254 security:
3255 - OAuth2:
3256 - admin
3257 parameters:
3258 - name: target
3259 in: query
3260 required: true
3261 description: direction of the mirror
3262 schema:
3263 type: string
3264 enum:
3265 - my-videos
3266 - remote-videos
3267 - $ref: '#/components/parameters/start'
3268 - $ref: '#/components/parameters/count'
3269 - $ref: '#/components/parameters/videoRedundanciesSort'
3270 responses:
3271 '200':
3272 description: successful operation
3273 content:
3274 application/json:
3275 schema:
3276 type: array
3277 items:
3278 $ref: '#/components/schemas/VideoRedundancy'
3279 post:
3280 tags:
3281 - Video Mirroring
3282 summary: Mirror a video
3283 security:
3284 - OAuth2:
3285 - admin
3286 requestBody:
3287 content:
3288 application/json:
3289 schema:
3290 type: object
3291 properties:
3292 videoId:
3293 $ref: '#/components/schemas/Video/properties/id'
3294 required:
3295 - videoId
3296 responses:
3297 '204':
3298 description: successful operation
3299 '400':
3300 description: cannot mirror a local video
3301 '404':
3302 description: video does not exist
3303 '409':
3304 description: video is already mirrored
3305 /redundancy/videos/{redundancyId}:
3306 delete:
3307 tags:
3308 - Video Mirroring
3309 summary: Delete a mirror done on a video
3310 security:
3311 - OAuth2:
3312 - admin
3313 parameters:
3314 - name: redundancyId
3315 in: path
3316 required: true
3317 description: id of an existing redundancy on a video
3318 schema:
3319 type: string
3320 responses:
3321 '204':
3322 description: successful operation
3323 '404':
3324 description: video redundancy not found
3325 '/feeds/video-comments.{format}':
3326 get:
3327 tags:
3328 - Feeds
3329 summary: List comments on videos
3330 parameters:
3331 - name: format
3332 in: path
3333 required: true
3334 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
3335 schema:
3336 type: string
3337 enum:
3338 - xml
3339 - rss
3340 - rss2
3341 - atom
3342 - atom1
3343 - json
3344 - json1
3345 - name: videoId
3346 in: query
3347 description: 'limit listing to a specific video'
3348 schema:
3349 type: string
3350 - name: accountId
3351 in: query
3352 description: 'limit listing to a specific account'
3353 schema:
3354 type: string
3355 - name: accountName
3356 in: query
3357 description: 'limit listing to a specific account'
3358 schema:
3359 type: string
3360 - name: videoChannelId
3361 in: query
3362 description: 'limit listing to a specific video channel'
3363 schema:
3364 type: string
3365 - name: videoChannelName
3366 in: query
3367 description: 'limit listing to a specific video channel'
3368 schema:
3369 type: string
3370 responses:
3371 '204':
3372 description: successful operation
3373 headers:
3374 Cache-Control:
3375 schema:
3376 type: string
3377 default: 'max-age=900' # 15 min cache
3378 content:
3379 application/xml:
3380 schema:
3381 $ref: '#/components/schemas/VideoCommentsForXML'
3382 examples:
3383 nightly:
3384 externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local
3385 application/rss+xml:
3386 schema:
3387 $ref: '#/components/schemas/VideoCommentsForXML'
3388 examples:
3389 nightly:
3390 externalValue: https://peertube2.cpy.re/feeds/video-comments.rss?filter=local
3391 text/xml:
3392 schema:
3393 $ref: '#/components/schemas/VideoCommentsForXML'
3394 examples:
3395 nightly:
3396 externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local
3397 application/atom+xml:
3398 schema:
3399 $ref: '#/components/schemas/VideoCommentsForXML'
3400 examples:
3401 nightly:
3402 externalValue: https://peertube2.cpy.re/feeds/video-comments.atom?filter=local
3403 application/json:
3404 schema:
3405 type: object
3406 examples:
3407 nightly:
3408 externalValue: https://peertube2.cpy.re/feeds/video-comments.json?filter=local
3409 '400':
3410 x-summary: field inconsistencies
3411 description: >
3412 Arises when:
3413 - videoId filter is mixed with a channel filter
3414 '404':
3415 description: video, video channel or account not found
3416 '406':
3417 description: accept header unsupported
3418 '/feeds/videos.{format}':
3419 get:
3420 tags:
3421 - Feeds
3422 summary: List videos
3423 parameters:
3424 - name: format
3425 in: path
3426 required: true
3427 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
3428 schema:
3429 type: string
3430 enum:
3431 - xml
3432 - rss
3433 - rss2
3434 - atom
3435 - atom1
3436 - json
3437 - json1
3438 - name: accountId
3439 in: query
3440 description: 'limit listing to a specific account'
3441 schema:
3442 type: string
3443 - name: accountName
3444 in: query
3445 description: 'limit listing to a specific account'
3446 schema:
3447 type: string
3448 - name: videoChannelId
3449 in: query
3450 description: 'limit listing to a specific video channel'
3451 schema:
3452 type: string
3453 - name: videoChannelName
3454 in: query
3455 description: 'limit listing to a specific video channel'
3456 schema:
3457 type: string
3458 - $ref: '#/components/parameters/sort'
3459 - $ref: '#/components/parameters/nsfw'
3460 - $ref: '#/components/parameters/filter'
3461 responses:
3462 '204':
3463 description: successful operation
3464 headers:
3465 Cache-Control:
3466 schema:
3467 type: string
3468 default: 'max-age=900' # 15 min cache
3469 content:
3470 application/xml:
3471 schema:
3472 $ref: '#/components/schemas/VideosForXML'
3473 examples:
3474 nightly:
3475 externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
3476 application/rss+xml:
3477 schema:
3478 $ref: '#/components/schemas/VideosForXML'
3479 examples:
3480 nightly:
3481 externalValue: https://peertube2.cpy.re/feeds/videos.rss?filter=local
3482 text/xml:
3483 schema:
3484 $ref: '#/components/schemas/VideosForXML'
3485 examples:
3486 nightly:
3487 externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
3488 application/atom+xml:
3489 schema:
3490 $ref: '#/components/schemas/VideosForXML'
3491 examples:
3492 nightly:
3493 externalValue: https://peertube2.cpy.re/feeds/videos.atom?filter=local
3494 application/json:
3495 schema:
3496 type: object
3497 examples:
3498 nightly:
3499 externalValue: https://peertube2.cpy.re/feeds/videos.json?filter=local
3500 '404':
3501 description: video channel or account not found
3502 '406':
3503 description: accept header unsupported
3504 '/feeds/subscriptions.{format}':
3505 get:
3506 tags:
3507 - Feeds
3508 - Account
3509 summary: List videos of subscriptions tied to a token
3510 parameters:
3511 - name: format
3512 in: path
3513 required: true
3514 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
3515 schema:
3516 type: string
3517 enum:
3518 - xml
3519 - rss
3520 - rss2
3521 - atom
3522 - atom1
3523 - json
3524 - json1
3525 - name: accountId
3526 in: query
3527 description: limit listing to a specific account
3528 schema:
3529 type: string
3530 required: true
3531 - name: token
3532 in: query
3533 description: private token allowing access
3534 schema:
3535 type: string
3536 required: true
3537 - $ref: '#/components/parameters/sort'
3538 - $ref: '#/components/parameters/nsfw'
3539 - $ref: '#/components/parameters/filter'
3540 responses:
3541 '204':
3542 description: successful operation
3543 headers:
3544 Cache-Control:
3545 schema:
3546 type: string
3547 default: 'max-age=900' # 15 min cache
3548 content:
3549 application/xml:
3550 schema:
3551 $ref: '#/components/schemas/VideosForXML'
3552 application/rss+xml:
3553 schema:
3554 $ref: '#/components/schemas/VideosForXML'
3555 text/xml:
3556 schema:
3557 $ref: '#/components/schemas/VideosForXML'
3558 application/atom+xml:
3559 schema:
3560 $ref: '#/components/schemas/VideosForXML'
3561 application/json:
3562 schema:
3563 type: object
3564 '406':
3565 description: accept header unsupported
3566 /plugins:
3567 get:
3568 tags:
3569 - Plugins
3570 summary: List plugins
3571 security:
3572 - OAuth2:
3573 - admin
3574 parameters:
3575 - name: pluginType
3576 in: query
3577 schema:
3578 type: integer
3579 - name: uninstalled
3580 in: query
3581 schema:
3582 type: boolean
3583 - $ref: '#/components/parameters/start'
3584 - $ref: '#/components/parameters/count'
3585 - $ref: '#/components/parameters/sort'
3586 responses:
3587 '200':
3588 description: successful operation
3589 content:
3590 application/json:
3591 schema:
3592 $ref: '#/components/schemas/PluginResponse'
3593 /plugins/available:
3594 get:
3595 tags:
3596 - Plugins
3597 summary: List available plugins
3598 security:
3599 - OAuth2:
3600 - admin
3601 parameters:
3602 - name: search
3603 in: query
3604 schema:
3605 type: string
3606 - name: pluginType
3607 in: query
3608 schema:
3609 type: integer
3610 - name: currentPeerTubeEngine
3611 in: query
3612 schema:
3613 type: string
3614 - $ref: '#/components/parameters/start'
3615 - $ref: '#/components/parameters/count'
3616 - $ref: '#/components/parameters/sort'
3617 responses:
3618 '200':
3619 description: successful operation
3620 content:
3621 application/json:
3622 schema:
3623 $ref: '#/components/schemas/PluginResponse'
3624 '503':
3625 description: plugin index unavailable
3626 /plugins/install:
3627 post:
3628 tags:
3629 - Plugins
3630 summary: Install a plugin
3631 security:
3632 - OAuth2:
3633 - admin
3634 requestBody:
3635 content:
3636 application/json:
3637 schema:
3638 oneOf:
3639 - type: object
3640 properties:
3641 npmName:
3642 type: string
3643 example: peertube-plugin-auth-ldap
3644 required:
3645 - npmName
3646 additionalProperties: false
3647 - type: object
3648 properties:
3649 path:
3650 type: string
3651 required:
3652 - path
3653 additionalProperties: false
3654 responses:
3655 '204':
3656 description: successful operation
3657 '400':
3658 description: should have either `npmName` or `path` set
3659 /plugins/update:
3660 post:
3661 tags:
3662 - Plugins
3663 summary: Update a plugin
3664 security:
3665 - OAuth2:
3666 - admin
3667 requestBody:
3668 content:
3669 application/json:
3670 schema:
3671 oneOf:
3672 - type: object
3673 properties:
3674 npmName:
3675 type: string
3676 example: peertube-plugin-auth-ldap
3677 required:
3678 - npmName
3679 additionalProperties: false
3680 - type: object
3681 properties:
3682 path:
3683 type: string
3684 required:
3685 - path
3686 additionalProperties: false
3687 responses:
3688 '204':
3689 description: successful operation
3690 '400':
3691 description: should have either `npmName` or `path` set
3692 '404':
3693 description: existing plugin not found
3694 /plugins/uninstall:
3695 post:
3696 tags:
3697 - Plugins
3698 summary: Uninstall a plugin
3699 security:
3700 - OAuth2:
3701 - admin
3702 requestBody:
3703 content:
3704 application/json:
3705 schema:
3706 type: object
3707 properties:
3708 npmName:
3709 type: string
3710 description: name of the plugin/theme in its package.json
3711 example: peertube-plugin-auth-ldap
3712 required:
3713 - npmName
3714 responses:
3715 '204':
3716 description: successful operation
3717 '404':
3718 description: existing plugin not found
3719 /plugins/{npmName}:
3720 get:
3721 tags:
3722 - Plugins
3723 summary: Get a plugin
3724 security:
3725 - OAuth2:
3726 - admin
3727 parameters:
3728 - $ref: '#/components/parameters/npmName'
3729 responses:
3730 '200':
3731 description: successful operation
3732 content:
3733 application/json:
3734 schema:
3735 $ref: '#/components/schemas/Plugin'
3736 '404':
3737 description: plugin not found
3738 /plugins/{npmName}/settings:
3739 put:
3740 tags:
3741 - Plugins
3742 summary: Set a plugin's settings
3743 security:
3744 - OAuth2:
3745 - admin
3746 parameters:
3747 - $ref: '#/components/parameters/npmName'
3748 requestBody:
3749 content:
3750 application/json:
3751 schema:
3752 type: object
3753 properties:
3754 settings:
3755 type: object
3756 additionalProperties: true
3757 responses:
3758 '204':
3759 description: successful operation
3760 '404':
3761 description: plugin not found
3762 /plugins/{npmName}/public-settings:
3763 get:
3764 tags:
3765 - Plugins
3766 summary: Get a plugin's public settings
3767 parameters:
3768 - $ref: '#/components/parameters/npmName'
3769 responses:
3770 '200':
3771 description: successful operation
3772 content:
3773 application/json:
3774 schema:
3775 type: object
3776 additionalProperties: true
3777 '404':
3778 description: plugin not found
3779 /plugins/{npmName}/registered-settings:
3780 get:
3781 tags:
3782 - Plugins
3783 summary: Get a plugin's registered settings
3784 security:
3785 - OAuth2:
3786 - admin
3787 parameters:
3788 - $ref: '#/components/parameters/npmName'
3789 responses:
3790 '200':
3791 description: successful operation
3792 content:
3793 application/json:
3794 schema:
3795 type: object
3796 additionalProperties: true
3797 '404':
3798 description: plugin not found
3799 servers:
3800 - url: 'https://peertube2.cpy.re/api/v1'
3801 description: Live Test Server (live data - latest nightly version)
3802 - url: 'https://peertube3.cpy.re/api/v1'
3803 description: Live Test Server (live data - latest RC version)
3804 - url: 'https://peertube.cpy.re/api/v1'
3805 description: Live Test Server (live data - stable version)
3806 components:
3807 parameters:
3808 start:
3809 name: start
3810 in: query
3811 required: false
3812 description: Offset used to paginate results
3813 schema:
3814 type: integer
3815 minimum: 0
3816 count:
3817 name: count
3818 in: query
3819 required: false
3820 description: "Number of items to return"
3821 schema:
3822 type: integer
3823 default: 15
3824 maximum: 100
3825 minimum: 1
3826 sort:
3827 name: sort
3828 in: query
3829 required: false
3830 description: Sort column
3831 schema:
3832 type: string
3833 example: -createdAt
3834 search:
3835 name: search
3836 in: query
3837 required: false
3838 description: Plain text search, applied to various parts of the model depending on endpoint
3839 schema:
3840 type: string
3841 searchTarget:
3842 name: searchTarget
3843 in: query
3844 required: false
3845 description: >
3846 If the administrator enabled search index support, you can override the default search target.
3847
3848
3849 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
3850 It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
3851 * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
3852 then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
3853 After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
3854 * 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
3855 the data from the origin instance API
3856 schema:
3857 type: string
3858 enum:
3859 - 'local'
3860 - 'search-index'
3861 videosSort:
3862 name: sort
3863 in: query
3864 required: false
3865 description: Sort videos by criteria
3866 schema:
3867 type: string
3868 enum:
3869 - name
3870 - -duration
3871 - -createdAt
3872 - -publishedAt
3873 - -views
3874 - -likes
3875 - -trending
3876 - -hot
3877 videosSearchSort:
3878 name: sort
3879 in: query
3880 required: false
3881 description: Sort videos by criteria
3882 schema:
3883 type: string
3884 enum:
3885 - name
3886 - -duration
3887 - -createdAt
3888 - -publishedAt
3889 - -views
3890 - -likes
3891 - -match
3892 commentsSort:
3893 name: sort
3894 in: query
3895 required: false
3896 description: Sort comments by criteria
3897 schema:
3898 type: string
3899 enum:
3900 - -createdAt
3901 - -totalReplies
3902 blacklistsSort:
3903 name: sort
3904 in: query
3905 required: false
3906 description: Sort blacklists by criteria
3907 schema:
3908 type: string
3909 enum:
3910 - -id
3911 - name
3912 - -duration
3913 - -views
3914 - -likes
3915 - -dislikes
3916 - -uuid
3917 - -createdAt
3918 usersSearch:
3919 name: search
3920 in: query
3921 required: false
3922 description: Plain text search that will match with user usernames or emails
3923 schema:
3924 type: string
3925 usersBlocked:
3926 name: blocked
3927 in: query
3928 required: false
3929 description: Filter results down to (un)banned users
3930 schema:
3931 type: boolean
3932 usersSort:
3933 name: sort
3934 in: query
3935 required: false
3936 description: Sort users by criteria
3937 schema:
3938 type: string
3939 enum:
3940 - -id
3941 - -username
3942 - -createdAt
3943 abusesSort:
3944 name: sort
3945 in: query
3946 required: false
3947 description: Sort abuses by criteria
3948 schema:
3949 type: string
3950 enum:
3951 - -id
3952 - -createdAt
3953 - -state
3954 videoRedundanciesSort:
3955 name: sort
3956 in: query
3957 required: false
3958 description: Sort abuses by criteria
3959 schema:
3960 type: string
3961 enum:
3962 - name
3963 name:
3964 name: name
3965 in: path
3966 required: true
3967 description: The username or handle of the account
3968 schema:
3969 type: string
3970 example: chocobozzz | chocobozzz@example.org
3971 id:
3972 name: id
3973 in: path
3974 required: true
3975 description: The user id
3976 schema:
3977 $ref: '#/components/schemas/id'
3978 idOrUUID:
3979 name: id
3980 in: path
3981 required: true
3982 description: The object id or uuid
3983 schema:
3984 oneOf:
3985 - $ref: '#/components/schemas/id'
3986 - $ref: '#/components/schemas/UUIDv4'
3987 playlistElementId:
3988 name: playlistElementId
3989 in: path
3990 required: true
3991 description: Playlist element id
3992 schema:
3993 $ref: '#/components/schemas/id'
3994 abuseId:
3995 name: abuseId
3996 in: path
3997 required: true
3998 description: Abuse id
3999 schema:
4000 $ref: '#/components/schemas/Abuse/properties/id'
4001 abuseMessageId:
4002 name: abuseMessageId
4003 in: path
4004 required: true
4005 description: Abuse message id
4006 schema:
4007 $ref: '#/components/schemas/AbuseMessage/properties/id'
4008 captionLanguage:
4009 name: captionLanguage
4010 in: path
4011 required: true
4012 description: The caption language
4013 schema:
4014 $ref: '#/components/schemas/VideoLanguageSet'
4015 channelHandle:
4016 name: channelHandle
4017 in: path
4018 required: true
4019 description: The video channel handle
4020 schema:
4021 type: string
4022 example: my_username | my_username@example.com
4023 subscriptionHandle:
4024 name: subscriptionHandle
4025 in: path
4026 required: true
4027 description: The subscription handle
4028 schema:
4029 type: string
4030 example: my_username | my_username@example.com
4031 threadId:
4032 name: threadId
4033 in: path
4034 required: true
4035 description: The thread id (root comment id)
4036 schema:
4037 $ref: '#/components/schemas/VideoCommentThreadTree/properties/comment/properties/id'
4038 commentId:
4039 name: commentId
4040 in: path
4041 required: true
4042 description: The comment id
4043 schema:
4044 $ref: '#/components/schemas/VideoComment/properties/id'
4045 isLive:
4046 name: isLive
4047 in: query
4048 required: false
4049 description: whether or not the video is a live
4050 schema:
4051 type: boolean
4052 categoryOneOf:
4053 name: categoryOneOf
4054 in: query
4055 required: false
4056 description: category id of the video (see [/videos/categories](#operation/getCategories))
4057 schema:
4058 oneOf:
4059 - $ref: '#/components/schemas/VideoCategorySet'
4060 - type: array
4061 items:
4062 $ref: '#/components/schemas/VideoCategorySet'
4063 style: form
4064 explode: false
4065 tagsOneOf:
4066 name: tagsOneOf
4067 in: query
4068 required: false
4069 description: tag(s) of the video
4070 schema:
4071 oneOf:
4072 - type: string
4073 - type: array
4074 maxItems: 5
4075 items:
4076 type: string
4077 style: form
4078 explode: false
4079 tagsAllOf:
4080 name: tagsAllOf
4081 in: query
4082 required: false
4083 description: tag(s) of the video, where all should be present in the video
4084 schema:
4085 oneOf:
4086 - type: string
4087 - type: array
4088 items:
4089 type: string
4090 style: form
4091 explode: false
4092 languageOneOf:
4093 name: languageOneOf
4094 in: query
4095 required: false
4096 description: language id of the video (see [/videos/languages](#operation/getLanguages)). Use `_unknown` to filter on videos that don't have a video language
4097 schema:
4098 oneOf:
4099 - $ref: '#/components/schemas/VideoLanguageSet'
4100 - type: array
4101 items:
4102 $ref: '#/components/schemas/VideoLanguageSet'
4103 style: form
4104 explode: false
4105 licenceOneOf:
4106 name: licenceOneOf
4107 in: query
4108 required: false
4109 description: licence id of the video (see [/videos/licences](#operation/getLicences))
4110 schema:
4111 oneOf:
4112 - $ref: '#/components/schemas/VideoLicenceSet'
4113 - type: array
4114 items:
4115 $ref: '#/components/schemas/VideoLicenceSet'
4116 style: form
4117 explode: false
4118 skipCount:
4119 name: skipCount
4120 in: query
4121 required: false
4122 description: if you don't need the `total` in the response
4123 schema:
4124 type: string
4125 enum:
4126 - 'true'
4127 - 'false'
4128 default: 'false'
4129 nsfw:
4130 name: nsfw
4131 in: query
4132 required: false
4133 description: whether to include nsfw videos, if any
4134 schema:
4135 type: string
4136 enum:
4137 - 'true'
4138 - 'false'
4139 filter:
4140 name: filter
4141 in: query
4142 required: false
4143 description: >
4144 Special filters which might require special rights:
4145 * `local` - only videos local to the instance
4146 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
4147 * `all` - all videos, showing private and unlisted videos (requires Admin privileges)
4148 schema:
4149 type: string
4150 enum:
4151 - local
4152 - all-local
4153 subscriptionsUris:
4154 name: uris
4155 in: query
4156 required: true
4157 description: list of uris to check if each is part of the user subscriptions
4158 schema:
4159 type: array
4160 items:
4161 type: string
4162 format: uri
4163 npmName:
4164 name: npmName
4165 in: path
4166 required: true
4167 description: name of the plugin/theme on npmjs.com or in its package.json
4168 schema:
4169 type: string
4170 example: peertube-plugin-auth-ldap
4171 jobType:
4172 name: jobType
4173 in: query
4174 required: false
4175 description: job type
4176 schema:
4177 type: string
4178 enum:
4179 - activitypub-follow
4180 - activitypub-http-broadcast
4181 - activitypub-http-fetcher
4182 - activitypub-http-unicast
4183 - email
4184 - video-transcoding
4185 - video-file-import
4186 - video-import
4187 - videos-views
4188 - activitypub-refresher
4189 - video-redundancy
4190 - video-live-ending
4191 securitySchemes:
4192 OAuth2:
4193 description: |
4194 Authenticating via OAuth requires the following steps:
4195 - Have an activated account
4196 - [Generate](https://docs.joinpeertube.org/api-rest-getting-started) a
4197 Bearer Token for that account at `/api/v1/users/token`
4198 - Make authenticated requests, putting *Authorization: Bearer <token\>*
4199 - Profit, depending on the role assigned to the account
4200
4201 Note that the __access token is valid for 1 day__ and, and is given
4202 along with a __refresh token valid for 2 weeks__.
4203 type: oauth2
4204 flows:
4205 password:
4206 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
4207 scopes:
4208 admin: Admin scope
4209 moderator: Moderator scope
4210 user: User scope
4211 schemas:
4212 # Resuable core properties
4213 id:
4214 type: integer
4215 minimum: 1
4216 example: 42
4217 UUIDv4:
4218 type: string
4219 format: uuid
4220 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4221 pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
4222 minLength: 36
4223 maxLength: 36
4224 username:
4225 type: string
4226 description: immutable name of the user, used to find or mention its actor
4227 example: chocobozzz
4228 pattern: '/^[a-z0-9._]{1,50}$/'
4229 minLength: 1
4230 maxLength: 50
4231 usernameChannel:
4232 type: string
4233 description: immutable name of the channel, used to interact with its actor
4234 example: framasoft_videos
4235 pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/'
4236 password:
4237 type: string
4238 format: password
4239 minLength: 6
4240 maxLength: 255
4241
4242 VideoCategorySet:
4243 type: integer
4244 description: category id of the video (see [/videos/categories](#operation/getCategories))
4245 example: 15
4246 VideoConstantNumber-Category:
4247 properties:
4248 id:
4249 $ref: '#/components/schemas/VideoCategorySet'
4250 label:
4251 type: string
4252 example: Science & Technology
4253
4254 VideoLicenceSet:
4255 type: integer
4256 description: licence id of the video (see [/videos/licences](#operation/getLicences))
4257 example: 2
4258 VideoConstantNumber-Licence:
4259 properties:
4260 id:
4261 $ref: '#/components/schemas/VideoLicenceSet'
4262 label:
4263 type: string
4264 example: Attribution - Share Alike
4265
4266 VideoLanguageSet:
4267 type: string
4268 description: language id of the video (see [/videos/languages](#operation/getLanguages))
4269 example: en
4270 VideoConstantString-Language:
4271 properties:
4272 id:
4273 $ref: '#/components/schemas/VideoLanguageSet'
4274 label:
4275 type: string
4276 example: English
4277
4278 VideoPlaylistPrivacySet:
4279 type: integer
4280 enum:
4281 - 1
4282 - 2
4283 - 3
4284 description: Video playlist privacy policy (see [/video-playlists/privacies])
4285 VideoPlaylistPrivacyConstant:
4286 properties:
4287 id:
4288 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
4289 label:
4290 type: string
4291
4292 VideoPlaylistTypeSet:
4293 type: integer
4294 enum:
4295 - 1
4296 - 2
4297 description: The video playlist type (Regular = `1`, Watch Later = `2`)
4298 VideoPlaylistTypeConstant:
4299 properties:
4300 id:
4301 $ref: '#/components/schemas/VideoPlaylistTypeSet'
4302 label:
4303 type: string
4304
4305 VideoPrivacySet:
4306 type: integer
4307 enum:
4308 - 1
4309 - 2
4310 - 3
4311 - 4
4312 description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies))
4313 VideoPrivacyConstant:
4314 properties:
4315 id:
4316 $ref: '#/components/schemas/VideoPrivacySet'
4317 label:
4318 type: string
4319
4320 NSFWPolicy:
4321 type: string
4322 enum:
4323 - display
4324 - blur
4325 - do_not_list
4326
4327 UserRole:
4328 type: integer
4329 enum:
4330 - 0
4331 - 1
4332 - 2
4333 description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
4334 example: 2
4335 UserAdminFlags:
4336 type: integer
4337 enum:
4338 - 0
4339 - 1
4340 description: 'Admin flags for the user (None = `0`, Bypass video blacklist = `1`)'
4341 example: 1
4342
4343 VideoStateConstant:
4344 properties:
4345 id:
4346 type: integer
4347 enum:
4348 - 1
4349 - 2
4350 - 3
4351 description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
4352 label:
4353 type: string
4354
4355 AbuseStateSet:
4356 type: integer
4357 enum:
4358 - 1
4359 - 2
4360 - 3
4361 description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)'
4362 AbuseStateConstant:
4363 properties:
4364 id:
4365 $ref: '#/components/schemas/AbuseStateSet'
4366 label:
4367 type: string
4368 AbusePredefinedReasons:
4369 type: array
4370 items:
4371 type: string
4372 enum:
4373 - violentOrAbusive
4374 - hatefulOrAbusive
4375 - spamOrMisleading
4376 - privacy
4377 - rights
4378 - serverRules
4379 - thumbnails
4380 - captions
4381 example: [spamOrMisleading]
4382
4383 VideoResolutionSet:
4384 type: integer
4385 description: |
4386 Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`)
4387
4388 `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos.
4389 example: 240
4390 VideoResolutionConstant:
4391 description: resolutions and their labels for the video
4392 properties:
4393 id:
4394 $ref: '#/components/schemas/VideoResolutionSet'
4395 label:
4396 type: string
4397 example: 240p
4398 VideoScheduledUpdate:
4399 properties:
4400 privacy:
4401 $ref: '#/components/schemas/VideoPrivacySet'
4402 updateAt:
4403 type: string
4404 format: date
4405 description: When to update the video
4406 required:
4407 - updateAt
4408 AccountSummary:
4409 properties:
4410 id:
4411 type: integer
4412 name:
4413 type: string
4414 displayName:
4415 type: string
4416 url:
4417 type: string
4418 format: url
4419 host:
4420 type: string
4421 format: hostname
4422 avatar:
4423 nullable: true
4424 allOf:
4425 - $ref: '#/components/schemas/ActorImage'
4426 VideoChannelSummary:
4427 properties:
4428 id:
4429 $ref: '#/components/schemas/id'
4430 name:
4431 type: string
4432 displayName:
4433 type: string
4434 url:
4435 type: string
4436 format: url
4437 host:
4438 type: string
4439 format: hostname
4440 avatar:
4441 nullable: true
4442 allOf:
4443 - $ref: '#/components/schemas/ActorImage'
4444 PlaylistElement:
4445 properties:
4446 position:
4447 type: integer
4448 startTimestamp:
4449 type: integer
4450 stopTimestamp:
4451 type: integer
4452 video:
4453 nullable: true
4454 allOf:
4455 - $ref: '#/components/schemas/Video'
4456 VideoFile:
4457 readOnly: true
4458 properties:
4459 magnetUri:
4460 type: string
4461 format: uri
4462 description: magnet URI allowing to resolve the video via BitTorrent without a metainfo file
4463 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
4464 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
4465 resolution:
4466 $ref: '#/components/schemas/VideoResolutionConstant'
4467 size:
4468 type: integer
4469 description: Video file size in bytes
4470 torrentUrl:
4471 type: string
4472 description: Direct URL of the torrent file
4473 format: url
4474 torrentDownloadUrl:
4475 type: string
4476 description: URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog)
4477 format: url
4478 fileUrl:
4479 type: string
4480 description: Direct URL of the video
4481 format: url
4482 fileDownloadUrl:
4483 type: string
4484 description: URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog)
4485 format: url
4486 fps:
4487 type: number
4488 description: Frames per second of the video file
4489 metadataUrl:
4490 type: string
4491 format: url
4492 description: URL dereferencing the output of ffprobe on the file
4493 VideoStreamingPlaylists:
4494 allOf:
4495 - type: object
4496 properties:
4497 id:
4498 $ref: '#/components/schemas/id'
4499 type:
4500 type: integer
4501 enum:
4502 - 1
4503 description: |
4504 Playlist type:
4505 - `1`: HLS
4506 - $ref: '#/components/schemas/VideoStreamingPlaylists-HLS'
4507 VideoStreamingPlaylists-HLS:
4508 properties:
4509 playlistUrl:
4510 type: string
4511 format: url
4512 segmentsSha256Url:
4513 type: string
4514 format: url
4515 files:
4516 type: array
4517 description: |
4518 Video files associated to this playlist.
4519
4520 The difference with the root `files` property is that these files are fragmented, so they can be used in this streaming playlist (HLS, etc.)
4521 items:
4522 $ref: '#/components/schemas/VideoFile'
4523 redundancies:
4524 type: array
4525 items:
4526 type: object
4527 properties:
4528 baseUrl:
4529 type: string
4530 format: url
4531 VideoInfo:
4532 properties:
4533 id:
4534 $ref: '#/components/schemas/Video/properties/id'
4535 uuid:
4536 $ref: '#/components/schemas/Video/properties/uuid'
4537 name:
4538 $ref: '#/components/schemas/Video/properties/name'
4539 Video:
4540 properties:
4541 id:
4542 description: object id for the video
4543 allOf:
4544 - $ref: '#/components/schemas/id'
4545 uuid:
4546 description: universal identifier for the video, that can be used across instances
4547 allOf:
4548 - $ref: '#/components/schemas/UUIDv4'
4549 isLive:
4550 type: boolean
4551 createdAt:
4552 type: string
4553 format: date-time
4554 example: 2017-10-01T10:52:46.396Z
4555 description: time at which the video object was first drafted
4556 publishedAt:
4557 type: string
4558 format: date-time
4559 example: 2018-10-01T10:52:46.396Z
4560 description: time at which the video was marked as ready for playback (with restrictions depending on `privacy`). Usually set after a `state` evolution.
4561 updatedAt:
4562 type: string
4563 format: date-time
4564 example: 2021-05-04T08:01:01.502Z
4565 description: last time the video's metadata was modified
4566 originallyPublishedAt:
4567 type: string
4568 format: date-time
4569 example: 2010-10-01T10:52:46.396Z
4570 description: used to represent a date of first publication, prior to the practical publication date of `publishedAt`
4571 category:
4572 allOf:
4573 - $ref: '#/components/schemas/VideoConstantNumber-Category'
4574 description: category in which the video is classified
4575 licence:
4576 allOf:
4577 - $ref: '#/components/schemas/VideoConstantNumber-Licence'
4578 description: licence under which the video is distributed
4579 language:
4580 allOf:
4581 - $ref: '#/components/schemas/VideoConstantString-Language'
4582 description: main language used in the video
4583 privacy:
4584 allOf:
4585 - $ref: '#/components/schemas/VideoPrivacyConstant'
4586 description: privacy policy used to distribute the video
4587 description:
4588 type: string
4589 example: |
4590 **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n
4591 **Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network, based on fr...
4592 minLength: 3
4593 maxLength: 250
4594 description: |
4595 truncated description of the video, written in Markdown.
4596 Resolve `descriptionPath` to get the full description of maximum `10000` characters.
4597 duration:
4598 type: integer
4599 example: 1419
4600 description: duration of the video in seconds
4601 isLocal:
4602 type: boolean
4603 name:
4604 type: string
4605 description: title of the video
4606 example: What is PeerTube?
4607 minLength: 3
4608 maxLength: 120
4609 thumbnailPath:
4610 type: string
4611 example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
4612 previewPath:
4613 type: string
4614 example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
4615 embedPath:
4616 type: string
4617 example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
4618 views:
4619 type: integer
4620 example: 1337
4621 likes:
4622 type: integer
4623 example: 42
4624 dislikes:
4625 type: integer
4626 example: 7
4627 nsfw:
4628 type: boolean
4629 waitTranscoding:
4630 type: boolean
4631 nullable: true
4632 state:
4633 allOf:
4634 - $ref: '#/components/schemas/VideoStateConstant'
4635 description: represents the internal state of the video processing within the PeerTube instance
4636 scheduledUpdate:
4637 nullable: true
4638 allOf:
4639 - $ref: '#/components/schemas/VideoScheduledUpdate'
4640 blacklisted:
4641 nullable: true
4642 type: boolean
4643 blacklistedReason:
4644 nullable: true
4645 type: string
4646 account:
4647 $ref: '#/components/schemas/AccountSummary'
4648 channel:
4649 $ref: '#/components/schemas/VideoChannelSummary'
4650 userHistory:
4651 nullable: true
4652 type: object
4653 properties:
4654 currentTime:
4655 type: integer
4656 VideoDetails:
4657 allOf:
4658 - $ref: '#/components/schemas/Video'
4659 - type: object
4660 properties:
4661 descriptionPath:
4662 type: string
4663 example: /api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180a6d/description
4664 description: path at which to get the full description of maximum `10000` characters
4665 support:
4666 type: string
4667 description: A text tell the audience how to support the video creator
4668 example: Please support our work on https://soutenir.framasoft.org/en/ <3
4669 minLength: 3
4670 maxLength: 1000
4671 channel:
4672 $ref: '#/components/schemas/VideoChannel'
4673 account:
4674 $ref: '#/components/schemas/Account'
4675 tags:
4676 example: [flowers, gardening]
4677 type: array
4678 minItems: 1
4679 maxItems: 5
4680 items:
4681 type: string
4682 minLength: 2
4683 maxLength: 30
4684 commentsEnabled:
4685 type: boolean
4686 downloadEnabled:
4687 type: boolean
4688 trackerUrls:
4689 type: array
4690 items:
4691 type: string
4692 format: url
4693 example:
4694 - https://peertube2.cpy.re/tracker/announce
4695 - wss://peertube2.cpy.re/tracker/socket
4696 files:
4697 type: array
4698 items:
4699 $ref: '#/components/schemas/VideoFile'
4700 description: |
4701 WebTorrent/raw video files. If WebTorrent is disabled on the server:
4702
4703 - field will be empty
4704 - video files will be found in `streamingPlaylists[].files` field
4705 streamingPlaylists:
4706 type: array
4707 items:
4708 $ref: '#/components/schemas/VideoStreamingPlaylists'
4709 description: |
4710 HLS playlists/manifest files. If HLS is disabled on the server:
4711
4712 - field will be empty
4713 - video files will be found in `files` field
4714 FileRedundancyInformation:
4715 properties:
4716 id:
4717 $ref: '#/components/schemas/id'
4718 fileUrl:
4719 type: string
4720 format: url
4721 strategy:
4722 type: string
4723 enum:
4724 - manual
4725 - most-views
4726 - trending
4727 - recently-added
4728 size:
4729 type: integer
4730 createdAt:
4731 type: string
4732 format: date-time
4733 updatedAt:
4734 type: string
4735 format: date-time
4736 expiresOn:
4737 type: string
4738 format: date-time
4739 VideoRedundancy:
4740 properties:
4741 id:
4742 $ref: '#/components/schemas/id'
4743 name:
4744 type: string
4745 url:
4746 type: string
4747 format: url
4748 uuid:
4749 $ref: '#/components/schemas/UUIDv4'
4750 redundancies:
4751 type: object
4752 properties:
4753 files:
4754 type: array
4755 items:
4756 $ref: '#/components/schemas/FileRedundancyInformation'
4757 streamingPlaylists:
4758 type: array
4759 items:
4760 $ref: '#/components/schemas/FileRedundancyInformation'
4761 VideoImportStateConstant:
4762 properties:
4763 id:
4764 type: integer
4765 enum:
4766 - 1
4767 - 2
4768 - 3
4769 description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
4770 label:
4771 type: string
4772 example: Pending
4773 VideoCreateImport:
4774 allOf:
4775 - type: object
4776 additionalProperties: false
4777 oneOf:
4778 - properties:
4779 targetUrl:
4780 $ref: '#/components/schemas/VideoImport/properties/targetUrl'
4781 required: [targetUrl]
4782 - properties:
4783 magnetUri:
4784 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
4785 required: [magnetUri]
4786 - properties:
4787 torrentfile:
4788 $ref: '#/components/schemas/VideoImport/properties/torrentfile'
4789 required: [torrentfile]
4790 - $ref: '#/components/schemas/VideoUploadRequestCommon'
4791 required:
4792 - channelId
4793 - name
4794 VideoImport:
4795 properties:
4796 id:
4797 readOnly: true
4798 allOf:
4799 - $ref: '#/components/schemas/id'
4800 targetUrl:
4801 type: string
4802 format: url
4803 description: remote URL where to find the import's source video
4804 example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
4805 magnetUri:
4806 type: string
4807 format: uri
4808 description: magnet URI allowing to resolve the import's source video
4809 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
4810 pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i
4811 torrentfile:
4812 writeOnly: true
4813 type: string
4814 format: binary
4815 description: Torrent file containing only the video file
4816 torrentName:
4817 readOnly: true
4818 type: string
4819 state:
4820 readOnly: true
4821 allOf:
4822 - $ref: '#/components/schemas/VideoImportStateConstant'
4823 error:
4824 readOnly: true
4825 type: string
4826 createdAt:
4827 readOnly: true
4828 type: string
4829 format: date-time
4830 updatedAt:
4831 readOnly: true
4832 type: string
4833 format: date-time
4834 video:
4835 readOnly: true
4836 nullable: true
4837 allOf:
4838 - $ref: '#/components/schemas/Video'
4839 VideoImportsList:
4840 properties:
4841 total:
4842 type: integer
4843 example: 1
4844 data:
4845 type: array
4846 maxItems: 100
4847 items:
4848 $ref: '#/components/schemas/VideoImport'
4849 Abuse:
4850 properties:
4851 id:
4852 $ref: '#/components/schemas/id'
4853 reason:
4854 type: string
4855 example: The video is a spam
4856 minLength: 2
4857 maxLength: 3000
4858 predefinedReasons:
4859 $ref: '#/components/schemas/AbusePredefinedReasons'
4860 reporterAccount:
4861 $ref: '#/components/schemas/Account'
4862 state:
4863 $ref: '#/components/schemas/AbuseStateConstant'
4864 moderationComment:
4865 type: string
4866 example: Decided to ban the server since it spams us regularly
4867 minLength: 2
4868 maxLength: 3000
4869 video:
4870 $ref: '#/components/schemas/VideoInfo'
4871 createdAt:
4872 type: string
4873 format: date-time
4874 AbuseMessage:
4875 properties:
4876 id:
4877 $ref: '#/components/schemas/id'
4878 message:
4879 type: string
4880 minLength: 2
4881 maxLength: 3000
4882 byModerator:
4883 type: boolean
4884 createdAt:
4885 type: string
4886 format: date-time
4887 account:
4888 $ref: '#/components/schemas/AccountSummary'
4889 VideoBlacklist:
4890 properties:
4891 id:
4892 $ref: '#/components/schemas/id'
4893 videoId:
4894 $ref: '#/components/schemas/Video/properties/id'
4895 createdAt:
4896 type: string
4897 format: date-time
4898 updatedAt:
4899 type: string
4900 format: date-time
4901 name:
4902 type: string
4903 minLength: 3
4904 maxLength: 120
4905 uuid:
4906 $ref: '#/components/schemas/UUIDv4'
4907 description:
4908 type: string
4909 minLength: 3
4910 maxLength: 10000
4911 duration:
4912 type: integer
4913 views:
4914 type: integer
4915 likes:
4916 type: integer
4917 dislikes:
4918 type: integer
4919 nsfw:
4920 type: boolean
4921 VideoPlaylist:
4922 properties:
4923 id:
4924 $ref: '#/components/schemas/id'
4925 uuid:
4926 $ref: '#/components/schemas/UUIDv4'
4927 createdAt:
4928 type: string
4929 format: date-time
4930 updatedAt:
4931 type: string
4932 format: date-time
4933 description:
4934 type: string
4935 minLength: 3
4936 maxLength: 1000
4937 displayName:
4938 type: string
4939 minLength: 1
4940 maxLength: 120
4941 isLocal:
4942 type: boolean
4943 videoLength:
4944 type: integer
4945 minimum: 0
4946 thumbnailPath:
4947 type: string
4948 privacy:
4949 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
4950 type:
4951 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
4952 ownerAccount:
4953 $ref: '#/components/schemas/AccountSummary'
4954 videoChannel:
4955 $ref: '#/components/schemas/VideoChannelSummary'
4956 VideoComment:
4957 properties:
4958 id:
4959 $ref: '#/components/schemas/id'
4960 url:
4961 type: string
4962 format: url
4963 text:
4964 type: string
4965 format: html
4966 description: Text of the comment
4967 minLength: 1
4968 example: This video is wonderful!
4969 threadId:
4970 $ref: '#/components/schemas/id'
4971 inReplyToCommentId:
4972 nullable: true
4973 allOf:
4974 - $ref: '#/components/schemas/id'
4975 videoId:
4976 $ref: '#/components/schemas/Video/properties/id'
4977 createdAt:
4978 type: string
4979 format: date-time
4980 updatedAt:
4981 type: string
4982 format: date-time
4983 deletedAt:
4984 nullable: true
4985 type: string
4986 format: date-time
4987 default: null
4988 isDeleted:
4989 type: boolean
4990 default: false
4991 totalRepliesFromVideoAuthor:
4992 type: integer
4993 minimum: 0
4994 totalReplies:
4995 type: integer
4996 minimum: 0
4997 account:
4998 $ref: '#/components/schemas/Account'
4999 VideoCommentThreadTree:
5000 properties:
5001 comment:
5002 $ref: '#/components/schemas/VideoComment'
5003 children:
5004 type: array
5005 items:
5006 $ref: '#/components/schemas/VideoCommentThreadTree'
5007 VideoCaption:
5008 properties:
5009 language:
5010 $ref: '#/components/schemas/VideoConstantString-Language'
5011 captionPath:
5012 type: string
5013 ActorImage:
5014 properties:
5015 path:
5016 type: string
5017 createdAt:
5018 type: string
5019 format: date-time
5020 updatedAt:
5021 type: string
5022 format: date-time
5023 ActorInfo:
5024 properties:
5025 id:
5026 $ref: '#/components/schemas/id'
5027 name:
5028 type: string
5029 displayName:
5030 type: string
5031 host:
5032 type: string
5033 format: hostname
5034 avatar:
5035 nullable: true
5036 type: object
5037 properties:
5038 path:
5039 type: string
5040 Actor:
5041 properties:
5042 id:
5043 $ref: '#/components/schemas/id'
5044 url:
5045 type: string
5046 format: url
5047 name:
5048 description: immutable name of the actor, used to find or mention it
5049 allOf:
5050 - $ref: '#/components/schemas/username'
5051 host:
5052 type: string
5053 format: hostname
5054 description: server on which the actor is resident
5055 hostRedundancyAllowed:
5056 type: boolean
5057 description: whether this actor's host allows redundancy of its videos
5058 followingCount:
5059 type: integer
5060 minimum: 0
5061 description: number of actors subscribed to by this actor, as seen by this instance
5062 followersCount:
5063 type: integer
5064 minimum: 0
5065 description: number of followers of this actor, as seen by this instance
5066 createdAt:
5067 type: string
5068 format: date-time
5069 updatedAt:
5070 type: string
5071 format: date-time
5072 avatar:
5073 $ref: '#/components/schemas/ActorImage'
5074 Account:
5075 allOf:
5076 - $ref: '#/components/schemas/Actor'
5077 - properties:
5078 userId:
5079 description: object id for the user tied to this account
5080 allOf:
5081 - $ref: '#/components/schemas/User/properties/id'
5082 displayName:
5083 type: string
5084 description: editable name of the account, displayed in its representations
5085 minLength: 3
5086 maxLength: 120
5087 description:
5088 type: string
5089 description: text or bio displayed on the account's profile
5090 UserWatchingVideo:
5091 properties:
5092 currentTime:
5093 type: integer
5094 description: timestamp within the video, in seconds
5095 example: 5
5096 ServerConfig:
5097 properties:
5098 instance:
5099 type: object
5100 properties:
5101 name:
5102 type: string
5103 shortDescription:
5104 type: string
5105 defaultClientRoute:
5106 type: string
5107 isNSFW:
5108 type: boolean
5109 defaultNSFWPolicy:
5110 type: string
5111 customizations:
5112 type: object
5113 properties:
5114 javascript:
5115 type: string
5116 css:
5117 type: string
5118 search:
5119 type: object
5120 properties:
5121 remoteUri:
5122 type: object
5123 properties:
5124 users:
5125 type: boolean
5126 anonymous:
5127 type: boolean
5128 plugin:
5129 type: object
5130 properties:
5131 registered:
5132 type: array
5133 items:
5134 type: string
5135 theme:
5136 type: object
5137 properties:
5138 registered:
5139 type: array
5140 items:
5141 type: string
5142 email:
5143 type: object
5144 properties:
5145 enabled:
5146 type: boolean
5147 contactForm:
5148 type: object
5149 properties:
5150 enabled:
5151 type: boolean
5152 serverVersion:
5153 type: string
5154 serverCommit:
5155 type: string
5156 signup:
5157 type: object
5158 properties:
5159 allowed:
5160 type: boolean
5161 allowedForCurrentIP:
5162 type: boolean
5163 requiresEmailVerification:
5164 type: boolean
5165 transcoding:
5166 type: object
5167 properties:
5168 hls:
5169 type: object
5170 properties:
5171 enabled:
5172 type: boolean
5173 webtorrent:
5174 type: object
5175 properties:
5176 enabled:
5177 type: boolean
5178 enabledResolutions:
5179 type: array
5180 items:
5181 $ref: '#/components/schemas/VideoResolutionSet'
5182 import:
5183 type: object
5184 properties:
5185 videos:
5186 type: object
5187 properties:
5188 http:
5189 type: object
5190 properties:
5191 enabled:
5192 type: boolean
5193 torrent:
5194 type: object
5195 properties:
5196 enabled:
5197 type: boolean
5198 autoBlacklist:
5199 type: object
5200 properties:
5201 videos:
5202 type: object
5203 properties:
5204 ofUsers:
5205 type: object
5206 properties:
5207 enabled:
5208 type: boolean
5209 avatar:
5210 type: object
5211 properties:
5212 file:
5213 type: object
5214 properties:
5215 size:
5216 type: object
5217 properties:
5218 max:
5219 type: integer
5220 extensions:
5221 type: array
5222 items:
5223 type: string
5224 video:
5225 type: object
5226 properties:
5227 image:
5228 type: object
5229 properties:
5230 extensions:
5231 type: array
5232 items:
5233 type: string
5234 size:
5235 type: object
5236 properties:
5237 max:
5238 type: integer
5239 file:
5240 type: object
5241 properties:
5242 extensions:
5243 type: array
5244 items:
5245 type: string
5246 videoCaption:
5247 type: object
5248 properties:
5249 file:
5250 type: object
5251 properties:
5252 size:
5253 type: object
5254 properties:
5255 max:
5256 type: integer
5257 extensions:
5258 type: array
5259 items:
5260 type: string
5261 user:
5262 type: object
5263 properties:
5264 videoQuota:
5265 type: integer
5266 example: 16810141515
5267 videoQuotaDaily:
5268 type: integer
5269 example: 1681014151
5270 trending:
5271 type: object
5272 properties:
5273 videos:
5274 type: object
5275 properties:
5276 intervalDays:
5277 type: integer
5278 tracker:
5279 type: object
5280 properties:
5281 enabled:
5282 type: boolean
5283 followings:
5284 type: object
5285 properties:
5286 instance:
5287 type: object
5288 properties:
5289 autoFollowIndex:
5290 type: object
5291 properties:
5292 indexUrl:
5293 type: string
5294 format: url
5295 ServerConfigAbout:
5296 properties:
5297 instance:
5298 type: object
5299 properties:
5300 name:
5301 type: string
5302 shortDescription:
5303 type: string
5304 description:
5305 type: string
5306 terms:
5307 type: string
5308 ServerConfigCustom:
5309 properties:
5310 instance:
5311 type: object
5312 properties:
5313 name:
5314 type: string
5315 shortDescription:
5316 type: string
5317 description:
5318 type: string
5319 terms:
5320 type: string
5321 defaultClientRoute:
5322 type: string
5323 isNSFW:
5324 type: boolean
5325 defaultNSFWPolicy:
5326 type: string
5327 customizations:
5328 type: object
5329 properties:
5330 javascript:
5331 type: string
5332 css:
5333 type: string
5334 theme:
5335 type: object
5336 properties:
5337 default:
5338 type: string
5339 services:
5340 type: object
5341 properties:
5342 twitter:
5343 type: object
5344 properties:
5345 username:
5346 type: string
5347 whitelisted:
5348 type: boolean
5349 cache:
5350 type: object
5351 properties:
5352 previews:
5353 type: object
5354 properties:
5355 size:
5356 type: integer
5357 captions:
5358 type: object
5359 properties:
5360 size:
5361 type: integer
5362 signup:
5363 type: object
5364 properties:
5365 enabled:
5366 type: boolean
5367 limit:
5368 type: integer
5369 requiresEmailVerification:
5370 type: boolean
5371 admin:
5372 type: object
5373 properties:
5374 email:
5375 type: string
5376 format: email
5377 contactForm:
5378 type: object
5379 properties:
5380 enabled:
5381 type: boolean
5382 user:
5383 type: object
5384 description: Settings that apply to new users, if registration is enabled
5385 properties:
5386 videoQuota:
5387 type: integer
5388 example: 16810141515
5389 videoQuotaDaily:
5390 type: integer
5391 example: 1681014151
5392 transcoding:
5393 type: object
5394 description: Settings pertaining to transcoding jobs
5395 properties:
5396 enabled:
5397 type: boolean
5398 allowAdditionalExtensions:
5399 type: boolean
5400 description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos
5401 allowAudioFiles:
5402 type: boolean
5403 description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file
5404 threads:
5405 type: integer
5406 description: Amount of threads used by ffmpeg for 1 transcoding job
5407 concurrency:
5408 type: number
5409 description: Amount of transcoding jobs to execute in parallel
5410 profile:
5411 type: string
5412 enum:
5413 - default
5414 description: |
5415 New profiles can be added by plugins ; available in core PeerTube: 'default'.
5416 resolutions:
5417 type: object
5418 description: Resolutions to transcode _new videos_ to
5419 properties:
5420 0p:
5421 type: boolean
5422 240p:
5423 type: boolean
5424 360p:
5425 type: boolean
5426 480p:
5427 type: boolean
5428 720p:
5429 type: boolean
5430 1080p:
5431 type: boolean
5432 1440p:
5433 type: boolean
5434 2160p:
5435 type: boolean
5436 webtorrent:
5437 type: object
5438 description: WebTorrent-specific settings
5439 properties:
5440 enabled:
5441 type: boolean
5442 hls:
5443 type: object
5444 description: HLS-specific settings
5445 properties:
5446 enabled:
5447 type: boolean
5448 import:
5449 type: object
5450 properties:
5451 videos:
5452 type: object
5453 properties:
5454 http:
5455 type: object
5456 properties:
5457 enabled:
5458 type: boolean
5459 torrent:
5460 type: object
5461 properties:
5462 enabled:
5463 type: boolean
5464 autoBlacklist:
5465 type: object
5466 properties:
5467 videos:
5468 type: object
5469 properties:
5470 ofUsers:
5471 type: object
5472 properties:
5473 enabled:
5474 type: boolean
5475 followers:
5476 type: object
5477 properties:
5478 instance:
5479 type: object
5480 properties:
5481 enabled:
5482 type: boolean
5483 manualApproval:
5484 type: boolean
5485 Follow:
5486 properties:
5487 id:
5488 $ref: '#/components/schemas/id'
5489 follower:
5490 $ref: '#/components/schemas/Actor'
5491 following:
5492 $ref: '#/components/schemas/Actor'
5493 score:
5494 type: number
5495 description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
5496 state:
5497 type: string
5498 enum:
5499 - pending
5500 - accepted
5501 createdAt:
5502 type: string
5503 format: date-time
5504 updatedAt:
5505 type: string
5506 format: date-time
5507
5508 PredefinedAbuseReasons:
5509 description: Reason categories that help triage reports
5510 type: array
5511 maxItems: 8
5512 items:
5513 type: string
5514 enum:
5515 - violentOrAbusive
5516 - hatefulOrAbusive
5517 - spamOrMisleading
5518 - privacy
5519 - rights
5520 - serverRules
5521 - thumbnails
5522 - captions
5523
5524 Job:
5525 properties:
5526 id:
5527 $ref: '#/components/schemas/id'
5528 state:
5529 type: string
5530 enum:
5531 - active
5532 - completed
5533 - failed
5534 - waiting
5535 - delayed
5536 type:
5537 type: string
5538 enum:
5539 - activitypub-http-unicast
5540 - activitypub-http-broadcast
5541 - activitypub-http-fetcher
5542 - activitypub-follow
5543 - video-file-import
5544 - video-transcoding
5545 - email
5546 - video-import
5547 - videos-views
5548 - activitypub-refresher
5549 - video-redundancy
5550 data:
5551 type: object
5552 additionalProperties: true
5553 error:
5554 type: object
5555 additionalProperties: true
5556 createdAt:
5557 type: string
5558 format: date-time
5559 finishedOn:
5560 type: string
5561 format: date-time
5562 processedOn:
5563 type: string
5564 format: date-time
5565 AddUserResponse:
5566 properties:
5567 user:
5568 type: object
5569 properties:
5570 id:
5571 $ref: '#/components/schemas/id'
5572 account:
5573 type: object
5574 properties:
5575 id:
5576 $ref: '#/components/schemas/id'
5577 VideoUploadRequestCommon:
5578 properties:
5579 name:
5580 description: Video name
5581 type: string
5582 example: What is PeerTube?
5583 minLength: 3
5584 maxLength: 120
5585 channelId:
5586 description: Channel id that will contain this video
5587 type: integer
5588 example: 3
5589 minimum: 1
5590 privacy:
5591 $ref: '#/components/schemas/VideoPrivacySet'
5592 category:
5593 $ref: '#/components/schemas/VideoCategorySet'
5594 licence:
5595 $ref: '#/components/schemas/VideoLicenceSet'
5596 language:
5597 $ref: '#/components/schemas/VideoLanguageSet'
5598 description:
5599 description: Video description
5600 type: string
5601 example: |
5602 **[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)**
5603 waitTranscoding:
5604 description: Whether or not we wait transcoding before publish the video
5605 type: boolean
5606 support:
5607 description: A text tell the audience how to support the video creator
5608 example: Please support our work on https://soutenir.framasoft.org/en/ <3
5609 type: string
5610 nsfw:
5611 description: Whether or not this video contains sensitive content
5612 type: boolean
5613 tags:
5614 description: Video tags (maximum 5 tags each between 2 and 30 characters)
5615 type: array
5616 minItems: 1
5617 maxItems: 5
5618 uniqueItems: true
5619 example:
5620 - framasoft
5621 - peertube
5622 items:
5623 type: string
5624 minLength: 2
5625 maxLength: 30
5626 commentsEnabled:
5627 description: Enable or disable comments for this video
5628 type: boolean
5629 downloadEnabled:
5630 description: Enable or disable downloading for this video
5631 type: boolean
5632 originallyPublishedAt:
5633 description: Date when the content was originally published
5634 type: string
5635 format: date-time
5636 scheduleUpdate:
5637 $ref: '#/components/schemas/VideoScheduledUpdate'
5638 thumbnailfile:
5639 description: Video thumbnail file
5640 type: string
5641 format: binary
5642 previewfile:
5643 description: Video preview file
5644 type: string
5645 format: binary
5646 required:
5647 - channelId
5648 - name
5649 VideoUploadRequestLegacy:
5650 allOf:
5651 - $ref: '#/components/schemas/VideoUploadRequestCommon'
5652 - type: object
5653 required:
5654 - videofile
5655 properties:
5656 videofile:
5657 description: Video file
5658 type: string
5659 format: binary
5660 VideoUploadRequestResumable:
5661 allOf:
5662 - $ref: '#/components/schemas/VideoUploadRequestCommon'
5663 - type: object
5664 required:
5665 - filename
5666 properties:
5667 filename:
5668 description: Video filename including extension
5669 type: string
5670 format: filename
5671 example: what_is_peertube.mp4
5672 thumbnailfile:
5673 description: Video thumbnail file
5674 type: string
5675 format: binary
5676 previewfile:
5677 description: Video preview file
5678 type: string
5679 format: binary
5680 VideoUploadResponse:
5681 properties:
5682 video:
5683 type: object
5684 properties:
5685 id:
5686 $ref: '#/components/schemas/Video/properties/id'
5687 uuid:
5688 $ref: '#/components/schemas/Video/properties/uuid'
5689 CommentThreadResponse:
5690 properties:
5691 total:
5692 type: integer
5693 example: 1
5694 data:
5695 type: array
5696 maxItems: 100
5697 items:
5698 $ref: '#/components/schemas/VideoComment'
5699 CommentThreadPostResponse:
5700 properties:
5701 comment:
5702 $ref: '#/components/schemas/VideoComment'
5703 VideoListResponse:
5704 properties:
5705 total:
5706 type: integer
5707 example: 1
5708 data:
5709 type: array
5710 maxItems: 100
5711 items:
5712 $ref: '#/components/schemas/Video'
5713 User:
5714 properties:
5715 account:
5716 $ref: '#/components/schemas/Account'
5717 autoPlayNextVideo:
5718 type: boolean
5719 description: Automatically start playing the upcoming video after the currently playing video
5720 autoPlayNextVideoPlaylist:
5721 type: boolean
5722 description: Automatically start playing the video on the playlist after the currently playing video
5723 autoPlayVideo:
5724 type: boolean
5725 description: Automatically start playing the video on the watch page
5726 blocked:
5727 type: boolean
5728 blockedReason:
5729 type: string
5730 createdAt:
5731 type: string
5732 email:
5733 type: string
5734 format: email
5735 description: The user email
5736 emailVerified:
5737 type: boolean
5738 description: Has the user confirmed their email address?
5739 id:
5740 allOf:
5741 - $ref: '#/components/schemas/id'
5742 readOnly: true
5743 pluginAuth:
5744 type: string
5745 description: Auth plugin to use to authenticate the user
5746 lastLoginDate:
5747 type: string
5748 format: date-time
5749 noInstanceConfigWarningModal:
5750 type: boolean
5751 noWelcomeModal:
5752 type: boolean
5753 nsfwPolicy:
5754 $ref: '#/components/schemas/NSFWPolicy'
5755 role:
5756 $ref: '#/components/schemas/UserRole'
5757 roleLabel:
5758 type: string
5759 enum:
5760 - User
5761 - Moderator
5762 - Administrator
5763 theme:
5764 type: string
5765 description: Theme enabled by this user
5766 username:
5767 $ref: '#/components/schemas/username'
5768 videoChannels:
5769 type: array
5770 items:
5771 $ref: '#/components/schemas/VideoChannel'
5772 videoQuota:
5773 type: integer
5774 description: The user video quota in bytes
5775 example: -1
5776 videoQuotaDaily:
5777 type: integer
5778 description: The user daily video quota in bytes
5779 example: -1
5780 webtorrentEnabled:
5781 type: boolean
5782 description: Enable P2P in the player
5783 UserWithStats:
5784 allOf:
5785 - $ref: '#/components/schemas/User'
5786 - properties:
5787 # optionally present fields: they require WITH_STATS scope
5788 videosCount:
5789 type: integer
5790 description: Count of videos published
5791 abusesCount:
5792 type: integer
5793 description: Count of reports/abuses of which the user is a target
5794 abusesAcceptedCount:
5795 type: integer
5796 description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team
5797 abusesCreatedCount:
5798 type: integer
5799 description: Count of reports/abuses created by the user
5800 videoCommentsCount:
5801 type: integer
5802 description: Count of comments published
5803 AddUser:
5804 properties:
5805 username:
5806 $ref: '#/components/schemas/username'
5807 password:
5808 $ref: '#/components/schemas/password'
5809 email:
5810 type: string
5811 format: email
5812 description: The user email
5813 videoQuota:
5814 type: integer
5815 description: The user video quota in bytes
5816 example: -1
5817 videoQuotaDaily:
5818 type: integer
5819 description: The user daily video quota in bytes
5820 example: -1
5821 channelName:
5822 $ref: '#/components/schemas/usernameChannel'
5823 role:
5824 $ref: '#/components/schemas/UserRole'
5825 adminFlags:
5826 $ref: '#/components/schemas/UserAdminFlags'
5827 required:
5828 - username
5829 - password
5830 - email
5831 - videoQuota
5832 - videoQuotaDaily
5833 - role
5834 UpdateUser:
5835 properties:
5836 email:
5837 description: The updated email of the user
5838 allOf:
5839 - $ref: '#/components/schemas/User/properties/email'
5840 emailVerified:
5841 type: boolean
5842 description: Set the email as verified
5843 videoQuota:
5844 type: integer
5845 description: The updated video quota of the user in bytes
5846 videoQuotaDaily:
5847 type: integer
5848 description: The updated daily video quota of the user in bytes
5849 pluginAuth:
5850 type: string
5851 nullable: true
5852 description: The auth plugin to use to authenticate the user
5853 example: 'peertube-plugin-auth-saml2'
5854 role:
5855 $ref: '#/components/schemas/UserRole'
5856 adminFlags:
5857 $ref: '#/components/schemas/UserAdminFlags'
5858 UpdateMe:
5859 # see shared/models/users/user-update-me.model.ts:
5860 properties:
5861 password:
5862 $ref: '#/components/schemas/password'
5863 currentPassword:
5864 $ref: '#/components/schemas/password'
5865 email:
5866 description: new email used for login and service communications
5867 allOf:
5868 - $ref: '#/components/schemas/User/properties/email'
5869 displayName:
5870 type: string
5871 description: new name of the user in its representations
5872 minLength: 3
5873 maxLength: 120
5874 displayNSFW:
5875 type: string
5876 description: new NSFW display policy
5877 enum:
5878 - 'true'
5879 - 'false'
5880 - both
5881 webTorrentEnabled:
5882 type: boolean
5883 description: whether to enable P2P in the player or not
5884 autoPlayVideo:
5885 type: boolean
5886 description: new preference regarding playing videos automatically
5887 autoPlayNextVideo:
5888 type: boolean
5889 description: new preference regarding playing following videos automatically
5890 autoPlayNextVideoPlaylist:
5891 type: boolean
5892 description: new preference regarding playing following playlist videos automatically
5893 videosHistoryEnabled:
5894 type: boolean
5895 description: whether to keep track of watched history or not
5896 videoLanguages:
5897 type: array
5898 items:
5899 type: string
5900 description: list of languages to filter videos down to
5901 theme:
5902 type: string
5903 noInstanceConfigWarningModal:
5904 type: boolean
5905 noWelcomeModal:
5906 type: boolean
5907 GetMeVideoRating:
5908 properties:
5909 id:
5910 $ref: '#/components/schemas/id'
5911 rating:
5912 type: string
5913 enum:
5914 - like
5915 - dislike
5916 - none
5917 description: Rating of the video
5918 required:
5919 - id
5920 - rating
5921 VideoRating:
5922 properties:
5923 video:
5924 $ref: '#/components/schemas/Video'
5925 rating:
5926 type: string
5927 enum:
5928 - like
5929 - dislike
5930 - none
5931 description: Rating of the video
5932 required:
5933 - video
5934 - rating
5935 RegisterUser:
5936 properties:
5937 username:
5938 description: immutable name of the user, used to find or mention its actor
5939 allOf:
5940 - $ref: '#/components/schemas/username'
5941 password:
5942 $ref: '#/components/schemas/password'
5943 email:
5944 type: string
5945 format: email
5946 description: email of the user, used for login or service communications
5947 displayName:
5948 type: string
5949 description: editable name of the user, displayed in its representations
5950 minLength: 1
5951 maxLength: 120
5952 channel:
5953 type: object
5954 description: channel base information used to create the first channel of the user
5955 properties:
5956 name:
5957 $ref: '#/components/schemas/usernameChannel'
5958 displayName:
5959 $ref: '#/components/schemas/VideoChannel/properties/displayName'
5960 required:
5961 - username
5962 - password
5963 - email
5964
5965 VideoChannel:
5966 properties:
5967 # GET/POST/PUT properties
5968 displayName:
5969 type: string
5970 description: editable name of the channel, displayed in its representations
5971 example: Videos of Framasoft
5972 minLength: 1
5973 maxLength: 120
5974 description:
5975 type: string
5976 example: Videos made with <3 by Framasoft
5977 minLength: 3
5978 maxLength: 1000
5979 support:
5980 type: string
5981 description: text shown by default on all videos of this channel, to tell the audience how to support it
5982 example: Please support our work on https://soutenir.framasoft.org/en/ <3
5983 minLength: 3
5984 maxLength: 1000
5985 # GET-only properties
5986 id:
5987 readOnly: true
5988 allOf:
5989 - $ref: '#/components/schemas/id'
5990 isLocal:
5991 readOnly: true
5992 type: boolean
5993 updatedAt:
5994 readOnly: true
5995 type: string
5996 format: date-time
5997 ownerAccount:
5998 readOnly: true
5999 nullable: true
6000 type: object
6001 properties:
6002 id:
6003 type: integer
6004 uuid:
6005 $ref: '#/components/schemas/UUIDv4'
6006 VideoChannelCreate:
6007 allOf:
6008 - $ref: '#/components/schemas/VideoChannel'
6009 - properties:
6010 name:
6011 description: username of the channel to create
6012 allOf:
6013 - $ref: '#/components/schemas/usernameChannel'
6014 required:
6015 - name
6016 - displayName
6017 VideoChannelUpdate:
6018 allOf:
6019 - $ref: '#/components/schemas/VideoChannel'
6020 - properties:
6021 bulkVideosSupportUpdate:
6022 type: boolean
6023 description: Update the support field for all videos of this channel
6024 VideoChannelList:
6025 properties:
6026 total:
6027 type: integer
6028 example: 1
6029 data:
6030 type: array
6031 items:
6032 allOf:
6033 - $ref: '#/components/schemas/VideoChannel'
6034 - $ref: '#/components/schemas/Actor'
6035
6036 MRSSPeerLink:
6037 type: object
6038 xml:
6039 name: 'media:peerLink'
6040 properties:
6041 href:
6042 type: string
6043 xml:
6044 attribute: true
6045 type:
6046 type: string
6047 enum:
6048 - application/x-bittorrent
6049 xml:
6050 attribute: true
6051 MRSSGroupContent:
6052 type: object
6053 xml:
6054 name: 'media:content'
6055 properties:
6056 url:
6057 type: string
6058 format: url
6059 xml:
6060 attribute: true
6061 fileSize:
6062 type: integer
6063 xml:
6064 attribute: true
6065 type:
6066 type: string
6067 xml:
6068 attribute: true
6069 framerate:
6070 type: integer
6071 xml:
6072 attribute: true
6073 duration:
6074 type: integer
6075 xml:
6076 attribute: true
6077 height:
6078 type: integer
6079 xml:
6080 attribute: true
6081 lang:
6082 type: string
6083 xml:
6084 attribute: true
6085 VideoCommentsForXML:
6086 type: array
6087 xml:
6088 wrapped: true
6089 name: 'channel'
6090 items:
6091 type: object
6092 xml:
6093 name: 'item'
6094 properties:
6095 link:
6096 type: string
6097 format: url
6098 guid:
6099 type: string
6100 pubDate:
6101 type: string
6102 format: date-time
6103 'content:encoded':
6104 type: string
6105 'dc:creator':
6106 type: string
6107 VideosForXML:
6108 type: array
6109 xml:
6110 wrapped: true
6111 name: 'channel'
6112 items:
6113 type: object
6114 xml:
6115 name: 'item'
6116 properties:
6117 link:
6118 type: string
6119 format: url
6120 description: video watch page URL
6121 guid:
6122 type: string
6123 description: video canonical URL
6124 pubDate:
6125 type: string
6126 format: date-time
6127 description: video publication date
6128 description:
6129 type: string
6130 description: video description
6131 'content:encoded':
6132 type: string
6133 description: video description
6134 'dc:creator':
6135 type: string
6136 description: publisher user name
6137 'media:category':
6138 type: integer
6139 description: video category (MRSS)
6140 'media:community':
6141 type: object
6142 description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
6143 properties:
6144 'media:statistics':
6145 type: object
6146 properties:
6147 views:
6148 type: integer
6149 xml:
6150 attribute: true
6151 'media:embed':
6152 type: object
6153 properties:
6154 url:
6155 type: string
6156 format: url
6157 description: video embed path, relative to the canonical URL domain (MRSS)
6158 xml:
6159 attribute: true
6160 'media:player':
6161 type: object
6162 properties:
6163 url:
6164 type: string
6165 format: url
6166 description: video watch path, relative to the canonical URL domain (MRSS)
6167 xml:
6168 attribute: true
6169 'media:thumbnail':
6170 type: object
6171 properties:
6172 url:
6173 type: string
6174 format: url
6175 xml:
6176 attribute: true
6177 height:
6178 type: integer
6179 xml:
6180 attribute: true
6181 width:
6182 type: integer
6183 xml:
6184 attribute: true
6185 'media:title':
6186 type: string
6187 description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
6188 'media:description':
6189 type: string
6190 'media:rating':
6191 type: string
6192 enum:
6193 - nonadult
6194 - adult
6195 description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
6196 'enclosure':
6197 type: object
6198 description: main streamable file for the video
6199 properties:
6200 url:
6201 type: string
6202 format: url
6203 xml:
6204 attribute: true
6205 type:
6206 type: string
6207 enum:
6208 - application/x-bittorrent
6209 xml:
6210 attribute: true
6211 length:
6212 type: integer
6213 xml:
6214 attribute: true
6215 'media:group':
6216 type: array
6217 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)
6218 items:
6219 anyOf:
6220 - $ref: '#/components/schemas/MRSSPeerLink'
6221 - $ref: '#/components/schemas/MRSSGroupContent'
6222 NotificationSettingValue:
6223 type: integer
6224 description: >
6225 Notification type
6226
6227 - `0` NONE
6228
6229 - `1` WEB
6230
6231 - `2` EMAIL
6232 enum:
6233 - 0
6234 - 1
6235 - 3
6236 Notification:
6237 properties:
6238 id:
6239 $ref: '#/components/schemas/id'
6240 type:
6241 type: integer
6242 description: >
6243 Notification type, following the `UserNotificationType` enum:
6244
6245 - `1` NEW_VIDEO_FROM_SUBSCRIPTION
6246
6247 - `2` NEW_COMMENT_ON_MY_VIDEO
6248
6249 - `3` NEW_ABUSE_FOR_MODERATORS
6250
6251 - `4` BLACKLIST_ON_MY_VIDEO
6252
6253 - `5` UNBLACKLIST_ON_MY_VIDEO
6254
6255 - `6` MY_VIDEO_PUBLISHED
6256
6257 - `7` MY_VIDEO_IMPORT_SUCCESS
6258
6259 - `8` MY_VIDEO_IMPORT_ERROR
6260
6261 - `9` NEW_USER_REGISTRATION
6262
6263 - `10` NEW_FOLLOW
6264
6265 - `11` COMMENT_MENTION
6266
6267 - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
6268
6269 - `13` NEW_INSTANCE_FOLLOWER
6270
6271 - `14` AUTO_INSTANCE_FOLLOWING
6272 read:
6273 type: boolean
6274 video:
6275 nullable: true
6276 allOf:
6277 - $ref: '#/components/schemas/VideoInfo'
6278 - type: object
6279 properties:
6280 channel:
6281 $ref: '#/components/schemas/ActorInfo'
6282 videoImport:
6283 nullable: true
6284 type: object
6285 properties:
6286 id:
6287 $ref: '#/components/schemas/id'
6288 video:
6289 nullable: true
6290 $ref: '#/components/schemas/VideoInfo'
6291 torrentName:
6292 type: string
6293 nullable: true
6294 magnetUri:
6295 $ref: '#/components/schemas/VideoImport/properties/magnetUri'
6296 targetUri:
6297 type: string
6298 format: uri
6299 nullable: true
6300 comment:
6301 nullable: true
6302 type: object
6303 properties:
6304 id:
6305 $ref: '#/components/schemas/id'
6306 threadId:
6307 type: integer
6308 video:
6309 $ref: '#/components/schemas/VideoInfo'
6310 account:
6311 $ref: '#/components/schemas/ActorInfo'
6312 videoAbuse:
6313 nullable: true
6314 type: object
6315 properties:
6316 id:
6317 $ref: '#/components/schemas/id'
6318 video:
6319 allOf:
6320 - $ref: '#/components/schemas/VideoInfo'
6321 videoBlacklist:
6322 nullable: true
6323 type: object
6324 properties:
6325 id:
6326 $ref: '#/components/schemas/id'
6327 video:
6328 allOf:
6329 - $ref: '#/components/schemas/VideoInfo'
6330 account:
6331 nullable: true
6332 allOf:
6333 - $ref: '#/components/schemas/ActorInfo'
6334 actorFollow:
6335 type: object
6336 nullable: true
6337 properties:
6338 id:
6339 $ref: '#/components/schemas/id'
6340 follower:
6341 $ref: '#/components/schemas/ActorInfo'
6342 state:
6343 type: string
6344 enum:
6345 - pending
6346 - accepted
6347 following:
6348 type: object
6349 properties:
6350 type:
6351 type: string
6352 enum:
6353 - account
6354 - channel
6355 - instance
6356 name:
6357 type: string
6358 displayName:
6359 type: string
6360 host:
6361 type: string
6362 format: hostname
6363 createdAt:
6364 type: string
6365 format: date-time
6366 updatedAt:
6367 type: string
6368 format: date-time
6369 NotificationListResponse:
6370 properties:
6371 total:
6372 type: integer
6373 example: 1
6374 data:
6375 type: array
6376 maxItems: 100
6377 items:
6378 $ref: '#/components/schemas/Notification'
6379 Plugin:
6380 properties:
6381 name:
6382 type: string
6383 example: peertube-plugin-auth-ldap
6384 type:
6385 type: integer
6386 description: >
6387 - `1`: PLUGIN
6388
6389 - `2`: THEME
6390 enum:
6391 - 1
6392 - 2
6393 latestVersion:
6394 type: string
6395 example: 0.0.3
6396 version:
6397 type: string
6398 example: 0.0.1
6399 enabled:
6400 type: boolean
6401 uninstalled:
6402 type: boolean
6403 peertubeEngine:
6404 type: string
6405 example: 2.2.0
6406 description:
6407 type: string
6408 homepage:
6409 type: string
6410 format: url
6411 example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap
6412 settings:
6413 type: object
6414 additionalProperties: true
6415 createdAt:
6416 type: string
6417 format: date-time
6418 updatedAt:
6419 type: string
6420 format: date-time
6421 PluginResponse:
6422 properties:
6423 total:
6424 type: integer
6425 example: 1
6426 data:
6427 type: array
6428 maxItems: 100
6429 items:
6430 $ref: '#/components/schemas/Plugin'
6431
6432 LiveVideoUpdate:
6433 properties:
6434 saveReplay:
6435 type: boolean
6436 permanentLive:
6437 description: User can stream multiple times in a permanent live
6438 type: boolean
6439
6440 LiveVideoResponse:
6441 properties:
6442 rtmpUrl:
6443 type: string
6444 streamKey:
6445 type: string
6446 description: RTMP stream key to use to stream into this live video
6447 saveReplay:
6448 type: boolean
6449 permanentLive:
6450 description: User can stream multiple times in a permanent live
6451 type: boolean
6452
6453
6454
6455 callbacks:
6456 searchIndex:
6457 'https://search.example.org/api/v1/search/videos':
6458 post:
6459 summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`
6460 responses:
6461 '200':
6462 description: successful operation
6463 content:
6464 application/json:
6465 schema:
6466 $ref: '#/components/schemas/VideoListResponse'