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