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