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