]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/api/openapi.yaml
Use `'` instead of `'` for passwords in the documentation (see #1453)
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
CommitLineData
3e9e6f2f 1openapi: 3.0.0
1569a818 2info:
5e1c08eb 3 title: PeerTube
b6ff6971 4 version: 1.1.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
26 sessions, and authenticate using this session token. One session token can
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
RK
40externalDocs:
41 url: https://docs.joinpeertube.org/api.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
RK
52 - name: Feeds
53 description: |
54 Feeds of videos and feeds of comments allow to see updates and get them in
55 an aggregator or script of your choice.
56 - name: Job
3e9e6f2f
RK
57 description: >
58 Jobs are long-running tasks enqueued and processed by the instance
5776f78e
RK
59 itself. No additional worker registration is currently available.
60 - name: Server Following
3e9e6f2f
RK
61 description: >
62 Managing servers which the instance interacts with is crucial to the
5776f78e
RK
63 concept of federation in PeerTube and external video indexation. The PeerTube
64 server then deals with inter-server ActivityPub operations and propagates
2963c343
RK
65 information across its social graph by posting activities to actors' inbox
66 endpoints.
5776f78e 67 - name: Video Abuse
2963c343
RK
68 description: |
69 Video abuses deal with reports of local or remote videos alike.
70 - name: Video
71 description: |
72 Operations dealing with listing, uploading, fetching or modifying videos.
73 - name: Search
74 description: |
75 The search helps to find _videos_ from within the instance and beyond.
76 Videos from other instances federated by the instance (that is, instances
77 followed by the instance) can be found via keywords and other criteria of
78 the advanced search.
5776f78e 79 - name: Video Comment
3e9e6f2f
RK
80 description: >
81 Operations dealing with comments to a video. Comments are organized in
82 threads.
5776f78e 83 - name: Video Channel
3e9e6f2f
RK
84 description: >
85 Operations dealing with creation, modification and video listing of a
5776f78e
RK
86 user's channels.
87 - name: Video Blacklist
88 description: >
89 Operations dealing with blacklisting videos (removing them from view and
90 preventing interactions).
91 - name: Video Rate
92 description: >
93 Voting for a video.
94x-tagGroups:
95 - name: Accounts
96 tags:
97 - Accounts
98 - User
99 - name: Videos
100 tags:
101 - Video
102 - Video Channel
103 - Video Comment
5776f78e
RK
104 - Video Following
105 - Video Rate
106 - name: Moderation
107 tags:
9d0b856e 108 - Video Abuse
5776f78e 109 - Video Blacklist
65f02679 110 - name: Instance Configuration
5776f78e
RK
111 tags:
112 - Config
113 - Server Following
114 - name: Notifications
115 tags:
116 - Feeds
117 - name: Jobs
118 tags:
119 - Job
120 - name: Search
121 tags:
122 - Search
1569a818 123paths:
ad9e39fb 124 '/accounts/{name}':
1569a818
DG
125 get:
126 tags:
127 - Accounts
2963c343 128 summary: Get the account by name
1569a818 129 parameters:
3e9e6f2f
RK
130 - $ref: '#/components/parameters/name'
131 - $ref: '#/components/parameters/start'
132 - $ref: '#/components/parameters/count'
133 - $ref: '#/components/parameters/sort'
1569a818
DG
134 responses:
135 '200':
136 description: successful operation
3e9e6f2f
RK
137 content:
138 application/json:
139 schema:
140 $ref: '#/components/schemas/Account'
ad9e39fb 141 '/accounts/{name}/videos':
6b738c7a
C
142 get:
143 tags:
144 - Accounts
2963c343 145 - Video
3e9e6f2f 146 summary: 'Get videos for an account, provided the name of that account'
6b738c7a 147 parameters:
3e9e6f2f 148 - $ref: '#/components/parameters/name'
6b738c7a
C
149 responses:
150 '200':
151 description: successful operation
3e9e6f2f
RK
152 content:
153 application/json:
154 schema:
155 $ref: '#/components/schemas/Video'
2963c343
RK
156 x-code-samples:
157 - lang: JavaScript
158 source: |
8f9e8be1 159 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
2963c343
RK
160 .then(function(response) {
161 return response.json()
162 }).then(function(data) {
163 console.log(data)
164 })
8f9e8be1
RK
165 - lang: Shell
166 source: |
167 # pip install httpie
168 http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
5776f78e
RK
169 - lang: Ruby
170 source: |
171 require 'uri'
172 require 'net/http'
173
174 url = URI("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
175
176 http = Net::HTTP.new(url.host, url.port)
177 http.use_ssl = true
178 http.verify_mode = OpenSSL::SSL::VERIFY_NONE
179
180 request = Net::HTTP::Post.new(url)
181 request["content-type"] = 'application/json'
182 response = http.request(request)
183 puts response.read_body
184 - lang: Python
185 source: |
186 import http.client
187
188 conn = http.client.HTTPSConnection("https://peertube2.cpy.re/api/v1")
189
190 headers = {
191 'content-type': "application/json"
192 }
193
194 conn.request("POST", "/accounts/{name}/videos", None, headers)
195
196 res = conn.getresponse()
197 data = res.read()
198
199 print(data.decode("utf-8"))
1569a818
DG
200 /accounts:
201 get:
202 tags:
203 - Accounts
2963c343 204 summary: Get all accounts
1569a818
DG
205 responses:
206 '200':
207 description: successful operation
3e9e6f2f 208 content:
8f9e8be1 209 'application/json':
3e9e6f2f
RK
210 schema:
211 type: array
212 items:
213 $ref: '#/components/schemas/Account'
1569a818
DG
214 /config:
215 get:
216 tags:
217 - Config
6441981b 218 summary: Get the public configuration of the server
1569a818
DG
219 responses:
220 '200':
221 description: successful operation
3e9e6f2f
RK
222 content:
223 application/json:
224 schema:
225 $ref: '#/components/schemas/ServerConfig'
6441981b
RK
226 /config/about:
227 get:
228 summary: Get the instance about page content
229 tags:
230 - Config
231 responses:
232 '200':
233 description: successful operation
234 /config/custom:
235 get:
236 summary: Get the runtime configuration of the server
237 tags:
238 - Config
239 security:
240 - OAuth2:
241 - admin
242 responses:
243 '200':
244 description: successful operation
245 put:
246 summary: Set the runtime configuration of the server
247 tags:
248 - Config
249 security:
250 - OAuth2:
251 - admin
252 responses:
253 '200':
254 description: successful operation
255 delete:
256 summary: Delete the runtime configuration of the server
257 tags:
258 - Config
259 security:
260 - OAuth2:
261 - admin
262 responses:
263 '200':
264 description: successful operation
3e9e6f2f 265 '/feeds/videos.{format}':
244e76a5 266 get:
3e9e6f2f
RK
267 summary: >-
268 Get the feed of videos for the server, with optional filter by account
269 name or id
244e76a5
RK
270 tags:
271 - Feeds
244e76a5
RK
272 parameters:
273 - name: format
274 in: path
275 required: true
3e9e6f2f
RK
276 description: >-
277 The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and
278 json to JSON FEED 1.0
279 schema:
280 type: string
281 enum:
282 - xml
283 - atom
284 - json
285 default: xml
244e76a5
RK
286 - name: accountId
287 in: query
288 required: false
3e9e6f2f
RK
289 description: >-
290 The id of the local account to filter to (beware, users IDs and not
291 actors IDs which will return empty feeds
292 schema:
293 type: number
244e76a5
RK
294 - name: accountName
295 in: query
296 required: false
3e9e6f2f
RK
297 description: The name of the local account to filter to
298 schema:
299 type: string
244e76a5
RK
300 responses:
301 '200':
302 description: successful operation
d216b538 303 /jobs/{state}:
1569a818 304 get:
2963c343 305 summary: Get list of jobs
94ff4c23 306 security:
3e9e6f2f
RK
307 - OAuth2:
308 - admin
1569a818
DG
309 tags:
310 - Job
44cb3b85
DG
311 parameters:
312 - name: state
313 in: path
314 required: true
3e9e6f2f
RK
315 description: The state of the job
316 schema:
317 type: string
65f02679
RK
318 enum:
319 - active
320 - completed
321 - failed
322 - waiting
323 - delayed
3e9e6f2f
RK
324 - $ref: '#/components/parameters/start'
325 - $ref: '#/components/parameters/count'
326 - $ref: '#/components/parameters/sort'
1569a818
DG
327 responses:
328 '200':
329 description: successful operation
3e9e6f2f
RK
330 content:
331 application/json:
332 schema:
333 type: array
334 items:
335 $ref: '#/components/schemas/Job'
1569a818
DG
336 '/server/following/{host}':
337 delete:
94ff4c23 338 security:
3e9e6f2f
RK
339 - OAuth2:
340 - admin
1569a818 341 tags:
5776f78e 342 - Server Following
2963c343 343 summary: Unfollow a server by hostname
1569a818
DG
344 parameters:
345 - name: host
346 in: path
347 required: true
1569a818 348 description: 'The host to unfollow '
3e9e6f2f
RK
349 schema:
350 type: string
1569a818
DG
351 responses:
352 '201':
353 description: successful operation
354 /server/followers:
355 get:
356 tags:
5776f78e 357 - Server Following
2963c343 358 summary: Get followers of the server
44cb3b85 359 parameters:
3e9e6f2f
RK
360 - $ref: '#/components/parameters/start'
361 - $ref: '#/components/parameters/count'
362 - $ref: '#/components/parameters/sort'
1569a818
DG
363 responses:
364 '200':
365 description: successful operation
3e9e6f2f
RK
366 content:
367 application/json:
368 schema:
369 type: array
370 items:
371 $ref: '#/components/schemas/Follow'
1569a818
DG
372 /server/following:
373 get:
374 tags:
5776f78e 375 - Server Following
2963c343 376 summary: Get servers followed by the server
44cb3b85 377 parameters:
3e9e6f2f
RK
378 - $ref: '#/components/parameters/start'
379 - $ref: '#/components/parameters/count'
380 - $ref: '#/components/parameters/sort'
1569a818
DG
381 responses:
382 '200':
383 description: successful operation
3e9e6f2f
RK
384 content:
385 application/json:
386 schema:
387 type: array
388 items:
389 $ref: '#/components/schemas/Follow'
1569a818 390 post:
94ff4c23 391 security:
3e9e6f2f
RK
392 - OAuth2:
393 - admin
1569a818 394 tags:
5776f78e 395 - Server Following
2963c343 396 summary: Follow a server
1569a818
DG
397 responses:
398 '204':
3e9e6f2f
RK
399 $ref: '#/paths/~1users~1me/put/responses/204'
400 requestBody:
401 content:
402 application/json:
403 schema:
404 $ref: '#/components/schemas/Follow'
1569a818
DG
405 /users:
406 post:
2963c343 407 summary: Creates user
94ff4c23 408 security:
3e9e6f2f
RK
409 - OAuth2:
410 - admin
1569a818
DG
411 tags:
412 - User
1569a818
DG
413 responses:
414 '200':
415 description: successful operation
3e9e6f2f
RK
416 content:
417 application/json:
418 schema:
419 $ref: '#/components/schemas/AddUserResponse'
420 requestBody:
421 content:
422 application/json:
423 schema:
424 $ref: '#/components/schemas/AddUser'
425 description: User to create
426 required: true
1569a818 427 get:
2963c343 428 summary: Get a list of users
94ff4c23 429 security:
3e9e6f2f 430 - OAuth2: []
1569a818
DG
431 tags:
432 - User
44cb3b85 433 parameters:
3e9e6f2f
RK
434 - $ref: '#/components/parameters/start'
435 - $ref: '#/components/parameters/count'
fd5af7a2 436 - $ref: '#/components/parameters/usersSort'
1569a818
DG
437 responses:
438 '200':
439 description: successful operation
3e9e6f2f
RK
440 content:
441 application/json:
442 schema:
443 type: array
444 items:
445 $ref: '#/components/schemas/User'
1569a818
DG
446 '/users/{id}':
447 delete:
2963c343 448 summary: Delete a user by its id
94ff4c23 449 security:
3e9e6f2f
RK
450 - OAuth2:
451 - admin
1569a818
DG
452 tags:
453 - User
1569a818 454 parameters:
3e9e6f2f 455 - $ref: '#/components/parameters/id'
1569a818
DG
456 responses:
457 '204':
3e9e6f2f 458 $ref: '#/paths/~1users~1me/put/responses/204'
1569a818 459 get:
2963c343 460 summary: Get user by its id
94ff4c23 461 security:
3e9e6f2f 462 - OAuth2: []
1569a818
DG
463 tags:
464 - User
1569a818 465 parameters:
3e9e6f2f 466 - $ref: '#/components/parameters/id'
1569a818
DG
467 responses:
468 '200':
469 description: successful operation
3e9e6f2f
RK
470 content:
471 application/json:
472 schema:
473 $ref: '#/components/schemas/User'
1569a818 474 put:
2963c343 475 summary: Update user profile by its id
94ff4c23 476 security:
3e9e6f2f 477 - OAuth2: []
1569a818
DG
478 tags:
479 - User
1569a818 480 parameters:
3e9e6f2f 481 - $ref: '#/components/parameters/id'
1569a818
DG
482 responses:
483 '204':
3e9e6f2f
RK
484 $ref: '#/paths/~1users~1me/put/responses/204'
485 requestBody:
486 content:
487 application/json:
488 schema:
489 $ref: '#/components/schemas/UpdateUser'
490 required: true
1569a818
DG
491 /users/me:
492 get:
2963c343 493 summary: Get current user information
94ff4c23 494 security:
3e9e6f2f 495 - OAuth2: []
1569a818
DG
496 tags:
497 - User
1569a818
DG
498 responses:
499 '200':
500 description: successful operation
3e9e6f2f
RK
501 content:
502 application/json:
503 schema:
504 type: array
505 items:
506 $ref: '#/components/schemas/User'
1569a818 507 put:
2963c343 508 summary: Update current user information
94ff4c23 509 security:
3e9e6f2f 510 - OAuth2: []
1569a818
DG
511 tags:
512 - User
1569a818
DG
513 responses:
514 '204':
3e9e6f2f
RK
515 description: Successful operation
516 requestBody:
517 content:
518 application/json:
519 schema:
520 $ref: '#/components/schemas/UpdateMe'
521 required: true
1569a818
DG
522 /users/me/video-quota-used:
523 get:
2963c343 524 summary: Get current user used quota
94ff4c23 525 security:
3e9e6f2f 526 - OAuth2: []
1569a818
DG
527 tags:
528 - User
1569a818
DG
529 responses:
530 '200':
531 description: successful operation
3e9e6f2f
RK
532 content:
533 application/json:
534 schema:
535 type: number
1569a818
DG
536 '/users/me/videos/{videoId}/rating':
537 get:
3e9e6f2f 538 summary: 'Get rating of video by its id, among those of the current user'
94ff4c23 539 security:
3e9e6f2f 540 - OAuth2: []
1569a818
DG
541 tags:
542 - User
1569a818
DG
543 parameters:
544 - name: videoId
545 in: path
546 required: true
1569a818 547 description: 'The video id '
3e9e6f2f
RK
548 schema:
549 type: string
1569a818
DG
550 responses:
551 '200':
552 description: successful operation
3e9e6f2f
RK
553 content:
554 application/json:
555 schema:
556 $ref: '#/components/schemas/GetMeVideoRating'
1569a818
DG
557 /users/me/videos:
558 get:
2963c343 559 summary: Get videos of the current user
94ff4c23 560 security:
3e9e6f2f 561 - OAuth2: []
1569a818
DG
562 tags:
563 - User
44cb3b85 564 parameters:
3e9e6f2f
RK
565 - $ref: '#/components/parameters/start'
566 - $ref: '#/components/parameters/count'
567 - $ref: '#/components/parameters/sort'
1569a818
DG
568 responses:
569 '200':
570 description: successful operation
3e9e6f2f
RK
571 content:
572 application/json:
573 schema:
574 type: array
575 items:
576 $ref: '#/components/schemas/Video'
1569a818
DG
577 /users/register:
578 post:
2963c343 579 summary: Register a user
1569a818
DG
580 tags:
581 - User
1569a818
DG
582 responses:
583 '204':
3e9e6f2f
RK
584 $ref: '#/paths/~1users~1me/put/responses/204'
585 requestBody:
586 content:
587 application/json:
588 schema:
589 $ref: '#/components/schemas/RegisterUser'
590 required: true
1569a818
DG
591 /users/me/avatar/pick:
592 post:
2963c343 593 summary: Update current user avatar
94ff4c23 594 security:
3e9e6f2f 595 - OAuth2: []
1569a818
DG
596 tags:
597 - User
1569a818
DG
598 responses:
599 '200':
600 description: successful operation
3e9e6f2f
RK
601 content:
602 application/json:
603 schema:
604 $ref: '#/components/schemas/Avatar'
605 requestBody:
606 content:
607 multipart/form-data:
608 schema:
609 type: object
610 properties:
611 avatarfile:
612 description: The file to upload.
613 type: string
614 format: binary
615 encoding:
616 profileImage:
617 # only accept png/jpeg
618 contentType: image/png, image/jpeg
c360c494 619 /videos:
1569a818 620 get:
2963c343 621 summary: Get list of videos
1569a818
DG
622 tags:
623 - Video
44cb3b85 624 parameters:
fd5af7a2
RK
625 - $ref: '#/components/parameters/categoryOneOf'
626 - $ref: '#/components/parameters/tagsOneOf'
627 - $ref: '#/components/parameters/tagsAllOf'
628 - $ref: '#/components/parameters/licenceOneOf'
629 - $ref: '#/components/parameters/languageOneOf'
630 - $ref: '#/components/parameters/nsfw'
631 - $ref: '#/components/parameters/filter'
3e9e6f2f
RK
632 - $ref: '#/components/parameters/start'
633 - $ref: '#/components/parameters/count'
fd5af7a2 634 - $ref: '#/components/parameters/videosSort'
1569a818
DG
635 responses:
636 '200':
637 description: successful operation
3e9e6f2f
RK
638 content:
639 application/json:
640 schema:
641 type: array
642 items:
643 $ref: '#/components/schemas/Video'
c360c494 644 /videos/categories:
1569a818 645 get:
2963c343 646 summary: Get list of video licences known by the server
1569a818
DG
647 tags:
648 - Video
1569a818
DG
649 responses:
650 '200':
651 description: successful operation
3e9e6f2f
RK
652 content:
653 application/json:
654 schema:
655 type: array
656 items:
657 type: string
c360c494 658 /videos/licences:
1569a818 659 get:
2963c343 660 summary: Get list of video licences known by the server
1569a818
DG
661 tags:
662 - Video
1569a818
DG
663 responses:
664 '200':
665 description: successful operation
3e9e6f2f
RK
666 content:
667 application/json:
668 schema:
669 type: array
670 items:
671 type: string
c360c494 672 /videos/languages:
1569a818 673 get:
2963c343 674 summary: Get list of languages known by the server
1569a818
DG
675 tags:
676 - Video
1569a818
DG
677 responses:
678 '200':
679 description: successful operation
3e9e6f2f
RK
680 content:
681 application/json:
682 schema:
683 type: array
684 items:
685 type: string
c360c494 686 /videos/privacies:
1569a818 687 get:
2963c343 688 summary: Get list of privacy policies supported by the server
1569a818
DG
689 tags:
690 - Video
1569a818
DG
691 responses:
692 '200':
693 description: successful operation
3e9e6f2f
RK
694 content:
695 application/json:
696 schema:
697 type: array
698 items:
699 type: string
700 '/videos/{id}':
1569a818 701 put:
2963c343 702 summary: Update metadata for a video by its id
94ff4c23 703 security:
3e9e6f2f 704 - OAuth2: []
1569a818
DG
705 tags:
706 - Video
1569a818 707 parameters:
3e9e6f2f 708 - $ref: '#/components/parameters/id2'
1569a818
DG
709 responses:
710 '200':
711 description: successful operation
3e9e6f2f
RK
712 content:
713 application/json:
714 schema:
715 $ref: '#/components/schemas/Video'
716 requestBody:
717 content:
718 multipart/form-data:
719 schema:
720 type: object
721 properties:
722 thumbnailfile:
723 description: Video thumbnail file
724 type: string
725 previewfile:
726 description: Video preview file
727 type: string
728 category:
729 description: Video category
730 type: string
731 licence:
732 description: Video licence
733 type: string
734 language:
735 description: Video language
736 type: string
737 description:
738 description: Video description
739 type: string
740 waitTranscoding:
741 description: Whether or not we wait transcoding before publish the video
742 type: string
743 support:
744 description: Text describing how to support the video uploader
745 type: string
746 nsfw:
747 description: Whether or not this video contains sensitive content
748 type: string
749 name:
750 description: Video name
751 type: string
752 tags:
753 description: Video tags
754 type: string
755 commentsEnabled:
756 description: Enable or disable comments for this video
757 type: string
758 scheduleUpdate: &ref_0
759 type: object
760 properties:
761 privacy:
762 type: string
763 enum:
764 - Public
765 - Unlisted
766 description: Video privacy target
767 updateAt:
768 type: string
769 format: date
770 description: When to update the video
771 required:
772 - updateAt
1569a818 773 get:
2963c343 774 summary: Get a video by its id
1569a818
DG
775 tags:
776 - Video
1569a818 777 parameters:
3e9e6f2f 778 - $ref: '#/components/parameters/id2'
1569a818
DG
779 responses:
780 '200':
781 description: successful operation
3e9e6f2f
RK
782 content:
783 application/json:
784 schema:
785 $ref: '#/components/schemas/Video'
1569a818 786 delete:
2963c343 787 summary: Delete a video by its id
94ff4c23 788 security:
3e9e6f2f 789 - OAuth2: []
1569a818
DG
790 tags:
791 - Video
1569a818 792 parameters:
3e9e6f2f 793 - $ref: '#/components/parameters/id2'
1569a818
DG
794 responses:
795 '204':
3e9e6f2f
RK
796 $ref: '#/paths/~1users~1me/put/responses/204'
797 '/videos/{id}/description':
1569a818 798 get:
2963c343 799 summary: Get a video description by its id
1569a818
DG
800 tags:
801 - Video
1569a818 802 parameters:
3e9e6f2f 803 - $ref: '#/components/parameters/id2'
1569a818
DG
804 responses:
805 '200':
806 description: successful operation
3e9e6f2f
RK
807 content:
808 application/json:
809 schema:
810 type: string
811 '/videos/{id}/views':
1569a818 812 post:
2963c343 813 summary: Add a view to the video by its id
1569a818
DG
814 tags:
815 - Video
1569a818 816 parameters:
3e9e6f2f 817 - $ref: '#/components/parameters/id2'
1569a818
DG
818 responses:
819 '204':
3e9e6f2f 820 $ref: '#/paths/~1users~1me/put/responses/204'
6441981b
RK
821 '/videos/{id}/watching':
822 put:
823 summary: Indicate progress of in watching the video by its id for a user
824 tags:
825 - Video
826 security:
827 - OAuth2: []
828 parameters:
829 - $ref: '#/components/parameters/id2'
830 requestBody:
831 content:
832 application/json:
833 schema:
834 $ref: '#/components/schemas/UserWatchingVideo'
835 required: true
836 responses:
837 '204':
838 $ref: '#/paths/~1users~1me/put/responses/204'
839 /videos/ownership:
840 get:
841 summary: Get list of video ownership changes requests
842 tags:
843 - Video
844 security:
845 - OAuth2: []
846 parameters:
847 - $ref: '#/components/parameters/id2'
848 responses:
849 '200':
850 description: successful operation
851 '/videos/ownership/{id}/accept':
852 post:
853 summary: Refuse ownership change request for video by its id
854 tags:
855 - Video
856 security:
857 - OAuth2: []
858 parameters:
859 - $ref: '#/components/parameters/id2'
860 responses:
861 '204':
862 $ref: '#/paths/~1users~1me/put/responses/204'
863 '/videos/ownership/{id}/refuse':
864 post:
865 summary: Accept ownership change request for video by its id
866 tags:
867 - Video
868 security:
869 - OAuth2: []
870 parameters:
871 - $ref: '#/components/parameters/id2'
872 responses:
873 '204':
874 $ref: '#/paths/~1users~1me/put/responses/204'
875 '/videos/{id}/give-ownership':
876 post:
877 summary: Request change of ownership for a video you own, by its id
878 tags:
879 - Video
880 security:
881 - OAuth2: []
882 parameters:
883 - $ref: '#/components/parameters/id2'
884 requestBody:
885 required: true
886 content:
887 application/x-www-form-urlencoded:
888 schema:
889 type: object
890 properties:
891 username:
892 type: string
893 required:
894 - username
895 responses:
896 '204':
897 $ref: '#/paths/~1users~1me/put/responses/204'
898 '400':
899 description: 'Changing video ownership to a remote account is not supported yet'
c360c494 900 /videos/upload:
1569a818 901 post:
2963c343 902 summary: Upload a video file with its metadata
94ff4c23 903 security:
3e9e6f2f 904 - OAuth2: []
1569a818
DG
905 tags:
906 - Video
1569a818
DG
907 responses:
908 '200':
909 description: successful operation
3e9e6f2f
RK
910 content:
911 application/json:
912 schema:
913 $ref: '#/components/schemas/VideoUploadResponse'
914 requestBody:
915 content:
916 multipart/form-data:
917 schema:
918 type: object
919 properties:
920 videofile:
921 description: Video file
922 type: string
923 format: binary
924 channelId:
925 description: Channel id that will contain this video
926 type: number
927 thumbnailfile:
928 description: Video thumbnail file
929 type: string
930 previewfile:
931 description: Video preview file
932 type: string
8f9e8be1
RK
933 privacy:
934 $ref: '#/components/schemas/VideoPrivacy'
3e9e6f2f
RK
935 category:
936 description: Video category
937 type: string
938 licence:
939 description: Video licence
940 type: string
941 language:
942 description: Video language
943 type: string
944 description:
945 description: Video description
946 type: string
947 waitTranscoding:
948 description: Whether or not we wait transcoding before publish the video
949 type: string
950 support:
951 description: Text describing how to support the video uploader
952 type: string
953 nsfw:
954 description: Whether or not this video contains sensitive content
955 type: string
956 name:
957 description: Video name
958 type: string
959 tags:
960 description: Video tags
961 type: string
962 commentsEnabled:
963 description: Enable or disable comments for this video
964 type: string
965 scheduleUpdate: *ref_0
966 required:
967 - videofile
968 - channelId
8f9e8be1 969 - name
8f9e8be1
RK
970 x-code-samples:
971 - lang: Shell
972 source: |
973 ## DEPENDENCIES: httpie, jq
974 # pip install httpie
975 USERNAME="<your_username>"
976 PASSWORD="<your_password>"
977 FILE_PATH="<your_file_path>"
978 CHANNEL_ID="<your_channel_id>"
8f9e8be1
RK
979 NAME="<video_name>"
980
981 API_PATH="https://peertube2.cpy.re/api/v1"
982 ## AUTH
983 client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
984 client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
985 token=$(http -b --form POST "$API_PATH/users/token" \
986 client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
987 username=$USERNAME \
988 password=$PASSWORD \
989 | jq -r ".access_token")
990 ## VIDEO UPLOAD
991 http -b --form POST "$API_PATH/videos/upload" \
992 videofile@$FILE_PATH \
993 channelId=$CHANNEL_ID \
994 name=$NAME \
8f9e8be1 995 "Authorization:Bearer $token"
c360c494 996 /videos/abuse:
1569a818 997 get:
2963c343 998 summary: Get list of reported video abuses
94ff4c23 999 security:
3e9e6f2f 1000 - OAuth2: []
1569a818 1001 tags:
5776f78e 1002 - Video Abuse
44cb3b85 1003 parameters:
3e9e6f2f
RK
1004 - $ref: '#/components/parameters/start'
1005 - $ref: '#/components/parameters/count'
fd5af7a2 1006 - $ref: '#/components/parameters/abusesSort'
1569a818
DG
1007 responses:
1008 '200':
1009 description: successful operation
3e9e6f2f
RK
1010 content:
1011 application/json:
1012 schema:
1013 type: array
1014 items:
1015 $ref: '#/components/schemas/VideoAbuse'
1016 '/videos/{id}/abuse':
1569a818 1017 post:
3e9e6f2f 1018 summary: 'Report an abuse, on a video by its id'
94ff4c23 1019 security:
3e9e6f2f 1020 - OAuth2: []
1569a818 1021 tags:
5776f78e 1022 - Video Abuse
1569a818 1023 parameters:
3e9e6f2f 1024 - $ref: '#/components/parameters/id2'
1569a818
DG
1025 responses:
1026 '204':
3e9e6f2f
RK
1027 $ref: '#/paths/~1users~1me/put/responses/204'
1028 '/videos/{id}/blacklist':
1569a818 1029 post:
2963c343 1030 summary: Put on blacklist a video by its id
94ff4c23 1031 security:
3e9e6f2f
RK
1032 - OAuth2:
1033 - admin
1034 - moderator
1569a818 1035 tags:
5776f78e 1036 - Video Blacklist
1569a818 1037 parameters:
3e9e6f2f 1038 - $ref: '#/components/parameters/id2'
1569a818
DG
1039 responses:
1040 '204':
3e9e6f2f 1041 $ref: '#/paths/~1users~1me/put/responses/204'
1569a818 1042 delete:
2963c343 1043 summary: Delete an entry of the blacklist of a video by its id
94ff4c23 1044 security:
3e9e6f2f
RK
1045 - OAuth2:
1046 - admin
1047 - moderator
1569a818 1048 tags:
5776f78e 1049 - Video Blacklist
1569a818 1050 parameters:
3e9e6f2f 1051 - $ref: '#/components/parameters/id2'
1569a818
DG
1052 responses:
1053 '204':
3e9e6f2f 1054 $ref: '#/paths/~1users~1me/put/responses/204'
c360c494 1055 /videos/blacklist:
1569a818 1056 get:
2963c343 1057 summary: Get list of videos on blacklist
94ff4c23 1058 security:
3e9e6f2f
RK
1059 - OAuth2:
1060 - admin
1061 - moderator
1569a818 1062 tags:
5776f78e 1063 - Video Blacklist
44cb3b85 1064 parameters:
3e9e6f2f
RK
1065 - $ref: '#/components/parameters/start'
1066 - $ref: '#/components/parameters/count'
fd5af7a2 1067 - $ref: '#/components/parameters/blacklistsSort'
1569a818
DG
1068 responses:
1069 '200':
1070 description: successful operation
3e9e6f2f
RK
1071 content:
1072 application/json:
1073 schema:
1074 type: array
1075 items:
1076 $ref: '#/components/schemas/VideoBlacklist'
48dce1c9 1077 /video-channels:
1569a818 1078 get:
2963c343 1079 summary: Get list of video channels
1569a818 1080 tags:
5776f78e 1081 - Video Channel
44cb3b85 1082 parameters:
3e9e6f2f
RK
1083 - $ref: '#/components/parameters/start'
1084 - $ref: '#/components/parameters/count'
1085 - $ref: '#/components/parameters/sort'
1569a818
DG
1086 responses:
1087 '200':
1088 description: successful operation
3e9e6f2f
RK
1089 content:
1090 application/json:
1091 schema:
1092 type: array
1093 items:
1094 $ref: '#/components/schemas/VideoChannel'
1569a818 1095 post:
2963c343 1096 summary: Creates a video channel for the current user
94ff4c23 1097 security:
3e9e6f2f 1098 - OAuth2: []
1569a818 1099 tags:
5776f78e 1100 - Video Channel
1569a818
DG
1101 responses:
1102 '204':
3e9e6f2f
RK
1103 $ref: '#/paths/~1users~1me/put/responses/204'
1104 requestBody:
1105 $ref: '#/components/requestBodies/VideoChannelInput'
1106 '/video-channels/{id}':
1569a818 1107 get:
2963c343 1108 summary: Get a video channel by its id
1569a818 1109 tags:
5776f78e 1110 - Video Channel
1569a818 1111 parameters:
3e9e6f2f 1112 - $ref: '#/components/parameters/id3'
1569a818
DG
1113 responses:
1114 '200':
1115 description: successful operation
3e9e6f2f
RK
1116 content:
1117 application/json:
1118 schema:
1119 $ref: '#/components/schemas/VideoChannel'
1569a818 1120 put:
2963c343 1121 summary: Update a video channel by its id
94ff4c23 1122 security:
3e9e6f2f 1123 - OAuth2: []
1569a818 1124 tags:
5776f78e 1125 - Video Channel
1569a818 1126 parameters:
3e9e6f2f 1127 - $ref: '#/components/parameters/id3'
1569a818
DG
1128 responses:
1129 '204':
3e9e6f2f
RK
1130 $ref: '#/paths/~1users~1me/put/responses/204'
1131 requestBody:
1132 $ref: '#/components/requestBodies/VideoChannelInput'
1569a818 1133 delete:
2963c343 1134 summary: Delete a video channel by its id
94ff4c23 1135 security:
3e9e6f2f 1136 - OAuth2: []
1569a818 1137 tags:
5776f78e 1138 - Video Channel
1569a818 1139 parameters:
3e9e6f2f 1140 - $ref: '#/components/parameters/id3'
cc918ac3
C
1141 responses:
1142 '204':
3e9e6f2f
RK
1143 $ref: '#/paths/~1users~1me/put/responses/204'
1144 '/video-channels/{id}/videos':
cc918ac3 1145 get:
2963c343 1146 summary: Get videos of a video channel by its id
cc918ac3 1147 tags:
5776f78e 1148 - Video Channel
cc918ac3 1149 parameters:
3e9e6f2f 1150 - $ref: '#/components/parameters/id3'
1569a818 1151 responses:
cc918ac3 1152 '200':
1569a818 1153 description: successful operation
3e9e6f2f
RK
1154 content:
1155 application/json:
1156 schema:
1157 $ref: '#/components/schemas/Video'
1158 '/accounts/{name}/video-channels':
6b738c7a 1159 get:
2963c343 1160 summary: Get video channels of an account by its name
6b738c7a 1161 tags:
5776f78e 1162 - Video Channel
6b738c7a 1163 parameters:
3e9e6f2f 1164 - $ref: '#/components/parameters/name'
6b738c7a
C
1165 responses:
1166 '200':
1167 description: successful operation
3e9e6f2f
RK
1168 content:
1169 application/json:
1170 schema:
1171 type: array
1172 items:
1173 $ref: '#/components/schemas/VideoChannel'
1174 '/videos/{id}/comment-threads':
1569a818 1175 get:
2963c343 1176 summary: Get the comment threads of a video by its id
1569a818 1177 tags:
5776f78e 1178 - Video Comment
1569a818 1179 parameters:
3e9e6f2f
RK
1180 - $ref: '#/components/parameters/id2'
1181 - $ref: '#/components/parameters/start'
1182 - $ref: '#/components/parameters/count'
1183 - $ref: '#/components/parameters/sort'
1569a818
DG
1184 responses:
1185 '200':
1186 description: successful operation
3e9e6f2f
RK
1187 content:
1188 application/json:
1189 schema:
1190 $ref: '#/components/schemas/CommentThreadResponse'
1569a818 1191 post:
3e9e6f2f 1192 summary: 'Creates a comment thread, on a video by its id'
94ff4c23 1193 security:
3e9e6f2f 1194 - OAuth2: []
1569a818 1195 tags:
5776f78e 1196 - Video Comment
1569a818 1197 parameters:
3e9e6f2f 1198 - $ref: '#/components/parameters/id2'
1569a818
DG
1199 responses:
1200 '200':
1201 description: successful operation
3e9e6f2f
RK
1202 content:
1203 application/json:
1204 schema:
1205 $ref: '#/components/schemas/CommentThreadPostResponse'
1206 '/videos/{id}/comment-threads/{threadId}':
1569a818 1207 get:
3e9e6f2f 1208 summary: 'Get the comment thread by its id, of a video by its id'
1569a818 1209 tags:
5776f78e 1210 - Video Comment
1569a818 1211 parameters:
3e9e6f2f
RK
1212 - $ref: '#/components/parameters/id2'
1213 - name: threadId
1214 in: path
1215 required: true
1216 description: The thread id (root comment id)
1217 schema:
1218 type: number
1569a818
DG
1219 responses:
1220 '200':
1221 description: successful operation
3e9e6f2f
RK
1222 content:
1223 application/json:
1224 schema:
1225 $ref: '#/components/schemas/VideoCommentThreadTree'
1226 '/videos/{id}/comments/{commentId}':
1569a818 1227 post:
3e9e6f2f 1228 summary: 'Creates a comment in a comment thread by its id, of a video by its id'
94ff4c23 1229 security:
3e9e6f2f 1230 - OAuth2: []
1569a818 1231 tags:
5776f78e 1232 - Video Comment
1569a818 1233 parameters:
3e9e6f2f
RK
1234 - $ref: '#/components/parameters/id2'
1235 - $ref: '#/components/parameters/commentId'
1569a818
DG
1236 responses:
1237 '200':
1238 description: successful operation
3e9e6f2f
RK
1239 content:
1240 application/json:
1241 schema:
1242 $ref: '#/components/schemas/CommentThreadPostResponse'
1569a818 1243 delete:
3e9e6f2f 1244 summary: 'Delete a comment in a comment therad by its id, of a video by its id'
94ff4c23 1245 security:
3e9e6f2f 1246 - OAuth2: []
1569a818 1247 tags:
5776f78e 1248 - Video Comment
1569a818 1249 parameters:
3e9e6f2f
RK
1250 - $ref: '#/components/parameters/id2'
1251 - $ref: '#/components/parameters/commentId'
1569a818
DG
1252 responses:
1253 '204':
3e9e6f2f
RK
1254 $ref: '#/paths/~1users~1me/put/responses/204'
1255 '/videos/{id}/rate':
1569a818 1256 put:
2963c343 1257 summary: Vote for a video by its id
94ff4c23 1258 security:
3e9e6f2f 1259 - OAuth2: []
1569a818 1260 tags:
5776f78e 1261 - Video Rate
1569a818 1262 parameters:
3e9e6f2f 1263 - $ref: '#/components/parameters/id2'
1569a818
DG
1264 responses:
1265 '204':
3e9e6f2f 1266 $ref: '#/paths/~1users~1me/put/responses/204'
fb72c193
DL
1267 /search/videos:
1268 get:
1269 tags:
1270 - Search
2963c343 1271 summary: Get the videos corresponding to a given query
fb72c193 1272 parameters:
3e9e6f2f
RK
1273 - $ref: '#/components/parameters/start'
1274 - $ref: '#/components/parameters/count'
fd5af7a2 1275 - $ref: '#/components/parameters/videosSearchSort'
655b5490 1276 - name: search
fb72c193
DL
1277 in: query
1278 required: true
3e9e6f2f
RK
1279 description: String to search
1280 schema:
1281 type: string
fb72c193
DL
1282 responses:
1283 '200':
1284 description: successful operation
3e9e6f2f
RK
1285 content:
1286 application/json:
1287 schema:
1569a818
DG
1288 type: array
1289 items:
3e9e6f2f
RK
1290 $ref: '#/components/schemas/Video'
1291servers:
6441981b
RK
1292 - url: 'https://peertube.cpy.re/api/v1'
1293 description: Live Test Server (live data - stable version)
8f9e8be1 1294 - url: 'https://peertube2.cpy.re/api/v1'
6441981b
RK
1295 description: Live Test Server (live data - bleeding edge version)
1296 - url: 'https://peertube3.cpy.re/api/v1'
1297 description: Live Test Server (live data - bleeding edge version)
3e9e6f2f
RK
1298components:
1299 parameters:
1300 start:
1301 name: start
1302 in: query
1303 required: false
1304 description: Offset
1305 schema:
1569a818 1306 type: number
3e9e6f2f
RK
1307 count:
1308 name: count
1309 in: query
1310 required: false
1311 description: Number of items
1312 schema:
1569a818 1313 type: number
3e9e6f2f
RK
1314 sort:
1315 name: sort
1316 in: query
1317 required: false
1318 description: Sort column (-createdAt for example)
1319 schema:
1320 type: string
fd5af7a2
RK
1321 videosSort:
1322 name: sort
1323 in: query
1324 required: false
1325 description: Sort videos by criteria
1326 schema:
1327 type: string
1328 enum:
1329 - -name
1330 - -duration
1331 - -createdAt
1332 - -publishedAt
1333 - -views
1334 - -likes
1335 - -trending
1336 videosSearchSort:
1337 name: sort
1338 in: query
1339 required: false
1340 description: Sort videos by criteria
1341 schema:
1342 type: string
1343 enum:
1344 - -name
1345 - -duration
1346 - -createdAt
1347 - -publishedAt
1348 - -views
1349 - -likes
1350 - -match
1351 blacklistsSort:
1352 name: sort
1353 in: query
1354 required: false
1355 description: Sort blacklists by criteria
1356 schema:
1357 type: string
1358 enum:
1359 - -id
1360 - -name
1361 - -duration
1362 - -views
1363 - -likes
1364 - -dislikes
1365 - -uuid
1366 - -createdAt
1367 usersSort:
1368 name: sort
1369 in: query
1370 required: false
1371 description: Sort users by criteria
1372 schema:
1373 type: string
1374 enum:
1375 - -id
1376 - -username
1377 - -createdAt
1378 abusesSort:
1379 name: sort
1380 in: query
1381 required: false
1382 description: Sort abuses by criteria
1383 schema:
1384 type: string
1385 enum:
1386 - -id
1387 - -createdAt
1388 - -state
3e9e6f2f
RK
1389 name:
1390 name: name
1391 in: path
1392 required: true
1393 description: >-
1394 The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
1395 example)
1396 schema:
1397 type: string
1398 id:
1399 name: id
1400 in: path
1401 required: true
1402 description: The user id
1403 schema:
1569a818 1404 type: number
3e9e6f2f
RK
1405 id2:
1406 name: id
1407 in: path
1408 required: true
1409 description: The video id or uuid
1410 schema:
1411 type: string
1412 id3:
1413 name: id
1414 in: path
1415 required: true
1416 description: The video channel id or uuid
1417 schema:
1418 type: string
1419 commentId:
1420 name: threadId
1421 in: path
1422 required: true
1423 description: The comment id
1424 schema:
c360c494 1425 type: number
fd5af7a2
RK
1426 categoryOneOf:
1427 name: categoryOneOf
1428 in: query
1429 required: false
1430 description: category id of the video
1431 schema:
1432 oneOf:
1433 - type: number
1434 - type: array
1435 items:
1436 type: number
2beb9895
RK
1437 style: form
1438 explode: false
fd5af7a2
RK
1439 tagsOneOf:
1440 name: tagsOneOf
1441 in: query
1442 required: false
1443 description: tag(s) of the video
1444 schema:
1445 oneOf:
1446 - type: string
1447 - type: array
1448 items:
1449 type: string
2beb9895
RK
1450 style: form
1451 explode: false
fd5af7a2
RK
1452 tagsAllOf:
1453 name: tagsAllOf
1454 in: query
1455 required: false
1456 description: tag(s) of the video, where all should be present in the video
1457 schema:
1458 oneOf:
1459 - type: string
1460 - type: array
1461 items:
1462 type: string
2beb9895
RK
1463 style: form
1464 explode: false
fd5af7a2
RK
1465 languageOneOf:
1466 name: languageOneOf
1467 in: query
1468 required: false
1469 description: language id of the video
1470 schema:
1471 oneOf:
2beb9895 1472 - type: string
fd5af7a2
RK
1473 - type: array
1474 items:
2beb9895
RK
1475 type: string
1476 style: form
1477 explode: false
fd5af7a2
RK
1478 licenceOneOf:
1479 name: licenceOneOf
1480 in: query
1481 required: false
1482 description: licence id of the video
1483 schema:
1484 oneOf:
1485 - type: number
1486 - type: array
1487 items:
1488 type: number
2beb9895
RK
1489 style: form
1490 explode: false
fd5af7a2
RK
1491 nsfw:
1492 name: nsfw
1493 in: query
1494 required: false
1495 description: whether to include nsfw videos, if any
1496 schema:
1497 type: string
1498 enum:
1499 - 'true'
1500 - 'false'
1501 filter:
1502 name: filter
1503 in: query
1504 required: false
1505 description: >
1506 Special filters (local for instance) which might require special rights:
1507 * `local` - only videos local to the instance
1508 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
1509 schema:
1510 type: string
1511 enum:
1512 - local
1513 - all-local
3e9e6f2f
RK
1514 requestBodies:
1515 VideoChannelInput:
1516 content:
1517 application/json:
1518 schema:
1519 $ref: '#/components/schemas/VideoChannelInput'
1520 securitySchemes:
1521 OAuth2:
1522 description: >
1523 In the header: *Authorization: Bearer <token\>*
1524
1525
1526 Authenticating via OAuth requires the following steps:
1527
1528
1529 - Have an account with sufficient authorization levels
1530
1531 - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a
1532 Bearer Token
1533
1534 - Make Authenticated Requests
1535 type: oauth2
1536 flows:
1537 password:
1538 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
1539 scopes:
1540 admin: Admin scope
1541 moderator: Moderator scope
1542 user: User scope
1543 schemas:
1544 VideoConstantNumber:
1545 properties:
1546 id:
1547 type: number
1548 label:
1549 type: string
1550 VideoConstantString:
1551 properties:
1552 id:
1553 type: string
1554 label:
1555 type: string
1556 VideoPrivacy:
1557 type: string
1558 enum:
1559 - Public
1560 - Unlisted
1561 - Private
1562 Video:
1563 properties:
1564 id:
1565 type: number
1566 uuid:
1567 type: string
1568 createdAt:
1569 type: string
1570 publishedAt:
1571 type: string
1572 updatedAt:
1573 type: string
1574 category:
1575 $ref: '#/components/schemas/VideoConstantNumber'
1576 licence:
1577 $ref: '#/components/schemas/VideoConstantNumber'
1578 language:
1579 $ref: '#/components/schemas/VideoConstantString'
1580 privacy:
1581 $ref: '#/components/schemas/VideoPrivacy'
1582 description:
1583 type: string
1584 duration:
1585 type: number
1586 isLocal:
1587 type: boolean
1588 name:
1589 type: string
1590 thumbnailPath:
1591 type: string
1592 previewPath:
1593 type: string
1594 embedPath:
1595 type: string
1596 views:
1597 type: number
1598 likes:
1599 type: number
1600 dislikes:
1601 type: number
1602 nsfw:
1603 type: boolean
1604 account:
1605 type: object
1606 properties:
1607 name:
1608 type: string
1609 displayName:
1610 type: string
1611 url:
1612 type: string
1613 host:
1614 type: string
1615 avatar:
1616 $ref: '#/components/schemas/Avatar'
1617 VideoAbuse:
1618 properties:
1619 id:
1620 type: number
1621 reason:
1622 type: string
1623 reporterAccount:
1624 $ref: '#/components/schemas/Account'
1625 video:
1626 type: object
1627 properties:
1628 id:
1629 type: number
1630 name:
1631 type: string
1632 uuid:
1633 type: string
1634 url:
1635 type: string
1636 createdAt:
1637 type: string
1638 VideoBlacklist:
1639 properties:
1640 id:
1641 type: number
1642 videoId:
1643 type: number
1644 createdAt:
1645 type: string
1646 updatedAt:
1647 type: string
1648 name:
1649 type: string
1650 uuid:
1651 type: string
1652 description:
1653 type: string
1654 duration:
1655 type: number
1656 views:
1657 type: number
1658 likes:
1659 type: number
1660 dislikes:
1661 type: number
1662 nsfw:
1663 type: boolean
1664 VideoChannel:
1665 properties:
1666 displayName:
1667 type: string
1668 description:
1669 type: string
1670 isLocal:
1671 type: boolean
1672 ownerAccount:
1673 type: object
1674 properties:
1675 id:
1676 type: number
1677 uuid:
1678 type: string
1679 VideoComment:
1680 properties:
1681 id:
1682 type: number
1683 url:
1684 type: string
1685 text:
1686 type: string
1687 threadId:
1688 type: number
1689 inReplyToCommentId:
1690 type: number
1691 videoId:
1692 type: number
1693 createdAt:
1694 type: string
1695 updatedAt:
1696 type: string
1697 totalReplies:
1698 type: number
1699 account:
1700 $ref: '#/components/schemas/Account'
1701 VideoCommentThreadTree:
1702 properties:
1703 comment:
1704 $ref: '#/components/schemas/VideoComment'
1705 children:
1706 type: array
1707 items:
1708 $ref: '#/components/schemas/VideoCommentThreadTree'
1709 Avatar:
1710 properties:
1711 path:
1712 type: string
1713 createdAt:
1714 type: string
1715 updatedAt:
1716 type: string
1717 Actor:
1718 properties:
1719 id:
1720 type: number
1721 uuid:
1722 type: string
1723 url:
1724 type: string
1725 name:
1726 type: string
1727 host:
1728 type: string
1729 followingCount:
1730 type: number
1731 followersCount:
1732 type: number
1733 createdAt:
1734 type: string
1735 updatedAt:
1736 type: string
1737 avatar:
1738 $ref: '#/components/schemas/Avatar'
1739 Account:
1740 allOf:
1741 - $ref: '#/components/schemas/Actor'
1742 - properties:
1743 displayName:
1744 type: string
1745 User:
1746 properties:
1747 id:
1748 type: number
1749 username:
1750 type: string
1751 email:
1752 type: string
1753 displayNSFW:
1754 type: boolean
1755 autoPlayVideo:
1756 type: boolean
1757 role:
1758 type: string
1759 enum:
1760 - User
1761 - Moderator
1762 - Administrator
1763 videoQuota:
1764 type: number
1765 createdAt:
1766 type: string
1767 account:
1768 $ref: '#/components/schemas/Account'
1769 videoChannels:
1770 type: array
1771 items:
1772 $ref: '#/components/schemas/VideoChannel'
6441981b
RK
1773 UserWatchingVideo:
1774 properties:
1775 currentTime:
1776 type: number
3e9e6f2f
RK
1777 ServerConfig:
1778 properties:
1779 signup:
1780 type: object
1781 properties:
1782 allowed:
1783 type: boolean
1784 transcoding:
1785 type: object
1786 properties:
1787 enabledResolutions:
1788 type: array
1789 items:
1790 type: number
1791 avatar:
1792 type: object
1793 properties:
1794 file:
1795 type: object
1796 properties:
1797 size:
1798 type: object
1799 properties:
1800 max:
1801 type: number
1802 extensions:
1803 type: array
1804 items:
1805 type: string
1806 video:
1807 type: object
1808 properties:
1809 file:
1810 type: object
1811 properties:
1812 extensions:
1813 type: array
1814 items:
1815 type: string
1816 Follow:
1817 properties:
1818 id:
1819 type: number
1820 follower:
1821 $ref: '#/components/schemas/Actor'
1822 following:
1823 $ref: '#/components/schemas/Actor'
1824 score:
1825 type: number
1826 state:
1827 type: string
1828 enum:
1829 - pending
1830 - accepted
1831 createdAt:
1832 type: string
1833 updatedAt:
1834 type: string
1835 Job:
1836 properties:
1837 id:
1838 type: number
1839 state:
1840 type: string
1841 enum:
1842 - pending
1843 - processing
1844 - error
1845 - success
1846 category:
1847 type: string
1848 enum:
1849 - transcoding
1850 - activitypub-http
1851 handlerName:
1852 type: string
1853 handlerInputData:
1854 type: string
1855 createdAt:
1856 type: string
1857 updatedAt:
1858 type: string
1859 AddUserResponse:
1860 properties:
1861 id:
1862 type: number
1863 uuid:
1864 type: string
1865 VideoUploadResponse:
1866 properties:
1867 video:
1868 type: object
1869 properties:
1870 id:
1871 type: number
1872 uuid:
1873 type: string
1874 CommentThreadResponse:
1875 properties:
1876 total:
1877 type: number
1878 data:
1879 type: array
1880 items:
1881 $ref: '#/components/schemas/VideoComment'
1882 CommentThreadPostResponse:
1883 properties:
1884 comment:
1885 $ref: '#/components/schemas/VideoComment'
1886 AddUser:
1887 properties:
1888 username:
1889 type: string
1890 description: 'The user username '
1891 password:
1892 type: string
1893 description: 'The user password '
1894 email:
1895 type: string
1896 description: 'The user email '
1897 videoQuota:
1898 type: string
1899 description: 'The user videoQuota '
1900 role:
0f490230
RK
1901 type: integer
1902 format: int32
1903 enum:
1904 - 0
1905 - 1
1906 - 2
3e9e6f2f
RK
1907 description: 'The user role '
1908 required:
1909 - username
1910 - password
1911 - email
1912 - videoQuota
1913 - role
1914 UpdateUser:
1915 properties:
1916 id:
1917 type: string
1918 description: 'The user id '
1919 email:
1920 type: string
1921 description: 'The updated email of the user '
1922 videoQuota:
1923 type: string
1924 description: 'The updated videoQuota of the user '
1925 role:
1926 type: string
1927 description: 'The updated role of the user '
1928 required:
1929 - id
1930 - email
1931 - videoQuota
1932 - role
1933 UpdateMe:
1934 properties:
1935 password:
1936 type: string
1937 description: 'Your new password '
1938 email:
1939 type: string
1940 description: 'Your new email '
1941 displayNSFW:
1942 type: string
1943 description: 'Your new displayNSFW '
1944 autoPlayVideo:
1945 type: string
1946 description: 'Your new autoPlayVideo '
1947 required:
1948 - password
1949 - email
1950 - displayNSFW
1951 - autoPlayVideo
1952 GetMeVideoRating:
1953 properties:
1954 id:
1955 type: string
1956 description: 'Id of the video '
1957 rating:
1958 type: number
1959 description: 'Rating of the video '
1960 required:
1961 - id
1962 - rating
1963 RegisterUser:
1964 properties:
1965 username:
1966 type: string
1967 description: 'The username of the user '
1968 password:
1969 type: string
1970 description: 'The password of the user '
1971 email:
1972 type: string
1973 description: 'The email of the user '
1974 required:
1975 - username
1976 - password
1977 - email
1978 VideoChannelInput:
1979 properties:
1980 name:
1981 type: string
1982 description:
1983 type: string
1569a818 1984