]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/api/openapi.yaml
Add open api doc for live
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
CommitLineData
3e9e6f2f 1openapi: 3.0.0
1569a818 2info:
5e1c08eb 3 title: PeerTube
b43d19cf 4 version: 2.4.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
002df381 16
b029d58a 17 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite
06746a8b 18 HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with
5776f78e 19 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
06746a8b
RK
20 which generates a client SDK in the language of your choice - we generate some client SDKs automatically:
21
22 - [Python](https://framagit.org/framasoft/peertube/clients/python)
23 - [Go](https://framagit.org/framasoft/peertube/clients/go)
24 - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin)
3e9e6f2f 25
b029d58a
C
26 See the [Quick Start guide](https://docs.joinpeertube.org/#/api-rest-getting-started) so you can play with the PeerTube API.
27
2963c343 28 # Authentication
002df381 29
2963c343 30 When you sign up for an account, you are given the possibility to generate
1fd12c7c 31 sessions, and authenticate using this session token. One session token can
2963c343 32 currently be used at a time.
5776f78e 33
84f6e32c
RK
34 ## Roles
35
36 Accounts are given permissions based on their role. There are three roles on
37 PeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/#/admin-managing-users?id=roles) for a detail of their permissions.
38
5776f78e 39 # Errors
002df381 40
5776f78e
RK
41 The API uses standard HTTP status codes to indicate the success or failure
42 of the API call. The body of the response will be JSON in the following
43 format.
44
45 ```
46 {
47 "code": "unauthorized_request", // example inner error code
48 "error": "Token is invalid." // example exposed error message
49 }
50 ```
6441981b 51externalDocs:
512a5759 52 url: https://docs.joinpeertube.org/api-rest-reference.html
2963c343
RK
53tags:
54 - name: Accounts
3e9e6f2f 55 description: >
1e904cde 56 Accounts encompass remote accounts discovered across the federation,
84f6e32c
RK
57 and correspond to the main Actor, along with video channels a user can create, which
58 are also Actors.
59
60 When a comment is posted, it is done with your Account's Actor.
61 - name: Users
62 description: >
63 Using some features of PeerTube require authentication, for which User
3e9e6f2f 64 provide different levels of permission as well as associated user
84f6e32c
RK
65 information. Each user has a corresponding local Account for federation.
66 - name: My User
67 description: >
68 Operations related to your own User, when logged-in.
69 - name: My Subscriptions
70 description: >
71 Operations related to your subscriptions to video channels, their
72 new videos, and how to keep up to date with their latest publications!
73 - name: My Notifications
74 description: >
75 Notifications following new videos, follows or reports. They allow you
76 to keep track of the interactions and overall important information that
77 concerns you. You MAY set per-notification type delivery preference, to
78 receive the info either by mail, by in-browser notification or both.
2963c343 79 - name: Config
3e9e6f2f
RK
80 description: >
81 Each server exposes public information regarding supported videos and
82 options.
2963c343 83 - name: Job
3e9e6f2f
RK
84 description: >
85 Jobs are long-running tasks enqueued and processed by the instance
5776f78e 86 itself. No additional worker registration is currently available.
b029d58a 87 - name: Instance Follows
3e9e6f2f
RK
88 description: >
89 Managing servers which the instance interacts with is crucial to the
5776f78e 90 concept of federation in PeerTube and external video indexation. The PeerTube
1fd12c7c 91 server then deals with inter-server ActivityPub operations and propagates
2963c343
RK
92 information across its social graph by posting activities to actors' inbox
93 endpoints.
84f6e32c
RK
94 externalDocs:
95 url: https://docs.joinpeertube.org/#/admin-following-instances?id=instances-follows
04b703f6
RK
96 - name: Instance Redundancy
97 description: >
98 Redundancy is part of the inter-server solidarity that PeerTube fosters.
99 Manage the list of instances you wish to help by seeding their videos according
100 to the policy of video selection of your choice. Note that you have a similar functionality
101 to mirror individual videos, see `Video Mirroring`.
84f6e32c
RK
102 externalDocs:
103 url: https://docs.joinpeertube.org/#/admin-following-instances?id=instances-redundancy
7461d440
RK
104 - name: Plugins
105 description: >
84f6e32c
RK
106 Managing plugins installed from a local path or from NPM, or search for new ones.
107 externalDocs:
108 url: https://docs.joinpeertube.org/#/api-plugins
310b5219 109 - name: Abuses
2963c343 110 description: |
310b5219 111 Abuses deal with reports of local or remote videos/comments/accounts alike.
2963c343
RK
112 - name: Video
113 description: |
114 Operations dealing with listing, uploading, fetching or modifying videos.
115 - name: Search
116 description: |
ad031145 117 The search helps to find _videos_ or _channels_ from within the instance and beyond.
2963c343
RK
118 Videos from other instances federated by the instance (that is, instances
119 followed by the instance) can be found via keywords and other criteria of
120 the advanced search.
ad031145
C
121
122 Administrators can also enable the use of a remote search system, indexing
123 videos and channels not could be not federated by the instance.
b029d58a 124 - name: Video Comments
3e9e6f2f
RK
125 description: >
126 Operations dealing with comments to a video. Comments are organized in
127 threads.
b029d58a 128 - name: Video Playlists
71810d0b
RK
129 description: >
130 Operations dealing with playlists of videos. Playlists are bound to users
131 and/or channels.
b029d58a 132 - name: Video Channels
3e9e6f2f 133 description: >
d73810be 134 Operations dealing with the creation, modification and listing of videos within a channel.
06746a8b 135 - name: Video Blocks
5776f78e 136 description: >
d73810be 137 Operations dealing with blocking videos (removing them from view and
5776f78e 138 preventing interactions).
b029d58a 139 - name: Video Rates
5776f78e 140 description: >
b029d58a 141 Like/dislike a video.
06746a8b
RK
142 - name: Feeds
143 description: >
144 Server syndication feeds
5776f78e
RK
145x-tagGroups:
146 - name: Accounts
147 tags:
148 - Accounts
b029d58a 149 - Users
1f82e3e8 150 - My User
b029d58a 151 - My Subscriptions
f4d59981 152 - My Notifications
5776f78e
RK
153 - name: Videos
154 tags:
155 - Video
04b703f6 156 - Video Captions
b029d58a
C
157 - Video Channels
158 - Video Comments
b029d58a
C
159 - Video Rates
160 - Video Playlists
161 - Video Ownership Change
04b703f6 162 - Video Mirroring
4e239e35 163 - Live Videos
06746a8b 164 - Feeds
b029d58a
C
165 - name: Search
166 tags:
167 - Search
5776f78e
RK
168 - name: Moderation
169 tags:
310b5219 170 - Abuses
1ebddadd 171 - Video Blocks
06746a8b
RK
172 - Account Blocks
173 - Server Blocks
65f02679 174 - name: Instance Configuration
5776f78e
RK
175 tags:
176 - Config
b029d58a 177 - Instance Follows
04b703f6 178 - Instance Redundancy
7461d440 179 - Plugins
5776f78e
RK
180 - name: Jobs
181 tags:
182 - Job
1569a818 183paths:
ad9e39fb 184 '/accounts/{name}':
1569a818
DG
185 get:
186 tags:
187 - Accounts
b029d58a 188 summary: Get an account
1569a818 189 parameters:
3e9e6f2f 190 - $ref: '#/components/parameters/name'
1569a818
DG
191 responses:
192 '200':
193 description: successful operation
3e9e6f2f
RK
194 content:
195 application/json:
196 schema:
197 $ref: '#/components/schemas/Account'
06746a8b
RK
198 '404':
199 description: account not found
ad9e39fb 200 '/accounts/{name}/videos':
6b738c7a
C
201 get:
202 tags:
203 - Accounts
2963c343 204 - Video
b029d58a 205 summary: 'List videos of an account'
6b738c7a 206 parameters:
3e9e6f2f 207 - $ref: '#/components/parameters/name'
59c794a5
C
208 - $ref: '#/components/parameters/categoryOneOf'
209 - $ref: '#/components/parameters/tagsOneOf'
210 - $ref: '#/components/parameters/tagsAllOf'
211 - $ref: '#/components/parameters/licenceOneOf'
212 - $ref: '#/components/parameters/languageOneOf'
213 - $ref: '#/components/parameters/nsfw'
214 - $ref: '#/components/parameters/filter'
215 - $ref: '#/components/parameters/skipCount'
216 - $ref: '#/components/parameters/start'
217 - $ref: '#/components/parameters/count'
218 - $ref: '#/components/parameters/videosSort'
6b738c7a
C
219 responses:
220 '200':
221 description: successful operation
3e9e6f2f
RK
222 content:
223 application/json:
224 schema:
048b6946 225 $ref: '#/components/schemas/VideoListResponse'
2963c343
RK
226 x-code-samples:
227 - lang: JavaScript
228 source: |
8f9e8be1 229 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
2963c343
RK
230 .then(function(response) {
231 return response.json()
232 }).then(function(data) {
233 console.log(data)
234 })
8f9e8be1
RK
235 - lang: Shell
236 source: |
0579dee3
JK
237 ## DEPENDENCIES: jq
238 curl -s https://peertube2.cpy.re/api/v1/accounts/{name}/videos | jq
5776f78e
RK
239 - lang: Ruby
240 source: |
5776f78e 241 require 'net/http'
f6d51cfe 242 require 'json'
5776f78e 243
f6d51cfe 244 uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
5776f78e 245
f6d51cfe 246 http = Net::HTTP.new(uri.host, uri.port)
5776f78e 247 http.use_ssl = true
5776f78e 248
f6d51cfe
MDB
249 response = http.get(uri.request_uri)
250
251 puts JSON.parse(response.read_body)
5776f78e
RK
252 - lang: Python
253 source: |
f6d51cfe 254 import requests
5776f78e 255
f6d51cfe
MDB
256 r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
257 json = r.json()
5776f78e 258
f6d51cfe 259 print(json)
1569a818
DG
260 /accounts:
261 get:
262 tags:
263 - Accounts
b029d58a 264 summary: List accounts
2a8ae759
FS
265 parameters:
266 - $ref: '#/components/parameters/start'
267 - $ref: '#/components/parameters/count'
268 - $ref: '#/components/parameters/sort'
1569a818
DG
269 responses:
270 '200':
271 description: successful operation
3e9e6f2f 272 content:
8f9e8be1 273 'application/json':
3e9e6f2f
RK
274 schema:
275 type: array
276 items:
277 $ref: '#/components/schemas/Account'
1569a818
DG
278 /config:
279 get:
280 tags:
281 - Config
b029d58a 282 summary: Get instance public configuration
1569a818
DG
283 responses:
284 '200':
285 description: successful operation
3e9e6f2f
RK
286 content:
287 application/json:
288 schema:
289 $ref: '#/components/schemas/ServerConfig'
6441981b
RK
290 /config/about:
291 get:
b029d58a 292 summary: Get instance "About" information
6441981b
RK
293 tags:
294 - Config
295 responses:
296 '200':
297 description: successful operation
2a8ae759
FS
298 content:
299 application/json:
300 schema:
301 $ref: '#/components/schemas/ServerConfigAbout'
6441981b
RK
302 /config/custom:
303 get:
b029d58a 304 summary: Get instance runtime configuration
6441981b
RK
305 tags:
306 - Config
307 security:
308 - OAuth2:
309 - admin
310 responses:
311 '200':
312 description: successful operation
2a8ae759
FS
313 content:
314 application/json:
315 schema:
316 $ref: '#/components/schemas/ServerConfigCustom'
6441981b 317 put:
b029d58a 318 summary: Set instance runtime configuration
6441981b
RK
319 tags:
320 - Config
321 security:
322 - OAuth2:
323 - admin
324 responses:
325 '200':
326 description: successful operation
84f6e32c
RK
327 '400':
328 x-summary: field inconsistencies
329 description: >
330 Arises when:
331 - the emailer is disabled and the instance is open to registrations
332 - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled
6441981b 333 delete:
b029d58a 334 summary: Delete instance runtime configuration
6441981b
RK
335 tags:
336 - Config
337 security:
338 - OAuth2:
339 - admin
340 responses:
341 '200':
342 description: successful operation
d216b538 343 /jobs/{state}:
1569a818 344 get:
b029d58a 345 summary: List instance jobs
94ff4c23 346 security:
3e9e6f2f
RK
347 - OAuth2:
348 - admin
1569a818
DG
349 tags:
350 - Job
44cb3b85
DG
351 parameters:
352 - name: state
353 in: path
354 required: true
3e9e6f2f
RK
355 description: The state of the job
356 schema:
357 type: string
65f02679
RK
358 enum:
359 - active
360 - completed
361 - failed
362 - waiting
363 - delayed
3e9e6f2f
RK
364 - $ref: '#/components/parameters/start'
365 - $ref: '#/components/parameters/count'
366 - $ref: '#/components/parameters/sort'
1569a818
DG
367 responses:
368 '200':
369 description: successful operation
3e9e6f2f
RK
370 content:
371 application/json:
372 schema:
84f6e32c
RK
373 type: object
374 properties:
375 total:
376 type: integer
377 example: 1
378 data:
379 type: array
380 maxItems: 100
381 items:
382 $ref: '#/components/schemas/Job'
1569a818
DG
383 '/server/following/{host}':
384 delete:
94ff4c23 385 security:
3e9e6f2f 386 - OAuth2:
06746a8b 387 - admin
1569a818 388 tags:
b029d58a
C
389 - Instance Follows
390 summary: Unfollow a server
1569a818
DG
391 parameters:
392 - name: host
393 in: path
394 required: true
1569a818 395 description: 'The host to unfollow '
3e9e6f2f
RK
396 schema:
397 type: string
84f6e32c 398 format: hostname
1569a818
DG
399 responses:
400 '201':
401 description: successful operation
402 /server/followers:
403 get:
404 tags:
b029d58a
C
405 - Instance Follows
406 summary: List instance followers
44cb3b85 407 parameters:
3e9e6f2f
RK
408 - $ref: '#/components/parameters/start'
409 - $ref: '#/components/parameters/count'
410 - $ref: '#/components/parameters/sort'
1569a818
DG
411 responses:
412 '200':
413 description: successful operation
3e9e6f2f
RK
414 content:
415 application/json:
416 schema:
417 type: array
418 items:
419 $ref: '#/components/schemas/Follow'
1569a818
DG
420 /server/following:
421 get:
422 tags:
b029d58a 423 - Instance Follows
f4d59981 424 summary: List instances followed by the server
44cb3b85 425 parameters:
f4d59981
RK
426 - name: state
427 in: query
428 schema:
429 type: string
430 enum:
431 - pending
432 - accepted
433 - name: actorType
434 in: query
435 schema:
436 type: string
437 enum:
438 - Person
439 - Application
440 - Group
441 - Service
442 - Organization
3e9e6f2f
RK
443 - $ref: '#/components/parameters/start'
444 - $ref: '#/components/parameters/count'
445 - $ref: '#/components/parameters/sort'
1569a818
DG
446 responses:
447 '200':
448 description: successful operation
3e9e6f2f
RK
449 content:
450 application/json:
451 schema:
452 type: array
453 items:
454 $ref: '#/components/schemas/Follow'
1569a818 455 post:
94ff4c23 456 security:
3e9e6f2f
RK
457 - OAuth2:
458 - admin
1569a818 459 tags:
b029d58a 460 - Instance Follows
2963c343 461 summary: Follow a server
1569a818
DG
462 responses:
463 '204':
c1843150 464 description: successful operation
f4d59981
RK
465 '500':
466 description: cannot follow a non-HTTPS server
3e9e6f2f
RK
467 requestBody:
468 content:
469 application/json:
470 schema:
f4d59981
RK
471 type: object
472 properties:
473 hosts:
474 type: array
475 items:
476 type: string
84f6e32c 477 format: hostname
f4d59981 478 uniqueItems: true
1569a818
DG
479 /users:
480 post:
b029d58a 481 summary: Create a user
94ff4c23 482 security:
3e9e6f2f
RK
483 - OAuth2:
484 - admin
1569a818 485 tags:
b029d58a 486 - Users
1569a818 487 responses:
1e904cde 488 '200':
2c318664 489 description: user created
3e9e6f2f
RK
490 content:
491 application/json:
492 schema:
493 $ref: '#/components/schemas/AddUserResponse'
2c318664
RK
494 links:
495 # GET /users/{id}
496 GetUserId:
497 operationId: getUserId
498 parameters:
499 id: '$response.body#/user/id'
500 # PUT /users/{id}
501 PutUserId:
502 operationId: putUserId
503 parameters:
504 id: '$response.body#/user/id'
505 # DELETE /users/{id}
506 DelUserId:
507 operationId: delUserId
508 parameters:
509 id: '$response.body#/user/id'
510 '403':
511 description: insufficient authority to create an admin or moderator
3e9e6f2f
RK
512 requestBody:
513 content:
514 application/json:
515 schema:
516 $ref: '#/components/schemas/AddUser'
517 description: User to create
518 required: true
1569a818 519 get:
b029d58a 520 summary: List users
94ff4c23 521 security:
8491293b
RK
522 - OAuth2:
523 - admin
1569a818 524 tags:
b029d58a 525 - Users
44cb3b85 526 parameters:
8491293b
RK
527 - $ref: '#/components/parameters/usersSearch'
528 - $ref: '#/components/parameters/usersBlocked'
3e9e6f2f
RK
529 - $ref: '#/components/parameters/start'
530 - $ref: '#/components/parameters/count'
fd5af7a2 531 - $ref: '#/components/parameters/usersSort'
1569a818
DG
532 responses:
533 '200':
534 description: successful operation
3e9e6f2f
RK
535 content:
536 application/json:
537 schema:
538 type: array
539 items:
540 $ref: '#/components/schemas/User'
1569a818 541 '/users/{id}':
2c318664
RK
542 parameters:
543 - $ref: '#/components/parameters/id'
1569a818 544 delete:
b029d58a 545 summary: Delete a user
94ff4c23 546 security:
3e9e6f2f
RK
547 - OAuth2:
548 - admin
1569a818 549 tags:
b029d58a 550 - Users
2c318664 551 operationId: delUserId
1569a818
DG
552 responses:
553 '204':
c1843150 554 description: successful operation
1569a818 555 get:
b029d58a 556 summary: Get a user
94ff4c23 557 security:
3e9e6f2f 558 - OAuth2: []
1569a818 559 tags:
b029d58a 560 - Users
2c318664 561 operationId: getUserId
1569a818
DG
562 responses:
563 '200':
564 description: successful operation
3e9e6f2f
RK
565 content:
566 application/json:
567 schema:
568 $ref: '#/components/schemas/User'
1569a818 569 put:
b029d58a 570 summary: Update a user
94ff4c23 571 security:
3e9e6f2f 572 - OAuth2: []
1569a818 573 tags:
b029d58a 574 - Users
2c318664 575 operationId: putUserId
1569a818
DG
576 responses:
577 '204':
c1843150 578 description: successful operation
3e9e6f2f
RK
579 requestBody:
580 content:
581 application/json:
582 schema:
583 $ref: '#/components/schemas/UpdateUser'
584 required: true
1f82e3e8
C
585 /users/register:
586 post:
587 summary: Register a user
588 tags:
b029d58a 589 - Users
1f82e3e8
C
590 responses:
591 '204':
c1843150 592 description: successful operation
1f82e3e8
C
593 requestBody:
594 content:
595 application/json:
596 schema:
597 $ref: '#/components/schemas/RegisterUser'
598 required: true
1569a818
DG
599 /users/me:
600 get:
b029d58a 601 summary: Get my user information
94ff4c23 602 security:
e76d5784
RK
603 - OAuth2:
604 - user
1569a818 605 tags:
1f82e3e8 606 - My User
1569a818
DG
607 responses:
608 '200':
609 description: successful operation
3e9e6f2f
RK
610 content:
611 application/json:
612 schema:
613 type: array
614 items:
615 $ref: '#/components/schemas/User'
1569a818 616 put:
b029d58a 617 summary: Update my user information
94ff4c23 618 security:
e76d5784
RK
619 - OAuth2:
620 - user
1569a818 621 tags:
1f82e3e8 622 - My User
1569a818
DG
623 responses:
624 '204':
37db4176 625 description: successful operation
3e9e6f2f
RK
626 requestBody:
627 content:
628 application/json:
629 schema:
630 $ref: '#/components/schemas/UpdateMe'
631 required: true
1f82e3e8
C
632 /users/me/videos/imports:
633 get:
b029d58a 634 summary: Get video imports of my user
1f82e3e8
C
635 security:
636 - OAuth2:
637 - user
638 tags:
b029d58a 639 - Videos
1f82e3e8
C
640 - My User
641 parameters:
642 - $ref: '#/components/parameters/start'
643 - $ref: '#/components/parameters/count'
644 - $ref: '#/components/parameters/sort'
645 responses:
646 '200':
647 description: successful operation
648 content:
649 application/json:
650 schema:
651 $ref: '#/components/schemas/VideoImport'
1569a818
DG
652 /users/me/video-quota-used:
653 get:
b029d58a 654 summary: Get my user used quota
94ff4c23 655 security:
e76d5784
RK
656 - OAuth2:
657 - user
1569a818 658 tags:
1f82e3e8 659 - My User
1569a818
DG
660 responses:
661 '200':
662 description: successful operation
3e9e6f2f
RK
663 content:
664 application/json:
665 schema:
666 type: number
1569a818
DG
667 '/users/me/videos/{videoId}/rating':
668 get:
50e16ccf 669 summary: Get rate of my user for a video
94ff4c23 670 security:
3e9e6f2f 671 - OAuth2: []
1569a818 672 tags:
1f82e3e8 673 - My User
b029d58a 674 - Video Rates
1569a818
DG
675 parameters:
676 - name: videoId
677 in: path
678 required: true
1569a818 679 description: 'The video id '
3e9e6f2f
RK
680 schema:
681 type: string
1569a818
DG
682 responses:
683 '200':
684 description: successful operation
3e9e6f2f
RK
685 content:
686 application/json:
687 schema:
688 $ref: '#/components/schemas/GetMeVideoRating'
1569a818
DG
689 /users/me/videos:
690 get:
b029d58a 691 summary: Get videos of my user
94ff4c23 692 security:
e76d5784
RK
693 - OAuth2:
694 - user
1569a818 695 tags:
1f82e3e8 696 - My User
b029d58a 697 - Videos
44cb3b85 698 parameters:
3e9e6f2f
RK
699 - $ref: '#/components/parameters/start'
700 - $ref: '#/components/parameters/count'
701 - $ref: '#/components/parameters/sort'
1569a818
DG
702 responses:
703 '200':
704 description: successful operation
3e9e6f2f
RK
705 content:
706 application/json:
707 schema:
048b6946 708 $ref: '#/components/schemas/VideoListResponse'
e76d5784
RK
709 /users/me/subscriptions:
710 get:
b029d58a 711 summary: Get my user subscriptions
e76d5784
RK
712 security:
713 - OAuth2:
714 - user
715 tags:
b029d58a 716 - My Subscriptions
e76d5784
RK
717 parameters:
718 - $ref: '#/components/parameters/start'
719 - $ref: '#/components/parameters/count'
720 - $ref: '#/components/parameters/sort'
721 responses:
722 '200':
723 description: successful operation
724 post:
2c318664
RK
725 tags:
726 - My Subscriptions
b029d58a 727 summary: Add subscription to my user
e76d5784
RK
728 security:
729 - OAuth2:
730 - user
2c318664
RK
731 requestBody:
732 content:
733 application/json:
734 schema:
735 type: object
736 properties:
737 uri:
738 type: string
739 format: uri
740 description: uri of the video channels to subscribe to
741 required:
742 - uri
743 examples:
744 default:
745 value:
746 uri: 008a0e54-375d-49d0-8379-143202e24152@video.lqdn.fr
e76d5784
RK
747 responses:
748 '200':
749 description: successful operation
750 /users/me/subscriptions/exist:
751 get:
b029d58a 752 summary: Get if subscriptions exist for my user
e76d5784
RK
753 security:
754 - OAuth2:
755 - user
756 tags:
b029d58a 757 - My Subscriptions
e76d5784
RK
758 parameters:
759 - $ref: '#/components/parameters/subscriptionsUris'
760 responses:
761 '200':
762 description: successful operation
763 content:
764 application/json:
765 schema:
766 type: object
767 /users/me/subscriptions/videos:
768 get:
b029d58a 769 summary: List videos of subscriptions of my user
e76d5784
RK
770 security:
771 - OAuth2:
772 - user
773 tags:
b029d58a
C
774 - My Subscriptions
775 - Videos
e76d5784 776 parameters:
59c794a5
C
777 - $ref: '#/components/parameters/categoryOneOf'
778 - $ref: '#/components/parameters/tagsOneOf'
779 - $ref: '#/components/parameters/tagsAllOf'
780 - $ref: '#/components/parameters/licenceOneOf'
781 - $ref: '#/components/parameters/languageOneOf'
782 - $ref: '#/components/parameters/nsfw'
783 - $ref: '#/components/parameters/filter'
784 - $ref: '#/components/parameters/skipCount'
e76d5784
RK
785 - $ref: '#/components/parameters/start'
786 - $ref: '#/components/parameters/count'
59c794a5 787 - $ref: '#/components/parameters/videosSort'
e76d5784
RK
788 responses:
789 '200':
790 description: successful operation
791 content:
792 application/json:
793 schema:
048b6946 794 $ref: '#/components/schemas/VideoListResponse'
cb9d028a 795 '/users/me/subscriptions/{subscriptionHandle}':
e76d5784 796 get:
b029d58a 797 summary: Get subscription of my user
e76d5784
RK
798 security:
799 - OAuth2:
800 - user
801 tags:
b029d58a 802 - My Subscriptions
cb9d028a
C
803 parameters:
804 - $ref: '#/components/parameters/subscriptionHandle'
e76d5784
RK
805 responses:
806 '200':
807 description: successful operation
808 content:
809 application/json:
810 schema:
811 $ref: '#/components/schemas/VideoChannel'
812 delete:
b029d58a 813 summary: Delete subscription of my user
e76d5784
RK
814 security:
815 - OAuth2:
816 - user
817 tags:
b029d58a 818 - My Subscriptions
cb9d028a
C
819 parameters:
820 - $ref: '#/components/parameters/subscriptionHandle'
e76d5784
RK
821 responses:
822 '200':
823 description: successful operation
f4d59981
RK
824 /users/me/notifications:
825 get:
826 summary: List my notifications
827 security:
828 - OAuth2: []
829 tags:
830 - My Notifications
831 parameters:
832 - name: unread
833 in: query
834 description: only list unread notifications
835 schema:
836 type: boolean
837 - $ref: '#/components/parameters/start'
838 - $ref: '#/components/parameters/count'
839 - $ref: '#/components/parameters/sort'
840 responses:
841 '200':
842 description: successful operation
843 content:
844 application/json:
845 schema:
846 $ref: '#/components/schemas/NotificationListResponse'
847 /users/me/notifications/read:
848 post:
849 summary: Mark notifications as read by their id
850 security:
851 - OAuth2: []
852 tags:
853 - My Notifications
854 requestBody:
855 content:
2c318664 856 application/json:
f4d59981
RK
857 schema:
858 type: object
859 properties:
860 ids:
861 type: array
862 description: ids of the notifications to mark as read
863 items:
864 type: integer
865 required:
866 - ids
867 responses:
868 '204':
869 description: successful operation
870 /users/me/notifications/read-all:
871 post:
872 summary: Mark all my notification as read
873 security:
874 - OAuth2: []
875 tags:
876 - My Notifications
877 responses:
878 '204':
879 description: successful operation
880 /users/me/notification-settings:
881 put:
882 summary: Update my notification settings
883 security:
884 - OAuth2: []
885 tags:
886 - My Notifications
887 requestBody:
888 content:
2c318664 889 application/json:
f4d59981
RK
890 schema:
891 type: object
892 properties:
893 newVideoFromSubscription:
894 $ref: '#/components/schemas/NotificationSettingValue'
895 newCommentOnMyVideo:
896 $ref: '#/components/schemas/NotificationSettingValue'
4f32032f 897 abuseAsModerator:
f4d59981
RK
898 $ref: '#/components/schemas/NotificationSettingValue'
899 videoAutoBlacklistAsModerator:
900 $ref: '#/components/schemas/NotificationSettingValue'
901 blacklistOnMyVideo:
902 $ref: '#/components/schemas/NotificationSettingValue'
903 myVideoPublished:
904 $ref: '#/components/schemas/NotificationSettingValue'
905 myVideoImportFinished:
906 $ref: '#/components/schemas/NotificationSettingValue'
907 newFollow:
908 $ref: '#/components/schemas/NotificationSettingValue'
909 newUserRegistration:
910 $ref: '#/components/schemas/NotificationSettingValue'
911 commentMention:
912 $ref: '#/components/schemas/NotificationSettingValue'
913 newInstanceFollower:
914 $ref: '#/components/schemas/NotificationSettingValue'
915 autoInstanceFollowing:
916 $ref: '#/components/schemas/NotificationSettingValue'
917 responses:
918 '204':
919 description: successful operation
1569a818
DG
920 /users/me/avatar/pick:
921 post:
b029d58a 922 summary: Update my user avatar
94ff4c23 923 security:
3e9e6f2f 924 - OAuth2: []
1569a818 925 tags:
1f82e3e8 926 - My User
1569a818
DG
927 responses:
928 '200':
929 description: successful operation
3e9e6f2f
RK
930 content:
931 application/json:
932 schema:
933 $ref: '#/components/schemas/Avatar'
934 requestBody:
935 content:
936 multipart/form-data:
937 schema:
938 type: object
939 properties:
940 avatarfile:
941 description: The file to upload.
942 type: string
943 format: binary
944 encoding:
0ad45af7 945 avatarfile:
3e9e6f2f 946 contentType: image/png, image/jpeg
b029d58a
C
947 /videos/ownership:
948 get:
949 summary: List video ownership changes
950 tags:
951 - Video Ownership Change
952 security:
953 - OAuth2: []
954 responses:
955 '200':
956 description: successful operation
957 '/videos/ownership/{id}/accept':
958 post:
959 summary: Accept ownership change request
960 tags:
961 - Video Ownership Change
962 security:
963 - OAuth2: []
964 parameters:
965 - $ref: '#/components/parameters/idOrUUID'
966 responses:
967 '204':
c1843150 968 description: successful operation
06746a8b
RK
969 '403':
970 description: cannot terminate an ownership change of another user
971 '404':
972 description: video owneship change not found
b029d58a
C
973 '/videos/ownership/{id}/refuse':
974 post:
975 summary: Refuse ownership change request
976 tags:
977 - Video Ownership Change
978 security:
979 - OAuth2: []
980 parameters:
981 - $ref: '#/components/parameters/idOrUUID'
982 responses:
983 '204':
c1843150 984 description: successful operation
06746a8b
RK
985 '403':
986 description: cannot terminate an ownership change of another user
987 '404':
988 description: video owneship change not found
b029d58a
C
989 '/videos/{id}/give-ownership':
990 post:
991 summary: Request ownership change
992 tags:
993 - Video Ownership Change
994 security:
995 - OAuth2: []
996 parameters:
997 - $ref: '#/components/parameters/idOrUUID'
998 requestBody:
999 required: true
1000 content:
1001 application/x-www-form-urlencoded:
1002 schema:
1003 type: object
1004 properties:
1005 username:
1006 type: string
1007 required:
1008 - username
1009 responses:
1010 '204':
c1843150 1011 description: successful operation
b029d58a 1012 '400':
06746a8b
RK
1013 description: changing video ownership to a remote account is not supported yet
1014 '404':
1015 description: video not found
c360c494 1016 /videos:
1569a818 1017 get:
b029d58a 1018 summary: List videos
1569a818
DG
1019 tags:
1020 - Video
44cb3b85 1021 parameters:
fd5af7a2
RK
1022 - $ref: '#/components/parameters/categoryOneOf'
1023 - $ref: '#/components/parameters/tagsOneOf'
1024 - $ref: '#/components/parameters/tagsAllOf'
1025 - $ref: '#/components/parameters/licenceOneOf'
1026 - $ref: '#/components/parameters/languageOneOf'
1027 - $ref: '#/components/parameters/nsfw'
1028 - $ref: '#/components/parameters/filter'
59c794a5 1029 - $ref: '#/components/parameters/skipCount'
3e9e6f2f
RK
1030 - $ref: '#/components/parameters/start'
1031 - $ref: '#/components/parameters/count'
fd5af7a2 1032 - $ref: '#/components/parameters/videosSort'
1569a818
DG
1033 responses:
1034 '200':
1035 description: successful operation
3e9e6f2f
RK
1036 content:
1037 application/json:
1038 schema:
048b6946 1039 $ref: '#/components/schemas/VideoListResponse'
c360c494 1040 /videos/categories:
1569a818 1041 get:
b029d58a 1042 summary: List available video categories
1569a818
DG
1043 tags:
1044 - Video
1569a818
DG
1045 responses:
1046 '200':
1047 description: successful operation
3e9e6f2f
RK
1048 content:
1049 application/json:
1050 schema:
1051 type: array
1052 items:
1053 type: string
84f6e32c
RK
1054 examples:
1055 nightly:
1056 externalValue: https://peertube2.cpy.re/api/v1/videos/categories
c360c494 1057 /videos/licences:
1569a818 1058 get:
b029d58a 1059 summary: List available video licences
1569a818
DG
1060 tags:
1061 - Video
1569a818
DG
1062 responses:
1063 '200':
1064 description: successful operation
3e9e6f2f
RK
1065 content:
1066 application/json:
1067 schema:
1068 type: array
1069 items:
1070 type: string
84f6e32c
RK
1071 examples:
1072 nightly:
1073 externalValue: https://peertube2.cpy.re/api/v1/videos/licences
c360c494 1074 /videos/languages:
1569a818 1075 get:
b029d58a 1076 summary: List available video languages
1569a818
DG
1077 tags:
1078 - Video
1569a818
DG
1079 responses:
1080 '200':
1081 description: successful operation
3e9e6f2f
RK
1082 content:
1083 application/json:
1084 schema:
1085 type: array
1086 items:
1087 type: string
84f6e32c
RK
1088 examples:
1089 nightly:
1090 externalValue: https://peertube2.cpy.re/api/v1/videos/languages
c360c494 1091 /videos/privacies:
1569a818 1092 get:
b029d58a 1093 summary: List available video privacies
1569a818
DG
1094 tags:
1095 - Video
1569a818
DG
1096 responses:
1097 '200':
1098 description: successful operation
3e9e6f2f
RK
1099 content:
1100 application/json:
1101 schema:
1102 type: array
1103 items:
1104 type: string
84f6e32c
RK
1105 examples:
1106 nightly:
1107 externalValue: https://peertube2.cpy.re/api/v1/videos/privacies
3e9e6f2f 1108 '/videos/{id}':
1569a818 1109 put:
b029d58a 1110 summary: Update a video
94ff4c23 1111 security:
3e9e6f2f 1112 - OAuth2: []
1569a818
DG
1113 tags:
1114 - Video
1569a818 1115 parameters:
cb9d028a 1116 - $ref: '#/components/parameters/idOrUUID'
1569a818 1117 responses:
37db4176 1118 '204':
1569a818 1119 description: successful operation
3e9e6f2f
RK
1120 requestBody:
1121 content:
1122 multipart/form-data:
1123 schema:
1124 type: object
1125 properties:
1126 thumbnailfile:
1127 description: Video thumbnail file
1128 type: string
0ad45af7 1129 format: binary
3e9e6f2f
RK
1130 previewfile:
1131 description: Video preview file
1132 type: string
0ad45af7 1133 format: binary
3e9e6f2f
RK
1134 category:
1135 description: Video category
84f6e32c
RK
1136 type: integer
1137 example: 4
3e9e6f2f
RK
1138 licence:
1139 description: Video licence
84f6e32c
RK
1140 type: integer
1141 example: 2
3e9e6f2f
RK
1142 language:
1143 description: Video language
1144 type: string
c1843150
C
1145 privacy:
1146 $ref: '#/components/schemas/VideoPrivacySet'
3e9e6f2f
RK
1147 description:
1148 description: Video description
1149 type: string
1150 waitTranscoding:
1151 description: Whether or not we wait transcoding before publish the video
1152 type: string
1153 support:
00494d6e
RK
1154 description: A text tell the audience how to support the video creator
1155 example: Please support my work on <insert crowdfunding plateform>! <3
3e9e6f2f
RK
1156 type: string
1157 nsfw:
1158 description: Whether or not this video contains sensitive content
84f6e32c 1159 type: boolean
3e9e6f2f
RK
1160 name:
1161 description: Video name
1162 type: string
1163 tags:
12fed49e 1164 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1fd12c7c 1165 type: array
07d02f6d
FS
1166 minItems: 1
1167 maxItems: 5
1fd12c7c
C
1168 items:
1169 type: string
07d02f6d
FS
1170 minLength: 2
1171 maxLength: 30
3e9e6f2f
RK
1172 commentsEnabled:
1173 description: Enable or disable comments for this video
84f6e32c 1174 type: boolean
37db4176
FS
1175 originallyPublishedAt:
1176 description: Date when the content was originally published
1177 type: string
1178 format: date-time
5dce26d2
C
1179 scheduleUpdate:
1180 $ref: '#/components/schemas/VideoScheduledUpdate'
0ad45af7
FS
1181 encoding:
1182 thumbnailfile:
1183 contentType: image/jpeg
1184 previewfile:
1185 contentType: image/jpeg
1569a818 1186 get:
b029d58a 1187 summary: Get a video
1569a818
DG
1188 tags:
1189 - Video
1569a818 1190 parameters:
cb9d028a 1191 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1192 responses:
1193 '200':
1194 description: successful operation
3e9e6f2f
RK
1195 content:
1196 application/json:
1197 schema:
5dce26d2 1198 $ref: '#/components/schemas/VideoDetails'
1569a818 1199 delete:
b029d58a 1200 summary: Delete a video
94ff4c23 1201 security:
3e9e6f2f 1202 - OAuth2: []
1569a818
DG
1203 tags:
1204 - Video
1569a818 1205 parameters:
cb9d028a 1206 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1207 responses:
1208 '204':
c1843150 1209 description: successful operation
3e9e6f2f 1210 '/videos/{id}/description':
1569a818 1211 get:
b029d58a 1212 summary: Get complete video description
1569a818
DG
1213 tags:
1214 - Video
1569a818 1215 parameters:
cb9d028a 1216 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1217 responses:
1218 '200':
1219 description: successful operation
3e9e6f2f
RK
1220 content:
1221 application/json:
1222 schema:
1223 type: string
1224 '/videos/{id}/views':
1569a818 1225 post:
b029d58a 1226 summary: Add a view to a video
1569a818
DG
1227 tags:
1228 - Video
1569a818 1229 parameters:
cb9d028a 1230 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1231 responses:
1232 '204':
c1843150 1233 description: successful operation
6441981b
RK
1234 '/videos/{id}/watching':
1235 put:
b029d58a 1236 summary: Set watching progress of a video
6441981b
RK
1237 tags:
1238 - Video
1239 security:
1240 - OAuth2: []
1241 parameters:
cb9d028a 1242 - $ref: '#/components/parameters/idOrUUID'
6441981b
RK
1243 requestBody:
1244 content:
1245 application/json:
1246 schema:
1247 $ref: '#/components/schemas/UserWatchingVideo'
1248 required: true
1249 responses:
1250 '204':
c1843150 1251 description: successful operation
c360c494 1252 /videos/upload:
1569a818 1253 post:
b029d58a 1254 summary: Upload a video
94ff4c23 1255 security:
3e9e6f2f 1256 - OAuth2: []
1569a818
DG
1257 tags:
1258 - Video
1569a818
DG
1259 responses:
1260 '200':
1261 description: successful operation
3e9e6f2f
RK
1262 content:
1263 application/json:
1264 schema:
1265 $ref: '#/components/schemas/VideoUploadResponse'
06bcfbd9 1266 '403':
84f6e32c 1267 description: user video quota is exceeded with this video
06bcfbd9 1268 '408':
84f6e32c 1269 description: upload has timed out
06bcfbd9 1270 '422':
84f6e32c 1271 description: invalid input file
3e9e6f2f
RK
1272 requestBody:
1273 content:
1274 multipart/form-data:
1275 schema:
1276 type: object
1277 properties:
1278 videofile:
1279 description: Video file
1280 type: string
1281 format: binary
1282 channelId:
1283 description: Channel id that will contain this video
06746a8b 1284 type: integer
3e9e6f2f
RK
1285 thumbnailfile:
1286 description: Video thumbnail file
1287 type: string
0ad45af7 1288 format: binary
3e9e6f2f
RK
1289 previewfile:
1290 description: Video preview file
1291 type: string
0ad45af7 1292 format: binary
8f9e8be1 1293 privacy:
ee89e8fd 1294 $ref: '#/components/schemas/VideoPrivacySet'
3e9e6f2f
RK
1295 category:
1296 description: Video category
84f6e32c
RK
1297 type: integer
1298 example: 4
3e9e6f2f
RK
1299 licence:
1300 description: Video licence
1301 type: string
1302 language:
1303 description: Video language
84f6e32c
RK
1304 type: integer
1305 example: 2
3e9e6f2f
RK
1306 description:
1307 description: Video description
1308 type: string
1309 waitTranscoding:
1310 description: Whether or not we wait transcoding before publish the video
cd372e84 1311 type: boolean
3e9e6f2f 1312 support:
00494d6e
RK
1313 description: A text tell the audience how to support the video creator
1314 example: Please support my work on <insert crowdfunding plateform>! <3
3e9e6f2f
RK
1315 type: string
1316 nsfw:
1317 description: Whether or not this video contains sensitive content
84f6e32c 1318 type: boolean
3e9e6f2f
RK
1319 name:
1320 description: Video name
1321 type: string
1322 tags:
07d02f6d 1323 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1fd12c7c 1324 type: array
07d02f6d
FS
1325 minItems: 1
1326 maxItems: 5
06746a8b 1327 uniqueItems: true
1fd12c7c
C
1328 items:
1329 type: string
07d02f6d
FS
1330 minLength: 2
1331 maxLength: 30
3e9e6f2f
RK
1332 commentsEnabled:
1333 description: Enable or disable comments for this video
84f6e32c 1334 type: boolean
cd372e84
A
1335 downloadEnabled:
1336 description: Enable or disable downloading for this video
1337 type: boolean
f9f89092
FS
1338 originallyPublishedAt:
1339 description: Date when the content was originally published
1340 type: string
1341 format: date-time
5dce26d2
C
1342 scheduleUpdate:
1343 $ref: '#/components/schemas/VideoScheduledUpdate'
3e9e6f2f
RK
1344 required:
1345 - videofile
1346 - channelId
8f9e8be1 1347 - name
0ad45af7
FS
1348 encoding:
1349 videofile:
1350 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
1351 thumbnailfile:
1352 contentType: image/jpeg
1353 previewfile:
1354 contentType: image/jpeg
8f9e8be1
RK
1355 x-code-samples:
1356 - lang: Shell
1357 source: |
0579dee3 1358 ## DEPENDENCIES: jq
8f9e8be1
RK
1359 USERNAME="<your_username>"
1360 PASSWORD="<your_password>"
1361 FILE_PATH="<your_file_path>"
1362 CHANNEL_ID="<your_channel_id>"
8f9e8be1
RK
1363 NAME="<video_name>"
1364
1365 API_PATH="https://peertube2.cpy.re/api/v1"
1366 ## AUTH
0579dee3
JK
1367 client_id=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1368 client_secret=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1369 token=$(curl -s "$API_PATH/users/token" \
1370 --data client_id="$client_id" \
1371 --data client_secret="$client_secret" \
1372 --data grant_type=password \
1373 --data response_type=code \
1374 --data username="$USERNAME" \
1375 --data password="$PASSWORD" \
8f9e8be1
RK
1376 | jq -r ".access_token")
1377 ## VIDEO UPLOAD
0579dee3
JK
1378 curl -s "$API_PATH/videos/upload" \
1379 -H "Authorization: Bearer $token" \
1380 --max-time 600 \
1381 --form videofile=@"$FILE_PATH" \
1382 --form channelId=$CHANNEL_ID \
1383 --form name="$NAME"
28c8e63e
C
1384 /videos/imports:
1385 post:
b029d58a
C
1386 summary: Import a video
1387 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
28c8e63e
C
1388 security:
1389 - OAuth2: []
1390 tags:
1391 - Video
28c8e63e
C
1392 requestBody:
1393 content:
1394 multipart/form-data:
1395 schema:
1396 type: object
1397 properties:
1398 torrentfile:
1399 description: Torrent File
1400 type: string
1401 format: binary
1402 targetUrl:
1403 description: HTTP target URL
1404 type: string
1405 magnetUri:
1406 description: Magnet URI
1407 type: string
1408 channelId:
1409 description: Channel id that will contain this video
06746a8b 1410 type: integer
28c8e63e
C
1411 thumbnailfile:
1412 description: Video thumbnail file
1413 type: string
0ad45af7 1414 format: binary
28c8e63e
C
1415 previewfile:
1416 description: Video preview file
1417 type: string
0ad45af7 1418 format: binary
28c8e63e 1419 privacy:
ee89e8fd 1420 $ref: '#/components/schemas/VideoPrivacySet'
28c8e63e
C
1421 category:
1422 description: Video category
1423 type: string
1424 licence:
1425 description: Video licence
1426 type: string
1427 language:
1428 description: Video language
1429 type: string
1430 description:
1431 description: Video description
1432 type: string
1433 waitTranscoding:
1434 description: Whether or not we wait transcoding before publish the video
cd372e84 1435 type: boolean
28c8e63e 1436 support:
00494d6e
RK
1437 description: A text tell the audience how to support the video creator
1438 example: Please support my work on <insert crowdfunding plateform>! <3
28c8e63e
C
1439 type: string
1440 nsfw:
1441 description: Whether or not this video contains sensitive content
cd372e84 1442 type: boolean
28c8e63e
C
1443 name:
1444 description: Video name
1445 type: string
1446 tags:
07d02f6d 1447 description: Video tags (maximum 5 tags each between 2 and 30 characters)
28c8e63e 1448 type: array
07d02f6d
FS
1449 minItems: 1
1450 maxItems: 5
28c8e63e
C
1451 items:
1452 type: string
07d02f6d
FS
1453 minLength: 2
1454 maxLength: 30
28c8e63e
C
1455 commentsEnabled:
1456 description: Enable or disable comments for this video
cd372e84
A
1457 type: boolean
1458 downloadEnabled:
1459 description: Enable or disable downloading for this video
1460 type: boolean
5dce26d2
C
1461 scheduleUpdate:
1462 $ref: '#/components/schemas/VideoScheduledUpdate'
28c8e63e
C
1463 required:
1464 - channelId
1465 - name
0ad45af7
FS
1466 encoding:
1467 torrentfile:
1468 contentType: application/x-bittorrent
1469 thumbnailfile:
1470 contentType: image/jpeg
1471 previewfile:
1472 contentType: image/jpeg
06746a8b
RK
1473 responses:
1474 '200':
1475 description: successful operation
1476 content:
1477 application/json:
1478 schema:
1479 $ref: '#/components/schemas/VideoUploadResponse'
1480 '409':
1481 description: HTTP or Torrent/magnetURI import not enabled
1482 '400':
1483 description: '`magnetUri` or `targetUrl` or a torrent file missing'
668b7f09 1484
4e239e35
C
1485 /videos/live:
1486 post:
1487 summary: Create a live
1488 security:
1489 - OAuth2: []
1490 tags:
1491 - Live Videos
1492 - Video
1493 responses:
1494 '200':
1495 description: successful operation
1496 content:
1497 application/json:
1498 schema:
1499 $ref: '#/components/schemas/VideoUploadResponse'
1500 '403':
1501 description: Live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded
1502 requestBody:
1503 content:
1504 multipart/form-data:
1505 schema:
1506 type: object
1507 properties:
1508 channelId:
1509 description: Channel id that will contain this live video
1510 type: integer
1511 saveReplay:
1512 type: boolean
1513 thumbnailfile:
1514 description: Live video/replay thumbnail file
1515 type: string
1516 format: binary
1517 previewfile:
1518 description: Live video/replay preview file
1519 type: string
1520 format: binary
1521 privacy:
1522 $ref: '#/components/schemas/VideoPrivacySet'
1523 category:
1524 description: Live video/replay category
1525 type: string
1526 licence:
1527 description: Live video/replay licence
1528 type: string
1529 language:
1530 description: Live video/replay language
1531 type: string
1532 description:
1533 description: Live video/replay description
1534 type: string
1535 support:
1536 description: A text tell the audience how to support the creator
1537 example: Please support my work on <insert crowdfunding plateform>! <3
1538 type: string
1539 nsfw:
1540 description: Whether or not this live video/replay contains sensitive content
1541 type: boolean
1542 name:
1543 description: Live video/replay name
1544 type: string
1545 tags:
1546 description: Live video/replay tags (maximum 5 tags each between 2 and 30 characters)
1547 type: array
1548 minItems: 1
1549 maxItems: 5
1550 items:
1551 type: string
1552 minLength: 2
1553 maxLength: 30
1554 commentsEnabled:
1555 description: Enable or disable comments for this live video/replay
1556 type: boolean
1557 downloadEnabled:
1558 description: Enable or disable downloading for the replay of this live
1559 type: boolean
1560 required:
1561 - channelId
1562 - name
1563 encoding:
1564 thumbnailfile:
1565 contentType: image/jpeg
1566 previewfile:
1567 contentType: image/jpeg
1568
1569 /videos/live/{id}:
1570 get:
1571 summary: Get a live information
1572 security:
1573 - OAuth2: []
1574 tags:
1575 - Live Videos
1576 - Video
1577 parameters:
1578 - $ref: '#/components/parameters/idOrUUID'
1579 responses:
1580 '200':
1581 description: successful operation
1582 content:
1583 application/json:
1584 schema:
1585 $ref: '#/components/schemas/LiveVideoResponse'
1586 put:
1587 summary: Update a live information
1588 security:
1589 - OAuth2: []
1590 tags:
1591 - Live Videos
1592 - Video
1593 parameters:
1594 - $ref: '#/components/parameters/idOrUUID'
1595 requestBody:
1596 content:
1597 application/json:
1598 schema:
1599 $ref: '#/components/schemas/LiveVideoUpdate'
1600 responses:
1601 '204':
1602 description: Successful operation
1603 '400':
1604 description: Bad parameters or trying to update a live that has already started
1605 '403':
1606 description: Trying to save replay of the live but saving replay is not enabled on the instance
1607
668b7f09
C
1608 /users/me/abuses:
1609 get:
1610 summary: List my abuses
1611 security:
1612 - OAuth2: []
1613 tags:
1614 - Abuses
1615 - My User
1616 parameters:
1617 - name: id
1618 in: query
1619 description: only list the report with this id
1620 schema:
1621 type: integer
1622 - name: state
1623 in: query
1624 schema:
1625 $ref: '#/components/schemas/AbuseStateSet'
1626 - $ref: '#/components/parameters/start'
1627 - $ref: '#/components/parameters/count'
1628 - $ref: '#/components/parameters/abusesSort'
1629 responses:
1630 '200':
1631 description: successful operation
1632 content:
1633 application/json:
1634 schema:
1635 type: array
1636 items:
1637 $ref: '#/components/schemas/Abuse'
1638
e3489df9 1639 /abuses:
1569a818 1640 get:
310b5219 1641 summary: List abuses
94ff4c23 1642 security:
b029d58a 1643 - OAuth2:
06746a8b
RK
1644 - admin
1645 - moderator
1569a818 1646 tags:
310b5219 1647 - Abuses
44cb3b85 1648 parameters:
84f6e32c
RK
1649 - name: id
1650 in: query
1651 description: only list the report with this id
1652 schema:
1653 type: integer
1654 - name: predefinedReason
1655 in: query
1656 description: predefined reason the listed reports should contain
1657 schema:
e3489df9 1658 $ref: '#/components/schemas/PredefinedAbuseReasons'
84f6e32c
RK
1659 - name: search
1660 in: query
1661 description: plain search that will match with video titles, reporter names and more
1662 schema:
1663 type: string
1664 - name: state
1665 in: query
84f6e32c 1666 schema:
668b7f09 1667 $ref: '#/components/schemas/AbuseStateSet'
84f6e32c
RK
1668 - name: searchReporter
1669 in: query
1670 description: only list reports of a specific reporter
1671 schema:
1672 type: string
1673 - name: searchReportee
1674 description: only list reports of a specific reportee
1675 in: query
1676 schema:
1677 type: string
1678 - name: searchVideo
1679 in: query
1680 description: only list reports of a specific video
1681 schema:
1682 type: string
1683 - name: searchVideoChannel
1684 in: query
1685 description: only list reports of a specific video channel
1686 schema:
1687 type: string
17b07dc5
C
1688 - name: videoIs
1689 in: query
1690 description: only list blacklisted or deleted videos
1691 schema:
1692 type: string
1693 enum:
1694 - 'deleted'
1695 - 'blacklisted'
1696 - name: filter
1697 in: query
1698 description: only list account, comment or video reports
1699 schema:
1700 type: string
1701 enum:
1702 - 'video'
1703 - 'comment'
1704 - 'account'
3e9e6f2f
RK
1705 - $ref: '#/components/parameters/start'
1706 - $ref: '#/components/parameters/count'
fd5af7a2 1707 - $ref: '#/components/parameters/abusesSort'
1569a818
DG
1708 responses:
1709 '200':
1710 description: successful operation
3e9e6f2f
RK
1711 content:
1712 application/json:
1713 schema:
1714 type: array
1715 items:
668b7f09 1716 $ref: '#/components/schemas/Abuse'
e3489df9 1717
1569a818 1718 post:
b029d58a 1719 summary: Report an abuse
94ff4c23 1720 security:
3e9e6f2f 1721 - OAuth2: []
1569a818 1722 tags:
310b5219 1723 - Abuses
50e16ccf 1724 requestBody:
1ebddadd 1725 required: true
50e16ccf
C
1726 content:
1727 application/json:
1728 schema:
1729 type: object
1730 properties:
1731 reason:
1732 description: Reason why the user reports this video
1733 type: string
84f6e32c 1734 minLength: 4
1ebddadd 1735 predefinedReasons:
e3489df9
C
1736 $ref: '#/components/schemas/PredefinedAbuseReasons'
1737
1738 video:
1739 type: object
1740 properties:
1741 id:
1742 description: Video id to report
1743 type: number
1744 startAt:
1745 type: integer
1746 description: Timestamp in the video that marks the beginning of the report
1747 minimum: 0
1748 endAt:
1749 type: integer
1750 description: Timestamp in the video that marks the ending of the report
1751 minimum: 0
1752 comment:
1753 type: object
1754 properties:
1755 id:
1756 description: Comment id to report
1757 type: number
1758 account:
1759 type: object
1760 properties:
1761 id:
1762 description: Account id to report
1763 type: number
1ebddadd
RK
1764 required:
1765 - reason
50e16ccf
C
1766 responses:
1767 '204':
1768 description: successful operation
84f6e32c
RK
1769 '400':
1770 description: incorrect request parameters
e3489df9 1771 '/abuses/{abuseId}':
50e16ccf
C
1772 put:
1773 summary: Update an abuse
1774 security:
1775 - OAuth2:
1776 - admin
1777 - moderator
1778 tags:
310b5219 1779 - Abuses
50e16ccf 1780 parameters:
50e16ccf
C
1781 - $ref: '#/components/parameters/abuseId'
1782 requestBody:
1783 content:
1784 application/json:
1785 schema:
1786 type: object
1787 properties:
1788 state:
4f32032f 1789 $ref: '#/components/schemas/AbuseStateSet'
50e16ccf
C
1790 moderationComment:
1791 type: string
84f6e32c
RK
1792 description: Update the report comment visible only to the moderation team
1793 responses:
1794 '204':
1795 description: successful operation
1796 '404':
310b5219 1797 description: abuse not found
50e16ccf 1798 delete:
84f6e32c 1799 tags:
310b5219 1800 - Abuses
50e16ccf
C
1801 summary: Delete an abuse
1802 security:
1803 - OAuth2:
1804 - admin
1805 - moderator
84f6e32c 1806 parameters:
84f6e32c 1807 - $ref: '#/components/parameters/abuseId'
50e16ccf
C
1808 responses:
1809 '204':
1810 description: successful operation
06746a8b
RK
1811 '404':
1812 description: block not found
668b7f09
C
1813 '/abuses/{abuseId}/messages':
1814 get:
1815 summary: List messages of an abuse
1816 security:
1817 - OAuth2: []
1818 tags:
1819 - Abuses
1820 parameters:
1821 - $ref: '#/components/parameters/abuseId'
1822 responses:
1823 '200':
1824 description: successful operation
1825 content:
1826 application/json:
1827 schema:
1828 type: array
1829 items:
1830 $ref: '#/components/schemas/AbuseMessage'
1831
1832 post:
1833 summary: Add message to an abuse
1834 security:
1835 - OAuth2: []
1836 tags:
1837 - Abuses
fcc4466e
C
1838 parameters:
1839 - $ref: '#/components/parameters/abuseId'
668b7f09
C
1840 requestBody:
1841 required: true
1842 content:
1843 application/json:
1844 schema:
1845 type: object
1846 properties:
1847 message:
1848 description: Message to send
1849 type: string
1850 required:
1851 - message
1852 responses:
1853 '200':
1854 description: successful operation
1855 '400':
1856 description: incorrect request parameters
1857 '/abuses/{abuseId}/messages/{abuseMessageId}':
1858 delete:
1859 summary: Delete an abuse message
1860 security:
1861 - OAuth2: []
1862 tags:
1863 - Abuses
1864 parameters:
1865 - $ref: '#/components/parameters/abuseId'
1866 - $ref: '#/components/parameters/abuseMessageId'
1867 responses:
1868 '204':
1869 description: successful operation
50e16ccf 1870
3e9e6f2f 1871 '/videos/{id}/blacklist':
1569a818 1872 post:
06746a8b 1873 summary: Block a video
94ff4c23 1874 security:
3e9e6f2f
RK
1875 - OAuth2:
1876 - admin
1877 - moderator
1569a818 1878 tags:
06746a8b 1879 - Video Blocks
1569a818 1880 parameters:
cb9d028a 1881 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1882 responses:
1883 '204':
c1843150 1884 description: successful operation
1569a818 1885 delete:
06746a8b 1886 summary: Unblock a video by its id
94ff4c23 1887 security:
3e9e6f2f
RK
1888 - OAuth2:
1889 - admin
1890 - moderator
1569a818 1891 tags:
06746a8b 1892 - Video Blocks
1569a818 1893 parameters:
cb9d028a 1894 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1895 responses:
1896 '204':
c1843150 1897 description: successful operation
06746a8b
RK
1898 '404':
1899 description: block not found
c360c494 1900 /videos/blacklist:
1569a818 1901 get:
06746a8b
RK
1902 tags:
1903 - Video Blocks
f4d59981 1904 summary: List video blocks
94ff4c23 1905 security:
3e9e6f2f
RK
1906 - OAuth2:
1907 - admin
1908 - moderator
44cb3b85 1909 parameters:
84f6e32c
RK
1910 - name: type
1911 in: query
1912 description: >
1913 list only blocks that match this type:
1914
1915 - `1`: manual block
1916
1917 - `2`: automatic block that needs review
1918 schema:
1919 type: integer
1920 enum:
1921 - 1
1922 - 2
1923 - name: search
1924 in: query
1925 description: plain search that will match with video titles, and more
1926 schema:
1927 type: string
3e9e6f2f
RK
1928 - $ref: '#/components/parameters/start'
1929 - $ref: '#/components/parameters/count'
fd5af7a2 1930 - $ref: '#/components/parameters/blacklistsSort'
1569a818
DG
1931 responses:
1932 '200':
1933 description: successful operation
3e9e6f2f
RK
1934 content:
1935 application/json:
1936 schema:
84f6e32c
RK
1937 type: object
1938 properties:
1939 total:
1940 type: integer
1941 example: 1
1942 data:
1943 type: array
1944 items:
1945 $ref: '#/components/schemas/VideoBlacklist'
67ae04a5
C
1946 /videos/{id}/captions:
1947 get:
b029d58a 1948 summary: List captions of a video
67ae04a5 1949 tags:
04b703f6 1950 - Video Captions
67ae04a5 1951 parameters:
cb9d028a 1952 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
1953 responses:
1954 '200':
1955 description: successful operation
1956 content:
1957 application/json:
1958 schema:
1959 type: object
1960 properties:
1961 total:
1962 type: integer
84f6e32c 1963 example: 1
67ae04a5
C
1964 data:
1965 type: array
1966 items:
1967 $ref: '#/components/schemas/VideoCaption'
1968 /videos/{id}/captions/{captionLanguage}:
1969 put:
1970 summary: Add or replace a video caption
1971 tags:
04b703f6 1972 - Video Captions
67ae04a5 1973 parameters:
cb9d028a 1974 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
1975 - $ref: '#/components/parameters/captionLanguage'
1976 requestBody:
1977 content:
1978 multipart/form-data:
1979 schema:
1980 type: object
1981 properties:
1982 captionfile:
1983 description: The file to upload.
1984 type: string
1985 format: binary
0ad45af7
FS
1986 encoding:
1987 captionfile:
205ed5b7 1988 contentType: text/vtt, application/x-subrip, text/plain
67ae04a5
C
1989 responses:
1990 '204':
c1843150 1991 description: successful operation
06746a8b
RK
1992 '404':
1993 description: video or language not found
67ae04a5
C
1994 delete:
1995 summary: Delete a video caption
1996 tags:
04b703f6 1997 - Video Captions
67ae04a5 1998 parameters:
cb9d028a 1999 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
2000 - $ref: '#/components/parameters/captionLanguage'
2001 responses:
2002 '204':
c1843150 2003 description: successful operation
06746a8b
RK
2004 '404':
2005 description: video or language or caption for that language not found
48dce1c9 2006 /video-channels:
1569a818 2007 get:
b029d58a 2008 summary: List video channels
1569a818 2009 tags:
b029d58a 2010 - Video Channels
44cb3b85 2011 parameters:
3e9e6f2f
RK
2012 - $ref: '#/components/parameters/start'
2013 - $ref: '#/components/parameters/count'
2014 - $ref: '#/components/parameters/sort'
1569a818
DG
2015 responses:
2016 '200':
2017 description: successful operation
3e9e6f2f
RK
2018 content:
2019 application/json:
2020 schema:
84f6e32c
RK
2021 type: object
2022 properties:
2023 total:
2024 type: integer
2025 example: 1
2026 data:
2027 type: array
2028 items:
2029 $ref: '#/components/schemas/VideoChannel'
1569a818 2030 post:
b029d58a 2031 summary: Create a video channel
94ff4c23 2032 security:
3e9e6f2f 2033 - OAuth2: []
1569a818 2034 tags:
b029d58a 2035 - Video Channels
1569a818
DG
2036 responses:
2037 '204':
c1843150 2038 description: successful operation
3e9e6f2f 2039 requestBody:
7d14d4d2
C
2040 content:
2041 application/json:
2042 schema:
2043 $ref: '#/components/schemas/VideoChannelCreate'
9ce3d302 2044 '/video-channels/{channelHandle}':
1569a818 2045 get:
b029d58a 2046 summary: Get a video channel
1569a818 2047 tags:
b029d58a 2048 - Video Channels
1569a818 2049 parameters:
9ce3d302 2050 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
2051 responses:
2052 '200':
2053 description: successful operation
3e9e6f2f
RK
2054 content:
2055 application/json:
2056 schema:
2057 $ref: '#/components/schemas/VideoChannel'
1569a818 2058 put:
b029d58a 2059 summary: Update a video channel
94ff4c23 2060 security:
3e9e6f2f 2061 - OAuth2: []
1569a818 2062 tags:
b029d58a 2063 - Video Channels
1569a818 2064 parameters:
9ce3d302 2065 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
2066 responses:
2067 '204':
c1843150 2068 description: successful operation
3e9e6f2f 2069 requestBody:
7d14d4d2
C
2070 content:
2071 application/json:
2072 schema:
2073 $ref: '#/components/schemas/VideoChannelUpdate'
1569a818 2074 delete:
b029d58a 2075 summary: Delete a video channel
94ff4c23 2076 security:
3e9e6f2f 2077 - OAuth2: []
1569a818 2078 tags:
b029d58a 2079 - Video Channels
1569a818 2080 parameters:
9ce3d302 2081 - $ref: '#/components/parameters/channelHandle'
cc918ac3
C
2082 responses:
2083 '204':
c1843150 2084 description: successful operation
9ce3d302 2085 '/video-channels/{channelHandle}/videos':
cc918ac3 2086 get:
b029d58a 2087 summary: List videos of a video channel
cc918ac3 2088 tags:
048b6946 2089 - Video
b029d58a 2090 - Video Channels
cc918ac3 2091 parameters:
9ce3d302 2092 - $ref: '#/components/parameters/channelHandle'
59c794a5
C
2093 - $ref: '#/components/parameters/categoryOneOf'
2094 - $ref: '#/components/parameters/tagsOneOf'
2095 - $ref: '#/components/parameters/tagsAllOf'
2096 - $ref: '#/components/parameters/licenceOneOf'
2097 - $ref: '#/components/parameters/languageOneOf'
2098 - $ref: '#/components/parameters/nsfw'
2099 - $ref: '#/components/parameters/filter'
2100 - $ref: '#/components/parameters/skipCount'
2101 - $ref: '#/components/parameters/start'
2102 - $ref: '#/components/parameters/count'
2103 - $ref: '#/components/parameters/videosSort'
1569a818 2104 responses:
cc918ac3 2105 '200':
1569a818 2106 description: successful operation
3e9e6f2f
RK
2107 content:
2108 application/json:
2109 schema:
048b6946 2110 $ref: '#/components/schemas/VideoListResponse'
c1843150
C
2111
2112 /video-playlists/privacies:
2113 get:
2114 summary: List available playlist privacies
2115 tags:
2116 - Video Playlists
2117 responses:
2118 '200':
2119 description: successful operation
2120 content:
2121 application/json:
2122 schema:
2123 type: array
2124 items:
2125 type: string
84f6e32c
RK
2126 examples:
2127 nightly:
2128 externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies
c1843150 2129
71810d0b
RK
2130 /video-playlists:
2131 get:
b029d58a 2132 summary: List video playlists
71810d0b 2133 tags:
b029d58a 2134 - Video Playlists
71810d0b
RK
2135 parameters:
2136 - $ref: '#/components/parameters/start'
2137 - $ref: '#/components/parameters/count'
2138 - $ref: '#/components/parameters/sort'
2139 responses:
2140 '200':
2141 description: successful operation
2142 content:
2143 application/json:
2144 schema:
84f6e32c
RK
2145 type: object
2146 properties:
2147 total:
2148 type: integer
2149 example: 1
2150 data:
2151 type: array
2152 items:
2153 $ref: '#/components/schemas/VideoPlaylist'
c1843150
C
2154 post:
2155 summary: Create a video playlist
2156 description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
2157 security:
2158 - OAuth2: []
2159 tags:
2160 - Video Playlists
2161 responses:
2162 '200':
2163 description: successful operation
2164 content:
2165 application/json:
2166 schema:
2167 type: object
2168 properties:
2169 videoPlaylist:
2170 type: object
2171 properties:
2172 id:
06746a8b 2173 type: integer
c1843150
C
2174 uuid:
2175 type: string
2176 requestBody:
2177 content:
2178 multipart/form-data:
2179 schema:
2180 type: object
2181 properties:
2182 displayName:
2183 description: Video playlist display name
2184 type: string
2185 thumbnailfile:
2186 description: Video playlist thumbnail file
2187 type: string
2188 format: binary
2189 privacy:
2190 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2191 description:
2192 description: Video playlist description
2193 type: string
2194 videoChannelId:
2195 description: Video channel in which the playlist will be published
06746a8b 2196 type: integer
c1843150
C
2197 required:
2198 - displayName
2c318664
RK
2199 encoding:
2200 thumbnailfile:
2201 contentType: image/jpeg
c1843150
C
2202
2203 /video-playlists/{id}:
2204 get:
2205 summary: Get a video playlist
2206 tags:
2207 - Video Playlists
2208 parameters:
2209 - $ref: '#/components/parameters/idOrUUID'
2210 responses:
2211 '200':
2212 description: successful operation
2213 content:
2214 application/json:
2215 schema:
2216 $ref: '#/components/schemas/VideoPlaylist'
2217 put:
2218 summary: Update a video playlist
2219 description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
2220 security:
2221 - OAuth2: []
2222 tags:
2223 - Video Playlists
2224 responses:
2225 '204':
2226 description: successful operation
2227 parameters:
2228 - $ref: '#/components/parameters/idOrUUID'
2229 requestBody:
2230 content:
2231 multipart/form-data:
2232 schema:
2233 type: object
2234 properties:
2235 displayName:
2236 description: Video playlist display name
2237 type: string
2238 thumbnailfile:
2239 description: Video playlist thumbnail file
2240 type: string
2241 format: binary
2242 privacy:
2243 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2244 description:
2245 description: Video playlist description
2246 type: string
2247 videoChannelId:
2248 description: Video channel in which the playlist will be published
06746a8b 2249 type: integer
2c318664
RK
2250 encoding:
2251 thumbnailfile:
2252 contentType: image/jpeg
c1843150
C
2253 delete:
2254 summary: Delete a video playlist
2255 security:
2256 - OAuth2: []
2257 tags:
2258 - Video Playlists
2259 parameters:
2260 - $ref: '#/components/parameters/idOrUUID'
2261 responses:
2262 '204':
2263 description: successful operation
2264
2265 /video-playlists/{id}/videos:
2266 get:
2267 summary: 'List videos of a playlist'
2268 tags:
2269 - Videos
2270 - Video Playlists
2271 parameters:
2272 - $ref: '#/components/parameters/idOrUUID'
2273 responses:
2274 '200':
2275 description: successful operation
2276 content:
2277 application/json:
2278 schema:
2279 $ref: '#/components/schemas/VideoListResponse'
2280 post:
2281 summary: 'Add a video in a playlist'
2282 security:
2283 - OAuth2: []
2284 tags:
2285 - Videos
2286 - Video Playlists
2287 parameters:
2288 - $ref: '#/components/parameters/idOrUUID'
2289 responses:
2290 '200':
2291 description: successful operation
2292 content:
2293 application/json:
2294 schema:
2295 type: object
2296 properties:
2297 videoPlaylistElement:
2298 type: object
2299 properties:
2300 id:
06746a8b 2301 type: integer
c1843150
C
2302 requestBody:
2303 content:
2304 application/json:
2305 schema:
2306 type: object
2307 properties:
2308 videoId:
06746a8b 2309 type: integer
c1843150
C
2310 description: 'Video to add in the playlist'
2311 startTimestamp:
06746a8b 2312 type: integer
c1843150
C
2313 description: 'Start the video at this specific timestamp (in seconds)'
2314 stopTimestamp:
06746a8b 2315 type: integer
c1843150
C
2316 description: 'Stop the video at this specific timestamp (in seconds)'
2317 required:
2318 - videoId
2319
2320 /video-playlists/{id}/videos/reorder:
2321 post:
2322 summary: 'Reorder a playlist'
2323 security:
2324 - OAuth2: []
2325 tags:
2326 - Video Playlists
2327 parameters:
2328 - $ref: '#/components/parameters/idOrUUID'
2329 responses:
2330 '204':
2331 description: successful operation
2332 requestBody:
2333 content:
2334 application/json:
2335 schema:
2336 type: object
2337 properties:
2338 startPosition:
06746a8b
RK
2339 type: integer
2340 description: 'Start position of the element to reorder'
2341 minimum: 1
c1843150 2342 insertAfterPosition:
06746a8b
RK
2343 type: integer
2344 description: 'New position for the block to reorder, to add the block before the first element'
2345 minimum: 0
c1843150 2346 reorderLength:
06746a8b
RK
2347 type: integer
2348 description: 'How many element from `startPosition` to reorder'
2349 minimum: 1
c1843150
C
2350 required:
2351 - startPosition
2352 - insertAfterPosition
2353
b9e924a8 2354 /video-playlists/{id}/videos/{playlistElementId}:
c1843150
C
2355 put:
2356 summary: 'Update a playlist element'
2357 security:
2358 - OAuth2: []
2359 tags:
2360 - Video Playlists
2361 parameters:
2362 - $ref: '#/components/parameters/idOrUUID'
2363 - $ref: '#/components/parameters/playlistElementId'
2364 responses:
2365 '204':
2366 description: successful operation
2367 requestBody:
2368 content:
2369 application/json:
2370 schema:
2371 type: object
2372 properties:
2373 startTimestamp:
06746a8b 2374 type: integer
c1843150
C
2375 description: 'Start the video at this specific timestamp (in seconds)'
2376 stopTimestamp:
06746a8b 2377 type: integer
c1843150
C
2378 description: 'Stop the video at this specific timestamp (in seconds)'
2379 delete:
2380 summary: 'Delete an element from a playlist'
2381 security:
2382 - OAuth2: []
2383 tags:
2384 - Video Playlists
2385 parameters:
2386 - $ref: '#/components/parameters/idOrUUID'
2387 - $ref: '#/components/parameters/playlistElementId'
2388 responses:
2389 '204':
2390 description: successful operation
2391
0590bb46
C
2392 '/users/me/video-playlists/videos-exist':
2393 get:
2394 summary: 'Check video exists in my playlists'
2395 security:
2396 - OAuth2: []
2397 tags:
2398 - Video Playlists
2399 parameters:
2400 - name: videoIds
2401 in: query
2402 required: true
2403 description: The video ids to check
2404 schema:
2405 type: array
2406 items:
06746a8b 2407 type: integer
0590bb46
C
2408 responses:
2409 '200':
2410 description: successful operation
2411 content:
2412 application/json:
2413 schema:
2414 type: object
2415 properties:
2416 videoId:
2417 type: array
2418 items:
2419 type: object
2420 properties:
2421 playlistElementId:
06746a8b 2422 type: integer
0590bb46 2423 playlistId:
06746a8b 2424 type: integer
0590bb46 2425 startTimestamp:
06746a8b 2426 type: integer
0590bb46 2427 stopTimestamp:
06746a8b 2428 type: integer
0590bb46 2429
3e9e6f2f 2430 '/accounts/{name}/video-channels':
6b738c7a 2431 get:
b029d58a 2432 summary: List video channels of an account
6b738c7a 2433 tags:
b029d58a
C
2434 - Video Channels
2435 - Accounts
6b738c7a 2436 parameters:
3e9e6f2f 2437 - $ref: '#/components/parameters/name'
84f6e32c
RK
2438 - name: withStats
2439 in: query
2440 description: include view statistics for the last 30 days (only if authentified as the account user)
2441 schema:
2442 type: boolean
2443 - $ref: '#/components/parameters/start'
2444 - $ref: '#/components/parameters/count'
2445 - $ref: '#/components/parameters/sort'
6b738c7a
C
2446 responses:
2447 '200':
2448 description: successful operation
3e9e6f2f
RK
2449 content:
2450 application/json:
2451 schema:
2452 type: array
2453 items:
2454 $ref: '#/components/schemas/VideoChannel'
c100a614
YB
2455 '/accounts/{name}/ratings':
2456 get:
b029d58a 2457 summary: List ratings of an account
c100a614
YB
2458 security:
2459 - OAuth2: []
2460 tags:
b029d58a 2461 - Accounts
c100a614 2462 parameters:
cb9d028a 2463 - $ref: '#/components/parameters/name'
c100a614
YB
2464 - $ref: '#/components/parameters/start'
2465 - $ref: '#/components/parameters/count'
2466 - $ref: '#/components/parameters/sort'
2467 - name: rating
2468 in: query
2469 required: false
b3d1054e 2470 description: Optionally filter which ratings to retrieve
c100a614
YB
2471 schema:
2472 type: string
2473 enum:
2474 - like
2475 - dislike
2476 responses:
2477 '200':
2478 description: successful operation
2479 content:
2480 application/json:
2481 schema:
2482 type: array
2483 items:
2484 $ref: '#/components/schemas/VideoRating'
3e9e6f2f 2485 '/videos/{id}/comment-threads':
1569a818 2486 get:
b029d58a 2487 summary: List threads of a video
1569a818 2488 tags:
b029d58a 2489 - Video Comments
1569a818 2490 parameters:
cb9d028a 2491 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f
RK
2492 - $ref: '#/components/parameters/start'
2493 - $ref: '#/components/parameters/count'
71810d0b 2494 - $ref: '#/components/parameters/commentsSort'
1569a818
DG
2495 responses:
2496 '200':
2497 description: successful operation
3e9e6f2f
RK
2498 content:
2499 application/json:
2500 schema:
2501 $ref: '#/components/schemas/CommentThreadResponse'
1569a818 2502 post:
b029d58a 2503 summary: Create a thread
94ff4c23 2504 security:
3e9e6f2f 2505 - OAuth2: []
1569a818 2506 tags:
b029d58a 2507 - Video Comments
1569a818 2508 parameters:
cb9d028a 2509 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
2510 responses:
2511 '200':
2512 description: successful operation
3e9e6f2f
RK
2513 content:
2514 application/json:
2515 schema:
2516 $ref: '#/components/schemas/CommentThreadPostResponse'
2c318664
RK
2517 '404':
2518 description: video does not exist
98639806
C
2519 requestBody:
2520 content:
2521 application/json:
2522 schema:
2523 type: object
2524 properties:
2525 text:
2526 type: string
2527 description: 'Text comment'
2528 required:
2529 - text
2530
3e9e6f2f 2531 '/videos/{id}/comment-threads/{threadId}':
1569a818 2532 get:
b029d58a 2533 summary: Get a thread
1569a818 2534 tags:
b029d58a 2535 - Video Comments
1569a818 2536 parameters:
cb9d028a
C
2537 - $ref: '#/components/parameters/idOrUUID'
2538 - $ref: '#/components/parameters/threadId'
1569a818
DG
2539 responses:
2540 '200':
2541 description: successful operation
3e9e6f2f
RK
2542 content:
2543 application/json:
2544 schema:
2545 $ref: '#/components/schemas/VideoCommentThreadTree'
2546 '/videos/{id}/comments/{commentId}':
1569a818 2547 post:
b029d58a 2548 summary: Reply to a thread of a video
94ff4c23 2549 security:
3e9e6f2f 2550 - OAuth2: []
1569a818 2551 tags:
b029d58a 2552 - Video Comments
1569a818 2553 parameters:
cb9d028a 2554 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f 2555 - $ref: '#/components/parameters/commentId'
1569a818
DG
2556 responses:
2557 '200':
2558 description: successful operation
3e9e6f2f
RK
2559 content:
2560 application/json:
2561 schema:
2562 $ref: '#/components/schemas/CommentThreadPostResponse'
2c318664
RK
2563 '404':
2564 description: thread or video does not exist
98639806
C
2565 requestBody:
2566 content:
2567 application/json:
2568 schema:
2569 type: object
2570 properties:
2571 text:
2572 type: string
2573 description: 'Text comment'
2574 required:
2575 - text
2576
1569a818 2577 delete:
b029d58a 2578 summary: Delete a comment or a reply
94ff4c23 2579 security:
3e9e6f2f 2580 - OAuth2: []
1569a818 2581 tags:
b029d58a 2582 - Video Comments
1569a818 2583 parameters:
cb9d028a 2584 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f 2585 - $ref: '#/components/parameters/commentId'
1569a818
DG
2586 responses:
2587 '204':
c1843150 2588 description: successful operation
84f6e32c
RK
2589 '403':
2590 description: cannot remove comment of another user
2591 '404':
2592 description: comment or video does not exist
2593 '409':
2594 description: comment is already deleted
3e9e6f2f 2595 '/videos/{id}/rate':
1569a818 2596 put:
b029d58a 2597 summary: Like/dislike a video
94ff4c23 2598 security:
3e9e6f2f 2599 - OAuth2: []
1569a818 2600 tags:
b029d58a 2601 - Video Rates
1569a818 2602 parameters:
cb9d028a 2603 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
2604 responses:
2605 '204':
c1843150 2606 description: successful operation
2c318664
RK
2607 '404':
2608 description: video does not exist
fb72c193
DL
2609 /search/videos:
2610 get:
2611 tags:
2612 - Search
b029d58a 2613 summary: Search videos
fb72c193 2614 parameters:
84f6e32c
RK
2615 - name: search
2616 in: query
2617 required: true
2618 allowEmptyValue: false
2619 description: >
2620 String to search. If the user can make a remote URI search, and the string is an URI then the
2621 PeerTube instance will fetch the remote object and add it to its database. Then,
2622 you can use the REST API to fetch the complete video information and interact with it.
2623 schema:
2624 type: string
59c794a5
C
2625 - $ref: '#/components/parameters/categoryOneOf'
2626 - $ref: '#/components/parameters/tagsOneOf'
2627 - $ref: '#/components/parameters/tagsAllOf'
2628 - $ref: '#/components/parameters/licenceOneOf'
2629 - $ref: '#/components/parameters/languageOneOf'
2630 - $ref: '#/components/parameters/nsfw'
2631 - $ref: '#/components/parameters/filter'
2632 - $ref: '#/components/parameters/skipCount'
3e9e6f2f
RK
2633 - $ref: '#/components/parameters/start'
2634 - $ref: '#/components/parameters/count'
ad031145 2635 - $ref: '#/components/parameters/searchTarget'
fd5af7a2 2636 - $ref: '#/components/parameters/videosSearchSort'
ad031145
C
2637 - name: startDate
2638 in: query
ad031145
C
2639 description: Get videos that are published after this date
2640 schema:
2641 type: string
2642 format: date-time
2643 - name: endDate
2644 in: query
ad031145
C
2645 description: Get videos that are published before this date
2646 schema:
2647 type: string
2648 format: date-time
2649 - name: originallyPublishedStartDate
2650 in: query
ad031145 2651 description: Get videos that are originally published after this date
3e9e6f2f
RK
2652 schema:
2653 type: string
ad031145
C
2654 format: date-time
2655 - name: originallyPublishedEndDate
2656 in: query
ad031145
C
2657 description: Get videos that are originally published before this date
2658 schema:
2659 type: string
2660 format: date-time
2661 - name: durationMin
2662 in: query
ad031145
C
2663 description: Get videos that have this minimum duration
2664 schema:
06746a8b 2665 type: integer
ad031145
C
2666 - name: durationMax
2667 in: query
ad031145
C
2668 description: Get videos that have this maximum duration
2669 schema:
06746a8b 2670 type: integer
2c318664
RK
2671 callbacks:
2672 'searchTarget === search-index':
2673 $ref: '#/components/callbacks/searchIndex'
fb72c193
DL
2674 responses:
2675 '200':
2676 description: successful operation
3e9e6f2f
RK
2677 content:
2678 application/json:
2679 schema:
048b6946 2680 $ref: '#/components/schemas/VideoListResponse'
2c318664
RK
2681 '500':
2682 description: search index unavailable
ad031145
C
2683 /search/video-channels:
2684 get:
2685 tags:
2686 - Search
2687 summary: Search channels
2688 parameters:
ad031145
C
2689 - name: search
2690 in: query
2691 required: true
2692 description: >
2693 String to search. If the user can make a remote URI search, and the string is an URI then the
2694 PeerTube instance will fetch the remote object and add it to its database. Then,
2695 you can use the REST API to fetch the complete channel information and interact with it.
2696 schema:
2697 type: string
84f6e32c
RK
2698 - $ref: '#/components/parameters/start'
2699 - $ref: '#/components/parameters/count'
2700 - $ref: '#/components/parameters/searchTarget'
2701 - $ref: '#/components/parameters/sort'
2c318664
RK
2702 callbacks:
2703 'searchTarget === search-index':
2704 $ref: '#/components/callbacks/searchIndex'
ad031145
C
2705 responses:
2706 '200':
2707 description: successful operation
2708 content:
2709 application/json:
2710 schema:
2711 type: array
2712 items:
2713 $ref: '#/components/schemas/VideoChannel'
2c318664
RK
2714 '500':
2715 description: search index unavailable
06746a8b
RK
2716 /blocklist/accounts:
2717 get:
2718 tags:
2719 - Account Blocks
2720 summary: List account blocks
2721 security:
2722 - OAuth2:
2723 - admin
2724 parameters:
2725 - $ref: '#/components/parameters/start'
2726 - $ref: '#/components/parameters/count'
2727 - $ref: '#/components/parameters/sort'
2728 responses:
2729 '200':
2730 description: successful operation
2731 post:
2732 tags:
2733 - Account Blocks
2734 summary: Block an account
2735 security:
2736 - OAuth2:
2737 - admin
2738 requestBody:
2739 content:
2740 application/json:
2741 schema:
2742 type: object
2743 properties:
2744 accountName:
2745 type: string
84f6e32c 2746 example: chocobozzz@example.org
06746a8b
RK
2747 description: account to block, in the form `username@domain`
2748 required:
2749 - accountName
2750 responses:
2751 '200':
2752 description: successful operation
2753 '409':
2754 description: self-blocking forbidden
2755 '/blocklist/accounts/{accountName}':
2756 delete:
2757 tags:
2758 - Account Blocks
2759 summary: Unblock an account by its handle
2760 security:
2761 - OAuth2:
2762 - admin
2763 parameters:
2764 - name: accountName
2765 in: path
2766 required: true
2767 description: account to unblock, in the form `username@domain`
2768 schema:
2769 type: string
2770 responses:
2771 '201':
2772 description: successful operation
2773 '404':
2774 description: account or account block does not exist
2775 /blocklist/servers:
2776 get:
2777 tags:
2778 - Server Blocks
2779 summary: List server blocks
2780 security:
2781 - OAuth2:
2782 - admin
2783 parameters:
2784 - $ref: '#/components/parameters/start'
2785 - $ref: '#/components/parameters/count'
2786 - $ref: '#/components/parameters/sort'
2787 responses:
2788 '200':
2789 description: successful operation
2790 post:
2791 tags:
2792 - Server Blocks
2793 summary: Block a server
2794 security:
2795 - OAuth2:
2796 - admin
2797 requestBody:
2798 content:
2799 application/json:
2800 schema:
2801 type: object
2802 properties:
84f6e32c 2803 host:
06746a8b 2804 type: string
84f6e32c 2805 format: hostname
06746a8b
RK
2806 description: server domain to block
2807 required:
84f6e32c 2808 - host
06746a8b
RK
2809 responses:
2810 '200':
2811 description: successful operation
2812 '409':
2813 description: self-blocking forbidden
2814 '/blocklist/servers/{host}':
2815 delete:
2816 tags:
2817 - Server Blocks
2818 summary: Unblock a server by its domain
2819 security:
2820 - OAuth2:
2821 - admin
2822 parameters:
2823 - name: host
2824 in: path
2825 required: true
2826 description: server domain to unblock
2827 schema:
2828 type: string
84f6e32c 2829 format: hostname
06746a8b
RK
2830 responses:
2831 '201':
2832 description: successful operation
2833 '404':
2834 description: account block does not exist
04b703f6
RK
2835 /redundancy/{host}:
2836 put:
2837 tags:
2838 - Instance Redundancy
2839 summary: Update a server redundancy policy
2840 security:
2841 - OAuth2:
2842 - admin
2843 parameters:
2844 - name: host
2845 in: path
2846 required: true
2847 description: server domain to mirror
2848 schema:
2849 type: string
84f6e32c 2850 format: hostname
04b703f6
RK
2851 requestBody:
2852 content:
2853 application/json:
2854 schema:
2855 type: object
2856 properties:
2857 redundancyAllowed:
2858 type: boolean
2859 description: allow mirroring of the host's local videos
2860 required:
2861 - redundancyAllowed
2862 responses:
2863 '204':
2864 description: successful operation
2865 '404':
2866 description: server is not already known
2867 /redundancy/videos:
2868 get:
2869 tags:
2870 - Video Mirroring
2871 summary: List videos being mirrored
2872 security:
2873 - OAuth2:
2874 - admin
2875 parameters:
2876 - name: target
2877 in: query
2878 required: true
2879 description: direction of the mirror
2880 schema:
2881 type: string
2882 enum:
2883 - my-videos
2884 - remote-videos
2885 - $ref: '#/components/parameters/start'
2886 - $ref: '#/components/parameters/count'
2887 - $ref: '#/components/parameters/videoRedundanciesSort'
2888 responses:
2889 '200':
2890 description: successful operation
2891 content:
2892 application/json:
2893 schema:
2894 type: array
2895 items:
2896 $ref: '#/components/schemas/VideoRedundancy'
2897 post:
2898 tags:
2899 - Video Mirroring
2900 summary: Mirror a video
2901 security:
2902 - OAuth2:
2903 - admin
2904 requestBody:
2905 content:
2906 application/json:
2907 schema:
2908 type: object
2909 properties:
2910 videoId:
84f6e32c 2911 type: integer
04b703f6
RK
2912 required:
2913 - videoId
2914 responses:
2915 '204':
2916 description: successful operation
2917 '400':
2918 description: cannot mirror a local video
2919 '404':
2920 description: video does not exist
2921 '409':
2922 description: video is already mirrored
2923 /redundancy/videos/{redundancyId}:
2924 delete:
2925 tags:
2926 - Video Mirroring
2927 summary: Delete a mirror done on a video
2928 security:
2929 - OAuth2:
2930 - admin
2931 parameters:
2932 - name: redundancyId
2933 in: path
2934 required: true
2935 description: id of an existing redundancy on a video
2936 schema:
2937 type: string
2938 responses:
2939 '204':
2940 description: successful operation
2941 '404':
2942 description: video redundancy not found
06746a8b
RK
2943 '/feeds/video-comments.{format}':
2944 get:
2945 tags:
2946 - Feeds
2947 summary: List comments on videos
d73810be 2948 servers:
d73810be 2949 - url: 'https://peertube2.cpy.re'
f4d59981 2950 description: Live Test Server (live data - latest nightly version)
d73810be
RK
2951 - url: 'https://peertube3.cpy.re'
2952 description: Live Test Server (live data - latest RC version)
f4d59981
RK
2953 - url: 'https://peertube.cpy.re'
2954 description: Live Test Server (live data - stable version)
06746a8b
RK
2955 parameters:
2956 - name: format
2957 in: path
2958 required: true
00494d6e 2959 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
06746a8b
RK
2960 schema:
2961 type: string
2962 enum:
2963 - xml
2964 - rss
2965 - rss2
2966 - atom
2967 - atom1
2968 - json
2969 - json1
2970 - name: videoId
d73810be 2971 in: query
06746a8b
RK
2972 description: 'limit listing to a specific video'
2973 schema:
2974 type: string
00494d6e
RK
2975 - name: accountId
2976 in: query
2977 description: 'limit listing to a specific account'
2978 schema:
2979 type: string
2980 - name: accountName
2981 in: query
2982 description: 'limit listing to a specific account'
2983 schema:
2984 type: string
2985 - name: videoChannelId
2986 in: query
2987 description: 'limit listing to a specific video channel'
2988 schema:
2989 type: string
2990 - name: videoChannelName
2991 in: query
2992 description: 'limit listing to a specific video channel'
2993 schema:
2994 type: string
06746a8b
RK
2995 responses:
2996 '204':
2997 description: successful operation
2998 headers:
2999 Cache-Control:
3000 schema:
3001 type: string
3002 default: 'max-age=900' # 15 min cache
3003 content:
3004 application/xml:
3005 schema:
3006 $ref: '#/components/schemas/VideoCommentsForXML'
3007 application/rss+xml:
3008 schema:
3009 $ref: '#/components/schemas/VideoCommentsForXML'
3010 text/xml:
3011 schema:
3012 $ref: '#/components/schemas/VideoCommentsForXML'
3013 application/atom+xml:
3014 schema:
3015 $ref: '#/components/schemas/VideoCommentsForXML'
3016 application/json:
3017 schema:
3018 type: object
00494d6e
RK
3019 '400':
3020 x-summary: field inconsistencies
3021 description: >
3022 Arises when:
3023 - videoId filter is mixed with a channel filter
3024 '404':
3025 description: video, video channel or account not found
06746a8b
RK
3026 '406':
3027 description: accept header unsupported
3028 '/feeds/videos.{format}':
3029 get:
3030 tags:
3031 - Feeds
3032 summary: List videos
d73810be 3033 servers:
d73810be 3034 - url: 'https://peertube2.cpy.re'
f4d59981 3035 description: Live Test Server (live data - latest nightly version)
d73810be
RK
3036 - url: 'https://peertube3.cpy.re'
3037 description: Live Test Server (live data - latest RC version)
f4d59981
RK
3038 - url: 'https://peertube.cpy.re'
3039 description: Live Test Server (live data - stable version)
06746a8b
RK
3040 parameters:
3041 - name: format
3042 in: path
3043 required: true
00494d6e 3044 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
06746a8b
RK
3045 schema:
3046 type: string
3047 enum:
3048 - xml
3049 - rss
3050 - rss2
3051 - atom
3052 - atom1
3053 - json
3054 - json1
3055 - name: accountId
d73810be 3056 in: query
06746a8b
RK
3057 description: 'limit listing to a specific account'
3058 schema:
3059 type: string
3060 - name: accountName
d73810be 3061 in: query
06746a8b
RK
3062 description: 'limit listing to a specific account'
3063 schema:
3064 type: string
3065 - name: videoChannelId
d73810be 3066 in: query
06746a8b
RK
3067 description: 'limit listing to a specific video channel'
3068 schema:
3069 type: string
3070 - name: videoChannelName
d73810be 3071 in: query
06746a8b
RK
3072 description: 'limit listing to a specific video channel'
3073 schema:
3074 type: string
84f6e32c
RK
3075 - $ref: '#/components/parameters/sort'
3076 - $ref: '#/components/parameters/nsfw'
3077 - $ref: '#/components/parameters/filter'
06746a8b
RK
3078 responses:
3079 '204':
3080 description: successful operation
3081 headers:
3082 Cache-Control:
3083 schema:
3084 type: string
3085 default: 'max-age=900' # 15 min cache
3086 content:
3087 application/xml:
3088 schema:
3089 $ref: '#/components/schemas/VideosForXML'
84f6e32c
RK
3090 examples:
3091 nightly:
3092 externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
06746a8b
RK
3093 application/rss+xml:
3094 schema:
3095 $ref: '#/components/schemas/VideosForXML'
3096 text/xml:
3097 schema:
3098 $ref: '#/components/schemas/VideosForXML'
3099 application/atom+xml:
3100 schema:
3101 $ref: '#/components/schemas/VideosForXML'
3102 application/json:
3103 schema:
3104 type: object
00494d6e
RK
3105 '404':
3106 description: video channel or account not found
06746a8b
RK
3107 '406':
3108 description: accept header unsupported
7461d440
RK
3109 /plugins:
3110 get:
3111 tags:
3112 - Plugins
3113 summary: List plugins
3114 security:
3115 - OAuth2:
3116 - admin
3117 parameters:
3118 - name: pluginType
3119 in: query
3120 schema:
3121 type: integer
3122 - name: uninstalled
3123 in: query
3124 schema:
3125 type: boolean
3126 - $ref: '#/components/parameters/start'
3127 - $ref: '#/components/parameters/count'
3128 - $ref: '#/components/parameters/sort'
3129 responses:
3130 '200':
3131 description: successful operation
3132 content:
3133 application/json:
3134 schema:
3135 $ref: '#/components/schemas/PluginResponse'
3136 /plugins/available:
3137 get:
3138 tags:
3139 - Plugins
3140 summary: List available plugins
3141 security:
3142 - OAuth2:
3143 - admin
3144 parameters:
3145 - name: search
3146 in: query
3147 schema:
3148 type: string
3149 - name: pluginType
3150 in: query
3151 schema:
3152 type: integer
3153 - name: currentPeerTubeEngine
3154 in: query
3155 schema:
3156 type: string
3157 - $ref: '#/components/parameters/start'
3158 - $ref: '#/components/parameters/count'
3159 - $ref: '#/components/parameters/sort'
3160 responses:
3161 '200':
3162 description: successful operation
3163 content:
3164 application/json:
3165 schema:
3166 $ref: '#/components/schemas/PluginResponse'
3167 '503':
3168 description: plugin index unavailable
3169 /plugins/install:
3170 post:
3171 tags:
3172 - Plugins
3173 summary: Install a plugin
3174 security:
3175 - OAuth2:
3176 - admin
3177 requestBody:
3178 content:
3179 application/json:
3180 schema:
3181 oneOf:
3182 - type: object
3183 properties:
3184 npmName:
3185 type: string
84f6e32c 3186 example: peertube-plugin-auth-ldap
7461d440
RK
3187 required:
3188 - npmName
3189 additionalProperties: false
3190 - type: object
3191 properties:
3192 path:
3193 type: string
3194 required:
3195 - path
3196 additionalProperties: false
3197 responses:
3198 '204':
3199 description: successful operation
3200 '400':
3201 description: should have either `npmName` or `path` set
3202 /plugins/update:
3203 post:
3204 tags:
3205 - Plugins
3206 summary: Update a plugin
3207 security:
3208 - OAuth2:
3209 - admin
3210 requestBody:
3211 content:
3212 application/json:
3213 schema:
3214 oneOf:
3215 - type: object
3216 properties:
3217 npmName:
3218 type: string
84f6e32c 3219 example: peertube-plugin-auth-ldap
7461d440
RK
3220 required:
3221 - npmName
3222 additionalProperties: false
3223 - type: object
3224 properties:
3225 path:
3226 type: string
3227 required:
3228 - path
3229 additionalProperties: false
3230 responses:
3231 '204':
3232 description: successful operation
3233 '400':
3234 description: should have either `npmName` or `path` set
3235 '404':
3236 description: existing plugin not found
3237 /plugins/uninstall:
3238 post:
3239 tags:
3240 - Plugins
3241 summary: Uninstall a plugin
3242 security:
3243 - OAuth2:
3244 - admin
3245 requestBody:
3246 content:
3247 application/json:
3248 schema:
3249 type: object
3250 properties:
3251 npmName:
3252 type: string
84f6e32c
RK
3253 description: name of the plugin/theme in its package.json
3254 example: peertube-plugin-auth-ldap
7461d440
RK
3255 required:
3256 - npmName
3257 responses:
3258 '204':
3259 description: successful operation
3260 '404':
3261 description: existing plugin not found
3262 /plugins/{npmName}:
3263 get:
3264 tags:
3265 - Plugins
3266 summary: Get a plugin
3267 security:
3268 - OAuth2:
3269 - admin
3270 parameters:
84f6e32c 3271 - $ref: '#/components/parameters/npmName'
7461d440
RK
3272 responses:
3273 '200':
3274 description: successful operation
3275 content:
3276 application/json:
3277 schema:
3278 $ref: '#/components/schemas/Plugin'
3279 '404':
3280 description: plugin not found
3281 /plugins/{npmName}/settings:
3282 put:
3283 tags:
3284 - Plugins
3285 summary: Set a plugin's settings
3286 security:
3287 - OAuth2:
3288 - admin
3289 parameters:
84f6e32c 3290 - $ref: '#/components/parameters/npmName'
7461d440
RK
3291 requestBody:
3292 content:
3293 application/json:
3294 schema:
3295 type: object
3296 properties:
3297 settings:
3298 type: object
3299 additionalProperties: true
3300 responses:
3301 '204':
3302 description: successful operation
3303 '404':
3304 description: plugin not found
3305 /plugins/{npmName}/public-settings:
3306 get:
3307 tags:
3308 - Plugins
3309 summary: Get a plugin's public settings
7461d440 3310 parameters:
84f6e32c 3311 - $ref: '#/components/parameters/npmName'
7461d440
RK
3312 responses:
3313 '200':
3314 description: successful operation
3315 content:
3316 application/json:
3317 schema:
3318 type: object
3319 additionalProperties: true
3320 '404':
3321 description: plugin not found
3322 /plugins/{npmName}/registered-settings:
3323 get:
3324 tags:
3325 - Plugins
3326 summary: Get a plugin's registered settings
3327 security:
3328 - OAuth2:
3329 - admin
3330 parameters:
84f6e32c 3331 - $ref: '#/components/parameters/npmName'
7461d440
RK
3332 responses:
3333 '200':
3334 description: successful operation
3335 content:
3336 application/json:
3337 schema:
3338 type: object
3339 additionalProperties: true
3340 '404':
3341 description: plugin not found
3e9e6f2f 3342servers:
8f9e8be1 3343 - url: 'https://peertube2.cpy.re/api/v1'
f4d59981 3344 description: Live Test Server (live data - latest nightly version)
6441981b 3345 - url: 'https://peertube3.cpy.re/api/v1'
b029d58a 3346 description: Live Test Server (live data - latest RC version)
f4d59981
RK
3347 - url: 'https://peertube.cpy.re/api/v1'
3348 description: Live Test Server (live data - stable version)
3e9e6f2f
RK
3349components:
3350 parameters:
3351 start:
3352 name: start
3353 in: query
3354 required: false
06746a8b 3355 description: Offset used to paginate results
3e9e6f2f 3356 schema:
06746a8b 3357 type: integer
84f6e32c 3358 minimum: 0
3e9e6f2f
RK
3359 count:
3360 name: count
3361 in: query
3362 required: false
06746a8b 3363 description: "Number of items to return"
3e9e6f2f 3364 schema:
06746a8b 3365 type: integer
84f6e32c 3366 default: 15
06746a8b
RK
3367 maximum: 100
3368 minimum: 1
3e9e6f2f
RK
3369 sort:
3370 name: sort
3371 in: query
3372 required: false
84f6e32c 3373 description: Sort column
3e9e6f2f
RK
3374 schema:
3375 type: string
84f6e32c 3376 example: -createdAt
8491293b
RK
3377 search:
3378 name: search
3379 in: query
3380 required: false
3381 description: Plain text search, applied to various parts of the model depending on endpoint
3382 schema:
3383 type: string
ad031145
C
3384 searchTarget:
3385 name: searchTarget
3386 in: query
3387 required: false
3388 description: >
3389 If the administrator enabled search index support, you can override the default search target.
3390
3391
3392 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
84f6e32c 3393 It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
ad031145
C
3394 * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
3395 then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
3396 After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
84f6e32c 3397 * If the current user doesn't have the ability to make a remote URI search, then redirect the user on the origin instance or fetch
ad031145
C
3398 the data from the origin instance API
3399 schema:
3400 type: string
3401 enum:
3402 - 'local'
3403 - 'search-index'
fd5af7a2
RK
3404 videosSort:
3405 name: sort
3406 in: query
3407 required: false
3408 description: Sort videos by criteria
3409 schema:
3410 type: string
3411 enum:
04b703f6 3412 - name
fd5af7a2
RK
3413 - -duration
3414 - -createdAt
3415 - -publishedAt
3416 - -views
3417 - -likes
3418 - -trending
3419 videosSearchSort:
3420 name: sort
3421 in: query
3422 required: false
3423 description: Sort videos by criteria
3424 schema:
3425 type: string
3426 enum:
04b703f6 3427 - name
fd5af7a2
RK
3428 - -duration
3429 - -createdAt
3430 - -publishedAt
3431 - -views
3432 - -likes
3433 - -match
71810d0b
RK
3434 commentsSort:
3435 name: sort
3436 in: query
3437 required: false
3438 description: Sort comments by criteria
3439 schema:
3440 type: string
3441 enum:
3442 - -createdAt
3443 - -totalReplies
fd5af7a2
RK
3444 blacklistsSort:
3445 name: sort
3446 in: query
3447 required: false
3448 description: Sort blacklists by criteria
3449 schema:
3450 type: string
3451 enum:
3452 - -id
04b703f6 3453 - name
fd5af7a2
RK
3454 - -duration
3455 - -views
3456 - -likes
3457 - -dislikes
3458 - -uuid
3459 - -createdAt
8491293b
RK
3460 usersSearch:
3461 name: search
3462 in: query
3463 required: false
3464 description: Plain text search that will match with user usernames or emails
3465 schema:
3466 type: string
3467 usersBlocked:
3468 name: blocked
3469 in: query
3470 required: false
3471 description: Filter results down to (un)banned users
3472 schema:
3473 type: boolean
fd5af7a2
RK
3474 usersSort:
3475 name: sort
3476 in: query
3477 required: false
3478 description: Sort users by criteria
3479 schema:
3480 type: string
3481 enum:
3482 - -id
3483 - -username
3484 - -createdAt
3485 abusesSort:
3486 name: sort
3487 in: query
3488 required: false
3489 description: Sort abuses by criteria
3490 schema:
3491 type: string
3492 enum:
3493 - -id
3494 - -createdAt
3495 - -state
04b703f6
RK
3496 videoRedundanciesSort:
3497 name: sort
3498 in: query
3499 required: false
3500 description: Sort abuses by criteria
3501 schema:
3502 type: string
3503 enum:
3504 - name
3e9e6f2f
RK
3505 name:
3506 name: name
3507 in: path
3508 required: true
84f6e32c 3509 description: The name of the account
3e9e6f2f
RK
3510 schema:
3511 type: string
84f6e32c 3512 example: chocobozzz | chocobozzz@example.org
3e9e6f2f
RK
3513 id:
3514 name: id
3515 in: path
3516 required: true
3517 description: The user id
3518 schema:
06746a8b 3519 type: integer
84f6e32c
RK
3520 minimum: 0
3521 example: 42
cb9d028a 3522 idOrUUID:
3e9e6f2f
RK
3523 name: id
3524 in: path
3525 required: true
c1843150 3526 description: The object id or uuid
3e9e6f2f 3527 schema:
84f6e32c
RK
3528 oneOf:
3529 - type: integer
3530 minimum: 0
3531 example: 42
3532 - type: string
3533 format: uuid
3534 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
c1843150
C
3535 playlistElementId:
3536 name: playlistElementId
3537 in: path
3538 required: true
3539 description: Playlist element id
3540 schema:
06746a8b 3541 type: integer
50e16ccf
C
3542 abuseId:
3543 name: abuseId
3544 in: path
3545 required: true
310b5219 3546 description: Abuse id
50e16ccf 3547 schema:
06746a8b 3548 type: integer
668b7f09
C
3549 abuseMessageId:
3550 name: abuseMessageId
3551 in: path
3552 required: true
3553 description: Abuse message id
3554 schema:
3555 type: integer
67ae04a5
C
3556 captionLanguage:
3557 name: captionLanguage
3558 in: path
3559 required: true
3560 description: The caption language
3561 schema:
3562 type: string
9ce3d302
C
3563 channelHandle:
3564 name: channelHandle
3e9e6f2f
RK
3565 in: path
3566 required: true
84f6e32c 3567 description: The video channel handle
3e9e6f2f
RK
3568 schema:
3569 type: string
84f6e32c 3570 example: my_username | my_username@example.com
cb9d028a
C
3571 subscriptionHandle:
3572 name: subscriptionHandle
3573 in: path
3574 required: true
84f6e32c 3575 description: The subscription handle
cb9d028a
C
3576 schema:
3577 type: string
84f6e32c 3578 example: my_username | my_username@example.com
cb9d028a 3579 threadId:
3e9e6f2f
RK
3580 name: threadId
3581 in: path
3582 required: true
cb9d028a
C
3583 description: The thread id (root comment id)
3584 schema:
06746a8b 3585 type: integer
cb9d028a
C
3586 commentId:
3587 name: commentId
3588 in: path
3589 required: true
3e9e6f2f
RK
3590 description: The comment id
3591 schema:
06746a8b 3592 type: integer
fd5af7a2
RK
3593 categoryOneOf:
3594 name: categoryOneOf
3595 in: query
3596 required: false
84f6e32c 3597 description: category id of the video (see [/videos/categories](#tag/Video/paths/~1videos~1categories/get))
fd5af7a2
RK
3598 schema:
3599 oneOf:
06746a8b 3600 - type: integer
fd5af7a2
RK
3601 - type: array
3602 items:
06746a8b 3603 type: integer
2beb9895
RK
3604 style: form
3605 explode: false
fd5af7a2
RK
3606 tagsOneOf:
3607 name: tagsOneOf
3608 in: query
3609 required: false
3610 description: tag(s) of the video
3611 schema:
3612 oneOf:
3613 - type: string
3614 - type: array
3615 items:
3616 type: string
2beb9895
RK
3617 style: form
3618 explode: false
fd5af7a2
RK
3619 tagsAllOf:
3620 name: tagsAllOf
3621 in: query
3622 required: false
3623 description: tag(s) of the video, where all should be present in the video
3624 schema:
3625 oneOf:
3626 - type: string
3627 - type: array
3628 items:
3629 type: string
2beb9895
RK
3630 style: form
3631 explode: false
fd5af7a2
RK
3632 languageOneOf:
3633 name: languageOneOf
3634 in: query
3635 required: false
84f6e32c 3636 description: language id of the video (see [/videos/languages](#tag/Video/paths/~1videos~1languages/get)). Use `_unknown` to filter on videos that don't have a video language
fd5af7a2
RK
3637 schema:
3638 oneOf:
2beb9895 3639 - type: string
fd5af7a2
RK
3640 - type: array
3641 items:
2beb9895
RK
3642 type: string
3643 style: form
3644 explode: false
fd5af7a2
RK
3645 licenceOneOf:
3646 name: licenceOneOf
3647 in: query
3648 required: false
84f6e32c 3649 description: licence id of the video (see [/videos/licences](#tag/Video/paths/~1videos~1licences/get))
fd5af7a2
RK
3650 schema:
3651 oneOf:
06746a8b 3652 - type: integer
fd5af7a2
RK
3653 - type: array
3654 items:
06746a8b 3655 type: integer
2beb9895
RK
3656 style: form
3657 explode: false
59c794a5
C
3658 skipCount:
3659 name: skipCount
3660 in: query
3661 required: false
3662 description: if you don't need the `total` in the response
3663 schema:
3664 type: string
3665 enum:
3666 - 'true'
3667 - 'false'
06746a8b 3668 default: 'false'
fd5af7a2
RK
3669 nsfw:
3670 name: nsfw
3671 in: query
3672 required: false
3673 description: whether to include nsfw videos, if any
3674 schema:
3675 type: string
3676 enum:
3677 - 'true'
3678 - 'false'
3679 filter:
3680 name: filter
3681 in: query
3682 required: false
3683 description: >
3684 Special filters (local for instance) which might require special rights:
3685 * `local` - only videos local to the instance
3686 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
3687 schema:
3688 type: string
3689 enum:
3690 - local
3691 - all-local
e76d5784
RK
3692 subscriptionsUris:
3693 name: uris
3694 in: query
3695 required: true
3696 description: list of uris to check if each is part of the user subscriptions
3697 schema:
3698 type: array
3699 items:
3700 type: string
84f6e32c
RK
3701 format: uri
3702 npmName:
3703 name: npmName
3704 in: path
3705 required: true
3706 description: name of the plugin/theme on npmjs.com or in its package.json
3707 schema:
3708 type: string
3709 example: peertube-plugin-auth-ldap
3e9e6f2f
RK
3710 securitySchemes:
3711 OAuth2:
3712 description: >
3713 In the header: *Authorization: Bearer <token\>*
3714
3715
3716 Authenticating via OAuth requires the following steps:
3717
3718
3719 - Have an account with sufficient authorization levels
3720
46e9407c 3721 - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
3e9e6f2f
RK
3722 Bearer Token
3723
3724 - Make Authenticated Requests
3725 type: oauth2
3726 flows:
3727 password:
3728 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
3729 scopes:
3730 admin: Admin scope
3731 moderator: Moderator scope
3732 user: User scope
3733 schemas:
3734 VideoConstantNumber:
3735 properties:
3736 id:
06746a8b 3737 type: integer
3e9e6f2f
RK
3738 label:
3739 type: string
3740 VideoConstantString:
3741 properties:
3742 id:
3743 type: string
3744 label:
3745 type: string
c1843150
C
3746
3747 VideoPlaylistPrivacySet:
3748 type: integer
3749 enum:
3750 - 1
3751 - 2
3752 - 3
06746a8b 3753 description: 'The video playlist privacy (Public = `1`, Unlisted = `2`, Private = `3`)'
c1843150
C
3754 VideoPlaylistPrivacyConstant:
3755 properties:
3756 id:
3757 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
3758 label:
3759 type: string
3760
3761 VideoPlaylistTypeSet:
3762 type: integer
3763 enum:
3764 - 1
3765 - 2
06746a8b 3766 description: 'The video playlist type (Regular = `1`, Watch Later = `2`)'
c1843150
C
3767 VideoPlaylistTypeConstant:
3768 properties:
3769 id:
3770 $ref: '#/components/schemas/VideoPlaylistTypeSet'
3771 label:
3772 type: string
3773
ee89e8fd
C
3774 VideoPrivacySet:
3775 type: integer
3e9e6f2f 3776 enum:
ee89e8fd
C
3777 - 1
3778 - 2
3779 - 3
c1843150 3780 - 4
06746a8b 3781 description: 'The video privacy (Public = `1`, Unlisted = `2`, Private = `3`, Internal = `4`)'
ee89e8fd
C
3782 VideoPrivacyConstant:
3783 properties:
3784 id:
c1843150 3785 $ref: '#/components/schemas/VideoPrivacySet'
ee89e8fd
C
3786 label:
3787 type: string
50e16ccf 3788
0590bb46
C
3789 NSFWPolicy:
3790 type: string
3791 enum:
3792 - display
3793 - blur
3794 - do_not_list
3795
3796 UserRole:
06746a8b 3797 type: integer
0590bb46
C
3798 enum:
3799 - 0
3800 - 1
3801 - 2
06746a8b 3802 description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
2c318664 3803 example: 2
0590bb46 3804
5dce26d2
C
3805 VideoStateConstant:
3806 properties:
3807 id:
3808 type: integer
3809 enum:
3810 - 1
3811 - 2
3812 - 3
06746a8b 3813 description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
5dce26d2
C
3814 label:
3815 type: string
50e16ccf 3816
4f32032f 3817 AbuseStateSet:
50e16ccf
C
3818 type: integer
3819 enum:
3820 - 1
3821 - 2
3822 - 3
668b7f09 3823 description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)'
4f32032f 3824 AbuseStateConstant:
50e16ccf
C
3825 properties:
3826 id:
4f32032f 3827 $ref: '#/components/schemas/AbuseStateSet'
50e16ccf
C
3828 label:
3829 type: string
4f32032f 3830 AbusePredefinedReasons:
1ebddadd
RK
3831 type: array
3832 items:
3833 type: string
3834 enum:
3835 - violentOrAbusive
3836 - hatefulOrAbusive
3837 - spamOrMisleading
3838 - privacy
3839 - rights
3840 - serverRules
3841 - thumbnails
3842 - captions
84f6e32c 3843 example: [spamOrMisleading]
50e16ccf 3844
5dce26d2
C
3845 VideoResolutionConstant:
3846 properties:
3847 id:
3848 type: integer
3849 description: 'Video resolution (240, 360, 720 ...)'
84f6e32c 3850 example: 240
5dce26d2
C
3851 label:
3852 type: string
84f6e32c 3853 example: 240p
5dce26d2
C
3854 VideoScheduledUpdate:
3855 properties:
3856 privacy:
3857 $ref: '#/components/schemas/VideoPrivacySet'
5dce26d2
C
3858 updateAt:
3859 type: string
3860 format: date
3861 description: When to update the video
3862 required:
3863 - updateAt
c1843150 3864 AccountSummary:
5dce26d2
C
3865 properties:
3866 id:
06746a8b 3867 type: integer
5dce26d2
C
3868 name:
3869 type: string
3870 displayName:
3871 type: string
3872 url:
3873 type: string
84f6e32c 3874 format: url
5dce26d2
C
3875 host:
3876 type: string
84f6e32c 3877 format: hostname
5dce26d2
C
3878 avatar:
3879 nullable: true
c1843150
C
3880 allOf:
3881 - $ref: '#/components/schemas/Avatar'
5dce26d2
C
3882 VideoChannelSummary:
3883 properties:
3884 id:
06746a8b 3885 type: integer
5dce26d2
C
3886 name:
3887 type: string
3888 displayName:
3889 type: string
3890 url:
3891 type: string
84f6e32c 3892 format: url
5dce26d2
C
3893 host:
3894 type: string
84f6e32c 3895 format: hostname
5dce26d2
C
3896 avatar:
3897 nullable: true
c1843150
C
3898 allOf:
3899 - $ref: '#/components/schemas/Avatar'
5dce26d2
C
3900 PlaylistElement:
3901 properties:
3902 position:
06746a8b 3903 type: integer
5dce26d2 3904 startTimestamp:
06746a8b 3905 type: integer
5dce26d2 3906 stopTimestamp:
06746a8b 3907 type: integer
bfbd9128
C
3908 video:
3909 nullable: true
c1843150
C
3910 allOf:
3911 - $ref: '#/components/schemas/Video'
5dce26d2
C
3912 VideoFile:
3913 properties:
3914 magnetUri:
3915 type: string
3916 resolution:
3917 $ref: '#/components/schemas/VideoResolutionConstant'
3918 size:
06746a8b 3919 type: integer
5dce26d2
C
3920 description: 'Video file size in bytes'
3921 torrentUrl:
3922 type: string
84f6e32c 3923 format: url
0ad45af7 3924 torrentDownloadUrl:
5dce26d2 3925 type: string
84f6e32c 3926 format: url
5dce26d2
C
3927 fileUrl:
3928 type: string
84f6e32c 3929 format: url
5dce26d2
C
3930 fileDownloadUrl:
3931 type: string
84f6e32c 3932 format: url
5dce26d2
C
3933 fps:
3934 type: number
63748ad0
C
3935 metadataUrl:
3936 type: string
84f6e32c 3937 format: url
5dce26d2
C
3938 VideoStreamingPlaylists:
3939 properties:
3940 id:
06746a8b 3941 type: integer
5dce26d2 3942 type:
06746a8b 3943 type: integer
5dce26d2
C
3944 enum:
3945 - 1
06746a8b 3946 description: 'Playlist type (HLS = `1`)'
5dce26d2
C
3947 playlistUrl:
3948 type: string
84f6e32c 3949 format: url
5dce26d2
C
3950 segmentsSha256Url:
3951 type: string
84f6e32c 3952 format: url
63748ad0
C
3953 files:
3954 type: array
000ca2a8 3955 description: 'Video files associated to this playlist. The difference with the root "files" property is that these files are fragmented, so they can be used in this streaming playlist (HLS etc)'
63748ad0
C
3956 items:
3957 $ref: '#/components/schemas/VideoFile'
5dce26d2
C
3958 redundancies:
3959 type: array
3960 items:
3961 type: object
3962 properties:
3963 baseUrl:
3964 type: string
84f6e32c 3965 format: url
f4d59981
RK
3966 VideoInfo:
3967 properties:
3968 id:
3969 type: integer
3970 uuid:
3971 type: string
84f6e32c
RK
3972 format: uuid
3973 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
f4d59981
RK
3974 name:
3975 type: string
3e9e6f2f
RK
3976 Video:
3977 properties:
3978 id:
06746a8b 3979 type: integer
84f6e32c 3980 example: 8
3e9e6f2f
RK
3981 uuid:
3982 type: string
84f6e32c
RK
3983 format: uuid
3984 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
4e239e35
C
3985 isLive:
3986 type: boolean
3e9e6f2f
RK
3987 createdAt:
3988 type: string
84f6e32c 3989 format: date-time
3e9e6f2f
RK
3990 publishedAt:
3991 type: string
84f6e32c 3992 format: date-time
3e9e6f2f
RK
3993 updatedAt:
3994 type: string
84f6e32c 3995 format: date-time
5dce26d2
C
3996 originallyPublishedAt:
3997 type: string
84f6e32c 3998 format: date-time
3e9e6f2f
RK
3999 category:
4000 $ref: '#/components/schemas/VideoConstantNumber'
4001 licence:
4002 $ref: '#/components/schemas/VideoConstantNumber'
4003 language:
4004 $ref: '#/components/schemas/VideoConstantString'
4005 privacy:
ee89e8fd 4006 $ref: '#/components/schemas/VideoPrivacyConstant'
3e9e6f2f
RK
4007 description:
4008 type: string
4009 duration:
06746a8b 4010 type: integer
84f6e32c 4011 example: 1419
3e9e6f2f
RK
4012 isLocal:
4013 type: boolean
4014 name:
4015 type: string
84f6e32c 4016 example: What is PeerTube?
3e9e6f2f
RK
4017 thumbnailPath:
4018 type: string
84f6e32c 4019 example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
4020 previewPath:
4021 type: string
20dcfd74 4022 example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
4023 embedPath:
4024 type: string
84f6e32c 4025 example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
3e9e6f2f 4026 views:
06746a8b 4027 type: integer
84f6e32c 4028 example: 1337
3e9e6f2f 4029 likes:
06746a8b 4030 type: integer
84f6e32c 4031 example: 42
3e9e6f2f 4032 dislikes:
06746a8b 4033 type: integer
84f6e32c 4034 example: 7
3e9e6f2f
RK
4035 nsfw:
4036 type: boolean
5dce26d2
C
4037 waitTranscoding:
4038 type: boolean
4039 nullable: true
4040 state:
4041 $ref: '#/components/schemas/VideoStateConstant'
4042 scheduledUpdate:
4043 nullable: true
c1843150
C
4044 allOf:
4045 - $ref: '#/components/schemas/VideoScheduledUpdate'
5dce26d2
C
4046 blacklisted:
4047 nullable: true
4048 type: boolean
4049 blacklistedReason:
4050 nullable: true
4051 type: string
3e9e6f2f 4052 account:
c1843150 4053 $ref: '#/components/schemas/AccountSummary'
5dce26d2
C
4054 channel:
4055 $ref: '#/components/schemas/VideoChannelSummary'
4056 userHistory:
4057 nullable: true
3e9e6f2f
RK
4058 type: object
4059 properties:
5dce26d2 4060 currentTime:
06746a8b 4061 type: integer
5dce26d2
C
4062 VideoDetails:
4063 allOf:
4064 - $ref: '#/components/schemas/Video'
4065 - type: object
4066 properties:
4067 descriptionPath:
3e9e6f2f 4068 type: string
5dce26d2 4069 support:
3e9e6f2f 4070 type: string
00494d6e 4071 description: A text tell the audience how to support the video creator
84f6e32c 4072 example: Please support my work on <insert crowdfunding plateform>! <3
5dce26d2
C
4073 channel:
4074 $ref: '#/components/schemas/VideoChannel'
4075 account:
4076 $ref: '#/components/schemas/Account'
4077 tags:
4078 type: array
4079 items:
4080 type: string
84f6e32c 4081 example: [flowers, gardening]
5dce26d2
C
4082 files:
4083 type: array
000ca2a8 4084 description: 'WebTorrent/raw video files. Can be empty if WebTorrent is disabled on the server. In this case, video files will be in the "streamingPlaylists[].files" property'
5dce26d2
C
4085 items:
4086 $ref: '#/components/schemas/VideoFile'
4087 commentsEnabled:
4088 type: boolean
4089 downloadEnabled:
4090 type: boolean
4091 trackerUrls:
4092 type: array
4093 items:
4094 type: string
84f6e32c 4095 format: url
5dce26d2
C
4096 streamingPlaylists:
4097 type: array
4098 items:
4099 $ref: '#/components/schemas/VideoStreamingPlaylists'
04b703f6
RK
4100 FileRedundancyInformation:
4101 properties:
4102 id:
4103 type: integer
4104 fileUrl:
4105 type: string
84f6e32c 4106 format: url
04b703f6
RK
4107 strategy:
4108 type: string
84f6e32c
RK
4109 enum:
4110 - manual
4111 - most-views
4112 - trending
4113 - recently-added
04b703f6
RK
4114 size:
4115 type: integer
4116 createdAt:
4117 type: string
4118 format: date-time
4119 updatedAt:
4120 type: string
4121 format: date-time
4122 expiresOn:
4123 type: string
4124 format: date-time
4125 VideoRedundancy:
4126 properties:
4127 id:
4128 type: integer
4129 name:
4130 type: string
4131 url:
4132 type: string
84f6e32c 4133 format: url
04b703f6
RK
4134 uuid:
4135 type: string
84f6e32c
RK
4136 format: uuid
4137 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
04b703f6
RK
4138 redundancies:
4139 type: object
4140 properties:
4141 files:
4142 type: array
4143 items:
1e904cde 4144 $ref: '#/components/schemas/FileRedundancyInformation'
04b703f6
RK
4145 streamingPlaylists:
4146 type: array
4147 items:
1e904cde 4148 $ref: '#/components/schemas/FileRedundancyInformation'
1f82e3e8
C
4149 VideoImportStateConstant:
4150 properties:
4151 id:
4152 type: integer
4153 enum:
4154 - 1
4155 - 2
4156 - 3
06746a8b 4157 description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
1f82e3e8
C
4158 label:
4159 type: string
84f6e32c 4160 example: Pending
1f82e3e8
C
4161 VideoImport:
4162 properties:
4163 id:
06746a8b 4164 type: integer
84f6e32c 4165 example: 2
1f82e3e8
C
4166 targetUrl:
4167 type: string
84f6e32c
RK
4168 format: url
4169 example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
1f82e3e8
C
4170 magnetUri:
4171 type: string
84f6e32c
RK
4172 format: uri
4173 example: magnet:?xs=https%3A%2F%2Fframatube.org%2Fstatic%2Ftorrents%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.torrent&xt=urn:btih:38b4747ff788b30bf61f59d1965cd38f9e48e01f&dn=What+is+PeerTube%3F&tr=wss%3A%2F%2Fframatube.org%2Ftracker%2Fsocket&tr=https%3A%2F%2Fframatube.org%2Ftracker%2Fannounce&ws=https%3A%2F%2Fframatube.org%2Fstatic%2Fwebseed%2F9c9de5e8-0a1e-484a-b099-e80766180a6d-240.mp4
1f82e3e8
C
4174 torrentName:
4175 type: string
4176 state:
84f6e32c 4177 $ref: '#/components/schemas/VideoImportStateConstant'
1f82e3e8
C
4178 error:
4179 type: string
4180 createdAt:
4181 type: string
84f6e32c 4182 format: date-time
1f82e3e8
C
4183 updatedAt:
4184 type: string
84f6e32c 4185 format: date-time
1f82e3e8
C
4186 video:
4187 $ref: '#/components/schemas/Video'
668b7f09 4188 Abuse:
3e9e6f2f
RK
4189 properties:
4190 id:
06746a8b 4191 type: integer
84f6e32c 4192 example: 7
3e9e6f2f
RK
4193 reason:
4194 type: string
84f6e32c 4195 example: The video is a spam
1ebddadd 4196 predefinedReasons:
4f32032f 4197 $ref: '#/components/schemas/AbusePredefinedReasons'
3e9e6f2f
RK
4198 reporterAccount:
4199 $ref: '#/components/schemas/Account'
50e16ccf 4200 state:
4f32032f 4201 $ref: '#/components/schemas/AbuseStateConstant'
50e16ccf
C
4202 moderationComment:
4203 type: string
84f6e32c 4204 example: Decided to ban the server since it spams us regularly
3e9e6f2f
RK
4205 video:
4206 type: object
4207 properties:
4208 id:
06746a8b 4209 type: integer
3e9e6f2f
RK
4210 name:
4211 type: string
4212 uuid:
4213 type: string
84f6e32c
RK
4214 format: uuid
4215 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
3e9e6f2f
RK
4216 createdAt:
4217 type: string
84f6e32c 4218 format: date-time
668b7f09
C
4219 AbuseMessage:
4220 properties:
4221 id:
4222 type: integer
4223 message:
4224 type: string
4225 byModerator:
4226 type: boolean
4227 createdAt:
4228 type: string
4229 format: date-time
4230 account:
4231 $ref: '#/components/schemas/AccountSummary'
3e9e6f2f
RK
4232 VideoBlacklist:
4233 properties:
4234 id:
06746a8b 4235 type: integer
3e9e6f2f 4236 videoId:
06746a8b 4237 type: integer
3e9e6f2f
RK
4238 createdAt:
4239 type: string
84f6e32c 4240 format: date-time
3e9e6f2f
RK
4241 updatedAt:
4242 type: string
84f6e32c 4243 format: date-time
3e9e6f2f
RK
4244 name:
4245 type: string
4246 uuid:
4247 type: string
84f6e32c
RK
4248 format: uuid
4249 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
3e9e6f2f
RK
4250 description:
4251 type: string
4252 duration:
06746a8b 4253 type: integer
3e9e6f2f 4254 views:
06746a8b 4255 type: integer
3e9e6f2f 4256 likes:
06746a8b 4257 type: integer
3e9e6f2f 4258 dislikes:
06746a8b 4259 type: integer
3e9e6f2f
RK
4260 nsfw:
4261 type: boolean
4262 VideoChannel:
4263 properties:
4264 displayName:
4265 type: string
4266 description:
4267 type: string
4268 isLocal:
4269 type: boolean
4270 ownerAccount:
4271 type: object
4272 properties:
4273 id:
06746a8b 4274 type: integer
3e9e6f2f
RK
4275 uuid:
4276 type: string
84f6e32c
RK
4277 format: uuid
4278 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
71810d0b
RK
4279 VideoPlaylist:
4280 properties:
4281 id:
06746a8b 4282 type: integer
71810d0b
RK
4283 createdAt:
4284 type: string
84f6e32c 4285 format: date-time
71810d0b
RK
4286 updatedAt:
4287 type: string
84f6e32c 4288 format: date-time
71810d0b
RK
4289 description:
4290 type: string
4291 uuid:
4292 type: string
84f6e32c
RK
4293 format: uuid
4294 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
71810d0b
RK
4295 displayName:
4296 type: string
4297 isLocal:
4298 type: boolean
4299 videoLength:
06746a8b 4300 type: integer
71810d0b
RK
4301 thumbnailPath:
4302 type: string
4303 privacy:
c1843150 4304 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
71810d0b 4305 type:
c1843150 4306 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
71810d0b 4307 ownerAccount:
c1843150
C
4308 $ref: '#/components/schemas/AccountSummary'
4309 videoChannel:
4310 $ref: '#/components/schemas/VideoChannelSummary'
3e9e6f2f
RK
4311 VideoComment:
4312 properties:
4313 id:
06746a8b 4314 type: integer
3e9e6f2f
RK
4315 url:
4316 type: string
84f6e32c 4317 format: url
3e9e6f2f
RK
4318 text:
4319 type: string
4320 threadId:
06746a8b 4321 type: integer
3e9e6f2f 4322 inReplyToCommentId:
06746a8b 4323 type: integer
3e9e6f2f 4324 videoId:
06746a8b 4325 type: integer
3e9e6f2f
RK
4326 createdAt:
4327 type: string
84f6e32c 4328 format: date-time
3e9e6f2f
RK
4329 updatedAt:
4330 type: string
84f6e32c 4331 format: date-time
5b0413dd 4332 totalRepliesFromVideoAuthor:
06746a8b 4333 type: integer
3e9e6f2f 4334 totalReplies:
06746a8b 4335 type: integer
3e9e6f2f
RK
4336 account:
4337 $ref: '#/components/schemas/Account'
4338 VideoCommentThreadTree:
4339 properties:
4340 comment:
4341 $ref: '#/components/schemas/VideoComment'
4342 children:
4343 type: array
4344 items:
4345 $ref: '#/components/schemas/VideoCommentThreadTree'
67ae04a5
C
4346 VideoCaption:
4347 properties:
4348 language:
4349 $ref: '#/components/schemas/VideoConstantString'
4350 captionPath:
4351 type: string
3e9e6f2f
RK
4352 Avatar:
4353 properties:
4354 path:
4355 type: string
4356 createdAt:
4357 type: string
84f6e32c 4358 format: date-time
3e9e6f2f
RK
4359 updatedAt:
4360 type: string
84f6e32c 4361 format: date-time
f4d59981
RK
4362 ActorInfo:
4363 properties:
4364 id:
4365 type: integer
84f6e32c 4366 example: 11
f4d59981
RK
4367 name:
4368 type: string
4369 displayName:
4370 type: string
4371 host:
4372 type: string
84f6e32c 4373 format: hostname
f4d59981
RK
4374 avatar:
4375 nullable: true
4376 type: object
4377 properties:
4378 path:
4379 type: string
3e9e6f2f
RK
4380 Actor:
4381 properties:
4382 id:
06746a8b 4383 type: integer
84f6e32c 4384 example: 11
3e9e6f2f
RK
4385 url:
4386 type: string
84f6e32c 4387 format: url
3e9e6f2f
RK
4388 name:
4389 type: string
4390 host:
4391 type: string
84f6e32c 4392 format: hostname
3e9e6f2f 4393 followingCount:
06746a8b 4394 type: integer
3e9e6f2f 4395 followersCount:
06746a8b 4396 type: integer
3e9e6f2f
RK
4397 createdAt:
4398 type: string
84f6e32c 4399 format: date-time
3e9e6f2f
RK
4400 updatedAt:
4401 type: string
84f6e32c 4402 format: date-time
3e9e6f2f
RK
4403 avatar:
4404 $ref: '#/components/schemas/Avatar'
4405 Account:
4406 allOf:
4407 - $ref: '#/components/schemas/Actor'
4408 - properties:
2a8ae759
FS
4409 userId:
4410 type: string
84f6e32c 4411 example: 2
3e9e6f2f
RK
4412 displayName:
4413 type: string
2a8ae759
FS
4414 description:
4415 type: string
6441981b
RK
4416 UserWatchingVideo:
4417 properties:
4418 currentTime:
06746a8b 4419 type: integer
84f6e32c
RK
4420 description: timestamp within the video, in seconds
4421 example: 5
3e9e6f2f
RK
4422 ServerConfig:
4423 properties:
2a8ae759
FS
4424 instance:
4425 type: object
4426 properties:
4427 name:
4428 type: string
4429 shortDescription:
4430 type: string
4431 defaultClientRoute:
4432 type: string
4433 isNSFW:
4434 type: boolean
4435 defaultNSFWPolicy:
4436 type: string
4437 customizations:
4438 type: object
4439 properties:
4440 javascript:
4441 type: string
4442 css:
4443 type: string
f30736c8
RK
4444 search:
4445 type: object
4446 properties:
4447 remoteUri:
4448 type: object
4449 properties:
4450 users:
4451 type: boolean
4452 anonymous:
4453 type: boolean
2a8ae759
FS
4454 plugin:
4455 type: object
4456 properties:
4457 registered:
4458 type: array
4459 items:
4460 type: string
4461 theme:
4462 type: object
4463 properties:
4464 registered:
4465 type: array
4466 items:
4467 type: string
4468 email:
4469 type: object
4470 properties:
4471 enabled:
4472 type: boolean
4473 contactForm:
4474 type: object
4475 properties:
4476 enabled:
4477 type: boolean
4478 serverVersion:
4479 type: string
4480 serverCommit:
4481 type: string
3e9e6f2f
RK
4482 signup:
4483 type: object
4484 properties:
4485 allowed:
4486 type: boolean
2a8ae759
FS
4487 allowedForCurrentIP:
4488 type: boolean
4489 requiresEmailVerification:
4490 type: boolean
3e9e6f2f
RK
4491 transcoding:
4492 type: object
4493 properties:
2a8ae759
FS
4494 hls:
4495 type: object
4496 properties:
4497 enabled:
4498 type: boolean
f30736c8
RK
4499 webtorrent:
4500 type: object
4501 properties:
4502 enabled:
4503 type: boolean
3e9e6f2f
RK
4504 enabledResolutions:
4505 type: array
4506 items:
06746a8b 4507 type: integer
2a8ae759
FS
4508 import:
4509 type: object
4510 properties:
4511 videos:
4512 type: object
4513 properties:
4514 http:
4515 type: object
4516 properties:
4517 enabled:
4518 type: boolean
4519 torrent:
4520 type: object
4521 properties:
4522 enabled:
4523 type: boolean
4524 autoBlacklist:
4525 type: object
4526 properties:
4527 videos:
4528 type: object
4529 properties:
4530 ofUsers:
4531 type: object
4532 properties:
4533 enabled:
4534 type: boolean
3e9e6f2f
RK
4535 avatar:
4536 type: object
4537 properties:
4538 file:
4539 type: object
4540 properties:
4541 size:
4542 type: object
4543 properties:
4544 max:
06746a8b 4545 type: integer
3e9e6f2f
RK
4546 extensions:
4547 type: array
4548 items:
4549 type: string
4550 video:
4551 type: object
4552 properties:
2a8ae759
FS
4553 image:
4554 type: object
4555 properties:
4556 extensions:
4557 type: array
4558 items:
4559 type: string
4560 size:
4561 type: object
4562 properties:
4563 max:
06746a8b 4564 type: integer
3e9e6f2f
RK
4565 file:
4566 type: object
4567 properties:
4568 extensions:
4569 type: array
4570 items:
4571 type: string
2a8ae759
FS
4572 videoCaption:
4573 type: object
4574 properties:
4575 file:
4576 type: object
4577 properties:
4578 size:
4579 type: object
4580 properties:
4581 max:
06746a8b 4582 type: integer
2a8ae759
FS
4583 extensions:
4584 type: array
4585 items:
4586 type: string
4587 user:
4588 type: object
4589 properties:
4590 videoQuota:
06746a8b 4591 type: integer
2a8ae759 4592 videoQuotaDaily:
06746a8b 4593 type: integer
2a8ae759
FS
4594 trending:
4595 type: object
4596 properties:
4597 videos:
4598 type: object
4599 properties:
4600 intervalDays:
06746a8b 4601 type: integer
2a8ae759 4602 tracker:
747b17c7 4603 type: object
2a8ae759
FS
4604 properties:
4605 enabled:
4606 type: boolean
f30736c8
RK
4607 followings:
4608 type: object
4609 properties:
4610 instance:
4611 type: object
4612 properties:
4613 autoFollowIndex:
4614 type: object
4615 properties:
4616 indexUrl:
4617 type: string
84f6e32c 4618 format: url
2a8ae759
FS
4619 ServerConfigAbout:
4620 properties:
4621 instance:
4622 type: object
4623 properties:
4624 name:
4625 type: string
4626 shortDescription:
4627 type: string
4628 description:
4629 type: string
4630 terms:
4631 type: string
4632 ServerConfigCustom:
4633 properties:
4634 instance:
4635 type: object
4636 properties:
4637 name:
4638 type: string
4639 shortDescription:
4640 type: string
4641 description:
4642 type: string
4643 terms:
4644 type: string
4645 defaultClientRoute:
4646 type: string
4647 isNSFW:
4648 type: boolean
4649 defaultNSFWPolicy:
4650 type: string
4651 customizations:
4652 type: object
4653 properties:
4654 javascript:
4655 type: string
4656 css:
4657 type: string
4658 theme:
4659 type: object
4660 properties:
4661 default:
4662 type: string
4663 services:
4664 type: object
4665 properties:
4666 twitter:
4667 type: object
4668 properties:
4669 username:
4670 type: string
4671 whitelisted:
4672 type: boolean
4673 cache:
4674 type: object
4675 properties:
4676 previews:
4677 type: object
4678 properties:
4679 size:
06746a8b 4680 type: integer
2a8ae759
FS
4681 captions:
4682 type: object
4683 properties:
4684 size:
06746a8b 4685 type: integer
2a8ae759
FS
4686 signup:
4687 type: object
4688 properties:
4689 enabled:
4690 type: boolean
4691 limit:
06746a8b 4692 type: integer
2a8ae759
FS
4693 requiresEmailVerification:
4694 type: boolean
4695 admin:
4696 type: object
4697 properties:
4698 email:
4699 type: string
84f6e32c 4700 format: email
2a8ae759
FS
4701 contactForm:
4702 type: object
4703 properties:
4704 enabled:
4705 type: boolean
4706 user:
4707 type: object
4708 properties:
4709 videoQuota:
06746a8b 4710 type: integer
2a8ae759 4711 videoQuotaDaily:
06746a8b 4712 type: integer
2a8ae759
FS
4713 transcoding:
4714 type: object
4715 properties:
4716 enabled:
4717 type: boolean
4718 allowAdditionalExtensions:
4719 type: boolean
4720 allowAudioFiles:
4721 type: boolean
4722 threads:
06746a8b 4723 type: integer
2a8ae759
FS
4724 resolutions:
4725 type: object
4726 properties:
4727 240p:
4728 type: boolean
4729 360p:
4730 type: boolean
4731 480p:
4732 type: boolean
4733 720p:
4734 type: boolean
4735 1080p:
4736 type: boolean
4737 2160p:
4738 type: boolean
4739 hls:
4740 type: object
4741 properties:
4742 enabled:
4743 type: boolean
4744 import:
4745 type: object
4746 properties:
4747 videos:
4748 type: object
4749 properties:
4750 http:
4751 type: object
4752 properties:
4753 enabled:
4754 type: boolean
4755 torrent:
4756 type: object
4757 properties:
4758 enabled:
4759 type: boolean
4760 autoBlacklist:
4761 type: object
4762 properties:
4763 videos:
4764 type: object
4765 properties:
4766 ofUsers:
4767 type: object
4768 properties:
4769 enabled:
4770 type: boolean
4771 followers:
4772 type: object
4773 properties:
4774 instance:
4775 type: object
4776 properties:
4777 enabled:
4778 type: boolean
4779 manualApproval:
4780 type: boolean
3e9e6f2f
RK
4781 Follow:
4782 properties:
4783 id:
06746a8b 4784 type: integer
3e9e6f2f
RK
4785 follower:
4786 $ref: '#/components/schemas/Actor'
4787 following:
4788 $ref: '#/components/schemas/Actor'
4789 score:
4790 type: number
04b703f6 4791 description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
3e9e6f2f
RK
4792 state:
4793 type: string
4794 enum:
4795 - pending
4796 - accepted
4797 createdAt:
4798 type: string
84f6e32c 4799 format: date-time
3e9e6f2f
RK
4800 updatedAt:
4801 type: string
84f6e32c 4802 format: date-time
e3489df9
C
4803
4804 PredefinedAbuseReasons:
4805 description: Reason categories that help triage reports
4806 type: array
4807 items:
4808 type: string
4809 enum:
4810 - violentOrAbusive
4811 - hatefulOrAbusive
4812 - spamOrMisleading
4813 - privacy
4814 - rights
4815 - serverRules
4816 - thumbnails
4817 - captions
4818
3e9e6f2f
RK
4819 Job:
4820 properties:
4821 id:
06746a8b 4822 type: integer
84f6e32c
RK
4823 minimum: 0
4824 example: 42
3e9e6f2f
RK
4825 state:
4826 type: string
4827 enum:
84f6e32c
RK
4828 - active
4829 - completed
4830 - failed
4831 - waiting
4832 - delayed
4833 type:
3e9e6f2f
RK
4834 type: string
4835 enum:
84f6e32c
RK
4836 - activitypub-http-unicast
4837 - activitypub-http-broadcast
4838 - activitypub-http-fetcher
4839 - activitypub-follow
4840 - video-file-import
4841 - video-transcoding
4842 - email
4843 - video-import
4844 - videos-views
4845 - activitypub-refresher
4846 - video-redundancy
4847 data:
4848 type: object
4849 additionalProperties: true
4850 error:
4851 type: object
4852 additionalProperties: true
3e9e6f2f
RK
4853 createdAt:
4854 type: string
84f6e32c
RK
4855 format: date-time
4856 finishedOn:
3e9e6f2f 4857 type: string
84f6e32c
RK
4858 format: date-time
4859 processedOn:
4860 type: string
4861 format: date-time
3e9e6f2f
RK
4862 AddUserResponse:
4863 properties:
2c318664
RK
4864 user:
4865 type: object
4866 properties:
4867 id:
4868 type: integer
4869 example: 8
4870 account:
4871 type: object
4872 properties:
4873 id:
4874 type: integer
4875 example: 37
3e9e6f2f
RK
4876 VideoUploadResponse:
4877 properties:
4878 video:
4879 type: object
4880 properties:
4881 id:
06746a8b 4882 type: integer
84f6e32c 4883 example: 8
3e9e6f2f
RK
4884 uuid:
4885 type: string
84f6e32c
RK
4886 format: uuid
4887 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
3e9e6f2f
RK
4888 CommentThreadResponse:
4889 properties:
4890 total:
06746a8b 4891 type: integer
84f6e32c 4892 example: 1
3e9e6f2f
RK
4893 data:
4894 type: array
84f6e32c 4895 maxItems: 100
3e9e6f2f
RK
4896 items:
4897 $ref: '#/components/schemas/VideoComment'
4898 CommentThreadPostResponse:
4899 properties:
4900 comment:
4901 $ref: '#/components/schemas/VideoComment'
048b6946
C
4902 VideoListResponse:
4903 properties:
4904 total:
06746a8b 4905 type: integer
84f6e32c 4906 example: 1
048b6946
C
4907 data:
4908 type: array
84f6e32c 4909 maxItems: 100
048b6946
C
4910 items:
4911 $ref: '#/components/schemas/Video'
84f6e32c
RK
4912 User:
4913 properties:
4914 id:
4915 type: integer
4916 readOnly: true
4917 username:
4918 type: string
4919 description: The user username
4920 minLength: 1
4921 maxLength: 50
4922 email:
4923 type: string
4924 format: email
4925 description: The user email
4926 theme:
4927 type: string
4928 description: Theme enabled by this user
4929 emailVerified:
4930 type: boolean
4931 description: Has the user confirmed their email address?
4932 nsfwPolicy:
4933 $ref: '#/components/schemas/NSFWPolicy'
4934 webtorrentEnabled:
4935 type: boolean
4936 description: Enable P2P in the player
4937 autoPlayVideo:
4938 type: boolean
4939 description: Automatically start playing the video on the watch page
4940 role:
4941 $ref: '#/components/schemas/UserRole'
4942 roleLabel:
4943 type: string
4944 enum:
4945 - User
4946 - Moderator
4947 - Administrator
4948 videoQuota:
4949 type: integer
4950 description: The user video quota
4951 videoQuotaDaily:
4952 type: integer
4953 description: The user daily video quota
4954 videosCount:
4955 type: integer
4f32032f 4956 abusesCount:
84f6e32c 4957 type: integer
4f32032f 4958 abusesAcceptedCount:
84f6e32c 4959 type: integer
4f32032f 4960 abusesCreatedCount:
84f6e32c
RK
4961 type: integer
4962 videoCommentsCount:
4963 type: integer
4964 noInstanceConfigWarningModal:
4965 type: boolean
4966 noWelcomeModal:
4967 type: boolean
4968 blocked:
4969 type: boolean
4970 blockedReason:
4971 type: string
4972 createdAt:
4973 type: string
4974 account:
4975 $ref: '#/components/schemas/Account'
4976 videoChannels:
4977 type: array
4978 items:
4979 $ref: '#/components/schemas/VideoChannel'
3e9e6f2f
RK
4980 AddUser:
4981 properties:
4982 username:
4983 type: string
84f6e32c 4984 description: The user username
06746a8b
RK
4985 minLength: 1
4986 maxLength: 50
3e9e6f2f
RK
4987 password:
4988 type: string
84f6e32c
RK
4989 format: password
4990 description: The user password. If the smtp server is configured, you can leave empty and an email will be sent
06746a8b
RK
4991 minLength: 6
4992 maxLength: 255
3e9e6f2f
RK
4993 email:
4994 type: string
84f6e32c
RK
4995 format: email
4996 description: The user email
3e9e6f2f 4997 videoQuota:
84f6e32c
RK
4998 type: integer
4999 description: The user video quota
fbe1bc2a 5000 videoQuotaDaily:
84f6e32c
RK
5001 type: integer
5002 description: The user daily video quota
3e9e6f2f 5003 role:
0590bb46 5004 $ref: '#/components/schemas/UserRole'
3e9e6f2f
RK
5005 required:
5006 - username
5007 - password
5008 - email
5009 - videoQuota
fbe1bc2a 5010 - videoQuotaDaily
3e9e6f2f
RK
5011 - role
5012 UpdateUser:
5013 properties:
5014 id:
5015 type: string
84f6e32c 5016 description: The user id
3e9e6f2f
RK
5017 email:
5018 type: string
84f6e32c
RK
5019 format: email
5020 description: The updated email of the user
3e9e6f2f 5021 videoQuota:
84f6e32c
RK
5022 type: integer
5023 description: The updated video quota of the user
fbe1bc2a 5024 videoQuotaDaily:
84f6e32c
RK
5025 type: integer
5026 description: The updated daily video quota of the user
3e9e6f2f 5027 role:
0590bb46 5028 $ref: '#/components/schemas/UserRole'
3e9e6f2f
RK
5029 required:
5030 - id
5031 - email
5032 - videoQuota
fbe1bc2a 5033 - videoQuotaDaily
3e9e6f2f
RK
5034 - role
5035 UpdateMe:
5036 properties:
5037 password:
5038 type: string
84f6e32c
RK
5039 format: password
5040 description: Your new password
5041 minLength: 6
5042 maxLength: 255
3e9e6f2f
RK
5043 email:
5044 type: string
84f6e32c
RK
5045 format: email
5046 description: Your new email
3e9e6f2f
RK
5047 displayNSFW:
5048 type: string
84f6e32c
RK
5049 description: Your new displayNSFW
5050 enum:
5051 - 'true'
5052 - 'false'
5053 - both
3e9e6f2f 5054 autoPlayVideo:
84f6e32c
RK
5055 type: boolean
5056 description: Your new autoPlayVideo
3e9e6f2f
RK
5057 required:
5058 - password
5059 - email
5060 - displayNSFW
5061 - autoPlayVideo
5062 GetMeVideoRating:
5063 properties:
5064 id:
5065 type: string
84f6e32c 5066 description: Id of the video
3e9e6f2f
RK
5067 rating:
5068 type: number
84f6e32c 5069 description: Rating of the video
3e9e6f2f
RK
5070 required:
5071 - id
5072 - rating
c100a614
YB
5073 VideoRating:
5074 properties:
5075 video:
5076 $ref: '#/components/schemas/Video'
5077 rating:
5078 type: number
5079 description: 'Rating of the video'
5080 required:
5081 - video
5082 - rating
3e9e6f2f
RK
5083 RegisterUser:
5084 properties:
5085 username:
5086 type: string
84f6e32c
RK
5087 description: The username of the user
5088 minLength: 1
5089 maxLength: 50
5090 pattern: '/^[a-z0-9._]{1,50}$/'
3e9e6f2f
RK
5091 password:
5092 type: string
84f6e32c
RK
5093 format: password
5094 description: The password of the user
5095 minLength: 6
5096 maxLength: 255
3e9e6f2f
RK
5097 email:
5098 type: string
84f6e32c
RK
5099 format: email
5100 description: The email of the user
1f20622f
C
5101 displayName:
5102 type: string
84f6e32c
RK
5103 description: The user display name
5104 minLength: 1
5105 maxLength: 120
1f20622f
C
5106 channel:
5107 type: object
5108 properties:
5109 name:
5110 type: string
84f6e32c
RK
5111 description: The name for the default channel
5112 pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/'
1f20622f
C
5113 displayName:
5114 type: string
84f6e32c
RK
5115 description: The display name for the default channel
5116 minLength: 1
5117 maxLength: 120
3e9e6f2f
RK
5118 required:
5119 - username
5120 - password
5121 - email
7d14d4d2 5122 VideoChannelCreate:
3e9e6f2f
RK
5123 properties:
5124 name:
5125 type: string
7d14d4d2
C
5126 displayName:
5127 type: string
3e9e6f2f
RK
5128 description:
5129 type: string
7d14d4d2
C
5130 support:
5131 type: string
06746a8b 5132 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
00494d6e 5133 example: Please support my work on <insert crowdfunding plateform>! <3
7d14d4d2
C
5134 required:
5135 - name
5136 - displayName
5137 VideoChannelUpdate:
5138 properties:
5139 displayName:
5140 type: string
5141 description:
5142 type: string
5143 support:
5144 type: string
06746a8b 5145 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
00494d6e 5146 example: Please support my work on <insert crowdfunding plateform>! <3
7d14d4d2
C
5147 bulkVideosSupportUpdate:
5148 type: boolean
06746a8b 5149 description: 'Update the support field for all videos of this channel'
1569a818 5150
06746a8b
RK
5151 MRSSPeerLink:
5152 type: object
5153 xml:
5154 name: 'media:peerLink'
5155 properties:
5156 href:
5157 type: string
5158 xml:
5159 attribute: true
5160 type:
5161 type: string
5162 enum:
5163 - application/x-bittorrent
5164 xml:
5165 attribute: true
5166 MRSSGroupContent:
5167 type: object
5168 xml:
5169 name: 'media:content'
5170 properties:
5171 url:
5172 type: string
84f6e32c 5173 format: url
06746a8b
RK
5174 xml:
5175 attribute: true
5176 fileSize:
5177 type: integer
5178 xml:
5179 attribute: true
5180 type:
5181 type: string
5182 xml:
5183 attribute: true
5184 framerate:
5185 type: integer
5186 xml:
5187 attribute: true
5188 duration:
5189 type: integer
5190 xml:
5191 attribute: true
5192 height:
5193 type: integer
5194 xml:
5195 attribute: true
5196 lang:
5197 type: string
5198 xml:
5199 attribute: true
5200 VideoCommentsForXML:
5201 type: array
5202 xml:
5203 wrapped: true
5204 name: 'channel'
5205 items:
5206 type: object
5207 xml:
5208 name: 'item'
5209 properties:
5210 link:
5211 type: string
84f6e32c 5212 format: url
06746a8b
RK
5213 guid:
5214 type: string
5215 pubDate:
5216 type: string
5217 format: date-time
5218 'content:encoded':
5219 type: string
5220 'dc:creator':
5221 type: string
5222 VideosForXML:
5223 type: array
5224 xml:
5225 wrapped: true
5226 name: 'channel'
5227 items:
5228 type: object
5229 xml:
5230 name: 'item'
5231 properties:
5232 link:
5233 type: string
84f6e32c 5234 format: url
06746a8b
RK
5235 description: video watch page URL
5236 guid:
5237 type: string
5238 description: video canonical URL
5239 pubDate:
5240 type: string
5241 format: date-time
5242 description: video publication date
5243 description:
5244 type: string
5245 description: video description
5246 'content:encoded':
5247 type: string
5248 description: video description
5249 'dc:creator':
5250 type: string
5251 description: publisher user name
5252 'media:category':
5253 type: integer
5254 description: video category (MRSS)
5255 'media:community':
5256 type: object
5257 description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
5258 properties:
5259 'media:statistics':
5260 type: object
5261 properties:
5262 views:
5263 type: integer
5264 xml:
5265 attribute: true
5266 'media:embed':
5267 type: object
5268 properties:
5269 url:
5270 type: string
84f6e32c 5271 format: url
06746a8b
RK
5272 description: video embed path, relative to the canonical URL domain (MRSS)
5273 xml:
5274 attribute: true
5275 'media:player':
5276 type: object
5277 properties:
5278 url:
5279 type: string
84f6e32c 5280 format: url
06746a8b
RK
5281 description: video watch path, relative to the canonical URL domain (MRSS)
5282 xml:
5283 attribute: true
5284 'media:thumbnail':
5285 type: object
5286 properties:
5287 url:
5288 type: string
84f6e32c 5289 format: url
06746a8b
RK
5290 xml:
5291 attribute: true
5292 height:
5293 type: integer
5294 xml:
5295 attribute: true
5296 width:
5297 type: integer
5298 xml:
5299 attribute: true
5300 'media:title':
5301 type: string
5302 description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
5303 'media:description':
5304 type: string
5305 'media:rating':
5306 type: string
5307 enum:
5308 - nonadult
5309 - adult
5310 description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
5311 'enclosure':
5312 type: object
5313 description: main streamable file for the video
5314 properties:
5315 url:
5316 type: string
84f6e32c 5317 format: url
06746a8b
RK
5318 xml:
5319 attribute: true
5320 type:
5321 type: string
5322 enum:
5323 - application/x-bittorrent
5324 xml:
5325 attribute: true
5326 length:
5327 type: integer
5328 xml:
5329 attribute: true
5330 'media:group':
5331 type: array
5332 description: list of streamable files for the video. see [media:peerLink](https://www.rssboard.org/media-rss#media-peerlink) and [media:content](https://www.rssboard.org/media-rss#media-content) or (MRSS)
5333 items:
5334 anyOf:
5335 - $ref: '#/components/schemas/MRSSPeerLink'
f4d59981
RK
5336 - $ref: '#/components/schemas/MRSSGroupContent'
5337 NotificationSettingValue:
5338 type: integer
5339 description: >
5340 Notification type
84f6e32c 5341
f4d59981 5342 - `0` NONE
84f6e32c 5343
f4d59981 5344 - `1` WEB
84f6e32c 5345
f4d59981
RK
5346 - `2` EMAIL
5347 enum:
5348 - 0
5349 - 1
5350 - 3
5351 Notification:
5352 properties:
5353 id:
5354 type: integer
5355 type:
5356 type: integer
5357 description: >
5358 Notification type, following the `UserNotificationType` enum:
84f6e32c 5359
f4d59981 5360 - `1` NEW_VIDEO_FROM_SUBSCRIPTION
84f6e32c 5361
f4d59981 5362 - `2` NEW_COMMENT_ON_MY_VIDEO
84f6e32c 5363
310b5219 5364 - `3` NEW_ABUSE_FOR_MODERATORS
84f6e32c 5365
f4d59981 5366 - `4` BLACKLIST_ON_MY_VIDEO
84f6e32c 5367
f4d59981 5368 - `5` UNBLACKLIST_ON_MY_VIDEO
84f6e32c 5369
f4d59981 5370 - `6` MY_VIDEO_PUBLISHED
84f6e32c 5371
f4d59981 5372 - `7` MY_VIDEO_IMPORT_SUCCESS
84f6e32c 5373
f4d59981 5374 - `8` MY_VIDEO_IMPORT_ERROR
84f6e32c 5375
f4d59981 5376 - `9` NEW_USER_REGISTRATION
84f6e32c 5377
f4d59981 5378 - `10` NEW_FOLLOW
84f6e32c 5379
f4d59981 5380 - `11` COMMENT_MENTION
84f6e32c 5381
f4d59981 5382 - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
84f6e32c 5383
f4d59981 5384 - `13` NEW_INSTANCE_FOLLOWER
84f6e32c 5385
f4d59981
RK
5386 - `14` AUTO_INSTANCE_FOLLOWING
5387 read:
5388 type: boolean
5389 video:
5390 nullable: true
5391 allOf:
5392 - $ref: '#/components/schemas/VideoInfo'
5393 - type: object
5394 properties:
5395 channel:
5396 $ref: '#/components/schemas/ActorInfo'
5397 videoImport:
5398 nullable: true
5399 type: object
5400 properties:
5401 id:
5402 type: integer
5403 video:
5404 nullable: true
5405 $ref: '#/components/schemas/VideoInfo'
5406 torrentName:
5407 type: string
5408 nullable: true
5409 magnetUri:
5410 type: string
84f6e32c 5411 format: uri
f4d59981
RK
5412 nullable: true
5413 targetUri:
5414 type: string
84f6e32c 5415 format: uri
f4d59981
RK
5416 nullable: true
5417 comment:
5418 nullable: true
5419 type: object
5420 properties:
5421 id:
5422 type: integer
5423 threadId:
5424 type: integer
5425 video:
5426 $ref: '#/components/schemas/VideoInfo'
5427 account:
5428 $ref: '#/components/schemas/ActorInfo'
5429 videoAbuse:
5430 nullable: true
5431 type: object
5432 properties:
5433 id:
5434 type: integer
5435 video:
5436 allOf:
5437 - $ref: '#/components/schemas/VideoInfo'
5438 videoBlacklist:
5439 nullable: true
5440 type: object
5441 properties:
5442 id:
5443 type: integer
5444 video:
5445 allOf:
5446 - $ref: '#/components/schemas/VideoInfo'
5447 account:
5448 nullable: true
5449 allOf:
5450 - $ref: '#/components/schemas/ActorInfo'
5451 actorFollow:
5452 type: object
5453 nullable: true
5454 properties:
5455 id:
5456 type: integer
5457 follower:
5458 $ref: '#/components/schemas/ActorInfo'
5459 state:
5460 type: string
5461 enum:
5462 - pending
5463 - accepted
5464 following:
5465 type: object
5466 properties:
5467 type:
5468 type: string
5469 enum:
5470 - account
5471 - channel
5472 - instance
5473 name:
5474 type: string
5475 displayName:
5476 type: string
5477 host:
5478 type: string
84f6e32c 5479 format: hostname
f4d59981
RK
5480 createdAt:
5481 type: string
5482 format: date-time
5483 updatedAt:
5484 type: string
5485 format: date-time
5486 NotificationListResponse:
5487 properties:
5488 total:
5489 type: integer
84f6e32c 5490 example: 1
f4d59981
RK
5491 data:
5492 type: array
84f6e32c 5493 maxItems: 100
f4d59981 5494 items:
7461d440
RK
5495 $ref: '#/components/schemas/Notification'
5496 Plugin:
5497 properties:
5498 name:
5499 type: string
84f6e32c 5500 example: peertube-plugin-auth-ldap
7461d440
RK
5501 type:
5502 type: integer
84f6e32c
RK
5503 description: >
5504 - `1`: PLUGIN
5505
5506 - `2`: THEME
7461d440
RK
5507 enum:
5508 - 1
5509 - 2
5510 latestVersion:
5511 type: string
84f6e32c 5512 example: 0.0.3
7461d440
RK
5513 version:
5514 type: string
84f6e32c 5515 example: 0.0.1
7461d440
RK
5516 enabled:
5517 type: boolean
5518 uninstalled:
5519 type: boolean
5520 peertubeEngine:
5521 type: string
84f6e32c 5522 example: 2.2.0
7461d440
RK
5523 description:
5524 type: string
5525 homepage:
5526 type: string
84f6e32c
RK
5527 format: url
5528 example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap
7461d440
RK
5529 settings:
5530 type: object
5531 additionalProperties: true
5532 createdAt:
5533 type: string
5534 format: date-time
5535 updatedAt:
5536 type: string
5537 format: date-time
5538 PluginResponse:
5539 properties:
5540 total:
5541 type: integer
84f6e32c 5542 example: 1
7461d440
RK
5543 data:
5544 type: array
84f6e32c 5545 maxItems: 100
7461d440 5546 items:
2c318664 5547 $ref: '#/components/schemas/Plugin'
4e239e35
C
5548
5549 LiveVideoUpdate:
5550 properties:
5551 saveReplay:
5552 type: boolean
5553
5554 LiveVideoResponse:
5555 properties:
5556 rtmpUrl:
5557 type: string
5558 streamKey:
5559 type: string
5560 description: RTMP stream key to use to stream into this live video
5561 saveReplay:
5562 type: boolean
5563
2c318664
RK
5564 callbacks:
5565 searchIndex:
c00f96ce 5566 'https://search.example.org/api/v1/search/videos':
2c318664
RK
5567 post:
5568 summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`
5569 responses:
5570 '200':
5571 description: successful operation
5572 content:
5573 application/json:
5574 schema:
1e904cde 5575 $ref: '#/components/schemas/VideoListResponse'