]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/api/openapi.yaml
Add videos list filters param in api doc
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
CommitLineData
3e9e6f2f 1openapi: 3.0.0
1569a818 2info:
5e1c08eb 3 title: PeerTube
93468b08 4 version: 2.1.1
2963c343
RK
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'
5776f78e 13 altText: PeerTube Project Homepage
2963c343
RK
14 description: |
15 # Introduction
002df381 16
b029d58a 17 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite
2963c343 18 HTTP/REST library for your programming language to use PeerTube. No official
5776f78e
RK
19 SDK is currently provided, but the spec API is fully compatible with
20 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
21 which generates a client SDK in the language of your choice.
3e9e6f2f 22
b029d58a
C
23 See the [Quick Start guide](https://docs.joinpeertube.org/#/api-rest-getting-started) so you can play with the PeerTube API.
24
2963c343 25 # Authentication
002df381 26
2963c343 27 When you sign up for an account, you are given the possibility to generate
1fd12c7c 28 sessions, and authenticate using this session token. One session token can
2963c343 29 currently be used at a time.
5776f78e
RK
30
31 # Errors
002df381 32
5776f78e
RK
33 The API uses standard HTTP status codes to indicate the success or failure
34 of the API call. The body of the response will be JSON in the following
35 format.
36
37 ```
38 {
39 "code": "unauthorized_request", // example inner error code
40 "error": "Token is invalid." // example exposed error message
41 }
42 ```
6441981b 43externalDocs:
512a5759 44 url: https://docs.joinpeertube.org/api-rest-reference.html
2963c343
RK
45tags:
46 - name: Accounts
3e9e6f2f 47 description: >
2963c343 48 Using some features of PeerTube require authentication, for which Accounts
3e9e6f2f 49 provide different levels of permission as well as associated user
5776f78e 50 information. Accounts also encompass remote accounts discovered across the federation.
2963c343 51 - name: Config
3e9e6f2f
RK
52 description: >
53 Each server exposes public information regarding supported videos and
54 options.
2963c343 55 - name: Job
3e9e6f2f
RK
56 description: >
57 Jobs are long-running tasks enqueued and processed by the instance
5776f78e 58 itself. No additional worker registration is currently available.
b029d58a 59 - name: Instance Follows
3e9e6f2f
RK
60 description: >
61 Managing servers which the instance interacts with is crucial to the
5776f78e 62 concept of federation in PeerTube and external video indexation. The PeerTube
1fd12c7c 63 server then deals with inter-server ActivityPub operations and propagates
2963c343
RK
64 information across its social graph by posting activities to actors' inbox
65 endpoints.
50e16ccf 66 - name: Video Abuses
2963c343
RK
67 description: |
68 Video abuses deal with reports of local or remote videos alike.
69 - name: Video
70 description: |
71 Operations dealing with listing, uploading, fetching or modifying videos.
72 - name: Search
73 description: |
74 The search helps to find _videos_ from within the instance and beyond.
75 Videos from other instances federated by the instance (that is, instances
76 followed by the instance) can be found via keywords and other criteria of
77 the advanced search.
b029d58a 78 - name: Video Comments
3e9e6f2f
RK
79 description: >
80 Operations dealing with comments to a video. Comments are organized in
81 threads.
b029d58a 82 - name: Video Playlists
71810d0b
RK
83 description: >
84 Operations dealing with playlists of videos. Playlists are bound to users
85 and/or channels.
b029d58a 86 - name: Video Channels
3e9e6f2f
RK
87 description: >
88 Operations dealing with creation, modification and video listing of a
5776f78e
RK
89 user's channels.
90 - name: Video Blacklist
91 description: >
92 Operations dealing with blacklisting videos (removing them from view and
93 preventing interactions).
b029d58a 94 - name: Video Rates
5776f78e 95 description: >
b029d58a 96 Like/dislike a video.
5776f78e
RK
97x-tagGroups:
98 - name: Accounts
99 tags:
100 - Accounts
b029d58a 101 - Users
1f82e3e8 102 - My User
b029d58a 103 - My Subscriptions
5776f78e
RK
104 - name: Videos
105 tags:
106 - Video
67ae04a5 107 - Video Caption
b029d58a
C
108 - Video Channels
109 - Video Comments
5776f78e 110 - Video Following
b029d58a
C
111 - Video Rates
112 - Video Playlists
113 - Video Ownership Change
114 - name: Search
115 tags:
116 - Search
5776f78e
RK
117 - name: Moderation
118 tags:
50e16ccf 119 - Video Abuses
5776f78e 120 - Video Blacklist
65f02679 121 - name: Instance Configuration
5776f78e
RK
122 tags:
123 - Config
b029d58a 124 - Instance Follows
5776f78e
RK
125 - name: Jobs
126 tags:
127 - Job
1569a818 128paths:
ad9e39fb 129 '/accounts/{name}':
1569a818
DG
130 get:
131 tags:
132 - Accounts
b029d58a 133 summary: Get an account
1569a818 134 parameters:
3e9e6f2f 135 - $ref: '#/components/parameters/name'
1569a818
DG
136 responses:
137 '200':
138 description: successful operation
3e9e6f2f
RK
139 content:
140 application/json:
141 schema:
142 $ref: '#/components/schemas/Account'
ad9e39fb 143 '/accounts/{name}/videos':
6b738c7a
C
144 get:
145 tags:
146 - Accounts
2963c343 147 - Video
b029d58a 148 summary: 'List videos of an account'
6b738c7a 149 parameters:
3e9e6f2f 150 - $ref: '#/components/parameters/name'
59c794a5
C
151 - $ref: '#/components/parameters/categoryOneOf'
152 - $ref: '#/components/parameters/tagsOneOf'
153 - $ref: '#/components/parameters/tagsAllOf'
154 - $ref: '#/components/parameters/licenceOneOf'
155 - $ref: '#/components/parameters/languageOneOf'
156 - $ref: '#/components/parameters/nsfw'
157 - $ref: '#/components/parameters/filter'
158 - $ref: '#/components/parameters/skipCount'
159 - $ref: '#/components/parameters/start'
160 - $ref: '#/components/parameters/count'
161 - $ref: '#/components/parameters/videosSort'
6b738c7a
C
162 responses:
163 '200':
164 description: successful operation
3e9e6f2f
RK
165 content:
166 application/json:
167 schema:
048b6946 168 $ref: '#/components/schemas/VideoListResponse'
2963c343
RK
169 x-code-samples:
170 - lang: JavaScript
171 source: |
8f9e8be1 172 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
2963c343
RK
173 .then(function(response) {
174 return response.json()
175 }).then(function(data) {
176 console.log(data)
177 })
8f9e8be1
RK
178 - lang: Shell
179 source: |
180 # pip install httpie
181 http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
5776f78e
RK
182 - lang: Ruby
183 source: |
5776f78e 184 require 'net/http'
f6d51cfe 185 require 'json'
5776f78e 186
f6d51cfe 187 uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
5776f78e 188
f6d51cfe 189 http = Net::HTTP.new(uri.host, uri.port)
5776f78e 190 http.use_ssl = true
5776f78e 191
f6d51cfe
MDB
192 response = http.get(uri.request_uri)
193
194 puts JSON.parse(response.read_body)
5776f78e
RK
195 - lang: Python
196 source: |
f6d51cfe 197 import requests
5776f78e 198
f6d51cfe
MDB
199 r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
200 json = r.json()
5776f78e 201
f6d51cfe 202 print(json)
1569a818
DG
203 /accounts:
204 get:
205 tags:
206 - Accounts
b029d58a 207 summary: List accounts
2a8ae759
FS
208 parameters:
209 - $ref: '#/components/parameters/start'
210 - $ref: '#/components/parameters/count'
211 - $ref: '#/components/parameters/sort'
1569a818
DG
212 responses:
213 '200':
214 description: successful operation
3e9e6f2f 215 content:
8f9e8be1 216 'application/json':
3e9e6f2f
RK
217 schema:
218 type: array
219 items:
220 $ref: '#/components/schemas/Account'
1569a818
DG
221 /config:
222 get:
223 tags:
224 - Config
b029d58a 225 summary: Get instance public configuration
1569a818
DG
226 responses:
227 '200':
228 description: successful operation
3e9e6f2f
RK
229 content:
230 application/json:
231 schema:
232 $ref: '#/components/schemas/ServerConfig'
6441981b
RK
233 /config/about:
234 get:
b029d58a 235 summary: Get instance "About" information
6441981b
RK
236 tags:
237 - Config
238 responses:
239 '200':
240 description: successful operation
2a8ae759
FS
241 content:
242 application/json:
243 schema:
244 $ref: '#/components/schemas/ServerConfigAbout'
6441981b
RK
245 /config/custom:
246 get:
b029d58a 247 summary: Get instance runtime configuration
6441981b
RK
248 tags:
249 - Config
250 security:
251 - OAuth2:
252 - admin
253 responses:
254 '200':
255 description: successful operation
2a8ae759
FS
256 content:
257 application/json:
258 schema:
259 $ref: '#/components/schemas/ServerConfigCustom'
6441981b 260 put:
b029d58a 261 summary: Set instance runtime configuration
6441981b
RK
262 tags:
263 - Config
264 security:
265 - OAuth2:
266 - admin
267 responses:
268 '200':
269 description: successful operation
270 delete:
b029d58a 271 summary: Delete instance runtime configuration
6441981b
RK
272 tags:
273 - Config
274 security:
275 - OAuth2:
276 - admin
277 responses:
278 '200':
279 description: successful operation
d216b538 280 /jobs/{state}:
1569a818 281 get:
b029d58a 282 summary: List instance jobs
94ff4c23 283 security:
3e9e6f2f
RK
284 - OAuth2:
285 - admin
1569a818
DG
286 tags:
287 - Job
44cb3b85
DG
288 parameters:
289 - name: state
290 in: path
291 required: true
3e9e6f2f
RK
292 description: The state of the job
293 schema:
294 type: string
65f02679
RK
295 enum:
296 - active
297 - completed
298 - failed
299 - waiting
300 - delayed
3e9e6f2f
RK
301 - $ref: '#/components/parameters/start'
302 - $ref: '#/components/parameters/count'
303 - $ref: '#/components/parameters/sort'
1569a818
DG
304 responses:
305 '200':
306 description: successful operation
3e9e6f2f
RK
307 content:
308 application/json:
309 schema:
310 type: array
311 items:
312 $ref: '#/components/schemas/Job'
1569a818
DG
313 '/server/following/{host}':
314 delete:
94ff4c23 315 security:
3e9e6f2f
RK
316 - OAuth2:
317 - admin
1569a818 318 tags:
b029d58a
C
319 - Instance Follows
320 summary: Unfollow a server
1569a818
DG
321 parameters:
322 - name: host
323 in: path
324 required: true
1569a818 325 description: 'The host to unfollow '
3e9e6f2f
RK
326 schema:
327 type: string
1569a818
DG
328 responses:
329 '201':
330 description: successful operation
331 /server/followers:
332 get:
333 tags:
b029d58a
C
334 - Instance Follows
335 summary: List instance followers
44cb3b85 336 parameters:
3e9e6f2f
RK
337 - $ref: '#/components/parameters/start'
338 - $ref: '#/components/parameters/count'
339 - $ref: '#/components/parameters/sort'
1569a818
DG
340 responses:
341 '200':
342 description: successful operation
3e9e6f2f
RK
343 content:
344 application/json:
345 schema:
346 type: array
347 items:
348 $ref: '#/components/schemas/Follow'
1569a818
DG
349 /server/following:
350 get:
351 tags:
b029d58a
C
352 - Instance Follows
353 summary: List instance followings
44cb3b85 354 parameters:
3e9e6f2f
RK
355 - $ref: '#/components/parameters/start'
356 - $ref: '#/components/parameters/count'
357 - $ref: '#/components/parameters/sort'
1569a818
DG
358 responses:
359 '200':
360 description: successful operation
3e9e6f2f
RK
361 content:
362 application/json:
363 schema:
364 type: array
365 items:
366 $ref: '#/components/schemas/Follow'
1569a818 367 post:
94ff4c23 368 security:
3e9e6f2f
RK
369 - OAuth2:
370 - admin
1569a818 371 tags:
b029d58a 372 - Instance Follows
2963c343 373 summary: Follow a server
1569a818
DG
374 responses:
375 '204':
c1843150 376 description: successful operation
3e9e6f2f
RK
377 requestBody:
378 content:
379 application/json:
380 schema:
381 $ref: '#/components/schemas/Follow'
1569a818
DG
382 /users:
383 post:
b029d58a 384 summary: Create a user
94ff4c23 385 security:
3e9e6f2f
RK
386 - OAuth2:
387 - admin
1569a818 388 tags:
b029d58a 389 - Users
1569a818
DG
390 responses:
391 '200':
392 description: successful operation
3e9e6f2f
RK
393 content:
394 application/json:
395 schema:
396 $ref: '#/components/schemas/AddUserResponse'
397 requestBody:
398 content:
399 application/json:
400 schema:
401 $ref: '#/components/schemas/AddUser'
402 description: User to create
403 required: true
1569a818 404 get:
b029d58a 405 summary: List users
94ff4c23 406 security:
3e9e6f2f 407 - OAuth2: []
1569a818 408 tags:
b029d58a 409 - Users
44cb3b85 410 parameters:
3e9e6f2f
RK
411 - $ref: '#/components/parameters/start'
412 - $ref: '#/components/parameters/count'
fd5af7a2 413 - $ref: '#/components/parameters/usersSort'
1569a818
DG
414 responses:
415 '200':
416 description: successful operation
3e9e6f2f
RK
417 content:
418 application/json:
419 schema:
420 type: array
421 items:
422 $ref: '#/components/schemas/User'
1569a818
DG
423 '/users/{id}':
424 delete:
b029d58a 425 summary: Delete a user
94ff4c23 426 security:
3e9e6f2f
RK
427 - OAuth2:
428 - admin
1569a818 429 tags:
b029d58a 430 - Users
1569a818 431 parameters:
3e9e6f2f 432 - $ref: '#/components/parameters/id'
1569a818
DG
433 responses:
434 '204':
c1843150 435 description: successful operation
1569a818 436 get:
b029d58a 437 summary: Get a user
94ff4c23 438 security:
3e9e6f2f 439 - OAuth2: []
1569a818 440 tags:
b029d58a 441 - Users
1569a818 442 parameters:
3e9e6f2f 443 - $ref: '#/components/parameters/id'
1569a818
DG
444 responses:
445 '200':
446 description: successful operation
3e9e6f2f
RK
447 content:
448 application/json:
449 schema:
450 $ref: '#/components/schemas/User'
1569a818 451 put:
b029d58a 452 summary: Update a user
94ff4c23 453 security:
3e9e6f2f 454 - OAuth2: []
1569a818 455 tags:
b029d58a 456 - Users
1569a818 457 parameters:
3e9e6f2f 458 - $ref: '#/components/parameters/id'
1569a818
DG
459 responses:
460 '204':
c1843150 461 description: successful operation
3e9e6f2f
RK
462 requestBody:
463 content:
464 application/json:
465 schema:
466 $ref: '#/components/schemas/UpdateUser'
467 required: true
1f82e3e8
C
468 /users/register:
469 post:
470 summary: Register a user
471 tags:
b029d58a 472 - Users
1f82e3e8
C
473 responses:
474 '204':
c1843150 475 description: successful operation
1f82e3e8
C
476 requestBody:
477 content:
478 application/json:
479 schema:
480 $ref: '#/components/schemas/RegisterUser'
481 required: true
1569a818
DG
482 /users/me:
483 get:
b029d58a 484 summary: Get my user information
94ff4c23 485 security:
e76d5784
RK
486 - OAuth2:
487 - user
1569a818 488 tags:
1f82e3e8 489 - My User
1569a818
DG
490 responses:
491 '200':
492 description: successful operation
3e9e6f2f
RK
493 content:
494 application/json:
495 schema:
496 type: array
497 items:
498 $ref: '#/components/schemas/User'
1569a818 499 put:
b029d58a 500 summary: Update my user information
94ff4c23 501 security:
e76d5784
RK
502 - OAuth2:
503 - user
1569a818 504 tags:
1f82e3e8 505 - My User
1569a818
DG
506 responses:
507 '204':
37db4176 508 description: successful operation
3e9e6f2f
RK
509 requestBody:
510 content:
511 application/json:
512 schema:
513 $ref: '#/components/schemas/UpdateMe'
514 required: true
1f82e3e8
C
515 /users/me/videos/imports:
516 get:
b029d58a 517 summary: Get video imports of my user
1f82e3e8
C
518 security:
519 - OAuth2:
520 - user
521 tags:
b029d58a 522 - Videos
1f82e3e8
C
523 - My User
524 parameters:
525 - $ref: '#/components/parameters/start'
526 - $ref: '#/components/parameters/count'
527 - $ref: '#/components/parameters/sort'
528 responses:
529 '200':
530 description: successful operation
531 content:
532 application/json:
533 schema:
534 $ref: '#/components/schemas/VideoImport'
1569a818
DG
535 /users/me/video-quota-used:
536 get:
b029d58a 537 summary: Get my user used quota
94ff4c23 538 security:
e76d5784
RK
539 - OAuth2:
540 - user
1569a818 541 tags:
1f82e3e8 542 - My User
1569a818
DG
543 responses:
544 '200':
545 description: successful operation
3e9e6f2f
RK
546 content:
547 application/json:
548 schema:
549 type: number
1569a818
DG
550 '/users/me/videos/{videoId}/rating':
551 get:
50e16ccf 552 summary: Get rate of my user for a video
94ff4c23 553 security:
3e9e6f2f 554 - OAuth2: []
1569a818 555 tags:
1f82e3e8 556 - My User
b029d58a 557 - Video Rates
1569a818
DG
558 parameters:
559 - name: videoId
560 in: path
561 required: true
1569a818 562 description: 'The video id '
3e9e6f2f
RK
563 schema:
564 type: string
1569a818
DG
565 responses:
566 '200':
567 description: successful operation
3e9e6f2f
RK
568 content:
569 application/json:
570 schema:
571 $ref: '#/components/schemas/GetMeVideoRating'
1569a818
DG
572 /users/me/videos:
573 get:
b029d58a 574 summary: Get videos of my user
94ff4c23 575 security:
e76d5784
RK
576 - OAuth2:
577 - user
1569a818 578 tags:
1f82e3e8 579 - My User
b029d58a 580 - Videos
44cb3b85 581 parameters:
3e9e6f2f
RK
582 - $ref: '#/components/parameters/start'
583 - $ref: '#/components/parameters/count'
584 - $ref: '#/components/parameters/sort'
1569a818
DG
585 responses:
586 '200':
587 description: successful operation
3e9e6f2f
RK
588 content:
589 application/json:
590 schema:
048b6946 591 $ref: '#/components/schemas/VideoListResponse'
e76d5784
RK
592 /users/me/subscriptions:
593 get:
b029d58a 594 summary: Get my user subscriptions
e76d5784
RK
595 security:
596 - OAuth2:
597 - user
598 tags:
b029d58a 599 - My Subscriptions
e76d5784
RK
600 parameters:
601 - $ref: '#/components/parameters/start'
602 - $ref: '#/components/parameters/count'
603 - $ref: '#/components/parameters/sort'
604 responses:
605 '200':
606 description: successful operation
607 post:
b029d58a 608 summary: Add subscription to my user
e76d5784
RK
609 security:
610 - OAuth2:
611 - user
612 tags:
b029d58a 613 - My Subscriptions
e76d5784
RK
614 responses:
615 '200':
616 description: successful operation
617 /users/me/subscriptions/exist:
618 get:
b029d58a 619 summary: Get if subscriptions exist for my user
e76d5784
RK
620 security:
621 - OAuth2:
622 - user
623 tags:
b029d58a 624 - My Subscriptions
e76d5784
RK
625 parameters:
626 - $ref: '#/components/parameters/subscriptionsUris'
627 responses:
628 '200':
629 description: successful operation
630 content:
631 application/json:
632 schema:
633 type: object
634 /users/me/subscriptions/videos:
635 get:
b029d58a 636 summary: List videos of subscriptions of my user
e76d5784
RK
637 security:
638 - OAuth2:
639 - user
640 tags:
b029d58a
C
641 - My Subscriptions
642 - Videos
e76d5784 643 parameters:
59c794a5
C
644 - $ref: '#/components/parameters/categoryOneOf'
645 - $ref: '#/components/parameters/tagsOneOf'
646 - $ref: '#/components/parameters/tagsAllOf'
647 - $ref: '#/components/parameters/licenceOneOf'
648 - $ref: '#/components/parameters/languageOneOf'
649 - $ref: '#/components/parameters/nsfw'
650 - $ref: '#/components/parameters/filter'
651 - $ref: '#/components/parameters/skipCount'
e76d5784
RK
652 - $ref: '#/components/parameters/start'
653 - $ref: '#/components/parameters/count'
59c794a5 654 - $ref: '#/components/parameters/videosSort'
e76d5784
RK
655 responses:
656 '200':
657 description: successful operation
658 content:
659 application/json:
660 schema:
048b6946 661 $ref: '#/components/schemas/VideoListResponse'
cb9d028a 662 '/users/me/subscriptions/{subscriptionHandle}':
e76d5784 663 get:
b029d58a 664 summary: Get subscription of my user
e76d5784
RK
665 security:
666 - OAuth2:
667 - user
668 tags:
b029d58a 669 - My Subscriptions
cb9d028a
C
670 parameters:
671 - $ref: '#/components/parameters/subscriptionHandle'
e76d5784
RK
672 responses:
673 '200':
674 description: successful operation
675 content:
676 application/json:
677 schema:
678 $ref: '#/components/schemas/VideoChannel'
679 delete:
b029d58a 680 summary: Delete subscription of my user
e76d5784
RK
681 security:
682 - OAuth2:
683 - user
684 tags:
b029d58a 685 - My Subscriptions
cb9d028a
C
686 parameters:
687 - $ref: '#/components/parameters/subscriptionHandle'
e76d5784
RK
688 responses:
689 '200':
690 description: successful operation
1569a818
DG
691 /users/me/avatar/pick:
692 post:
b029d58a 693 summary: Update my user avatar
94ff4c23 694 security:
3e9e6f2f 695 - OAuth2: []
1569a818 696 tags:
1f82e3e8 697 - My User
1569a818
DG
698 responses:
699 '200':
700 description: successful operation
3e9e6f2f
RK
701 content:
702 application/json:
703 schema:
704 $ref: '#/components/schemas/Avatar'
705 requestBody:
706 content:
707 multipart/form-data:
708 schema:
709 type: object
710 properties:
711 avatarfile:
712 description: The file to upload.
713 type: string
714 format: binary
715 encoding:
0ad45af7 716 avatarfile:
3e9e6f2f 717 contentType: image/png, image/jpeg
b029d58a
C
718 /videos/ownership:
719 get:
720 summary: List video ownership changes
721 tags:
722 - Video Ownership Change
723 security:
724 - OAuth2: []
725 responses:
726 '200':
727 description: successful operation
728 '/videos/ownership/{id}/accept':
729 post:
730 summary: Accept ownership change request
731 tags:
732 - Video Ownership Change
733 security:
734 - OAuth2: []
735 parameters:
736 - $ref: '#/components/parameters/idOrUUID'
737 responses:
738 '204':
c1843150 739 description: successful operation
b029d58a
C
740 '/videos/ownership/{id}/refuse':
741 post:
742 summary: Refuse ownership change request
743 tags:
744 - Video Ownership Change
745 security:
746 - OAuth2: []
747 parameters:
748 - $ref: '#/components/parameters/idOrUUID'
749 responses:
750 '204':
c1843150 751 description: successful operation
b029d58a
C
752 '/videos/{id}/give-ownership':
753 post:
754 summary: Request ownership change
755 tags:
756 - Video Ownership Change
757 security:
758 - OAuth2: []
759 parameters:
760 - $ref: '#/components/parameters/idOrUUID'
761 requestBody:
762 required: true
763 content:
764 application/x-www-form-urlencoded:
765 schema:
766 type: object
767 properties:
768 username:
769 type: string
770 required:
771 - username
772 responses:
773 '204':
c1843150 774 description: successful operation
b029d58a
C
775 '400':
776 description: 'Changing video ownership to a remote account is not supported yet'
c360c494 777 /videos:
1569a818 778 get:
b029d58a 779 summary: List videos
1569a818
DG
780 tags:
781 - Video
44cb3b85 782 parameters:
fd5af7a2
RK
783 - $ref: '#/components/parameters/categoryOneOf'
784 - $ref: '#/components/parameters/tagsOneOf'
785 - $ref: '#/components/parameters/tagsAllOf'
786 - $ref: '#/components/parameters/licenceOneOf'
787 - $ref: '#/components/parameters/languageOneOf'
788 - $ref: '#/components/parameters/nsfw'
789 - $ref: '#/components/parameters/filter'
59c794a5 790 - $ref: '#/components/parameters/skipCount'
3e9e6f2f
RK
791 - $ref: '#/components/parameters/start'
792 - $ref: '#/components/parameters/count'
fd5af7a2 793 - $ref: '#/components/parameters/videosSort'
1569a818
DG
794 responses:
795 '200':
796 description: successful operation
3e9e6f2f
RK
797 content:
798 application/json:
799 schema:
048b6946 800 $ref: '#/components/schemas/VideoListResponse'
c360c494 801 /videos/categories:
1569a818 802 get:
b029d58a 803 summary: List available video categories
1569a818
DG
804 tags:
805 - Video
1569a818
DG
806 responses:
807 '200':
808 description: successful operation
3e9e6f2f
RK
809 content:
810 application/json:
811 schema:
812 type: array
813 items:
814 type: string
c360c494 815 /videos/licences:
1569a818 816 get:
b029d58a 817 summary: List available video licences
1569a818
DG
818 tags:
819 - Video
1569a818
DG
820 responses:
821 '200':
822 description: successful operation
3e9e6f2f
RK
823 content:
824 application/json:
825 schema:
826 type: array
827 items:
828 type: string
c360c494 829 /videos/languages:
1569a818 830 get:
b029d58a 831 summary: List available video languages
1569a818
DG
832 tags:
833 - Video
1569a818
DG
834 responses:
835 '200':
836 description: successful operation
3e9e6f2f
RK
837 content:
838 application/json:
839 schema:
840 type: array
841 items:
842 type: string
c360c494 843 /videos/privacies:
1569a818 844 get:
b029d58a 845 summary: List available video privacies
1569a818
DG
846 tags:
847 - Video
1569a818
DG
848 responses:
849 '200':
850 description: successful operation
3e9e6f2f
RK
851 content:
852 application/json:
853 schema:
854 type: array
855 items:
856 type: string
857 '/videos/{id}':
1569a818 858 put:
b029d58a 859 summary: Update a video
94ff4c23 860 security:
3e9e6f2f 861 - OAuth2: []
1569a818
DG
862 tags:
863 - Video
1569a818 864 parameters:
cb9d028a 865 - $ref: '#/components/parameters/idOrUUID'
1569a818 866 responses:
37db4176 867 '204':
1569a818 868 description: successful operation
3e9e6f2f
RK
869 requestBody:
870 content:
871 multipart/form-data:
872 schema:
873 type: object
874 properties:
875 thumbnailfile:
876 description: Video thumbnail file
877 type: string
0ad45af7 878 format: binary
3e9e6f2f
RK
879 previewfile:
880 description: Video preview file
881 type: string
0ad45af7 882 format: binary
3e9e6f2f
RK
883 category:
884 description: Video category
885 type: string
886 licence:
887 description: Video licence
888 type: string
889 language:
890 description: Video language
891 type: string
c1843150
C
892 privacy:
893 $ref: '#/components/schemas/VideoPrivacySet'
3e9e6f2f
RK
894 description:
895 description: Video description
896 type: string
897 waitTranscoding:
898 description: Whether or not we wait transcoding before publish the video
899 type: string
900 support:
901 description: Text describing how to support the video uploader
902 type: string
903 nsfw:
904 description: Whether or not this video contains sensitive content
905 type: string
906 name:
907 description: Video name
908 type: string
909 tags:
12fed49e 910 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1fd12c7c 911 type: array
07d02f6d
FS
912 minItems: 1
913 maxItems: 5
1fd12c7c
C
914 items:
915 type: string
07d02f6d
FS
916 minLength: 2
917 maxLength: 30
3e9e6f2f
RK
918 commentsEnabled:
919 description: Enable or disable comments for this video
920 type: string
37db4176
FS
921 originallyPublishedAt:
922 description: Date when the content was originally published
923 type: string
924 format: date-time
5dce26d2
C
925 scheduleUpdate:
926 $ref: '#/components/schemas/VideoScheduledUpdate'
0ad45af7
FS
927 encoding:
928 thumbnailfile:
929 contentType: image/jpeg
930 previewfile:
931 contentType: image/jpeg
1569a818 932 get:
b029d58a 933 summary: Get a video
1569a818
DG
934 tags:
935 - Video
1569a818 936 parameters:
cb9d028a 937 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
938 responses:
939 '200':
940 description: successful operation
3e9e6f2f
RK
941 content:
942 application/json:
943 schema:
5dce26d2 944 $ref: '#/components/schemas/VideoDetails'
1569a818 945 delete:
b029d58a 946 summary: Delete a video
94ff4c23 947 security:
3e9e6f2f 948 - OAuth2: []
1569a818
DG
949 tags:
950 - Video
1569a818 951 parameters:
cb9d028a 952 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
953 responses:
954 '204':
c1843150 955 description: successful operation
3e9e6f2f 956 '/videos/{id}/description':
1569a818 957 get:
b029d58a 958 summary: Get complete video description
1569a818
DG
959 tags:
960 - Video
1569a818 961 parameters:
cb9d028a 962 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
963 responses:
964 '200':
965 description: successful operation
3e9e6f2f
RK
966 content:
967 application/json:
968 schema:
969 type: string
970 '/videos/{id}/views':
1569a818 971 post:
b029d58a 972 summary: Add a view to a video
1569a818
DG
973 tags:
974 - Video
1569a818 975 parameters:
cb9d028a 976 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
977 responses:
978 '204':
c1843150 979 description: successful operation
6441981b
RK
980 '/videos/{id}/watching':
981 put:
b029d58a 982 summary: Set watching progress of a video
6441981b
RK
983 tags:
984 - Video
985 security:
986 - OAuth2: []
987 parameters:
cb9d028a 988 - $ref: '#/components/parameters/idOrUUID'
6441981b
RK
989 requestBody:
990 content:
991 application/json:
992 schema:
993 $ref: '#/components/schemas/UserWatchingVideo'
994 required: true
995 responses:
996 '204':
c1843150 997 description: successful operation
c360c494 998 /videos/upload:
1569a818 999 post:
b029d58a 1000 summary: Upload a video
94ff4c23 1001 security:
3e9e6f2f 1002 - OAuth2: []
1569a818
DG
1003 tags:
1004 - Video
1569a818
DG
1005 responses:
1006 '200':
1007 description: successful operation
3e9e6f2f
RK
1008 content:
1009 application/json:
1010 schema:
1011 $ref: '#/components/schemas/VideoUploadResponse'
06bcfbd9
RK
1012 '403':
1013 description: 'The user video quota is exceeded with this video.'
1014 '408':
1015 description: 'Upload has timed out'
1016 '422':
1017 description: 'Invalid input file.'
3e9e6f2f
RK
1018 requestBody:
1019 content:
1020 multipart/form-data:
1021 schema:
1022 type: object
1023 properties:
1024 videofile:
1025 description: Video file
1026 type: string
1027 format: binary
1028 channelId:
1029 description: Channel id that will contain this video
1030 type: number
1031 thumbnailfile:
1032 description: Video thumbnail file
1033 type: string
0ad45af7 1034 format: binary
3e9e6f2f
RK
1035 previewfile:
1036 description: Video preview file
1037 type: string
0ad45af7 1038 format: binary
8f9e8be1 1039 privacy:
ee89e8fd 1040 $ref: '#/components/schemas/VideoPrivacySet'
3e9e6f2f
RK
1041 category:
1042 description: Video category
1043 type: string
1044 licence:
1045 description: Video licence
1046 type: string
1047 language:
1048 description: Video language
1049 type: string
1050 description:
1051 description: Video description
1052 type: string
1053 waitTranscoding:
1054 description: Whether or not we wait transcoding before publish the video
1055 type: string
1056 support:
1057 description: Text describing how to support the video uploader
1058 type: string
1059 nsfw:
1060 description: Whether or not this video contains sensitive content
1061 type: string
1062 name:
1063 description: Video name
1064 type: string
1065 tags:
07d02f6d 1066 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1fd12c7c 1067 type: array
07d02f6d
FS
1068 minItems: 1
1069 maxItems: 5
1fd12c7c
C
1070 items:
1071 type: string
07d02f6d
FS
1072 minLength: 2
1073 maxLength: 30
3e9e6f2f
RK
1074 commentsEnabled:
1075 description: Enable or disable comments for this video
1076 type: string
f9f89092
FS
1077 originallyPublishedAt:
1078 description: Date when the content was originally published
1079 type: string
1080 format: date-time
5dce26d2
C
1081 scheduleUpdate:
1082 $ref: '#/components/schemas/VideoScheduledUpdate'
3e9e6f2f
RK
1083 required:
1084 - videofile
1085 - channelId
8f9e8be1 1086 - name
0ad45af7
FS
1087 encoding:
1088 videofile:
1089 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
1090 thumbnailfile:
1091 contentType: image/jpeg
1092 previewfile:
1093 contentType: image/jpeg
8f9e8be1
RK
1094 x-code-samples:
1095 - lang: Shell
1096 source: |
1097 ## DEPENDENCIES: httpie, jq
1098 # pip install httpie
1099 USERNAME="<your_username>"
1100 PASSWORD="<your_password>"
1101 FILE_PATH="<your_file_path>"
1102 CHANNEL_ID="<your_channel_id>"
8f9e8be1
RK
1103 NAME="<video_name>"
1104
1105 API_PATH="https://peertube2.cpy.re/api/v1"
1106 ## AUTH
1107 client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1108 client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1109 token=$(http -b --form POST "$API_PATH/users/token" \
1110 client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
1111 username=$USERNAME \
1112 password=$PASSWORD \
1113 | jq -r ".access_token")
1114 ## VIDEO UPLOAD
1115 http -b --form POST "$API_PATH/videos/upload" \
1116 videofile@$FILE_PATH \
1117 channelId=$CHANNEL_ID \
1118 name=$NAME \
8f9e8be1 1119 "Authorization:Bearer $token"
28c8e63e
C
1120 /videos/imports:
1121 post:
b029d58a
C
1122 summary: Import a video
1123 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
28c8e63e
C
1124 security:
1125 - OAuth2: []
1126 tags:
1127 - Video
1128 responses:
1129 '200':
1130 description: successful operation
1131 content:
1132 application/json:
1133 schema:
1134 $ref: '#/components/schemas/VideoUploadResponse'
1135 requestBody:
1136 content:
1137 multipart/form-data:
1138 schema:
1139 type: object
1140 properties:
1141 torrentfile:
1142 description: Torrent File
1143 type: string
1144 format: binary
1145 targetUrl:
1146 description: HTTP target URL
1147 type: string
1148 magnetUri:
1149 description: Magnet URI
1150 type: string
1151 channelId:
1152 description: Channel id that will contain this video
1153 type: number
1154 thumbnailfile:
1155 description: Video thumbnail file
1156 type: string
0ad45af7 1157 format: binary
28c8e63e
C
1158 previewfile:
1159 description: Video preview file
1160 type: string
0ad45af7 1161 format: binary
28c8e63e 1162 privacy:
ee89e8fd 1163 $ref: '#/components/schemas/VideoPrivacySet'
28c8e63e
C
1164 category:
1165 description: Video category
1166 type: string
1167 licence:
1168 description: Video licence
1169 type: string
1170 language:
1171 description: Video language
1172 type: string
1173 description:
1174 description: Video description
1175 type: string
1176 waitTranscoding:
1177 description: Whether or not we wait transcoding before publish the video
1178 type: string
1179 support:
1180 description: Text describing how to support the video uploader
1181 type: string
1182 nsfw:
1183 description: Whether or not this video contains sensitive content
1184 type: string
1185 name:
1186 description: Video name
1187 type: string
1188 tags:
07d02f6d 1189 description: Video tags (maximum 5 tags each between 2 and 30 characters)
28c8e63e 1190 type: array
07d02f6d
FS
1191 minItems: 1
1192 maxItems: 5
28c8e63e
C
1193 items:
1194 type: string
07d02f6d
FS
1195 minLength: 2
1196 maxLength: 30
28c8e63e
C
1197 commentsEnabled:
1198 description: Enable or disable comments for this video
1199 type: string
5dce26d2
C
1200 scheduleUpdate:
1201 $ref: '#/components/schemas/VideoScheduledUpdate'
28c8e63e
C
1202 required:
1203 - channelId
1204 - name
0ad45af7
FS
1205 encoding:
1206 torrentfile:
1207 contentType: application/x-bittorrent
1208 thumbnailfile:
1209 contentType: image/jpeg
1210 previewfile:
1211 contentType: image/jpeg
c360c494 1212 /videos/abuse:
1569a818 1213 get:
b029d58a 1214 summary: List video abuses
94ff4c23 1215 security:
b029d58a
C
1216 - OAuth2:
1217 - admin
1218 - moderator
1569a818 1219 tags:
50e16ccf 1220 - Video Abuses
44cb3b85 1221 parameters:
3e9e6f2f
RK
1222 - $ref: '#/components/parameters/start'
1223 - $ref: '#/components/parameters/count'
fd5af7a2 1224 - $ref: '#/components/parameters/abusesSort'
1569a818
DG
1225 responses:
1226 '200':
1227 description: successful operation
3e9e6f2f
RK
1228 content:
1229 application/json:
1230 schema:
1231 type: array
1232 items:
1233 $ref: '#/components/schemas/VideoAbuse'
1234 '/videos/{id}/abuse':
1569a818 1235 post:
b029d58a 1236 summary: Report an abuse
94ff4c23 1237 security:
3e9e6f2f 1238 - OAuth2: []
1569a818 1239 tags:
50e16ccf
C
1240 - Video Abuses
1241 - Videos
1569a818 1242 parameters:
cb9d028a 1243 - $ref: '#/components/parameters/idOrUUID'
50e16ccf
C
1244 requestBody:
1245 content:
1246 application/json:
1247 schema:
1248 type: object
1249 properties:
1250 reason:
1251 description: Reason why the user reports this video
1252 type: string
1253 responses:
1254 '204':
1255 description: successful operation
1256 '/videos/{id}/abuse/{abuseId}':
1257 put:
1258 summary: Update an abuse
1259 security:
1260 - OAuth2:
1261 - admin
1262 - moderator
1263 tags:
1264 - Video Abuses
1569a818
DG
1265 responses:
1266 '204':
c1843150 1267 description: successful operation
50e16ccf
C
1268 parameters:
1269 - $ref: '#/components/parameters/idOrUUID'
1270 - $ref: '#/components/parameters/abuseId'
1271 requestBody:
1272 content:
1273 application/json:
1274 schema:
1275 type: object
1276 properties:
1277 state:
1278 $ref: '#/components/schemas/VideoAbuseStateSet'
1279 moderationComment:
1280 type: string
1281 description: 'Update the comment of the video abuse for other admin/moderators'
1282 delete:
1283 summary: Delete an abuse
1284 security:
1285 - OAuth2:
1286 - admin
1287 - moderator
1288 tags:
1289 - Video Abuses
1290 responses:
1291 '204':
1292 description: successful operation
1293 parameters:
1294 - $ref: '#/components/parameters/idOrUUID'
1295 - $ref: '#/components/parameters/abuseId'
1296
3e9e6f2f 1297 '/videos/{id}/blacklist':
1569a818 1298 post:
b029d58a 1299 summary: Blacklist a video
94ff4c23 1300 security:
3e9e6f2f
RK
1301 - OAuth2:
1302 - admin
1303 - moderator
1569a818 1304 tags:
5776f78e 1305 - Video Blacklist
1569a818 1306 parameters:
cb9d028a 1307 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1308 responses:
1309 '204':
c1843150 1310 description: successful operation
1569a818 1311 delete:
2963c343 1312 summary: Delete an entry of the blacklist of a video by its id
94ff4c23 1313 security:
3e9e6f2f
RK
1314 - OAuth2:
1315 - admin
1316 - moderator
1569a818 1317 tags:
5776f78e 1318 - Video Blacklist
1569a818 1319 parameters:
cb9d028a 1320 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1321 responses:
1322 '204':
c1843150 1323 description: successful operation
c360c494 1324 /videos/blacklist:
1569a818 1325 get:
b029d58a 1326 summary: List blacklisted videos
94ff4c23 1327 security:
3e9e6f2f
RK
1328 - OAuth2:
1329 - admin
1330 - moderator
1569a818 1331 tags:
5776f78e 1332 - Video Blacklist
44cb3b85 1333 parameters:
3e9e6f2f
RK
1334 - $ref: '#/components/parameters/start'
1335 - $ref: '#/components/parameters/count'
fd5af7a2 1336 - $ref: '#/components/parameters/blacklistsSort'
1569a818
DG
1337 responses:
1338 '200':
1339 description: successful operation
3e9e6f2f
RK
1340 content:
1341 application/json:
1342 schema:
1343 type: array
1344 items:
1345 $ref: '#/components/schemas/VideoBlacklist'
67ae04a5
C
1346 /videos/{id}/captions:
1347 get:
b029d58a 1348 summary: List captions of a video
67ae04a5
C
1349 tags:
1350 - Video Caption
1351 parameters:
cb9d028a 1352 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
1353 responses:
1354 '200':
1355 description: successful operation
1356 content:
1357 application/json:
1358 schema:
1359 type: object
1360 properties:
1361 total:
1362 type: integer
1363 data:
1364 type: array
1365 items:
1366 $ref: '#/components/schemas/VideoCaption'
1367 /videos/{id}/captions/{captionLanguage}:
1368 put:
1369 summary: Add or replace a video caption
1370 tags:
1371 - Video Caption
1372 parameters:
cb9d028a 1373 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
1374 - $ref: '#/components/parameters/captionLanguage'
1375 requestBody:
1376 content:
1377 multipart/form-data:
1378 schema:
1379 type: object
1380 properties:
1381 captionfile:
1382 description: The file to upload.
1383 type: string
1384 format: binary
0ad45af7
FS
1385 encoding:
1386 captionfile:
205ed5b7 1387 contentType: text/vtt, application/x-subrip, text/plain
67ae04a5
C
1388 responses:
1389 '204':
c1843150 1390 description: successful operation
67ae04a5
C
1391 delete:
1392 summary: Delete a video caption
1393 tags:
1394 - Video Caption
1395 parameters:
cb9d028a 1396 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
1397 - $ref: '#/components/parameters/captionLanguage'
1398 responses:
1399 '204':
c1843150 1400 description: successful operation
48dce1c9 1401 /video-channels:
1569a818 1402 get:
b029d58a 1403 summary: List video channels
1569a818 1404 tags:
b029d58a 1405 - Video Channels
44cb3b85 1406 parameters:
3e9e6f2f
RK
1407 - $ref: '#/components/parameters/start'
1408 - $ref: '#/components/parameters/count'
1409 - $ref: '#/components/parameters/sort'
1569a818
DG
1410 responses:
1411 '200':
1412 description: successful operation
3e9e6f2f
RK
1413 content:
1414 application/json:
1415 schema:
1416 type: array
1417 items:
1418 $ref: '#/components/schemas/VideoChannel'
1569a818 1419 post:
b029d58a 1420 summary: Create a video channel
94ff4c23 1421 security:
3e9e6f2f 1422 - OAuth2: []
1569a818 1423 tags:
b029d58a 1424 - Video Channels
1569a818
DG
1425 responses:
1426 '204':
c1843150 1427 description: successful operation
3e9e6f2f 1428 requestBody:
7d14d4d2
C
1429 content:
1430 application/json:
1431 schema:
1432 $ref: '#/components/schemas/VideoChannelCreate'
9ce3d302 1433 '/video-channels/{channelHandle}':
1569a818 1434 get:
b029d58a 1435 summary: Get a video channel
1569a818 1436 tags:
b029d58a 1437 - Video Channels
1569a818 1438 parameters:
9ce3d302 1439 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
1440 responses:
1441 '200':
1442 description: successful operation
3e9e6f2f
RK
1443 content:
1444 application/json:
1445 schema:
1446 $ref: '#/components/schemas/VideoChannel'
1569a818 1447 put:
b029d58a 1448 summary: Update a video channel
94ff4c23 1449 security:
3e9e6f2f 1450 - OAuth2: []
1569a818 1451 tags:
b029d58a 1452 - Video Channels
1569a818 1453 parameters:
9ce3d302 1454 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
1455 responses:
1456 '204':
c1843150 1457 description: successful operation
3e9e6f2f 1458 requestBody:
7d14d4d2
C
1459 content:
1460 application/json:
1461 schema:
1462 $ref: '#/components/schemas/VideoChannelUpdate'
1569a818 1463 delete:
b029d58a 1464 summary: Delete a video channel
94ff4c23 1465 security:
3e9e6f2f 1466 - OAuth2: []
1569a818 1467 tags:
b029d58a 1468 - Video Channels
1569a818 1469 parameters:
9ce3d302 1470 - $ref: '#/components/parameters/channelHandle'
cc918ac3
C
1471 responses:
1472 '204':
c1843150 1473 description: successful operation
9ce3d302 1474 '/video-channels/{channelHandle}/videos':
cc918ac3 1475 get:
b029d58a 1476 summary: List videos of a video channel
cc918ac3 1477 tags:
048b6946 1478 - Video
b029d58a 1479 - Video Channels
cc918ac3 1480 parameters:
9ce3d302 1481 - $ref: '#/components/parameters/channelHandle'
59c794a5
C
1482 - $ref: '#/components/parameters/categoryOneOf'
1483 - $ref: '#/components/parameters/tagsOneOf'
1484 - $ref: '#/components/parameters/tagsAllOf'
1485 - $ref: '#/components/parameters/licenceOneOf'
1486 - $ref: '#/components/parameters/languageOneOf'
1487 - $ref: '#/components/parameters/nsfw'
1488 - $ref: '#/components/parameters/filter'
1489 - $ref: '#/components/parameters/skipCount'
1490 - $ref: '#/components/parameters/start'
1491 - $ref: '#/components/parameters/count'
1492 - $ref: '#/components/parameters/videosSort'
1569a818 1493 responses:
cc918ac3 1494 '200':
1569a818 1495 description: successful operation
3e9e6f2f
RK
1496 content:
1497 application/json:
1498 schema:
048b6946 1499 $ref: '#/components/schemas/VideoListResponse'
c1843150
C
1500
1501 /video-playlists/privacies:
1502 get:
1503 summary: List available playlist privacies
1504 tags:
1505 - Video Playlists
1506 responses:
1507 '200':
1508 description: successful operation
1509 content:
1510 application/json:
1511 schema:
1512 type: array
1513 items:
1514 type: string
1515
71810d0b
RK
1516 /video-playlists:
1517 get:
b029d58a 1518 summary: List video playlists
71810d0b 1519 tags:
b029d58a 1520 - Video Playlists
71810d0b
RK
1521 parameters:
1522 - $ref: '#/components/parameters/start'
1523 - $ref: '#/components/parameters/count'
1524 - $ref: '#/components/parameters/sort'
1525 responses:
1526 '200':
1527 description: successful operation
1528 content:
1529 application/json:
1530 schema:
1531 type: array
1532 items:
1533 $ref: '#/components/schemas/VideoPlaylist'
c1843150
C
1534 post:
1535 summary: Create a video playlist
1536 description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
1537 security:
1538 - OAuth2: []
1539 tags:
1540 - Video Playlists
1541 responses:
1542 '200':
1543 description: successful operation
1544 content:
1545 application/json:
1546 schema:
1547 type: object
1548 properties:
1549 videoPlaylist:
1550 type: object
1551 properties:
1552 id:
1553 type: number
1554 uuid:
1555 type: string
1556 requestBody:
1557 content:
1558 multipart/form-data:
1559 schema:
1560 type: object
1561 properties:
1562 displayName:
1563 description: Video playlist display name
1564 type: string
1565 thumbnailfile:
1566 description: Video playlist thumbnail file
1567 type: string
1568 format: binary
1569 privacy:
1570 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1571 description:
1572 description: Video playlist description
1573 type: string
1574 videoChannelId:
1575 description: Video channel in which the playlist will be published
1576 type: number
1577 required:
1578 - displayName
1579
1580 /video-playlists/{id}:
1581 get:
1582 summary: Get a video playlist
1583 tags:
1584 - Video Playlists
1585 parameters:
1586 - $ref: '#/components/parameters/idOrUUID'
1587 responses:
1588 '200':
1589 description: successful operation
1590 content:
1591 application/json:
1592 schema:
1593 $ref: '#/components/schemas/VideoPlaylist'
1594 put:
1595 summary: Update a video playlist
1596 description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
1597 security:
1598 - OAuth2: []
1599 tags:
1600 - Video Playlists
1601 responses:
1602 '204':
1603 description: successful operation
1604 parameters:
1605 - $ref: '#/components/parameters/idOrUUID'
1606 requestBody:
1607 content:
1608 multipart/form-data:
1609 schema:
1610 type: object
1611 properties:
1612 displayName:
1613 description: Video playlist display name
1614 type: string
1615 thumbnailfile:
1616 description: Video playlist thumbnail file
1617 type: string
1618 format: binary
1619 privacy:
1620 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1621 description:
1622 description: Video playlist description
1623 type: string
1624 videoChannelId:
1625 description: Video channel in which the playlist will be published
1626 type: number
1627 delete:
1628 summary: Delete a video playlist
1629 security:
1630 - OAuth2: []
1631 tags:
1632 - Video Playlists
1633 parameters:
1634 - $ref: '#/components/parameters/idOrUUID'
1635 responses:
1636 '204':
1637 description: successful operation
1638
1639 /video-playlists/{id}/videos:
1640 get:
1641 summary: 'List videos of a playlist'
1642 tags:
1643 - Videos
1644 - Video Playlists
1645 parameters:
1646 - $ref: '#/components/parameters/idOrUUID'
1647 responses:
1648 '200':
1649 description: successful operation
1650 content:
1651 application/json:
1652 schema:
1653 $ref: '#/components/schemas/VideoListResponse'
1654 post:
1655 summary: 'Add a video in a playlist'
1656 security:
1657 - OAuth2: []
1658 tags:
1659 - Videos
1660 - Video Playlists
1661 parameters:
1662 - $ref: '#/components/parameters/idOrUUID'
1663 responses:
1664 '200':
1665 description: successful operation
1666 content:
1667 application/json:
1668 schema:
1669 type: object
1670 properties:
1671 videoPlaylistElement:
1672 type: object
1673 properties:
1674 id:
1675 type: number
1676 requestBody:
1677 content:
1678 application/json:
1679 schema:
1680 type: object
1681 properties:
1682 videoId:
1683 type: number
1684 description: 'Video to add in the playlist'
1685 startTimestamp:
1686 type: number
1687 description: 'Start the video at this specific timestamp (in seconds)'
1688 stopTimestamp:
1689 type: number
1690 description: 'Stop the video at this specific timestamp (in seconds)'
1691 required:
1692 - videoId
1693
1694 /video-playlists/{id}/videos/reorder:
1695 post:
1696 summary: 'Reorder a playlist'
1697 security:
1698 - OAuth2: []
1699 tags:
1700 - Video Playlists
1701 parameters:
1702 - $ref: '#/components/parameters/idOrUUID'
1703 responses:
1704 '204':
1705 description: successful operation
1706 requestBody:
1707 content:
1708 application/json:
1709 schema:
1710 type: object
1711 properties:
1712 startPosition:
1713 type: number
1714 description: 'Start position of the element to reorder (starts from 1)'
1715 insertAfterPosition:
1716 type: number
1717 description: 'New position for the block to reorder (starts from 0, to add the block before the first element)'
1718 reorderLength:
1719 type: number
1720 description: 'How many element from startPosition to reorder (minimum length is 1)'
1721 required:
1722 - startPosition
1723 - insertAfterPosition
1724
1725 /video-playlists/{id}/videos/:playlistElementId:
1726 put:
1727 summary: 'Update a playlist element'
1728 security:
1729 - OAuth2: []
1730 tags:
1731 - Video Playlists
1732 parameters:
1733 - $ref: '#/components/parameters/idOrUUID'
1734 - $ref: '#/components/parameters/playlistElementId'
1735 responses:
1736 '204':
1737 description: successful operation
1738 requestBody:
1739 content:
1740 application/json:
1741 schema:
1742 type: object
1743 properties:
1744 startTimestamp:
1745 type: number
1746 description: 'Start the video at this specific timestamp (in seconds)'
1747 stopTimestamp:
1748 type: number
1749 description: 'Stop the video at this specific timestamp (in seconds)'
1750 delete:
1751 summary: 'Delete an element from a playlist'
1752 security:
1753 - OAuth2: []
1754 tags:
1755 - Video Playlists
1756 parameters:
1757 - $ref: '#/components/parameters/idOrUUID'
1758 - $ref: '#/components/parameters/playlistElementId'
1759 responses:
1760 '204':
1761 description: successful operation
1762
3e9e6f2f 1763 '/accounts/{name}/video-channels':
6b738c7a 1764 get:
b029d58a 1765 summary: List video channels of an account
6b738c7a 1766 tags:
b029d58a
C
1767 - Video Channels
1768 - Accounts
6b738c7a 1769 parameters:
3e9e6f2f 1770 - $ref: '#/components/parameters/name'
6b738c7a
C
1771 responses:
1772 '200':
1773 description: successful operation
3e9e6f2f
RK
1774 content:
1775 application/json:
1776 schema:
1777 type: array
1778 items:
1779 $ref: '#/components/schemas/VideoChannel'
c100a614
YB
1780 '/accounts/{name}/ratings':
1781 get:
b029d58a 1782 summary: List ratings of an account
c100a614
YB
1783 security:
1784 - OAuth2: []
1785 tags:
b029d58a 1786 - Accounts
c100a614 1787 parameters:
cb9d028a 1788 - $ref: '#/components/parameters/name'
c100a614
YB
1789 - $ref: '#/components/parameters/start'
1790 - $ref: '#/components/parameters/count'
1791 - $ref: '#/components/parameters/sort'
1792 - name: rating
1793 in: query
1794 required: false
b3d1054e 1795 description: Optionally filter which ratings to retrieve
c100a614
YB
1796 schema:
1797 type: string
1798 enum:
1799 - like
1800 - dislike
1801 responses:
1802 '200':
1803 description: successful operation
1804 content:
1805 application/json:
1806 schema:
1807 type: array
1808 items:
1809 $ref: '#/components/schemas/VideoRating'
3e9e6f2f 1810 '/videos/{id}/comment-threads':
1569a818 1811 get:
b029d58a 1812 summary: List threads of a video
1569a818 1813 tags:
b029d58a 1814 - Video Comments
1569a818 1815 parameters:
cb9d028a 1816 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f
RK
1817 - $ref: '#/components/parameters/start'
1818 - $ref: '#/components/parameters/count'
71810d0b 1819 - $ref: '#/components/parameters/commentsSort'
1569a818
DG
1820 responses:
1821 '200':
1822 description: successful operation
3e9e6f2f
RK
1823 content:
1824 application/json:
1825 schema:
1826 $ref: '#/components/schemas/CommentThreadResponse'
1569a818 1827 post:
b029d58a 1828 summary: Create a thread
94ff4c23 1829 security:
3e9e6f2f 1830 - OAuth2: []
1569a818 1831 tags:
b029d58a 1832 - Video Comments
1569a818 1833 parameters:
cb9d028a 1834 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1835 responses:
1836 '200':
1837 description: successful operation
3e9e6f2f
RK
1838 content:
1839 application/json:
1840 schema:
1841 $ref: '#/components/schemas/CommentThreadPostResponse'
98639806
C
1842 requestBody:
1843 content:
1844 application/json:
1845 schema:
1846 type: object
1847 properties:
1848 text:
1849 type: string
1850 description: 'Text comment'
1851 required:
1852 - text
1853
3e9e6f2f 1854 '/videos/{id}/comment-threads/{threadId}':
1569a818 1855 get:
b029d58a 1856 summary: Get a thread
1569a818 1857 tags:
b029d58a 1858 - Video Comments
1569a818 1859 parameters:
cb9d028a
C
1860 - $ref: '#/components/parameters/idOrUUID'
1861 - $ref: '#/components/parameters/threadId'
1569a818
DG
1862 responses:
1863 '200':
1864 description: successful operation
3e9e6f2f
RK
1865 content:
1866 application/json:
1867 schema:
1868 $ref: '#/components/schemas/VideoCommentThreadTree'
1869 '/videos/{id}/comments/{commentId}':
1569a818 1870 post:
b029d58a 1871 summary: Reply to a thread of a video
94ff4c23 1872 security:
3e9e6f2f 1873 - OAuth2: []
1569a818 1874 tags:
b029d58a 1875 - Video Comments
1569a818 1876 parameters:
cb9d028a 1877 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f 1878 - $ref: '#/components/parameters/commentId'
1569a818
DG
1879 responses:
1880 '200':
1881 description: successful operation
3e9e6f2f
RK
1882 content:
1883 application/json:
1884 schema:
1885 $ref: '#/components/schemas/CommentThreadPostResponse'
98639806
C
1886 requestBody:
1887 content:
1888 application/json:
1889 schema:
1890 type: object
1891 properties:
1892 text:
1893 type: string
1894 description: 'Text comment'
1895 required:
1896 - text
1897
1569a818 1898 delete:
b029d58a 1899 summary: Delete a comment or a reply
94ff4c23 1900 security:
3e9e6f2f 1901 - OAuth2: []
1569a818 1902 tags:
b029d58a 1903 - Video Comments
1569a818 1904 parameters:
cb9d028a 1905 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f 1906 - $ref: '#/components/parameters/commentId'
1569a818
DG
1907 responses:
1908 '204':
c1843150 1909 description: successful operation
3e9e6f2f 1910 '/videos/{id}/rate':
1569a818 1911 put:
b029d58a 1912 summary: Like/dislike a video
94ff4c23 1913 security:
3e9e6f2f 1914 - OAuth2: []
1569a818 1915 tags:
b029d58a 1916 - Video Rates
1569a818 1917 parameters:
cb9d028a 1918 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1919 responses:
1920 '204':
c1843150 1921 description: successful operation
fb72c193
DL
1922 /search/videos:
1923 get:
1924 tags:
1925 - Search
b029d58a 1926 summary: Search videos
fb72c193 1927 parameters:
59c794a5
C
1928 - $ref: '#/components/parameters/categoryOneOf'
1929 - $ref: '#/components/parameters/tagsOneOf'
1930 - $ref: '#/components/parameters/tagsAllOf'
1931 - $ref: '#/components/parameters/licenceOneOf'
1932 - $ref: '#/components/parameters/languageOneOf'
1933 - $ref: '#/components/parameters/nsfw'
1934 - $ref: '#/components/parameters/filter'
1935 - $ref: '#/components/parameters/skipCount'
3e9e6f2f
RK
1936 - $ref: '#/components/parameters/start'
1937 - $ref: '#/components/parameters/count'
59c794a5 1938 - $ref: '#/components/parameters/videosSort'
fd5af7a2 1939 - $ref: '#/components/parameters/videosSearchSort'
655b5490 1940 - name: search
fb72c193
DL
1941 in: query
1942 required: true
3e9e6f2f
RK
1943 description: String to search
1944 schema:
1945 type: string
fb72c193
DL
1946 responses:
1947 '200':
1948 description: successful operation
3e9e6f2f
RK
1949 content:
1950 application/json:
1951 schema:
048b6946 1952 $ref: '#/components/schemas/VideoListResponse'
3e9e6f2f 1953servers:
6441981b
RK
1954 - url: 'https://peertube.cpy.re/api/v1'
1955 description: Live Test Server (live data - stable version)
8f9e8be1 1956 - url: 'https://peertube2.cpy.re/api/v1'
b029d58a 1957 description: Live Test Server (live data - latest nighlty version)
6441981b 1958 - url: 'https://peertube3.cpy.re/api/v1'
b029d58a 1959 description: Live Test Server (live data - latest RC version)
3e9e6f2f
RK
1960components:
1961 parameters:
1962 start:
1963 name: start
1964 in: query
1965 required: false
1966 description: Offset
1967 schema:
1569a818 1968 type: number
3e9e6f2f
RK
1969 count:
1970 name: count
1971 in: query
1972 required: false
1973 description: Number of items
1974 schema:
1569a818 1975 type: number
3e9e6f2f
RK
1976 sort:
1977 name: sort
1978 in: query
1979 required: false
1980 description: Sort column (-createdAt for example)
1981 schema:
1982 type: string
fd5af7a2
RK
1983 videosSort:
1984 name: sort
1985 in: query
1986 required: false
1987 description: Sort videos by criteria
1988 schema:
1989 type: string
1990 enum:
1991 - -name
1992 - -duration
1993 - -createdAt
1994 - -publishedAt
1995 - -views
1996 - -likes
1997 - -trending
1998 videosSearchSort:
1999 name: sort
2000 in: query
2001 required: false
2002 description: Sort videos by criteria
2003 schema:
2004 type: string
2005 enum:
2006 - -name
2007 - -duration
2008 - -createdAt
2009 - -publishedAt
2010 - -views
2011 - -likes
2012 - -match
71810d0b
RK
2013 commentsSort:
2014 name: sort
2015 in: query
2016 required: false
2017 description: Sort comments by criteria
2018 schema:
2019 type: string
2020 enum:
2021 - -createdAt
2022 - -totalReplies
fd5af7a2
RK
2023 blacklistsSort:
2024 name: sort
2025 in: query
2026 required: false
2027 description: Sort blacklists by criteria
2028 schema:
2029 type: string
2030 enum:
2031 - -id
2032 - -name
2033 - -duration
2034 - -views
2035 - -likes
2036 - -dislikes
2037 - -uuid
2038 - -createdAt
2039 usersSort:
2040 name: sort
2041 in: query
2042 required: false
2043 description: Sort users by criteria
2044 schema:
2045 type: string
2046 enum:
2047 - -id
2048 - -username
2049 - -createdAt
2050 abusesSort:
2051 name: sort
2052 in: query
2053 required: false
2054 description: Sort abuses by criteria
2055 schema:
2056 type: string
2057 enum:
2058 - -id
2059 - -createdAt
2060 - -state
3e9e6f2f
RK
2061 name:
2062 name: name
2063 in: path
2064 required: true
2065 description: >-
2066 The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
2067 example)
2068 schema:
2069 type: string
2070 id:
2071 name: id
2072 in: path
2073 required: true
2074 description: The user id
2075 schema:
1569a818 2076 type: number
cb9d028a 2077 idOrUUID:
3e9e6f2f
RK
2078 name: id
2079 in: path
2080 required: true
c1843150 2081 description: The object id or uuid
3e9e6f2f
RK
2082 schema:
2083 type: string
c1843150
C
2084 playlistElementId:
2085 name: playlistElementId
2086 in: path
2087 required: true
2088 description: Playlist element id
2089 schema:
2090 type: number
50e16ccf
C
2091 abuseId:
2092 name: abuseId
2093 in: path
2094 required: true
2095 description: Video abuse id
2096 schema:
2097 type: number
67ae04a5
C
2098 captionLanguage:
2099 name: captionLanguage
2100 in: path
2101 required: true
2102 description: The caption language
2103 schema:
2104 type: string
9ce3d302
C
2105 channelHandle:
2106 name: channelHandle
3e9e6f2f
RK
2107 in: path
2108 required: true
9ce3d302 2109 description: "The video channel handle (example: 'my_username@example.com' or 'my_username')"
3e9e6f2f
RK
2110 schema:
2111 type: string
cb9d028a
C
2112 subscriptionHandle:
2113 name: subscriptionHandle
2114 in: path
2115 required: true
2116 description: "The subscription handle (example: 'my_username@example.com' or 'my_username')"
2117 schema:
2118 type: string
2119 threadId:
3e9e6f2f
RK
2120 name: threadId
2121 in: path
2122 required: true
cb9d028a
C
2123 description: The thread id (root comment id)
2124 schema:
2125 type: number
2126 commentId:
2127 name: commentId
2128 in: path
2129 required: true
3e9e6f2f
RK
2130 description: The comment id
2131 schema:
c360c494 2132 type: number
fd5af7a2
RK
2133 categoryOneOf:
2134 name: categoryOneOf
2135 in: query
2136 required: false
59c794a5 2137 description: category id of the video (see /videos/categories)
fd5af7a2
RK
2138 schema:
2139 oneOf:
2140 - type: number
2141 - type: array
2142 items:
2143 type: number
2beb9895
RK
2144 style: form
2145 explode: false
fd5af7a2
RK
2146 tagsOneOf:
2147 name: tagsOneOf
2148 in: query
2149 required: false
2150 description: tag(s) of the video
2151 schema:
2152 oneOf:
2153 - type: string
2154 - type: array
2155 items:
2156 type: string
2beb9895
RK
2157 style: form
2158 explode: false
fd5af7a2
RK
2159 tagsAllOf:
2160 name: tagsAllOf
2161 in: query
2162 required: false
2163 description: tag(s) of the video, where all should be present in the video
2164 schema:
2165 oneOf:
2166 - type: string
2167 - type: array
2168 items:
2169 type: string
2beb9895
RK
2170 style: form
2171 explode: false
fd5af7a2
RK
2172 languageOneOf:
2173 name: languageOneOf
2174 in: query
2175 required: false
59c794a5 2176 description: language id of the video (see /videos/languages). Use _unknown to filter on videos that don't have a video language
fd5af7a2
RK
2177 schema:
2178 oneOf:
2beb9895 2179 - type: string
fd5af7a2
RK
2180 - type: array
2181 items:
2beb9895
RK
2182 type: string
2183 style: form
2184 explode: false
fd5af7a2
RK
2185 licenceOneOf:
2186 name: licenceOneOf
2187 in: query
2188 required: false
59c794a5 2189 description: licence id of the video (see /videos/licences)
fd5af7a2
RK
2190 schema:
2191 oneOf:
2192 - type: number
2193 - type: array
2194 items:
2195 type: number
2beb9895
RK
2196 style: form
2197 explode: false
59c794a5
C
2198 skipCount:
2199 name: skipCount
2200 in: query
2201 required: false
2202 description: if you don't need the `total` in the response
2203 schema:
2204 type: string
2205 enum:
2206 - 'true'
2207 - 'false'
fd5af7a2
RK
2208 nsfw:
2209 name: nsfw
2210 in: query
2211 required: false
2212 description: whether to include nsfw videos, if any
2213 schema:
2214 type: string
2215 enum:
2216 - 'true'
2217 - 'false'
2218 filter:
2219 name: filter
2220 in: query
2221 required: false
2222 description: >
2223 Special filters (local for instance) which might require special rights:
2224 * `local` - only videos local to the instance
2225 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
2226 schema:
2227 type: string
2228 enum:
2229 - local
2230 - all-local
e76d5784
RK
2231 subscriptionsUris:
2232 name: uris
2233 in: query
2234 required: true
2235 description: list of uris to check if each is part of the user subscriptions
2236 schema:
2237 type: array
2238 items:
2239 type: string
3e9e6f2f
RK
2240 securitySchemes:
2241 OAuth2:
2242 description: >
2243 In the header: *Authorization: Bearer <token\>*
2244
2245
2246 Authenticating via OAuth requires the following steps:
2247
2248
2249 - Have an account with sufficient authorization levels
2250
46e9407c 2251 - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
3e9e6f2f
RK
2252 Bearer Token
2253
2254 - Make Authenticated Requests
2255 type: oauth2
2256 flows:
2257 password:
2258 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
2259 scopes:
2260 admin: Admin scope
2261 moderator: Moderator scope
2262 user: User scope
2263 schemas:
2264 VideoConstantNumber:
2265 properties:
2266 id:
2267 type: number
2268 label:
2269 type: string
2270 VideoConstantString:
2271 properties:
2272 id:
2273 type: string
2274 label:
2275 type: string
c1843150
C
2276
2277 VideoPlaylistPrivacySet:
2278 type: integer
2279 enum:
2280 - 1
2281 - 2
2282 - 3
2283 description: 'The video playlist privacy (Public = 1, Unlisted = 2, Private = 3)'
2284 VideoPlaylistPrivacyConstant:
2285 properties:
2286 id:
2287 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2288 label:
2289 type: string
2290
2291 VideoPlaylistTypeSet:
2292 type: integer
2293 enum:
2294 - 1
2295 - 2
2296 description: 'The video playlist type (Regular = 1, Watch Later = 2)'
2297 VideoPlaylistTypeConstant:
2298 properties:
2299 id:
2300 $ref: '#/components/schemas/VideoPlaylistTypeSet'
2301 label:
2302 type: string
2303
ee89e8fd
C
2304 VideoPrivacySet:
2305 type: integer
3e9e6f2f 2306 enum:
ee89e8fd
C
2307 - 1
2308 - 2
2309 - 3
c1843150
C
2310 - 4
2311 description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3, Internal = 4)'
ee89e8fd
C
2312 VideoPrivacyConstant:
2313 properties:
2314 id:
c1843150 2315 $ref: '#/components/schemas/VideoPrivacySet'
ee89e8fd
C
2316 label:
2317 type: string
50e16ccf 2318
5dce26d2
C
2319 VideoStateConstant:
2320 properties:
2321 id:
2322 type: integer
2323 enum:
2324 - 1
2325 - 2
2326 - 3
2327 description: 'The video state (Published = 1, to transcode = 2, to import = 3)'
2328 label:
2329 type: string
50e16ccf
C
2330
2331 VideoAbuseStateSet:
2332 type: integer
2333 enum:
2334 - 1
2335 - 2
2336 - 3
2337 description: 'The video playlist privacy (Pending = 1, Rejected = 2, Accepted = 3)'
2338 VideoAbuseStateConstant:
2339 properties:
2340 id:
2341 $ref: '#/components/schemas/VideoAbuseStateSet'
2342 label:
2343 type: string
2344
5dce26d2
C
2345 VideoResolutionConstant:
2346 properties:
2347 id:
2348 type: integer
2349 description: 'Video resolution (240, 360, 720 ...)'
2350 label:
2351 type: string
2352 VideoScheduledUpdate:
2353 properties:
2354 privacy:
2355 $ref: '#/components/schemas/VideoPrivacySet'
5dce26d2
C
2356 updateAt:
2357 type: string
2358 format: date
2359 description: When to update the video
2360 required:
2361 - updateAt
c1843150 2362 AccountSummary:
5dce26d2
C
2363 properties:
2364 id:
2365 type: number
2366 name:
2367 type: string
2368 displayName:
2369 type: string
2370 url:
2371 type: string
2372 host:
2373 type: string
2374 avatar:
2375 nullable: true
c1843150
C
2376 allOf:
2377 - $ref: '#/components/schemas/Avatar'
5dce26d2
C
2378 VideoChannelSummary:
2379 properties:
2380 id:
2381 type: number
2382 name:
2383 type: string
2384 displayName:
2385 type: string
2386 url:
2387 type: string
2388 host:
2389 type: string
2390 avatar:
2391 nullable: true
c1843150
C
2392 allOf:
2393 - $ref: '#/components/schemas/Avatar'
5dce26d2
C
2394 PlaylistElement:
2395 properties:
2396 position:
2397 type: number
2398 startTimestamp:
2399 type: number
2400 stopTimestamp:
2401 type: number
bfbd9128
C
2402 video:
2403 nullable: true
c1843150
C
2404 allOf:
2405 - $ref: '#/components/schemas/Video'
5dce26d2
C
2406 VideoFile:
2407 properties:
2408 magnetUri:
2409 type: string
2410 resolution:
2411 $ref: '#/components/schemas/VideoResolutionConstant'
2412 size:
2413 type: number
2414 description: 'Video file size in bytes'
2415 torrentUrl:
2416 type: string
0ad45af7 2417 torrentDownloadUrl:
5dce26d2
C
2418 type: string
2419 fileUrl:
2420 type: string
2421 fileDownloadUrl:
2422 type: string
2423 fps:
2424 type: number
2425 VideoStreamingPlaylists:
2426 properties:
2427 id:
2428 type: number
2429 type:
2430 type: number
2431 enum:
2432 - 1
2433 description: 'Playlist type (HLS = 1)'
2434 playlistUrl:
2435 type: string
2436 segmentsSha256Url:
2437 type: string
2438 redundancies:
2439 type: array
2440 items:
2441 type: object
2442 properties:
2443 baseUrl:
2444 type: string
3e9e6f2f
RK
2445 Video:
2446 properties:
2447 id:
2448 type: number
2449 uuid:
2450 type: string
2451 createdAt:
2452 type: string
2453 publishedAt:
2454 type: string
2455 updatedAt:
2456 type: string
5dce26d2
C
2457 originallyPublishedAt:
2458 type: string
3e9e6f2f
RK
2459 category:
2460 $ref: '#/components/schemas/VideoConstantNumber'
2461 licence:
2462 $ref: '#/components/schemas/VideoConstantNumber'
2463 language:
2464 $ref: '#/components/schemas/VideoConstantString'
2465 privacy:
ee89e8fd 2466 $ref: '#/components/schemas/VideoPrivacyConstant'
3e9e6f2f
RK
2467 description:
2468 type: string
2469 duration:
2470 type: number
2471 isLocal:
2472 type: boolean
2473 name:
2474 type: string
2475 thumbnailPath:
2476 type: string
2477 previewPath:
2478 type: string
2479 embedPath:
2480 type: string
2481 views:
2482 type: number
2483 likes:
2484 type: number
2485 dislikes:
2486 type: number
2487 nsfw:
2488 type: boolean
5dce26d2
C
2489 waitTranscoding:
2490 type: boolean
2491 nullable: true
2492 state:
2493 $ref: '#/components/schemas/VideoStateConstant'
2494 scheduledUpdate:
2495 nullable: true
c1843150
C
2496 allOf:
2497 - $ref: '#/components/schemas/VideoScheduledUpdate'
5dce26d2
C
2498 blacklisted:
2499 nullable: true
2500 type: boolean
2501 blacklistedReason:
2502 nullable: true
2503 type: string
3e9e6f2f 2504 account:
c1843150 2505 $ref: '#/components/schemas/AccountSummary'
5dce26d2
C
2506 channel:
2507 $ref: '#/components/schemas/VideoChannelSummary'
2508 userHistory:
2509 nullable: true
3e9e6f2f
RK
2510 type: object
2511 properties:
5dce26d2
C
2512 currentTime:
2513 type: number
5dce26d2
C
2514 VideoDetails:
2515 allOf:
2516 - $ref: '#/components/schemas/Video'
2517 - type: object
2518 properties:
2519 descriptionPath:
3e9e6f2f 2520 type: string
5dce26d2 2521 support:
3e9e6f2f 2522 type: string
5dce26d2
C
2523 channel:
2524 $ref: '#/components/schemas/VideoChannel'
2525 account:
2526 $ref: '#/components/schemas/Account'
2527 tags:
2528 type: array
2529 items:
2530 type: string
2531 files:
2532 type: array
2533 items:
2534 $ref: '#/components/schemas/VideoFile'
2535 commentsEnabled:
2536 type: boolean
2537 downloadEnabled:
2538 type: boolean
2539 trackerUrls:
2540 type: array
2541 items:
2542 type: string
2543 streamingPlaylists:
2544 type: array
2545 items:
2546 $ref: '#/components/schemas/VideoStreamingPlaylists'
1f82e3e8
C
2547 VideoImportStateConstant:
2548 properties:
2549 id:
2550 type: integer
2551 enum:
2552 - 1
2553 - 2
2554 - 3
2555 description: 'The video import state (Pending = 1, Success = 2, Failed = 3)'
2556 label:
2557 type: string
2558 VideoImport:
2559 properties:
2560 id:
2561 type: number
2562 targetUrl:
2563 type: string
2564 magnetUri:
2565 type: string
2566 torrentName:
2567 type: string
2568 state:
2569 type: object
2570 properties:
2571 id:
2572 $ref: '#/components/schemas/VideoImportStateConstant'
2573 label:
2574 type: string
2575 error:
2576 type: string
2577 createdAt:
2578 type: string
2579 updatedAt:
2580 type: string
2581 video:
2582 $ref: '#/components/schemas/Video'
3e9e6f2f
RK
2583 VideoAbuse:
2584 properties:
2585 id:
2586 type: number
2587 reason:
2588 type: string
2589 reporterAccount:
2590 $ref: '#/components/schemas/Account'
50e16ccf
C
2591 state:
2592 $ref: '#/components/schemas/VideoAbuseStateConstant'
2593 moderationComment:
2594 type: string
3e9e6f2f
RK
2595 video:
2596 type: object
2597 properties:
2598 id:
2599 type: number
2600 name:
2601 type: string
2602 uuid:
2603 type: string
3e9e6f2f
RK
2604 createdAt:
2605 type: string
2606 VideoBlacklist:
2607 properties:
2608 id:
2609 type: number
2610 videoId:
2611 type: number
2612 createdAt:
2613 type: string
2614 updatedAt:
2615 type: string
2616 name:
2617 type: string
2618 uuid:
2619 type: string
2620 description:
2621 type: string
2622 duration:
2623 type: number
2624 views:
2625 type: number
2626 likes:
2627 type: number
2628 dislikes:
2629 type: number
2630 nsfw:
2631 type: boolean
2632 VideoChannel:
2633 properties:
2634 displayName:
2635 type: string
2636 description:
2637 type: string
2638 isLocal:
2639 type: boolean
2640 ownerAccount:
2641 type: object
2642 properties:
2643 id:
2644 type: number
2645 uuid:
2646 type: string
71810d0b
RK
2647 VideoPlaylist:
2648 properties:
2649 id:
2650 type: number
2651 createdAt:
2652 type: string
2653 updatedAt:
2654 type: string
2655 description:
2656 type: string
2657 uuid:
2658 type: string
2659 displayName:
2660 type: string
2661 isLocal:
2662 type: boolean
2663 videoLength:
2664 type: number
2665 thumbnailPath:
2666 type: string
2667 privacy:
c1843150 2668 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
71810d0b 2669 type:
c1843150 2670 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
71810d0b 2671 ownerAccount:
c1843150
C
2672 $ref: '#/components/schemas/AccountSummary'
2673 videoChannel:
2674 $ref: '#/components/schemas/VideoChannelSummary'
3e9e6f2f
RK
2675 VideoComment:
2676 properties:
2677 id:
2678 type: number
2679 url:
2680 type: string
2681 text:
2682 type: string
2683 threadId:
2684 type: number
2685 inReplyToCommentId:
2686 type: number
2687 videoId:
2688 type: number
2689 createdAt:
2690 type: string
2691 updatedAt:
2692 type: string
5b0413dd
RK
2693 totalRepliesFromVideoAuthor:
2694 type: number
3e9e6f2f
RK
2695 totalReplies:
2696 type: number
2697 account:
2698 $ref: '#/components/schemas/Account'
2699 VideoCommentThreadTree:
2700 properties:
2701 comment:
2702 $ref: '#/components/schemas/VideoComment'
2703 children:
2704 type: array
2705 items:
2706 $ref: '#/components/schemas/VideoCommentThreadTree'
67ae04a5
C
2707 VideoCaption:
2708 properties:
2709 language:
2710 $ref: '#/components/schemas/VideoConstantString'
2711 captionPath:
2712 type: string
3e9e6f2f
RK
2713 Avatar:
2714 properties:
2715 path:
2716 type: string
2717 createdAt:
2718 type: string
2719 updatedAt:
2720 type: string
2721 Actor:
2722 properties:
2723 id:
2724 type: number
3e9e6f2f
RK
2725 url:
2726 type: string
2727 name:
2728 type: string
2729 host:
2730 type: string
2731 followingCount:
2732 type: number
2733 followersCount:
2734 type: number
2735 createdAt:
2736 type: string
2737 updatedAt:
2738 type: string
2739 avatar:
2740 $ref: '#/components/schemas/Avatar'
2741 Account:
2742 allOf:
2743 - $ref: '#/components/schemas/Actor'
2744 - properties:
2a8ae759
FS
2745 userId:
2746 type: string
3e9e6f2f
RK
2747 displayName:
2748 type: string
2a8ae759
FS
2749 description:
2750 type: string
3e9e6f2f
RK
2751 User:
2752 properties:
2753 id:
2754 type: number
2755 username:
2756 type: string
2757 email:
2758 type: string
2759 displayNSFW:
2760 type: boolean
2761 autoPlayVideo:
2762 type: boolean
2763 role:
63d17405
C
2764 type: integer
2765 enum:
2766 - 0
2767 - 1
2768 - 2
2769 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2770 roleLabel:
3e9e6f2f
RK
2771 type: string
2772 enum:
2773 - User
2774 - Moderator
2775 - Administrator
2776 videoQuota:
2777 type: number
ff40a4eb 2778 videoQuotaDaily:
fbe1bc2a 2779 type: number
3e9e6f2f
RK
2780 createdAt:
2781 type: string
2782 account:
2783 $ref: '#/components/schemas/Account'
2784 videoChannels:
2785 type: array
2786 items:
2787 $ref: '#/components/schemas/VideoChannel'
6441981b
RK
2788 UserWatchingVideo:
2789 properties:
2790 currentTime:
2791 type: number
3e9e6f2f
RK
2792 ServerConfig:
2793 properties:
2a8ae759
FS
2794 instance:
2795 type: object
2796 properties:
2797 name:
2798 type: string
2799 shortDescription:
2800 type: string
2801 defaultClientRoute:
2802 type: string
2803 isNSFW:
2804 type: boolean
2805 defaultNSFWPolicy:
2806 type: string
2807 customizations:
2808 type: object
2809 properties:
2810 javascript:
2811 type: string
2812 css:
2813 type: string
f30736c8
RK
2814 search:
2815 type: object
2816 properties:
2817 remoteUri:
2818 type: object
2819 properties:
2820 users:
2821 type: boolean
2822 anonymous:
2823 type: boolean
2a8ae759
FS
2824 plugin:
2825 type: object
2826 properties:
2827 registered:
2828 type: array
2829 items:
2830 type: string
2831 theme:
2832 type: object
2833 properties:
2834 registered:
2835 type: array
2836 items:
2837 type: string
2838 email:
2839 type: object
2840 properties:
2841 enabled:
2842 type: boolean
2843 contactForm:
2844 type: object
2845 properties:
2846 enabled:
2847 type: boolean
2848 serverVersion:
2849 type: string
2850 serverCommit:
2851 type: string
3e9e6f2f
RK
2852 signup:
2853 type: object
2854 properties:
2855 allowed:
2856 type: boolean
2a8ae759
FS
2857 allowedForCurrentIP:
2858 type: boolean
2859 requiresEmailVerification:
2860 type: boolean
3e9e6f2f
RK
2861 transcoding:
2862 type: object
2863 properties:
2a8ae759
FS
2864 hls:
2865 type: object
2866 properties:
2867 enabled:
2868 type: boolean
f30736c8
RK
2869 webtorrent:
2870 type: object
2871 properties:
2872 enabled:
2873 type: boolean
3e9e6f2f
RK
2874 enabledResolutions:
2875 type: array
2876 items:
2877 type: number
2a8ae759
FS
2878 import:
2879 type: object
2880 properties:
2881 videos:
2882 type: object
2883 properties:
2884 http:
2885 type: object
2886 properties:
2887 enabled:
2888 type: boolean
2889 torrent:
2890 type: object
2891 properties:
2892 enabled:
2893 type: boolean
2894 autoBlacklist:
2895 type: object
2896 properties:
2897 videos:
2898 type: object
2899 properties:
2900 ofUsers:
2901 type: object
2902 properties:
2903 enabled:
2904 type: boolean
3e9e6f2f
RK
2905 avatar:
2906 type: object
2907 properties:
2908 file:
2909 type: object
2910 properties:
2911 size:
2912 type: object
2913 properties:
2914 max:
2915 type: number
2916 extensions:
2917 type: array
2918 items:
2919 type: string
2920 video:
2921 type: object
2922 properties:
2a8ae759
FS
2923 image:
2924 type: object
2925 properties:
2926 extensions:
2927 type: array
2928 items:
2929 type: string
2930 size:
2931 type: object
2932 properties:
2933 max:
2934 type: number
3e9e6f2f
RK
2935 file:
2936 type: object
2937 properties:
2938 extensions:
2939 type: array
2940 items:
2941 type: string
2a8ae759
FS
2942 videoCaption:
2943 type: object
2944 properties:
2945 file:
2946 type: object
2947 properties:
2948 size:
2949 type: object
2950 properties:
2951 max:
2952 type: number
2953 extensions:
2954 type: array
2955 items:
2956 type: string
2957 user:
2958 type: object
2959 properties:
2960 videoQuota:
2961 type: number
2962 videoQuotaDaily:
2963 type: number
2964 trending:
2965 type: object
2966 properties:
2967 videos:
2968 type: object
2969 properties:
2970 intervalDays:
2971 type: number
2972 tracker:
747b17c7 2973 type: object
2a8ae759
FS
2974 properties:
2975 enabled:
2976 type: boolean
f30736c8
RK
2977 followings:
2978 type: object
2979 properties:
2980 instance:
2981 type: object
2982 properties:
2983 autoFollowIndex:
2984 type: object
2985 properties:
2986 indexUrl:
2987 type: string
2a8ae759
FS
2988 ServerConfigAbout:
2989 properties:
2990 instance:
2991 type: object
2992 properties:
2993 name:
2994 type: string
2995 shortDescription:
2996 type: string
2997 description:
2998 type: string
2999 terms:
3000 type: string
3001 ServerConfigCustom:
3002 properties:
3003 instance:
3004 type: object
3005 properties:
3006 name:
3007 type: string
3008 shortDescription:
3009 type: string
3010 description:
3011 type: string
3012 terms:
3013 type: string
3014 defaultClientRoute:
3015 type: string
3016 isNSFW:
3017 type: boolean
3018 defaultNSFWPolicy:
3019 type: string
3020 customizations:
3021 type: object
3022 properties:
3023 javascript:
3024 type: string
3025 css:
3026 type: string
3027 theme:
3028 type: object
3029 properties:
3030 default:
3031 type: string
3032 services:
3033 type: object
3034 properties:
3035 twitter:
3036 type: object
3037 properties:
3038 username:
3039 type: string
3040 whitelisted:
3041 type: boolean
3042 cache:
3043 type: object
3044 properties:
3045 previews:
3046 type: object
3047 properties:
3048 size:
3049 type: number
3050 captions:
3051 type: object
3052 properties:
3053 size:
3054 type: number
3055 signup:
3056 type: object
3057 properties:
3058 enabled:
3059 type: boolean
3060 limit:
3061 type: number
3062 requiresEmailVerification:
3063 type: boolean
3064 admin:
3065 type: object
3066 properties:
3067 email:
3068 type: string
3069 contactForm:
3070 type: object
3071 properties:
3072 enabled:
3073 type: boolean
3074 user:
3075 type: object
3076 properties:
3077 videoQuota:
3078 type: number
3079 videoQuotaDaily:
3080 type: number
3081 transcoding:
3082 type: object
3083 properties:
3084 enabled:
3085 type: boolean
3086 allowAdditionalExtensions:
3087 type: boolean
3088 allowAudioFiles:
3089 type: boolean
3090 threads:
3091 type: number
3092 resolutions:
3093 type: object
3094 properties:
3095 240p:
3096 type: boolean
3097 360p:
3098 type: boolean
3099 480p:
3100 type: boolean
3101 720p:
3102 type: boolean
3103 1080p:
3104 type: boolean
3105 2160p:
3106 type: boolean
3107 hls:
3108 type: object
3109 properties:
3110 enabled:
3111 type: boolean
3112 import:
3113 type: object
3114 properties:
3115 videos:
3116 type: object
3117 properties:
3118 http:
3119 type: object
3120 properties:
3121 enabled:
3122 type: boolean
3123 torrent:
3124 type: object
3125 properties:
3126 enabled:
3127 type: boolean
3128 autoBlacklist:
3129 type: object
3130 properties:
3131 videos:
3132 type: object
3133 properties:
3134 ofUsers:
3135 type: object
3136 properties:
3137 enabled:
3138 type: boolean
3139 followers:
3140 type: object
3141 properties:
3142 instance:
3143 type: object
3144 properties:
3145 enabled:
3146 type: boolean
3147 manualApproval:
3148 type: boolean
3e9e6f2f
RK
3149 Follow:
3150 properties:
3151 id:
3152 type: number
3153 follower:
3154 $ref: '#/components/schemas/Actor'
3155 following:
3156 $ref: '#/components/schemas/Actor'
3157 score:
3158 type: number
3159 state:
3160 type: string
3161 enum:
3162 - pending
3163 - accepted
3164 createdAt:
3165 type: string
3166 updatedAt:
3167 type: string
3168 Job:
3169 properties:
3170 id:
3171 type: number
3172 state:
3173 type: string
3174 enum:
3175 - pending
3176 - processing
3177 - error
3178 - success
3179 category:
3180 type: string
3181 enum:
3182 - transcoding
3183 - activitypub-http
3184 handlerName:
3185 type: string
3186 handlerInputData:
3187 type: string
3188 createdAt:
3189 type: string
3190 updatedAt:
3191 type: string
3192 AddUserResponse:
3193 properties:
3194 id:
3195 type: number
3196 uuid:
3197 type: string
3198 VideoUploadResponse:
3199 properties:
3200 video:
3201 type: object
3202 properties:
3203 id:
3204 type: number
3205 uuid:
3206 type: string
3207 CommentThreadResponse:
3208 properties:
3209 total:
3210 type: number
3211 data:
3212 type: array
3213 items:
3214 $ref: '#/components/schemas/VideoComment'
3215 CommentThreadPostResponse:
3216 properties:
3217 comment:
3218 $ref: '#/components/schemas/VideoComment'
048b6946
C
3219 VideoListResponse:
3220 properties:
3221 total:
3222 type: number
3223 data:
3224 type: array
3225 items:
3226 $ref: '#/components/schemas/Video'
3e9e6f2f
RK
3227 AddUser:
3228 properties:
3229 username:
3230 type: string
3231 description: 'The user username '
3232 password:
3233 type: string
45f1bd72 3234 description: 'The user password. If the smtp server is configured, you can leave empty and an email will be sent '
3e9e6f2f
RK
3235 email:
3236 type: string
3237 description: 'The user email '
3238 videoQuota:
3239 type: string
3240 description: 'The user videoQuota '
fbe1bc2a
C
3241 videoQuotaDaily:
3242 type: string
3243 description: 'The user daily video quota '
3e9e6f2f 3244 role:
0f490230 3245 type: integer
0f490230
RK
3246 enum:
3247 - 0
3248 - 1
3249 - 2
63d17405 3250 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
3e9e6f2f
RK
3251 required:
3252 - username
3253 - password
3254 - email
3255 - videoQuota
fbe1bc2a 3256 - videoQuotaDaily
3e9e6f2f
RK
3257 - role
3258 UpdateUser:
3259 properties:
3260 id:
3261 type: string
3262 description: 'The user id '
3263 email:
3264 type: string
3265 description: 'The updated email of the user '
3266 videoQuota:
3267 type: string
3268 description: 'The updated videoQuota of the user '
fbe1bc2a
C
3269 videoQuotaDaily:
3270 type: string
3271 description: 'The updated daily video quota of the user '
3e9e6f2f 3272 role:
63d17405
C
3273 type: integer
3274 enum:
3275 - 0
3276 - 1
3277 - 2
3278 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
3e9e6f2f
RK
3279 required:
3280 - id
3281 - email
3282 - videoQuota
fbe1bc2a 3283 - videoQuotaDaily
3e9e6f2f
RK
3284 - role
3285 UpdateMe:
3286 properties:
3287 password:
3288 type: string
3289 description: 'Your new password '
3290 email:
3291 type: string
3292 description: 'Your new email '
3293 displayNSFW:
3294 type: string
3295 description: 'Your new displayNSFW '
3296 autoPlayVideo:
3297 type: string
3298 description: 'Your new autoPlayVideo '
3299 required:
3300 - password
3301 - email
3302 - displayNSFW
3303 - autoPlayVideo
3304 GetMeVideoRating:
3305 properties:
3306 id:
3307 type: string
3308 description: 'Id of the video '
3309 rating:
3310 type: number
3311 description: 'Rating of the video '
3312 required:
3313 - id
3314 - rating
c100a614
YB
3315 VideoRating:
3316 properties:
3317 video:
3318 $ref: '#/components/schemas/Video'
3319 rating:
3320 type: number
3321 description: 'Rating of the video'
3322 required:
3323 - video
3324 - rating
3e9e6f2f
RK
3325 RegisterUser:
3326 properties:
3327 username:
3328 type: string
3329 description: 'The username of the user '
3330 password:
3331 type: string
3332 description: 'The password of the user '
3333 email:
3334 type: string
3335 description: 'The email of the user '
1f20622f
C
3336 displayName:
3337 type: string
3338 description: 'The user display name'
3339 channel:
3340 type: object
3341 properties:
3342 name:
3343 type: string
3344 description: 'The default channel name'
3345 displayName:
3346 type: string
3347 description: 'The default channel display name'
3348
3e9e6f2f
RK
3349 required:
3350 - username
3351 - password
3352 - email
7d14d4d2 3353 VideoChannelCreate:
3e9e6f2f
RK
3354 properties:
3355 name:
3356 type: string
7d14d4d2
C
3357 displayName:
3358 type: string
3e9e6f2f
RK
3359 description:
3360 type: string
7d14d4d2
C
3361 support:
3362 type: string
3363 required:
3364 - name
3365 - displayName
3366 VideoChannelUpdate:
3367 properties:
3368 displayName:
3369 type: string
3370 description:
3371 type: string
3372 support:
3373 type: string
3374 bulkVideosSupportUpdate:
3375 type: boolean
3376 description: 'Update all videos support field of this channel'
1569a818 3377