]> 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
0109c492 4 version: 1.3.1
2963c343
RK
5 contact:
6 name: PeerTube Community
7 url: 'https://joinpeertube.org'
8 license:
9 name: AGPLv3.0
10 url: 'https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE'
11 x-logo:
12 url: 'https://joinpeertube.org/img/brand.png'
5776f78e 13 altText: PeerTube Project Homepage
2963c343
RK
14 description: |
15 # Introduction
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
5dce26d2
C
847 scheduleUpdate:
848 $ref: '#/components/schemas/VideoScheduledUpdate'
1569a818 849 get:
2963c343 850 summary: Get a video by its id
1569a818
DG
851 tags:
852 - Video
1569a818 853 parameters:
3e9e6f2f 854 - $ref: '#/components/parameters/id2'
1569a818
DG
855 responses:
856 '200':
857 description: successful operation
3e9e6f2f
RK
858 content:
859 application/json:
860 schema:
5dce26d2 861 $ref: '#/components/schemas/VideoDetails'
1569a818 862 delete:
2963c343 863 summary: Delete a video by its id
94ff4c23 864 security:
3e9e6f2f 865 - OAuth2: []
1569a818
DG
866 tags:
867 - Video
1569a818 868 parameters:
3e9e6f2f 869 - $ref: '#/components/parameters/id2'
1569a818
DG
870 responses:
871 '204':
3e9e6f2f
RK
872 $ref: '#/paths/~1users~1me/put/responses/204'
873 '/videos/{id}/description':
1569a818 874 get:
2963c343 875 summary: Get a video description by its id
1569a818
DG
876 tags:
877 - Video
1569a818 878 parameters:
3e9e6f2f 879 - $ref: '#/components/parameters/id2'
1569a818
DG
880 responses:
881 '200':
882 description: successful operation
3e9e6f2f
RK
883 content:
884 application/json:
885 schema:
886 type: string
887 '/videos/{id}/views':
1569a818 888 post:
2963c343 889 summary: Add a view to the video by its id
1569a818
DG
890 tags:
891 - Video
1569a818 892 parameters:
3e9e6f2f 893 - $ref: '#/components/parameters/id2'
1569a818
DG
894 responses:
895 '204':
3e9e6f2f 896 $ref: '#/paths/~1users~1me/put/responses/204'
6441981b
RK
897 '/videos/{id}/watching':
898 put:
f50ab1c2 899 summary: Set watching progress of a video by its id for a user
6441981b
RK
900 tags:
901 - Video
902 security:
903 - OAuth2: []
904 parameters:
905 - $ref: '#/components/parameters/id2'
906 requestBody:
907 content:
908 application/json:
909 schema:
910 $ref: '#/components/schemas/UserWatchingVideo'
911 required: true
912 responses:
913 '204':
914 $ref: '#/paths/~1users~1me/put/responses/204'
915 /videos/ownership:
916 get:
917 summary: Get list of video ownership changes requests
918 tags:
919 - Video
920 security:
921 - OAuth2: []
922 parameters:
923 - $ref: '#/components/parameters/id2'
924 responses:
925 '200':
926 description: successful operation
927 '/videos/ownership/{id}/accept':
928 post:
929 summary: Refuse ownership change request for video by its id
930 tags:
931 - Video
932 security:
933 - OAuth2: []
934 parameters:
935 - $ref: '#/components/parameters/id2'
936 responses:
937 '204':
938 $ref: '#/paths/~1users~1me/put/responses/204'
939 '/videos/ownership/{id}/refuse':
940 post:
941 summary: Accept ownership change request for video by its id
942 tags:
943 - Video
944 security:
945 - OAuth2: []
946 parameters:
947 - $ref: '#/components/parameters/id2'
948 responses:
949 '204':
950 $ref: '#/paths/~1users~1me/put/responses/204'
951 '/videos/{id}/give-ownership':
952 post:
953 summary: Request change of ownership for a video you own, by its id
954 tags:
955 - Video
956 security:
957 - OAuth2: []
958 parameters:
959 - $ref: '#/components/parameters/id2'
960 requestBody:
961 required: true
962 content:
963 application/x-www-form-urlencoded:
964 schema:
965 type: object
966 properties:
967 username:
968 type: string
969 required:
970 - username
971 responses:
972 '204':
973 $ref: '#/paths/~1users~1me/put/responses/204'
974 '400':
975 description: 'Changing video ownership to a remote account is not supported yet'
c360c494 976 /videos/upload:
1569a818 977 post:
2963c343 978 summary: Upload a video file with its metadata
94ff4c23 979 security:
3e9e6f2f 980 - OAuth2: []
1569a818
DG
981 tags:
982 - Video
1569a818
DG
983 responses:
984 '200':
985 description: successful operation
3e9e6f2f
RK
986 content:
987 application/json:
988 schema:
989 $ref: '#/components/schemas/VideoUploadResponse'
990 requestBody:
991 content:
992 multipart/form-data:
993 schema:
994 type: object
995 properties:
996 videofile:
997 description: Video file
998 type: string
999 format: binary
1000 channelId:
1001 description: Channel id that will contain this video
1002 type: number
1003 thumbnailfile:
1004 description: Video thumbnail file
1005 type: string
1006 previewfile:
1007 description: Video preview file
1008 type: string
8f9e8be1 1009 privacy:
ee89e8fd 1010 $ref: '#/components/schemas/VideoPrivacySet'
3e9e6f2f
RK
1011 category:
1012 description: Video category
1013 type: string
1014 licence:
1015 description: Video licence
1016 type: string
1017 language:
1018 description: Video language
1019 type: string
1020 description:
1021 description: Video description
1022 type: string
1023 waitTranscoding:
1024 description: Whether or not we wait transcoding before publish the video
1025 type: string
1026 support:
1027 description: Text describing how to support the video uploader
1028 type: string
1029 nsfw:
1030 description: Whether or not this video contains sensitive content
1031 type: string
1032 name:
1033 description: Video name
1034 type: string
1035 tags:
1036 description: Video tags
1fd12c7c
C
1037 type: array
1038 items:
1039 type: string
3e9e6f2f
RK
1040 commentsEnabled:
1041 description: Enable or disable comments for this video
1042 type: string
5dce26d2
C
1043 scheduleUpdate:
1044 $ref: '#/components/schemas/VideoScheduledUpdate'
3e9e6f2f
RK
1045 required:
1046 - videofile
1047 - channelId
8f9e8be1 1048 - name
8f9e8be1
RK
1049 x-code-samples:
1050 - lang: Shell
1051 source: |
1052 ## DEPENDENCIES: httpie, jq
1053 # pip install httpie
1054 USERNAME="<your_username>"
1055 PASSWORD="<your_password>"
1056 FILE_PATH="<your_file_path>"
1057 CHANNEL_ID="<your_channel_id>"
8f9e8be1
RK
1058 NAME="<video_name>"
1059
1060 API_PATH="https://peertube2.cpy.re/api/v1"
1061 ## AUTH
1062 client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1063 client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1064 token=$(http -b --form POST "$API_PATH/users/token" \
1065 client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
1066 username=$USERNAME \
1067 password=$PASSWORD \
1068 | jq -r ".access_token")
1069 ## VIDEO UPLOAD
1070 http -b --form POST "$API_PATH/videos/upload" \
1071 videofile@$FILE_PATH \
1072 channelId=$CHANNEL_ID \
1073 name=$NAME \
8f9e8be1 1074 "Authorization:Bearer $token"
28c8e63e
C
1075 /videos/imports:
1076 post:
1077 summary: Import a torrent or magnetURI or HTTP ressource (if enabled by the instance administrator)
1078 security:
1079 - OAuth2: []
1080 tags:
1081 - Video
1082 responses:
1083 '200':
1084 description: successful operation
1085 content:
1086 application/json:
1087 schema:
1088 $ref: '#/components/schemas/VideoUploadResponse'
1089 requestBody:
1090 content:
1091 multipart/form-data:
1092 schema:
1093 type: object
1094 properties:
1095 torrentfile:
1096 description: Torrent File
1097 type: string
1098 format: binary
1099 targetUrl:
1100 description: HTTP target URL
1101 type: string
1102 magnetUri:
1103 description: Magnet URI
1104 type: string
1105 channelId:
1106 description: Channel id that will contain this video
1107 type: number
1108 thumbnailfile:
1109 description: Video thumbnail file
1110 type: string
1111 previewfile:
1112 description: Video preview file
1113 type: string
1114 privacy:
ee89e8fd 1115 $ref: '#/components/schemas/VideoPrivacySet'
28c8e63e
C
1116 category:
1117 description: Video category
1118 type: string
1119 licence:
1120 description: Video licence
1121 type: string
1122 language:
1123 description: Video language
1124 type: string
1125 description:
1126 description: Video description
1127 type: string
1128 waitTranscoding:
1129 description: Whether or not we wait transcoding before publish the video
1130 type: string
1131 support:
1132 description: Text describing how to support the video uploader
1133 type: string
1134 nsfw:
1135 description: Whether or not this video contains sensitive content
1136 type: string
1137 name:
1138 description: Video name
1139 type: string
1140 tags:
1141 description: Video tags
1142 type: array
1143 items:
1144 type: string
1145 commentsEnabled:
1146 description: Enable or disable comments for this video
1147 type: string
5dce26d2
C
1148 scheduleUpdate:
1149 $ref: '#/components/schemas/VideoScheduledUpdate'
28c8e63e
C
1150 required:
1151 - channelId
1152 - name
c360c494 1153 /videos/abuse:
1569a818 1154 get:
2963c343 1155 summary: Get list of reported video abuses
94ff4c23 1156 security:
3e9e6f2f 1157 - OAuth2: []
1569a818 1158 tags:
5776f78e 1159 - Video Abuse
44cb3b85 1160 parameters:
3e9e6f2f
RK
1161 - $ref: '#/components/parameters/start'
1162 - $ref: '#/components/parameters/count'
fd5af7a2 1163 - $ref: '#/components/parameters/abusesSort'
1569a818
DG
1164 responses:
1165 '200':
1166 description: successful operation
3e9e6f2f
RK
1167 content:
1168 application/json:
1169 schema:
1170 type: array
1171 items:
1172 $ref: '#/components/schemas/VideoAbuse'
1173 '/videos/{id}/abuse':
1569a818 1174 post:
3e9e6f2f 1175 summary: 'Report an abuse, on a video by its id'
94ff4c23 1176 security:
3e9e6f2f 1177 - OAuth2: []
1569a818 1178 tags:
5776f78e 1179 - Video Abuse
1569a818 1180 parameters:
3e9e6f2f 1181 - $ref: '#/components/parameters/id2'
1569a818
DG
1182 responses:
1183 '204':
3e9e6f2f
RK
1184 $ref: '#/paths/~1users~1me/put/responses/204'
1185 '/videos/{id}/blacklist':
1569a818 1186 post:
2963c343 1187 summary: Put on blacklist a video by its id
94ff4c23 1188 security:
3e9e6f2f
RK
1189 - OAuth2:
1190 - admin
1191 - moderator
1569a818 1192 tags:
5776f78e 1193 - Video Blacklist
1569a818 1194 parameters:
3e9e6f2f 1195 - $ref: '#/components/parameters/id2'
1569a818
DG
1196 responses:
1197 '204':
3e9e6f2f 1198 $ref: '#/paths/~1users~1me/put/responses/204'
1569a818 1199 delete:
2963c343 1200 summary: Delete an entry of the blacklist of a video by its id
94ff4c23 1201 security:
3e9e6f2f
RK
1202 - OAuth2:
1203 - admin
1204 - moderator
1569a818 1205 tags:
5776f78e 1206 - Video Blacklist
1569a818 1207 parameters:
3e9e6f2f 1208 - $ref: '#/components/parameters/id2'
1569a818
DG
1209 responses:
1210 '204':
3e9e6f2f 1211 $ref: '#/paths/~1users~1me/put/responses/204'
c360c494 1212 /videos/blacklist:
1569a818 1213 get:
2963c343 1214 summary: Get list of videos on blacklist
94ff4c23 1215 security:
3e9e6f2f
RK
1216 - OAuth2:
1217 - admin
1218 - moderator
1569a818 1219 tags:
5776f78e 1220 - Video Blacklist
44cb3b85 1221 parameters:
3e9e6f2f
RK
1222 - $ref: '#/components/parameters/start'
1223 - $ref: '#/components/parameters/count'
fd5af7a2 1224 - $ref: '#/components/parameters/blacklistsSort'
1569a818
DG
1225 responses:
1226 '200':
1227 description: successful operation
3e9e6f2f
RK
1228 content:
1229 application/json:
1230 schema:
1231 type: array
1232 items:
1233 $ref: '#/components/schemas/VideoBlacklist'
67ae04a5
C
1234 /videos/{id}/captions:
1235 get:
1236 summary: Get list of video's captions
1237 tags:
1238 - Video Caption
1239 parameters:
1240 - $ref: '#/components/parameters/id2'
1241 responses:
1242 '200':
1243 description: successful operation
1244 content:
1245 application/json:
1246 schema:
1247 type: object
1248 properties:
1249 total:
1250 type: integer
1251 data:
1252 type: array
1253 items:
1254 $ref: '#/components/schemas/VideoCaption'
1255 /videos/{id}/captions/{captionLanguage}:
1256 put:
1257 summary: Add or replace a video caption
1258 tags:
1259 - Video Caption
1260 parameters:
1261 - $ref: '#/components/parameters/id2'
1262 - $ref: '#/components/parameters/captionLanguage'
1263 requestBody:
1264 content:
1265 multipart/form-data:
1266 schema:
1267 type: object
1268 properties:
1269 captionfile:
1270 description: The file to upload.
1271 type: string
1272 format: binary
1273 responses:
1274 '204':
1275 $ref: '#/paths/~1users~1me/put/responses/204'
1276 delete:
1277 summary: Delete a video caption
1278 tags:
1279 - Video Caption
1280 parameters:
1281 - $ref: '#/components/parameters/id2'
1282 - $ref: '#/components/parameters/captionLanguage'
1283 responses:
1284 '204':
1285 $ref: '#/paths/~1users~1me/put/responses/204'
48dce1c9 1286 /video-channels:
1569a818 1287 get:
2963c343 1288 summary: Get list of video channels
1569a818 1289 tags:
5776f78e 1290 - Video Channel
44cb3b85 1291 parameters:
3e9e6f2f
RK
1292 - $ref: '#/components/parameters/start'
1293 - $ref: '#/components/parameters/count'
1294 - $ref: '#/components/parameters/sort'
1569a818
DG
1295 responses:
1296 '200':
1297 description: successful operation
3e9e6f2f
RK
1298 content:
1299 application/json:
1300 schema:
1301 type: array
1302 items:
1303 $ref: '#/components/schemas/VideoChannel'
1569a818 1304 post:
2963c343 1305 summary: Creates a video channel for the current user
94ff4c23 1306 security:
3e9e6f2f 1307 - OAuth2: []
1569a818 1308 tags:
5776f78e 1309 - Video Channel
1569a818
DG
1310 responses:
1311 '204':
3e9e6f2f
RK
1312 $ref: '#/paths/~1users~1me/put/responses/204'
1313 requestBody:
7d14d4d2
C
1314 content:
1315 application/json:
1316 schema:
1317 $ref: '#/components/schemas/VideoChannelCreate'
9ce3d302 1318 '/video-channels/{channelHandle}':
1569a818 1319 get:
2963c343 1320 summary: Get a video channel by its id
1569a818 1321 tags:
5776f78e 1322 - Video Channel
1569a818 1323 parameters:
9ce3d302 1324 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
1325 responses:
1326 '200':
1327 description: successful operation
3e9e6f2f
RK
1328 content:
1329 application/json:
1330 schema:
1331 $ref: '#/components/schemas/VideoChannel'
1569a818 1332 put:
2963c343 1333 summary: Update a video channel by its id
94ff4c23 1334 security:
3e9e6f2f 1335 - OAuth2: []
1569a818 1336 tags:
5776f78e 1337 - Video Channel
1569a818 1338 parameters:
9ce3d302 1339 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
1340 responses:
1341 '204':
3e9e6f2f
RK
1342 $ref: '#/paths/~1users~1me/put/responses/204'
1343 requestBody:
7d14d4d2
C
1344 content:
1345 application/json:
1346 schema:
1347 $ref: '#/components/schemas/VideoChannelUpdate'
1569a818 1348 delete:
2963c343 1349 summary: Delete a video channel by its id
94ff4c23 1350 security:
3e9e6f2f 1351 - OAuth2: []
1569a818 1352 tags:
5776f78e 1353 - Video Channel
1569a818 1354 parameters:
9ce3d302 1355 - $ref: '#/components/parameters/channelHandle'
cc918ac3
C
1356 responses:
1357 '204':
3e9e6f2f 1358 $ref: '#/paths/~1users~1me/put/responses/204'
9ce3d302 1359 '/video-channels/{channelHandle}/videos':
cc918ac3 1360 get:
2963c343 1361 summary: Get videos of a video channel by its id
cc918ac3 1362 tags:
048b6946 1363 - Video
5776f78e 1364 - Video Channel
cc918ac3 1365 parameters:
9ce3d302 1366 - $ref: '#/components/parameters/channelHandle'
1569a818 1367 responses:
cc918ac3 1368 '200':
1569a818 1369 description: successful operation
3e9e6f2f
RK
1370 content:
1371 application/json:
1372 schema:
048b6946 1373 $ref: '#/components/schemas/VideoListResponse'
3e9e6f2f 1374 '/accounts/{name}/video-channels':
6b738c7a 1375 get:
2963c343 1376 summary: Get video channels of an account by its name
6b738c7a 1377 tags:
5776f78e 1378 - Video Channel
6b738c7a 1379 parameters:
3e9e6f2f 1380 - $ref: '#/components/parameters/name'
6b738c7a
C
1381 responses:
1382 '200':
1383 description: successful operation
3e9e6f2f
RK
1384 content:
1385 application/json:
1386 schema:
1387 type: array
1388 items:
1389 $ref: '#/components/schemas/VideoChannel'
c100a614
YB
1390 '/accounts/{name}/ratings':
1391 get:
1392 summary: Get ratings of an account by its name
1393 security:
1394 - OAuth2: []
1395 tags:
1396 - User
1397 parameters:
1398 - $ref: '#/components/parameters/start'
1399 - $ref: '#/components/parameters/count'
1400 - $ref: '#/components/parameters/sort'
1401 - name: rating
1402 in: query
1403 required: false
1404 description: Optionaly filter which ratings to retrieve
1405 schema:
1406 type: string
1407 enum:
1408 - like
1409 - dislike
1410 responses:
1411 '200':
1412 description: successful operation
1413 content:
1414 application/json:
1415 schema:
1416 type: array
1417 items:
1418 $ref: '#/components/schemas/VideoRating'
3e9e6f2f 1419 '/videos/{id}/comment-threads':
1569a818 1420 get:
2963c343 1421 summary: Get the comment threads of a video by its id
1569a818 1422 tags:
5776f78e 1423 - Video Comment
1569a818 1424 parameters:
3e9e6f2f
RK
1425 - $ref: '#/components/parameters/id2'
1426 - $ref: '#/components/parameters/start'
1427 - $ref: '#/components/parameters/count'
1428 - $ref: '#/components/parameters/sort'
1569a818
DG
1429 responses:
1430 '200':
1431 description: successful operation
3e9e6f2f
RK
1432 content:
1433 application/json:
1434 schema:
1435 $ref: '#/components/schemas/CommentThreadResponse'
1569a818 1436 post:
3e9e6f2f 1437 summary: 'Creates a comment thread, on a video by its id'
94ff4c23 1438 security:
3e9e6f2f 1439 - OAuth2: []
1569a818 1440 tags:
5776f78e 1441 - Video Comment
1569a818 1442 parameters:
3e9e6f2f 1443 - $ref: '#/components/parameters/id2'
1569a818
DG
1444 responses:
1445 '200':
1446 description: successful operation
3e9e6f2f
RK
1447 content:
1448 application/json:
1449 schema:
1450 $ref: '#/components/schemas/CommentThreadPostResponse'
1451 '/videos/{id}/comment-threads/{threadId}':
1569a818 1452 get:
3e9e6f2f 1453 summary: 'Get the comment thread by its id, of a video by its id'
1569a818 1454 tags:
5776f78e 1455 - Video Comment
1569a818 1456 parameters:
3e9e6f2f
RK
1457 - $ref: '#/components/parameters/id2'
1458 - name: threadId
1459 in: path
1460 required: true
1461 description: The thread id (root comment id)
1462 schema:
1463 type: number
1569a818
DG
1464 responses:
1465 '200':
1466 description: successful operation
3e9e6f2f
RK
1467 content:
1468 application/json:
1469 schema:
1470 $ref: '#/components/schemas/VideoCommentThreadTree'
1471 '/videos/{id}/comments/{commentId}':
1569a818 1472 post:
3e9e6f2f 1473 summary: 'Creates a comment in a comment thread by its id, of a video by its id'
94ff4c23 1474 security:
3e9e6f2f 1475 - OAuth2: []
1569a818 1476 tags:
5776f78e 1477 - Video Comment
1569a818 1478 parameters:
3e9e6f2f
RK
1479 - $ref: '#/components/parameters/id2'
1480 - $ref: '#/components/parameters/commentId'
1569a818
DG
1481 responses:
1482 '200':
1483 description: successful operation
3e9e6f2f
RK
1484 content:
1485 application/json:
1486 schema:
1487 $ref: '#/components/schemas/CommentThreadPostResponse'
1569a818 1488 delete:
089caedc 1489 summary: 'Delete a comment in a comment thread by its id, of a video by its id'
94ff4c23 1490 security:
3e9e6f2f 1491 - OAuth2: []
1569a818 1492 tags:
5776f78e 1493 - Video Comment
1569a818 1494 parameters:
3e9e6f2f
RK
1495 - $ref: '#/components/parameters/id2'
1496 - $ref: '#/components/parameters/commentId'
1569a818
DG
1497 responses:
1498 '204':
3e9e6f2f
RK
1499 $ref: '#/paths/~1users~1me/put/responses/204'
1500 '/videos/{id}/rate':
1569a818 1501 put:
2963c343 1502 summary: Vote for a video by its id
94ff4c23 1503 security:
3e9e6f2f 1504 - OAuth2: []
1569a818 1505 tags:
5776f78e 1506 - Video Rate
1569a818 1507 parameters:
3e9e6f2f 1508 - $ref: '#/components/parameters/id2'
1569a818
DG
1509 responses:
1510 '204':
3e9e6f2f 1511 $ref: '#/paths/~1users~1me/put/responses/204'
fb72c193
DL
1512 /search/videos:
1513 get:
1514 tags:
1515 - Search
2963c343 1516 summary: Get the videos corresponding to a given query
fb72c193 1517 parameters:
3e9e6f2f
RK
1518 - $ref: '#/components/parameters/start'
1519 - $ref: '#/components/parameters/count'
fd5af7a2 1520 - $ref: '#/components/parameters/videosSearchSort'
655b5490 1521 - name: search
fb72c193
DL
1522 in: query
1523 required: true
3e9e6f2f
RK
1524 description: String to search
1525 schema:
1526 type: string
fb72c193
DL
1527 responses:
1528 '200':
1529 description: successful operation
3e9e6f2f
RK
1530 content:
1531 application/json:
1532 schema:
048b6946 1533 $ref: '#/components/schemas/VideoListResponse'
3e9e6f2f 1534servers:
6441981b
RK
1535 - url: 'https://peertube.cpy.re/api/v1'
1536 description: Live Test Server (live data - stable version)
8f9e8be1 1537 - url: 'https://peertube2.cpy.re/api/v1'
6441981b
RK
1538 description: Live Test Server (live data - bleeding edge version)
1539 - url: 'https://peertube3.cpy.re/api/v1'
1540 description: Live Test Server (live data - bleeding edge version)
3e9e6f2f
RK
1541components:
1542 parameters:
1543 start:
1544 name: start
1545 in: query
1546 required: false
1547 description: Offset
1548 schema:
1569a818 1549 type: number
3e9e6f2f
RK
1550 count:
1551 name: count
1552 in: query
1553 required: false
1554 description: Number of items
1555 schema:
1569a818 1556 type: number
3e9e6f2f
RK
1557 sort:
1558 name: sort
1559 in: query
1560 required: false
1561 description: Sort column (-createdAt for example)
1562 schema:
1563 type: string
fd5af7a2
RK
1564 videosSort:
1565 name: sort
1566 in: query
1567 required: false
1568 description: Sort videos by criteria
1569 schema:
1570 type: string
1571 enum:
1572 - -name
1573 - -duration
1574 - -createdAt
1575 - -publishedAt
1576 - -views
1577 - -likes
1578 - -trending
1579 videosSearchSort:
1580 name: sort
1581 in: query
1582 required: false
1583 description: Sort videos by criteria
1584 schema:
1585 type: string
1586 enum:
1587 - -name
1588 - -duration
1589 - -createdAt
1590 - -publishedAt
1591 - -views
1592 - -likes
1593 - -match
1594 blacklistsSort:
1595 name: sort
1596 in: query
1597 required: false
1598 description: Sort blacklists by criteria
1599 schema:
1600 type: string
1601 enum:
1602 - -id
1603 - -name
1604 - -duration
1605 - -views
1606 - -likes
1607 - -dislikes
1608 - -uuid
1609 - -createdAt
1610 usersSort:
1611 name: sort
1612 in: query
1613 required: false
1614 description: Sort users by criteria
1615 schema:
1616 type: string
1617 enum:
1618 - -id
1619 - -username
1620 - -createdAt
1621 abusesSort:
1622 name: sort
1623 in: query
1624 required: false
1625 description: Sort abuses by criteria
1626 schema:
1627 type: string
1628 enum:
1629 - -id
1630 - -createdAt
1631 - -state
3e9e6f2f
RK
1632 name:
1633 name: name
1634 in: path
1635 required: true
1636 description: >-
1637 The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
1638 example)
1639 schema:
1640 type: string
1641 id:
1642 name: id
1643 in: path
1644 required: true
1645 description: The user id
1646 schema:
1569a818 1647 type: number
3e9e6f2f
RK
1648 id2:
1649 name: id
1650 in: path
1651 required: true
1652 description: The video id or uuid
1653 schema:
1654 type: string
67ae04a5
C
1655 captionLanguage:
1656 name: captionLanguage
1657 in: path
1658 required: true
1659 description: The caption language
1660 schema:
1661 type: string
9ce3d302
C
1662 channelHandle:
1663 name: channelHandle
3e9e6f2f
RK
1664 in: path
1665 required: true
9ce3d302 1666 description: "The video channel handle (example: 'my_username@example.com' or 'my_username')"
3e9e6f2f
RK
1667 schema:
1668 type: string
1669 commentId:
1670 name: threadId
1671 in: path
1672 required: true
1673 description: The comment id
1674 schema:
c360c494 1675 type: number
fd5af7a2
RK
1676 categoryOneOf:
1677 name: categoryOneOf
1678 in: query
1679 required: false
1680 description: category id of the video
1681 schema:
1682 oneOf:
1683 - type: number
1684 - type: array
1685 items:
1686 type: number
2beb9895
RK
1687 style: form
1688 explode: false
fd5af7a2
RK
1689 tagsOneOf:
1690 name: tagsOneOf
1691 in: query
1692 required: false
1693 description: tag(s) of the video
1694 schema:
1695 oneOf:
1696 - type: string
1697 - type: array
1698 items:
1699 type: string
2beb9895
RK
1700 style: form
1701 explode: false
fd5af7a2
RK
1702 tagsAllOf:
1703 name: tagsAllOf
1704 in: query
1705 required: false
1706 description: tag(s) of the video, where all should be present in the video
1707 schema:
1708 oneOf:
1709 - type: string
1710 - type: array
1711 items:
1712 type: string
2beb9895
RK
1713 style: form
1714 explode: false
fd5af7a2
RK
1715 languageOneOf:
1716 name: languageOneOf
1717 in: query
1718 required: false
1719 description: language id of the video
1720 schema:
1721 oneOf:
2beb9895 1722 - type: string
fd5af7a2
RK
1723 - type: array
1724 items:
2beb9895
RK
1725 type: string
1726 style: form
1727 explode: false
fd5af7a2
RK
1728 licenceOneOf:
1729 name: licenceOneOf
1730 in: query
1731 required: false
1732 description: licence id of the video
1733 schema:
1734 oneOf:
1735 - type: number
1736 - type: array
1737 items:
1738 type: number
2beb9895
RK
1739 style: form
1740 explode: false
fd5af7a2
RK
1741 nsfw:
1742 name: nsfw
1743 in: query
1744 required: false
1745 description: whether to include nsfw videos, if any
1746 schema:
1747 type: string
1748 enum:
1749 - 'true'
1750 - 'false'
1751 filter:
1752 name: filter
1753 in: query
1754 required: false
1755 description: >
1756 Special filters (local for instance) which might require special rights:
1757 * `local` - only videos local to the instance
1758 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
1759 schema:
1760 type: string
1761 enum:
1762 - local
1763 - all-local
e76d5784
RK
1764 subscriptionsUris:
1765 name: uris
1766 in: query
1767 required: true
1768 description: list of uris to check if each is part of the user subscriptions
1769 schema:
1770 type: array
1771 items:
1772 type: string
3e9e6f2f
RK
1773 securitySchemes:
1774 OAuth2:
1775 description: >
1776 In the header: *Authorization: Bearer <token\>*
1777
1778
1779 Authenticating via OAuth requires the following steps:
1780
1781
1782 - Have an account with sufficient authorization levels
1783
46e9407c 1784 - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
3e9e6f2f
RK
1785 Bearer Token
1786
1787 - Make Authenticated Requests
1788 type: oauth2
1789 flows:
1790 password:
1791 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
1792 scopes:
1793 admin: Admin scope
1794 moderator: Moderator scope
1795 user: User scope
1796 schemas:
1797 VideoConstantNumber:
1798 properties:
1799 id:
1800 type: number
1801 label:
1802 type: string
1803 VideoConstantString:
1804 properties:
1805 id:
1806 type: string
1807 label:
1808 type: string
ee89e8fd
C
1809 VideoPrivacySet:
1810 type: integer
3e9e6f2f 1811 enum:
ee89e8fd
C
1812 - 1
1813 - 2
1814 - 3
1815 description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3)'
1816 VideoPrivacyConstant:
1817 properties:
1818 id:
1819 type: integer
1820 enum:
1821 - 1
1822 - 2
1823 - 3
1824 label:
1825 type: string
5dce26d2
C
1826 VideoStateConstant:
1827 properties:
1828 id:
1829 type: integer
1830 enum:
1831 - 1
1832 - 2
1833 - 3
1834 description: 'The video state (Published = 1, to transcode = 2, to import = 3)'
1835 label:
1836 type: string
1837 VideoResolutionConstant:
1838 properties:
1839 id:
1840 type: integer
1841 description: 'Video resolution (240, 360, 720 ...)'
1842 label:
1843 type: string
1844 VideoScheduledUpdate:
1845 properties:
1846 privacy:
1847 $ref: '#/components/schemas/VideoPrivacySet'
1848 description: Video privacy target
1849 updateAt:
1850 type: string
1851 format: date
1852 description: When to update the video
1853 required:
1854 - updateAt
1855 VideoAccountSummary:
1856 properties:
1857 id:
1858 type: number
1859 name:
1860 type: string
1861 displayName:
1862 type: string
1863 url:
1864 type: string
1865 host:
1866 type: string
1867 avatar:
1868 nullable: true
1869 $ref: '#/components/schemas/Avatar'
1870 VideoChannelSummary:
1871 properties:
1872 id:
1873 type: number
1874 name:
1875 type: string
1876 displayName:
1877 type: string
1878 url:
1879 type: string
1880 host:
1881 type: string
1882 avatar:
1883 nullable: true
1884 $ref: '#/components/schemas/Avatar'
1885 PlaylistElement:
1886 properties:
1887 position:
1888 type: number
1889 startTimestamp:
1890 type: number
1891 stopTimestamp:
1892 type: number
1893 VideoFile:
1894 properties:
1895 magnetUri:
1896 type: string
1897 resolution:
1898 $ref: '#/components/schemas/VideoResolutionConstant'
1899 size:
1900 type: number
1901 description: 'Video file size in bytes'
1902 torrentUrl:
1903 type: string
1904 torrentDownaloadUrl:
1905 type: string
1906 fileUrl:
1907 type: string
1908 fileDownloadUrl:
1909 type: string
1910 fps:
1911 type: number
1912 VideoStreamingPlaylists:
1913 properties:
1914 id:
1915 type: number
1916 type:
1917 type: number
1918 enum:
1919 - 1
1920 description: 'Playlist type (HLS = 1)'
1921 playlistUrl:
1922 type: string
1923 segmentsSha256Url:
1924 type: string
1925 redundancies:
1926 type: array
1927 items:
1928 type: object
1929 properties:
1930 baseUrl:
1931 type: string
3e9e6f2f
RK
1932 Video:
1933 properties:
1934 id:
1935 type: number
1936 uuid:
1937 type: string
1938 createdAt:
1939 type: string
1940 publishedAt:
1941 type: string
1942 updatedAt:
1943 type: string
5dce26d2
C
1944 originallyPublishedAt:
1945 type: string
3e9e6f2f
RK
1946 category:
1947 $ref: '#/components/schemas/VideoConstantNumber'
1948 licence:
1949 $ref: '#/components/schemas/VideoConstantNumber'
1950 language:
1951 $ref: '#/components/schemas/VideoConstantString'
1952 privacy:
ee89e8fd 1953 $ref: '#/components/schemas/VideoPrivacyConstant'
3e9e6f2f
RK
1954 description:
1955 type: string
1956 duration:
1957 type: number
1958 isLocal:
1959 type: boolean
1960 name:
1961 type: string
1962 thumbnailPath:
1963 type: string
1964 previewPath:
1965 type: string
1966 embedPath:
1967 type: string
1968 views:
1969 type: number
1970 likes:
1971 type: number
1972 dislikes:
1973 type: number
1974 nsfw:
1975 type: boolean
5dce26d2
C
1976 waitTranscoding:
1977 type: boolean
1978 nullable: true
1979 state:
1980 $ref: '#/components/schemas/VideoStateConstant'
1981 scheduledUpdate:
1982 nullable: true
1983 $ref: '#/components/schemas/VideoScheduledUpdate'
1984 blacklisted:
1985 nullable: true
1986 type: boolean
1987 blacklistedReason:
1988 nullable: true
1989 type: string
3e9e6f2f 1990 account:
5dce26d2
C
1991 $ref: '#/components/schemas/VideoAccountSummary'
1992 channel:
1993 $ref: '#/components/schemas/VideoChannelSummary'
1994 userHistory:
1995 nullable: true
3e9e6f2f
RK
1996 type: object
1997 properties:
5dce26d2
C
1998 currentTime:
1999 type: number
2000 playlistElement:
2001 nullable: true
2002 $ref: '#/components/schemas/PlaylistElement'
2003 VideoDetails:
2004 allOf:
2005 - $ref: '#/components/schemas/Video'
2006 - type: object
2007 properties:
2008 descriptionPath:
3e9e6f2f 2009 type: string
5dce26d2 2010 support:
3e9e6f2f 2011 type: string
5dce26d2
C
2012 channel:
2013 $ref: '#/components/schemas/VideoChannel'
2014 account:
2015 $ref: '#/components/schemas/Account'
2016 tags:
2017 type: array
2018 items:
2019 type: string
2020 files:
2021 type: array
2022 items:
2023 $ref: '#/components/schemas/VideoFile'
2024 commentsEnabled:
2025 type: boolean
2026 downloadEnabled:
2027 type: boolean
2028 trackerUrls:
2029 type: array
2030 items:
2031 type: string
2032 streamingPlaylists:
2033 type: array
2034 items:
2035 $ref: '#/components/schemas/VideoStreamingPlaylists'
3e9e6f2f
RK
2036 VideoAbuse:
2037 properties:
2038 id:
2039 type: number
2040 reason:
2041 type: string
2042 reporterAccount:
2043 $ref: '#/components/schemas/Account'
2044 video:
2045 type: object
2046 properties:
2047 id:
2048 type: number
2049 name:
2050 type: string
2051 uuid:
2052 type: string
2053 url:
2054 type: string
2055 createdAt:
2056 type: string
2057 VideoBlacklist:
2058 properties:
2059 id:
2060 type: number
2061 videoId:
2062 type: number
2063 createdAt:
2064 type: string
2065 updatedAt:
2066 type: string
2067 name:
2068 type: string
2069 uuid:
2070 type: string
2071 description:
2072 type: string
2073 duration:
2074 type: number
2075 views:
2076 type: number
2077 likes:
2078 type: number
2079 dislikes:
2080 type: number
2081 nsfw:
2082 type: boolean
2083 VideoChannel:
2084 properties:
2085 displayName:
2086 type: string
2087 description:
2088 type: string
2089 isLocal:
2090 type: boolean
2091 ownerAccount:
2092 type: object
2093 properties:
2094 id:
2095 type: number
2096 uuid:
2097 type: string
2098 VideoComment:
2099 properties:
2100 id:
2101 type: number
2102 url:
2103 type: string
2104 text:
2105 type: string
2106 threadId:
2107 type: number
2108 inReplyToCommentId:
2109 type: number
2110 videoId:
2111 type: number
2112 createdAt:
2113 type: string
2114 updatedAt:
2115 type: string
2116 totalReplies:
2117 type: number
2118 account:
2119 $ref: '#/components/schemas/Account'
2120 VideoCommentThreadTree:
2121 properties:
2122 comment:
2123 $ref: '#/components/schemas/VideoComment'
2124 children:
2125 type: array
2126 items:
2127 $ref: '#/components/schemas/VideoCommentThreadTree'
67ae04a5
C
2128 VideoCaption:
2129 properties:
2130 language:
2131 $ref: '#/components/schemas/VideoConstantString'
2132 captionPath:
2133 type: string
3e9e6f2f
RK
2134 Avatar:
2135 properties:
2136 path:
2137 type: string
2138 createdAt:
2139 type: string
2140 updatedAt:
2141 type: string
2142 Actor:
2143 properties:
2144 id:
2145 type: number
2146 uuid:
2147 type: string
2148 url:
2149 type: string
2150 name:
2151 type: string
2152 host:
2153 type: string
2154 followingCount:
2155 type: number
2156 followersCount:
2157 type: number
2158 createdAt:
2159 type: string
2160 updatedAt:
2161 type: string
2162 avatar:
2163 $ref: '#/components/schemas/Avatar'
2164 Account:
2165 allOf:
2166 - $ref: '#/components/schemas/Actor'
2167 - properties:
2168 displayName:
2169 type: string
2170 User:
2171 properties:
2172 id:
2173 type: number
2174 username:
2175 type: string
2176 email:
2177 type: string
2178 displayNSFW:
2179 type: boolean
2180 autoPlayVideo:
2181 type: boolean
2182 role:
63d17405
C
2183 type: integer
2184 enum:
2185 - 0
2186 - 1
2187 - 2
2188 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
2189 roleLabel:
3e9e6f2f
RK
2190 type: string
2191 enum:
2192 - User
2193 - Moderator
2194 - Administrator
2195 videoQuota:
2196 type: number
ff40a4eb 2197 videoQuotaDaily:
fbe1bc2a 2198 type: number
3e9e6f2f
RK
2199 createdAt:
2200 type: string
2201 account:
2202 $ref: '#/components/schemas/Account'
2203 videoChannels:
2204 type: array
2205 items:
2206 $ref: '#/components/schemas/VideoChannel'
6441981b
RK
2207 UserWatchingVideo:
2208 properties:
2209 currentTime:
2210 type: number
3e9e6f2f
RK
2211 ServerConfig:
2212 properties:
2213 signup:
2214 type: object
2215 properties:
2216 allowed:
2217 type: boolean
2218 transcoding:
2219 type: object
2220 properties:
2221 enabledResolutions:
2222 type: array
2223 items:
2224 type: number
2225 avatar:
2226 type: object
2227 properties:
2228 file:
2229 type: object
2230 properties:
2231 size:
2232 type: object
2233 properties:
2234 max:
2235 type: number
2236 extensions:
2237 type: array
2238 items:
2239 type: string
2240 video:
2241 type: object
2242 properties:
2243 file:
2244 type: object
2245 properties:
2246 extensions:
2247 type: array
2248 items:
2249 type: string
2250 Follow:
2251 properties:
2252 id:
2253 type: number
2254 follower:
2255 $ref: '#/components/schemas/Actor'
2256 following:
2257 $ref: '#/components/schemas/Actor'
2258 score:
2259 type: number
2260 state:
2261 type: string
2262 enum:
2263 - pending
2264 - accepted
2265 createdAt:
2266 type: string
2267 updatedAt:
2268 type: string
2269 Job:
2270 properties:
2271 id:
2272 type: number
2273 state:
2274 type: string
2275 enum:
2276 - pending
2277 - processing
2278 - error
2279 - success
2280 category:
2281 type: string
2282 enum:
2283 - transcoding
2284 - activitypub-http
2285 handlerName:
2286 type: string
2287 handlerInputData:
2288 type: string
2289 createdAt:
2290 type: string
2291 updatedAt:
2292 type: string
2293 AddUserResponse:
2294 properties:
2295 id:
2296 type: number
2297 uuid:
2298 type: string
2299 VideoUploadResponse:
2300 properties:
2301 video:
2302 type: object
2303 properties:
2304 id:
2305 type: number
2306 uuid:
2307 type: string
2308 CommentThreadResponse:
2309 properties:
2310 total:
2311 type: number
2312 data:
2313 type: array
2314 items:
2315 $ref: '#/components/schemas/VideoComment'
2316 CommentThreadPostResponse:
2317 properties:
2318 comment:
2319 $ref: '#/components/schemas/VideoComment'
048b6946
C
2320 VideoListResponse:
2321 properties:
2322 total:
2323 type: number
2324 data:
2325 type: array
2326 items:
2327 $ref: '#/components/schemas/Video'
3e9e6f2f
RK
2328 AddUser:
2329 properties:
2330 username:
2331 type: string
2332 description: 'The user username '
2333 password:
2334 type: string
2335 description: 'The user password '
2336 email:
2337 type: string
2338 description: 'The user email '
2339 videoQuota:
2340 type: string
2341 description: 'The user videoQuota '
fbe1bc2a
C
2342 videoQuotaDaily:
2343 type: string
2344 description: 'The user daily video quota '
3e9e6f2f 2345 role:
0f490230 2346 type: integer
0f490230
RK
2347 enum:
2348 - 0
2349 - 1
2350 - 2
63d17405 2351 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
3e9e6f2f
RK
2352 required:
2353 - username
2354 - password
2355 - email
2356 - videoQuota
fbe1bc2a 2357 - videoQuotaDaily
3e9e6f2f
RK
2358 - role
2359 UpdateUser:
2360 properties:
2361 id:
2362 type: string
2363 description: 'The user id '
2364 email:
2365 type: string
2366 description: 'The updated email of the user '
2367 videoQuota:
2368 type: string
2369 description: 'The updated videoQuota of the user '
fbe1bc2a
C
2370 videoQuotaDaily:
2371 type: string
2372 description: 'The updated daily video quota of the user '
3e9e6f2f 2373 role:
63d17405
C
2374 type: integer
2375 enum:
2376 - 0
2377 - 1
2378 - 2
2379 description: 'The user role (Admin = 0, Moderator = 1, User = 2)'
3e9e6f2f
RK
2380 required:
2381 - id
2382 - email
2383 - videoQuota
fbe1bc2a 2384 - videoQuotaDaily
3e9e6f2f
RK
2385 - role
2386 UpdateMe:
2387 properties:
2388 password:
2389 type: string
2390 description: 'Your new password '
2391 email:
2392 type: string
2393 description: 'Your new email '
2394 displayNSFW:
2395 type: string
2396 description: 'Your new displayNSFW '
2397 autoPlayVideo:
2398 type: string
2399 description: 'Your new autoPlayVideo '
2400 required:
2401 - password
2402 - email
2403 - displayNSFW
2404 - autoPlayVideo
2405 GetMeVideoRating:
2406 properties:
2407 id:
2408 type: string
2409 description: 'Id of the video '
2410 rating:
2411 type: number
2412 description: 'Rating of the video '
2413 required:
2414 - id
2415 - rating
c100a614
YB
2416 VideoRating:
2417 properties:
2418 video:
2419 $ref: '#/components/schemas/Video'
2420 rating:
2421 type: number
2422 description: 'Rating of the video'
2423 required:
2424 - video
2425 - rating
3e9e6f2f
RK
2426 RegisterUser:
2427 properties:
2428 username:
2429 type: string
2430 description: 'The username of the user '
2431 password:
2432 type: string
2433 description: 'The password of the user '
2434 email:
2435 type: string
2436 description: 'The email of the user '
1f20622f
C
2437 displayName:
2438 type: string
2439 description: 'The user display name'
2440 channel:
2441 type: object
2442 properties:
2443 name:
2444 type: string
2445 description: 'The default channel name'
2446 displayName:
2447 type: string
2448 description: 'The default channel display name'
2449
3e9e6f2f
RK
2450 required:
2451 - username
2452 - password
2453 - email
7d14d4d2 2454 VideoChannelCreate:
3e9e6f2f
RK
2455 properties:
2456 name:
2457 type: string
7d14d4d2
C
2458 displayName:
2459 type: string
3e9e6f2f
RK
2460 description:
2461 type: string
7d14d4d2
C
2462 support:
2463 type: string
2464 required:
2465 - name
2466 - displayName
2467 VideoChannelUpdate:
2468 properties:
2469 displayName:
2470 type: string
2471 description:
2472 type: string
2473 support:
2474 type: string
2475 bulkVideosSupportUpdate:
2476 type: boolean
2477 description: 'Update all videos support field of this channel'
1569a818 2478