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