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