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