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